PageSourceSearch

https://www.mountainsgeek.com/main-4Q24EJBC.js

js mountainsgeek.com collected 2026-10-03 00:56:33 UTC 2,002,129 bytes, 1,336 lines download raw bytes

1var I4=Object.create;var pC=Object.defineProperty,D4=Object.defineProperties,M4=Object.getOwnPropertyDescriptor,k4=Object.getOwnPropertyDescriptors,A4=Object.getOwnPropertyNames,Gv=Object.getOwnPropertySymbols,P4=Object.getPrototypeOf,fC=Object.prototype.hasOwnProperty,w2=Object.prototype.propertyIsEnumerable;var x2=(i,e,r)=>e in i?pC(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,bt=(i,e)=>{for(var r in e||={})fC.call(e,r)&&x2(i,r,e[r]);if(Gv)for(var r of Gv(e))w2.call(e,r)&&x2(i,r,e[r]);return i},en=(i,e)=>D4(i,k4(e));var C2=(i,e)=>{var r={};for(var t in i)fC.call(i,t)&&e.indexOf(t)<0&&(r[t]=i[t]);if(i!=null&&Gv)for(var t of Gv(i))e.indexOf(t)<0&&w2.call(i,t)&&(r[t]=i[t]);return r};var O4=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var R4=(i,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of A4(e))!fC.call(i,o)&&o!==r&&pC(i,o,{get:()=>e[o],enumerable:!(t=M4(e,o))||t.enumerable});return i};var mC=(i,e,r)=>(r=i!=null?I4(P4(i)):{},R4(e||!i||!i.__esModule?pC(r,"default",{value:i,enumerable:!0}):r,i));var dp=(i,e,r)=>new Promise((t,o)=>{var n=C=>{try{_(r.next(C))}catch(M){o(M)}},d=C=>{try{_(r.throw(C))}catch(M){o(M)}},_=C=>C.done?t(C.value):Promise.resolve(C.value).then(n,d);_((r=r.apply(i,e)).next())});var zx=O4((SI,TI)=>{"use strict";(function(i,e){typeof SI=="object"&&typeof TI<"u"?TI.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.mapboxgl=e())})(SI,function(){"use strict";var i,e,r;function t(n,d){if(!i)i=d;else if(!e)e=d;else{var _="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 = {}; ("+i+")(sharedChunk); ("+e+")(sharedChunk); self.onerror = null;",C={};i(C),r=d(C),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(r.workerUrl=window.URL.createObjectURL(new Blob([_],{type:"text/javascript"})))}}t(["exports"],function(n){"use strict";var d=typeof self<"u"?self:{},_="2.15.0";let C,M={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(C==null){let a=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{C=process.env.API_URL_REGEX!=null?new RegExp(process.env.API_URL_REGEX):a}catch{C=a}}return C},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(!M.API_URL)return null;try{let a=new URL(M.API_URL);return a.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":a.hostname==="api.mapbox.com"?"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},j={supported:!1,testSupport:function(a){!_e&&ie&&(Ee?Ye(a):G=a)}},G,ie,_e=!1,Ee=!1;function Ye(a){let s=a.createTexture();a.bindTexture(a.TEXTURE_2D,s);try{if(a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,ie),a.isContextLost())return;j.supported=!0}
1catch{}a.deleteTexture(s),_e=!0}d.document&&(ie=d.document.createElement("img"),ie.onload=function(){G&&Ye(G),G=null,Ee=!0},ie.onerror=function(){_e=!0,G=null},ie.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");let $e="01";function at(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Lt=jt;function jt(a,s,l,u){this.cx=3*a,this.bx=3*(l-a)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(u-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=s,this.p2x=l,this.p2y=u}jt.prototype={sampleCurveX:function(a){return((this.ax*a+this.bx)*a+this.cx)*a},sampleCurveY:function(a){return((this.ay*a+this.by)*a+this.cy)*a},sampleCurveDerivativeX:function(a){return(3*this.ax*a+2*this.bx)*a+this.cx},solveCurveX:function(a,s){if(s===void 0&&(s=1e-6),a<0)return 0;if(a>1)return 1;for(var l=a,u=0;u<8;u++){var p=this.sampleCurveX(l)-a;if(Math.abs(p)<s)return l;var m=this.sampleCurveDerivativeX(l);if(Math.abs(m)<1e-6)break;l-=p/m}var v=0,b=1;for(l=a,u=0;u<20&&(p=this.sampleCurveX(l),!(Math.abs(p-a)<s));u++)a>p?v=l:b=l,l=.5*(b-v)+v;return l},solve:function(a,s){return this.sampleCurveY(this.solveCurveX(a,s))}};var $t=at(Lt),tn=Fi;function Fi(a,s){this.x=a,this.y=s}Fi.prototype={clone:function(){return new Fi(this.x,this.y)},add:function(a){return this.clone()._add(a)},sub:function(a){return this.clone()._sub(a)},multByPoint:function(a){return this.clone()._multByPoint(a)},divByPoint:function(a){return this.clone()._divByPoint(a)},mult:function(a){return this.clone()._mult(a)},div:function(a){return this.clone()._div(a)},rotate:function(a){return this.clone()._rotate(a)},rotateAround:function(a,s){return this.clone()._rotateAround(a,s)},matMult:function(a){return this.clone()._matMult(a)},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(a){return this.x===a.x&&this.y===a.y},dist:function(a){return Math.sqrt(this.distSqr(a))},distSqr:function(a){var s=a.x-this.x,l=a.y-this.y;return s*s+l*l},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(a){return Math.atan2(this.y-a.y,this.x-a.x)},angleWith:function(a){return this.angleWithSep(a.x,a.y)},angleWithSep:function(a,s){return Math.atan2(this.x*s-this.y*a,this.x*a+this.y*s)},_matMult:function(a){var s=a[2]*this.x+a[3]*this.y;return this.x=a[0]*this.x+a[1]*this.y,this.y=s,this},_add:function(a){return this.x+=a.x,this.y+=a.y,this},_sub:function(a){return this.x-=a.x,this.y-=a.y,this},_mult:function(a){return this.x*=a,this.y*=a,this},_div:function(a){return this.x/=a,this.y/=a,this},_multByPoint:function(a){return this.x*=a.x,this.y*=a.y,this},_divByPoint:function(a){return this.x/=a.x,this.y/=a.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var a=this.y;return this.y=this.x,this.x=-a,this},_rotate:function(a){var s=Math.cos(a),l=Math.sin(a),u=l*this.x+s*this.y;return this.x=s*this.x-l*this.y,this.y=u,this},_rotateAround:function(a,s){var l=Math.cos(a),u=Math.sin(a),p=s.y+u*(this.x-s.x)+l*(this.y-s.y);return this.x=s.x+l*(this.x-s.x)-u*(this.y-s.y),this.y=p,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Fi.convert=function(a){return a instanceof Fi?a:Array.isArray(a)?new Fi(a[0],a[1]):a};var tt=at(tn);let Sr=Math.PI/180,so=180/Math.PI;function ai(a){return a*Sr}function sr(a){return a*so}let na=[[0,0],[1,0],[1,1],[0,1]];function jo(a){if(a<=0)return 0;if(a>=1)return 1;let s=a*a,l=s*a;return 4*(a<.5?l:3*(a-s)+l-.75)}function Fa(a,s,l,u){let p=new $t(a,s,l,u);return function(m){return p.solve(m)}}let Tl=Fa(.25,.1,.25,1);function pt(a,s,l){return Math.min(l,Math.max(s,a))}function Zt(a,s,l){return(l=pt((l-a)/(s-a),0,1))*l*(3-2*l)}function Ft(a,s,l){let u=l-s,p=((a-s)%u+u)%u+s;return p===s?l:p}function ri(a,s,l){if(!a.length)return l(null,[]);let u=a.length,p=new Array(a.length),m=null;a.forEach((v,b)=>{s(v,(w,T)=>{w&&(m=w),p[b]=T,--u==0&&l(m,p)})})}function Pn(a){let s=[];for(let l in a)s.push(a[l]);return s}function cn(a,...s){for(let l of s)for(let u in l)a[u]=l[u];return a}let ir=1;function ao(){return ir++}function un(){return function a(s){return s?(s^Math.random()*(16>>s/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,a)}()}function Vo(a){return a<=1?1:Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))}function fc(a){return!!a&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(a)}function Zn(a,s){a.forEach(l=>{s[l]&&(s[l]=s[l].bind(s))})}function fo(a,s){return a.indexOf(s,a.length-s.length)!==-1}function ii(a,s,l){let u={};for(let p in a)u[p]=s.call(l||this,a[p],p,a);return u}function as(a,s,l){let u={};for(let p in a)s.call(l||this,a[p],p,a)&&(u[p]=a[p]);return u}function zr(a){return Array.isArray(a)?a.map(zr):typeof a=="object"&&a?ii(a,zr):a}let Pu={};function Un(a){Pu[a]||(typeof console<"u"&&console.warn(a),Pu[a]=!0)}function Bo(a,s,l){return(l.y-a.y)*(s.x-a.x)>(s.y-a.y)*(l.x-a.x)}function uh(a){let s=0;for(let l,u,p=0,m=a.length,v=m-1;p<m;v=p++)l=a[p],u=a[v],s+=(u.x-l.x)*(l.y+u.y);return s}function ra(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function To(a){let s={};if(a.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(l,u,p,m)=>{let v=p||m;return s[u]=!v||v.toLowerCase(),""}),s["max-age"]){let l=parseInt(s["max-age"],10);isNaN(l)?delete s["max-age"]:s["max-age"]=l}return s}let Ou=null;function mc(a){if(Ou==null){let s=a.navigator?a.navigator.userAgent:null;Ou=!!a.safari||!(!s||!(/\b(iPad|iPhone|iPod)\b/.test(s)||s.match("Safari")&&!s.match("Chrome")))}return Ou}function Ru(a){try{let s=d[a];return s.setItem("_mapbox_test_",1),s.removeItem("_mapbox_test_"),!0}catch{return!1}}function Na(a,s){return[a[4*s],a[4*s+1],a[4*s+2],a[4*s+3]]}let gc="mapbox-tiles",dh=500,hh=50,Uo,za;function Lu(){try{return d.caches}catch{}}function Il(){Lu()&&!Uo&&(Uo=d.caches.open(gc))}function _c(a){let s=a.indexOf("?");if(s<0)return a;let l=function(p){let m=p.indexOf("?");return m>0?p.slice(m+1).split("&"):[]}(a),u=l.filter(p=>{let m=p.split("=");return m[0]==="language"||m[0]==="worldview"});return u.length?`${a.slice(0,s)}?${u.join("&")}`:a.slice(0,s)}let Fu=1/0,Dl={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Dl);
1class ja extends Error{constructor(s,l,u){l===401&&ke(u)&&(s+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(s),this.status=l,this.url=u}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}let Ml=ra()?()=>self.worker&&self.worker.referrer:()=>(d.location.protocol==="blob:"?d.parent:d).location.href,kl=function(a,s){if(!(/^file:/.test(l=a.url)||/^file:/.test(Ml())&&!/^\w+:/.test(l))){if(d.fetch&&d.Request&&d.AbortController&&d.Request.prototype.hasOwnProperty("signal"))return function(u,p){let m=new d.AbortController,v=new d.Request(u.url,{method:u.method||"GET",body:u.body,credentials:u.credentials,headers:u.headers,referrer:Ml(),referrerPolicy:u.referrerPolicy,signal:m.signal}),b=!1,w=!1,T=(k=v.url).indexOf("sku=")>0&&ke(k);var k;u.type==="json"&&v.headers.set("Accept","application/json");let R=(V,B,$)=>{if(w)return;if(V&&V.message!=="SecurityError"&&Un(V.toString()),B&&$)return L(B);let Y=Date.now();d.fetch(v).then(re=>{if(re.ok){let fe=T?re.clone():null;return L(re,fe,Y)}return p(new ja(re.statusText,re.status,u.url))}).catch(re=>{re.name!=="AbortError"&&p(new Error(`${re.message} ${u.url}`))})},L=(V,B,$)=>{(u.type==="arrayBuffer"?V.arrayBuffer():u.type==="json"?V.json():V.text()).then(Y=>{w||(B&&$&&function(re,fe,oe){if(Il(),!Uo)return;let he={status:fe.status,statusText:fe.statusText,headers:new d.Headers};fe.headers.forEach((Le,Pe)=>he.headers.set(Pe,Le));let ge=To(fe.headers.get("Cache-Control")||"");if(ge["no-store"])return;ge["max-age"]&&he.headers.set("Expires",new Date(oe+1e3*ge["max-age"]).toUTCString());let me=he.headers.get("Expires");me&&(new Date(me).getTime()-oe<42e4||function(Le,Pe){if(za===void 0)try{new Response(new ReadableStream),za=!0}catch{za=!1}za?Pe(Le.body):Le.blob().then(Pe)}(fe,Le=>{let Pe=new d.Response(Le,he);Il(),Uo&&Uo.then(He=>He.put(_c(re.url),Pe)).catch(He=>Un(He.message))}))}(v,B,$),b=!0,p(null,Y,V.headers.get("Cache-Control"),V.headers.get("Expires")))}).catch(Y=>{w||p(new Error(Y.message))})};return T?function(V,B){if(Il(),!Uo)return B(null);let $=_c(V.url);Uo.then(Y=>{Y.match($).then(re=>{let fe=function(oe){if(!oe)return!1;let he=new Date(oe.headers.get("Expires")||0),ge=To(oe.headers.get("Cache-Control")||"");return he>Date.now()&&!ge["no-cache"]}(re);Y.delete($),fe&&Y.put($,re.clone()),B(null,re,fe)}).catch(B)}).catch(B)}(v,R):R(null,null),{cancel:()=>{w=!0,b||m.abort()}}}(a,s);if(ra()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",a,s,void 0,!0)}var l;return function(u,p){let m=new d.XMLHttpRequest;m.open(u.method||"GET",u.url,!0),u.type==="arrayBuffer"&&(m.responseType="arraybuffer");for(let v in u.headers)m.setRequestHeader(v,u.headers[v]);return u.type==="json"&&(m.responseType="text",m.setRequestHeader("Accept","application/json")),m.withCredentials=u.credentials==="include",m.onerror=()=>{p(new Error(m.statusText))},m.onload=()=>{if((m.status>=200&&m.status<300||m.status===0)&&m.response!==null){let v=m.response;if(u.type==="json")try{v=JSON.parse(m.response)}catch(b){return p(b)}p(null,v,m.getResponseHeader("Cache-Control"),m.getResponseHeader("Expires"))}else p(new ja(m.statusText,m.status,u.url))},m.send(u.body),{cancel:()=>m.abort()}}(a,s)},vc=function(a,s){return kl(cn(a,{type:"arrayBuffer"}),s)};function ph(a){let s=d.document.createElement("a");return s.href=a,s.protocol===d.document.location.protocol&&s.host===d.document.location.host}let pe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",W,K;W=[],K=0;let de=function(a,s){if(j.supported&&(a.headers||(a.headers={}),a.headers.accept="image/webp,*/*"),K>=M.MAX_PARALLEL_IMAGE_REQUESTS){let m={requestParameters:a,callback:s,cancelled:!1,cancel(){this.cancelled=!0}};return W.push(m),m}K++;let l=!1,u=()=>{if(!l)for(l=!0,K--;W.length&&K<M.MAX_PARALLEL_IMAGE_REQUESTS;){let m=W.shift(),{requestParameters:v,callback:b,cancelled:w}=m;w||(m.cancel=de(v,b).cancel)}},p=vc(a,(m,v,b,w)=>{u(),m?s(m):v&&(d.createImageBitmap?function(T,k){let R=new d.Blob([new Uint8Array(T)],{type:"image/png"});d.createImageBitmap(R).then(L=>
1{k(null,L)}).catch(L=>{k(new Error(`Could not load image because of ${L.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(v,(T,k)=>s(T,k,b,w)):function(T,k){let R=new d.Image,L=d.URL;R.onload=()=>{k(null,R),L.revokeObjectURL(R.src),R.onload=null,d.requestAnimationFrame(()=>{R.src=pe})},R.onerror=()=>k(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."));let V=new d.Blob([new Uint8Array(T)],{type:"image/png"});R.src=T.byteLength?L.createObjectURL(V):pe}(v,(T,k)=>s(T,k,b,w)))});return{cancel:()=>{p.cancel(),u()}}},ve="NO_ACCESS_TOKEN";function Ce(a){return a.indexOf("mapbox:")===0}function ke(a){return M.API_URL_REGEX.test(a)}function Me(a){return M.API_CDN_URL_REGEX.test(a)}function we(a){return M.API_STYLE_REGEX.test(a)&&!je(a)}function je(a){return M.API_SPRITE_REGEX.test(a)}let ft=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function vt(a){let s=a.match(ft);if(!s)throw new Error("Unable to parse URL object");return{protocol:s[1],authority:s[2],path:s[3]||"/",params:s[4]?s[4].split("&"):[]}}function ut(a){let s=a.params.length?`?${a.params.join("&")}`:"";return`${a.protocol}://${a.authority}${a.path}${s}`}let hi="mapbox.eventData";function xi(a){if(!a)return null;let s=a.split(".");if(!s||s.length!==3)return null;try{return JSON.parse(decodeURIComponent(d.atob(s[1]).split("").map(l=>"%"+("00"+l.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch{return null}}class pi{constructor(s){this.type=s,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(s){let l=xi(M.ACCESS_TOKEN),u="";return u=l&&l.u?d.btoa(encodeURIComponent(l.u).replace(/%([0-9A-F]{2})/g,(p,m)=>String.fromCharCode(+("0x"+m)))):M.ACCESS_TOKEN||"",s?`${hi}.${s}:${u}`:`${hi}:${u}`}fetchEventData(){let s=Ru("localStorage"),l=this.getStorageKey(),u=this.getStorageKey("uuid");if(s)try{let p=d.localStorage.getItem(l);p&&(this.eventData=JSON.parse(p));let m=d.localStorage.getItem(u);m&&(this.anonId=m)}catch{Un("Unable to read from LocalStorage")}}saveEventData(){let s=Ru("localStorage"),l=this.getStorageKey(),u=this.getStorageKey("uuid");if(s)try{d.localStorage.setItem(u,this.anonId),Object.keys(this.eventData).length>=1&&d.localStorage.setItem(l,JSON.stringify(this.eventData))}catch{Un("Unable to write to LocalStorage")}}processRequests(s){}postEvent(s,l,u,p){if(!M.EVENTS_URL)return;let m=vt(M.EVENTS_URL);m.params.push(`access_token=${p||M.ACCESS_TOKEN||""}`);let v={event:this.type,created:new Date(s).toISOString()},b=l?cn(v,l):v,w={url:ut(m),headers:{"Content-Type":"text/plain"},body:JSON.stringify([b])};this.pendingRequest=function(T,k){return kl(cn(T,{method:"POST"}),k)}(w,T=>{this.pendingRequest=null,u(T),this.saveEventData(),this.processRequests(p)})}queueRequest(s,l){this.queue.push(s),this.processRequests(l)}}let wi=new class extends pi{constructor(a){super("appUserTurnstile"),this._customAccessToken=a}postTurnstileEvent(a,s){M.EVENTS_URL&&M.ACCESS_TOKEN&&Array.isArray(a)&&a.some(l=>Ce(l)||ke(l))&&this.queueRequest(Date.now(),s)}processRequests(a){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();let s=xi(M.ACCESS_TOKEN),l=s?s.u:M.ACCESS_TOKEN,u=l!==this.eventData.tokenU;fc(this.anonId)||(this.anonId=un(),u=!0);let p=this.queue.shift();if(this.eventData.lastSuccess){let m=new Date(this.eventData.lastSuccess),v=new Date(p),b=(p-this.eventData.lastSuccess)/864e5;u=u||b>=1||b<-1||m.getDate()!==v.getDate()}else u=!0;u?this.postEvent(p,{sdkIdentifier:"mapbox-gl-js",sdkVersion:_,skuId:$e,"enabled.telemetry":!1,userId:this.anonId},m=>{m||(this.eventData.lastSuccess=p,this.eventData.tokenU=l)},a):this.processRequests()}},Ni=wi.postTurnstileEvent.bind(wi),Hn=new class extends pi{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(a,s,l,u){this.skuToken=s,this.errorCb=u,M.EVENTS_URL&&(l||M.ACCESS_TOKEN?this.queueRequest({id:a,timestamp:Date.now()},l):this.errorCb(new Error(ve)))}processRequests(a){if(this.pendingRequest||this.queue.length===0)return;let{id:s,timestamp:l}=this.queue.shift();s&&this.success[s]||(this.anonId||this.fetchEventData(),fc(this.anonId)||(this.anonId=un()),this.postEvent(l,{sdkIdentifier:"mapbox-gl-js",sdkVersion:_,skuId:$e,skuToken:this.skuToken,userId:this.anonId},u=>{u?this.errorCb(u):s&&(this.success[s]=!0)},a))}}
1,ar=Hn.postMapLoadEvent.bind(Hn),Zr=new class extends pi{constructor(){super("gljs.performance")}postPerformanceEvent(a,s){M.EVENTS_URL&&(a||M.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:s},a)}processRequests(a){if(this.pendingRequest||this.queue.length===0)return;let{timestamp:s,performanceData:l}=this.queue.shift(),u=function(p){let m=d.performance.getEntriesByType("resource"),v=d.performance.getEntriesByType("mark"),b=function(L){let V={};if(L){for(let B in L)if(B!=="other")for(let $ of L[B]){let Y=`${B}ResolveRangeMin`,re=`${B}ResolveRangeMax`,fe=`${B}RequestCount`,oe=`${B}RequestCachedCount`;V[Y]=Math.min(V[Y]||1/0,$.startTime),V[re]=Math.max(V[re]||-1/0,$.responseEnd);let he=ge=>{V[ge]===void 0&&(V[ge]=0),++V[ge]};$.transferSize!==void 0&&$.transferSize===0&&he(oe),he(fe)}}return V}(function(L,V){let B={};if(L)for(let $ of L){let Y=V($);B[Y]===void 0&&(B[Y]=[]),B[Y].push($)}return B}(m,b0)),w=d.devicePixelRatio,T=d.navigator.connection||d.navigator.mozConnection||d.navigator.webkitConnection,k={counters:[],metadata:[],attributes:[]},R=(L,V,B)=>{B!=null&&L.push({name:V,value:B.toString()})};for(let L in b)R(k.counters,L,b[L]);if(p.interactionRange[0]!==1/0&&p.interactionRange[1]!==-1/0&&(R(k.counters,"interactionRangeMin",p.interactionRange[0]),R(k.counters,"interactionRangeMax",p.interactionRange[1])),v)for(let L of Object.keys(yc)){let V=yc[L],B=v.find($=>$.name===V);B&&R(k.counters,V,B.startTime)}return R(k.counters,"visibilityHidden",p.visibilityHidden),R(k.attributes,"style",function(L){if(L)for(let V of L){let B=V.name.split("?")[0];if(we(B)){let $=B.split("/").slice(-2);if($.length===2)return`mapbox://styles/${$[0]}/${$[1]}`}}}(m)),R(k.attributes,"terrainEnabled",p.terrainEnabled?"true":"false"),R(k.attributes,"fogEnabled",p.fogEnabled?"true":"false"),R(k.attributes,"projection",p.projection),R(k.attributes,"zoom",p.zoom),R(k.metadata,"devicePixelRatio",w),R(k.metadata,"connectionEffectiveType",T?T.effectiveType:void 0),R(k.metadata,"navigatorUserAgent",d.navigator.userAgent),R(k.metadata,"screenWidth",d.screen.width),R(k.metadata,"screenHeight",d.screen.height),R(k.metadata,"windowWidth",d.innerWidth),R(k.metadata,"windowHeight",d.innerHeight),R(k.metadata,"mapWidth",p.width/w),R(k.metadata,"mapHeight",p.height/w),R(k.metadata,"webglRenderer",p.renderer),R(k.metadata,"webglVendor",p.vendor),R(k.metadata,"sdkVersion",_),R(k.metadata,"sdkIdentifier","mapbox-gl-js"),k}(l);for(let p of u.metadata);for(let p of u.counters);for(let p of u.attributes);this.postEvent(s,u,()=>{},a)}},yr=Zr.postPerformanceEvent.bind(Zr),Ms=new class extends pi{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(a,s,l,u){if(!M.API_URL||!M.SESSION_PATH)return;let p=vt(M.API_URL+M.SESSION_PATH);p.params.push(`sku=${s||""}`),p.params.push(`access_token=${u||M.ACCESS_TOKEN||""}`);let m={url:ut(p),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(v,b){return kl(cn(v,{method:"GET"}),b)}(m,v=>{this.pendingRequest=null,l(v),this.saveEventData(),this.processRequests(u)})}getSessionAPI(a,s,l,u){this.skuToken=s,this.errorCb=u,M.SESSION_PATH&&M.API_URL&&(l||M.ACCESS_TOKEN?this.queueRequest({id:a,timestamp:Date.now()},l):this.errorCb(new Error(ve)))}processRequests(a){if(this.pendingRequest||this.queue.length===0)return;let{id:s,timestamp:l}=this.queue.shift();s&&this.success[s]||this.getSession(l,this.skuToken,u=>{u?this.errorCb(u):s&&(this.success[s]=!0)},a)}},Tr=Ms.getSessionAPI.bind(Ms),lo=new Set,yc={create:"create",load:"load",fullLoad:"fullLoad"},R1={mark(a){d.performance.mark(a)},measure(a,s,l){d.performance.measure(a,s,l)}};function b0(a){let s=a.name.split("?")[0];return Me(s)&&s.includes("mapbox-gl.js")?"javascript":Me(s)&&s.includes("mapbox-gl.css")?"css":function(l){return M.API_FONTS_REGEX.test(l)}(s)?"fontRange":je(s)?"sprite":we(s)?"style":function(l){return M.API_TILEJSON_REGEX.test(l)}(s)?"tilejson":"other"}let nn=d.performance;function Zf(a){let s=a?a.url.toString():void 0;return nn.getEntriesByName(s)}let Nu,Kf,fh,ks,oa={now:()=>fh!==void 0?fh:d.performance.now(),setNow(a){fh=a},restoreNow(){fh=void 0},frame(a){let s=d.requestAnimationFrame(a);return{cancel:()=>d.cancelAnimationFrame(s)}},getImageData(a,s=0){let{width:l,height:u}=a;ks||(ks=d.document.createElement("canvas"));let p=ks.getContext("2d",{willReadFrequently:!0});if(!p)throw new Error("failed to create canvas 2d context");return(l>ks.width||u>ks.height)&&(ks.width=l,ks.height=u),p.clearRect(-s,-s,l+2*s,u+2*s),p.drawImage(a,0,0,l,u),p.getImageData(-s,-s,l+2*s,u+2*s)},resolveURL:a=>(Nu||(Nu=d.document.createElement("a")),Nu.href=a,Nu.href),get devicePixelRatio(){return d.devicePixelRatio},get prefersReducedMotion(){return!!d.matchMedia&&(Kf==null&&(Kf=d.matchMedia("(prefers-reduced-motion: reduce)")),Kf.matches)}};
1function Xf(a,s,l){l[a]&&l[a].indexOf(s)!==-1||(l[a]=l[a]||[],l[a].push(s))}function Yf(a,s,l){if(l&&l[a]){let u=l[a].indexOf(s);u!==-1&&l[a].splice(u,1)}}class Al{constructor(s,l={}){cn(this,l),this.type=s}}class sa extends Al{constructor(s,l={}){super("error",cn({error:s},l))}}class zu{on(s,l){return this._listeners=this._listeners||{},Xf(s,l,this._listeners),this}off(s,l){return Yf(s,l,this._listeners),Yf(s,l,this._oneTimeListeners),this}once(s,l){return l?(this._oneTimeListeners=this._oneTimeListeners||{},Xf(s,l,this._oneTimeListeners),this):new Promise(u=>this.once(s,u))}fire(s,l){typeof s=="string"&&(s=new Al(s,l||{}));let u=s.type;if(this.listens(u)){s.target=this;let p=this._listeners&&this._listeners[u]?this._listeners[u].slice():[];for(let b of p)b.call(this,s);let m=this._oneTimeListeners&&this._oneTimeListeners[u]?this._oneTimeListeners[u].slice():[];for(let b of m)Yf(u,b,this._oneTimeListeners),b.call(this,s);let v=this._eventedParent;v&&(cn(s,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),v.fire(s))}else s instanceof sa&&console.error(s.error);return this}listens(s){return!!(this._listeners&&this._listeners[s]&&this._listeners[s].length>0||this._oneTimeListeners&&this._oneTimeListeners[s]&&this._oneTimeListeners[s].length>0||this._eventedParent&&this._eventedParent.listens(s))}setEventedParent(s,l){return this._eventedParent=s,this._eventedParentData=l,this}}var Ue=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}
1,"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
vendor: 16,128 bytes, line 1
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":
vendor: 3,928 bytes, line 1
1false,"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"}
1,"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 aa(a,...s){for(let l of s)for(let u in l)a[u]=l[u];return a}function lr(a){return a instanceof Number||a instanceof String||a instanceof Boolean?a.valueOf():a}function Ir(a){if(Array.isArray(a))return a.map(Ir);if(a instanceof Object&&!(a instanceof Number||a instanceof String||a instanceof Boolean)){let s={};for(let l in a)s[l]=Ir(a[l]);return s}return lr(a)}
1class x0 extends Error{constructor(s,l){super(l),this.message=l,this.key=s}}var As=x0;class Qf{constructor(s,l=[]){this.parent=s,this.bindings={};for(let[u,p]of l)this.bindings[u]=p}concat(s){return new Qf(this,s)}get(s){if(this.bindings[s])return this.bindings[s];if(this.parent)return this.parent.get(s);throw new Error(`${s} not found in scope.`)}has(s){return!!this.bindings[s]||!!this.parent&&this.parent.has(s)}}var w0=Qf;let bc={kind:"null"},Tt={kind:"number"},Oi={kind:"string"},Ii={kind:"boolean"},Io={kind:"color"},ls={kind:"object"},Di={kind:"value"},Do={kind:"collator"},ju={kind:"formatted"},Pl={kind:"resolvedImage"};function Ho(a,s){return{kind:"array",itemType:a,N:s}}function Fn(a){if(a.kind==="array"){let s=Fn(a.itemType);return typeof a.N=="number"?`array<${s}, ${a.N}>`:a.itemType.kind==="value"?"array":`array<${s}>`}return a.kind}let C0=[bc,Tt,Oi,Ii,Io,ju,ls,Ho(Di),Pl];function la(a,s){if(s.kind==="error")return null;if(a.kind==="array"){if(s.kind==="array"&&(s.N===0&&s.itemType.kind==="value"||!la(a.itemType,s.itemType))&&(typeof a.N!="number"||a.N===s.N))return null}else{if(a.kind===s.kind)return null;if(a.kind==="value"){for(let l of C0)if(!la(l,s))return null}}return`Expected ${Fn(a)} but found ${Fn(s)} instead.`}function Vu(a,s){return s.some(l=>l.kind===a.kind)}function Bu(a,s){return s.some(l=>l==="null"?a===null:l==="array"?Array.isArray(a):l==="object"?a&&!Array.isArray(a)&&typeof a=="object":l===typeof a)}var Jf,E0={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 Uu(a){return(a=Math.round(a))<0?0:a>255?255:a}function Hu(a){return Uu(a[a.length-1]==="%"?parseFloat(a)/100*255:parseInt(a))}function mh(a){return(s=a[a.length-1]==="%"?parseFloat(a)/100:parseFloat(a))<0?0:s>1?1:s;var s}function xc(a,s,l){return l<0?l+=1:l>1&&(l-=1),6*l<1?a+(s-a)*l*6:2*l<1?s:3*l<2?a+(s-a)*(2/3-l)*6:a}try{Jf={}.parseCSSColor=function(a){var s,l=a.replace(/ /g,"").toLowerCase();if(l in E0)return E0[l].slice();if(l[0]==="#")return l.length===4?(s=parseInt(l.substr(1),16))>=0&&s<=4095?[(3840&s)>>4|(3840&s)>>8,240&s|(240&s)>>4,15&s|(15&s)<<4,1]:null:l.length===7&&(s=parseInt(l.substr(1),16))>=0&&s<=16777215?[(16711680&s)>>16,(65280&s)>>8,255&s,1]:null;var u=l.indexOf("("),p=l.indexOf(")");if(u!==-1&&p+1===l.length){var m=l.substr(0,u),v=l.substr(u+1,p-(u+1)).split(","),b=1;switch(m){case"rgba":if(v.length!==4)return null;b=mh(v.pop());case"rgb":return v.length!==3?null:[Hu(v[0]),Hu(v[1]),Hu(v[2]),b];case"hsla":if(v.length!==4)return null;b=mh(v.pop());case"hsl":if(v.length!==3)return null;var w=(parseFloat(v[0])%360+360)%360/360,T=mh(v[1]),k=mh(v[2]),R=k<=.5?k*(T+1):k+T-k*T,L=2*k-R;return[Uu(255*xc(L,R,w+1/3)),Uu(255*xc(L,R,w)),Uu(255*xc(L,R,w-1/3)),b];default:return null}}return null}}catch{}class mo{constructor(s,l,u,p=1){this.r=s,this.g=l,this.b=u,this.a=p}static parse(s){if(!s)return;if(s instanceof mo)return s;
1if(typeof s!="string")return;let l=Jf(s);return l?new mo(l[0]/255*l[3],l[1]/255*l[3],l[2]/255*l[3],l[3]):void 0}toString(){let[s,l,u,p]=this.toArray();return`rgba(${Math.round(s)},${Math.round(l)},${Math.round(u)},${p})`}toArray(){let{r:s,g:l,b:u,a:p}=this;return p===0?[0,0,0,0]:[255*s/p,255*l/p,255*u/p,p]}toArray01(){let{r:s,g:l,b:u,a:p}=this;return p===0?[0,0,0,0]:[s/p,l/p,u/p,p]}toArray01PremultipliedAlpha(){let{r:s,g:l,b:u,a:p}=this;return[s,l,u,p]}}mo.black=new mo(0,0,0,1),mo.white=new mo(1,1,1,1),mo.transparent=new mo(0,0,0,0),mo.red=new mo(1,0,0,1),mo.blue=new mo(0,0,1,1);var nr=mo;class em{constructor(s,l,u){this.sensitivity=s?l?"variant":"case":l?"accent":"base",this.locale=u,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(s,l){return this.collator.compare(s,l)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class tm{constructor(s,l,u,p,m){this.text=s.normalize?s.normalize():s,this.image=l,this.scale=u,this.fontStack=p,this.textColor=m}}class go{constructor(s){this.sections=s}static fromString(s){return new go([new tm(s,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(s=>s.text.length!==0||s.image&&s.image.name.length!==0)}static factory(s){return s instanceof go?s:go.fromString(s)}toString(){return this.sections.length===0?"":this.sections.map(s=>s.text).join("")}serialize(){let s=["format"];for(let l of this.sections){if(l.image){s.push(["image",l.image.name]);continue}s.push(l.text);let u={};l.fontStack&&(u["text-font"]=["literal",l.fontStack.split(",")]),l.scale&&(u["font-scale"]=l.scale),l.textColor&&(u["text-color"]=["rgba"].concat(l.textColor.toArray())),s.push(u)}return s}}class $o{constructor(s){this.name=s.name,this.available=s.available}toString(){return this.name}static fromString(s){return s?new $o({name:s,available:!1}):null}serialize(){return["image",this.name]}}function S0(a,s,l,u){return typeof a=="number"&&a>=0&&a<=255&&typeof s=="number"&&s>=0&&s<=255&&typeof l=="number"&&l>=0&&l<=255?u===void 0||typeof u=="number"&&u>=0&&u<=1?null:`Invalid rgba value [${[a,s,l,u].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof u=="number"?[a,s,l,u]:[a,s,l]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function $u(a){if(a===null||typeof a=="string"||typeof a=="boolean"||typeof a=="number"||a instanceof nr||a instanceof em||a instanceof go||a instanceof $o)return!0;if(Array.isArray(a)){for(let s of a)if(!$u(s))return!1;return!0}if(typeof a=="object"){for(let s in a)if(!$u(a[s]))return!1;return!0}return!1}function Jn(a){if(a===null)return bc;if(typeof a=="string")return Oi;if(typeof a=="boolean")return Ii;if(typeof a=="number")return Tt;if(a instanceof nr)return Io;if(a instanceof em)return Do;if(a instanceof go)return ju;if(a instanceof $o)return Pl;if(Array.isArray(a)){let s=a.length,l;for(let u of a){let p=Jn(u);if(l){if(l===p)continue;l=Di;break}l=p}return Ho(l||Di,s)}return ls}function Gu(a){let s=typeof a;return a===null?"":s==="string"||s==="number"||s==="boolean"?String(a):a instanceof nr||a instanceof go||a instanceof $o?a.toString():JSON.stringify(a)}class im{constructor(s,l){this.type=s,this.value=l}static parse(s,l){if(s.length!==2)return l.error(`'literal' expression requires exactly one argument, but found ${s.length-1} instead.`);if(!$u(s[1]))return l.error("invalid value");let u=s[1],p=Jn(u),m=l.expectedType;return p.kind!=="array"||p.N!==0||!m||m.kind!=="array"||typeof m.N=="number"&&m.N!==0||(p=m),new im(p,u)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof nr?["rgba"].concat(this.value.toArray()):this.value instanceof go?this.value.serialize():this.value}}var Ol=im,jr=class{constructor(a){this.name="ExpressionEvaluationError",this.message=a}toJSON(){return this.message}};let nm={string:Oi,number:Tt,boolean:Ii,object:ls};class rm{constructor(s,l){this.type=s,this.args=l}static parse(s,l){if(s.length<2)return l.error("Expected at least one argument.");let u,p=1,m=s[0];if(m==="array"){let b,w;if(s.length>2){let T=s[1];if(typeof T!="string"||!(T in nm)||T==="object")return l.error('The item type argument of "array" must be one of string, number, boolean',1);b=nm[T],p++}else b=Di;if(s.length>3){if(s[2]!==null&&(typeof s[2]!="number"||s[2]<0||s[2]!==Math.floor(s[2])))return l.error('The length argument to "array" must be a positive integer literal',2);w=s[2],p++}u=Ho(b,w)}else u=nm[m];let v=[];for(;p<s.length;p++){let b=l.parse(s[p],p,Di);if(!b)return null;v.push(b)}return new rm(u,v)}
1evaluate(s){for(let l=0;l<this.args.length;l++){let u=this.args[l].evaluate(s);if(!la(this.type,Jn(u)))return u;if(l===this.args.length-1)throw new jr(`Expected value to be of type ${Fn(this.type)}, but found ${Fn(Jn(u))} instead.`)}return null}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}serialize(){let s=this.type,l=[s.kind];if(s.kind==="array"){let u=s.itemType;if(u.kind==="string"||u.kind==="number"||u.kind==="boolean"){l.push(u.kind);let p=s.N;(typeof p=="number"||this.args.length>1)&&l.push(p)}}return l.concat(this.args.map(u=>u.serialize()))}}var ca=rm;class Va{constructor(s){this.type=ju,this.sections=s}static parse(s,l){if(s.length<2)return l.error("Expected at least one argument.");let u=s[1];if(!Array.isArray(u)&&typeof u=="object")return l.error("First argument must be an image or text section.");let p=[],m=!1;for(let v=1;v<=s.length-1;++v){let b=s[v];if(m&&typeof b=="object"&&!Array.isArray(b)){m=!1;let w=null;if(b["font-scale"]&&(w=l.parse(b["font-scale"],1,Tt),!w))return null;let T=null;if(b["text-font"]&&(T=l.parse(b["text-font"],1,Ho(Oi)),!T))return null;let k=null;if(b["text-color"]&&(k=l.parse(b["text-color"],1,Io),!k))return null;let R=p[p.length-1];R.scale=w,R.font=T,R.textColor=k}else{let w=l.parse(s[v],1,Di);if(!w)return null;let T=w.type.kind;if(T!=="string"&&T!=="value"&&T!=="null"&&T!=="resolvedImage")return l.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");m=!0,p.push({content:w,scale:null,font:null,textColor:null})}}return new Va(p)}evaluate(s){return new go(this.sections.map(l=>{let u=l.content.evaluate(s);return Jn(u)===Pl?new tm("",u,null,null,null):new tm(Gu(u),null,l.scale?l.scale.evaluate(s):null,l.font?l.font.evaluate(s).join(","):null,l.textColor?l.textColor.evaluate(s):null)}))}eachChild(s){for(let l of this.sections)s(l.content),l.scale&&s(l.scale),l.font&&s(l.font),l.textColor&&s(l.textColor)}outputDefined(){return!1}serialize(){let s=["format"];for(let l of this.sections){s.push(l.content.serialize());let u={};l.scale&&(u["font-scale"]=l.scale.serialize()),l.font&&(u["text-font"]=l.font.serialize()),l.textColor&&(u["text-color"]=l.textColor.serialize()),s.push(u)}return s}}class gh{constructor(s){this.type=Pl,this.input=s}static parse(s,l){if(s.length!==2)return l.error("Expected two arguments.");let u=l.parse(s[1],1,Oi);return u?new gh(u):l.error("No image name provided.")}evaluate(s){let l=this.input.evaluate(s),u=$o.fromString(l);return u&&s.availableImages&&(u.available=s.availableImages.indexOf(l)>-1),u}eachChild(s){s(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}let L1={"to-boolean":Ii,"to-color":Io,"to-number":Tt,"to-string":Oi};class om{constructor(s,l){this.type=s,this.args=l}static parse(s,l){if(s.length<2)return l.error("Expected at least one argument.");let u=s[0];if((u==="to-boolean"||u==="to-string")&&s.length!==2)return l.error("Expected one argument.");let p=L1[u],m=[];for(let v=1;v<s.length;v++){let b=l.parse(s[v],v,Di);if(!b)return null;m.push(b)}return new om(p,m)}evaluate(s){if(this.type.kind==="boolean")return!!this.args[0].evaluate(s);if(this.type.kind==="color"){let l,u;for(let p of this.args){if(l=p.evaluate(s),u=null,l instanceof nr)return l;if(typeof l=="string"){let m=s.parseColor(l);if(m)return m}else if(Array.isArray(l)&&(u=l.length<3||l.length>4?`Invalid rbga value ${JSON.stringify(l)}: expected an array containing either three or four numeric values.`:S0(l[0],l[1],l[2],l[3]),!u))return new nr(l[0]/255,l[1]/255,l[2]/255,l[3])}throw new jr(u||`Could not parse color from value '${typeof l=="string"?l:String(JSON.stringify(l))}'`)}if(this.type.kind==="number"){let l=null;for(let u of this.args){if(l=u.evaluate(s),l===null)return 0;let p=Number(l);if(!isNaN(p))return p}throw new jr(`Could not convert ${JSON.stringify(l)} to number.`)}return this.type.kind==="formatted"?go.fromString(Gu(this.args[0].evaluate(s))):this.type.kind==="resolvedImage"?$o.fromString(Gu(this.args[0].evaluate(s))):Gu(this.args[0].evaluate(s))}
1eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Va([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new gh(this.args[0]).serialize();let s=[`to-${this.type.kind}`];return this.eachChild(l=>{s.push(l.serialize())}),s}}var wc=om;let Ps=["Unknown","Point","LineString","Polygon"];var sm=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&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ps[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){let a=this.featureDistanceData.center,s=this.featureDistanceData.scale,{x:l,y:u}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(l*s-a[0])+this.featureDistanceData.bearing[1]*(u*s-a[1])}return 0}parseColor(a){let s=this._parseColorCache[a];return s||(s=this._parseColorCache[a]=nr.parse(a)),s}};class Rl{constructor(s,l,u,p){this.name=s,this.type=l,this._evaluate=u,this.args=p}evaluate(s){return this._evaluate(s,this.args)}eachChild(s){this.args.forEach(s)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(s=>s.serialize()))}static parse(s,l){let u=s[0],p=Rl.definitions[u];if(!p)return l.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0);let m=Array.isArray(p)?p[0]:p.type,v=Array.isArray(p)?[[p[1],p[2]]]:p.overloads,b=v.filter(([T])=>!Array.isArray(T)||T.length===s.length-1),w=null;for(let[T,k]of b){w=new hm(l.registry,l.path,null,l.scope);let R=[],L=!1;for(let V=1;V<s.length;V++){let B=s[V],$=Array.isArray(T)?T[V-1]:T.type,Y=w.parse(B,1+R.length,$);if(!Y){L=!0;break}R.push(Y)}if(!L)if(Array.isArray(T)&&T.length!==R.length)w.error(`Expected ${T.length} arguments, but found ${R.length} instead.`);else{for(let V=0;V<R.length;V++){let B=Array.isArray(T)?T[V]:T.type,$=R[V];w.concat(V+1).checkSubtype(B,$.type)}if(w.errors.length===0)return new Rl(u,m,k,R)}}if(b.length===1)l.errors.push(...w.errors);else{let T=(b.length?b:v).map(([R])=>{return L=R,Array.isArray(L)?`(${L.map(Fn).join(", ")})`:`(${Fn(L.type)}...)`;var L}).join(" | "),k=[];for(let R=1;R<s.length;R++){let L=l.parse(s[R],1+k.length);if(!L)return null;k.push(Fn(L.type))}l.error(`Expected arguments of type ${T}, but found (${k.join(", ")}) instead.`)}return null}static register(s,l){Rl.definitions=l;for(let u in l)s[u]=Rl}}var ua=Rl;class qu{constructor(s,l,u){this.type=Do,this.locale=u,this.caseSensitive=s,this.diacriticSensitive=l}static parse(s,l){if(s.length!==2)return l.error("Expected one argument.");let u=s[1];if(typeof u!="object"||Array.isArray(u))return l.error("Collator options argument must be an object.");let p=l.parse(u["case-sensitive"]!==void 0&&u["case-sensitive"],1,Ii);if(!p)return null;let m=l.parse(u["diacritic-sensitive"]!==void 0&&u["diacritic-sensitive"],1,Ii);if(!m)return null;let v=null;return u.locale&&(v=l.parse(u.locale,1,Oi),!v)?null:new qu(p,m,v)}evaluate(s){return new em(this.caseSensitive.evaluate(s),this.diacriticSensitive.evaluate(s),this.locale?this.locale.evaluate(s):null)}eachChild(s){s(this.caseSensitive),s(this.diacriticSensitive),this.locale&&s(this.locale)}outputDefined(){return!1}serialize(){let s={};return s["case-sensitive"]=this.caseSensitive.serialize(),s["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(s.locale=this.locale.serialize()),["collator",s]}}let da=8192;function _h(a,s){a[0]=Math.min(a[0],s[0]),a[1]=Math.min(a[1],s[1]),a[2]=Math.max(a[2],s[0]),a[3]=Math.max(a[3],s[1])}function Cc(a,s){return!(a[0]<=s[0]||a[2]>=s[2]||a[1]<=s[1]||a[3]>=s[3])}function Wu(a,s){let l=(180+a[0])/360,u=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a[1]*Math.PI/360)))/360,p=Math.pow(2,s.z);return[Math.round(l*p*da),Math.round(u*p*da)]}function T0(a,s,l){let u=a[0]-s[0],p=a[1]-s[1],m=a[0]-l[0],v=a[1]-l[1];return u*v-m*p==0&&u*m<=0&&p*v<=0}function vh(a,s){let l=!1;for(let v=0,b=s.length;v<b;v++){let w=s[v];for(let T=0,k=w.length;T<k-1;T++){if(T0(a,w[T],w[T+1]))return!1;(p=w[T])[1]>(u=a)[1]!=(m=w[T+1])[1]>u[1]&&u[0]<(m[0]-p[0])*(u[1]-p[1])/(m[1]-p[1])+p[0]&&(l=!l)}}var u,p,m;return l}function am(a,s){for(let l=0;l<s.length;l++)if(vh(a,s[l]))return!0;return!1}function lm(a,s,l,u){let p=u[0]-l[0],m=u[1]-l[1],v=(a[0]-l[0])*m-p*(a[1]-l[1]),b=(s[0]-l[0])*m-p*(s[1]-l[1]);return v>0&&b<0||v<0&&b>0}function Ec(a,s,l){for(let T of l)for(let k=0;k<T.length-1;++k)if((b=[(v=T[k+1])[0]-(m=T[k])[0],v[1]-m[1]])[0]*(w=[(p=s)[0]-(u=a)[0],p[1]-u[1]])[1]-b[1]*w[0]!=0&&lm(u,p,m,v)&&lm(m,v,u,p))return!0;var u,p,m,v,b,w;return!1}function rn(a,s){for(let l=0;l<a.length;++l)if(!vh(a[l],s))return!1;for(let l=0;l<a.length-1;
1++l)if(Ec(a[l],a[l+1],s))return!1;return!0}function F1(a,s){for(let l=0;l<s.length;l++)if(rn(a,s[l]))return!0;return!1}function cm(a,s,l){let u=[];for(let p=0;p<a.length;p++){let m=[];for(let v=0;v<a[p].length;v++){let b=Wu(a[p][v],l);_h(s,b),m.push(b)}u.push(m)}return u}function I0(a,s,l){let u=[];for(let p=0;p<a.length;p++){let m=cm(a[p],s,l);u.push(m)}return u}function um(a,s,l,u){if(a[0]<l[0]||a[0]>l[2]){let p=.5*u,m=a[0]-l[0]>p?-u:l[0]-a[0]>p?u:0;m===0&&(m=a[0]-l[2]>p?-u:l[2]-a[0]>p?u:0),a[0]+=m}_h(s,a)}function D0(a,s,l,u){let p=Math.pow(2,u.z)*da,m=[u.x*da,u.y*da],v=[];if(!a)return v;for(let b of a)for(let w of b){let T=[w.x+m[0],w.y+m[1]];um(T,s,l,p),v.push(T)}return v}function dm(a,s,l,u){let p=Math.pow(2,u.z)*da,m=[u.x*da,u.y*da],v=[];if(!a)return v;for(let w of a){let T=[];for(let k of w){let R=[k.x+m[0],k.y+m[1]];_h(s,R),T.push(R)}v.push(T)}if(s[2]-s[0]<=p/2){(b=s)[0]=b[1]=1/0,b[2]=b[3]=-1/0;for(let w of v)for(let T of w)um(T,s,l,p)}var b;return v}class Sc{constructor(s,l){this.type=Ii,this.geojson=s,this.geometries=l}static parse(s,l){if(s.length!==2)return l.error(`'within' expression requires exactly one argument, but found ${s.length-1} instead.`);if($u(s[1])){let u=s[1];if(u.type==="FeatureCollection")for(let p=0;p<u.features.length;++p){let m=u.features[p].geometry.type;if(m==="Polygon"||m==="MultiPolygon")return new Sc(u,u.features[p].geometry)}else if(u.type==="Feature"){let p=u.geometry.type;if(p==="Polygon"||p==="MultiPolygon")return new Sc(u,u.geometry)}else if(u.type==="Polygon"||u.type==="MultiPolygon")return new Sc(u,u)}return l.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(s){if(s.geometry()!=null&&s.canonicalID()!=null){if(s.geometryType()==="Point")return function(l,u){let p=[1/0,1/0,-1/0,-1/0],m=[1/0,1/0,-1/0,-1/0],v=l.canonicalID();if(!v)return!1;if(u.type==="Polygon"){let b=cm(u.coordinates,m,v),w=D0(l.geometry(),p,m,v);if(!Cc(p,m))return!1;for(let T of w)if(!vh(T,b))return!1}if(u.type==="MultiPolygon"){let b=I0(u.coordinates,m,v),w=D0(l.geometry(),p,m,v);if(!Cc(p,m))return!1;for(let T of w)if(!am(T,b))return!1}return!0}(s,this.geometries);if(s.geometryType()==="LineString")return function(l,u){let p=[1/0,1/0,-1/0,-1/0],m=[1/0,1/0,-1/0,-1/0],v=l.canonicalID();if(!v)return!1;if(u.type==="Polygon"){let b=cm(u.coordinates,m,v),w=dm(l.geometry(),p,m,v);if(!Cc(p,m))return!1;for(let T of w)if(!rn(T,b))return!1}if(u.type==="MultiPolygon"){let b=I0(u.coordinates,m,v),w=dm(l.geometry(),p,m,v);if(!Cc(p,m))return!1;for(let T of w)if(!F1(T,b))return!1}return!0}(s,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var yh=Sc;function Tc(a){if(a instanceof ua&&(a.name==="get"&&a.args.length===1||a.name==="feature-state"||a.name==="has"&&a.args.length===1||a.name==="properties"||a.name==="geometry-type"||a.name==="id"||/^filter-/.test(a.name))||a instanceof yh)return!1;let s=!0;return a.eachChild(l=>{s&&!Tc(l)&&(s=!1)}),s}function ha(a){if(a instanceof ua&&a.name==="feature-state")return!1;let s=!0;return a.eachChild(l=>{s&&!ha(l)&&(s=!1)}),s}function Ll(a,s){if(a instanceof ua&&s.indexOf(a.name)>=0)return!1;let l=!0;return a.eachChild(u=>{l&&!Ll(u,s)&&(l=!1)}),l}class bh{constructor(s,l){this.type=l.type,this.name=s,this.boundExpression=l}static parse(s,l){if(s.length!==2||typeof s[1]!="string")return l.error("'var' expression requires exactly one string literal argument.");let u=s[1];return l.scope.has(u)?new bh(u,l.scope.get(u)):l.error(`Unknown variable "${u}". Make sure "${u}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(s){return this.boundExpression.evaluate(s)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var M0=bh;class Zu{constructor(s,l=[],u,p=new w0,m=[]){this.registry=s,this.path=l,this.key=l.map(v=>`[${v}]`).join(""),this.scope=p,this.errors=m,this.expectedType=u}parse(s,l,u,p,m={}){return l?this.concat(l,u,p)._parse(s,m):this._parse(s,m)}_parse(s,l){function u(p,m,v){return v==="assert"?new ca(m,[p]):v==="coerce"?new wc(m,[p]):p}
1if(s!==null&&typeof s!="string"&&typeof s!="boolean"&&typeof s!="number"||(s=["literal",s]),Array.isArray(s)){if(s.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let p=s[0];if(typeof p!="string")return this.error(`Expression name must be a string, but found ${typeof p} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let m=this.registry[p];if(m){let v=m.parse(s,this);if(!v)return null;if(this.expectedType){let b=this.expectedType,w=v.type;if(b.kind!=="string"&&b.kind!=="number"&&b.kind!=="boolean"&&b.kind!=="object"&&b.kind!=="array"||w.kind!=="value")if(b.kind!=="color"&&b.kind!=="formatted"&&b.kind!=="resolvedImage"||w.kind!=="value"&&w.kind!=="string"){if(this.checkSubtype(b,w))return null}else v=u(v,b,l.typeAnnotation||"coerce");else v=u(v,b,l.typeAnnotation||"assert")}if(!(v instanceof Ol)&&v.type.kind!=="resolvedImage"&&pm(v)){let b=new sm;try{v=new Ol(v.type,v.evaluate(b))}catch(w){return this.error(w.message),null}}return v}return this.error(`Unknown expression "${p}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(s===void 0?"'undefined' value invalid. Use null instead.":typeof s=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof s} instead.`)}concat(s,l,u){let p=typeof s=="number"?this.path.concat(s):this.path,m=u?this.scope.concat(u):this.scope;return new Zu(this.registry,p,l||null,m,this.errors)}error(s,...l){let u=`${this.key}${l.map(p=>`[${p}]`).join("")}`;this.errors.push(new As(u,s))}checkSubtype(s,l){let u=la(s,l);return u&&this.error(u),u}}var hm=Zu;function pm(a){if(a instanceof M0)return pm(a.boundExpression);if(a instanceof ua&&a.name==="error"||a instanceof qu||a instanceof yh)return!1;let s=a instanceof wc||a instanceof ca,l=!0;return a.eachChild(u=>{l=s?l&&pm(u):l&&u instanceof Ol}),!!l&&Tc(a)&&Ll(a,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function xh(a,s){let l=a.length-1,u,p,m=0,v=l,b=0;for(;m<=v;)if(b=Math.floor((m+v)/2),u=a[b],p=a[b+1],u<=s){if(b===l||s<p)return b;m=b+1}else{if(!(u>s))throw new jr("Input is not a number.");v=b-1}return 0}class wh{constructor(s,l,u){this.type=s,this.input=l,this.labels=[],this.outputs=[];for(let[p,m]of u)this.labels.push(p),this.outputs.push(m)}static parse(s,l){if(s.length-1<4)return l.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return l.error("Expected an even number of arguments.");let u=l.parse(s[1],1,Tt);if(!u)return null;let p=[],m=null;l.expectedType&&l.expectedType.kind!=="value"&&(m=l.expectedType);for(let v=1;v<s.length;v+=2){let b=v===1?-1/0:s[v],w=s[v+1],T=v,k=v+1;if(typeof b!="number")return l.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',T);if(p.length&&p[p.length-1][0]>=b)return l.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',T);let R=l.parse(w,k,m);if(!R)return null;m=m||R.type,p.push([b,R])}return new wh(m,u,p)}evaluate(s){let l=this.labels,u=this.outputs;if(l.length===1)return u[0].evaluate(s);let p=this.input.evaluate(s);if(p<=l[0])return u[0].evaluate(s);let m=l.length;return p>=l[m-1]?u[m-1].evaluate(s):u[xh(l,p)].evaluate(s)}eachChild(s){s(this.input);for(let l of this.outputs)s(l)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}serialize(){let s=["step",this.input.serialize()];for(let l=0;l<this.labels.length;l++)l>0&&s.push(this.labels[l]),s.push(this.outputs[l].serialize());return s}}var fm=wh;function Wi(a,s,l){return a*(1-l)+s*l}var Ku=Object.freeze({__proto__:null,array:function(a,s,l){return a.map((u,p)=>Wi(u,s[p],l))},color:function(a,s,l){return new nr(Wi(a.r,s.r,l),Wi(a.g,s.g,l),Wi(a.b,s.b,l),Wi(a.a,s.a,l))},number:Wi});let k0=.95047,mm=1.08883,A0=4/29,Fl=6/29,gm=3*Fl*Fl,N1=Fl*Fl*Fl,z1=Math.PI/180,j1=180/Math.PI;function _m(a){return a>N1?Math.pow(a,1/3):a/gm+A0}function vm(a){return a>Fl?a*a*a:gm*(a-A0)}function ym(a){return 255*(a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055)}function Ch(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function P0(a){let s=Ch(a.r),l=Ch(a.g),u=Ch(a.b),p=_m((.4124564*s+.3575761*l+.1804375*u)/k0),m=_m((.2126729*s+.71
151522*l+.072175*u)/1);return{l:116*m-16,a:500*(p-m),b:200*(m-_m((.0193339*s+.119192*l+.9503041*u)/mm)),alpha:a.a}}function O0(a){let s=(a.l+16)/116,l=isNaN(a.a)?s:s+a.a/500,u=isNaN(a.b)?s:s-a.b/200;return s=1*vm(s),l=k0*vm(l),u=mm*vm(u),new nr(ym(3.2404542*l-1.5371385*s-.4985314*u),ym(-.969266*l+1.8760108*s+.041556*u),ym(.0556434*l-.2040259*s+1.0572252*u),a.alpha)}function V1(a,s,l){let u=s-a;return a+l*(u>180||u<-180?u-360*Math.round(u/360):u)}let Xu={forward:P0,reverse:O0,interpolate:function(a,s,l){return{l:Wi(a.l,s.l,l),a:Wi(a.a,s.a,l),b:Wi(a.b,s.b,l),alpha:Wi(a.alpha,s.alpha,l)}}},Ic={forward:function(a){let{l:s,a:l,b:u}=P0(a),p=Math.atan2(u,l)*j1;return{h:p<0?p+360:p,c:Math.sqrt(l*l+u*u),l:s,alpha:a.a}},reverse:function(a){let s=a.h*z1,l=a.c;return O0({l:a.l,a:Math.cos(s)*l,b:Math.sin(s)*l,alpha:a.alpha})},interpolate:function(a,s,l){return{h:V1(a.h,s.h,l),c:Wi(a.c,s.c,l),l:Wi(a.l,s.l,l),alpha:Wi(a.alpha,s.alpha,l)}}};var bm=Object.freeze({__proto__:null,hcl:Ic,lab:Xu});class Yu{constructor(s,l,u,p,m){this.type=s,this.operator=l,this.interpolation=u,this.input=p,this.labels=[],this.outputs=[];for(let[v,b]of m)this.labels.push(v),this.outputs.push(b)}static interpolationFactor(s,l,u,p){let m=0;if(s.name==="exponential")m=xm(l,s.base,u,p);else if(s.name==="linear")m=xm(l,1,u,p);else if(s.name==="cubic-bezier"){let v=s.controlPoints;m=new $t(v[0],v[1],v[2],v[3]).solve(xm(l,1,u,p))}return m}static parse(s,l){let[u,p,m,...v]=s;if(!Array.isArray(p)||p.length===0)return l.error("Expected an interpolation type expression.",1);if(p[0]==="linear")p={name:"linear"};else if(p[0]==="exponential"){let T=p[1];if(typeof T!="number")return l.error("Exponential interpolation requires a numeric base.",1,1);p={name:"exponential",base:T}}else{if(p[0]!=="cubic-bezier")return l.error(`Unknown interpolation type ${String(p[0])}`,1,0);{let T=p.slice(1);if(T.length!==4||T.some(k=>typeof k!="number"||k<0||k>1))return l.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);p={name:"cubic-bezier",controlPoints:T}}}if(s.length-1<4)return l.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return l.error("Expected an even number of arguments.");if(m=l.parse(m,2,Tt),!m)return null;let b=[],w=null;u==="interpolate-hcl"||u==="interpolate-lab"?w=Io:l.expectedType&&l.expectedType.kind!=="value"&&(w=l.expectedType);for(let T=0;T<v.length;T+=2){let k=v[T],R=v[T+1],L=T+3,V=T+4;if(typeof k!="number")return l.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',L);if(b.length&&b[b.length-1][0]>=k)return l.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',L);let B=l.parse(R,V,w);if(!B)return null;w=w||B.type,b.push([k,B])}return w.kind==="number"||w.kind==="color"||w.kind==="array"&&w.itemType.kind==="number"&&typeof w.N=="number"?new Yu(w,u,p,m,b):l.error(`Type ${Fn(w)} is not interpolatable.`)}evaluate(s){let l=this.labels,u=this.outputs;if(l.length===1)return u[0].evaluate(s);let p=this.input.evaluate(s);if(p<=l[0])return u[0].evaluate(s);let m=l.length;if(p>=l[m-1])return u[m-1].evaluate(s);let v=xh(l,p),b=Yu.interpolationFactor(this.interpolation,p,l[v],l[v+1]),w=u[v].evaluate(s),T=u[v+1].evaluate(s);return this.operator==="interpolate"?Ku[this.type.kind.toLowerCase()](w,T,b):this.operator==="interpolate-hcl"?Ic.reverse(Ic.interpolate(Ic.forward(w),Ic.forward(T),b)):Xu.reverse(Xu.interpolate(Xu.forward(w),Xu.forward(T),b))}eachChild(s){s(this.input);for(let l of this.outputs)s(l)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}serialize(){let s;s=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);let l=[this.operator,s,this.input.serialize()];for(let u=0;u<this.labels.length;u++)l.push(this.labels[u],this.outputs[u].serialize());return l}}function xm(a,s,l,u){let p=u-l,m=a-l;return p===0?0:s===1?m/p:(Math.pow(s,m)-1)/(Math.pow(s,p)-1)}var Os=Yu;class Eh{constructor(s,l){this.type=s,this.args=l}static parse(s,l){if(s.length<2)return l.error("Expectected at least one argument.");let u=null,p=l.expectedType;p&&p.kind!=="value"&&(u=p);let m=[];for(let b of s.slice(1)){let w=l.parse(b,1+m.length,u,void 0,{typeAnnotation:"omit"});if(!w)return null;u=u||w.type,m.push(w)}let v=p&&m.some(b=>la(p,b.type));return new Eh(v?Di:u,m)}evaluate(s){let l,u=null,p=0;for(let m of this.args){if(p++,u=m.evaluate(s),u&&u instanceof $o&&!u.available&&(l||(l=u),u=null,p===this.args.length))return l;if(u!==null)break}return u}
1eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}serialize(){let s=["coalesce"];return this.eachChild(l=>{s.push(l.serialize())}),s}}var wm=Eh;class Sh{constructor(s,l){this.type=l.type,this.bindings=[].concat(s),this.result=l}evaluate(s){return this.result.evaluate(s)}eachChild(s){for(let l of this.bindings)s(l[1]);s(this.result)}static parse(s,l){if(s.length<4)return l.error(`Expected at least 3 arguments, but found ${s.length-1} instead.`);let u=[];for(let m=1;m<s.length-1;m+=2){let v=s[m];if(typeof v!="string")return l.error(`Expected string, but found ${typeof v} instead.`,m);if(/[^a-zA-Z0-9_]/.test(v))return l.error("Variable names must contain only alphanumeric characters or '_'.",m);let b=l.parse(s[m+1],m+1);if(!b)return null;u.push([v,b])}let p=l.parse(s[s.length-1],s.length-1,l.expectedType,u);return p?new Sh(u,p):null}outputDefined(){return this.result.outputDefined()}serialize(){let s=["let"];for(let[l,u]of this.bindings)s.push(l,u.serialize());return s.push(this.result.serialize()),s}}var R0=Sh;class Cm{constructor(s,l,u){this.type=s,this.index=l,this.input=u}static parse(s,l){if(s.length!==3)return l.error(`Expected 2 arguments, but found ${s.length-1} instead.`);let u=l.parse(s[1],1,Tt),p=l.parse(s[2],2,Ho(l.expectedType||Di));return u&&p?new Cm(p.type.itemType,u,p):null}evaluate(s){let l=this.index.evaluate(s),u=this.input.evaluate(s);if(l<0)throw new jr(`Array index out of bounds: ${l} < 0.`);if(l>=u.length)throw new jr(`Array index out of bounds: ${l} > ${u.length-1}.`);if(l!==Math.floor(l))throw new jr(`Array index must be an integer, but found ${l} instead.`);return u[l]}eachChild(s){s(this.index),s(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var B1=Cm;class Em{constructor(s,l){this.type=Ii,this.needle=s,this.haystack=l}static parse(s,l){if(s.length!==3)return l.error(`Expected 2 arguments, but found ${s.length-1} instead.`);let u=l.parse(s[1],1,Di),p=l.parse(s[2],2,Di);return u&&p?Vu(u.type,[Ii,Oi,Tt,bc,Di])?new Em(u,p):l.error(`Expected first argument to be of type boolean, string, number or null, but found ${Fn(u.type)} instead`):null}evaluate(s){let l=this.needle.evaluate(s),u=this.haystack.evaluate(s);if(u==null)return!1;if(!Bu(l,["boolean","string","number","null"]))throw new jr(`Expected first argument to be of type boolean, string, number or null, but found ${Fn(Jn(l))} instead.`);if(!Bu(u,["string","array"]))throw new jr(`Expected second argument to be of type array or string, but found ${Fn(Jn(u))} instead.`);return u.indexOf(l)>=0}eachChild(s){s(this.needle),s(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Th=Em;class Qu{constructor(s,l,u){this.type=Tt,this.needle=s,this.haystack=l,this.fromIndex=u}static parse(s,l){if(s.length<=2||s.length>=5)return l.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);let u=l.parse(s[1],1,Di),p=l.parse(s[2],2,Di);if(!u||!p)return null;if(!Vu(u.type,[Ii,Oi,Tt,bc,Di]))return l.error(`Expected first argument to be of type boolean, string, number or null, but found ${Fn(u.type)} instead`);if(s.length===4){let m=l.parse(s[3],3,Tt);return m?new Qu(u,p,m):null}return new Qu(u,p)}evaluate(s){let l=this.needle.evaluate(s),u=this.haystack.evaluate(s);if(!Bu(l,["boolean","string","number","null"]))throw new jr(`Expected first argument to be of type boolean, string, number or null, but found ${Fn(Jn(l))} instead.`);if(!Bu(u,["string","array"]))throw new jr(`Expected second argument to be of type array or string, but found ${Fn(Jn(u))} instead.`);if(this.fromIndex){let p=this.fromIndex.evaluate(s);return u.indexOf(l,p)}return u.indexOf(l)}eachChild(s){s(this.needle),s(this.haystack),this.fromIndex&&s(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){let s=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),s]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var L0=Qu;class Sm{constructor(s,l,u,p,m,v){this.inputType=s,this.type=l,this.input=u,this.cases=p,this.outputs=m,this.otherwise=v}static parse(s,l){if(s.length<5)return l.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if(s.length%2!=1)return l.error("Expected an even number of arguments.");let u,p;l.expectedType&&l.expectedType.kind!=="value"&&(p=l.expectedType);let m={},v=[];for(let T=2;T<s.length-1;T+=2){let k=s[T],R=s[T+1];Array.isArray(k)||(k=[k]);let L=l.concat(T);if(k.length===0)return L.error("Expected at least one branch label.");for(let B of k){if(typeof B!="number"&&typeof B!="string")return L.error("Branch labels must be numbers or strings.");if(typeof B=="number"&&Math.abs(B)>Number.MAX_SAFE_INTEGER)return L.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof B=="number"&&Math.floor(B)!==B)return L.error("Numeric branch labels must be integer values.");if(u){if(L.checkSubtype(u,Jn(B)))return null}else u=Jn(B);if(m[String(B)]!==void 0)return L.error("Branch labels must be unique.");m[String(B)]=v.length}let V=l.parse(R,T,p);if(!V)return null;p=p||V.type,v.push(V)}let b=l.parse(s[1],1,Di);if(!b)return null;let w=l.parse(s[s.length-1],s.length-1,p);return w?b.type.kind!=="value"&&l.concat(1).checkSubtype(u,b.type)?null:new Sm(u,p,b,m,v,w):null}evaluate(s){let l=this.input.evaluate(s);return(Jn(l)===this.inputType&&this.outputs[this.cases[l]]||this.otherwise).evaluate(s)}
1eachChild(s){s(this.input),this.outputs.forEach(s),s(this.otherwise)}outputDefined(){return this.outputs.every(s=>s.outputDefined())&&this.otherwise.outputDefined()}serialize(){let s=["match",this.input.serialize()],l=Object.keys(this.cases).sort(),u=[],p={};for(let v of l){let b=p[this.cases[v]];b===void 0?(p[this.cases[v]]=u.length,u.push([this.cases[v],[v]])):u[b][1].push(v)}let m=v=>this.inputType.kind==="number"?Number(v):v;for(let[v,b]of u)s.push(b.length===1?m(b[0]):b.map(m)),s.push(this.outputs[v].serialize());return s.push(this.otherwise.serialize()),s}}var U1=Sm;class Tm{constructor(s,l,u){this.type=s,this.branches=l,this.otherwise=u}static parse(s,l){if(s.length<4)return l.error(`Expected at least 3 arguments, but found only ${s.length-1}.`);if(s.length%2!=0)return l.error("Expected an odd number of arguments.");let u;l.expectedType&&l.expectedType.kind!=="value"&&(u=l.expectedType);let p=[];for(let v=1;v<s.length-1;v+=2){let b=l.parse(s[v],v,Ii);if(!b)return null;let w=l.parse(s[v+1],v+1,u);if(!w)return null;p.push([b,w]),u=u||w.type}let m=l.parse(s[s.length-1],s.length-1,u);return m?new Tm(u,p,m):null}evaluate(s){for(let[l,u]of this.branches)if(l.evaluate(s))return u.evaluate(s);return this.otherwise.evaluate(s)}eachChild(s){for(let[l,u]of this.branches)s(l),s(u);s(this.otherwise)}outputDefined(){return this.branches.every(([s,l])=>l.outputDefined())&&this.otherwise.outputDefined()}serialize(){let s=["case"];return this.eachChild(l=>{s.push(l.serialize())}),s}}var F0=Tm;class Ju{constructor(s,l,u,p){this.type=s,this.input=l,this.beginIndex=u,this.endIndex=p}static parse(s,l){if(s.length<=2||s.length>=5)return l.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);let u=l.parse(s[1],1,Di),p=l.parse(s[2],2,Tt);if(!u||!p)return null;if(!Vu(u.type,[Ho(Di),Oi,Di]))return l.error(`Expected first argument to be of type array or string, but found ${Fn(u.type)} instead`);if(s.length===4){let m=l.parse(s[3],3,Tt);return m?new Ju(u.type,u,p,m):null}return new Ju(u.type,u,p)}evaluate(s){let l=this.input.evaluate(s),u=this.beginIndex.evaluate(s);if(!Bu(l,["string","array"]))throw new jr(`Expected first argument to be of type array or string, but found ${Fn(Jn(l))} instead.`);if(this.endIndex){let p=this.endIndex.evaluate(s);return l.slice(u,p)}return l.slice(u)}eachChild(s){s(this.input),s(this.beginIndex),this.endIndex&&s(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){let s=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),s]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var N0=Ju;function Ih(a,s){return a==="=="||a==="!="?s.kind==="boolean"||s.kind==="string"||s.kind==="number"||s.kind==="null"||s.kind==="value":s.kind==="string"||s.kind==="number"||s.kind==="value"}function z0(a,s,l,u){return u.compare(s,l)===0}function Dc(a,s,l){let u=a!=="=="&&a!=="!=";return class x3{constructor(m,v,b){this.type=Ii,this.lhs=m,this.rhs=v,this.collator=b,this.hasUntypedArgument=m.type.kind==="value"||v.type.kind==="value"}static parse(m,v){if(m.length!==3&&m.length!==4)return v.error("Expected two or three arguments.");let b=m[0],w=v.parse(m[1],1,Di);if(!w)return null;if(!Ih(b,w.type))return v.concat(1).error(`"${b}" comparisons are not supported for type '${Fn(w.type)}'.`);let T=v.parse(m[2],2,Di);if(!T)return null;if(!Ih(b,T.type))return v.concat(2).error(`"${b}" comparisons are not supported for type '${Fn(T.type)}'.`);if(w.type.kind!==T.type.kind&&w.type.kind!=="value"&&T.type.kind!=="value")return v.error(`Cannot compare types '${Fn(w.type)}' and '${Fn(T.type)}'.`);u&&(w.type.kind==="value"&&T.type.kind!=="value"?w=new ca(T.type,[w]):w.type.kind!=="value"&&T.type.kind==="value"&&(T=new ca(w.type,[T])));let k=null;if(m.length===4){if(w.type.kind!=="string"&&T.type.kind!=="string"&&w.type.kind!=="value"&&T.type.kind!=="value")return v.error("Cannot use collator to compare non-string types.");if(k=v.parse(m[3],3,Do),!k)return null}return new x3(w,T,k)}evaluate(m){let v=this.lhs.evaluate(m),b=this.rhs.evaluate(m);if(u&&this.hasUntypedArgument){let w=Jn(v),T=Jn(b);if(w.kind!==T.kind||w.kind!=="string"&&w.kind!=="number")throw new jr(`Expected arguments for "${a}" to be (string, string) or (number, number), but found (${w.kind}, ${T.kind}) instead.`)}if(this.collator&&!u&&this.hasUntypedArgument){let w=Jn(v),T=Jn(b);if(w.kind!=="string"||T.kind!=="string")return s(m,v,b)}return this.collator?l(m,v,b,this.collator.evaluate(m)):s(m,v,b)}eachChild(m){m(this.lhs),m(this.rhs),this.collator&&m(this.collator)}outputDefined(){return!0}serialize(){let m=[a];return this.eachChild(v=>{m.push(v.serialize())}),m}}}let H1=Dc("==",function(a,s,l){return s===l},z0),$1=Dc("!=",function(a,s,l){return s!==l},function(a,s,l,u){return!z0(0,s,l,u)}),G1=Dc("<",function(a,s,l){return s<l},function(a,s,l,u){return u.compare(s,l)<0}),q1=Dc(">",function(a,s,l){return s>l},function(a,s,l,u){return u.compare(s,l)>0}),W1=Dc("<=",function(a,s,l){return s<=l},function(a,s,l,u){return u.compare(s,l)<=0}),j0=Dc(">=",function(a,s,l){return s>=l},function(a,s,l,u){return u.compare(s,l)>=0});class Dh{constructor(s,l,u,p,m,v){this.type=Oi,this.number=s,this.locale=l,this.currency=u,this.unit=p,this.minFractionDigits=m,this.maxFractionDigits=v}static parse(s,l){if(s.length!==3)return l.error("Expected two arguments.");let u=l.parse(s[1],1,Tt);if(!u)return null;let p=s[2];if(typeof p!="object"||Array.isArray(p))return l.error("NumberFormat options argument must be an object.");let m=null;if(p.locale&&(m=l.parse(p.locale,1,Oi),!m))return null;let v=null;if(p.currency&&(v=l.parse(p.currency,1,Oi),!v))return null;let b=null;if(p.unit&&(b=l.parse(p.unit,1,Oi),!b))return null;let w=null;if(p["min-fraction-digits"]&&(w=l.parse(p["min-fraction-digits"],1,Tt),!w))return null;let T=null;return p["max-fraction-digits"]&&(T=l.parse(p["max-fraction-digits"],1,Tt),!T)?null:new Dh(u,m,v,b,w,T)}evaluate(s){return new Intl.NumberFormat(this.locale?this.locale.evaluate(s):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(s):void 0,unit:this.unit?this.unit.evaluate(s):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(s):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(s):void 0}).format(this.number.evaluate(s))}eachChild(s){s(this.number),this.locale&&s(this.locale),this.currency&&s(this.currency),this.unit&&s(this.unit),this.minFractionDigits&&s(this.minFractionDigits),this.maxFractionDigits&&s(this.maxFractionDigits)}outputDefined(){return!1}serialize(){let s={};return this.locale&&(s.locale=this.locale.serialize()),this.currency&&(s.currency=this.currency.serialize()),this.unit&&(s.unit=this.unit.serialize()),this.minFractionDigits&&(s["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(s["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),s]}}class Mc{constructor(s){this.type=Tt,this.input=s}static parse(s,l){if(s.length!==2)return l.error(`Expected 1 argument, but found ${s.length-1} instead.`);let u=l.parse(s[1],1);return u?u.type.kind!=="array"&&u.type.kind!=="string"&&u.type.kind!=="value"?l.error(`Expected argument of type string or array, but found ${Fn(u.type)} instead.`):new Mc(u):null}evaluate(s){let l=this.input.evaluate(s);if(typeof l=="string"||Array.isArray(l))return l.length;throw new jr(`Expected value to be of type string or array, but found ${Fn(Jn(l))} instead.`)}eachChild(s){s(this.input)}outputDefined(){return!1}serialize(){let s=["length"];return this.eachChild(l=>{s.push(l.serialize())}),s}}let V0={"==":H1,"!=":$1,">":q1,"<":G1,">=":j0,"<=":W1,array:ca,at:B1,boolean:ca,case:F0,coalesce:wm,collator:qu,format:Va,image:gh,in:Th,"index-of":L0,interpolate:Os,"interpolate-hcl":Os,"interpolate-lab":Os,length:Mc,let:R0,literal:Ol,match:U1,number:ca,"number-format":Dh,object:ca,slice:N0,step:fm,string:ca,"to-boolean":wc,"to-color":wc,"to-number":wc,"to-string":wc,var:M0,within:yh};function B0(a,[s,l,u,p]){s=s.evaluate(a),l=l.evaluate(a),u=u.evaluate(a);let m=p?p.evaluate(a):1,v=S0(s,l,u,m);if(v)throw new jr(v);return new nr(s/255*m,l/255*m,u/255*m,m)}function pa(a,s){return a in s}function Mh(a,s){let l=s[a];return l===void 0?null:l}function Go(a){return{type:a}}ua.register(V0,{error:[{kind:"error"},[Oi],(a,[s])=>{throw new jr(s.evaluate(a))}],typeof:[Oi,[Di],(a,[s])=>Fn(Jn(s.evaluate(a)))],"to-rgba":[Ho(Tt,4),[Io],(a,[s])=>s.evaluate(a).toArray()],rgb:[Io,[Tt,Tt,Tt],B0],rgba:[Io,[Tt,Tt,Tt,Tt],B0],has:{type:Ii,overloads:[[[Oi],(a,[s])=>pa(s.evaluate(a),a.properties())],[[Oi,ls],(a,[s,l])=>pa(s.evaluate(a),l.evaluate(a))]]},get:{type:Di,overloads:[[[Oi],(a,[s])=>Mh(s.evaluate(a),a.properties())],[[Oi,ls],(a,[s,l])=>Mh(s.evaluate(a),l.evaluate(a))]]},"feature-state":[Di,[Oi],(a,[s])=>Mh(s.evaluate(a),a.featureState||{})],properties:[ls,[],a=>a.properties()],"geometry-type":[Oi,[],a=>a.geometryType()],id:[Di,[],a=>a.id()],zoom:[Tt,[],a=>a.globals.zoom],pitch:[Tt,[],a=>a.globals.pitch||0],"distance-from-center":[Tt,[],a=>a.distanceFromCenter()],"heatmap-density":[Tt,[],a=>a.globals.heatmapDensity||0],"line-progress":[Tt,[],a=>a.globals.lineProgress||0],"sky-radial-progress":[Tt,[],a=>a.globals.skyRadialProgress||0],accumulated:[Di,[],a=>a.globals.accumulated===void 0?null:a.globals.accumulated],"+":[Tt,Go(Tt),(a,s)=>{let l=0;for(let u of s)l+=u.evaluate(a);return l}],"*":[Tt,Go(Tt),(a,s)=>{let l=1;for(let u of s)l*=u.evaluate(a);return l}],"-":{type:Tt,overloads:[[[Tt,Tt],(a,[s,l])=>s.evaluate(a)-l.evaluate(a)],[[Tt],(a,[s])=>-s.evaluate(a)]]},"/":[Tt,[Tt,Tt],(a,[s,l])=>s.evaluate(a)/l.evaluate(a)],"%":[Tt,[Tt,Tt],(a,[s,l])=>s.evaluate(a)%l.evaluate(a)],ln2:[Tt,[],()=>Math.LN2],pi:[Tt,[],()=>Math.PI],e:[Tt,[],()=>Math.E],"^":[Tt,[Tt,Tt],(a,[s,l])=>Math.pow(s.evaluate(a),l.evaluate(a))],sqrt:[Tt,[Tt],(a,[s])=>Math.sqrt(s.evaluate(a))],log10:[Tt,[Tt],(a,[s])=>Math.log(s.evaluate(a))/Math.LN10],ln:[Tt,[Tt],(a,[s])=>Math.log(s.evaluate(a))],log2:[Tt,[Tt],(a,[s])=>Math.log(s.evaluate(a))/Math.LN2],sin:[Tt,[Tt],(a,[s])=>Math.sin(s.evaluate(a))],cos:[Tt,[Tt],(a,[s])=>Math.cos(s.evaluate(a))],tan:[Tt,[Tt],(a,[s])=>Math.tan(s.evaluate(a))],asin:[Tt,[Tt],(a,[s])=>Math.asin(s.evaluate(a))],acos:[Tt,[Tt],(a,[s])=>Math.acos(s.evaluate(a))],atan:[Tt,[Tt],(a,[s])=>Math.atan(s.evaluate(a))],min:[Tt,Go(Tt),(a,s)=>Math.min(...s.map(l=>l.evaluate(a)))],max:[Tt,Go(Tt),(a,s)=>Math.max(...s.map(l=>l.evaluate(a)))],abs:[Tt,[Tt],(a,[s])=>Math.abs(s.evaluate(a))],round:[Tt,[Tt],(a,[s])=>{let l=s.evaluate(a);return l<0?-Math.round(-l):Math.round(l)}],floor:[Tt,[Tt],(a,[s])=>Math.floor(s.evaluate(a))],ceil:[Tt,[Tt],(a,[s])=>Math.ceil(s.evaluate(a))],"filter-==":[Ii,[Oi,Di],(a,[s,l])=>
1a.properties()[s.value]===l.value],"filter-id-==":[Ii,[Di],(a,[s])=>a.id()===s.value],"filter-type-==":[Ii,[Oi],(a,[s])=>a.geometryType()===s.value],"filter-<":[Ii,[Oi,Di],(a,[s,l])=>{let u=a.properties()[s.value],p=l.value;return typeof u==typeof p&&u<p}],"filter-id-<":[Ii,[Di],(a,[s])=>{let l=a.id(),u=s.value;return typeof l==typeof u&&l<u}],"filter->":[Ii,[Oi,Di],(a,[s,l])=>{let u=a.properties()[s.value],p=l.value;return typeof u==typeof p&&u>p}],"filter-id->":[Ii,[Di],(a,[s])=>{let l=a.id(),u=s.value;return typeof l==typeof u&&l>u}],"filter-<=":[Ii,[Oi,Di],(a,[s,l])=>{let u=a.properties()[s.value],p=l.value;return typeof u==typeof p&&u<=p}],"filter-id-<=":[Ii,[Di],(a,[s])=>{let l=a.id(),u=s.value;return typeof l==typeof u&&l<=u}],"filter->=":[Ii,[Oi,Di],(a,[s,l])=>{let u=a.properties()[s.value],p=l.value;return typeof u==typeof p&&u>=p}],"filter-id->=":[Ii,[Di],(a,[s])=>{let l=a.id(),u=s.value;return typeof l==typeof u&&l>=u}],"filter-has":[Ii,[Di],(a,[s])=>s.value in a.properties()],"filter-has-id":[Ii,[],a=>a.id()!==null&&a.id()!==void 0],"filter-type-in":[Ii,[Ho(Oi)],(a,[s])=>s.value.indexOf(a.geometryType())>=0],"filter-id-in":[Ii,[Ho(Di)],(a,[s])=>s.value.indexOf(a.id())>=0],"filter-in-small":[Ii,[Oi,Ho(Di)],(a,[s,l])=>l.value.indexOf(a.properties()[s.value])>=0],"filter-in-large":[Ii,[Oi,Ho(Di)],(a,[s,l])=>function(u,p,m,v){for(;m<=v;){let b=m+v>>1;if(p[b]===u)return!0;p[b]>u?v=b-1:m=b+1}return!1}(a.properties()[s.value],l.value,0,l.value.length-1)],all:{type:Ii,overloads:[[[Ii,Ii],(a,[s,l])=>s.evaluate(a)&&l.evaluate(a)],[Go(Ii),(a,s)=>{for(let l of s)if(!l.evaluate(a))return!1;return!0}]]},any:{type:Ii,overloads:[[[Ii,Ii],(a,[s,l])=>s.evaluate(a)||l.evaluate(a)],[Go(Ii),(a,s)=>{for(let l of s)if(l.evaluate(a))return!0;return!1}]]},"!":[Ii,[Ii],(a,[s])=>!s.evaluate(a)],"is-supported-script":[Ii,[Oi],(a,[s])=>{let l=a.globals&&a.globals.isSupportedScript;return!l||l(s.evaluate(a))}],upcase:[Oi,[Oi],(a,[s])=>s.evaluate(a).toUpperCase()],downcase:[Oi,[Oi],(a,[s])=>s.evaluate(a).toLowerCase()],concat:[Oi,Go(Di),(a,s)=>s.map(l=>Gu(l.evaluate(a))).join("")],"resolved-locale":[Oi,[Do],(a,[s])=>s.evaluate(a).resolvedLocale()]});var ed=V0;function U0(a){return{result:"success",value:a}}function Nl(a){return{result:"error",value:a}}function kc(a){return a["property-type"]==="data-driven"}function kh(a){return!!a.expression&&a.expression.parameters.indexOf("zoom")>-1}function Ah(a){return!!a.expression&&a.expression.interpolated}function Zi(a){return a instanceof Number?"number":a instanceof String?"string":a instanceof Boolean?"boolean":Array.isArray(a)?"array":a===null?"null":typeof a}function td(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function H0(a){return a}function Ph(a,s){let l=s.type==="color",u=a.stops&&typeof a.stops[0][0]=="object",p=u||!(u||a.property!==void 0),m=a.type||(Ah(s)?"exponential":"interval");if(l&&((a=aa({},a)).stops&&(a.stops=a.stops.map(T=>[T[0],nr.parse(T[1])])),a.default=nr.parse(a.default?a.default:s.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!bm[a.colorSpace])throw new Error(`Unknown color space: ${a.colorSpace}`);let v,b,w;if(m==="exponential")v=fa;else if(m==="interval")v=Oh;else if(m==="categorical"){v=$0,b=Object.create(null);for(let T of a.stops)b[T[0]]=T[1];w=typeof a.stops[0][0]}else{if(m!=="identity")throw new Error(`Unknown function type "${m}"`);v=G0}if(u){let T={},k=[];for(let V=0;V<a.stops.length;V++){let B=a.stops[V],$=B[0].zoom;T[$]===void 0&&(T[$]={zoom:$,type:a.type,property:a.property,default:a.default,stops:[]},k.push($)),T[$].stops.push([B[0].value,B[1]])}let R=[];for(let V of k)R.push([T[V].zoom,Ph(T[V],s)]);let L={name:"linear"};return{kind:"composite",interpolationType:L,interpolationFactor:Os.interpolationFactor.bind(void 0,L),zoomStops:R.map(V=>V[0]),evaluate:({zoom:V},B)=>fa({stops:R,base:a.base},s,V).evaluate(V,B)}}if(p){let T=m==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:T,interpolationFactor:Os.interpolationFactor.bind(void 0,T),zoomStops:a.stops.map(k=>k[0]),evaluate:({zoom:k})=>v(a,s,k,b,w)}}return{kind:"source",evaluate(T,k){let R=k&&k.properties?k.properties[a.property]:void 0;return R===void 0?Ac(a.default,s.default):v(a,s,R,b,w)}}}function Ac(a,s,l){return a!==void 0?a:s!==void 0?s:l!==void 0?l:void 0}function $0(a,s,l,u,p){return Ac(typeof l===p?u[l]:void 0,a.default,s.default)}function Oh(a,s,l){if(Zi(l)!=="number")return Ac(a.default,s.default);let u=a.stops.length;if(u===1||l<=a.stops[0][0])return a.stops[0][1];if(l>=a.stops[u-1][0])return a.stops[u-1][1];let p=xh(a.stops.map(m=>m[0]),l);return a.stops[p][1]}function fa(a,s,l){let u=a.base!==void 0?a.base:1;if(Zi(l)!=="number")return Ac(a.default,s.default);let p=a.stops.length;if(p===1||l<=a.stops[0][0])return a.stops[0][1];if(l>=a.stops[p-1][0])return a.stops[p-1][1];let m=xh(a.stops.map(k=>k[0]),l),v=function(k,R,L,V){let B=V-L,$=k-L;return B===0?0:R===1?$/B:(Math.pow(R,$)-1)/(Math.pow(R,B)-1)}(l,u,a.stops[m][0],a.stops[m+1][0]),b=a.stops[m][1],w=a.stops[m+1][1],T=Ku[s.type]||H0;if(a.colorSpace&&a.colorSpace!=="rgb"){let k=bm[a.colorSpace];T=(R,L)=>k.reverse(k.interpolate(k.forward(R),k.forward(L),v))}return typeof b.evaluate=="function"?{evaluate(...k){let R=b.evaluate.apply(void 0,k),L=w.evaluate.apply(void 0,k);if(R!==void 0&&L!==void 0)return T(R,L,v)}}:T(b,w,v)}function G0(a,s,l){return s.type==="color"?l=nr.parse(l):s.type==="formatted"?l=go.fromString(l.toString()):s.type==="resolvedImage"?l=$o.fromString(l.toString()):Zi(l)===s.t
1ype||s.type==="enum"&&s.values[l]||(l=void 0),Ac(l,a.default,s.default)}class Rh{constructor(s,l){this.expression=s,this._warningHistory={},this._evaluator=new sm,this._defaultValue=l?function(u){return u.type==="color"&&(td(u.default)||Array.isArray(u.default))?new nr(0,0,0,0):u.type==="color"?nr.parse(u.default)||null:u.default===void 0?null:u.default}(l):null,this._enumValues=l&&l.type==="enum"?l.values:null}evaluateWithoutErrorHandling(s,l,u,p,m,v,b,w){return this._evaluator.globals=s,this._evaluator.feature=l,this._evaluator.featureState=u,this._evaluator.canonical=p||null,this._evaluator.availableImages=m||null,this._evaluator.formattedSection=v,this._evaluator.featureTileCoord=b||null,this._evaluator.featureDistanceData=w||null,this.expression.evaluate(this._evaluator)}evaluate(s,l,u,p,m,v,b,w){this._evaluator.globals=s,this._evaluator.feature=l||null,this._evaluator.featureState=u||null,this._evaluator.canonical=p||null,this._evaluator.availableImages=m||null,this._evaluator.formattedSection=v||null,this._evaluator.featureTileCoord=b||null,this._evaluator.featureDistanceData=w||null;try{let T=this.expression.evaluate(this._evaluator);if(T==null||typeof T=="number"&&T!=T)return this._defaultValue;if(this._enumValues&&!(T in this._enumValues))throw new jr(`Expected value to be one of ${Object.keys(this._enumValues).map(k=>JSON.stringify(k)).join(", ")}, but found ${JSON.stringify(T)} instead.`);return T}catch(T){return this._warningHistory[T.message]||(this._warningHistory[T.message]=!0,typeof console<"u"&&console.warn(T.message)),this._defaultValue}}}function Pc(a){return Array.isArray(a)&&a.length>0&&typeof a[0]=="string"&&a[0]in ed}function Oc(a,s){let l=new hm(ed,[],s?function(p){let m={color:Io,string:Oi,number:Tt,enum:Oi,boolean:Ii,formatted:ju,resolvedImage:Pl};return p.type==="array"?Ho(m[p.value]||Di,p.length):m[p.type]}(s):void 0),u=l.parse(a,void 0,void 0,void 0,s&&s.type==="string"?{typeAnnotation:"coerce"}:void 0);return u?U0(new Rh(u,s)):Nl(l.errors)}class Im{constructor(s,l){this.kind=s,this._styleExpression=l,this.isStateDependent=s!=="constant"&&!ha(l.expression)}evaluateWithoutErrorHandling(s,l,u,p,m,v){return this._styleExpression.evaluateWithoutErrorHandling(s,l,u,p,m,v)}evaluate(s,l,u,p,m,v){return this._styleExpression.evaluate(s,l,u,p,m,v)}}class id{constructor(s,l,u,p){this.kind=s,this.zoomStops=u,this._styleExpression=l,this.isStateDependent=s!=="camera"&&!ha(l.expression),this.interpolationType=p}evaluateWithoutErrorHandling(s,l,u,p,m,v){return this._styleExpression.evaluateWithoutErrorHandling(s,l,u,p,m,v)}evaluate(s,l,u,p,m,v){return this._styleExpression.evaluate(s,l,u,p,m,v)}interpolationFactor(s,l,u){return this.interpolationType?Os.interpolationFactor(this.interpolationType,s,l,u):0}}function nd(a,s){if((a=Oc(a,s)).result==="error")return a;let l=a.value.expression,u=Tc(l);if(!u&&!kc(s))return Nl([new As("","data expressions not supported")]);let p=Ll(l,["zoom","pitch","distance-from-center"]);if(!p&&!kh(s))return Nl([new As("","zoom expressions not supported")]);let m=Fh(l);return m||p?m instanceof As?Nl([m]):m instanceof Os&&!Ah(s)?Nl([new As("",'"interpolate" expressions cannot be used with this property')]):U0(m?new id(u?"camera":"composite",a.value,m.labels,m instanceof Os?m.interpolation:void 0):new Im(u?"constant":"source",a.value)):Nl([new As("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Lh{constructor(s,l){this._parameters=s,this._specification=l,aa(this,Ph(this._parameters,this._specification))}static deserialize(s){return new Lh(s._parameters,s._specification)}static serialize(s){return{_parameters:s._parameters,_specification:s._specification}}}function Fh(a){let s=null;if(a instanceof R0)s=Fh(a.result);else if(a instanceof wm){for(let l of a.args)if(s=Fh(l),s)break}else(a instanceof fm||a instanceof Os)&&a.input instanceof ua&&a.input.name==="zoom"&&(s=a);return s instanceof As||a.eachChild(l=>{let u=Fh(l);u instanceof As?s=u:!s&&u?s=new As("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&u&&s!==u&&(s=new As("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}class Mt{constructor(s,l,u,p){this.message=(s?`${s}: `:"")+u,p&&(this.identifier=p),l!=null&&l.__line__&&(this.line=l.__line__)}}function cs(a){let s=a.key,l=a.value,u=a.valueSpec||{},p=a.objectElementValidators||{},m=a.style,v=a.styleSpec,b=[],w=Zi(l);if(w!=="object")return[new Mt(s,l,`object expected, ${w} found`)];for(let T in l){let k=T.split(".")[0],R;p[k]?R=p[k]:u[k]?R=Kr:p["*"]?R=p["*"]:u["*"]&&(R=Kr),R?b=b.concat(R({key:(s&&`${s}.`)+T,value:l[T],valueSpec:u[k]||u["*"],style:m,styleSpec:v,object:l,objectKey:T},l)):b.push(new Mt(s,l[T],`unknown property "${T}"`))}for(let T in u)p[T]||u[T].required&&u[T].default===void 0&&l[T]===void 0&&b.push(new Mt(s,l,`missing required property "${T}"`));return b}function q0(a){let s=a.value,l=a.valueSpec,u=a.style,p=a.styleSpec,m=a.key,v=a.arrayElementValidator||Kr;if(Zi(s)!=="array")return[new Mt(m,s,`array expected, ${Zi(s)} found`)];if(l.length&&s.length!==l.length)return[new Mt(m,s,`array length ${l.length} expected, length ${s.length} found`)];if(l["min-length"]&&s.length<l["min-length"])return[new Mt(m,s,`array length at least ${l["min-length"]} expected, length ${s.length} found`)];let b={type:l.value,values:l.values,minimum:l.minimum,maximum:l.maximum,function:void 0};p.$version<7&&(b.function=l.function),Zi(l.value)==="object"&&(b=l.value);let w=[];for(let T=0;T<s.length;T++)w=w.concat(v({array:s,arrayIndex:T,value:s[T],valueSpec:b,style:u,styleSpec:p,key:`${m}[${T}]`}));return w}function rd(a){let s=a.key,l=a.value,u=a.valueSpec,p=Zi(l);if(p==="number"&&l!=l&&(p="NaN"),p!=="number")return[new Mt(s,l,`number expected, ${p} found`)];if("minimum"in u){let m=u.minimum;if(Zi(u.minimum)==="array"&&(m=u.minimum[a.arrayIndex]),l<m)return[new Mt(s,l,`${l} is less than the minimum value ${m}`)]}if("maximum"in u){let m=u.maximum;if(Zi(u.maximum)==="array"&&(m=u.maximum[a.arrayIndex]),l>m)return[new Mt(s,l,`${l} is greater than the maximum value ${m}`)]}return[]}function od(a){let s=a.valueSpec,l=lr(a.value.type),u,p,m,v={},b=l!=="categorical"&&a.value.property===void 0,w=!b,T=Zi(a.value.stops)==="array"&&Zi(a.value.stops[0])==="array"&&Zi(a.value.stops[0][0])==="object",k=cs({key:a.key,value:a.value,valueSpec:a.styleSpec.function,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{stops:function(V){if(l==="identity")return[new Mt(V.key,V.value,'identity function may not have a "stops" property')];let B=[],$=V.value;return B=B.concat(q0({key:V.key,value:$,valueSpec:V.valueSpec,style:V.style,styleSpec:V.styleSpec,arrayElementValidator:R})),Zi($)==="array"&&$.length===0&&B.push(new Mt(V.key,$,"array must have at least one stop")),B},default:function(V){return Kr({key:V.key,value:V.value,valueSpec:s,style:V.style,styleSpec:V.styleSpec})}}});return l==="identity"&&b&&k.push(new Mt(a.key,a.value,'missing required property "property"')),l==="identity"||a.value.stops||k.push(new Mt(a.key,a.value,'missing required property "stops"')),l==="exponential"&&a.valueSpec.expression&&!Ah(a.valueSpec)&&k.push(new Mt(a.key,a.value,"exponential functions not supported")),a.styleSpec.$version>=8&&(w&&!kc(a.valueSpec)?k.push(new Mt(a.key,a.value,"property functions not supported")):b&&!kh(a.valueSpec)&&k.push(new Mt(a.key,a.value,"zoom functions not supported"))),l!=="categorical"&&!T||a.value.property!==void 0||k.push(new Mt(a.key,a.value,'"property" property is required')),k;function R(V){let B=[],$=V.value,Y=V.key;if(Zi($)!=="array")return[new Mt(Y,$,`array expected, ${Zi($)} found`)];if($.length!==2)return[new Mt(Y,$,`array length 2 expected, length ${$.length} found`)];if(T){if(Zi($[0])!=="object")return[new Mt(Y,$,`object expected, ${Zi($[0])} found`)];if($[0].zoom===void 0)return[new Mt(Y,$,"object stop key must have zoom")];if($[0].value===void 0)return[new Mt(Y,$,"object stop key must have value")];let re=lr($[0].zoom);if(typeof re!="number")return[new Mt(Y,$[0].zoom,"stop zoom values must be numbers")];if(m&&m>re)return[new Mt(Y,$[0].zoom,"stop zoom values must appear in ascending order")];re!==m&&(m=re,p=void 0,v={}),B=B.concat(cs({key:`${Y}[0]`,value:$[0],valueSpec:{zoom:{}},style:V.style,styleSpec:V.styleSpec,objectElementValidators:{zoom:rd,value:L}}))}else B=B.concat(L({key:`${Y}[0]`,value:$[0],valueSpec:{},style:V.style,styleSpec:V.styleSpec},$));return Pc(Ir($[1]))?B.concat([new Mt(`${Y}[1]`,$[1],"expressions are not allowed in function stops.")]):B.concat(Kr({key:`${Y}[1]`,value:$[1],valueSpec:s,style:V.style,styleSpec:V.styleSpec}))}function L(V,B){let $=Zi(V.value),Y=lr(V.value),re=V.value!==null?V.value:B;if(u){if($!==u)return[new Mt(V.key,re,`${$} stop domain type must match previous stop domain type ${u}`)]}else u=$;if($!=="number"&&$!=="string"&&$!=="boolean"&&typeof Y!="number"&&typeof Y!="string"&&typeof Y!="boolean")return[new Mt(V.key,re,"stop domain value must be a number, string, or boolean")];if($!=="number"&&l!=="categorical"){let fe=`number expected, ${$} found`;return kc(s)&&l===void 0&&(fe+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Mt(V.key,re,fe)]}return l!=="categorical"||$!=="number"||typeof Y=="number"&&isFinite(Y)&&Math.floor(Y)===Y?l!=="categorical"&&$==="number"&&typeof Y=="number"&&typeof p=="number"&&p!==void 0&&Y<p?[new Mt(V.key,re,"stop domain values must appear in ascending order")]:(p=Y,l==="categorical"&&Y in v?[new Mt(V.key,re,"stop domain values must be unique")]:(v[Y]=!0,[])):[new Mt(V.key,re,`integer expected, found ${String(Y)}`)]}}
1function Dr(a){let s=(a.expressionContext==="property"?nd:Oc)(Ir(a.value),a.valueSpec);if(s.result==="error")return s.value.map(u=>new Mt(`${a.key}${u.key}`,a.value,u.message));let l=s.value.expression||s.value._styleExpression.expression;if(a.expressionContext==="property"&&a.propertyKey==="text-font"&&!l.outputDefined())return[new Mt(a.key,a.value,`Invalid data expression for "${a.propertyKey}". Output values must be contained as literals within the expression.`)];if(a.expressionContext==="property"&&a.propertyType==="layout"&&!ha(l))return[new Mt(a.key,a.value,'"feature-state" data expressions are not supported with layout properties.')];if(a.expressionContext==="filter")return sd(l,a);if(a.expressionContext&&a.expressionContext.indexOf("cluster")===0){if(!Ll(l,["zoom","feature-state"]))return[new Mt(a.key,a.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(a.expressionContext==="cluster-initial"&&!Tc(l))return[new Mt(a.key,a.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function sd(a,s){let l=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(s.valueSpec&&s.valueSpec.expression)for(let p of s.valueSpec.expression.parameters)l.delete(p);if(l.size===0)return[];let u=[];return a instanceof ua&&l.has(a.name)?[new Mt(s.key,s.value,`["${a.name}"] expression is not supported in a filter for a ${s.object.type} layer with id: ${s.object.id}`)]:(a.eachChild(p=>{u.push(...sd(p,s))}),u)}function Nh(a){let s=a.key,l=a.value,u=a.valueSpec,p=[];return Array.isArray(u.values)?u.values.indexOf(lr(l))===-1&&p.push(new Mt(s,l,`expected one of [${u.values.join(", ")}], ${JSON.stringify(l)} found`)):Object.keys(u.values).indexOf(lr(l))===-1&&p.push(new Mt(s,l,`expected one of [${Object.keys(u.values).join(", ")}], ${JSON.stringify(l)} found`)),p}function Dm(a){if(a===!0||a===!1)return!0;if(!Array.isArray(a)||a.length===0)return!1;switch(a[0]){case"has":return a.length>=2&&a[1]!=="$id"&&a[1]!=="$type";case"in":return a.length>
1=3&&(typeof a[1]!="string"||Array.isArray(a[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return a.length!==3||Array.isArray(a[1])||Array.isArray(a[2]);case"any":case"all":for(let s of a.slice(1))if(!Dm(s)&&typeof s!="boolean")return!1;return!0;default:return!0}}function zh(a,s="fill"){if(a==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Dm(a)||(a=Lc(a));let l=a,u=!0;try{u=function(T){if(!Rc(T))return T;let k=Ir(T);return jh(k),k=W0(k),k}(l)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.
2This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md
3and paste the contents of this message in the report.
4Thank you!
5Filter Expression:
6${JSON.stringify(l,null,2)}
7        `)}let p=Ue[`filter_${s}`],m=Oc(u,p),v=null;if(m.result==="error")throw new Error(m.value.map(T=>`${T.key}: ${T.message}`).join(", "));v=(T,k,R)=>m.value.evaluate(T,k,{},R);let b=null,w=null;if(u!==l){let T=Oc(l,p);if(T.result==="error")throw new Error(T.value.map(k=>`${k.key}: ${k.message}`).join(", "));b=(k,R,L,V,B)=>T.value.evaluate(k,R,{},L,void 0,void 0,V,B),w=!Tc(T.value.expression)}return{filter:v,dynamicFilter:b||void 0,needGeometry:Z0(u),needFeature:!!w}}function W0(a){if(!Array.isArray(a))return a;let s=function(l){if(Mm.has(l[0])){for(let u=1;u<l.length;u++)if(Rc(l[u]))return!0}return l}(a);return s===!0?s:s.map(l=>W0(l))}function jh(a){let s=!1,l=[];if(a[0]==="case"){for(let u=1;u<a.length-1;u+=2)s=s||Rc(a[u]),l.push(a[u+1]);l.push(a[a.length-1])}else if(a[0]==="match"){s=s||Rc(a[1]);for(let u=2;u<a.length-1;u+=2)l.push(a[u+1]);l.push(a[a.length-1])}else if(a[0]==="step"){s=s||Rc(a[1]);for(let u=1;u<a.length-1;u+=2)l.push(a[u+1])}s&&(a.length=0,a.push("any",...l));for(let u=1;u<a.length;u++)jh(a[u])}function Rc(a){if(!Array.isArray(a))return!1;if((s=a[0])==="pitch"||s==="distance-from-center")return!0;var s;for(let l=1;l<a.length;l++)if(Rc(a[l]))return!0;return!1}let Mm=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Z1(a,s){return a<s?-1:a>s?1:0}function Z0(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(let s=1;s<a.length;s++)if(Z0(a[s]))return!0;return!1}function Lc(a){if(!a)return!0;let s=a[0];return a.length<=1?s!=="any":s==="=="?km(a[1],a[2],"=="):s==="!="?Vh(km(a[1],a[2],"==")):s==="<"||s===">"||s==="<="||s===">="?km(a[1],a[2],s):s==="any"?(l=a.slice(1),["any"].concat(l.map(Lc))):s==="all"?["all"].concat(a.slice(1).map(Lc)):s==="none"?["all"].concat(a.slice(1).map(Lc).map(Vh)):s==="in"?Am(a[1],a.slice(2)):s==="!in"?Vh(Am(a[1],a.slice(2))):s==="has"?Pm(a[1]):s==="!has"?Vh(Pm(a[1])):s!=="within"||a;var l}function km(a,s,l){switch(a){case"$type":return[`filter-type-${l}`,s];case"$id":return[`filter-id-${l}`,s];default:return[`filter-${l}`,a,s]}}function Am(a,s){if(s.length===0)return!1;switch(a){case"$type":return["filter-type-in",["literal",s]];case"$id":return["filter-id-in",["literal",s]];default:return s.length>200&&!s.some(l=>typeof l!=typeof s[0])?["filter-in-large",a,["literal",s.sort(Z1)]]:["filter-in-small",a,["literal",s]]}}function Pm(a){switch(a){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",a]}}function Vh(a){return["!",a]}function ad(a){return Dm(Ir(a.value))?Dr(aa({},a,{expressionContext:"filter",valueSpec:a.styleSpec[`filter_${a.layerType||"fill"}`]})):ld(a)}function ld(a){let s=a.value,l=a.key;if(Zi(s)!=="array")return[new Mt(l,s,`array expected, ${Zi(s)} found`)];let u=a.styleSpec,p,m=[];if(s.length<1)return[new Mt(l,s,"filter array must have at least 1 element")];switch(m=m.concat(Nh({key:`${l}[0]`,value:s[0],valueSpec:u.filter_operator,style:a.style,styleSpec:a.styleSpec})),lr(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&lr(s[1])==="$type"&&m.push(new Mt(l,s,`"$type" cannot be use with operator "${s[0]}"`));case"==":case"!=":s.length!==3&&m.push(new Mt(l,s,`filter array for operator "${s[0]}" must have 3 elements`));case"in":case"!in":s.length>
7=2&&(p=Zi(s[1]),p!=="string"&&m.push(new Mt(`${l}[1]`,s[1],`string expected, ${p} found`)));for(let v=2;v<s.length;v++)p=Zi(s[v]),lr(s[1])==="$type"?m=m.concat(Nh({key:`${l}[${v}]`,value:s[v],valueSpec:u.geometry_type,style:a.style,styleSpec:a.styleSpec})):p!=="string"&&p!=="number"&&p!=="boolean"&&m.push(new Mt(`${l}[${v}]`,s[v],`string, number, or boolean expected, ${p} found`));break;case"any":case"all":case"none":for(let v=1;v<s.length;v++)m=m.concat(ld({key:`${l}[${v}]`,value:s[v],style:a.style,styleSpec:a.styleSpec}));break;case"has":case"!has":p=Zi(s[1]),s.length!==2?m.push(new Mt(l,s,`filter array for "${s[0]}" operator must have 2 elements`)):p!=="string"&&m.push(new Mt(`${l}[1]`,s[1],`string expected, ${p} found`));break;case"within":p=Zi(s[1]),s.length!==2?m.push(new Mt(l,s,`filter array for "${s[0]}" operator must have 2 elements`)):p!=="object"&&m.push(new Mt(`${l}[1]`,s[1],`object expected, ${p} found`))}return m}function Om(a,s){let l=a.key,u=a.style,p=a.styleSpec,m=a.value,v=a.objectKey,b=p[`${s}_${a.layerType}`];if(!b)return[];let w=v.match(/^(.*)-transition$/);if(s==="paint"&&w&&b[w[1]]&&b[w[1]].transition)return Kr({key:l,value:m,valueSpec:p.transition,style:u,styleSpec:p});let T=a.valueSpec||b[v];if(!T)return[new Mt(l,m,`unknown property "${v}"`)];let k;if(Zi(m)==="string"&&kc(T)&&!T.tokens&&(k=/^{([^}]+)}$/.exec(m))){let L=`\`{ "type": "identity", "property": ${k?JSON.stringify(k[1]):'"_"'} }\``;return[new Mt(l,m,`"${v}" does not support interpolation syntax
8Use an identity property function instead: ${L}.`)]}let R=[];return a.layerType==="symbol"&&(v==="text-field"&&u&&!u.glyphs&&R.push(new Mt(l,m,'use of "text-field" requires a style "glyphs" property')),v==="text-font"&&td(Ir(m))&&lr(m.type)==="identity"&&R.push(new Mt(l,m,'"text-font" does not support identity functions'))),R.concat(Kr({key:a.key,value:m,valueSpec:T,style:u,styleSpec:p,expressionContext:"property",propertyType:s,propertyKey:v}))}function K0(a){return Om(a,"paint")}function Rm(a){return Om(a,"layout")}function X0(a){let s=[],l=a.value,u=a.key,p=a.style,m=a.styleSpec;l.type||l.ref||s.push(new Mt(u,l,'either "type" or "ref" is required'));let v=lr(l.type),b=lr(l.ref);if(l.id){let w=lr(l.id);for(let T=0;T<a.arrayIndex;T++){let k=p.layers[T];lr(k.id)===w&&s.push(new Mt(u,l.id,`duplicate layer id "${l.id}", previously used at line ${k.id.__line__}`))}}if("ref"in l){let w;["type","source","source-layer","filter","layout"].forEach(T=>{T in l&&s.push(new Mt(u,l[T],`"${T}" is prohibited for ref layers`))}),p.layers.forEach(T=>{lr(T.id)===b&&(w=T)}),w?w.ref?s.push(new Mt(u,l.ref,"ref cannot reference another ref layer")):v=lr(w.type):typeof b=="string"&&s.push(new Mt(u,l.ref,`ref layer "${b}" not found`))}else if(v!=="background"&&v!=="sky")if(l.source){let w=p.sources&&p.sources[l.source],T=w&&lr(w.type);w?T==="vector"&&v==="raster"?s.push(new Mt(u,l.source,`layer "${l.id}" requires a raster source`)):T==="raster"&&v!=="raster"?s.push(new Mt(u,l.source,`layer "${l.id}" requires a vector source`)):T!=="vector"||l["source-layer"]?T==="raster-dem"&&v!=="hillshade"?s.push(new Mt(u,l.source,"raster-dem source can only be used with layer type 'hillshade'.")):v!=="line"||!l.paint||!l.paint["line-gradient"]&&!l.paint["line-trim-offset"]||T==="geojson"&&w.lineMetrics||s.push(new Mt(u,l,`layer "${l.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):s.push(new Mt(u,l,`layer "${l.id}" must specify a "source-layer"`)):s.push(new Mt(u,l.source,`source "${l.source}" not found`))}else s.push(new Mt(u,l,'missing required property "source"'));return s=s.concat(cs({key:u,value:l,valueSpec:m.layer,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Kr({key:`${u}.type`,value:l.type,valueSpec:m.layer.type,style:a.style,styleSpec:a.styleSpec,object:l,objectKey:"type"}),filter:w=>
8ad(aa({layerType:v},w)),layout:w=>cs({layer:l,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":T=>Rm(aa({layerType:v},T))}}),paint:w=>cs({layer:l,key:w.key,value:w.value,valueSpec:{},style:w.style,styleSpec:w.styleSpec,objectElementValidators:{"*":T=>K0(aa({layerType:v},T))}})}})),s}function Ba(a){let s=a.value,l=a.key,u=Zi(s);return u!=="string"?[new Mt(l,s,`string expected, ${u} found`)]:[]}let Y0={promoteId:function({key:a,value:s}){if(Zi(s)==="string")return Ba({key:a,value:s});{let l=[];for(let u in s)l.push(...Ba({key:`${a}.${u}`,value:s[u]}));return l}}};function Q0(a){let s=a.value,l=a.key,u=a.styleSpec,p=a.style;if(!s.type)return[new Mt(l,s,'"type" is required')];let m=lr(s.type),v;switch(m){case"vector":case"raster":case"raster-dem":return v=cs({key:l,value:s,valueSpec:u[`source_${m.replace("-","_")}`],style:a.style,styleSpec:u,objectElementValidators:Y0}),v;case"geojson":if(v=cs({key:l,value:s,valueSpec:u.source_geojson,style:p,styleSpec:u,objectElementValidators:Y0}),s.cluster)for(let b in s.clusterProperties){let[w,T]=s.clusterProperties[b],k=typeof w=="string"?[w,["accumulated"],["get",b]]:w;v.push(...Dr({key:`${l}.${b}.map`,value:T,expressionContext:"cluster-map"})),v.push(...Dr({key:`${l}.${b}.reduce`,value:k,expressionContext:"cluster-reduce"}))}return v;case"video":return cs({key:l,value:s,valueSpec:u.source_video,style:p,styleSpec:u});case"image":return cs({key:l,value:s,valueSpec:u.source_image,style:p,styleSpec:u});case"canvas":return[new Mt(l,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Nh({key:`${l}.type`,value:s.type,valueSpec:{values:K1(u)},style:p,styleSpec:u})}}function K1(a){return a.source.reduce((s,l)=>{let u=a[l];return u.type.type==="enum"&&(s=s.concat(Object.keys(u.type.values))),s},[])}function J0(a){let s=a.value,l=a.styleSpec,u=l.light,p=a.style,m=[],v=Zi(s);if(s===void 0)return m;if(v!=="object")return m=m.concat([new Mt("light",s,`object expected, ${v} found`)]),m;for(let b in s){let w=b.match(/^(.*)-transition$/);m=m.concat(w&&u[w[1]]&&u[w[1]].transition?Kr({key:b,value:s[b],valueSpec:l.transition,style:p,styleSpec:l}):u[b]?Kr({key:b,value:s[b],valueSpec:u[b],style:p,styleSpec:l}):[new Mt(b,s[b],`unknown property "${b}"`)])}return m}function Lm(a){let s=a.value,l=a.key,u=a.style,p=a.styleSpec,m=p.terrain,v=[],b=Zi(s);if(s===void 0)return v;if(b!=="object")return v=v.concat([new Mt("terrain",s,`object expected, ${b} found`)]),v;for(let w in s){let T=w.match(/^(.*)-transition$/);v=v.concat(T&&m[T[1]]&&m[T[1]].transition?Kr({key:w,value:s[w],valueSpec:p.transition,style:u,styleSpec:p}):m[w]?Kr({key:w,value:s[w],valueSpec:m[w],style:u,styleSpec:p}):[new Mt(w,s[w],`unknown property "${w}"`)])}if(s.source){let w=u.sources&&u.sources[s.source],T=w&&lr(w.type);w?T!=="raster-dem"&&v.push(new Mt(l,s.source,`terrain cannot be used with a source of type ${String(T)}, it only be used with a "raster-dem" source type`)):v.push(new Mt(l,s.source,`source "${s.source}" not found`))}else v.push(new Mt(l,s,'terrain is missing required property "source"'));return v}function ev(a){let s=a.value,l=a.style,u=a.styleSpec,p=u.fog,m=[],v=Zi(s);if(s===void 0)return m;if(v!=="object")return m=m.concat([new Mt("fog",s,`object expected, ${v} found`)]),m;for(let b in s){let w=b.match(/^(.*)-transition$/);m=m.concat(w&&p[w[1]]&&p[w[1]].transition?Kr({key:b,value:s[b],valueSpec:u.transition,style:l,styleSpec:u}):p[b]?Kr({key:b,value:s[b],valueSpec:p[b],style:l,styleSpec:u}):[new Mt(b,s[b],`unknown property "${b}"`)])}return m}let tv={"*":()=>[],array:q0,boolean:function(a){let s=a.value,l=a.key,u=Zi(s);return u!=="boolean"?[new Mt(l,s,`boolean expected, ${u} found`)]:[]},number:rd,color:function(a){let s=a.key,l=a.value,u=Zi(l);return u!=="string"?[new Mt(s,l,`color expected, ${u} found`)]:Jf(l)===null?[new Mt(s,l,`color expected, "${l}" found`)]:[]},enum:Nh,filter:ad,function:od,layer:X0,object:cs,source:Q0,light:J0,terrain:Lm,fog:ev,string:Ba,formatted:function(a){return Ba(a).length===0?[]:Dr(a)},resolvedImage:function(a){return Ba(a).length===0?[]:Dr(a)},projection:function(a){let s=a.value,l=a.styleSpec,u=l.projection,p=a.style,m=[],v=Zi(s);if(v==="object")for(let b in s)m=m.concat(Kr({key:b,value:s[b],valueSpec:u[b],style:p,styleSpec:l}));else v!=="string"&&(m=m.concat([new Mt("projection",s,`object or string expected, ${v}
8 found`)]));return m}};function Kr(a){let s=a.value,l=a.valueSpec,u=a.styleSpec;return l.expression&&td(lr(s))?od(a):l.expression&&Pc(Ir(s))?Dr(a):l.type&&tv[l.type]?tv[l.type](a):cs(aa({},a,{valueSpec:l.type?u[l.type]:l}))}function X1(a){let s=a.value,l=a.key,u=Ba(a);return u.length||(s.indexOf("{fontstack}")===-1&&u.push(new Mt(l,s,'"glyphs" url must include a "{fontstack}" token')),s.indexOf("{range}")===-1&&u.push(new Mt(l,s,'"glyphs" url must include a "{range}" token'))),u}function iv(a,s=Ue){return qo(Kr({key:"",value:a,valueSpec:s.$root,styleSpec:s,style:a,objectElementValidators:{glyphs:X1,"*":()=>[]}}))}let Y1=a=>qo(K0(a)),Q1=a=>qo(Rm(a));function qo(a){return a.slice().sort((s,l)=>s.line&&l.line?s.line-l.line:0)}function nv(a,s){let l=!1;if(s&&s.length)for(let u of s)a.fire(new sa(new Error(u.message))),l=!0;return l}var J1=Rs,us=3;function Rs(a,s,l){var u=this.cells=[];if(a instanceof ArrayBuffer){this.arrayBuffer=a;var p=new Int32Array(this.arrayBuffer);a=p[0],this.d=(s=p[1])+2*(l=p[2]);for(var m=0;m<this.d*this.d;m++){var v=p[us+m],b=p[us+m+1];u.push(v===b?null:p.subarray(v,b))}var w=p[us+u.length+1];this.keys=p.subarray(p[us+u.length],w),this.bboxes=p.subarray(w),this.insert=this._insertReadonly}else{this.d=s+2*l;for(var T=0;T<this.d*this.d;T++)u.push([]);this.keys=[],this.bboxes=[]}this.n=s,this.extent=a,this.padding=l,this.scale=s/a,this.uid=0;var k=l/s*a;this.min=-k,this.max=a+k}Rs.prototype.insert=function(a,s,l,u,p){this._forEachCell(s,l,u,p,this._insertCell,this.uid++),this.keys.push(a),this.bboxes.push(s),this.bboxes.push(l),this.bboxes.push(u),this.bboxes.push(p)},Rs.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Rs.prototype._insertCell=function(a,s,l,u,p,m){this.cells[p].push(m)},Rs.prototype.query=function(a,s,l,u,p){var m=this.min,v=this.max;if(a<=m&&s<=m&&v<=l&&v<=u&&!p)return Array.prototype.slice.call(this.keys);var b=[];return this._forEachCell(a,s,l,u,this._queryCell,b,{},p),b},Rs.prototype._queryCell=function(a,s,l,u,p,m,v,b){var w=this.cells[p];if(w!==null)for(var T=this.keys,k=this.bboxes,R=0;R<w.length;R++){var L=w[R];if(v[L]===void 0){var V=4*L;(b?b(k[V+0],k[V+1],k[V+2],k[V+3]):a<=k[V+2]&&s<=k[V+3]&&l>=k[V+0]&&u>=k[V+1])?(v[L]=!0,m.push(T[L])):v[L]=!1}}},Rs.prototype._forEachCell=function(a,s,l,u,p,m,v,b){for(var w=this._convertToCellCoord(a),T=this._convertToCellCoord(s),k=this._convertToCellCoord(l),R=this._convertToCellCoord(u),L=w;L<=k;L++)for(var V=T;V<=R;V++){var B=this.d*V+L;if((!b||b(this._convertFromCellCoord(L),this._convertFromCellCoord(V),this._convertFromCellCoord(L+1),this._convertFromCellCoord(V+1)))&&p.call(this,a,s,l,u,B,m,v,b))return}},Rs.prototype._convertFromCellCoord=function(a){return(a-this.padding)/this.scale},Rs.prototype._convertToCellCoord=function(a){return Math.max(0,Math.min(this.d-1,Math.floor(a*this.scale)+this.padding))},Rs.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var a=this.cells,s=us+this.cells.length+1+1,l=0,u=0;u<this.cells.length;u++)l+=this.cells[u].length;var p=new Int32Array(s+l+this.keys.length+this.bboxes.length);p[0]=this.extent,p[1]=this.n,p[2]=this.padding;for(var m=s,v=0;v<a.length;v++){var b=a[v];p[us+v]=m,p.set(b,m),m+=b.length}return p[us+a.length]=m,p.set(this.keys,m),p[us+a.length+1]=m+=this.keys.length,p.set(this.bboxes,m),m+=this.bboxes.length,p.buffer};var zl=at(J1);let Bh={};function Pt(a,s,l={}){Object.defineProperty(a,"_classRegistryKey",{value:s,writeable:!1}),Bh[s]={klass:a,omit:l.omit||[]}}Pt(Object,"Object"),zl.serialize=function(a,s){let l=a.toArrayBuffer();return s&&s.push(l),{buffer:l}},zl.deserialize=function(a){return new zl(a.buffer)},Object.defineProperty(zl,"name",{value:"Grid"}),Pt(zl,"Grid"),Pt(nr,"Color"),Pt(Error,"Error"),Pt(ja,"AJAXError"),Pt($o,"ResolvedImage"),Pt(Lh,"StylePropertyFunction"),Pt(Rh,"StyleExpression",{omit:["_evaluator"]}),Pt(id,"ZoomDependentExpression"),Pt(Im,"ZoomConstantExpression"),Pt(ua,"CompoundExpression",{omit:["_evaluate"]});for(let a in ed)Bh[ed[a]._classRegistryKey]||Pt(ed[a],`Expression${a}`);function Fm(a){return a&&typeof ArrayBuffer<"u"&&(a instanceof ArrayBuffer||a.constructor&&a.constructor.name==="ArrayBuffer")}function Nm(a){return d.ImageBitmap&&a instanceof d.ImageBitmap}function Fc(a,s){if(a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="str
8ing"||a instanceof Boolean||a instanceof Number||a instanceof String||a instanceof Date||a instanceof RegExp)return a;if(Fm(a)||Nm(a))return s&&s.push(a),a;if(ArrayBuffer.isView(a)){let l=a;return s&&s.push(l.buffer),l}if(a instanceof d.ImageData)return s&&s.push(a.data.buffer),a;if(Array.isArray(a)){let l=[];for(let u of a)l.push(Fc(u,s));return l}if(typeof a=="object"){let l=a.constructor,u=l._classRegistryKey;if(!u)throw new Error(`can't serialize object of unregistered class ${u}`);let p=l.serialize?l.serialize(a,s):{};if(!l.serialize){for(let m in a)a.hasOwnProperty(m)&&(Bh[u].omit.indexOf(m)>=0||(p[m]=Fc(a[m],s)));a instanceof Error&&(p.message=a.message)}if(p.$name)throw new Error("$name property is reserved for worker serialization logic.");return u!=="Object"&&(p.$name=u),p}throw new Error("can't serialize object of type "+typeof a)}function jl(a){if(a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"||a instanceof Boolean||a instanceof Number||a instanceof String||a instanceof Date||a instanceof RegExp||Fm(a)||Nm(a)||ArrayBuffer.isView(a)||a instanceof d.ImageData)return a;if(Array.isArray(a))return a.map(jl);if(typeof a=="object"){let s=a.$name||"Object",{klass:l}=Bh[s];if(!l)throw new Error(`can't deserialize unregistered class ${s}`);if(l.deserialize)return l.deserialize(a);let u=Object.create(l.prototype);for(let p of Object.keys(a))p!=="$name"&&(u[p]=jl(a[p]));return u}throw new Error("can't deserialize object of type "+typeof a)}let St={"Latin-1 Supplement":a=>a>=128&&a<=255,Arabic:a=>a>=1536&&a<=1791,"Arabic Supplement":a=>a>=1872&&a<=1919,"Arabic Extended-A":a=>a>=2208&&a<=2303,"Hangul Jamo":a=>a>=4352&&a<=4607,"Unified Canadian Aboriginal Syllabics":a=>a>=5120&&a<=5759,Khmer:a=>a>=6016&&a<=6143,"Unified Canadian Aboriginal Syllabics Extended":a=>a>=6320&&a<=6399,"General Punctuation":a=>a>=8192&&a<=8303,"Letterlike Symbols":a=>a>=8448&&a<=8527,"Number Forms":a=>a>=8528&&a<=8591,"Miscellaneous Technical":a=>a>=8960&&a<=9215,"Control Pictures":a=>a>=9216&&a<=9279,"Optical Character Recognition":a=>a>=9280&&a<=9311,"Enclosed Alphanumerics":a=>a>=9312&&a<=9471,"Geometric Shapes":a=>a>=9632&&a<=9727,"Miscellaneous Symbols":a=>a>=9728&&a<=9983,"Miscellaneous Symbols and Arrows":a=>a>=11008&&a<=11263,"CJK Radicals Supplement":a=>a>=11904&&a<=12031,"Kangxi Radicals":a=>a>=12032&&a<=12255,"Ideographic Description Characters":a=>a>=12272&&a<=12287,"CJK Symbols and Punctuation":a=>a>=12288&&a<=12351,Hiragana:a=>a>=12352&&a<=12447,Katakana:a=>a>=12448&&a<=12543,Bopomofo:a=>a>=12544&&a<=12591,"Hangul Compatibility Jamo":a=>a>=12592&&a<=12687,Kanbun:a=>a>=12688&&a<=12703,"Bopomofo Extended":a=>a>=12704&&a<=12735,"CJK Strokes":a=>a>=12736&&a<=12783,"Katakana Phonetic Extensions":a=>a>=12784&&a<=12799,"Enclosed CJK Letters and Months":a=>a>=12800&&a<=13055,"CJK Compatibility":a=>a>=13056&&a<=13311,"CJK Unified Ideographs Extension A":a=>a>=13312&&a<=19903,"Yijing Hexagram Symbols":a=>a>=19904&&a<=19967,"CJK Unified Ideographs":a=>a>=19968&&a<=40959,"Yi Syllables":a=>a>=40960&&a<=42127,"Yi Radicals":a=>a>=42128&&a<=42191,"Hangul Jamo Extended-A":a=>a>=43360&&a<=43391,"Hangul Syllables":a=>a>=44032&&a<=55215,"Hangul Jamo Extended-B":a=>a>=55216&&a<=55295,"Private Use Area":a=>a>=57344&&a<=63743,"CJK Compatibility Ideographs":a=>a>=63744&&a<=64255,"Arabic Presentation Forms-A":a=>a>=64336&&a<=65023,"Vertical Forms":a=>a>=65040&&a<=65055,"CJK Compatibility Forms":a=>a>=65072&&a<=65103,"Small Form Variants":a=>
8a>=65104&&a<=65135,"Arabic Presentation Forms-B":a=>a>=65136&&a<=65279,"Halfwidth and Fullwidth Forms":a=>a>=65280&&a<=65519};function zm(a){for(let s of a)if(jm(s.charCodeAt(0)))return!0;return!1}function ew(a){for(let s of a)if(!rv(s.charCodeAt(0)))return!1;return!0}function rv(a){return!(St.Arabic(a)||St["Arabic Supplement"](a)||St["Arabic Extended-A"](a)||St["Arabic Presentation Forms-A"](a)||St["Arabic Presentation Forms-B"](a))}function jm(a){return!(a!==746&&a!==747&&(a<4352||!(St["Bopomofo Extended"](a)||St.Bopomofo(a)||St["CJK Compatibility Forms"](a)&&!(a>=65097&&a<=65103)||St["CJK Compatibility Ideographs"](a)||St["CJK Compatibility"](a)||St["CJK Radicals Supplement"](a)||St["CJK Strokes"](a)||!(!St["CJK Symbols and Punctuation"](a)||a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||St["CJK Unified Ideographs Extension A"](a)||St["CJK Unified Ideographs"](a)||St["Enclosed CJK Letters and Months"](a)||St["Hangul Compatibility Jamo"](a)||St["Hangul Jamo Extended-A"](a)||St["Hangul Jamo Extended-B"](a)||St["Hangul Jamo"](a)||St["Hangul Syllables"](a)||St.Hiragana(a)||St["Ideographic Description Characters"](a)||St.Kanbun(a)||St["Kangxi Radicals"](a)||St["Katakana Phonetic Extensions"](a)||St.Katakana(a)&&a!==12540||!(!St["Halfwidth and Fullwidth Forms"](a)||a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||!(!St["Small Form Variants"](a)||a>=65112&&a<=65118||a>=65123&&a<=65126)||St["Unified Canadian Aboriginal Syllabics"](a)||St["Unified Canadian Aboriginal Syllabics Extended"](a)||St["Vertical Forms"](a)||St["Yijing Hexagram Symbols"](a)||St["Yi Syllables"](a)||St["Yi Radicals"](a))))}function ov(a){return!(jm(a)||function(s){return!!(St["Latin-1 Supplement"](s)&&(s===167||s===169||s===174||s===177||s===188||s===189||s===190||s===215||s===247)||St["General Punctuation"](s)&&(s===8214||s===8224||s===8225||s===8240||s===8241||s===8251||s===8252||s===8258||s===8263||s===8264||s===8265||s===8273)||St["Letterlike Symbols"](s)||St["Number Forms"](s)||St["Miscellaneous Technical"](s)&&(s>=8960&&s<=8967||s>=8972&&s<=8991||s>=8996&&s<=9e3||s===9003||s>=9085&&s<=9114||s>=9150&&s<=9165||s===9167||s>=9169&&s<=9179||s>=9186&&s<=9215)||St["Control Pictures"](s)&&s!==9251||St["Optical Character Recognition"](s)||St["Enclosed Alphanumerics"](s)||St["Geometric Shapes"](s)||St["Miscellaneous Symbols"](s)&&!(s>=9754&&s<=9759)||St["Miscellaneous Symbols and Arrows"](s)&&(s>=11026&&s<=11055||s>=11088&&s<=11097||s>=11192&&s<=11243)||St["CJK Symbols and Punctuation"](s)||St.Katakana(s)||St["Private Use Area"](s)||St["CJK Compatibility Forms"](s)||St["Small Form Variants"](s)||St["Halfwidth and Fullwidth Forms"](s)||s===8734||s===8756||s===8757||s>=9984&&s<=10087||s>=10102&&s<=10131||s===65532||s===65533)}(a))}function sv(a){return a>=1424&&a<=2303||St["Arabic Presentation Forms-A"](a)||St["Arabic Presentation Forms-B"](a)}function tw(a,s){return!(!s&&sv(a)||a>=2304&&a<=3583||a>=3840&&a<=4255||St.Khmer(a))}function iw(a){for(let s of a)if(sv(s.charCodeAt(0)))return!0;return!1}let Vm="deferred",Bm="loading",Um="loaded",Nc=null,f="unavailable",c=null,h=function(a){a&&typeof a=="string"&&a.indexOf("NetworkError")>-1&&(f="error"),Nc&&Nc(a)};function g(){y.fire(new Al("pluginStateChange",{pluginStatus:f,pluginURL:c}))}let y=new zu,x=function(){return f},I=function(){if(f!==Vm||!c)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");f=Bm,g(),c&&vc({url:c},a=>{a?h(a):(f=Um,g())})},D={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>f===Um||D.applyArabicShaping!=null,isLoading:()=>f===Bm,setState(a){f=a.pluginStatus,c=a.pluginURL},isParsed:()=>D.applyArabicShaping!=null&&D.processBidirectionalText!=null&&D.processStyledBidirectionalText!=null,getPluginURL:()=>c};class O{constructor(s,l){this.zoom=s,l?(this.now=l.now,this.fadeDuration=l.fadeDuration,this.transition=l.transition,this.pitch=l.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(s){return function(l,u){for(let p of l)if(!tw(p.charCo
8deAt(0),u))return!1;return!0}(s,D.isLoaded())}}class z{constructor(s,l){this.property=s,this.value=l,this.expression=function(u,p){if(td(u))return new Lh(u,p);if(Pc(u)){let m=nd(u,p);if(m.result==="error")throw new Error(m.value.map(v=>`${v.key}: ${v.message}`).join(", "));return m.value}{let m=u;return typeof u=="string"&&p.type==="color"&&(m=nr.parse(u)),{kind:"constant",evaluate:()=>m}}}(l===void 0?s.specification.default:l,s.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(s,l,u){return this.property.possiblyEvaluate(this,s,l,u)}}class F{constructor(s){this.property=s,this.value=new z(s,void 0)}transitioned(s,l){return new X(this.property,this.value,l,cn({},s.transition,this.transition),s.now)}untransitioned(){return new X(this.property,this.value,null,{},0)}}class U{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitionablePropertyValues)}getValue(s){return zr(this._values[s].value.value)}setValue(s,l){this._values.hasOwnProperty(s)||(this._values[s]=new F(this._values[s].property)),this._values[s].value=new z(this._values[s].property,l===null?void 0:zr(l))}getTransition(s){return zr(this._values[s].transition)}setTransition(s,l){this._values.hasOwnProperty(s)||(this._values[s]=new F(this._values[s].property)),this._values[s].transition=zr(l)||void 0}serialize(){let s={};for(let l of Object.keys(this._values)){let u=this.getValue(l);u!==void 0&&(s[l]=u);let p=this.getTransition(l);p!==void 0&&(s[`${l}-transition`]=p)}return s}transitioned(s,l){let u=new J(this._properties);for(let p of Object.keys(this._values))u._values[p]=this._values[p].transitioned(s,l._values[p]);return u}untransitioned(){let s=new J(this._properties);for(let l of Object.keys(this._values))s._values[l]=this._values[l].untransitioned();return s}}class X{constructor(s,l,u,p,m){let v=p.delay||0,b=p.duration||0;m=m||0,this.property=s,this.value=l,this.begin=m+v,this.end=this.begin+b,s.specification.transition&&(p.delay||p.duration)&&(this.prior=u)}possiblyEvaluate(s,l,u){let p=s.now||0,m=this.value.possiblyEvaluate(s,l,u),v=this.prior;if(v){if(p>this.end)return this.prior=null,m;if(this.value.isDataDriven())return this.prior=null,m;if(p<this.begin)return v.possiblyEvaluate(s,l,u);{let b=(p-this.begin)/(this.end-this.begin);return this.property.interpolate(v.possiblyEvaluate(s,l,u),m,jo(b))}}return m}}class J{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitioningPropertyValues)}possiblyEvaluate(s,l,u){let p=new ne(this._properties);for(let m of Object.keys(this._values))p._values[m]=this._values[m].possiblyEvaluate(s,l,u);return p}hasTransition(){for(let s of Object.keys(this._values))if(this._values[s].prior)return!0;return!1}}class te{constructor(s){this._properties=s,this._values=Object.create(s.defaultPropertyValues)}getValue(s){return zr(this._values[s].value)}setValue(s,l){this._values[s]=new z(this._values[s].property,l===null?void 0:zr(l))}serialize(){let s={};for(let l of Object.keys(this._values)){let u=this.getValue(l);u!==void 0&&(s[l]=u)}return s}possiblyEvaluate(s,l,u){let p=new ne(this._properties);for(let m of Object.keys(this._values))p._values[m]=this._values[m].possiblyEvaluate(s,l,u);return p}}class ee{constructor(s,l,u){this.property=s,this.value=l,this.parameters=u}isConstant(){return this.value.kind==="constant"}constantOr(s){return this.value.kind==="constant"?this.value.value:s}evaluate(s,l,u,p){return this.property.evaluate(this.value,this.parameters,s,l,u,p)}}class ne{constructor(s){this._properties=s,this._values=Object.create(s.defaultPossiblyEvaluatedValues)}get(s){return this._values[s]}}class H{constructor(s){this.specification=s}possiblyEvaluate(s,l){return s.expression.evaluate(l)}interpolate(s,l,u){let p=Ku[this.specification.type];return p?p(s,l,u):s}}class Q{constructor(s,l){this.specification=s,this.overrides=l}possiblyEvaluate(s,l,u,p){return new ee(this,s.expression.kind==="constant"||s.expression.kind==="camera"?{kind:"constant",value:s.expression.evaluate(l,null,{},u,p)}:s.expression,l)}interpolate(s,l,u){if(s.value.kind!=="constant"||l.value.kind!=="constant")return s;if(s.value.value===void 0||l.value.value===void 0)return new ee(this,{kind:"constant",value:void 0},s.parameters);let p=Ku[this.specification.type];return p?new ee(this,{kind:"constant",value:p(s.value.value,l.value.value,u)},s.parameters):s}evaluate(s,l,u,p,m,v){return s.kind==="constant"?s.value:s.evaluate(l,u,p,m,v)}}class le{constructor(s){this.specification=s}possiblyEvaluate(s,l,u,p){return!!s.expression.evaluate(l,null,{},u,p)}interpolate(){return!1}}class ue{constructor(s){this.properties=s,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];let l=new O(0,{});for(let u in s){let p=s[u];p.specification.overridable&&this.overridableProperties.push(u);let m=this.defaultPropertyValues[u]=new z(p,void 0),v=this.defaultTransitionablePropertyValues[u]=new F(p);this.defaultTransitioningPropertyValues[u]=v.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=m.possiblyEvaluate(l)}}}function ye(a,s){return 256*(a=pt(Math.floor(a),0,255))+pt(Math.floor(s),0,255)}Pt(Q,"DataDrivenProperty"),Pt(H,"DataConstantProperty"),Pt(le,"ColorRampProperty");let xe={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class be{constructor(s,l){this._structArray=s,this._pos1=l*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class De{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(s,l){return s._trim(),l&&(s.isTransferred=!0,l.push(s.arrayBuffer)),{length:s.length,arrayBuffer:s.arrayBuffer}}static deserialize(s){let l=Object.create(this.prototype);return l.arrayBuffer=s.arrayBuffer,l.length=s.length,l.capacity=s.arrayBuffer.byteLength/l.bytesPerElement,l._refreshViews(),l}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(s){this.reserve(s),this.length=s}reserve(s){if(s>this.capacity){this.capacity=Math.max(s,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let l=this.uint8;this._refreshViews(),l&&this.uint8.set(l)}}_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 Ie(a,s=1){let l=0,u=0;return{members:a.map(p=>{let m=xe[p.type].BYTES_PER_ELEMENT,v=l=Re(l,Math.max(s,m)),b=p.components||1;return u=Math.max(u,m),l+=m*b,{name:p.name,type:p.type,components:b,offset:v}}),size:Re(l,Math.max(u,s)),alignment:s}}
vendor: 13,564 bytes, line 8
8function Re(a,s){return Math.ceil(a/s)*s}class nt extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,l){let u=this.length;return this.resize(u+1),this.emplace(u,s,l)}emplace(s,l,u){let p=2*s;return this.int16[p+0]=l,this.int16[p+1]=u,s}}nt.prototype.bytesPerElement=4,Pt(nt,"StructArrayLayout2i4");class Ae extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,l,u){let p=this.length;return this.resize(p+1),this.emplace(p,s,l,u)}emplace(s,l,u,p){let m=3*s;return this.int16[m+0]=l,this.int16[m+1]=u,this.int16[m+2]=p,s}}Ae.prototype.bytesPerElement=6,Pt(Ae,"StructArrayLayout3i6");class Ze extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,l,u,p){let m=this.length;return this.resize(m+1),this.emplace(m,s,l,u,p)}emplace(s,l,u,p,m){let v=4*s;return this.int16[v+0]=l,this.int16[v+1]=u,this.int16[v+2]=p,this.int16[v+3]=m,s}}Ze.prototype.bytesPerElement=8,Pt(Ze,"StructArrayLayout4i8");class Ne extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,l,u,p,m,v,b){let w=this.length;return this.resize(w+1),this.emplace(w,s,l,u,p,m,v,b)}emplace(s,l,u,p,m,v,b,w){let T=6*s,k=12*s,R=3*s;return this.int16[T+0]=l,this.int16[T+1]=u,this.uint8[k+4]=p,this.uint8[k+5]=m,this.uint8[k+6]=v,this.uint8[k+7]=b,this.float32[R+2]=w,s}}Ne.prototype.bytesPerElement=12,Pt(Ne,"StructArrayLayout2i4ub1f12");class it extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,l,u,p){let m=this.length;return this.resize(m+1),this.emplace(m,s,l,u,p)}emplace(s,l,u,p,m){let v=4*s;return this.float32[v+0]=l,this.float32[v+1]=u,this.float32[v+2]=p,this.float32[v+3]=m,s}}it.prototype.bytesPerElement=16,Pt(it,"StructArrayLayout4f16");class Oe extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,l,u,p,m){let v=this.length;return this.resize(v+1),this.emplace(v,s,l,u,p,m)}emplace(s,l,u,p,m,v){let b=6*s,w=3*s;return this.uint16[b+0]=l,this.uint16[b+1]=u,this.uint16[b+2]=p,this.uint16[b+3]=m,this.float32[w+2]=v,s}}Oe.prototype.bytesPerElement=12,Pt(Oe,"StructArrayLayout4ui1f12");class qe extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,l,u,p){let m=this.length;return this.resize(m+1),this.emplace(m,s,l,u,p)}emplace(s,l,u,p,m){let v=4*s;return this.uint16[v+0]=l,this.uint16[v+1]=u,this.uint16[v+2]=p,this.uint16[v+3]=m,s}}qe.prototype.bytesPerElement=8,Pt(qe,"StructArrayLayout4ui8");class ot extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,l,u,p,m,v){let b=this.length;return this.resize(b+1),this.emplace(b,s,l,u,p,m,v)}emplace(s,l,u,p,m,v,b){let w=6*s;return this.int16[w+0]=l,this.int16[w+1]=u,this.int16[w+2]=p,this.int16[w+3]=m,this.int16[w+4]=v,this.int16[w+5]=b,s}}ot.prototype.bytesPerElement=12,Pt(ot,"StructArrayLayout6i12");class Je extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,l,u,p,m,v,b,w,T,k,R,L){let V=this.length;return this.resize(V+1),this.emplace(V,s,l,u,p,m,v,b,w,T,k,R,L)}emplace(s,l,u,p,m,v,b,w,T,k,R,L,V){let B=12*s;return this.int16[B+0]=l,this.int16[B+1]=u,this.int16[B+2]=p,this.int16[B+3]=m,this.uint16[B+4]=v,this.uint16[B+5]=b,this.uint16[B+6]=w,this.uint16[B+7]=T,this.int16[B+8]=k,this.int16[B+9]=R,this.int16[B+10]=L,this.int16[B+11]=V,s}}Je.prototype.bytesPerElement=24,Pt(Je,"StructArrayLayout4i4ui4i24");class lt extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,l,u,p,m,v){let b=this.length;return this.resize(b+1),this.emplace(b,s,l,u,p,m,v)}emplace(s,l,u,p,m,v,b){let w=10*s,T=5*s;return this.int16[w+0]=l,this.int16[w+1]=u,this.int16[w+2]=p,this.float32[T+2]=m,this.float32[T+3]=v,this.float32[T+4]=b,s}}lt.prototype.bytesPerElement=20,Pt(lt,"StructArrayLayout3i3f20");class zt extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(s){let l=this.length;return this.resize(l+1),this.emplace(l,s)}emplace(s,l){return this.uint32[1*s+0]=l,s}}zt.prototype.bytesPerElement=4,Pt(zt,"StructArrayLayout1ul4");class oi extends De{_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(s,l,u,p,m,v,b,w,T,k,R,L,V){let B=this.length;return this.resize(B+1),this.emplace(B,s,l,u,p,m,v,b,w,T,k,R,L,V)}emplace(s,l,u,p,m,v,b,w,T,k,R,L,V,B){let $=20*s,Y=10*s;return this.int16[$+0]=l,this.int16[$+1]=u,this.int16[$+2]=p,this.int16[$+3]=m,this.int16[$+4]=v,this.float32[Y+3]=b,this.float32[Y+4]=w,this.float32[Y+5]=T,this.float32[Y+6]=k,this.int16[$+14]=R,this.uint32[Y+8]=L,this.uint16[$+18]=V,this.uint16[$+19]=B,s}}oi.prototype.bytesPerElement=40,Pt(oi,"StructArrayLayout5i4f1i1ul2ui40");class Ot extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,l,u,p,m,v,b){let w=this.length;return this.resize(w+1),this.emplace(w,s,l,u,p,m,v,b)}emplace(s,l,u,p,m,v,b,w){let T=8*s;return this.int16[T+0]=l,this.int16[T+1]=u,this.int16[T+2]=p,this.int16[T+4]=m,this.int16[T+5]=v,this.int16[T+6]=b,this.int16[T+7]=w,s}}Ot.prototype.bytesPerElement=16,Pt(Ot,"StructArrayLayout3i2i2i16");class Gt extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,l,u,p,m){let v=this.length;return this.resize(v+1),this.emplace(v,s,l,u,p,m)}emplace(s,l,u,p,m,v){let b=4*s,w=8*s;return this.float32[b+0]=l,this.float32[b+1]=u,this.float32[b+2]=p,this.int16[w+6]=m,this.int16[w+7]=v,s}}Gt.prototype.bytesPerElement=16,Pt(Gt,"StructArrayLayout2f1f2i16");class Mi extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,l,u,p){let m=this.length;return this.resize(m+1),this.emplace(m,s,l,u,p)}emplace(s,l,u,p,m){let v=12*s,b=3*s;return this.uint8[v+0]=l,this.uint8[v+1]=u,this.float32[b+1]=p,this.float32[b+2]=m,s}}Mi.prototype.bytesPerElement=12,Pt(Mi,"StructArrayLayout2ub2f12");class Ci extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,l,u){let p=this.length;return this.resize(p+1),this.emplace(p,s,l,u)}emplace(s,l,u,p){let m=3*s;return this.float32[m+0]=l,this.float32[m+1]=u,this.float32[m+2]=p,s}}Ci.prototype.bytesPerElement=12,Pt(Ci,"StructArrayLayout3f12");class Nt extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,l,u){let p=this.length;return this.resize(p+1),this.emplace(p,s,l,u)}emplace(s,l,u,p){let m=3*s;return this.uint16[m+0]=l,this.uint16[m+1]=u,this.uint16[m+2]=p,s}}Nt.prototype.bytesPerElement=6,Pt(Nt,"StructArrayLayout3ui6");class an extends De{_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(s,l,u,p,m,v,b,w,T,k,R,L,V,B,$,Y,re,fe,oe,he,ge){let me=this.length;return this.resize(me+1),this.emplace(me,s,l,u,p,m,v,b,w,T,k,R,L,V,B,$,Y,re,fe,oe,he,ge)}emplace(s,l,u,p,m,v,b,w,T,k,R,L,V,B,$,Y,re,fe,oe,he,ge,me){let Le=30*s,Pe=15*s,He=60*s;return this.int16[Le+0]=l,this.int16[Le+1]=u,this.int16[Le+2]=p,this.float32[Pe+2]=m,this.float32[Pe+3]=v,this.uint16[Le+8]=b,this.uint16[Le+9]=w,this.uint32[Pe+5]=T,this.uint32[Pe+6]=k,this.uint32[Pe+7]=R,this.uint16[Le+16]=L,this.uint16[Le+17]=V,this.uint16[Le+18]=B,this.float32[Pe+10]=$,this.float32[Pe+11]=Y,this.uint8[He+48]=re,this.uint8[He+49]=fe,this.uint8[He+50]=oe,this.uint32[Pe+13]=he,this.int16[Le+28]=ge,this.uint8[He+58]=me,s}}an.prototype.bytesPerElement=60,Pt(an,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class gn extends De{_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(s,l,u,p,m,v,b,w,T,k,R,L,V,B,$,Y,re,fe,oe,he,ge,me,Le,Pe,He,rt,ze,Ke,Xe,et){let dt=this.length;return this.resize(dt+1),this.emplace(dt,s,l,u,p,m,v,b,w,T,k,R,L,V,B,$,Y,re,fe,oe,he,ge,me,Le,Pe,He,rt,ze,Ke,Xe,et)}emplace(s,l,u,p,m,v,b,w,T,k,R,L,V,B,$,Y,re,fe,oe,he,ge,me,Le,Pe,He,rt,ze,Ke,Xe,et,dt){let Be=38*s,xt=19*s;return this.int16[Be+0]=l,this.int16[Be+1]=u,this.int16[Be+2]=p,this.float32[xt+2]=m,this.float32[xt+3]=v,this.int16[Be+8]=b,this.int16[Be+9]=w,this.int16[Be+10]=T,this.int16[Be+11]=k,this.int16[Be+12]=R,this.int16[Be+13]=L,this.uint16[Be+14]=V,this.uint16[Be+15]=B,this.uint16[Be+16]=$,this.uint16[Be+17]=Y,this.uint16[Be+18]=re,this.uint16[Be+19]=fe,this.uint16[Be+20]=oe,this.uint16[Be+21]=he,this.uint16[Be+22]=ge,this.uint16[Be+23]=me,this.uint16[Be+24]=Le,this.uint16[Be+25]=Pe,this.uint16[Be+26]=He,this.uint16[Be+27]=rt,this.uint16[Be+28]=ze,this.uint32[xt+15]=Ke,this.float32[xt+16]=Xe,this.float32[xt+17]=et,this.float32[xt+18]=dt,s}}gn.prototype.bytesPerElement=76,Pt(gn,"StructArrayLayout3i2f6i15ui1ul3f76");class _n extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s){let l=this.length;return this.resize(l+1),this.emplace(l,s)}emplace(s,l){return this.float32[1*s+0]=l,s}}_n.prototype.bytesPerElement=4,Pt(_n,"StructArrayLayout1f4");class vn extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,l,u,p,m){let v=this.length;return this.resize(v+1),this.emplace(v,s,l,u,p,m)}emplace(s,l,u,p,m,v){let b=5*s;return this.float32[b+0]=l,this.float32[b+1]=u,this.float32[b+2]=p,this.float32[b+3]=m,this.float32[b+4]=v,s}}vn.prototype.bytesPerElement=20,Pt(vn,"StructArrayLayout5f20");class Xr extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,l,u,p){let m=this.length;return this.resize(m+1),this.emplace(m,s,l,u,p)}emplace(s,l,u,p,m){let v=6*s;return this.uint32[3*s+0]=l,this.uint16[v+2]=u,this.uint16[v+3]=p,this.uint16[v+4]=m,s}}Xr.prototype.bytesPerElement=12,Pt(Xr,"StructArrayLayout1ul3ui12");class Mr extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,l){let u=this.length;return this.resize(u+1),this.emplace(u,s,l)}emplace(s,l,u){let p=2*s;return this.uint16[p+0]=l,this.uint16[p+1]=u,s}}Mr.prototype.bytesPerElement=4,Pt(Mr,"StructArrayLayout2ui4");class Wo extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s){let l=this.length;return this.resize(l+1),this.emplace(l,s)}emplace(s,l){return this.uint16[1*s+0]=l,s}}Wo.prototype.bytesPerElement=2,Pt(Wo,"StructArrayLayout1ui2");class Ls extends De{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,l){let u=this.length;return this.resize(u+1),this.emplace(u,s,l)}emplace(s,l,u){let p=2*s;return this.float32[p+0]=l,this.float32[p+1]=u,s}}Ls.prototype.bytesPerElement=8,Pt(Ls,"StructArrayLayout2f8");class Nn extends be{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]}}Nn.prototype.size=40;class yn extends oi{get(s){return new Nn(this,s)}}Pt(yn,"CollisionBoxArray");class Qi extends be{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]}
vendor: 5,260 bytes, line 8
8get 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(s){this._structArray.uint8[this._pos1+49]=s}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(s){this._structArray.uint8[this._pos1+50]=s}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(s){this._structArray.uint32[this._pos4+13]=s}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(s){this._structArray.uint8[this._pos1+58]=s}}Qi.prototype.size=60;class cr extends an{get(s){return new Qi(this,s)}}Pt(cr,"PlacedSymbolArray");class co extends be{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(s){this._structArray.uint32[this._pos4+15]=s}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]}}co.prototype.size=76;class On extends gn{get(s){return new co(this,s)}}Pt(On,"SymbolInstanceArray");class _o extends _n{getoffsetX(s){return this.float32[1*s+0]}}Pt(_o,"GlyphOffsetArray");class Uh extends nt{getx(s){return this.int16[2*s+0]}gety(s){return this.int16[2*s+1]}}Pt(Uh,"SymbolLineVertexArray");class Vl extends be{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]}}Vl.prototype.size=12;class cd extends Xr{get(s){return new Vl(this,s)}}Pt(cd,"FeatureIndexArray");class ma extends Mr{geta_centroid_pos0(s){return this.uint16[2*s+0]}geta_centroid_pos1(s){return this.uint16[2*s+1]}}Pt(ma,"FillExtrusionCentroidArray");let Ua=Ie([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Bl=Ie([{name:"a_dash",components:4,type:"Uint16"}]);var Hh={exports:{}},ud={exports:{}};ud.exports=function(a,s){var l,u,p,m,v,b,w,T;for(u=a.length-(l=3&a.length),p=s,v=3432918353,b=461845907,T=0;T<u;)w=255&a.charCodeAt(T)|(255&a.charCodeAt(++T))<<8|(255&a.charCodeAt(++T))<<16|(255&a.charCodeAt(++T))<<24,++T,p=27492+(65535&(m=5*(65535&(p=(p^=w=(65535&(w=(w=(65535&w)*v+(((w>>>16)*v&65535)<<16)&4294967295)<<15|w>>>17))*b+(((w>>>16)*b&65535)<<16)&4294967295)<<13|p>>>19))+((5*(p>>>16)&65535)<<16)&4294967295))+((58964+(m>>>16)&65535)<<16);switch(w=0,l){case 3:w^=(255&a.charCodeAt(T+2))<<16;case 2:w^=(255&a.charCodeAt(T+1))<<8;case 1:p^=w=(65535&(w=(w=(65535&(w^=255&a.charCodeAt(T)))*v+(((w>>>16)*v&65535)<<16)&4294967295)<<15|w>>>17))*b+(((w>>>16)*b&65535)<<16)&4294967295}
8return p^=a.length,p=2246822507*(65535&(p^=p>>>16))+((2246822507*(p>>>16)&65535)<<16)&4294967295,p=3266489909*(65535&(p^=p>>>13))+((3266489909*(p>>>16)&65535)<<16)&4294967295,(p^=p>>>16)>>>0};var Hm=ud.exports,GD={exports:{}};GD.exports=function(a,s){for(var l,u=a.length,p=s^u,m=0;u>=4;)l=1540483477*(65535&(l=255&a.charCodeAt(m)|(255&a.charCodeAt(++m))<<8|(255&a.charCodeAt(++m))<<16|(255&a.charCodeAt(++m))<<24))+((1540483477*(l>>>16)&65535)<<16),p=1540483477*(65535&p)+((1540483477*(p>>>16)&65535)<<16)^(l=1540483477*(65535&(l^=l>>>24))+((1540483477*(l>>>16)&65535)<<16)),u-=4,++m;switch(u){case 3:p^=(255&a.charCodeAt(m+2))<<16;case 2:p^=(255&a.charCodeAt(m+1))<<8;case 1:p=1540483477*(65535&(p^=255&a.charCodeAt(m)))+((1540483477*(p>>>16)&65535)<<16)}return p=1540483477*(65535&(p^=p>>>13))+((1540483477*(p>>>16)&65535)<<16),(p^=p>>>15)>>>0};var qD=Hm,Jz=GD.exports;Hh.exports=qD,Hh.exports.murmur3=qD,Hh.exports.murmur2=Jz;var nw=at(Hh.exports);class av{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(s,l,u,p){this.ids.push(WD(s)),this.positions.push(l,u,p)}getPositions(s){let l=WD(s),u=0,p=this.ids.length-1;for(;u<p;){let v=u+p>>1;this.ids[v]>=l?p=v:u=v+1}let m=[];for(;this.ids[u]===l;)m.push({index:this.positions[3*u],start:this.positions[3*u+1],end:this.positions[3*u+2]}),u++;return m}static serialize(s,l){let u=new Float64Array(s.ids),p=new Uint32Array(s.positions);return rw(u,p,0,u.length-1),l&&l.push(u.buffer,p.buffer),{ids:u,positions:p}}static deserialize(s){let l=new av;return l.ids=s.ids,l.positions=s.positions,l.indexed=!0,l}}function WD(a){let s=+a;return!isNaN(s)&&Number.MIN_SAFE_INTEGER<=s&&s<=Number.MAX_SAFE_INTEGER?s:nw(String(a))}function rw(a,s,l,u){for(;l<u;){let p=a[l+u>>1],m=l-1,v=u+1;for(;;){do m++;while(a[m]<p);do v--;while(a[v]>p);if(m>=v)break;lv(a,m,v),lv(s,3*m,3*v),lv(s,3*m+1,3*v+1),lv(s,3*m+2,3*v+2)}v-l<u-v?(rw(a,s,l,v),l=v+1):(rw(a,s,v+1,u),u=v)}}function lv(a,s,l){let u=a[s];a[s]=a[l],a[l]=u}Pt(av,"FeaturePositionMap");class Ul{constructor(s){this.gl=s.gl,this.initialized=!1}fetchUniformLocation(s,l){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(s,l),this.initialized=!0),!!this.location}}class cv extends Ul{constructor(s){super(s),this.current=0}set(s,l,u){this.fetchUniformLocation(s,l)&&this.current!==u&&(this.current=u,this.gl.uniform1f(this.location,u))}}class ZD extends Ul{constructor(s){super(s),this.current=[0,0,0,0]}set(s,l,u){this.fetchUniformLocation(s,l)&&(u[0]===this.current[0]&&u[1]===this.current[1]&&u[2]===this.current[2]&&u[3]===this.current[3]||(this.current=u,this.gl.uniform4f(this.location,u[0],u[1],u[2],u[3])))}}class KD extends Ul{constructor(s){super(s),this.current=nr.transparent}set(s,l,u){this.fetchUniformLocation(s,l)&&(u.r===this.current.r&&u.g===this.current.g&&u.b===this.current.b&&u.a===this.current.a||(this.current=u,this.gl.uniform4f(this.location,u.r,u.g,u.b,u.a)))}}let ej=new Float32Array(16),tj=new Float32Array(9),ij=new Float32Array(4);function ow(a){return[ye(255*a.r,255*a.g),ye(255*a.b,255*a.a)]}class $m{constructor(s,l,u){this.value=s,this.uniformNames=l.map(p=>`u_${p}`),this.type=u}setUniform(s,l,u,p,m){l.set(s,m,p.constantOr(this.value))}getBinding(s,l){return this.type==="color"?new KD(s):new cv(s)}}class $h{constructor(s,l){this.uniformNames=l.map(u=>`u_${u}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(s){this.pixelRatio=s.pixelRatio||1,this.pattern=s.tl.concat(s.br)}setUniform(s,l,u,p,m){let v=m==="u_pattern"||m==="u_dash"?this.pattern:m==="u_pixel_ratio"?this.pixelRatio:null;v&&l.set(s,m,v)}getBinding(s,l){return l==="u_pattern"||l==="u_dash"?new ZD(s):new cv(s)}}class Hl{constructor(s,l,u,p){this.expression=s,this.type=u,this.maxValue=0,this.paintVertexAttributes=l.map(m=>({name:`a_${m}`,type:"Float32",components:u==="color"?2:1,offset:0})),this.paintVertexArray=new p}populatePaintArray(s,l,u,p,m,v){let b=this.paintVertexArray.length,w=this.expression.evaluate(new O(0),l,{},m,p,v);this.paintVertexArray.resize(s),this._setPaintValue(b,s,w)}updatePaintArray(s,l,u,p,m){let v=this.expression.evaluate({zoom:0},u,p,void 0,m);this._setPaintValue(s,l,v)}
8_setPaintValue(s,l,u){if(this.type==="color"){let p=ow(u);for(let m=s;m<l;m++)this.paintVertexArray.emplace(m,p[0],p[1])}else{for(let p=s;p<l;p++)this.paintVertexArray.emplace(p,u);this.maxValue=Math.max(this.maxValue,Math.abs(u))}}upload(s){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=s.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ga{constructor(s,l,u,p,m,v){this.expression=s,this.uniformNames=l.map(b=>`u_${b}_t`),this.type=u,this.useIntegerZoom=p,this.zoom=m,this.maxValue=0,this.paintVertexAttributes=l.map(b=>({name:`a_${b}`,type:"Float32",components:u==="color"?4:2,offset:0})),this.paintVertexArray=new v}populatePaintArray(s,l,u,p,m,v){let b=this.expression.evaluate(new O(this.zoom),l,{},m,p,v),w=this.expression.evaluate(new O(this.zoom+1),l,{},m,p,v),T=this.paintVertexArray.length;this.paintVertexArray.resize(s),this._setPaintValue(T,s,b,w)}updatePaintArray(s,l,u,p,m){let v=this.expression.evaluate({zoom:this.zoom},u,p,void 0,m),b=this.expression.evaluate({zoom:this.zoom+1},u,p,void 0,m);this._setPaintValue(s,l,v,b)}_setPaintValue(s,l,u,p){if(this.type==="color"){let m=ow(u),v=ow(p);for(let b=s;b<l;b++)this.paintVertexArray.emplace(b,m[0],m[1],v[0],v[1])}else{for(let m=s;m<l;m++)this.paintVertexArray.emplace(m,u,p);this.maxValue=Math.max(this.maxValue,Math.abs(u),Math.abs(p))}}upload(s){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=s.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(s,l,u,p,m){let v=this.useIntegerZoom?Math.floor(u.zoom):u.zoom,b=pt(this.expression.interpolationFactor(v,this.zoom,this.zoom+1),0,1);l.set(s,m,b)}getBinding(s,l){return new cv(s)}}class zc{constructor(s,l,u,p,m){this.expression=s,this.layerId=m,this.paintVertexAttributes=(u==="array"?Bl:Ua).members;for(let v=0;v<l.length;++v);this.paintVertexArray=new p}populatePaintArray(s,l,u){let p=this.paintVertexArray.length;this.paintVertexArray.resize(s),this._setPaintValues(p,s,l.patterns&&l.patterns[this.layerId],u)}updatePaintArray(s,l,u,p,m,v){this._setPaintValues(s,l,u.patterns&&u.patterns[this.layerId],v)}_setPaintValues(s,l,u,p){if(!p||!u)return;let m=p[u];if(!m)return;let{tl:v,br:b,pixelRatio:w}=m;for(let T=s;T<l;T++)this.paintVertexArray.emplace(T,v[0],v[1],b[0],b[1],w)}upload(s){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=s.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class jc{constructor(s,l,u=()=>!0){this.binders={},this._buffers=[];let p=[];for(let m in s.paint._values){if(!u(m))continue;let v=s.paint.get(m);if(!(v instanceof ee&&kc(v.property.specification)))continue;let b=rj(m,s.type),w=v.value,T=v.property.specification.type,k=!!v.property.useIntegerZoom,R=m==="line-dasharray"||m.endsWith("pattern"),L=m==="line-dasharray"&&s.layout.get("line-cap").value.kind!=="constant";if(w.kind!=="constant"||L)if(w.kind==="source"||L||R){let V=XD(m,T,"source");this.binders[m]=R?new zc(w,b,T,V,s.id):new Hl(w,b,T,V),p.push(`/a_${m}`)}else{let V=XD(m,T,"composite");this.binders[m]=new ga(w,b,T,k,l,V),p.push(`/z_${m}`)}else this.binders[m]=R?new $h(w.value,b):new $m(w.value,b,T),p.push(`/u_${m}`)}this.cacheKey=p.sort().join("")}getMaxValue(s){let l=this.binders[s];return l instanceof Hl||l instanceof ga?l.maxValue:0}populatePaintArrays(s,l,u,p,m,v){for(let b in this.binders){let w=this.binders[b];(w instanceof Hl||w instanceof ga||w instanceof zc)&&w.populatePaintArray(s,l,u,p,m,v)}}setConstantPatternPositions(s){for(let l in this.binders){let u=this.binders[l];u instanceof $h&&u.setConstantPatternPositions(s)}}updatePaintArrays(s,l,u,p,m,v){let b=!1;for(let w in s){let T=l.getPositions(w);for(let k of T){let R=u.feature(k.index);for(let L in this.binders){let V=this.binders[L];if((V instanceof Hl||V instanceof ga||V instanceof zc)&&V.expression.isStateDependent===!0){let B=p.paint.get(L);V.expression=B.value,V.updatePaintArray(k.start,k.end,R,s[w],m,v),b=!0}}}}return b}
8defines(){let s=[];for(let l in this.binders){let u=this.binders[l];(u instanceof $m||u instanceof $h)&&s.push(...u.uniformNames.map(p=>`#define HAS_UNIFORM_${p}`))}return s}getBinderAttributes(){let s=[];for(let l in this.binders){let u=this.binders[l];if(u instanceof Hl||u instanceof ga||u instanceof zc)for(let p=0;p<u.paintVertexAttributes.length;p++)s.push(u.paintVertexAttributes[p].name)}return s}getBinderUniforms(){let s=[];for(let l in this.binders){let u=this.binders[l];if(u instanceof $m||u instanceof $h||u instanceof ga)for(let p of u.uniformNames)s.push(p)}return s}getPaintVertexBuffers(){return this._buffers}getUniforms(s){let l=[];for(let u in this.binders){let p=this.binders[u];if(p instanceof $m||p instanceof $h||p instanceof ga)for(let m of p.uniformNames)l.push({name:m,property:u,binding:p.getBinding(s,m)})}return l}setUniforms(s,l,u,p,m){for(let{name:v,property:b,binding:w}of u)this.binders[b].setUniform(s,w,m,p.get(b),v)}updatePaintBuffers(){this._buffers=[];for(let s in this.binders){let l=this.binders[s];(l instanceof Hl||l instanceof ga||l instanceof zc)&&l.paintVertexBuffer&&this._buffers.push(l.paintVertexBuffer)}}upload(s){for(let l in this.binders){let u=this.binders[l];(u instanceof Hl||u instanceof ga||u instanceof zc)&&u.upload(s)}this.updatePaintBuffers()}destroy(){for(let s in this.binders){let l=this.binders[s];(l instanceof Hl||l instanceof ga||l instanceof zc)&&l.destroy()}}}class dd{constructor(s,l,u=()=>!0){this.programConfigurations={};for(let p of s)this.programConfigurations[p.id]=new jc(p,l,u);this.needsUpload=!1,this._featureMap=new av,this._bufferOffset=0}populatePaintArrays(s,l,u,p,m,v,b){for(let w in this.programConfigurations)this.programConfigurations[w].populatePaintArrays(s,l,p,m,v,b);l.id!==void 0&&this._featureMap.add(l.id,u,this._bufferOffset,s),this._bufferOffset=s,this.needsUpload=!0}updatePaintArrays(s,l,u,p,m){for(let v of u)this.needsUpload=this.programConfigurations[v.id].updatePaintArrays(s,this._featureMap,l,v,p,m)||this.needsUpload}get(s){return this.programConfigurations[s]}upload(s){if(this.needsUpload){for(let l in this.programConfigurations)this.programConfigurations[l].upload(s);this.needsUpload=!1}}destroy(){for(let s in this.programConfigurations)this.programConfigurations[s].destroy()}}let nj={"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 rj(a,s){return nj[a]||[a.replace(`${s}-`,"").replace(/-/g,"_")]}let oj={"line-pattern":{source:Oe,composite:Oe},"fill-pattern":{source:Oe,composite:Oe},"fill-extrusion-pattern":{source:Oe,composite:Oe},"line-dasharray":{source:qe,composite:qe}},sj={color:{source:Ls,composite:it},number:{source:_n,composite:Ls}};function XD(a,s,l){let u=oj[a];return u&&u[l]||sj[s][l]}Pt($m,"ConstantBinder"),Pt($h,"PatternConstantBinder"),Pt(Hl,"SourceExpressionBinder"),Pt(zc,"PatternCompositeBinder"),Pt(ga,"CompositeExpressionBinder"),Pt(jc,"ProgramConfiguration",{omit:["_buffers"]}),Pt(dd,"ProgramConfigurationSet");let YD="-transition";class _a extends zu{constructor(s,l){if(super(),this.id=s.id,this.type=s.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,s.type!=="custom"&&(this.metadata=s.metadata,this.minzoom=s.minzoom,this.maxzoom=s.maxzoom,s.type!=="background"&&s.type!=="sky"&&(this.source=s.source,this.sourceLayer=s["source-layer"],this.filter=s.filter),l.layout&&(this._unevaluatedLayout=new te(l.layout)),l.paint)){this._transitionablePaint=new U(l.paint);for(let u in s.paint)this.setPaintProperty(u,s.paint[u],{validate:!1});for(let u in s.layout)this.setLayoutProperty(u,s.layout[u],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ne(l.paint)}}getLayoutProperty(s){return s==="visibility"?this.visibility:this._unevaluatedLayout.getValue(s)}setLayoutProperty(s,l,u={}
8){l!=null&&this._validate(Q1,`layers.${this.id}.layout.${s}`,s,l,u)||(s!=="visibility"?this._unevaluatedLayout.setValue(s,l):this.visibility=l)}getPaintProperty(s){return fo(s,YD)?this._transitionablePaint.getTransition(s.slice(0,-11)):this._transitionablePaint.getValue(s)}setPaintProperty(s,l,u={}){if(l!=null&&this._validate(Y1,`layers.${this.id}.paint.${s}`,s,l,u))return!1;if(fo(s,YD))return this._transitionablePaint.setTransition(s.slice(0,-11),l||void 0),!1;{let p=this._transitionablePaint._values[s],m=p.value.isDataDriven(),v=p.value;this._transitionablePaint.setValue(s,l),this._handleSpecialPaintPropertyUpdate(s);let b=this._transitionablePaint._values[s].value,w=b.isDataDriven(),T=fo(s,"pattern")||s==="line-dasharray";return w||m||T||this._handleOverridablePaintPropertyUpdate(s,v,b)}}_handleSpecialPaintPropertyUpdate(s){}getProgramIds(){return null}getProgramConfiguration(s){return null}_handleOverridablePaintPropertyUpdate(s,l,u){return!1}isHidden(s){return!!(this.minzoom&&s<this.minzoom)||!!(this.maxzoom&&s>=this.maxzoom)||this.visibility==="none"}updateTransitions(s){this._transitioningPaint=this._transitionablePaint.transitioned(s,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(s,l){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(s,void 0,l)),this.paint=this._transitioningPaint.possiblyEvaluate(s,void 0,l)}
8serialize(){let s={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&&(s.layout=s.layout||{},s.layout.visibility=this.visibility),as(s,(l,u)=>!(l===void 0||u==="layout"&&!Object.keys(l).length||u==="paint"&&!Object.keys(l).length))}_validate(s,l,u,p,m={}){return(!m||m.validate!==!1)&&nv(this,s.call(iv,{key:l,layerType:this.type,objectKey:u,value:p,styleSpec:Ue,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let s in this.paint._values){let l=this.paint.get(s);if(l instanceof ee&&kc(l.property.specification)&&(l.value.kind==="source"||l.value.kind==="composite")&&l.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=zh(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}let aj=Ie([{name:"a_pos",components:2,type:"Int16"}],4),lj=Ie([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class ur{constructor(s=[]){this.segments=s}prepareSegment(s,l,u,p){let m=this.segments[this.segments.length-1];return s>ur.MAX_VERTEX_ARRAY_LENGTH&&Un(`Max vertices per segment is ${ur.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${s}`),(!m||m.vertexLength+s>ur.MAX_VERTEX_ARRAY_LENGTH||m.sortKey!==p)&&(m={vertexOffset:l.length,primitiveOffset:u.length,vertexLength:0,primitiveLength:0},p!==void 0&&(m.sortKey=p),this.segments.push(m)),m}get(){return this.segments}destroy(){for(let s of this.segments)for(let l in s.vaos)s.vaos[l].destroy()}static simpleSegment(s,l,u,p){return new ur([{vertexOffset:s,primitiveOffset:l,vertexLength:u,primitiveLength:p,vaos:{},sortKey:0}])}}ur.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Pt(ur,"SegmentVector");var Ut=8192;class Vc{constructor(s,l){s&&(l?this.setSouthWest(s).setNorthEast(l):s.length===4?this.setSouthWest([s[0],s[1]]).setNorthEast([s[2],s[3]]):this.setSouthWest(s[0]).setNorthEast(s[1]))}setNorthEast(s){return this._ne=s instanceof bn?new bn(s.lng,s.lat):bn.convert(s),this}setSouthWest(s){return this._sw=s instanceof bn?new bn(s.lng,s.lat):bn.convert(s),this}extend(s){let l=this._sw,u=this._ne,p,m;if(s instanceof bn)p=s,m=s;else{if(!(s instanceof Vc))return Array.isArray(s)?s.length===4||s.every(Array.isArray)?this.extend(Vc.convert(s)):this.extend(bn.convert(s)):typeof s=="object"&&s!==null&&s.hasOwnProperty("lat")&&(s.hasOwnProperty("lon")||s.hasOwnProperty("lng"))?this.extend(bn.convert(s)):this;if(p=s._sw,m=s._ne,!p||!m)return this}return l||u?(l.lng=Math.min(p.lng,l.lng),l.lat=Math.min(p.lat,l.lat),u.lng=Math.max(m.lng,u.lng),u.lat=Math.max(m.lat,u.lat)):(this._sw=new bn(p.lng,p.lat),this._ne=new bn(m.lng,m.lat)),this}getCenter(){return new bn((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 bn(this.getWest(),this.getNorth())}getSouthEast(){return new bn(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(s){let{lng:l,lat:u}=bn.convert(s),p=this._sw.lng<=l&&l<=this._ne.lng;return this._sw.lng>this._ne.lng&&(p=this._sw.lng>=l&&l>=this._ne.lng),this._sw.lat<=u&&u<=this._ne.lat&&p}static convert(s){return!s||s instanceof Vc?s:new Vc(s)}}var uv=1e-6,Zo=typeof Float32Array<"u"?Float32Array:Array;function QD(){var a=new Zo(9);return Zo!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[5]=0,a[6]=0,a[7]=0),a[0]=1,a[4]=1,a[8]=1,a}function JD(a,s,l){var u=s[0],p=s[1],m=s[2],v=s[3],b=s[4],w=s[5],T=s[6],k=s[7],R=s[8],L=l[0],V=l[1],B=l[2],$=l[3],Y=l[4],re=l[5],fe=l[6],oe=l[7],he=l[8];return a[0]=L*u+V*v+B*T,a[1]=L*p+V*b+B*k,a[2]=L*m+V*w+B*R,a[3]=$*u+Y*v+re*T,a[4]=$*p+Y*b
vendor: 4,148 bytes, line 8
8+re*k,a[5]=$*m+Y*w+re*R,a[6]=fe*u+oe*v+he*T,a[7]=fe*p+oe*b+he*k,a[8]=fe*m+oe*w+he*R,a}function va(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function sw(a,s){var l=s[0],u=s[1],p=s[2],m=s[3],v=s[4],b=s[5],w=s[6],T=s[7],k=s[8],R=s[9],L=s[10],V=s[11],B=s[12],$=s[13],Y=s[14],re=s[15],fe=l*b-u*v,oe=l*w-p*v,he=l*T-m*v,ge=u*w-p*b,me=u*T-m*b,Le=p*T-m*w,Pe=k*$-R*B,He=k*Y-L*B,rt=k*re-V*B,ze=R*Y-L*$,Ke=R*re-V*$,Xe=L*re-V*Y,et=fe*Xe-oe*Ke+he*ze+ge*rt-me*He+Le*Pe;return et?(a[0]=(b*Xe-w*Ke+T*ze)*(et=1/et),a[1]=(p*Ke-u*Xe-m*ze)*et,a[2]=($*Le-Y*me+re*ge)*et,a[3]=(L*me-R*Le-V*ge)*et,a[4]=(w*rt-v*Xe-T*He)*et,a[5]=(l*Xe-p*rt+m*He)*et,a[6]=(Y*he-B*Le-re*oe)*et,a[7]=(k*Le-L*he+V*oe)*et,a[8]=(v*Ke-b*rt+T*Pe)*et,a[9]=(u*rt-l*Ke-m*Pe)*et,a[10]=(B*me-$*he+re*fe)*et,a[11]=(R*he-k*me-V*fe)*et,a[12]=(b*He-v*ze-w*Pe)*et,a[13]=(l*ze-u*He+p*Pe)*et,a[14]=($*oe-B*ge-Y*fe)*et,a[15]=(k*ge-R*oe+L*fe)*et,a):null}function hd(a,s,l){var u=s[0],p=s[1],m=s[2],v=s[3],b=s[4],w=s[5],T=s[6],k=s[7],R=s[8],L=s[9],V=s[10],B=s[11],$=s[12],Y=s[13],re=s[14],fe=s[15],oe=l[0],he=l[1],ge=l[2],me=l[3];return a[0]=oe*u+he*b+ge*R+me*$,a[1]=oe*p+he*w+ge*L+me*Y,a[2]=oe*m+he*T+ge*V+me*re,a[3]=oe*v+he*k+ge*B+me*fe,a[4]=(oe=l[4])*u+(he=l[5])*b+(ge=l[6])*R+(me=l[7])*$,a[5]=oe*p+he*w+ge*L+me*Y,a[6]=oe*m+he*T+ge*V+me*re,a[7]=oe*v+he*k+ge*B+me*fe,a[8]=(oe=l[8])*u+(he=l[9])*b+(ge=l[10])*R+(me=l[11])*$,a[9]=oe*p+he*w+ge*L+me*Y,a[10]=oe*m+he*T+ge*V+me*re,a[11]=oe*v+he*k+ge*B+me*fe,a[12]=(oe=l[12])*u+(he=l[13])*b+(ge=l[14])*R+(me=l[15])*$,a[13]=oe*p+he*w+ge*L+me*Y,a[14]=oe*m+he*T+ge*V+me*re,a[15]=oe*v+he*k+ge*B+me*fe,a}function Gm(a,s,l){var u,p,m,v,b,w,T,k,R,L,V,B,$=l[0],Y=l[1],re=l[2];return s===a?(a[12]=s[0]*$+s[4]*Y+s[8]*re+s[12],a[13]=s[1]*$+s[5]*Y+s[9]*re+s[13],a[14]=s[2]*$+s[6]*Y+s[10]*re+s[14],a[15]=s[3]*$+s[7]*Y+s[11]*re+s[15]):(p=s[1],m=s[2],v=s[3],b=s[4],w=s[5],T=s[6],k=s[7],R=s[8],L=s[9],V=s[10],B=s[11],a[0]=u=s[0],a[1]=p,a[2]=m,a[3]=v,a[4]=b,a[5]=w,a[6]=T,a[7]=k,a[8]=R,a[9]=L,a[10]=V,a[11]=B,a[12]=u*$+b*Y+R*re+s[12],a[13]=p*$+w*Y+L*re+s[13],a[14]=m*$+T*Y+V*re+s[14],a[15]=v*$+k*Y+B*re+s[15]),a}function pd(a,s,l){var u=l[0],p=l[1],m=l[2];return a[0]=s[0]*u,a[1]=s[1]*u,a[2]=s[2]*u,a[3]=s[3]*u,a[4]=s[4]*p,a[5]=s[5]*p,a[6]=s[6]*p,a[7]=s[7]*p,a[8]=s[8]*m,a[9]=s[9]*m,a[10]=s[10]*m,a[11]=s[11]*m,a[12]=s[12],a[13]=s[13],a[14]=s[14],a[15]=s[15],a}function aw(a,s,l){var u=Math.sin(l),p=Math.cos(l),m=s[4],v=s[5],b=s[6],w=s[7],T=s[8],k=s[9],R=s[10],L=s[11];return s!==a&&(a[0]=s[0],a[1]=s[1],a[2]=s[2],a[3]=s[3],a[12]=s[12],a[13]=s[13],a[14]=s[14],a[15]=s[15]),a[4]=m*p+T*u,a[5]=v*p+k*u,a[6]=b*p+R*u,a[7]=w*p+L*u,a[8]=T*p-m*u,a[9]=k*p-v*u,a[10]=R*p-b*u,a[11]=L*p-w*u,a}function dv(a,s,l){var u=Math.sin(l),p=Math.cos(l),m=s[0],v=s[1],b=s[2],w=s[3],T=s[8],k=s[9],R=s[10],L=s[11];return s!==a&&(a[4]=s[4],a[5]=s[5],a[6]=s[6],a[7]=s[7],a[12]=s[12],a[13]=s[13],a[14]=s[14],a[15]=s[15]),a[0]=m*p-T*u,a[1]=v*p-k*u,a[2]=b*p-R*u,a[3]=w*p-L*u,a[8]=m*u+T*p,a[9]=v*u+k*p,a[10]=b*u+R*p,a[11]=w*u+L*p,a}function eM(a,s){return a[0]=s[0],a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=s[1],a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s[2],a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function tM(a,s,l){var u,p,m,v=l[0],b=l[1],w=l[2],T=Math.hypot(v,b,w);return T<uv?null:(v*=T=1/T,b*=T,w*=T,u=Math.sin(s),p=Math.cos(s),a[0]=v*v*(m=1-p)+p,a[1]=b*v*m+w*u,a[2]=w*v*m-b*u,a[3]=0,a[4]=v*b*m-w*u,a[5]=b*b*m+p,a[6]=w*b*m+v*u,a[7]=0,a[8]=v*w*m+b*u,a[9]=b*w*m-v*u,a[10]=w*w*m+p,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a)}Math.hypot||(Math.hypot=function(){for(var a=0,s=arguments.length;s--;)a+=arguments[s]*arguments[s];return Math.sqrt(a)});var cj=hd;function lw(){var a=new Zo(3);return Zo!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),a}function iM(a){var s=new Zo(3);return s[0]=a[0],s[1]=a[1],s[2]=a[2],s}function qm(a){return Math.hypot(a[0],a[1],a[2])}function Gh(a,s,l){var u=new Zo(3);return u[0]=a,u[1]=s,u[2]=l,u}function $l(a,s,l){return a[0]=s[0]+l[0],a[1]=s[1]+l[1],a[2]=s[2]+l[2],a}function cw(a,s,l){return a[0]=s[0]-l[0],a[1]=s[1]-l[1],a[2]=s[2]-l[2],a}function nM(a,s,l){return a[0]=s[0]*l[0],a[1]=s[1]*l[1],a[2]=s[2]*l[2],a}
8function Wm(a,s,l){return a[0]=Math.min(s[0],l[0]),a[1]=Math.min(s[1],l[1]),a[2]=Math.min(s[2],l[2]),a}function Zm(a,s,l){return a[0]=Math.max(s[0],l[0]),a[1]=Math.max(s[1],l[1]),a[2]=Math.max(s[2],l[2]),a}function ds(a,s,l){return a[0]=s[0]*l,a[1]=s[1]*l,a[2]=s[2]*l,a}function Km(a,s,l,u){return a[0]=s[0]+l[0]*u,a[1]=s[1]+l[1]*u,a[2]=s[2]+l[2]*u,a}function vo(a,s){var l=s[0],u=s[1],p=s[2],m=l*l+u*u+p*p;return m>0&&(m=1/Math.sqrt(m)),a[0]=s[0]*m,a[1]=s[1]*m,a[2]=s[2]*m,a}function Fs(a,s){return a[0]*s[0]+a[1]*s[1]+a[2]*s[2]}function uw(a,s,l){var u=s[0],p=s[1],m=s[2],v=l[0],b=l[1],w=l[2];return a[0]=p*w-m*b,a[1]=m*v-u*w,a[2]=u*b-p*v,a}function rr(a,s,l){var u=s[0],p=s[1],m=s[2],v=l[3]*u+l[7]*p+l[11]*m+l[15];return a[0]=(l[0]*u+l[4]*p+l[8]*m+l[12])/(v=v||1),a[1]=(l[1]*u+l[5]*p+l[9]*m+l[13])/v,a[2]=(l[2]*u+l[6]*p+l[10]*m+l[14])/v,a}function rM(a,s,l){var u=l[0],p=l[1],m=l[2],v=s[0],b=s[1],w=s[2],T=p*w-m*b,k=m*v-u*w,R=u*b-p*v,L=p*R-m*k,V=m*T-u*R,B=u*k-p*T,$=2*l[3];return k*=$,R*=$,V*=2,B*=2,a[0]=v+(T*=$)+(L*=2),a[1]=b+k+V,a[2]=w+R+B,a}var Xm,ya=cw,uj=nM,dj=qm;function oM(a,s,l){return a[0]=s[0]*l,a[1]=s[1]*l,a[2]=s[2]*l,a[3]=s[3]*l,a}function sM(a,s){var l=s[0],u=s[1],p=s[2],m=s[3],v=l*l+u*u+p*p+m*m;return v>0&&(v=1/Math.sqrt(v)),a[0]=l*v,a[1]=u*v,a[2]=p*v,a[3]=m*v,a}function fd(a,s,l){var u=s[0],p=s[1],m=s[2],v=s[3];return a[0]=l[0]*u+l[4]*p+l[8]*m+l[12]*v,a[1]=l[1]*u+l[5]*p+l[9]*m+l[13]*v,a[2]=l[2]*u+l[6]*p+l[10]*m+l[14]*v,a[3]=l[3]*u+l[7]*p+l[11]*m+l[15]*v,a}function aM(){var a=new Zo(4);return Zo!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),a[3]=1,a}function lM(a){return a[0]=0,a[1]=0,a[2]=0,a[3]=1,a}function cM(a,s,l){l*=.5;var u=s[0],p=s[1],m=s[2],v=s[3],b=Math.sin(l),w=Math.cos(l);return a[0]=u*w+v*b,a[1]=p*w+m*b,a[2]=m*w-p*b,a[3]=v*w-u*b,a}function uM(a,s,l){l*=.5;var u=s[0],p=s[1],m=s[2],v=s[3],b=Math.sin(l),w=Math.cos(l);return a[0]=u*w-m*b,a[1]=p*w+v*b,a[2]=m*w+u*b,a[3]=v*w-p*b,a}lw(),Xm=new Zo(4),Zo!=Float32Array&&(Xm[0]=0,Xm[1]=0,Xm[2]=0,Xm[3]=0);var hj=sM;lw(),Gh(1,0,0),Gh(0,1,0),aM(),aM(),QD();let pj=Ie([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:dM}=pj,hM=Ie([{name:"a_pos_3",components:3,type:"Int16"}]);var Ym=Ie([{name:"a_pos",type:"Int16",components:2}]);class dw{constructor(s,l){this.pos=s,this.dir=l}intersectsPlane(s,l,u){let p=Fs(l,this.dir);if(Math.abs(p)<1e-6)return!1;let m=((s[0]-this.pos[0])*l[0]+(s[1]-this.pos[1])*l[1]+(s[2]-this.pos[2])*l[2])/p;return u[0]=this.pos[0]+this.dir[0]*m,u[1]=this.pos[1]+this.dir[1]*m,u[2]=this.pos[2]+this.dir[2]*m,!0}closestPointOnSphere(s,l,u){if(function(V,B){var $=V[0],Y=V[1],re=V[2],fe=B[0],oe=B[1],he=B[2];return Math.abs($-fe)<=uv*Math.max(1,Math.abs($),Math.abs(fe))&&Math.abs(Y-oe)<=uv*Math.max(1,Math.abs(Y),Math.abs(oe))&&Math.abs(re-he)<=uv*Math.max(1,Math.abs(re),Math.abs(he))}(this.pos,s)||l===0)return u[0]=u[1]=u[2]=0,!1;let[p,m,v]=this.dir,b=this.pos[0]-s[0],w=this.pos[1]-s[1],T=this.pos[2]-s[2],k=p*p+m*m+v*v,R=2*(b*p+w*m+T*v),L=R*R-4*k*(b*b+w*w+T*T-l*l);if(L<0){let V=Math.max(-R/2,0),B=b+p*V,$=w+m*V,Y=T+v*V,re=Math.hypot(B,$,Y);return u[0]=B*l/re,u[1]=$*l/re,u[2]=Y*l/re,!1}{let V=(-R-Math.sqrt(L))/(2*k);if(V<0){let B=Math.hypot(b,w,T);return u[0]=b*l/B,u[1]=w*l/B,u[2]=T*l/B,!1}return u[0]=b+p*V,u[1]=w+m*V,u[2]=T+v*V,!0}}}class hw{constructor(s,l,u,p,m){this.TL=s,this.TR=l,this.BR=u,this.BL=p,this.horizon=m}static fromInvProjectionMatrix(s,l,u){let p=[-1,1,1],m=[1,1,1],v=[1,-1,1],b=[-1,-1,1],w=rr(p,p,s),T=rr(m,m,s),k=rr(v,v,s),R=rr(b,b,s);return new hw(w,T,k,R,l/u)}}class pw{constructor(s,l){this.points=s,this.planes=l}static fromInvProjectionMatrix(s,l,u,p){let m=Math.pow(2,u),v=[[-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(w=>{let T=fd([],w,s),k=1/T[3]/l*m;return function(R,L,V){return R[0]=L[0]*V[0],R[1]=L[1]*V[1],R[2]=L[2]*V[2],R[3]=L[3]*V[3],R}(T,T,[k,k,p?1/T[3]:k,k])}),b=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(w=>{let T=vo([],uw([],ya([],v[w[0]],v[w[1]]),ya([],v[w[2]],v[w[1]]))),k=-Fs(T,v[w[1]]);return T.concat(k)});return new pw(v,b)}}class yo{static fromPoints(s){let l=[1/0,1/0,1/0],u=[-1/0,-1/0,-1/0];for(let p of s)Wm(l,l,p),Zm(u,u,p);return new yo(l,u)}static applyTransform(s,l){let u=s.getCorners();for(let p=0;p<u.length;++p)rr(u[p],u[p],l);return yo.fromPoints(u)}constructor(s,l){this.min=s,this.max=l,this.center=ds([],$l([],this.min,this.max),.5)}quadrant(s){let l=[s%2==0,s<2],u=iM(this.min),p=iM(this.max);for(let m=0;m<l.length;m++)u[m]=l[m]?this.min[m]:this.center[m],p[m]=l[m]?this.center[m]:this.max[m];return p[2]=this.max[2],new yo(u,p)}distanceX(s){return Math.max(Math.min(this.max[0],s[0]),this.min[0])-s[0]}distanceY(s){return Math.max(Math.min(this.max[1],s[1]),this.min[1])-s[1]}distanceZ(s){return Math.max(Math.min(this.max[2],s[2]),this.min[2])-s[2]}getCorners(){let s=this.min,l=this.max;return[[s[0],s[1],s[2]],[l[0],s[1],s[2]],[l[0],l[1],s[2]],[s[0],l[1],s[2]],[s[0],s[1],l[2]],[l[0],s[1],l[2]],[l[0],l[1],l[2]],[s[0],l[1],l[2]]]}intersects(s){let l=this.getCorners(),u=!0;for(let p=0;p<s.planes.length;p++){let m=s.planes[p],v=0;for(let b=0;b<l.length;b++)v+=Fs(m,l[b])+m[3]>=0;if(v===0)return 0;v!==l.length&&(u=!1)}if(u)return 2;for(let p=0;p<3;p++){let m=Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let b=0;b<s.points.length;b++){let w=s.points[b][p]-this.min[p];m=Math.min(m,w),v=Math.max(v,w)}if(v<0||m>this.max[p]-this.min[p])return 0}return 1}}let fw=5,pM=6,Ha=Ut/Math.PI/2,fj=16383,md=64,Qm=[md,32,16],Ns=-Ha,zs=Ha,mj=[new yo([Ns,Ns,Ns],[zs,zs,zs]),new yo([Ns,Ns,Ns],[0,0,zs]),new yo([0,Ns,Ns],[zs,0,zs]),new yo([Ns,0,Ns],[0,zs,zs]),new yo([0,0,Ns],[zs,zs,zs])];function hv(a){return a*Ha/tg}function fM(a,s,l,u=!0){let p=ds([],a._camera.position,a.worldSize),m=[s,l,1,1];fd(m,m,a.pixelMatrixInverse),oM(m,m,1/m[3]);let v=vo([],ya([],m,p)),b=a.globeMatrix,w=[b[12],b[13],b[14]],T=ya([],w,p),
8k=qm(T),R=vo([],T),L=a.worldSize/(2*Math.PI),V=Fs(R,v),B=Math.asin(L/k);if(B<Math.acos(V)){if(!u)return null;let rt=[],ze=[];ds(rt,v,k/V),vo(ze,ya(ze,rt,T)),vo(v,$l(v,T,ds(v,ze,Math.tan(B)*k)))}let $=[];new dw(p,v).closestPointOnSphere(w,L,$);let Y=vo([],Na(b,0)),re=vo([],Na(b,1)),fe=vo([],Na(b,2)),oe=Fs(Y,$),he=Fs(re,$),ge=Fs(fe,$),me=sr(Math.asin(-he/L)),Le=sr(Math.atan2(oe,ge));Le=a.center.lng+function(rt,ze){let Ke=(ze-rt+180)%360-180;return Ke<-180?Ke+360:Ke}(a.center.lng,Le);let Pe=Ga(Le),He=pt(qa(me),0,1);return new Kh(Pe,He)}class gj{constructor(s,l,u){this.a=ya([],s,u),this.b=ya([],l,u),this.center=u;let p=vo([],this.a),m=vo([],this.b);this.angle=Math.acos(Fs(p,m))}}function mw(a,s){if(a.angle===0)return null;let l;return l=a.a[s]===0?1/a.angle*.5*Math.PI:1/a.angle*Math.atan(a.b[s]/a.a[s]/Math.sin(a.angle)-1/Math.tan(a.angle)),l<0||l>1?null:function(u,p,m,v){let b=Math.sin(m);return u*(Math.sin((1-v)*m)/b)+p*(Math.sin(v*m)/b)}(a.a[s],a.b[s],a.angle,pt(l,0,1))+a.center[s]}function $a(a){if(a.z<=1)return mj[a.z+2*a.y+a.x];let s=gw(pv(a));return yo.fromPoints(s)}function gd(a,s,l){return ds(a,a,1-l),Km(a,a,s,l)}function mM(a,s){let l=Zh(s.zoom);if(l===0)return $a(a);let u=pv(a),p=gw(u),m=Ga(u.getWest())*s.worldSize,v=Ga(u.getEast())*s.worldSize,b=qa(u.getNorth())*s.worldSize,w=qa(u.getSouth())*s.worldSize,T=[m,b,0],k=[v,b,0],R=[m,w,0],L=[v,w,0],V=sw([],s.globeMatrix);return rr(T,T,V),rr(k,k,V),rr(R,R,V),rr(L,L,V),p[0]=gd(p[0],R,l),p[1]=gd(p[1],L,l),p[2]=gd(p[2],k,l),p[3]=gd(p[3],T,l),yo.fromPoints(p)}function gM(a,s,l){for(let u of a)rr(u,u,s),ds(u,u,l)}function _j(a,s,l){let u=s/a.worldSize,p=a.globeMatrix;if(l.z<=1){let Pe=$a(l).getCorners();return gM(Pe,p,u),yo.fromPoints(Pe)}let m=pv(l),v=gw(m);gM(v,p,u);let b=Number.MAX_VALUE,w=[-b,-b,-b],T=[b,b,b];if(m.contains(a.center)){for(let rt of v)Wm(T,T,rt),Zm(w,w,rt);w[2]=0;let Pe=a.point,He=[Pe.x*u,Pe.y*u,0];return Wm(T,T,He),Zm(w,w,He),new yo(T,w)}let k=[p[12]*u,p[13]*u,p[14]*u],R=m.getCenter(),L=pt(a.center.lat,-Qr,Qr),V=pt(R.lat,-Qr,Qr),B=Ga(a.center.lng),$=qa(L),Y=B-Ga(R.lng),re=$-qa(V);Y>.5?Y-=1:Y<-.5&&(Y+=1);let fe=0;Math.abs(Y)>Math.abs(re)?fe=Y>=0?1:3:(fe=re>=0?0:2,Km(k,k,[p[4]*u,p[5]*u,p[6]*u],-Math.sin(ai(re>=0?m.getSouth():m.getNorth()))*Ha));let oe=v[fe],he=v[(fe+1)%4],ge=new gj(oe,he,k),me=[mw(ge,0)||oe[0],mw(ge,1)||oe[1],mw(ge,2)||oe[2]],Le=Zh(a.zoom);if(Le>0){let Pe=function({x:rt,y:ze,z:Ke},Xe,et,dt,Be){let xt=1/(1<<Ke),Rt=rt*xt,wt=Rt+xt,li=ze*xt,ht=li+xt,Vt=0,ci=(Rt+wt)/2-dt;return ci>.5?Vt=-1:ci<-.5&&(Vt=1),Rt=((Rt+Vt)*Xe-(dt*=Xe))*et+dt,wt=((wt+Vt)*Xe-dt)*et+dt,li=(li*Xe-(Be*=Xe))*et+Be,ht=(ht*Xe-Be)*et+Be,[[Rt,ht,0],[wt,ht,0],[wt,li,0],[Rt,li,0]]}(l,s,a._pixelsPerMercatorPixel,B,$);for(let rt=0;rt<v.length;rt++)gd(v[rt],Pe[rt],Le);let He=$l([],Pe[fe],Pe[(fe+1)%4]);ds(He,He,.5),gd(me,He,Le)}for(let Pe of v)Wm(T,T,Pe),Zm(w,w,Pe);return T[2]=Math.min(oe[2],he[2]),Wm(T,T,me),Zm(w,w,me),new yo(T,w)}function pv({x:a,y:s,z:l}){let u=1/(1<<l),p=new bn(hs(a*u),Yr((s+1)*u)),m=new bn(hs((a+1)*u),Yr(s*u));return new Vc(p,m)}function gw(a){let s=ai(a.getNorth()),l=ai(a.getSouth()),u=Math.cos(s),p=Math.cos(l),m=Math.sin(s),v=Math.sin(l),b=a.getWest(),w=a.getEast();return[qh(p,v,b),qh(p,v,w),qh(u,m,w),qh(u,m,b)]}function qh(a,s,l,u=Ha){return l=ai(l),[a*Math.sin(l)*u,-s*u,a*Math.cos(l)*u]}function Wh(a,s,l){return qh(Math.cos(ai(a)),Math.sin(ai(a)),s,l)}function Jm(a,s,l,u){let p=1<<l.z,m=(a/Ut+l.x)/p;return Wh(Yr((s/Ut+l.y)/p),hs(m),u)}function fv({min:a,max:s}){return fj/Math.max(s[0]-a[0],s[1]-a[1],s[2]-a[2])}let _M=new Float64Array(16);function eg(a){let s=fv(a),l=eM(_M,[s,s,s]);return Gm(l,l,((u=[])[0]=-(p=a.min)[0],u[1]=-p[1],u[2]=-p[2],u));var u,p}function _w(a){let s=(u=a.min,(l=_M)[0]=1,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=1,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=1,l[11]=0,l[12]=u[0],l[13]=u[1],l[14]=u[2],l[15]=1,l);var l,u;let p=1/fv(a);return pd(s,s,[p,p,p])}function vM(a,s,l,u,p){let m=function(w){let T=Ut/(2*Math.PI);return w/(2*Math.PI)/T}(l),v=[a,s,-l/(2*Math.PI)],b=va(new Float64Array(16));return Gm(b,b,v),pd(b,b,[m,m,m]),aw(b,b,ai(-p)),dv(b,b,ai(-u)),b}function Zh(a){return Zt(fw,pM,a)}function yM(a,s){let l=Wh(s.lat,s.lng),u=function(B){let $=Wh(B._center.lat,B._center.lng),Y=uw([],Gh(0,1,0),$),re=tM([],-B.angle,$);Y=rr(Y,Y,re),tM(re,-B._pitch,Y);let fe=vo([],$);return ds(fe,fe,hv(B.cameraToCenterDistance/B.pixelsPerMeter)),rr(fe,fe,re),$l([],$,fe)}(a);return v=(p=cw([],u,l))[0],b=p[1],w=p[2],T=(m=l)[0],k=m[1],R=m[2],V=(L=Math.sqrt(v*v+b*b+w*w)*Math.sqrt(T*T+k*k+R*R))&&Fs(p,m)/L,Math.acos(Math.min(Math.max(V,-1),1));var p,m,v,b,w,T,k,R,L,V}function vw(a,s){return yM(a,s)>Math.PI/2*1.01}let bM=ai(85),vj=Math.cos(bM),yj=Math.sin(bM),tg=63710088e-1,xM=2*Math.PI*tg;class Bc{constructor(s,l){if(isNaN(s)||isNaN(l))throw new Error(`Invalid LngLat object: (${s}, ${l})`);if(this.lng=+s,this.lat=+l,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Bc(Ft(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(s){let l=Math.PI/180,u=this.lat*l,p=s.lat*l,m=Math.sin(u)*Math.sin(p)+Math.cos(u)*Math.cos(p)*Math.cos((s.lng-this.lng)*l);return tg*Math.acos(Math.min(m,1))}toBounds(s=0){let l=360*s/40075017,u=l/Math.cos(Math.PI/180*this.lat);return new Vc(new Bc(this.lng-u,this.lat-l),new Bc(this.lng+u,this.lat+l))}toEcef(s){let l=hv(s);return Wh(this.lat,this.lng,Ha+l)}static convert(s){if(s instanceof Bc)return s;if(Array.isArray(s)&&(s.length===2||s.length===3))return new Bc(Number(s[0]),Number(s[1]));if(!Array.isArray(s)&&typeof s=="object"&&s!==null)return new Bc(Number("lng"in s?s.lng:s.lon),Number(s.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}var bn=Bc;function yw(a){return xM*Math.cos(a*Math.PI/180)}function Ga(a){return(180+a)/360}function qa(a){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360}function ba(a,s){return a/yw(s)}function hs(a){return 360*a-180}function Yr(a){return 360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180)
8)-90}function wM(a,s){return a*yw(Yr(s))}let Qr=85.051129;function CM(a){return 1/Math.cos(a*Math.PI/180)}class Kh{constructor(s,l,u=0){this.x=+s,this.y=+l,this.z=+u}static fromLngLat(s,l=0){let u=bn.convert(s);return new Kh(Ga(u.lng),qa(u.lat),ba(l,u.lat))}toLngLat(){return new bn(hs(this.x),Yr(this.y))}toAltitude(){return wM(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/xM*CM(Yr(this.y))}}function bw(a,s,l,u,p,m,v,b,w){let T=(s+u)/2,k=(l+p)/2,R=new tt(T,k);b(R),function(L,V,B,$,Y,re){let fe=B-Y,oe=$-re;return Math.abs(($-V)*fe-(B-L)*oe)/Math.hypot(fe,oe)}(R.x,R.y,m.x,m.y,v.x,v.y)>=w?(bw(a,s,l,T,k,m,R,b,w),bw(a,T,k,u,p,R,v,b,w)):a.push(v)}function EM(a,s,l){let u=a[0],p=u.x,m=u.y;s(u);let v=[u];for(let b=1;b<a.length;b++){let w=a[b],{x:T,y:k}=w;s(w),bw(v,p,m,T,k,u,w,s,l),p=T,m=k,u=w}return v}function xw(a,s,l,u){if(u(s,l)){let p=s.add(l)._mult(.5);xw(a,s,p,u),xw(a,p,l,u)}else a.push(l)}function bj(a,s){let l=a[0],u=[l];for(let p=1;p<a.length;p++){let m=a[p];xw(u,l,m,s),l=m}return u}let ww=Math.pow(2,14)-1,SM=-ww-1;
8function xj(a,s){let l=Math.round(a.x*s),u=Math.round(a.y*s);return a.x=pt(l,SM,ww),a.y=pt(u,SM,ww),(l<a.x||l>a.x+1||u<a.y||u>a.y+1)&&Un("Geometry exceeds allowed extent, reduce your vector tile buffer size"),a}function Gl(a,s,l){let u=a.loadGeometry(),p=a.extent,m=Ut/p;if(s&&l&&l.projection.isReprojectedInTileSpace){let v=1<<s.z,{scale:b,x:w,y:T,projection:k}=l,R=L=>{let V=hs((s.x+L.x/p)/v),B=Yr((s.y+L.y/p)/v),$=k.project(V,B);L.x=($.x*b-w)*p,L.y=($.y*b-T)*p};for(let L=0;L<u.length;L++)if(a.type!==1)u[L]=EM(u[L],R,1);else{let V=[];for(let B of u[L])B.x<0||B.x>=p||B.y<0||B.y>=p||(R(B),V.push(B));u[L]=V}}for(let v of u)for(let b of v)xj(b,m);return u}function _d(a,s){return{type:a.type,id:a.id,properties:a.properties,geometry:s?Gl(a):[]}}function mv(a,s,l,u,p){a.emplaceBack(2*s+(u+1)/2,2*l+(p+1)/2)}function gv(a,s,l){a.emplaceBack(s.x,s.y,s.z,l[0]*16384,l[1]*16384,l[2]*16384)}class Cw{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(l=>l.id),this.index=s.index,this.hasPattern=!1,this.projection=s.projection,this.layoutVertexArray=new nt,this.indexArray=new Nt,this.segments=new ur,this.programConfigurations=new dd(s.layers,s.zoom),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(s,l,u,p){let m=this.layers[0],v=[],b=null;m.type==="circle"&&(b=m.layout.get("circle-sort-key"));for(let{feature:T,id:k,index:R,sourceLayerIndex:L}of s){let V=this.layers[0]._featureFilter.needGeometry,B=_d(T,V);if(!this.layers[0]._featureFilter.filter(new O(this.zoom),B,u))continue;let $=b?b.evaluate(B,{},u):void 0,Y={id:k,properties:T.properties,type:T.type,sourceLayerIndex:L,index:R,geometry:V?B.geometry:Gl(T,u,p),patterns:{},sortKey:$};v.push(Y)}b&&v.sort((T,k)=>T.sortKey-k.sortKey);let w=null;p.projection.name==="globe"&&(this.globeExtVertexArray=new ot,w=p.projection);for(let T of v){let{geometry:k,index:R,sourceLayerIndex:L}=T,V=s[R].feature;this.addFeature(T,k,R,l.availableImages,u,w),l.featureIndex.insert(V,k,R,L,this.index)}}update(s,l,u,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,l,this.stateDependentLayers,u,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,aj.members),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=s.createVertexBuffer(this.globeExtVertexArray,lj.members))),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(s,l,u,p,m,v){for(let b of l)for(let w of b){let T=w.x,k=w.y;if(T<0||T>=Ut||k<0||k>=Ut)continue;if(v){let V=v.projectTilePoint(T,k,m),B=v.upVector(m,T,k),$=this.globeExtVertexArray;gv($,V,B),gv($,V,B),gv($,V,B),gv($,V,B)}let R=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,s.sortKey),L=R.vertexLength;mv(this.layoutVertexArray,T,k,-1,-1),mv(this.layoutVertexArray,T,k,1,-1),mv(this.layoutVertexArray,T,k,1,1),mv(this.layoutVertexArray,T,k,-1,1),this.indexArray.emplaceBack(L,L+1,L+2),this.indexArray.emplaceBack(L,L+2,L+3),R.vertexLength+=4,R.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,u,{},p,m)}}function TM(a,s){for(let l=0;l<a.length;l++)if(vd(s,a[l]))return!0;for(let l=0;l<s.length;l++)if(vd(a,s[l]))return!0;return!!Ew(a,s)}function wj(a,s,l){return!!vd(a,s)||!!Sw(s,a,l)}function IM(a,s){if(a.length===1)return MM(s,a[0]);for(let l=0;l<s.length;l++){let u=s[l];for(let p=0;p<u.length;p++)if(vd(a,u[p]))return!0}for(let l=0;l<a.length;l++)if(MM(s,a[l]))return!0;for(let l=0;l<s.length;l++)if(Ew(a,s[l]))return!0;return!1}function Cj(a,s,l){if(a.length>1){if(Ew(a,s))return!0;for(let u=0;u<s.length;u++)if(Sw(s[u],a,l))return!0}for(let u=0;u<a.length;u++)if(Sw(a[u],s,l))return!0;return!1}function Ew(a,s){if(a.length===0||s.length===0)return!1;for(let l=0;l<a.length-1;l++){let u=a[l],p=a[l+1];for(let m=0;m<s.length-1;m++)if(Ej(u,p,s[m],s[m+1]))return!0}return!1}function Ej(a,s,l,u){return Bo(a,l,u)!==Bo(s,l,u)&&Bo(a,s,l)!==Bo(a,s,u)}function Sw(a,s,l){let u=l*l;if(s.length===1)return a.distSqr(s[0])<u;for(let p=1;p<s.length;p++)if(DM(a,s[p-1],s[p])<u)return!0;return!1}function DM(a,s,l){let u=s.distSqr(l);if(u===0)return a.distSqr(s);let p=((a.x-s.x)*(l.x-s.x)+(a.y-s.y)*(l.y-s.y))/u;return a.distSqr(p<0?s:p>1?l:l.sub(s)._mult(p)._add(s))}function MM(a,s){let l,u,p,m=!1;for(let v=0;v<a.length;v++){l=a[v];for(let b=0,w=l.length-1;b<l.length;w=b++)u=l[b],p=l[w],u.y>s.y!=p.y>s.y&&s.x<(p.x-u.x)*(s.y-u.y)/(p.y-u.y)+u.x&&(m=!m)}return m}function vd(a,s){let l=!1;for(let u=0,p=a.length-1;u<a.length;p=u++){let m=a[u],v=a[p];m.y>s.y!=v.y>
8s.y&&s.x<(v.x-m.x)*(s.y-m.y)/(v.y-m.y)+m.x&&(l=!l)}return l}function kM(a,s,l,u,p){for(let v of a)if(s<=v.x&&l<=v.y&&u>=v.x&&p>=v.y)return!0;let m=[new tt(s,l),new tt(s,p),new tt(u,p),new tt(u,l)];if(a.length>2){for(let v of m)if(vd(a,v))return!0}for(let v=0;v<a.length-1;v++)if(Sj(a[v],a[v+1],m))return!0;return!1}function Sj(a,s,l){let u=l[0],p=l[2];if(a.x<u.x&&s.x<u.x||a.x>p.x&&s.x>p.x||a.y<u.y&&s.y<u.y||a.y>p.y&&s.y>p.y)return!1;let m=Bo(a,s,l[0]);return m!==Bo(a,s,l[1])||m!==Bo(a,s,l[2])||m!==Bo(a,s,l[3])}function Xh(a,s,l){let u=s.paint.get(a).value;return u.kind==="constant"?u.value:l.programConfigurations.get(s.id).getMaxValue(a)}function _v(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1])}function AM(a,s,l,u,p){if(!s[0]&&!s[1])return a;let m=tt.convert(s)._mult(p);l==="viewport"&&m._rotate(-u);let v=[];for(let b=0;b<a.length;b++)v.push(a[b].sub(m));return v}function PM(a,s,l,u){let p=tt.convert(a)._mult(u);return s==="viewport"&&p._rotate(-l),p}Pt(Cw,"CircleBucket",{omit:["layers"]});let Tj=new ue({"circle-sort-key":new Q(Ue.layout_circle["circle-sort-key"])});var Ij={paint:new ue({"circle-radius":new Q(Ue.paint_circle["circle-radius"]),"circle-color":new Q(Ue.paint_circle["circle-color"]),"circle-blur":new Q(Ue.paint_circle["circle-blur"]),"circle-opacity":new Q(Ue.paint_circle["circle-opacity"]),"circle-translate":new H(Ue.paint_circle["circle-translate"]),"circle-translate-anchor":new H(Ue.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new H(Ue.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new H(Ue.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Q(Ue.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Q(Ue.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Q(Ue.paint_circle["circle-stroke-opacity"])}),layout:Tj};function OM(a,s,l,u,p,m,v,b,w){if(m&&a.queryGeometry.isAboveHorizon)return!1;m&&(w*=a.pixelToTileUnitsFactor);let T=a.tileID.canonical,k=l.projection.upVectorScale(T,l.center.lat,l.worldSize).metersToTile;for(let R of s)for(let L of R){let V=L.add(b),B=p&&l.elevation?l.elevation.exaggeration()*p.getElevationAt(V.x,V.y,!0):0,$=l.projection.projectTilePoint(V.x,V.y,T);if(B>0){let oe=l.projection.upVector(T,V.x,V.y);$.x+=oe[0]*k*B,$.y+=oe[1]*k*B,$.z+=oe[2]*k*B}let Y=m?V:Dj($.x,$.y,$.z,u),re=m?a.tilespaceRays.map(oe=>kj(oe,B)):a.queryGeometry.screenGeometry,fe=fd([],[$.x,$.y,$.z,1],u);if(!v&&m?w*=fe[3]/l.cameraToCenterDistance:v&&!m&&(w*=l.cameraToCenterDistance/fe[3]),m){let oe=Yr((L.y/Ut+T.y)/(1<<T.z));w/=l.projection.pixelsPerMeter(oe,1)/ba(1,oe)}if(wj(re,Y,w))return!0}return!1}function Dj(a,s,l,u){let p=fd([],[a,s,l,1],u);return new tt(p[0]/p[3],p[1]/p[3])}let RM=Gh(0,0,0),Mj=Gh(0,0,1);function kj(a,s){let l=lw();return RM[2]=s,a.intersectsPlane(RM,Mj,l),new tt(l[0],l[1])}class LM extends Cw{}function FM(a,{width:s,height:l},u,p){if(p){if(p instanceof Uint8ClampedArray)p=new Uint8Array(p.buffer);else if(p.length!==s*l*u)throw new RangeError("mismatched image size")}else p=new Uint8Array(s*l*u);return a.width=s,a.height=l,a.data=p,a}function NM(a,s,l){let{width:u,height:p}=s;u===a.width&&p===a.height||(Tw(a,s,{x:0,y:0},{x:0,y:0},{width:Math.min(a.width,u),height:Math.min(a.height,p)},l),a.width=u,a.height=p,a.data=s.data)}function Tw(a,s,l,u,p,m){if(p.width===0||p.height===0)return s;if(p.width>a.width||p.height>a.height||l.x>a.width-p.width||l.y>a.height-p.height)throw new RangeError("out of range source coordinates for image copy");if(p.width>s.width||p.height>s.height||u.x>s.width-p.width||u.y>s.height-p.height)throw new RangeError("out of range destination coordinates for image copy");let v=a.data,b=s.data;for(let w=0;w<p.height;w++){let T=((l.y+w)*a.width+l.x)*m,k=((u.y+w)*s.width+u.x)*m;for(let R=0;R<p.width*m;R++)b[k+R]=v[T+R]}return s}Pt(LM,"HeatmapBucket",{omit:["layers"]});class ql{constructor(s,l){FM(this,s,1,l)}resize(s){NM(this,new ql(s),1)}clone(){return new ql({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,l,u,p,m){Tw(s,l,u,p,m,1)}}class Ko{constructor(s,l){FM(this,s,4,l)}resize(s){NM(this,new Ko(s),4)}replace(s,l){l?this.data.set(s):this.data=s instanceof Uint8ClampedArray?new Uint8Array(s.buffer):s}clone(){return new Ko({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,l,u,p,m){Tw(s,l,u,p,m,4)}}Pt(ql,"AlphaImage"),Pt(Ko,"RGBAImage");var Aj={paint:new ue({"heatmap-radius":new Q(Ue.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Q(Ue.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new H(Ue.paint_heatmap["heatmap-intensity"]),"heatmap-color":new le(Ue.paint_heatmap["heatmap-color"]),"heatmap-opacity":new H(Ue.paint_heatmap["heatmap-opacity"])})};function Iw(a){let s={},l=a.resolution||256,u=a.clips?a.clips.length:1,p=a.image||new Ko({width:l,height:u}),m=(v,b,w)=>{s[a.evaluationKey]=w;let T=a.expression.evaluate(s);p.data[v+b+0]=Math.floor(255*T.r/T.a),p.data[v+b+1]=Math.floor(255*T.g/T.a),p.data[v+b+2]=Math.floor(255*T.b/T.a),p.data[v+b+3]=Math.floor(255*T.a)};if(a.clips)for(let v=0,b=0;v<u;++v,b+=4*l)for(let w=0,T=0;w<l;w++,T+=4){let k=w/(l-1),{start:R,end:L}=a.clips[v];m(b,T,R*(1-k)+L*k)}else for(let v=0,b=0;v<l;v++,b+=4)m(0,b,v/(l-1));return p}var Pj={paint:new ue({"hillshade-illumination-direction":new H(Ue.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new H(Ue.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new H(Ue.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new H(Ue.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new H(Ue.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new H(Ue.paint_hillshade["hillshade-accent-color"])})};let Oj=Ie([{name:"a_pos",components:2,type:"Int16"}],4),{members:Rj}=Oj;var Dw={exports:{}};function vv(a,s,l){l=l||2;var u,p,m,v,b,w,T,k=s&&s.length,R=k?s[0]*l:a.length,L=zM(a,0,R,l,!0),V=[];if(!L||L.next===L.prev)return V;if(k&&(L=function($,Y,re,fe){var oe,he,ge,me=[];for(oe=0,he=Y.length;oe<he;oe++)(ge=zM($,Y[oe]*fe,oe<he-1?Y[oe+1]*fe:$.length,fe,!1))===ge.next&&(ge.steiner=!0),me.push(Uj(ge));for(me.sort(jj),oe=0;oe<me.length;oe++)re=Vj(me[oe],re);return re}(a,s,L,l)),a.length>80*l){u=m=a[0],p=v=a[1];for(var B=l;B<R;B+=l)(b=a[B])<u&&(u=b),(w=a[B+1])<p&&(p=w),b>m&&(m=b),w>v&&(v=w);T=(T=Math.max(m-u,v-p))!==0?32767/T:0}return ig(L,V,l,u,p,T,0),V}function zM(a,s,l,u,p){var m,v;if(p===Aw(a,s,l,u)>0)for(m=s;m<l;m+=u)v=BM(m,a[m],a[m+1],v);else for(m=l-u;m>=s;m-=u)v=BM(m,a[m],a[m+1],v);return v&&yv(v,v.next)&&(rg(v),v=v.next),v}function yd(a,s){if(!a)return a;s||(s=a);var l,u=a;
8do if(l=!1,u.steiner||!yv(u,u.next)&&dr(u.prev,u,u.next)!==0)u=u.next;else{if(rg(u),(u=s=u.prev)===u.next)break;l=!0}while(l||u!==s);return s}function ig(a,s,l,u,p,m,v){if(a){!v&&m&&function(k,R,L,V){var B=k;do B.z===0&&(B.z=Mw(B.x,B.y,R,L,V)),B.prevZ=B.prev,B.nextZ=B.next,B=B.next;while(B!==k);B.prevZ.nextZ=null,B.prevZ=null,function($){var Y,re,fe,oe,he,ge,me,Le,Pe=1;do{for(re=$,$=null,he=null,ge=0;re;){for(ge++,fe=re,me=0,Y=0;Y<Pe&&(me++,fe=fe.nextZ);Y++);for(Le=Pe;me>0||Le>0&&fe;)me!==0&&(Le===0||!fe||re.z<=fe.z)?(oe=re,re=re.nextZ,me--):(oe=fe,fe=fe.nextZ,Le--),he?he.nextZ=oe:$=oe,oe.prevZ=he,he=oe;re=fe}he.nextZ=null,Pe*=2}while(ge>1)}(B)}(a,u,p,m);for(var b,w,T=a;a.prev!==a.next;)if(b=a.prev,w=a.next,m?Fj(a,u,p,m):Lj(a))s.push(b.i/l|0),s.push(a.i/l|0),s.push(w.i/l|0),rg(a),a=w.next,T=w.next;else if((a=w)===T){v?v===1?ig(a=Nj(yd(a),s,l),s,l,u,p,m,2):v===2&&zj(a,s,l,u,p,m):ig(yd(a),s,l,u,p,m,1);break}}}function Lj(a){var s=a.prev,l=a,u=a.next;if(dr(s,l,u)>=0)return!1;for(var p=s.x,m=l.x,v=u.x,b=s.y,w=l.y,T=u.y,k=p<m?p<v?p:v:m<v?m:v,R=b<w?b<T?b:T:w<T?w:T,L=p>m?p>v?p:v:m>v?m:v,V=b>w?b>T?b:T:w>T?w:T,B=u.next;B!==s;){if(B.x>=k&&B.x<=L&&B.y>=R&&B.y<=V&&Yh(p,b,m,w,v,T,B.x,B.y)&&dr(B.prev,B,B.next)>=0)return!1;B=B.next}return!0}function Fj(a,s,l,u){var p=a.prev,m=a,v=a.next;if(dr(p,m,v)>=0)return!1;for(var b=p.x,w=m.x,T=v.x,k=p.y,R=m.y,L=v.y,V=b<w?b<T?b:T:w<T?w:T,B=k<R?k<L?k:L:R<L?R:L,$=b>w?b>T?b:T:w>T?w:T,Y=k>R?k>L?k:L:R>L?R:L,re=Mw(V,B,s,l,u),fe=Mw($,Y,s,l,u),oe=a.prevZ,he=a.nextZ;oe&&oe.z>=re&&he&&he.z<=fe;){if(oe.x>=V&&oe.x<=$&&oe.y>=B&&oe.y<=Y&&oe!==p&&oe!==v&&Yh(b,k,w,R,T,L,oe.x,oe.y)&&dr(oe.prev,oe,oe.next)>=0||(oe=oe.prevZ,he.x>=V&&he.x<=$&&he.y>=B&&he.y<=Y&&he!==p&&he!==v&&Yh(b,k,w,R,T,L,he.x,he.y)&&dr(he.prev,he,he.next)>=0))return!1;he=he.nextZ}for(;oe&&oe.z>=re;){if(oe.x>=V&&oe.x<=$&&oe.y>=B&&oe.y<=Y&&oe!==p&&oe!==v&&Yh(b,k,w,R,T,L,oe.x,oe.y)&&dr(oe.prev,oe,oe.next)>=0)return!1;oe=oe.prevZ}for(;he&&he.z<=fe;){if(he.x>=V&&he.x<=$&&he.y>=B&&he.y<=Y&&he!==p&&he!==v&&Yh(b,k,w,R,T,L,he.x,he.y)&&dr(he.prev,he,he.next)>=0)return!1;he=he.nextZ}return!0}function Nj(a,s,l){var u=a;do{var p=u.prev,m=u.next.next;!yv(p,m)&&jM(p,u,u.next,m)&&ng(p,m)&&ng(m,p)&&(s.push(p.i/l|0),s.push(u.i/l|0),s.push(m.i/l|0),rg(u),rg(u.next),u=a=m),u=u.next}while(u!==a);return yd(u)}function zj(a,s,l,u,p,m){var v=a;do{for(var b=v.next.next;b!==v.prev;){if(v.i!==b.i&&Hj(v,b)){var w=VM(v,b);return v=yd(v,v.next),w=yd(w,w.next),ig(v,s,l,u,p,m,0),void ig(w,s,l,u,p,m,0)}b=b.next}v=v.next}while(v!==a)}function jj(a,s){return a.x-s.x}function Vj(a,s){var l=function(p,m){var v,b=m,w=p.x,T=p.y,k=-1/0;do{if(T<=b.y&&T>=b.next.y&&b.next.y!==b.y){var R=b.x+(T-b.y)*(b.next.x-b.x)/(b.next.y-b.y);if(R<=w&&R>k&&(k=R,v=b.x<b.next.x?b:b.next,R===w))return v}b=b.next}while(b!==m);if(!v)return null;var L,V=v,B=v.x,$=v.y,Y=1/0;b=v;do w>=b.x&&b.x>=B&&w!==b.x&&Yh(T<$?w:k,T,B,$,T<$?k:w,T,b.x,b.y)&&(L=Math.abs(T-b.y)/(w-b.x),ng(b,p)&&(L<Y||L===Y&&(b.x>v.x||b.x===v.x&&Bj(v,b)))&&(v=b,Y=L)),b=b.next;while(b!==V);return v}(a,s);if(!l)return s;var u=VM(l,a);return yd(u,u.next),yd(l,l.next)}function Bj(a,s){return dr(a.prev,a,s.prev)<0&&dr(s.next,a,a.next)<0}function Mw(a,s,l,u,p){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-l)*p|0)|a<<8))|a<<4))|a<<2))|a<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-u)*p|0)|s<<8))|s<<4))|s<<2))|s<<1))<<1}function Uj(a){var s=a,l=a;do(s.x<l.x||s.x===l.x&&s.y<l.y)&&(l=s),s=s.next;while(s!==a);return l}function Yh(a,s,l,u,p,m,v,b){return(p-v)*(s-b)>=(a-v)*(m-b)&&(a-v)*(u-b)>=(l-v)*(s-b)&&(l-v)*(m-b)>=(p-v)*(u-b)}function Hj(a,s){return a.next.i!==s.i&&a.prev.i!==s.i&&!function(l,u){var p=l;do{if(p.i!==l.i&&p.next.i!==l.i&&p.i!==u.i&&p.next.i!==u.i&&jM(p,p.next,l,u))return!0;p=p.next}while(p!==l);return!1}(a,s)&&(ng(a,s)&&ng(s,a)&&function(l,u){var p=l,m=!1,v=(l.x+u.x)/2,b=(l.y+u.y)/2;do p.y>b!=p.next.y>b&&p.next.y!==p.y&&v<(p.next.x-p.x)*(b-p.y)/(p.next.y-p.y)+p.x&&(m=!m),p=p.next;while(p!==l);return m}(a,s)&&(dr(a.prev,a,s.prev)||dr(a,s.prev,s))||yv(a,s)&&dr(a.prev,a,a.next)>0&&dr(s.prev,s,s.next)>0)}function dr(a,s,l){return(s.y-a.y)*(l.x-s.x)-(s.x-a.x)*(l.y-s.y)}function yv(a,s){return a.x===s.x&&a.y===s.y}function jM(a,s,l,u){var p=xv(dr(a,s,l)),m=xv(dr(a,s,u)),v=xv(dr(l,u,a)),b=xv(dr(l,u,s));return p!==m&&v!==b||!(p!==0||!bv(a,l,s))||!(m!==0||!bv(a,u,s))||!(v!==0||!bv(l,a,u))||!(b!==0||!bv(l,s,u))}function bv(a,s,l){return s.x<=Math.max(a.x,l.x)&&s.x>=Math.min(a.x,l.x)&&s.y<=Math.max(a.y,l.y)&&s.y>=Math.min(a.y,l.y)}
8function xv(a){return a>0?1:a<0?-1:0}function ng(a,s){return dr(a.prev,a,a.next)<0?dr(a,s,a.next)>=0&&dr(a,a.prev,s)>=0:dr(a,s,a.prev)<0||dr(a,a.next,s)<0}function VM(a,s){var l=new kw(a.i,a.x,a.y),u=new kw(s.i,s.x,s.y),p=a.next,m=s.prev;return a.next=s,s.prev=a,l.next=p,p.prev=l,u.next=l,l.prev=u,m.next=u,u.prev=m,u}function BM(a,s,l,u){var p=new kw(a,s,l);return u?(p.next=u.next,p.prev=u,u.next.prev=p,u.next=p):(p.prev=p,p.next=p),p}function rg(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function kw(a,s,l){this.i=a,this.x=s,this.y=l,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Aw(a,s,l,u){for(var p=0,m=s,v=l-u;m<l;m+=u)p+=(a[v]-a[m])*(a[m+1]+a[v+1]),v=m;return p}Dw.exports=vv,Dw.exports.default=vv,vv.deviation=function(a,s,l,u){var p=s&&s.length,m=Math.abs(Aw(a,0,p?s[0]*l:a.length,l));if(p)for(var v=0,b=s.length;v<b;v++)m-=Math.abs(Aw(a,s[v]*l,v<b-1?s[v+1]*l:a.length,l));var w=0;for(v=0;v<u.length;v+=3){var T=u[v]*l,k=u[v+1]*l,R=u[v+2]*l;w+=Math.abs((a[T]-a[R])*(a[k+1]-a[T+1])-(a[T]-a[k])*(a[R+1]-a[T+1]))}return m===0&&w===0?0:Math.abs((w-m)/m)},vv.flatten=function(a){for(var s=a[0][0].length,l={vertices:[],holes:[],dimensions:s},u=0,p=0;p<a.length;p++){for(var m=0;m<a[p].length;m++)for(var v=0;v<s;v++)l.vertices.push(a[p][m][v]);p>0&&l.holes.push(u+=a[p-1].length)}return l};var Pw=at(Dw.exports);function $j(a,s,l,u,p){UM(a,s,l||0,u||a.length-1,p||Gj)}function UM(a,s,l,u,p){for(;u>l;){if(u-l>600){var m=u-l+1,v=s-l+1,b=Math.log(m),w=.5*Math.exp(2*b/3),T=.5*Math.sqrt(b*w*(m-w)/m)*(v-m/2<0?-1:1);UM(a,s,Math.max(l,Math.floor(s-v*w/m+T)),Math.min(u,Math.floor(s+(m-v)*w/m+T)),p)}var k=a[s],R=l,L=u;for(og(a,l,s),p(a[u],k)>0&&og(a,l,u);R<L;){for(og(a,R,L),R++,L--;p(a[R],k)<0;)R++;for(;p(a[L],k)>0;)L--}p(a[l],k)===0?og(a,l,L):og(a,++L,u),L<=s&&(l=L+1),s<=L&&(u=L-1)}}function og(a,s,l){var u=a[s];a[s]=a[l],a[l]=u}function Gj(a,s){return a<s?-1:a>s?1:0}function Ow(a,s){let l=a.length;if(l<=1)return[a];let u=[],p,m;for(let v=0;v<l;v++){let b=uh(a[v]);b!==0&&(a[v].area=Math.abs(b),m===void 0&&(m=b<0),m===b<0?(p&&u.push(p),p=[a[v]]):p.push(a[v]))}if(p&&u.push(p),s>1)for(let v=0;v<u.length;v++)u[v].length<=s||($j(u[v],s,1,u[v].length-1,qj),u[v]=u[v].slice(0,s));return u}function qj(a,s){return s.area-a.area}function Rw(a,s,l){let u=l.patternDependencies,p=!1;for(let m of s){let v=m.paint.get(`${a}-pattern`);v.isConstant()||(p=!0);let b=v.constantOr(null);b&&(p=!0,u[b]=!0)}return p}function Lw(a,s,l,u,p){let m=p.patternDependencies;for(let v of s){let b=v.paint.get(`${a}-pattern`).value;if(b.kind!=="constant"){let w=b.evaluate({zoom:u},l,{},p.availableImages);w=w&&w.name?w.name:w,m[w]=!0,l.patterns[v.id]=w}}return l}class wv{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(l=>l.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new nt,this.indexArray=new Nt,this.indexArray2=new Mr,this.programConfigurations=new dd(s.layers,s.zoom),this.segments=new ur,this.segments2=new ur,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.projection=s.projection}populate(s,l,u,p){this.hasPattern=Rw("fill",this.layers,l);let m=this.layers[0].layout.get("fill-sort-key"),v=[];for(let{feature:b,id:w,index:T,sourceLayerIndex:k}of s){let R=this.layers[0]._featureFilter.needGeometry,L=_d(b,R);if(!this.layers[0]._featureFilter.filter(new O(this.zoom),L,u))continue;let V=m?m.evaluate(L,{},u,l.availableImages):void 0,B={id:w,properties:b.properties,type:b.type,sourceLayerIndex:k,index:T,geometry:R?L.geometry:Gl(b,u,p),patterns:{},sortKey:V};v.push(B)}m&&v.sort((b,w)=>b.sortKey-w.sortKey);for(let b of v){let{geometry:w,index:T,sourceLayerIndex:k}=b;if(this.hasPattern){let R=Lw("fill",this.layers,b,this.zoom,l);this.patternFeatures.push(R)}else this.addFeature(b,w,T,u,{},l.availableImages);l.featureIndex.insert(s[T].feature,w,T,k,this.index)}}update(s,l,u,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,l,this.stateDependentLayers,u,p)}addFeatures(s,l,u,p,m){for(let v of this.patternFeatures)this.addFeature(v,v.geometry,v.index,l,u,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,Rj),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.indexBuffer2=s.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(s),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(s,l,u,p,m,v=[]){for(let b of Ow(l,500)){let w=0;for(let B of b)w+=B.length;let T=this.segments.prepareSegment(w,this.layoutVertexArray,this.indexArray),k=T.vertexLength,R=[],L=[];for(let B of b){if(B.length===0)continue;B!==b[0]&&L.push(R.length/2);let $=this.segments2.prepareSegment(B.length,this.layoutVertexArray,this.indexArray2),Y=$.vertexLength;this.layoutVertexArray.emplaceBack(B[0].x,B[0].y),this.indexArray2.emplaceBack(Y+B.length-1,Y),R.push(B[0].x),R.push(B[0].y);for(let re=1;re<B.length;re++)this.layoutVertexArray.emplaceBack(B[re].x,B[re].y),this.indexArray2.emplaceBack(Y+re-1,Y+re),R.push(B[re].x),R.push(B[re].y);$.vertexLength+=B.length,$.primitiveLength+=B.length}let V=Pw(R,L);for(let B=0;B<V.length;B+=3)this.indexArray.emplaceBack(k+V[B],k+V[B+1],k+V[B+2]);T.vertexLength+=w,T.primitiveLength+=V.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,u,m,v,p)}}Pt(wv,"FillBucket",{omit:["layers","patternFeatures"]});let Wj=new ue({"fill-sort-key":new Q(Ue.layout_fill["fill-sort-key"])});var Zj={paint:new ue({"fill-antialias":new H(Ue.paint_fill["fill-antialias"]),"fill-opacity":new Q(Ue.paint_fill["fill-opacity"]),"fill-color":new Q(Ue.paint_fill["fill-color"]),"fill-outline-color":new Q(Ue.paint_fill["fill-outline-color"]),"fill-translate":new H(Ue.paint_fill["fill-translate"]),"fill-translate-anchor":new H(Ue.paint_fill["fill-translate-anchor"]),"fill-pattern":new Q(Ue.paint_fill["fill-pattern"])}),layout:Wj};let Kj=Ie([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Xj=Ie([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Yj=Ie([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Qj}=Kj;var Cv={},Jj=tn,HM=Qh;function Qh(a,s,l,u,p){this.properties={},this.extent=l,this.type=0,this._pbf=a,this._geometry=-1,this._keys=u,this._values=p,a.readFields(eV,this,s)}function eV(a,s,l){a==1?s.id=l.readVarint():a==2?function(u,p){for(var m=u.readVarint()+u.pos;u.pos<m;){var v=p._keys[u.readVarint()],b=p._values[u.readVarint()];p.properties[v]=b}}
8(l,s):a==3?s.type=l.readVarint():a==4&&(s._geometry=l.pos)}function tV(a){for(var s,l,u=0,p=0,m=a.length,v=m-1;p<m;v=p++)u+=((l=a[v]).x-(s=a[p]).x)*(s.y+l.y);return u}Qh.types=["Unknown","Point","LineString","Polygon"],Qh.prototype.loadGeometry=function(){var a=this._pbf;a.pos=this._geometry;for(var s,l=a.readVarint()+a.pos,u=1,p=0,m=0,v=0,b=[];a.pos<l;){if(p<=0){var w=a.readVarint();u=7&w,p=w>>3}if(p--,u===1||u===2)m+=a.readSVarint(),v+=a.readSVarint(),u===1&&(s&&b.push(s),s=[]),s.push(new Jj(m,v));else{if(u!==7)throw new Error("unknown command "+u);s&&s.push(s[0].clone())}}return s&&b.push(s),b},Qh.prototype.bbox=function(){var a=this._pbf;a.pos=this._geometry;for(var s=a.readVarint()+a.pos,l=1,u=0,p=0,m=0,v=1/0,b=-1/0,w=1/0,T=-1/0;a.pos<s;){if(u<=0){var k=a.readVarint();l=7&k,u=k>>3}if(u--,l===1||l===2)(p+=a.readSVarint())<v&&(v=p),p>b&&(b=p),(m+=a.readSVarint())<w&&(w=m),m>T&&(T=m);else if(l!==7)throw new Error("unknown command "+l)}return[v,w,b,T]},Qh.prototype.toGeoJSON=function(a,s,l){var u,p,m=this.extent*Math.pow(2,l),v=this.extent*a,b=this.extent*s,w=this.loadGeometry(),T=Qh.types[this.type];function k(V){for(var B=0;B<V.length;B++){var $=V[B];V[B]=[360*($.x+v)/m-180,360/Math.PI*Math.atan(Math.exp((180-360*($.y+b)/m)*Math.PI/180))-90]}}switch(this.type){case 1:var R=[];for(u=0;u<w.length;u++)R[u]=w[u][0];k(w=R);break;case 2:for(u=0;u<w.length;u++)k(w[u]);break;case 3:for(w=function(V){var B=V.length;if(B<=1)return[V];for(var $,Y,re=[],fe=0;fe<B;fe++){var oe=tV(V[fe]);oe!==0&&(Y===void 0&&(Y=oe<0),Y===oe<0?($&&re.push($),$=[V[fe]]):$.push(V[fe]))}return $&&re.push($),re}(w),u=0;u<w.length;u++)for(p=0;p<w[u].length;p++)k(w[u][p])}w.length===1?w=w[0]:T="Multi"+T;var L={type:"Feature",geometry:{type:T,coordinates:w},properties:this.properties};return"id"in this&&(L.id=this.id),L};var iV=HM,$M=GM;function GM(a,s){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=a,this._keys=[],this._values=[],this._features=[],a.readFields(nV,this,s),this.length=this._features.length}function nV(a,s,l){a===15?s.version=l.readVarint():a===1?s.name=l.readString():a===5?s.extent=l.readVarint():a===2?s._features.push(l.pos):a===3?s._keys.push(l.readString()):a===4&&s._values.push(function(u){for(var p=null,m=u.readVarint()+u.pos;u.pos<m;){var v=u.readVarint()>>3;p=v===1?u.readString():v===2?u.readFloat():v===3?u.readDouble():v===4?u.readVarint64():v===5?u.readVarint():v===6?u.readSVarint():v===7?u.readBoolean():null}return p}(l))}GM.prototype.feature=function(a){if(a<0||a>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[a];var s=this._pbf.readVarint()+this._pbf.pos;return new iV(this._pbf,s,this.extent,this._keys,this._values)};var rV=$M;function oV(a,s,l){if(a===3){var u=new rV(l,l.readVarint()+l.pos);u.length&&(s[u.name]=u)}}var Fw=Cv.VectorTile=function(a,s){this.layers=a.readFields(oV,{},s)},Ev=Cv.VectorTileFeature=HM;function Sv(a,s,l,u){let p=[],m=u===0?(v,b,w,T,k,R)=>{v.push(new tt(R,w+(R-b)/(T-b)*(k-w)))}:(v,b,w,T,k,R)=>{v.push(new tt(b+(R-w)/(k-w)*(T-b),R))};for(let v of a){let b=[];for(let w of v){if(w.length<=2)continue;let T=[];for(let L=0;L<w.length-1;L++){let V=w[L].x,B=w[L].y,$=w[L+1].x,Y=w[L+1].y,re=u===0?V:B,fe=u===0?$:Y;re<s?fe>s&&m(T,V,B,$,Y,s):re>l?fe<l&&m(T,V,B,$,Y,l):T.push(w[L]),fe<s&&re>=s&&m(T,V,B,$,Y,s),fe>l&&re<=l&&m(T,V,B,$,Y,l)}let k=w[w.length-1],R=u===0?k.x:k.y;R>=s&&R<=l&&T.push(k),T.length&&(k=T[T.length-1],T[0].x===k.x&&T[0].y===k.y||T.push(T[0]),b.push(T))}b.length&&p.push(b)}return p}Cv.VectorTileLayer=$M;let sV=Ev.types,aV=Math.pow(2,13);function sg(a,s,l,u,p,m,v,b){a.emplaceBack((s<<1)+v,(l<<1)+m,(Math.floor(u*aV)<<1)+p,Math.round(b))}function ag(a,s,l){a.emplaceBack(s.x,s.y,s.z,l[0]*16384,l[1]*16384,l[2]*16384)}class qM{constructor(){this.acc=new tt(0,0),this.polyCount=[]}startRing(s){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new tt(s.x,s.y),this.max=new tt(s.x,s.y))}append(s,l){this.currentPolyCount.edges++,this.acc._add(s);let u=this.min,p=this.max;s.x<u.x?u.x=s.x:s.x>p.x&&(p.x=s.x),s.y<u.y?u.y=s.y:s.y>p.y&&(p.y=s.y),((s.x===0||s.x===Ut)&&s.x===l.x)!=((s.y===0||s.y===Ut)&&s.y===l.y)&&this.processBorderOverlap(s,l),l.x<0!=s.x<0&&this.addBorderIntersection(0,Wi(l.y,s.y,(0-l.x)/(s.x-l.x))),l.x>Ut!=s.x>Ut&&this.addBorderIntersection(1,Wi(l.y,s.y,(Ut-l.x)/(s.x-l.x))),l.y<0!=s.y<0&&this.addBorderIntersection(2,Wi(l.x,s.x,(0-l.y)/(s.y-l.y))),l.y>Ut!=s.y>Ut&&this.addBorderIntersection(3,Wi(l.x,s.x,(Ut-l.y)/(s.y-l.y)))}addBorderIntersection(s,l){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]]);let u=this.borders[s];l<u[0]&&(u[0]=l),l>u[1]&&(u[1]=l)}processBorderOverlap(s,l){if(s.x===l.x){if(s.y===l.y)return;let u=s.x===0?0:1;
8this.addBorderIntersection(u,l.y),this.addBorderIntersection(u,s.y)}else{let u=s.y===0?2:3;this.addBorderIntersection(u,l.x),this.addBorderIntersection(u,s.x)}}centroid(){let s=this.polyCount.reduce((l,u)=>l+u.edges,0);return s!==0?this.acc.div(s)._round():new tt(0,0)}span(){return new tt(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce((s,l)=>s+ +(l[0]!==Number.MAX_VALUE),0)}}class lg{constructor(s){this.zoom=s.zoom,this.canonical=s.canonical,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(l=>l.id),this.index=s.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=s.projection,this.layoutVertexArray=new Ze,this.centroidVertexArray=new ma,this.indexArray=new Nt,this.programConfigurations=new dd(s.layers,s.zoom),this.segments=new ur,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.enableTerrain=s.enableTerrain}populate(s,l,u,p){this.features=[],this.hasPattern=Rw("fill-extrusion",this.layers,l),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(m){let v=Math.exp(Math.PI*(1-m.y/(1<<m.z)*2));return 80150034*v/(v*v+1)/Ut/(1<<m.z)}(u),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(let{feature:m,id:v,index:b,sourceLayerIndex:w}of s){let T=this.layers[0]._featureFilter.needGeometry,k=_d(m,T);if(!this.layers[0]._featureFilter.filter(new O(this.zoom),k,u))continue;let R={id:v,sourceLayerIndex:w,index:b,geometry:T?k.geometry:Gl(m,u,p),properties:m.properties,type:m.type,patterns:{}},L=this.layoutVertexArray.length;this.hasPattern?this.features.push(Lw("fill-extrusion",this.layers,R,this.zoom,l)):this.addFeature(R,R.geometry,b,u,{},l.availableImages,p),l.featureIndex.insert(m,R.geometry,b,w,this.index,L)}this.sortBorders()}addFeatures(s,l,u,p,m){for(let v of this.features){let{geometry:b}=v;this.addFeature(v,b,v.index,l,u,p,m)}this.sortBorders()}update(s,l,u,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,l,this.stateDependentLayers,u,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,Qj),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=s.createVertexBuffer(this.layoutVertexExtArray,Yj.members,!0))),this.programConfigurations.upload(s),this.uploaded=!0}uploadCentroid(s){this.centroidVertexArray.length!==0&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=s.createVertexBuffer(this.centroidVertexArray,Xj.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(s,l,u,p,m,v,b){let w=[new tt(0,0),new tt(Ut,Ut)],T=b.projection,k=T.name==="globe",R=this.enableTerrain&&!k?new qM:null,L=sV[s.type]==="Polygon";k&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new ot);let V=Ow(l,500);for(let re=V.length-1;re>=0;re--){let fe=V[re];(fe.length===0||(B=fe[0]).every(oe=>oe.x<=0)||B.every(oe=>oe.x>=Ut)||B.every(oe=>oe.y<=0)||B.every(oe=>oe.y>=Ut))&&V.splice(re,1)}var B;let $;if(k)$=JM(V,w,p);else{$=[];for(let re of V)$.push({polygon:re,bounds:w})}let Y=L?this.edgeRadius:0;for(let{polygon:re,bounds:fe}of $){let oe=0,he=0;for(let me of re)L&&!me[0].equals(me[me.length-1])&&me.push(me[0]),he+=L?me.length-1:me.length;let ge=this.segments.prepareSegment((L?5:4)*he,this.layoutVertexArray,this.indexArray);if(L){let me=[],Le=[];oe=ge.vertexLength;for(let He of re){let rt,ze;He.length&&He!==re[0]&&Le.push(me.length/2),rt=He[1].sub(He[0])._perp()._unit();for(let Ke=1;Ke<He.length;Ke++){let Xe=He[Ke],et=He[Ke===He.length-1?1:Ke+1],{x:dt,y:Be}=Xe;if(Y){ze=et.sub(Xe)._perp()._unit();let xt=rt.add(ze)._unit(),Rt=Y*Math.min(4,1/(rt.x*xt.x+rt.y*xt.y));dt+=Rt*xt.x,Be+=Rt*xt.y,rt=ze}sg(this.layoutVertexArray,dt,Be,0,0,1,1,0),ge.vertexLength++,me.push(Xe.x,Xe.y),k&&ag(this.layoutVertexExtArray,T.projectTilePoint(dt,Be,p),T.upVector(p,dt,Be))}}let Pe=Pw(me,Le);for(let He=0;He<Pe.length;He+=3)this.indexArray.emplaceBack(oe+Pe[He],oe+Pe[He+2],oe+Pe[He+1]),ge.primitiveLength++}for(let me of re){R&&me.length&&R.startRing(me[0]);let Le,Pe,He,rt=me.length>4&&XM(me[me.length-2],me[0],me[1]),ze=Y?lV(me[me.length-2],me[0],me[1],Y):0;Pe=me[1].sub(me[0])._perp()._unit();let Ke=!0;for(let Xe=1,et=0;Xe<me.length;Xe++){let dt=me[Xe-1],Be=me[Xe],xt=me[Xe===me.length-1?1:Xe+1];if(R&&L&&R.currentPolyCount.top++,KM(Be,dt,fe)){Y&&(Pe=xt.sub(Be)._perp()._unit(),Ke=!Ke);continue}R&&R.append(Be,dt);let Rt=Be.sub(dt)._perp(),wt=Rt.x/(Math.abs(Rt.x)+Math.abs(Rt.y)),li=Rt.y>0?1:0,ht=dt.dist(Be);if(et+ht>32768&&(et=0),Y){He=xt.sub(Be)._perp()._unit();let ui=ZM(dt,Be,xt,WM(Pe,He),Y);isNaN(ui)&&(ui=0);let Kt=Be.sub(dt)._unit();dt=dt.add(Kt.mult(ze))._round(),Be=Be.add(Kt.mult(-ui))._round(),ze=ui,Pe=He}let Vt=ge.vertexLength,ci=me.length>4&&XM(dt,Be,xt),Ki=YM(et,rt,Ke);
8if(sg(this.layoutVertexArray,dt.x,dt.y,wt,li,0,0,Ki),sg(this.layoutVertexArray,dt.x,dt.y,wt,li,0,1,Ki),et+=ht,Ki=YM(et,ci,!Ke),rt=ci,sg(this.layoutVertexArray,Be.x,Be.y,wt,li,0,0,Ki),sg(this.layoutVertexArray,Be.x,Be.y,wt,li,0,1,Ki),ge.vertexLength+=4,this.indexArray.emplaceBack(Vt+0,Vt+1,Vt+2),this.indexArray.emplaceBack(Vt+1,Vt+3,Vt+2),ge.primitiveLength+=2,Y){let ui=oe+(Xe===1?me.length-2:Xe-2),Kt=Xe===1?oe:ui+1;if(this.indexArray.emplaceBack(Vt+1,ui,Vt+3),this.indexArray.emplaceBack(ui,Kt,Vt+3),ge.primitiveLength+=2,Le===void 0&&(Le=Vt),!KM(xt,me[Xe],fe)){let kn=Xe===me.length-1?Le:ge.vertexLength;this.indexArray.emplaceBack(Vt+2,Vt+3,kn),this.indexArray.emplaceBack(Vt+3,kn+1,kn),this.indexArray.emplaceBack(Vt+3,Kt,kn+1),ge.primitiveLength+=3}Ke=!Ke}if(k){let ui=this.layoutVertexExtArray,Kt=T.projectTilePoint(dt.x,dt.y,p),kn=T.projectTilePoint(Be.x,Be.y,p),fi=T.upVector(p,dt.x,dt.y),mi=T.upVector(p,Be.x,Be.y);ag(ui,Kt,fi),ag(ui,Kt,fi),ag(ui,kn,mi),ag(ui,kn,mi)}}L&&(oe+=me.length-1)}}if(R&&R.polyCount.length>0){if(R.borders){R.vertexArrayOffset=this.centroidVertexArray.length;let re=R.borders,fe=this.featuresOnBorder.push(R)-1;for(let oe=0;oe<4;oe++)re[oe][0]!==Number.MAX_VALUE&&this.borders[oe].push(fe)}this.encodeCentroid(R.borders?void 0:R.centroid(),R)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,u,m,v,p)}sortBorders(){for(let s=0;s<4;s++)this.borders[s].sort((l,u)=>this.featuresOnBorder[l].borders[s][0]-this.featuresOnBorder[u].borders[s][0])}encodeCentroid(s,l,u=!0){let p,m;if(s)if(s.y!==0){let b=l.span()._mult(this.tileToMeter);p=(Math.max(s.x,1)<<3)+Math.min(7,Math.round(b.x/10)),m=(Math.max(s.y,1)<<3)+Math.min(7,Math.round(b.y/10))}else p=Math.ceil(7*(s.x+450)),m=0;else p=0,m=+u;let v=u?this.centroidVertexArray.length:l.vertexArrayOffset;for(let b of l.polyCount){u&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*b.edges+b.top);for(let w=0;w<b.top;w++)this.centroidVertexArray.emplace(v++,p,m);for(let w=0;w<2*b.edges;w++)this.centroidVertexArray.emplace(v++,0,m),this.centroidVertexArray.emplace(v++,p,m)}}}function WM(a,s){let l=a.add(s)._unit();return a.x*l.x+a.y*l.y}function lV(a,s,l,u){let p=s.sub(a)._perp()._unit(),m=l.sub(s)._perp()._unit();return ZM(a,s,l,WM(p,m),u)}function ZM(a,s,l,u,p){let m=Math.sqrt(1-u*u);return Math.min(a.dist(s)/3,s.dist(l)/3,p*m/u)}function KM(a,s,l){return a.x<l[0].x&&s.x<l[0].x||a.x>l[1].x&&s.x>l[1].x||a.y<l[0].y&&s.y<l[0].y||a.y>l[1].y&&s.y>l[1].y}function XM(a,s,l){if(a.x<0||a.x>=Ut||s.x<0||s.x>=Ut||l.x<0||l.x>=Ut)return!1;let u=l.sub(s),p=u.perp(),m=a.sub(s);return(u.x*m.x+u.y*m.y)/Math.sqrt((u.x*u.x+u.y*u.y)*(m.x*m.x+m.y*m.y))>-.866&&p.x*m.x+p.y*m.y<0}function YM(a,s,l){let u=s?2|a:-3&a;return l?1|u:-2&u}function QM(){let a=Math.PI/32,s=Math.tan(a),l=tg;return l*Math.sqrt(1+2*s*s)-l}function JM(a,s,l){let u=1<<l.z,p=hs(l.x/u),m=hs((l.x+1)/u),v=Yr(l.y/u),b=Yr((l.y+1)/u);return function(w,T,k,R,L=0,V){let B=[];if(!w.length||!k||!R)return B;let $=(me,Le)=>{for(let Pe of me)B.push({polygon:Pe,bounds:Le})},Y=Math.ceil(Math.log2(k)),re=Math.ceil(Math.log2(R)),fe=Y-re,oe=[];for(let me=0;me<Math.abs(fe);me++)oe.push(fe>0?0:1);for(let me=0;me<Math.min(Y,re);me++)oe.push(0),oe.push(1);let he=w;if(he=Sv(he,T[0].y-L,T[1].y+L,1),he=Sv(he,T[0].x-L,T[1].x+L,0),!he.length)return B;let ge=[];for(oe.length?ge.push({polygons:he,bounds:T,depth:0}):$(he,T);ge.length;){let me=ge.pop(),Le=me.depth,Pe=oe[Le],He=me.bounds[0],rt=me.bounds[1],ze=Pe===0?He.x:He.y,Ke=Pe===0?rt.x:rt.y,Xe=V?V(Pe,ze,Ke):.5*(ze+Ke),et=Sv(me.polygons,ze-L,Xe+L,Pe),dt=Sv(me.polygons,Xe-L,Ke+L,Pe);if(et.length){let Be=[He,new tt(Pe===0?Xe:rt.x,Pe===1?Xe:rt.y)];oe.length>Le+1?ge.push({polygons:et,bounds:Be,depth:Le+1}):$(et,Be)}if(dt.length){let Be=[new tt(Pe===0?Xe:He.x,Pe===1?Xe:He.y),rt];oe.length>Le+1?ge.push({polygons:dt,bounds:Be,depth:Le+1}):$(dt,Be)}}return B}(a,s,Math.ceil((m-p)/11.25),Math.ceil((v-b)/11.25),1,(w,T,k)=>{if(w===0)return .5*(T+k);{let R=Yr((l.y+T/Ut)/u);return(qa(.5*(Yr((l.y+k/Ut)/u)+R))*u-l.y)*Ut}})}Pt(lg,"FillExtrusionBucket",{omit:["layers","features"]}),Pt(qM,"PartMetadata");let cV=new ue({"fill-extrusion-edge-radius":new H(Ue["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var uV={paint:new ue({"fill-extrusion-opacity":new H(Ue["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Q(Ue["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new H(Ue["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new H(Ue["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Q(Ue["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Q(Ue["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Q(Ue["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new H(Ue["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new H(Ue["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new H(Ue["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new H(Ue["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:cV};function ek(a,s,l){var u=2*Math.PI*6378137/256/Math.pow(2,l);return[a*u-2*Math.PI*6378137/2,s*u-2*Math.PI*6378137/2]}class Tv{constructor(s,l,u){this.z=s,this.x=l,this.y=u,this.key=cg(0,s,s,l,u)}equals(s){return this.z===s.z&&this.x===s.x&&this.y===s.y}url(s,l){let u=function(m,v,b){var w=ek(256*m,256*(v=Math.pow(2,b)-v-1),b),T=ek(256*(m+1),256*(v+1),b);return w[0]+","+w[1]+","+T[0]+","+T[1]}(this.x,this.y,this.z),p=function(m,v,b){let w,T="";for(let k=m;k>0;k--)w=1<<k-1,T+=(v&w?1:0)+(b&w?2:0);return T}(this.z,this.x,this.y);return s[(this.x+this.y)%s.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(l==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",p).replace("{bbox-epsg-3857}",u)}toString(){return`${this.z}/${this.x}/${this.y}`}}class tk{constructor(s,l){this.wrap=s,this.canonical=l,this.key=cg(s,l.z,l.z,l.x,l.y)}}class bo{constructor(s,l,u,p,m){this.overscaledZ=s,this.wrap=l,this.canonical=new Tv(u,+p,+m),this.key=l===0&&s===u?this.canonical.key:cg(l,s,u,p,m)}equals(s){return this.overscaledZ===s.overscaledZ&&this.wrap===s.wrap&&this.canonical.equals(s.canonical)}scaledTo(s){let l=this.canonical.z-s;return s>this.canonical.z?new bo(s,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new bo(s,this.wrap,s,this.canonical.x>>l,this.canonical.y>>l)}calculateScaledKey(s,l=!0){if(this.overscaledZ===s&&l)return this.key;if(s>this.canonical.z)return cg(this.wrap*+l,s,this.canonical.z,this.canonical.x,this.canonical.y);{let u=this.canonical.z-s;return cg(this.wrap*+l,s,s,this.canonical.x>>u,this.canonical.y>>u)}}isChildOf(s){if(s.wrap!==this.wrap)return!1;let l=this.canonical.z-s.canonical.z;return s.overscaledZ===0||s.overscaledZ<this.overscaledZ&&s.canonical.x===this.canonical.x>>l&&s.canonical.y===this.canonical.y>>l}children(s){if(this.overscaledZ>=s)return[new bo(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let l=this.canonical.z+1,u=2*this.canonical.x,p=2*this.canonical.y;return[new bo(l,this.wrap,l,u,p),new bo(l,this.wrap,l,u+1,p),new bo(l,this.wrap,l,u,p+1),new bo(l,this.wrap,l,u+1,p+1)]}isLessThan(s){return this.wrap<s.wrap||!(this.wrap>s.wrap)&&(this.overscaledZ<s.overscaledZ||!(this.overscaledZ>
8s.overscaledZ)&&(this.canonical.x<s.canonical.x||!(this.canonical.x>s.canonical.x)&&this.canonical.y<s.canonical.y))}wrapped(){return new bo(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(s){return new bo(this.overscaledZ,s,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new tk(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function cg(a,s,l,u,p){let m=1<<Math.min(l,22),v=m*(p%m)+u%m;return a&&l<22&&(v+=m*m*((a<0?-2*a-1:2*a)%(1<<2*(22-l)))),16*(32*v+l)+(s-l)}Pt(Tv,"CanonicalTileID"),Pt(bo,"OverscaledTileID",{omit:["projMatrix"]});class Jh extends tt{constructor(s,l,u){super(s,l),this.z=u}}function ug(a,s){return a.x*s.x+a.y*s.y}function ik(a,s){if(a.length===1){let l=0,u=s[l++],p;for(;!p||u.equals(p);)if(p=s[l++],!p)return 1/0;for(;l<s.length;l++){let m=s[l],v=a[0],b=p.sub(u),w=m.sub(u),T=v.sub(u),k=ug(b,b),R=ug(b,w),L=ug(w,w),V=ug(T,b),B=ug(T,w),$=k*L-R*R,Y=(L*V-R*B)/$,re=(k*B-R*V)/$,fe=u.z*(1-Y-re)+p.z*Y+m.z*re;if(isFinite(fe))return fe}return 1/0}{let l=1/0;for(let u of s)l=Math.min(l,u.z);return l}}function nk(a,s,l,u,p,m,v,b){let w=v*p.getElevationAt(a,s,!0,!0),T=m[0]!==0,k=T?m[1]===0?v*(m[0]/7-450):v*function(R,L,V){let B=Math.floor(L[0]/8),$=Math.floor(L[1]/8),Y=10*(L[0]-8*B),re=10*(L[1]-8*$),fe=R.getElevationAt(B,$,!0,!0),oe=R.getMeterToDEM(V),he=Math.floor(.5*(Y*oe-1)),ge=Math.floor(.5*(re*oe-1)),me=R.tileCoordToPixel(B,$),Le=2*he+1,Pe=2*ge+1,He=function(dt,Be,xt,Rt,wt){return[dt.getElevationAtPixel(Be,xt,!0),dt.getElevationAtPixel(Be+wt,xt,!0),dt.getElevationAtPixel(Be,xt+wt,!0),dt.getElevationAtPixel(Be+Rt,xt+wt,!0)]}(R,me.x-he,me.y-ge,Le,Pe),rt=Math.abs(He[0]-He[1]),ze=Math.abs(He[2]-He[3]),Ke=Math.abs(He[0]-He[2])+Math.abs(He[1]-He[3]),Xe=Math.min(.25,.5*oe*(rt+ze)/Le),et=Math.min(.25,.5*oe*Ke/Pe);return fe+Math.max(Xe*Y,et*re)}(p,m,b):w;return{base:w+(l===0)?-1:l,top:T?Math.max(k+u,w+l+2):w+u}}let dV=Ie([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:hV}=dV,pV=Ie([{name:"a_packed",components:4,type:"Float32"}]),{members:fV}=pV,mV=Ev.types,gV=Math.cos(Math.PI/180*37.5);class Iv{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(l=>l.id),this.index=s.index,this.projection=s.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(l=>{this.gradients[l.id]={}}),this.layoutVertexArray=new Ne,this.layoutVertexArray2=new it,this.indexArray=new Nt,this.programConfigurations=new dd(s.layers,s.zoom),this.segments=new ur,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}populate(s,l,u,p){this.hasPattern=Rw("line",this.layers,l);let m=this.layers[0].layout.get("line-sort-key"),v=[];for(let{feature:k,id:R,index:L,sourceLayerIndex:V}of s){let B=this.layers[0]._featureFilter.needGeometry,$=_d(k,B);if(!this.layers[0]._featureFilter.filter(new O(this.zoom),$,u))continue;let Y=m?m.evaluate($,{},u):void 0,re={id:R,properties:k.properties,type:k.type,sourceLayerIndex:V,index:L,geometry:B?$.geometry:Gl(k,u,p),patterns:{},sortKey:Y};v.push(re)}m&&v.sort((k,R)=>k.sortKey-R.sortKey);let{lineAtlas:b,featureIndex:w}=l,T=this.addConstantDashes(b);for(let k of v){let{geometry:R,index:L,sourceLayerIndex:V}=k;if(T&&this.addFeatureDashes(k,b),this.hasPattern){let B=Lw("line",this.layers,k,this.zoom,l);this.patternFeatures.push(B)}else this.addFeature(k,R,L,u,b.positions,l.availableImages);w.insert(s[L].feature,R,L,V,this.index)}}addConstantDashes(s){let l=!1;for(let u of this.layers){let p=u.paint.get("line-dasharray").value,m=u.layout.get("line-cap").value;if(p.kind!=="constant"||m.kind!=="constant")l=!0;else{let v=m.value,b=p.value;if(!b)continue;s.addDash(b,v)}}return l}addFeatureDashes(s,l){let u=this.zoom;for(let p of this.layers){let m=p.paint.get("line-dasharray").value,v=p.layout.get("line-cap").value;if(m.kind==="constant"&&v.kind==="constant")continue;let b,w;if(m.kind==="constant"){if(b=m.value,!b)continue}else b=m.evaluate({zoom:u},s);w=v.kind==="constant"?v.value:v.evaluate({zoom:u},s),l.addDash(b,w),s.patterns[p.id]=l.getKey(b,w)}}update(s,l,u,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,l,this.stateDependentLayers,u,p)}addFeatures(s,l,u,p,m){for(let v of this.patternFeatures)this.addFeature(v,v.geometry,v.index,l,u,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=s.createVertexBuffer(this.layoutVertexArray2,fV)),this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,hV),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(s){if(s.properties&&s.properties.hasOwnProperty("mapbox_clip_start")&&s.properties.hasOwnProperty("mapbox_clip_end"))return{start:+s.properties.mapbox_clip_start,end:+s.properties.mapbox_clip_end}}addFeature(s,l,u,p,m,v){let b=this.layers[0].layout,w=b.get("line-join").evaluate(s,{}),T=b.get("line-cap").evaluate(s,{}),k=b.get("line-miter-limit"),R=b.get("line-round-limit");this.lineClips=this.lineFeatureClips(s);for(let L of l)this.addLine(L,s,w,T,k,R);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,u,m,v,p)}addLine(s,l,u,p,m,v){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineS
8oFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let re=0;re<s.length-1;re++)this.totalDistance+=s[re].dist(s[re+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let b=mV[l.type]==="Polygon",w=s.length;for(;w>=2&&s[w-1].equals(s[w-2]);)w--;let T=0;for(;T<w-1&&s[T].equals(s[T+1]);)T++;if(w<(b?3:2))return;u==="bevel"&&(m=1.05);let k=this.overscaling<=16?15*Ut/(512*this.overscaling):0,R=this.segments.prepareSegment(10*w,this.layoutVertexArray,this.indexArray),L,V,B,$,Y;this.e1=this.e2=-1,b&&(L=s[w-2],Y=s[T].sub(L)._unit()._perp());for(let re=T;re<w;re++){if(B=re===w-1?b?s[T+1]:void 0:s[re+1],B&&s[re].equals(B))continue;Y&&($=Y),L&&(V=L),L=s[re],Y=B?B.sub(L)._unit()._perp():$,$=$||Y;let fe=$.add(Y);fe.x===0&&fe.y===0||fe._unit();let oe=$.x*Y.x+$.y*Y.y,he=fe.x*Y.x+fe.y*Y.y,ge=he!==0?1/he:1/0,me=2*Math.sqrt(2-2*he),Le=he<gV&&V&&B,Pe=$.x*Y.y-$.y*Y.x>0;if(Le&&re>T){let ze=L.dist(V);if(ze>2*k){let Ke=L.sub(L.sub(V)._mult(k/ze)._round());this.updateDistance(V,Ke),this.addCurrentVertex(Ke,$,0,0,R),V=Ke}}let He=V&&B,rt=He?u:b?"butt":p;if(He&&rt==="round"&&(ge<v?rt="miter":ge<=2&&(rt="fakeround")),rt==="miter"&&ge>m&&(rt="bevel"),rt==="bevel"&&(ge>2&&(rt="flipbevel"),ge<m&&(rt="miter")),V&&this.updateDistance(V,L),rt==="miter")fe._mult(ge),this.addCurrentVertex(L,fe,0,0,R);else if(rt==="flipbevel"){if(ge>100)fe=Y.mult(-1);else{let ze=ge*$.add(Y).mag()/$.sub(Y).mag();fe._perp()._mult(ze*(Pe?-1:1))}this.addCurrentVertex(L,fe,0,0,R),this.addCurrentVertex(L,fe.mult(-1),0,0,R)}else if(rt==="bevel"||rt==="fakeround"){let ze=-Math.sqrt(ge*ge-1),Ke=Pe?ze:0,Xe=Pe?0:ze;if(V&&this.addCurrentVertex(L,$,Ke,Xe,R),rt==="fakeround"){let et=Math.round(180*me/Math.PI/20);for(let dt=1;dt<et;dt++){let Be=dt/et;if(Be!==.5){let Rt=Be-.5;Be+=Be*Rt*(Be-1)*((1.0904+oe*(oe*(3.55645-1.43519*oe)-3.2452))*Rt*Rt+(.848013+oe*(.215638*oe-1.06021)))}let xt=Y.sub($)._mult(Be)._add($)._unit()._mult(Pe?-1:1);this.addHalfVertex(L,xt.x,xt.y,!1,Pe,0,R)}}B&&this.addCurrentVertex(L,Y,-Ke,-Xe,R)}else if(rt==="butt")this.addCurrentVertex(L,fe,0,0,R);else if(rt==="square"){let ze=V?1:-1;V||this.addCurrentVertex(L,fe,ze,ze,R),this.addCurrentVertex(L,fe,0,0,R),V&&this.addCurrentVertex(L,fe,ze,ze,R)}else rt==="round"&&(V&&(this.addCurrentVertex(L,$,0,0,R),this.addCurrentVertex(L,$,1,1,R,!0)),B&&(this.addCurrentVertex(L,Y,-1,-1,R,!0),this.addCurrentVertex(L,Y,0,0,R)));if(Le&&re<w-1){let ze=L.dist(B);if(ze>2*k){let Ke=L.add(B.sub(L)._mult(k/ze)._round());this.updateDistance(L,Ke),this.addCurrentVertex(Ke,Y,0,0,R),L=Ke}}}}addCurrentVertex(s,l,u,p,m,v=!1){let b=l.y*p-l.x,w=-l.y-l.x*p;this.addHalfVertex(s,l.x+l.y*u,l.y-l.x*u,v,!1,u,m),this.addHalfVertex(s,b,w,v,!0,-p,m)}addHalfVertex({x:s,y:l},u,p,m,v,b,w){this.layoutVertexArray.emplaceBack((s<<1)+(m?1:0),(l<<1)+(v?1:0),Math.round(63*u)+128,Math.round(63*p)+128,1+(b===0?0:b<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);let T=w.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,T),w.primitiveLength++),v?this.e2=T:this.e1=T}updateScaledDistance(){if(this.lineClips){let s=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=s*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(s,l){this.distance+=s.dist(l),this.updateScaledDistance()}}Pt(Iv,"LineBucket",{omit:["layers","patternFeatures"]});let _V=new ue({"line-cap":new Q(Ue.layout_line["line-cap"]),"line-join":new Q(Ue.layout_line["line-join"]),"line-miter-limit":new H(Ue.layout_line["line-miter-limit"]),"line-round-limit":new H(Ue.layout_line["line-round-limit"]),"line-sort-key":new Q(Ue.layout_line["line-sort-key"])});var rk={paint:new ue({"line-opacity":new Q(Ue.paint_line["line-opacity"]),"line-color":new Q(Ue.paint_line["line-color"]),"line-translate":new H(Ue.paint_line["line-translate"]),"line-translate-anchor":new H(Ue.paint_line["line-translate-anchor"]),"line-width":new Q(Ue.paint_line["line-width"]),"line-gap-width":new Q(Ue.paint_line["line-gap-width"]),"line-offset":new Q(Ue.paint_line["line-offset"]),"line-blur"
8:new Q(Ue.paint_line["line-blur"]),"line-dasharray":new Q(Ue.paint_line["line-dasharray"]),"line-pattern":new Q(Ue.paint_line["line-pattern"]),"line-gradient":new le(Ue.paint_line["line-gradient"]),"line-trim-offset":new H(Ue.paint_line["line-trim-offset"])}),layout:_V};let ok=new class extends Q{possiblyEvaluate(a,s){return s=new O(Math.floor(s.zoom),{now:s.now,fadeDuration:s.fadeDuration,transition:s.transition}),super.possiblyEvaluate(a,s)}evaluate(a,s,l,u){return s=cn({},s,{zoom:Math.floor(s.zoom)}),super.evaluate(a,s,l,u)}}(rk.paint.properties["line-width"].specification);function sk(a,s){return s>0?s+2*a:a}ok.useIntegerZoom=!0;let vV=Ie([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),yV=Ie([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),bV=Ie([{name:"a_projected_pos",components:4,type:"Float32"}],4);Ie([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let xV=Ie([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),wV=Ie([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);Ie([{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"}]);let ak=Ie([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),CV=Ie([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Ie([{name:"triangle",components:3,type:"Uint16"}]),Ie([{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"}]),Ie([{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"}]),Ie([{type:"Float32",name:"offsetX"}]),Ie([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Vr=24;let xa=128;function Nw(a,s){let{expression:l}=s;if(l.kind==="constant")return{kind:"constant",layoutSize:l.evaluate(new O(a+1))};if(l.kind==="source")return{kind:"source"};{let{zoomStops:u,interpolationType:p}=l,m=0;for(;m<u.length&&u[m]<=a;)m++;m=Math.max(0,m-1);let v=m;for(;v<u.length&&u[v]<a+1;)v++;v=Math.min(u.length-1,v);let b=u[m],w=u[v];return l.kind==="composite"?{kind:"composite",minZoom:b,maxZoom:w,interpolationType:p}:{kind:"camera",minZoom:b,maxZoom:w,minSize:l.evaluate(new O(b)),maxSize:l.evaluate(new O(w)),interpolationType:p}}}function Dv(a,{uSize:s,uSizeT:l},{lowerSize:u,upperSize:p}){return a.kind==="source"?u/xa:a.kind==="composite"?Wi(u/xa,p/xa,l):s}function ep(a,s){let l=0,u=0;if(a.kind==="constant")u=a.layoutSize;else if(a.kind!=="source"){let{interpolationType:p,minZoom:m,maxZoom:v}=a,b=p?pt(Os.interpolationFactor(p,s,m,v),0,1):0;a.kind==="camera"?u=Wi(a.minSize,a.maxSize,b):l=b}return{uSizeT:l,uSize:u}}var EV=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:xa,evaluateSizeForFeature:Dv,evaluateSizeForZoom:ep,getSizeData:Nw});function SV(a,s,l){return a.sections.forEach(u=>{u.text=function(p,m,v){let b=m.layout.get("text-transform").evaluate(v,{});return b==="uppercase"?p=p.toLocaleUpperCase():b==="lowercase"&&(p=p.toLocaleLowerCase()),D.applyArabicShaping&&(p=D.applyArabicShaping(p)),p}(u.text,s,l)}),a}let dg={"!":"\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"
vendor: 4,435 bytes, line 8
8:"\uFE42","\u2190":"\u2191","\u2192":"\u2193"};function TV(a){return a==="\uFE36"||a==="\uFE48"||a==="\uFE38"||a==="\uFE44"||a==="\uFE42"||a==="\uFE3E"||a==="\uFE3C"||a==="\uFE3A"||a==="\uFE18"||a==="\uFE40"||a==="\uFE10"||a==="\uFE13"||a==="\uFE14"||a==="\uFF40"||a==="\uFFE3"||a==="\uFE11"||a==="\uFE12"}function IV(a){return a==="\uFE35"||a==="\uFE47"||a==="\uFE37"||a==="\uFE43"||a==="\uFE41"||a==="\uFE3D"||a==="\uFE3B"||a==="\uFE39"||a==="\uFE17"||a==="\uFE3F"}var lk=En,ck=function(a,s,l,u,p){var m,v,b=8*p-u-1,w=(1<<b)-1,T=w>>1,k=-7,R=l?p-1:0,L=l?-1:1,V=a[s+R];for(R+=L,m=V&(1<<-k)-1,V>>=-k,k+=b;k>0;m=256*m+a[s+R],R+=L,k-=8);for(v=m&(1<<-k)-1,m>>=-k,k+=u;k>0;v=256*v+a[s+R],R+=L,k-=8);if(m===0)m=1-T;else{if(m===w)return v?NaN:1/0*(V?-1:1);v+=Math.pow(2,u),m-=T}return(V?-1:1)*v*Math.pow(2,m-u)},uk=function(a,s,l,u,p,m){var v,b,w,T=8*m-p-1,k=(1<<T)-1,R=k>>1,L=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,V=u?0:m-1,B=u?1:-1,$=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(b=isNaN(s)?1:0,v=k):(v=Math.floor(Math.log(s)/Math.LN2),s*(w=Math.pow(2,-v))<1&&(v--,w*=2),(s+=v+R>=1?L/w:L*Math.pow(2,1-R))*w>=2&&(v++,w/=2),v+R>=k?(b=0,v=k):v+R>=1?(b=(s*w-1)*Math.pow(2,p),v+=R):(b=s*Math.pow(2,R-1)*Math.pow(2,p),v=0));p>=8;a[l+V]=255&b,V+=B,b/=256,p-=8);for(v=v<<p|b,T+=p;T>0;a[l+V]=255&v,V+=B,v/=256,T-=8);a[l+V-B]|=128*$};function En(a){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(a)?a:new Uint8Array(a||0),this.pos=0,this.type=0,this.length=this.buf.length}En.Varint=0,En.Fixed64=1,En.Bytes=2,En.Fixed32=5;var zw=4294967296,dk=1/zw,hk=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Wl(a){return a.type===En.Bytes?a.readVarint()+a.pos:a.pos+1}function tp(a,s,l){return l?4294967296*s+(a>>>0):4294967296*(s>>>0)+(a>>>0)}function pk(a,s,l){var u=s<=16383?1:s<=2097151?2:s<=268435455?3:Math.floor(Math.log(s)/(7*Math.LN2));l.realloc(u);for(var p=l.pos-1;p>=a;p--)l.buf[p+u]=l.buf[p]}function DV(a,s){for(var l=0;l<a.length;l++)s.writeVarint(a[l])}function MV(a,s){for(var l=0;l<a.length;l++)s.writeSVarint(a[l])}function kV(a,s){for(var l=0;l<a.length;l++)s.writeFloat(a[l])}function AV(a,s){for(var l=0;l<a.length;l++)s.writeDouble(a[l])}function PV(a,s){for(var l=0;l<a.length;l++)s.writeBoolean(a[l])}function OV(a,s){for(var l=0;l<a.length;l++)s.writeFixed32(a[l])}function RV(a,s){for(var l=0;l<a.length;l++)s.writeSFixed32(a[l])}function LV(a,s){for(var l=0;l<a.length;l++)s.writeFixed64(a[l])}function FV(a,s){for(var l=0;l<a.length;l++)s.writeSFixed64(a[l])}function Mv(a,s){return(a[s]|a[s+1]<<8|a[s+2]<<16)+16777216*a[s+3]}function ip(a,s,l){a[l]=s,a[l+1]=s>>>8,a[l+2]=s>>>16,a[l+3]=s>>>24}function fk(a,s){return(a[s]|a[s+1]<<8|a[s+2]<<16)+(a[s+3]<<24)}En.prototype={destroy:function(){this.buf=null},readFields:function(a,s,l){for(l=l||this.length;this.pos<l;){var u=this.readVarint(),p=u>>3,m=this.pos;this.type=7&u,a(p,s,this),this.pos===m&&this.skip(u)}return s},readMessage:function(a,s){return this.readFields(a,s,this.readVarint()+this.pos)},readFixed32:function(){var a=Mv(this.buf,this.pos);return this.pos+=4,a},readSFixed32:function(){var a=fk(this.buf,this.pos);return this.pos+=4,a},readFixed64:function(){var a=Mv(this.buf,this.pos)+Mv(this.buf,this.pos+4)*zw;return this.pos+=8,a},readSFixed64:function(){var a=Mv(this.buf,this.pos)+fk(this.buf,this.pos+4)*zw;return this.pos+=8,a},readFloat:function(){var a=ck(this.buf,this.pos,!0,23,4);return this.pos+=4,a},readDouble:function(){var a=ck(this.buf,this.pos,!0,52,8);return this.pos+=8,a},readVarint:function(a){var s,l,u=this.buf;return s=127&(l=u[this.pos++]),l<128?s:(s|=(127&(l=u[this.pos++]))<<7,l<128?s:(s|=(127&(l=u[this.pos++]))<<14,l<128?s:(s|=(127&(l=u[this.pos++]))<<21,l<128?s:function(p,m,v){var b,w,T=v.buf;if(b=(112&(w=T[v.pos++]))>>4,w<128||(b|=(127&(w=T[v.pos++]))<<3,w<128)||(b|=(127&(w=T[v.pos++]))<<10,w<128)||(b|=(127&(w=T[v.pos++]))<<17,w<128)||(b|=(127&(w=T[v.pos++]))<<24,w<128)||(b|=(1&(w=T[v.pos++]))<<31,w<128))return tp(p,b,m);throw new Error("Expected varint not more than 10 bytes")}(s|=(15&(l=u[this.pos]))<<28,a,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var a=this.readVarint();return a%2==1?(a+1)/-2:a/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var a=this.readVarint()+this.pos,s=this.pos;return this.pos=a,a-s>=12&&hk?function(l,u,p){return hk.decode(l.subarray(u,p))}(this.buf,s,a):function(l,u,p){for(var m="",v=u;v<p;
8){var b,w,T,k=l[v],R=null,L=k>239?4:k>223?3:k>191?2:1;if(v+L>p)break;L===1?k<128&&(R=k):L===2?(192&(b=l[v+1]))==128&&(R=(31&k)<<6|63&b)<=127&&(R=null):L===3?(w=l[v+2],(192&(b=l[v+1]))==128&&(192&w)==128&&((R=(15&k)<<12|(63&b)<<6|63&w)<=2047||R>=55296&&R<=57343)&&(R=null)):L===4&&(w=l[v+2],T=l[v+3],(192&(b=l[v+1]))==128&&(192&w)==128&&(192&T)==128&&((R=(15&k)<<18|(63&b)<<12|(63&w)<<6|63&T)<=65535||R>=1114112)&&(R=null)),R===null?(R=65533,L=1):R>65535&&(R-=65536,m+=String.fromCharCode(R>>>10&1023|55296),R=56320|1023&R),m+=String.fromCharCode(R),v+=L}return m}(this.buf,s,a)},readBytes:function(){var a=this.readVarint()+this.pos,s=this.buf.subarray(this.pos,a);return this.pos=a,s},readPackedVarint:function(a,s){if(this.type!==En.Bytes)return a.push(this.readVarint(s));var l=Wl(this);for(a=a||[];this.pos<l;)a.push(this.readVarint(s));return a},readPackedSVarint:function(a){if(this.type!==En.Bytes)return a.push(this.readSVarint());var s=Wl(this);for(a=a||[];this.pos<s;)a.push(this.readSVarint());return a},readPackedBoolean:function(a){if(this.type!==En.Bytes)return a.push(this.readBoolean());var s=Wl(this);for(a=a||[];this.pos<s;)a.push(this.readBoolean());return a},readPackedFloat:function(a){if(this.type!==En.Bytes)return a.push(this.readFloat());var s=Wl(this);for(a=a||[];this.pos<s;)a.push(this.readFloat());return a},readPackedDouble:function(a){if(this.type!==En.Bytes)return a.push(this.readDouble());var s=Wl(this);for(a=a||[];this.pos<s;)a.push(this.readDouble());return a},readPackedFixed32:function(a){if(this.type!==En.Bytes)return a.push(this.readFixed32());var s=Wl(this);for(a=a||[];this.pos<s;)a.push(this.readFixed32());return a},readPackedSFixed32:function(a){if(this.type!==En.Bytes)return a.push(this.readSFixed32());var s=Wl(this);for(a=a||[];this.pos<s;)a.push(this.readSFixed32());return a},readPackedFixed64:function(a){if(this.type!==En.Bytes)return a.push(this.readFixed64());var s=Wl(this);for(a=a||[];this.pos<s;)a.push(this.readFixed64());return a},readPackedSFixed64:function(a){if(this.type!==En.Bytes)return a.push(this.readSFixed64());var s=Wl(this);for(a=a||[];this.pos<s;)a.push(this.readSFixed64());return a},skip:function(a){var s=7&a;if(s===En.Varint)for(;this.buf[this.pos++]>127;);else if(s===En.Bytes)this.pos=this.readVarint()+this.pos;else if(s===En.Fixed32)this.pos+=4;else{if(s!==En.Fixed64)throw new Error("Unimplemented type: "+s);this.pos+=8}},writeTag:function(a,s){this.writeVarint(a<<3|s)},realloc:function(a){for(var s=this.length||16;s<this.pos+a;)s*=2;if(s!==this.length){var l=new Uint8Array(s);l.set(this.buf),this.buf=l,this.length=s}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(a){this.realloc(4),ip(this.buf,a,this.pos),this.pos+=4},writeSFixed32:function(a){this.realloc(4),ip(this.buf,a,this.pos),this.pos+=4},writeFixed64:function(a){this.realloc(8),ip(this.buf,-1&a,this.pos),ip(this.buf,Math.floor(a*dk),this.pos+4),this.pos+=8},writeSFixed64:function(a){this.realloc(8),ip(this.buf,-1&a,this.pos),ip(this.buf,Math.floor(a*dk),this.pos+4),this.pos+=8},writeVarint:function(a){(a=+a||0)>268435455||a<0?function(s,l){var u,p;if(s>=0?(u=s%4294967296|0,p=s/4294967296|0):(p=~(-s/4294967296),4294967295^(u=~(-s%4294967296))?u=u+1|0:(u=0,p=p+1|0)),s>=18446744073709552e3||s<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");l.realloc(10),function(m,v,b){b.buf[b.pos++]=127&m|128,m>>>=7,b.buf[b.pos++]=127&m|128,m>>>=7,b.buf[b.pos++]=127&m|128,m>>>=7,b.buf[b.pos++]=127&m|128,b.buf[b.pos]=127&(m>>>=7)}(u,0,l),function(m,v){var b=(7&m)<<4;v.buf[v.pos++]|=b|((m>>>=3)?128:0),m&&(v.buf[v.pos++]=127&m|((m>>>=7)?128:0),m&&(v.buf[v.pos++]=127&m|((m>>>=7)?128:0),m&&(v.buf[v.pos++]=127&m|((m>>>=7)?128:0),m&&(v.buf[v.pos++]=127&m|((m>>>=7)?128:0),m&&(v.buf[v.pos++]=127&m)))))}(p,l)}(a,this):(this.realloc(4),this.buf[this.pos++]=127&a|(a>127?128:0),a<=127||(this.buf[this.pos++]=127&(a>>>=7)|(a>127?128:0),a<=127||(this.buf[this.pos++]=127&(a>>>=7)|(a>127?128:0),a<=127||(this.buf[this.pos++]=a>>>7&127))))},writeSVarint:function(a){this.writeVarint(a<0?2*-a-1:2*a)},writeBoolean:function(a){this.writeVarint(!!a)},writeString:function(a){a=String(a),this.realloc(4*a.length),this.pos++;var s=this.pos;this.pos=function(u,p,m){for(var v,b,w=0;w<p.length;
vendor: 1,043 bytes, line 8
8w++){if((v=p.charCodeAt(w))>55295&&v<57344){if(!b){v>56319||w+1===p.length?(u[m++]=239,u[m++]=191,u[m++]=189):b=v;continue}if(v<56320){u[m++]=239,u[m++]=191,u[m++]=189,b=v;continue}v=b-55296<<10|v-56320|65536,b=null}else b&&(u[m++]=239,u[m++]=191,u[m++]=189,b=null);v<128?u[m++]=v:(v<2048?u[m++]=v>>6|192:(v<65536?u[m++]=v>>12|224:(u[m++]=v>>18|240,u[m++]=v>>12&63|128),u[m++]=v>>6&63|128),u[m++]=63&v|128)}return m}(this.buf,a,this.pos);var l=this.pos-s;l>=128&&pk(s,l,this),this.pos=s-1,this.writeVarint(l),this.pos+=l},writeFloat:function(a){this.realloc(4),uk(this.buf,a,this.pos,!0,23,4),this.pos+=4},writeDouble:function(a){this.realloc(8),uk(this.buf,a,this.pos,!0,52,8),this.pos+=8},writeBytes:function(a){var s=a.length;this.writeVarint(s),this.realloc(s);for(var l=0;l<s;l++)this.buf[this.pos++]=a[l]},writeRawMessage:function(a,s){this.pos++;var l=this.pos;a(s,this);var u=this.pos-l;u>=128&&pk(l,u,this),this.pos=l-1,this.writeVarint(u),this.pos+=u},writeMessage:function(a,s,l){this.writeTag(a,En.Bytes),this.writeRawMessage(s,l)}
8,writePackedVarint:function(a,s){s.length&&this.writeMessage(a,DV,s)},writePackedSVarint:function(a,s){s.length&&this.writeMessage(a,MV,s)},writePackedBoolean:function(a,s){s.length&&this.writeMessage(a,PV,s)},writePackedFloat:function(a,s){s.length&&this.writeMessage(a,kV,s)},writePackedDouble:function(a,s){s.length&&this.writeMessage(a,AV,s)},writePackedFixed32:function(a,s){s.length&&this.writeMessage(a,OV,s)},writePackedSFixed32:function(a,s){s.length&&this.writeMessage(a,RV,s)},writePackedFixed64:function(a,s){s.length&&this.writeMessage(a,LV,s)},writePackedSFixed64:function(a,s){s.length&&this.writeMessage(a,FV,s)},writeBytesField:function(a,s){this.writeTag(a,En.Bytes),this.writeBytes(s)},writeFixed32Field:function(a,s){this.writeTag(a,En.Fixed32),this.writeFixed32(s)},writeSFixed32Field:function(a,s){this.writeTag(a,En.Fixed32),this.writeSFixed32(s)},writeFixed64Field:function(a,s){this.writeTag(a,En.Fixed64),this.writeFixed64(s)},writeSFixed64Field:function(a,s){this.writeTag(a,En.Fixed64),this.writeSFixed64(s)},writeVarintField:function(a,s){this.writeTag(a,En.Varint),this.writeVarint(s)},writeSVarintField:function(a,s){this.writeTag(a,En.Varint),this.writeSVarint(s)},writeStringField:function(a,s){this.writeTag(a,En.Bytes),this.writeString(s)},writeFloatField:function(a,s){this.writeTag(a,En.Fixed32),this.writeFloat(s)},writeDoubleField:function(a,s){this.writeTag(a,En.Fixed64),this.writeDouble(s)},writeBooleanField:function(a,s){this.writeVarintField(a,!!s)}};var kv=at(lk);let jw=3;function NV(a,s,l){s.glyphs=[],a===1&&l.readMessage(zV,s)}function zV(a,s,l){if(a===3){let{id:u,bitmap:p,width:m,height:v,left:b,top:w,advance:T}=l.readMessage(jV,{});s.glyphs.push({id:u,bitmap:new ql({width:m+2*jw,height:v+2*jw},p),metrics:{width:m,height:v,left:b,top:w,advance:T}})}else a===4?s.ascender=l.readSVarint():a===5&&(s.descender=l.readSVarint())}function jV(a,s,l){a===1?s.id=l.readVarint():a===2?s.bitmap=l.readBytes():a===3?s.width=l.readVarint():a===4?s.height=l.readVarint():a===5?s.left=l.readSVarint():a===6?s.top=l.readSVarint():a===7&&(s.advance=l.readVarint())}let mk=jw;function Vw(a){let s=0,l=0;for(let v of a)s+=v.w*v.h,l=Math.max(l,v.w);a.sort((v,b)=>b.h-v.h);let u=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(s/.95)),l),h:1/0}],p=0,m=0;for(let v of a)for(let b=u.length-1;b>=0;b--){let w=u[b];if(!(v.w>w.w||v.h>w.h)){if(v.x=w.x,v.y=w.y,m=Math.max(m,v.y+v.h),p=Math.max(p,v.x+v.w),v.w===w.w&&v.h===w.h){let T=u.pop();b<u.length&&(u[b]=T)}else v.h===w.h?(w.x+=v.w,w.w-=v.w):v.w===w.w?(w.y+=v.h,w.h-=v.h):(u.push({x:w.x+v.w,y:w.y,w:w.w-v.w,h:v.h}),w.y+=v.h,w.h-=v.h);break}}return{w:p,h:m,fill:s/(p*m)||0}}let Mo=1;class Bw{constructor(s,{pixelRatio:l,version:u,stretchX:p,stretchY:m,content:v}){this.paddedRect=s,this.pixelRatio=l,this.stretchX=p,this.stretchY=m,this.content=v,this.version=u}get tl(){return[this.paddedRect.x+Mo,this.paddedRect.y+Mo]}get br(){return[this.paddedRect.x+this.paddedRect.w-Mo,this.paddedRect.y+this.paddedRect.h-Mo]}get displaySize(){return[(this.paddedRect.w-2*Mo)/this.pixelRatio,(this.paddedRect.h-2*Mo)/this.pixelRatio]}}class gk{constructor(s,l){let u={},p={};this.haveRenderCallbacks=[];let m=[];this.addImages(s,u,m),this.addImages(l,p,m);let{w:v,h:b}=Vw(m),w=new Ko({width:v||1,height:b||1});for(let T in s){let k=s[T],R=u[T].paddedRect;Ko.copy(k.data,w,{x:0,y:0},{x:R.x+Mo,y:R.y+Mo},k.data)}for(let T in l){let k=l[T],R=p[T].paddedRect,L=R.x+Mo,V=R.y+Mo,B=k.data.width,$=k.data.height;Ko.copy(k.data,w,{x:0,y:0},{x:L,y:V},k.data),Ko.copy(k.data,w,{x:0,y:$-1},{x:L,y:V-1},{width:B,height:1}),Ko.copy(k.data,w,{x:0,y:0},{x:L,y:V+$},{width:B,height:1}),Ko.copy(k.data,w,{x:B-1,y:0},{x:L-1,y:V},{width:1,height:$}),Ko.copy(k.data,w,{x:0,y:0},{x:L+B,y:V},{width:1,height:$})}this.image=w,this.iconPositions=u,this.patternPositions=p}addImages(s,l,u){for(let p in s){let m=s[p],v={x:0,y:0,w:m.data.width+2*Mo,h:m.data.height+2*Mo};u.push(v),l[p]=new Bw(v,m),m.hasRenderCallback&&this.haveRenderCallbacks.push(p)}}patchUpdatedImages(s,l){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(u=>s.hasImage(u)),s.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let u in s.updatedImages)this.patchUpdatedImage(this.iconPositions[u],s.getImage(u),l),this.patchUpdatedImage(this.patternPositions[u],s.getImage(u),l)}patchUpdatedImage(s,l,u){if(!s||!l||s.version===l.version)return;s.version=l.version;let[p,m]=s.tl;u.update(l.data,void 0,{x:p,y:m})}}Pt(Bw,"ImagePosition"),Pt(gk,"ImageAtlas");let ps={horizontal:1,vertical:2,horizontalOnly:3},_k=-17;class hg{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(s,l){let u=new hg;return u.scale=s||1,u.fontStack=l,u}static forImage(s){let l=new hg;return l.imageName=s,l}}class np{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(s,l){let u=new np;for(let p=0;p<s.sections.length;p++){let m=s.sections[p];m.image?u.addImageSection(m):u.addTextSection(m,l)}return u}length(){return this.text.length}getSection(s){return this.sections[this.sectionIndex[s]]}getSections(){return this.sections}getSectionIndex(s){return this.sectionIndex[s]}getCharCode(s){return this.text.charCodeAt(s)}verticalizePunctuation(s){this.text=function(l,u){let p="";for(let m=0;m<l.length;m++){let v=l.charCodeAt(m+1)||null,b=l.charCodeAt(m-1)||null;p+=!u&&(v&&ov(v)&&!dg[l[m+1]]||b&&ov(b)&&!dg[l[m-1]])||!dg[l[m]]?l[m]:dg[l[m]]}return p}(this.text,s)}trim(){let s=0;for(let u=0;u<this.text.length&&Av[this.text.charCodeAt(u)];u++)s++;let l=this.text.length;for(let u=this.text.length-1;u>=0&&u>=s&&Av[this.text.charCodeAt(u)];u--)l--;this.text=this.text.substring(s,l),this.sectionIndex=this.sectionIndex.slice(s,l)}
8substring(s,l){let u=new np;return u.text=this.text.substring(s,l),u.sectionIndex=this.sectionIndex.slice(s,l),u.sections=this.sections,u}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((s,l)=>Math.max(s,this.sections[l].scale),0)}addTextSection(s,l){this.text+=s.text,this.sections.push(hg.forText(s.scale,s.fontStack||l));let u=this.sections.length-1;for(let p=0;p<s.text.length;++p)this.sectionIndex.push(u)}addImageSection(s){let l=s.image?s.image.name:"";if(l.length===0)return void Un("Can't add FormattedSection with an empty image.");let u=this.getNextImageSectionCharCode();u?(this.text+=String.fromCharCode(u),this.sections.push(hg.forImage(l)),this.sectionIndex.push(this.sections.length-1)):Un("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Uw(a,s,l,u,p,m,v,b,w,T,k,R,L,V,B){let $=np.fromFeature(a,p);R===ps.vertical&&$.verticalizePunctuation(L);let Y=[],re=function(me,Le,Pe,He,rt,ze){if(!me)return[];let Ke=[],Xe=function(xt,Rt,wt,li,ht,Vt){let ci=0;for(let Ki=0;Ki<xt.length();Ki++){let ui=xt.getSection(Ki);ci+=vk(xt.getCharCode(Ki),ui,li,ht,Rt,Vt)}return ci/Math.max(1,Math.ceil(ci/wt))}(me,Le,Pe,He,rt,ze),et=me.text.indexOf("\u200B")>=0,dt=0;for(let xt=0;xt<me.length();xt++){let Rt=me.getSection(xt),wt=me.getCharCode(xt);if(Av[wt]||(dt+=vk(wt,Rt,He,rt,Le,ze)),xt<me.length()-1){let li=!((Be=wt)<11904||!(St["Bopomofo Extended"](Be)||St.Bopomofo(Be)||St["CJK Compatibility Forms"](Be)||St["CJK Compatibility Ideographs"](Be)||St["CJK Compatibility"](Be)||St["CJK Radicals Supplement"](Be)||St["CJK Strokes"](Be)||St["CJK Symbols and Punctuation"](Be)||St["CJK Unified Ideographs Extension A"](Be)||St["CJK Unified Ideographs"](Be)||St["Enclosed CJK Letters and Months"](Be)||St["Halfwidth and Fullwidth Forms"](Be)||St.Hiragana(Be)||St["Ideographic Description Characters"](Be)||St["Kangxi Radicals"](Be)||St["Katakana Phonetic Extensions"](Be)||St.Katakana(Be)||St["Vertical Forms"](Be)||St["Yi Radicals"](Be)||St["Yi Syllables"](Be)));(VV[wt]||li||Rt.imageName)&&Ke.push(bk(xt+1,dt,Xe,Ke,BV(wt,me.getCharCode(xt+1),li&&et),!1))}}var Be;return xk(bk(me.length(),dt,Xe,Ke,0,!0))}($,T,m,s,u,V),{processBidirectionalText:fe,processStyledBidirectionalText:oe}=D;if(fe&&$.sections.length===1){let me=fe($.toString(),re);for(let Le of me){let Pe=new np;Pe.text=Le,Pe.sections=$.sections;for(let He=0;He<Le.length;He++)Pe.sectionIndex.push(0);Y.push(Pe)}}else if(oe){let me=oe($.text,$.sectionIndex,re);for(let Le of me){let Pe=new np;Pe.text=Le[0],Pe.sectionIndex=Le[1],Pe.sections=$.sections,Y.push(Pe)}}else Y=function(me,Le){let Pe=[],He=me.text,rt=0;for(let ze of Le)Pe.push(me.substring(rt,ze)),rt=ze;return rt<He.length&&Pe.push(me.substring(rt,He.length)),Pe}($,re);let he=[],ge={positionedLines:he,text:$.toString(),top:k[1],bottom:k[1],left:k[0],right:k[0],writingMode:R,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(me,Le,Pe,He,rt,ze,Ke,Xe,et,dt,Be,xt){let Rt=0,wt=0,li=0,ht=Xe==="right"?1:Xe==="left"?0:.5,Vt=!1;for(let fi of rt){let mi=fi.getSections();for(let xn of mi){if(xn.imageName)continue;let Sn=Le[xn.fontStack];if(Sn&&(Vt=Sn.ascender!==void 0&&Sn.descender!==void 0,!Vt))break}if(!Vt)break}let ci=0;for(let fi of rt){fi.trim();let mi=fi.getMaxScale(),xn=(mi-1)*Vr,Sn={positionedGlyphs:[],lineOffset:0};me.positionedLines[ci]=Sn;let Tn=Sn.positionedGlyphs,wn=0;if(!fi.length()){wt+=ze,++ci;continue}let $n=0,er=0;for(let Cn=0;Cn<fi.length();Cn++){let br=fi.getSection(Cn),pr=fi.getSectionIndex(Cn),Kn=fi.getCharCode(Cn),Ji=br.scale,fr=null,In=null,xo=null,mr=Vr,Br=0,kr=!(et===ps.horizontal||!Be&&!jm(Kn)||Be&&(Av[Kn]||(Ki=Kn,St.Arabic(Ki)||St["Arabic Supplement"](Ki)||St["Arabic Extended-A"](Ki)||St["Arabic Presentation Forms-A"](Ki)||St["Arabic Presentation Forms-B"](Ki))));if(br.imageName){let wo=He[br.imageName];if(!wo)continue;xo=br.imageName,me.iconsInText=me.iconsInText||!0,In=wo.paddedRect;let Ar=wo.displaySize;Ji=Ji*Vr/xt,fr={width:Ar[0],height:Ar[1],left:Mo,top:-mk,advance:kr?Ar[1]:Ar[0],localGlyph:!1},Br=Vt?-fr.height*Ji:_k+mi*Vr-Ar[1]*Ji,mr=fr.advance;let Ea=(kr?Ar[0]:Ar[1])*Ji-Vr*mi;Ea>0&&Ea>wn&&(wn=Ea)}else{let wo=Pe[br.fontStack];if(!wo)continue;wo[Kn]&&(In=wo[Kn]);let Ar=Le[br.fontStack];if(!Ar)continue;let Ea=Ar.glyphs[Kn];if(!Ea)continue;if(fr=Ea.metrics,mr=Kn!==8203?Vr:0,Vt){let up=Ar.ascender!==void 0?Math.abs(Ar.ascender):0,wg=Ar.descender!==void 0?Math.abs(Ar.descender):0,Cg=(up+wg)*Ji;$n<Cg&&($n=Cg,er=(up-wg)/2*Ji),Br=-up*Ji}else Br=_k+(mi-Ji)*Vr}kr?(me.verticalizable=!0,Tn.push({glyph:Kn,imageName:xo,x:Rt,y:wt+Br,vertical:kr,scale:Ji,localGlyph:fr.localGlyph,fontStack:br.fontStack,sectionIndex:pr,metrics:fr,rect:In}),Rt+=mr*Ji+dt):(Tn.push({glyph:Kn,imageName:xo,x:Rt,y:wt+Br,vertical:kr,scale:Ji,localGlyph:fr.localGlyph,fontStack:br.fontStack,sectionIndex:pr,metrics:fr,rect:In}),Rt+=fr.advance*Ji+dt)}Tn.length!==0&&(li=Math.max(Rt-dt,li),Vt?wk(Tn,ht,wn,er,ze*mi/2):wk(Tn,ht,wn,0,ze/2)),Rt=0;let hr=ze*mi+wn;Sn.lineOffset=Math.max(wn,xn),wt+=hr,++ci}var Ki;let ui=wt,{horizontalAlign:Kt,verticalAlign:kn}=Hw(Ke);(function(fi,mi,xn,Sn,Tn,wn){let $n=(mi-xn)*Tn,er=-wn*Sn;for(let hr of fi)for(let Cn of hr.positionedGlyphs)Cn.x+=$n,Cn.y+=er})(me.positionedLines,ht,Kt,kn,li,ui),me.top+=-kn*ui,me.bottom=me.top+u
8i,me.left+=-Kt*li,me.right=me.left+li,me.hasBaseline=Vt}(ge,s,l,u,Y,v,b,w,R,T,L,B),!function(me){for(let Le of me)if(Le.positionedGlyphs.length!==0)return!1;return!0}(he)&&ge}let Av={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},VV={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function vk(a,s,l,u,p,m){if(s.imageName){let v=u[s.imageName];return v?v.displaySize[0]*s.scale*Vr/m+p:0}{let v=l[s.fontStack],b=v&&v.glyphs[a];return b?b.metrics.advance*s.scale+p:0}}function yk(a,s,l,u){let p=Math.pow(a-s,2);return u?a<s?p/2:2*p:p+Math.abs(l)*l}function BV(a,s,l){let u=0;return a===10&&(u-=1e4),l&&(u+=150),a!==40&&a!==65288||(u+=50),s!==41&&s!==65289||(u+=50),u}function bk(a,s,l,u,p,m){let v=null,b=yk(s,l,p,m);for(let w of u){let T=yk(s-w.x,l,p,m)+w.badness;T<=b&&(v=w,b=T)}return{index:a,x:s,priorBreak:v,badness:b}}function xk(a){return a?xk(a.priorBreak).concat(a.index):[]}function Hw(a){let s=.5,l=.5;switch(a){case"right":case"top-right":case"bottom-right":s=1;break;case"left":case"top-left":case"bottom-left":s=0}switch(a){case"bottom":case"bottom-right":case"bottom-left":l=1;break;case"top":case"top-right":case"top-left":l=0}return{horizontalAlign:s,verticalAlign:l}}function wk(a,s,l,u,p){if(!(s||l||u||p))return;let m=a.length-1,v=a[m],b=(v.x+v.metrics.advance*v.scale)*s;for(let w=0;w<=m;w++)a[w].x-=b,a[w].y+=l+u+p}function UV(a,s,l){let{horizontalAlign:u,verticalAlign:p}=Hw(l),m=s[0]-a.displaySize[0]*u,v=s[1]-a.displaySize[1]*p;return{image:a,top:v,bottom:v+a.displaySize[1],left:m,right:m+a.displaySize[0]}}function Ck(a,s,l,u,p,m){let v=a.image,b;if(v.content){let Y=v.content,re=v.pixelRatio||1;b=[Y[0]/re,Y[1]/re,v.displaySize[0]-Y[2]/re,v.displaySize[1]-Y[3]/re]}let w=s.left*m,T=s.right*m,k,R,L,V;l==="width"||l==="both"?(V=p[0]+w-u[3],R=p[0]+T+u[1]):(V=p[0]+(w+T-v.displaySize[0])/2,R=V+v.displaySize[0]);let B=s.top*m,$=s.bottom*m;return l==="height"||l==="both"?(k=p[1]+B-u[0],L=p[1]+$+u[2]):(k=p[1]+(B+$-v.displaySize[1])/2,L=k+v.displaySize[1]),{image:v,top:k,right:R,bottom:L,left:V,collisionPadding:b}}class Zl extends tt{constructor(s,l,u,p,m){super(s,l),this.angle=p,this.z=u,m!==void 0&&(this.segment=m)}clone(){return new Zl(this.x,this.y,this.z,this.angle,this.segment)}}function Ek(a,s,l,u,p){if(s.segment===void 0)return!0;let m=s,v=s.segment+1,b=0;for(;b>-l/2;){if(v--,v<0)return!1;b-=a[v].dist(m),m=a[v]}b+=a[v].dist(a[v+1]),v++;let w=[],T=0;for(;b<l/2;){let k=a[v],R=a[v+1];if(!R)return!1;let L=a[v-1].angleTo(k)-k.angleTo(R);for(L=Math.abs((L+3*Math.PI)%(2*Math.PI)-Math.PI),w.push({distance:b,angleDelta:L}),T+=L;b-w[0].distance>u;)T-=w.shift().angleDelta;if(T>p)return!1;v++,b+=k.dist(R)}return!0}function Sk(a){let s=0;for(let l=0;l<a.length-1;l++)s+=a[l].dist(a[l+1]);return s}function Tk(a,s,l){return a?.6*s*l:0}function Ik(a,s){return Math.max(a?a.right-a.left:0,s?s.right-s.left:0)}function HV(a,s,l,u,p,m){let v=Tk(l,p,m),b=Ik(l,u)*m,w=0,T=Sk(a)/2;for(let k=0;k<a.length-1;k++){let R=a[k],L=a[k+1],V=R.dist(L);if(w+V>T){let B=(T-w)/V,$=Wi(R.x,L.x,B),Y=Wi(R.y,L.y,B),re=new Zl($,Y,0,L.angleTo(R),k);return!v||Ek(a,re,b,v,s)?re:void 0}w+=V}}function $V(a,s,l,u,p,m,v,b,w){let T=Tk(u,m,v),k=Ik(u,p),R=k*v,L=a[0].x===0||a[0].x===w||a[0].y===0||a[0].y===w;return s-R<s/4&&(s=R+s/4),Dk(a,L?s/2*b%s:(k/2+2*m)*v*b%s,s,T,l,R,L,!1,w)}function Dk(a,s,l,u,p,m,v,b,w){let T=m/2,k=Sk(a),R=0,L=s-l,V=[];for(let B=0;B<a.length-1;B++){let $=a[B],Y=a[B+1],re=$.dist(Y),fe=Y.angleTo($);for(;L+l<R+re;){L+=l;let oe=(L-R)/re,he=Wi($.x,Y.x,oe),ge=Wi($.y,Y.y,oe);if(he>=0&&he<w&&ge>=0&&ge<w&&L-T>=0&&L+T<=k){let me=new Zl(he,ge,0,fe,B);me._round(),u&&!Ek(a,me,m,u,p)||V.push(me)}}R+=re}return b||V.length||v||(V=Dk(a,R/2,l,u,p,m,v,!0,w)),V}function Mk(a,s,l,u,p){let m=[];for(let v=0;v<a.length;v++){let b=a[v],w;for(let T=0;T<b.length-1;T++){let k=b[T],R=b[T+1];k.x<s&&R.x<s||(k.x<s?k=new tt(s,k.y+(s-k.x)/(R.x-k.x)*(R.y-k.y))._round():R.x<s&&(R=new tt(s,k.y+(s-k.x)/(R.x-k.x)*(R.y-k.y))._round()),k.y<l&&R.y<l||(k.y<l?k=new tt(k.x+(l-k.y)/(R.y-k.y)*(R.x-k.x),l)._round():R.y<l&&(R=new tt(k.x+(l-k.y)/(R.y-k.y)*(R.x-k.x),l)._roun
8d()),k.x>=u&&R.x>=u||(k.x>=u?k=new tt(u,k.y+(u-k.x)/(R.x-k.x)*(R.y-k.y))._round():R.x>=u&&(R=new tt(u,k.y+(u-k.x)/(R.x-k.x)*(R.y-k.y))._round()),k.y>=p&&R.y>=p||(k.y>=p?k=new tt(k.x+(p-k.y)/(R.y-k.y)*(R.x-k.x),p)._round():R.y>=p&&(R=new tt(k.x+(p-k.y)/(R.y-k.y)*(R.x-k.x),p)._round()),w&&k.equals(w[w.length-1])||(w=[k],m.push(w)),w.push(R)))))}}return m}Pt(Zl,"Anchor");let pg=1e20;function kk(a,s,l,u,p,m,v,b,w){for(let T=s;T<s+u;T++)Ak(a,l*m+T,m,p,v,b,w);for(let T=l;T<l+p;T++)Ak(a,T*m+s,1,u,v,b,w)}function Ak(a,s,l,u,p,m,v){m[0]=0,v[0]=-pg,v[1]=pg,p[0]=a[s];for(let b=1,w=0,T=0;b<u;b++){p[b]=a[s+b*l];let k=b*b;do{let R=m[w];T=(p[b]-p[R]+k-R*R)/(b-R)/2}while(T<=v[w]&&--w>-1);w++,m[w]=b,v[w]=T,v[w+1]=pg}for(let b=0,w=0;b<u;b++){for(;v[w+1]<b;)w++;let T=m[w],k=b-T;a[s+b*l]=p[T]+k*k}}let wa=2,$w={none:0,ideographs:1,all:2};class rp{constructor(s,l,u){this.requestManager=s,this.localGlyphMode=l,this.localFontFamily=u,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(s){this.url=s}getGlyphs(s,l){let u=[];for(let p in s)for(let m of s[p])u.push({stack:p,id:m});ri(u,({stack:p,id:m},v)=>{let b=this.entries[p];b||(b=this.entries[p]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let w=b.glyphs[m];if(w!==void 0)return void v(null,{stack:p,id:m,glyph:w});if(w=this._tinySDF(b,p,m),w)return b.glyphs[m]=w,void v(null,{stack:p,id:m,glyph:w});let T=Math.floor(m/256);if(256*T>65535)return void v(new Error("glyphs > 65535 not supported"));if(b.ranges[T])return void v(null,{stack:p,id:m,glyph:w});let k=b.requests[T];k||(k=b.requests[T]=[],rp.loadGlyphRange(p,T,this.url,this.requestManager,(R,L)=>{if(L){b.ascender=L.ascender,b.descender=L.descender;for(let V in L.glyphs)this._doesCharSupportLocalGlyph(+V)||(b.glyphs[+V]=L.glyphs[+V]);b.ranges[T]=!0}for(let V of k)V(R,L);delete b.requests[T]})),k.push((R,L)=>{R?v(R):L&&v(null,{stack:p,id:m,glyph:L.glyphs[m]||null})})},(p,m)=>{if(p)l(p);else if(m){let v={};for(let{stack:b,id:w,glyph:T}of m)v[b]===void 0&&(v[b]={}),v[b].glyphs===void 0&&(v[b].glyphs={}),v[b].glyphs[w]=T&&{id:T.id,bitmap:T.bitmap.clone(),metrics:T.metrics},v[b].ascender=this.entries[b].ascender,v[b].descender=this.entries[b].descender;l(null,v)}})}_doesCharSupportLocalGlyph(s){return this.localGlyphMode!==$w.none&&(this.localGlyphMode===$w.all?!!this.localFontFamily:!!this.localFontFamily&&(St["CJK Unified Ideographs"](s)||St["Hangul Syllables"](s)||St.Hiragana(s)||St.Katakana(s)||St["CJK Symbols and Punctuation"](s)))}_tinySDF(s,l,u){let p=this.localFontFamily;if(!p||!this._doesCharSupportLocalGlyph(u))return;let m=s.tinySDF;if(!m){let $="400";/bold/i.test(l)?$="900":/medium/i.test(l)?$="500":/light/i.test(l)&&($="200"),m=s.tinySDF=new rp.TinySDF({fontFamily:p,fontWeight:$,fontSize:24*wa,buffer:3*wa,radius:8*wa}),m.fontWeight=$}if(this.localGlyphs[m.fontWeight][u])return this.localGlyphs[m.fontWeight][u];let v=String.fromCharCode(u),{data:b,width:w,height:T,glyphWidth:k,glyphHeight:R,glyphLeft:L,glyphTop:V,glyphAdvance:B}=m.draw(v);return this.localGlyphs[m.fontWeight][u]={id:u,bitmap:new ql({width:w,height:T},b),metrics:{width:k/wa,height:R/wa,left:L/wa,top:V/wa-27,advance:B/wa,localGlyph:!0}}}}rp.loadGlyphRange=function(a,s,l,u,p){let m=256*s,v=m+255,b=u.transformRequest(u.normalizeGlyphsURL(l).replace("{fontstack}",a).replace("{range}",`${m}-${v}`),Dl.Glyphs);vc(b,(w,T)=>{if(w)p(w);else if(T){let k={},R=function(L){return new kv(L).readFields(NV,{})}(T);for(let L of R.glyphs)k[L.id]=L;p(null,{glyphs:k,ascender:R.ascender,descender:R.descender})}})},rp.TinySDF=class{constructor({fontSize:a=24,buffer:s=3,radius:l=8,cutoff:u=.25,fontFamily:p="sans-serif",fontWeight:m="normal",fontStyle:v="normal"}={}){this.buffer=s,this.cutoff=u,this.radius=l;let b=this.size=a+4*s,w=this._createCanvas(b),T=this.ctx=w.getContext("2d",{willReadFrequently:!0});T.font=`${v} ${m} ${a}px ${p}`,T.textBaseline="alphabetic",T.textAlign="left",T.fillStyle="black",this.gridOuter=new Float64Array(b*b),this.gridInner=new Float64Array(b*b),this.f=new Float64Array(b),this.z=new Float64Array(b+1),this.v=new Uint16Array(b)}_createCanvas(a){let s=document.createElement("canvas");return s.width=s.height=a,s}draw(a){let{width:s,actualBoundingBoxAscent:l,actualBoundingBoxDescent:u,actualBoundingBoxLeft:p,actualBoundingBoxRight:m}=this.ctx.measureText(a),v=Math.ceil(l),b=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(m-p))),w=Math.min(this.size-this.buffer,v+Math.ceil(u)),T=b+2*this.buffer,k=w+2*this.buffer,R=Math.max(T*k,0),L=new Uint8ClampedArray(R),V={data:L,width:T,height:k,glyphWidth:b,glyphHeight:w,glyphTop:v,glyphLeft:0,glyphAdvance:s};if(b===0||w===0)return V;let{ctx:B,buffer:$,gridInner:Y,gridOuter:re}=this;B.clearRect($,$,b,w),B.fillText(a,$,$+v);let fe=B.getImageData($,$,b,w);re.fill(pg,0,R),Y.fill(0,0,R);for(let oe=0;oe<w;oe++)for(let he=0;he<b;he++){let ge=fe.data[4*(oe*b+he)+3]/255;if(ge===0)continue;let me=(oe+$)*T+he+$;
8if(ge===1)re[me]=0,Y[me]=pg;else{let Le=.5-ge;re[me]=Le>0?Le*Le:0,Y[me]=Le<0?Le*Le:0}}kk(re,0,0,T,k,T,this.f,this.v,this.z),kk(Y,$,$,b,w,T,this.f,this.v,this.z);for(let oe=0;oe<R;oe++){let he=Math.sqrt(re[oe])-Math.sqrt(Y[oe]);L[oe]=Math.round(255-255*(he/this.radius+this.cutoff))}return V}};let op=Mo;function Pk(a,s,l,u){let p=[],m=a.image,v=m.pixelRatio,b=m.paddedRect.w-2*op,w=m.paddedRect.h-2*op,T=a.right-a.left,k=a.bottom-a.top,R=m.stretchX||[[0,b]],L=m.stretchY||[[0,w]],V=(ze,Ke)=>ze+Ke[1]-Ke[0],B=R.reduce(V,0),$=L.reduce(V,0),Y=b-B,re=w-$,fe=0,oe=B,he=0,ge=$,me=0,Le=Y,Pe=0,He=re;if(m.content&&u){let ze=m.content;fe=Pv(R,0,ze[0]),he=Pv(L,0,ze[1]),oe=Pv(R,ze[0],ze[2]),ge=Pv(L,ze[1],ze[3]),me=ze[0]-fe,Pe=ze[1]-he,Le=ze[2]-ze[0]-oe,He=ze[3]-ze[1]-ge}let rt=(ze,Ke,Xe,et)=>{let dt=Ov(ze.stretch-fe,oe,T,a.left),Be=Rv(ze.fixed-me,Le,ze.stretch,B),xt=Ov(Ke.stretch-he,ge,k,a.top),Rt=Rv(Ke.fixed-Pe,He,Ke.stretch,$),wt=Ov(Xe.stretch-fe,oe,T,a.left),li=Rv(Xe.fixed-me,Le,Xe.stretch,B),ht=Ov(et.stretch-he,ge,k,a.top),Vt=Rv(et.fixed-Pe,He,et.stretch,$),ci=new tt(dt,xt),Ki=new tt(wt,xt),ui=new tt(wt,ht),Kt=new tt(dt,ht),kn=new tt(Be/v,Rt/v),fi=new tt(li/v,Vt/v),mi=s*Math.PI/180;if(mi){let Tn=Math.sin(mi),wn=Math.cos(mi),$n=[wn,-Tn,Tn,wn];ci._matMult($n),Ki._matMult($n),Kt._matMult($n),ui._matMult($n)}let xn=ze.stretch+ze.fixed,Sn=Ke.stretch+Ke.fixed;return{tl:ci,tr:Ki,bl:Kt,br:ui,tex:{x:m.paddedRect.x+op+xn,y:m.paddedRect.y+op+Sn,w:Xe.stretch+Xe.fixed-xn,h:et.stretch+et.fixed-Sn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:kn,pixelOffsetBR:fi,minFontScaleX:Le/v/T,minFontScaleY:He/v/k,isSDF:l}};if(u&&(m.stretchX||m.stretchY)){let ze=Ok(R,Y,B),Ke=Ok(L,re,$);for(let Xe=0;Xe<ze.length-1;Xe++){let et=ze[Xe],dt=ze[Xe+1];for(let Be=0;Be<Ke.length-1;Be++)p.push(rt(et,Ke[Be],dt,Ke[Be+1]))}}else p.push(rt({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:b+1},{fixed:0,stretch:w+1}));return p}function Pv(a,s,l){let u=0;for(let p of a)u+=Math.max(s,Math.min(l,p[1]))-Math.max(s,Math.min(l,p[0]));return u}function Ok(a,s,l){let u=[{fixed:-op,stretch:0}];for(let[p,m]of a){let v=u[u.length-1];u.push({fixed:p-v.stretch,stretch:v.stretch}),u.push({fixed:p-v.stretch,stretch:v.stretch+(m-p)})}return u.push({fixed:s+op,stretch:l}),u}function Ov(a,s,l,u){return a/s*l+u}function Rv(a,s,l,u){return a-s*l/u}function GV(a,s,l,u){let p=s+a.positionedLines[u].lineOffset;return u===0?l+p/2:l+(p+(s+a.positionedLines[u-1].lineOffset))/2}class qV{constructor(s=[],l=WV){if(this.data=s,this.length=this.data.length,this.compare=l,this.length>0)for(let u=(this.length>>1)-1;u>=0;u--)this._down(u)}push(s){this.data.push(s),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let s=this.data[0],l=this.data.pop();return this.length--,this.length>0&&(this.data[0]=l,this._down(0)),s}peek(){return this.data[0]}_up(s){let{data:l,compare:u}=this,p=l[s];for(;s>0;){let m=s-1>>1,v=l[m];if(u(p,v)>=0)break;l[s]=v,s=m}l[s]=p}_down(s){let{data:l,compare:u}=this,p=this.length>>1,m=l[s];for(;s<p;){let v=1+(s<<1),b=l[v],w=v+1;if(w<this.length&&u(l[w],b)<0&&(v=w,b=l[w]),u(b,m)>=0)break;l[s]=b,s=v}l[s]=m}}function WV(a,s){return a<s?-1:a>s?1:0}function ZV(a,s=1,l=!1){let u=1/0,p=1/0,m=-1/0,v=-1/0,b=a[0];for(let V=0;V<b.length;V++){let B=b[V];(!V||B.x<u)&&(u=B.x),(!V||B.y<p)&&(p=B.y),(!V||B.x>m)&&(m=B.x),(!V||B.y>v)&&(v=B.y)}let w=Math.min(m-u,v-p),T=w/2,k=new qV([],KV);if(w===0)return new tt(u,p);for(let V=u;V<m;V+=w)for(let B=p;B<v;B+=w)k.push(new sp(V+T,B+T,T,a));let R=function(V){let B=0,$=0,Y=0,re=V[0];for(let fe=0,oe=re.length,he=oe-1;fe<oe;he=fe++){let ge=re[fe],me=re[he],Le=ge.x*me.y-me.x*ge.y;$+=(ge.x+me.x)*Le,Y+=(ge.y+me.y)*Le,B+=3*Le}return new sp($/B,Y/B,0,V)}(a),L=k.length;for(;k.length;){let V=k.pop();(V.d>R.d||!R.d)&&(R=V,l&&console.log("found best %d after %d probes",Math.round(1e4*V.d)/1e4,L)),V.max-R.d<=s||(T=V.h/2,k.push(new sp(V.p.x-T,V.p.y-T,T,a)),k.push(new sp(V.p.x+T,V.p.y-T,T,a)),k.push(new sp(V.p.x-T,V.p.y+T,T,a)),k.push(new sp(V.p.x+T,V.p.y+T,T,a)),L+=4)}return l&&(console.log(`num probes: ${L}`),console.log(`best distance: ${R.d}`)),R.p}function KV(a,s){return s.max-a.max}class sp{constructor(s,l,u,p){this.p=new tt(s,l),this.h=u,this.d=function(m,v){let b=!1,w=1/0;for(let T=0;T<v.length;T++){let k=v[T];for(let R=0,L=k.length,V=L-1;R<L;V=R++){let B=k[R],$=k[V];B.y>m.y!=$.y>m.y&&m.x<($.x-B.x)*(m.y-B.y)/($.y-B.y)+B.x&&(b=!b),w=Math.min(w,DM(m,B,$))}}return(b?1:-1)*Math.sqrt(w)}(this.p,p),this.max=this.d+this.h*Math.SQRT2}}let ap=7,Gw=Number.POSITIVE_INFINITY,XV=Math.sqrt(2);function Rk(a,[s,l]){let u=0,p=0;if(l===Gw){s<0&&(s=0);let m=s/XV;switch(a){case"top-right":case"top-left":p=m-ap;break;case"bottom-right":case"bottom-left":p=-m+ap;break;case"bottom":p=-s+ap;break;case"top":p=s-ap}switch(a){case"top-right":case"bottom-right":u=-m;break;case"top-left":case"bottom-left":u=m;break;case"left":u=s;break;case"right":u=-s}}else{switch(s=Math.abs(s),l=Math.abs(l),a){case"top-right":case"top-left":case"top":p=l-ap;break;case"bottom-right":case"bottom-left":case"bottom":p=-l+ap}switch(a){case"top-right":case"bottom-right":case"right":u=-s;break;case"top-left":case"bottom-left":case"left":u=s}}return[u,p]}function YV(a,s,l,u,p,m,v,b,w,T){a.createArrays(),a.tilePixelRatio=Ut/(512*a.overscaling),a.compareText={},a.iconsNeedLinear=!1;let k=a.layers[0].layout,R=a.layers[0]._unevaluatedLayout._values,L={};
8if(a.textSizeData.kind==="composite"){let{minZoom:$,maxZoom:Y}=a.textSizeData;L.compositeTextSizes=[R["text-size"].possiblyEvaluate(new O($),b),R["text-size"].possiblyEvaluate(new O(Y),b)]}if(a.iconSizeData.kind==="composite"){let{minZoom:$,maxZoom:Y}=a.iconSizeData;L.compositeIconSizes=[R["icon-size"].possiblyEvaluate(new O($),b),R["icon-size"].possiblyEvaluate(new O(Y),b)]}L.layoutTextSize=R["text-size"].possiblyEvaluate(new O(w+1),b),L.layoutIconSize=R["icon-size"].possiblyEvaluate(new O(w+1),b),L.textMaxSize=R["text-size"].possiblyEvaluate(new O(18),b);let V=k.get("text-rotation-alignment")==="map"&&k.get("symbol-placement")!=="point",B=k.get("text-size");for(let $ of a.features){let Y=k.get("text-font").evaluate($,{},b).join(","),re=B.evaluate($,{},b),fe=L.layoutTextSize.evaluate($,{},b),oe=(L.layoutIconSize.evaluate($,{},b),{horizontal:{},vertical:void 0}),he=$.text,ge,me=[0,0];if(he){let He=he.toString(),rt=k.get("text-letter-spacing").evaluate($,{},b)*Vr,ze=k.get("text-line-height").evaluate($,{},b)*Vr,Ke=ew(He)?rt:0,Xe=k.get("text-anchor").evaluate($,{},b),et=k.get("text-variable-anchor");if(!et){let wt=k.get("text-radial-offset").evaluate($,{},b);me=wt?Rk(Xe,[wt*Vr,Gw]):k.get("text-offset").evaluate($,{},b).map(li=>li*Vr)}let dt=V?"center":k.get("text-justify").evaluate($,{},b),Be=k.get("symbol-placement")==="point",xt=Be?k.get("text-max-width").evaluate($,{},b)*Vr:1/0,Rt=wt=>{a.allowVerticalPlacement&&zm(He)&&(oe.vertical=Uw(he,s,l,p,Y,xt,ze,Xe,wt,Ke,me,ps.vertical,!0,fe,re))};if(!V&&et){let wt=dt==="auto"?et.map(ht=>qw(ht)):[dt],li=!1;for(let ht=0;ht<wt.length;ht++){let Vt=wt[ht];if(!oe.horizontal[Vt])if(li)oe.horizontal[Vt]=oe.horizontal[0];else{let ci=Uw(he,s,l,p,Y,xt,ze,"center",Vt,Ke,me,ps.horizontal,!1,fe,re);ci&&(oe.horizontal[Vt]=ci,li=ci.positionedLines.length===1)}}Rt("left")}else{if(dt==="auto"&&(dt=qw(Xe)),Be||k.get("text-writing-mode").indexOf("horizontal")>=0||!zm(He)){let wt=Uw(he,s,l,p,Y,xt,ze,Xe,dt,Ke,me,ps.horizontal,!1,fe,re);wt&&(oe.horizontal[dt]=wt)}Rt(Be?"left":dt)}}let Le=!1;if($.icon&&$.icon.name){let He=u[$.icon.name];He&&(ge=UV(p[$.icon.name],k.get("icon-offset").evaluate($,{},b),k.get("icon-anchor").evaluate($,{},b)),Le=He.sdf,a.sdfIcons===void 0?a.sdfIcons=He.sdf:a.sdfIcons!==He.sdf&&Un("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(He.pixelRatio!==a.pixelRatio||k.get("icon-rotate").constantOr(1)!==0)&&(a.iconsNeedLinear=!0))}let Pe=Fk(oe.horizontal)||oe.vertical;
8a.iconsInText||(a.iconsInText=!!Pe&&Pe.iconsInText),(Pe||ge)&&QV(a,$,oe,ge,u,L,fe,0,me,Le,v,b,T)}m&&a.generateCollisionDebugBuffers(w,a.collisionBoxArray)}function qw(a){switch(a){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function QV(a,s,l,u,p,m,v,b,w,T,k,R,L){let V=m.textMaxSize.evaluate(s,{},R);V===void 0&&(V=v);let B=a.layers[0].layout,$=B.get("icon-offset").evaluate(s,{},R),Y=Fk(l.horizontal)||l.vertical,re=L.name==="globe",fe=Vr,oe=v/fe,he=a.tilePixelRatio*V/fe,ge=(Xe=a.overscaling,a.zoom>18&&Xe>2&&(Xe>>=1),Math.max(Ut/(512*Xe),1)*B.get("symbol-spacing")),me=B.get("text-padding")*a.tilePixelRatio,Le=B.get("icon-padding")*a.tilePixelRatio,Pe=ai(B.get("text-max-angle")),He=B.get("text-rotation-alignment")==="map"&&B.get("symbol-placement")!=="point",rt=B.get("icon-rotation-alignment")==="map"&&B.get("symbol-placement")!=="point",ze=B.get("symbol-placement"),Ke=ge/2;var Xe;let et=B.get("icon-text-fit"),dt;u&&et!=="none"&&(a.allowVerticalPlacement&&l.vertical&&(dt=Ck(u,l.vertical,et,B.get("icon-text-fit-padding"),$,oe)),Y&&(u=Ck(u,Y,et,B.get("icon-text-fit-padding"),$,oe)));let Be=(xt,Rt,wt)=>{if(Rt.x<0||Rt.x>=Ut||Rt.y<0||Rt.y>=Ut)return;let li=null;if(re){let{x:ht,y:Vt,z:ci}=L.projectTilePoint(Rt.x,Rt.y,wt);li={anchor:new Zl(ht,Vt,ci,0,void 0),up:L.upVector(wt,Rt.x,Rt.y)}}(function(ht,Vt,ci,Ki,ui,Kt,kn,fi,mi,xn,Sn,Tn,wn,$n,er,hr,Cn,br,pr,Kn,Ji,fr,In,xo,mr){let Br=ht.addToLineVertexArray(Vt,Ki),kr,wo,Ar,Ea,up,wg,Cg,m2=0,g2=0,_2=0,v2=0,aC=-1,lC=-1,Xa={},y2=nw(""),wd=ci?ci.anchor:Vt,cC=0,uC=0;if(mi._unevaluatedLayout.getValue("text-radial-offset")===void 0?[cC,uC]=mi.layout.get("text-offset").evaluate(Ji,{},mr).map(Xo=>Xo*Vr):(cC=mi.layout.get("text-radial-offset").evaluate(Ji,{},mr)*Vr,uC=Gw),ht.allowVerticalPlacement&&ui.vertical){let Xo=ui.vertical;if(er)wg=Ww(Xo),fi&&(Cg=Ww(fi));else{let Yo=mi.layout.get("text-rotate").evaluate(Ji,{},mr)+90;Ar=Lv(xn,wd,Vt,Sn,Tn,wn,Xo,$n,Yo,hr),fi&&(Ea=Lv(xn,wd,Vt,Sn,Tn,wn,fi,br,Yo))}}if(Kt){let Xo=mi.layout.get("icon-rotate").evaluate(Ji,{},mr),Yo=mi.layout.get("icon-text-fit")!=="none",Eg=Pk(Kt,Xo,In,Yo),hC=fi?Pk(fi,Xo,In,Yo):void 0;wo=Lv(xn,wd,Vt,Sn,Tn,wn,Kt,br,Xo),m2=4*Eg.length;let b2=ht.iconSizeData,Cd=null;b2.kind==="source"?(Cd=[xa*mi.layout.get("icon-size").evaluate(Ji,{},mr)],Cd[0]>Uc&&Un(`${ht.layerIds[0]}: Value for "icon-size" is >= ${fg}. Reduce your "icon-size".`)):b2.kind==="composite"&&(Cd=[xa*fr.compositeIconSizes[0].evaluate(Ji,{},mr),xa*fr.compositeIconSizes[1].evaluate(Ji,{},mr)],(Cd[0]>Uc||Cd[1]>Uc)&&Un(`${ht.layerIds[0]}: Value for "icon-size" is >= ${fg}. Reduce your "icon-size".`)),ht.addSymbols(ht.icon,Eg,Cd,Kn,pr,Ji,!1,ci,Vt,Br.lineStartIndex,Br.lineLength,-1,xo,mr),aC=ht.icon.placedSymbolArray.length-1,hC&&(g2=4*hC.length,ht.addSymbols(ht.icon,hC,Cd,Kn,pr,Ji,ps.vertical,ci,Vt,Br.lineStartIndex,Br.lineLength,-1,xo,mr),lC=ht.icon.placedSymbolArray.length-1)}for(let Xo in ui.horizontal){let Yo=ui.horizontal[Xo];kr||(y2=nw(Yo.text),er?up=Ww(Yo):kr=Lv(xn,wd,Vt,Sn,Tn,wn,Yo,$n,mi.layout.get("text-rotate").evaluate(Ji,{},mr),hr));let Eg=Yo.positionedLines.length===1;if(_2+=Lk(ht,ci,Vt,Yo,kn,mi,er,Ji,hr,Br,ui.vertical?ps.horizontal:ps.horizontalOnly,Eg?Object.keys(ui.horizontal):[Xo],Xa,aC,fr,xo,mr),Eg)break}ui.vertical&&(v2+=Lk(ht,ci,Vt,ui.vertical,kn,mi,er,Ji,hr,Br,ps.vertical,["vertical"],Xa,lC,fr,xo,mr));let Zc=-1,dC=(Xo,Yo)=>Xo?Math.max(Xo,Yo):Yo;Zc=dC(up,Zc),Zc=dC(wg,Zc),Zc=dC(Cg,Zc);let T4=Zc>-1?1:0;ht.glyphOffsetArray.length>=$c.MAX_GLYPHS&&Un("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ji.sortKey!==void 0&&ht.addToSortKeyRanges(ht.symbolInstances.length,Ji.sortKey),ht.symbolInstances.emplaceBack(wd.x,wd.y,wd.z,Vt.x,Vt.y,Xa.right>
8=0?Xa.right:-1,Xa.center>=0?Xa.center:-1,Xa.left>=0?Xa.left:-1,Xa.vertical>=0?Xa.vertical:-1,aC,lC,y2,kr!==void 0?kr:ht.collisionBoxArray.length,kr!==void 0?kr+1:ht.collisionBoxArray.length,Ar!==void 0?Ar:ht.collisionBoxArray.length,Ar!==void 0?Ar+1:ht.collisionBoxArray.length,wo!==void 0?wo:ht.collisionBoxArray.length,wo!==void 0?wo+1:ht.collisionBoxArray.length,Ea||ht.collisionBoxArray.length,Ea?Ea+1:ht.collisionBoxArray.length,Sn,_2,v2,m2,g2,T4,0,cC,uC,Zc)})(a,Rt,li,xt,l,u,p,dt,a.layers[0],a.collisionBoxArray,s.index,s.sourceLayerIndex,a.index,me,He,w,0,Le,rt,$,s,m,T,k,R)};if(ze==="line")for(let xt of Mk(s.geometry,0,0,Ut,Ut)){let Rt=$V(xt,ge,Pe,l.vertical||Y,u,fe,he,a.overscaling,Ut);for(let wt of Rt)Y&&JV(a,Y.text,Ke,wt)||Be(xt,wt,R)}else if(ze==="line-center"){for(let xt of s.geometry)if(xt.length>1){let Rt=HV(xt,Pe,l.vertical||Y,u,fe,he);Rt&&Be(xt,Rt,R)}}else if(s.type==="Polygon")for(let xt of Ow(s.geometry,0)){let Rt=ZV(xt,16);Be(xt[0],new Zl(Rt.x,Rt.y,0,0,void 0),R)}else if(s.type==="LineString")for(let xt of s.geometry)Be(xt,new Zl(xt[0].x,xt[0].y,0,0,void 0),R);else if(s.type==="Point")for(let xt of s.geometry)for(let Rt of xt)Be([Rt],new Zl(Rt.x,Rt.y,0,0,void 0),R)}let fg=255,Uc=fg*xa;function Lk(a,s,l,u,p,m,v,b,w,T,k,R,L,V,B,$,Y){let re=function(he,ge,me,Le,Pe,He,rt,ze){let Ke=[];if(ge.positionedLines.length===0)return Ke;let Xe=Le.layout.get("text-rotate").evaluate(He,{})*Math.PI/180,et=function(wt){let li=wt[0],ht=wt[1],Vt=li*ht;return Vt>0?[li,-ht]:Vt<0?[-li,ht]:li===0?[ht,li]:[ht,-li]}(me),dt=Math.abs(ge.top-ge.bottom);for(let wt of ge.positionedLines)dt-=wt.lineOffset;let Be=ge.positionedLines.length,xt=dt/Be,Rt=ge.top-me[1];for(let wt=0;wt<Be;++wt){let li=ge.positionedLines[wt];Rt=GV(ge,xt,Rt,wt);for(let ht of li.positionedGlyphs){if(!ht.rect)continue;let Vt=ht.rect||{},ci=mk+1,Ki=!0,ui=1,Kt=0;if(ht.imageName){let In=rt[ht.imageName];if(!In)continue;if(In.sdf){Un("SDF images are not supported in formatted text and will be ignored.");continue}Ki=!1,ui=In.pixelRatio,ci=Mo/ui}let kn=(Pe||ze)&&ht.vertical,fi=ht.metrics.advance*ht.scale/2,mi=ht.metrics,xn=ht.rect;if(xn===null)continue;ze&&ge.verticalizable&&(Kt=ht.imageName?fi-ht.metrics.width*ht.scale/2:0);let Sn=Pe?[ht.x+fi,ht.y]:[0,0],Tn=[0,0],wn=[0,0],$n=!1;Pe||(kn?(wn=[ht.x+fi+et[0],ht.y+et[1]-Kt],$n=!0):Tn=[ht.x+fi+me[0],ht.y+me[1]-Kt]);let er=xn.w*ht.scale/(ui*(ht.localGlyph?wa:1)),hr=xn.h*ht.scale/(ui*(ht.localGlyph?wa:1)),Cn,br,pr,Kn;if(kn){let In=ht.y-Rt,xo=new tt(-fi,fi-In),mr=-Math.PI/2,Br=new tt(...wn);Cn=new tt(-fi+Tn[0],Tn[1]),Cn._rotateAround(mr,xo)._add(Br),Cn.x+=-In+fi,Cn.y-=(mi.left-ci)*ht.scale;let kr=ht.imageName?mi.advance*ht.scale:Vr*ht.scale,wo=String.fromCharCode(ht.glyph);TV(wo)?Cn.x+=(1-ci)*ht.scale:IV(wo)?Cn.x+=kr-mi.height*ht.scale+(-ci-1)*ht.scale:Cn.x+=ht.imageName||mi.width+2*ci===xn.w&&mi.height+2*ci===xn.h?(kr-hr)/2:(kr-(mi.height+2*ci)*ht.scale)/2,br=new tt(Cn.x,Cn.y-er),pr=new tt(Cn.x+hr,Cn.y),Kn=new tt(Cn.x+hr,Cn.y-er)}else{let In=(mi.left-ci)*ht.scale-fi+Tn[0],xo=(-mi.top-ci)*ht.scale+Tn[1],mr=In+er,Br=xo+hr;Cn=new tt(In,xo),br=new tt(mr,xo),pr=new tt(In,Br),Kn=new tt(mr,Br)}if(Xe){let In;In=Pe?new tt(0,0):$n?new tt(et[0],et[1]):new tt(me[0],me[1]),Cn._rotateAround(Xe,In),br._rotateAround(Xe,In),pr._rotateAround(Xe,In),Kn._rotateAround(Xe,In)}let Ji=new tt(0,0),fr=new tt(0,0);Ke.push({tl:Cn,tr:br,bl:pr,br:Kn,tex:Vt,writingMode:ge.writingMode,glyphOffset:Sn,sectionIndex:ht.sectionIndex,isSDF:Ki,pixelOffsetTL:Ji,pixelOffsetBR:fr,minFontScaleX:0,minFontScaleY:0})}}return Ke}(0,u,w,m,v,b,p,a.allowVerticalPlacement),fe=a.textSizeData,oe=null;fe.kind==="source"?(oe=[xa*m.layout.get("text-size").evaluate(b,{},Y)],oe[0]>Uc&&Un(`${a.layerIds[0]}: Value for "text-size" is >= ${fg}. Reduce your "text-size".`)):fe.kind==="composite"&&(oe=[xa*B.compositeTextSizes[0].evaluate(b,{},Y),xa*B.compositeTextSizes[1].evaluate(b,{},Y)],(oe[0]>Uc||oe[1]>Uc)&&Un(`${a.layerIds[0]}: Value for "text-size" is >= ${fg}. Reduce your "text-size".`)),a.addSymbols(a.text,re,oe,w,v,b,k,s,l,T.lineStartIndex,T.lineLength,V,$,Y);for(let he of R)L[he]=a.text.placedSymbolArray.length-1;return 4*re.length}function Fk(a){for(let s in a)return a[s];return null}function Lv(a,s,l,u,p,m,v,b,w,T){let k=v.top,R=v.bottom,L=v.left,V=v.right,B=v.collisionPadding;if(B&&(L-=B[0],k-=B[1],V+=B[2],R+=B[3]),w){let $=new tt(L,k),Y=new tt(V,k),re=new tt(L,R),fe=new tt(V,R),oe=ai(w),he=new tt(0,0);
8T&&(he=new tt(T[0],T[1])),$._rotateAround(oe,he),Y._rotateAround(oe,he),re._rotateAround(oe,he),fe._rotateAround(oe,he),L=Math.min($.x,Y.x,re.x,fe.x),V=Math.max($.x,Y.x,re.x,fe.x),k=Math.min($.y,Y.y,re.y,fe.y),R=Math.max($.y,Y.y,re.y,fe.y)}return a.emplaceBack(s.x,s.y,s.z,l.x,l.y,L,k,V,R,b,u,p,m),a.length-1}function Ww(a){a.collisionPadding&&(a.top-=a.collisionPadding[1],a.bottom+=a.collisionPadding[3]);let s=a.bottom-a.top;return s>0?Math.max(10,s):null}function JV(a,s,l,u){let p=a.compareText;if(s in p){let m=p[s];for(let v=m.length-1;v>=0;v--)if(u.dist(m[v])<l)return!0}else p[s]=[];return p[s].push(u),!1}function Nk(a,s){let l=a.fovAboveCenter,u=a.elevation?a.elevation.getMinElevationBelowMSL()*s:0,p=(a._camera.position[2]*a.worldSize-u)/Math.cos(a._pitch),m=Math.sin(l)*p/Math.sin(Math.max(Math.PI/2-a._pitch-l,.01)),v=Math.sin(a._pitch)*m+p;return Math.min(1.01*v,p*(1/a._horizonShift))}function bd(a,s){if(!s.isReprojectedInTileSpace)return{scale:1<<a.z,x:a.x,y:a.y,x2:a.x+1,y2:a.y+1,projection:s};let l=Math.pow(2,-a.z),u=a.x*l,p=(a.x+1)*l,m=a.y*l,v=(a.y+1)*l,b=hs(u),w=hs(p),T=Yr(m),k=Yr(v),R=s.project(b,T),L=s.project(w,T),V=s.project(w,k),B=s.project(b,k),$=Math.min(R.x,L.x,V.x,B.x),Y=Math.min(R.y,L.y,V.y,B.y),re=Math.max(R.x,L.x,V.x,B.x),fe=Math.max(R.y,L.y,V.y,B.y),oe=l/16;function he(me,Le,Pe,He,rt,ze){let Ke=(Pe+rt)/2,Xe=(He+ze)/2,et=s.project(hs(Ke),Yr(Xe)),dt=Math.max(0,$-et.x,Y-et.y,et.x-re,et.y-fe);$=Math.min($,et.x),re=Math.max(re,et.x),Y=Math.min(Y,et.y),fe=Math.max(fe,et.y),dt>oe&&(he(me,et,Pe,He,Ke,Xe),he(et,Le,Ke,Xe,rt,ze))}he(R,L,u,m,p,m),he(L,V,p,m,p,v),he(V,B,p,v,u,v),he(B,R,u,v,u,m),$-=oe,Y-=oe,re+=oe,fe+=oe;let ge=1/Math.max(re-$,fe-Y);return{scale:ge,x:$*ge,y:Y*ge,x2:re*ge,y2:fe*ge,projection:s}}let e4=va(new Float32Array(16));class Hc{constructor(s){this.spec=s,this.name=s.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(s,l){return{x:0,y:0,z:0}}unproject(s,l){return new bn(0,0)}projectTilePoint(s,l,u){return{x:s,y:l,z:0}}locationPoint(s,l,u=!0){return s._coordinatePoint(s.locationCoordinate(l),u)}pixelsPerMeter(s,l){return ba(1,s)*l}pixelSpaceConversion(s,l,u){return 1}farthestPixelDistance(s){return Nk(s,s.pixelsPerMeter)}pointCoordinate(s,l,u,p){let m=s.horizonLineFromTop(!1),v=new tt(l,Math.max(m,u));return s.rayIntersectionCoordinate(s.pointRayIntersection(v,p))}pointCoordinate3D(s,l,u){let p=new tt(l,u);if(s.elevation)return s.elevation.pointCoordinate(p);{let m=this.pointCoordinate(s,p.x,p.y,0);return[m.x,m.y,m.z]}}isPointAboveHorizon(s,l){if(s.elevation)return!this.pointCoordinate3D(s,l.x,l.y);let u=s.horizonLineFromTop();return l.y<u}createInversionMatrix(s,l){return e4}createTileMatrix(s,l,u){let p,m,v,b=u.canonical,w=va(new Float64Array(16));if(this.isReprojectedInTileSpace){let T=bd(b,this);p=1,m=T.x+u.wrap*T.scale,v=T.y,pd(w,w,[p/T.scale,p/T.scale,s.pixelsPerMeter/l])}else p=l/s.zoomScale(b.z),m=(b.x+Math.pow(2,b.z)*u.wrap)*p,v=b.y*p;return Gm(w,w,[m,v,0]),pd(w,w,[p/Ut,p/Ut,1]),w}upVector(s,l,u){return[0,0,1]}upVectorScale(s,l,u){return{metersToTile:1}}}class t4 extends Hc{constructor(s){super(s),this.range=[4,7],this.center=s.center||[-96,37.5];let[l,u]=this.parallels=s.parallels||[29.5,45.5],p=Math.sin(ai(l));this.n=(p+Math.sin(ai(u)))/2,this.c=1+p*(2*this.n-p),this.r0=Math.sqrt(this.c)/this.n}project(s,l){let{n:u,c:p,r0:m}=this,v=ai(s-this.center[0]),b=ai(l),w=Math.sqrt(p-2*u*Math.sin(b))/u;return{x:w*Math.sin(v*u),y:w*Math.cos(v*u)-m,z:0}}unproject(s,l){let{n:u,c:p,r0:m}=this,v=m+l,b=Math.atan2(s,Math.abs(v))*Math.sign(v);v*u<0&&(b-=Math.PI*Math.sign(s)*Math.sign(v));let w=ai(this.center[0])*u;b=Ft(b,-Math.PI-w,Math.PI-w);let T=pt(sr(b/u)+this.center[0],-180,180),k=Math.asin(pt((p-(s*s+v*v)*u*u)/(2*u),-1,1)),R=pt(sr(k),-Qr,Qr);return new bn(T,R)}}let mg=1.340264,gg=-.081106,_g=893e-6,vg=.003796,Fv=Math.sqrt(3)/2;class i4 extends Hc{project(s,l){l=l/180*Math.PI,s=s/180*Math.PI;let u=Math.asin(Fv*Math.sin(l)),p=u*u,m=p*p*p;return{x:.5*(s*Math.cos(u)/(Fv*(mg+3*gg*p+m*(7*_g+9*vg*p)))/Math.PI+.5),y:1-.5*(u*(mg+gg*
8p+m*(_g+vg*p))/Math.PI+1),z:0}}unproject(s,l){s=(2*s-.5)*Math.PI;let u=l=(2*(1-l)-1)*Math.PI,p=u*u,m=p*p*p;for(let k,R,L,V=0;V<12&&(R=u*(mg+gg*p+m*(_g+vg*p))-l,L=mg+3*gg*p+m*(7*_g+9*vg*p),k=R/L,u=pt(u-k,-Math.PI/3,Math.PI/3),p=u*u,m=p*p*p,!(Math.abs(k)<1e-12));++V);let v=Fv*s*(mg+3*gg*p+m*(7*_g+9*vg*p))/Math.cos(u),b=Math.asin(Math.sin(u)/Fv),w=pt(180*v/Math.PI,-180,180),T=pt(180*b/Math.PI,-Qr,Qr);return new bn(w,T)}}class n4 extends Hc{constructor(s){super(s),this.wrap=!0,this.supportsWorldCopies=!0}project(s,l){return{x:.5+s/360,y:.5-l/360,z:0}}unproject(s,l){let u=360*(s-.5),p=pt(360*(.5-l),-Qr,Qr);return new bn(u,p)}}let lp=Math.PI/2;function Nv(a){return Math.tan((lp+a)/2)}class r4 extends Hc{constructor(s){super(s),this.center=s.center||[0,30];let[l,u]=this.parallels=s.parallels||[30,30],p=ai(l),m=ai(u);this.southernCenter=p+m<0,this.southernCenter&&(p=-p,m=-m);let v=Math.cos(p),b=Nv(p);this.n=p===m?Math.sin(p):Math.log(v/Math.cos(m))/Math.log(Nv(m)/b),this.f=v*Math.pow(Nv(p),this.n)/this.n}project(s,l){l=ai(l),this.southernCenter&&(l=-l),s=ai(s-this.center[0]);let u=1e-6,{n:p,f:m}=this;m>0?l<-lp+u&&(l=-lp+u):l>lp-u&&(l=lp-u);let v=m/Math.pow(Nv(l),p),b=v*Math.sin(p*s),w=m-v*Math.cos(p*s);return b=.5*(b/Math.PI+.5),w=.5*(w/Math.PI+.5),{x:b,y:this.southernCenter?w:1-w,z:0}}unproject(s,l){s=(2*s-.5)*Math.PI,this.southernCenter&&(l=1-l),l=(2*(1-l)-.5)*Math.PI;let{n:u,f:p}=this,m=p-l,v=Math.sign(m),b=Math.sign(u)*Math.sqrt(s*s+m*m),w=Math.atan2(s,Math.abs(m))*v;m*u<0&&(w-=Math.PI*Math.sign(s)*v);let T=pt(sr(w/u)+this.center[0],-180,180),k=pt(sr(2*Math.atan(Math.pow(p/b,1/u))-lp),-Qr,Qr);return new bn(T,this.southernCenter?-k:k)}}class zk extends Hc{constructor(s){super(s),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(s,l){return{x:Ga(s),y:qa(l),z:0}}unproject(s,l){let u=hs(s),p=Yr(l);return new bn(u,p)}}let jk=ai(Qr);class o4 extends Hc{project(s,l){let u=(l=ai(l))*l,p=u*u;return{x:.5*((s=ai(s))*(.8707-.131979*u+p*(p*(.003971*u-.001529*p)-.013791))/Math.PI+.5),y:1-.5*(l*(1.007226+u*(.015085+p*(.028874*u-.044475-.005916*p)))/Math.PI+1),z:0}}unproject(s,l){s=(2*s-.5)*Math.PI;let u=l=(2*(1-l)-1)*Math.PI,p=25,m=0,v=u*u;do{v=u*u;let T=v*v;m=(u*(1.007226+v*(.015085+T*(.028874*v-.044475-.005916*T)))-l)/(1.007226+v*(.045255+T*(.259866*v-.311325-.005916*11*T))),u=pt(u-m,-jk,jk)}while(Math.abs(m)>1e-6&&--p>0);v=u*u;let b=pt(sr(s/(.8707+v*(v*(v*v*v*(.003971-.001529*v)-.013791)-.131979))),-180,180),w=sr(u);return new bn(b,w)}}let Vk=ai(Qr);class s4 extends Hc{project(s,l){l=ai(l),s=ai(s);let u=Math.cos(l),p=2/Math.PI,m=Math.acos(u*Math.cos(s/2)),v=Math.sin(m)/m,b=.5*(s*p+2*u*Math.sin(s/2)/v)||0,w=.5*(l+Math.sin(l)/v)||0;return{x:.5*(b/Math.PI+.5),y:1-.5*(w/Math.PI+1),z:0}}unproject(s,l){let u=s=(2*s-.5)*Math.PI,p=l=(2*(1-l)-1)*Math.PI,m=25,v=1e-6,b=0,w=0;do{let T=Math.cos(p),k=Math.sin(p),R=2*k*T,L=k*k,V=T*T,B=Math.cos(u/2),$=Math.sin(u/2),Y=2*B*$,re=$*$,fe=1-V*B*B,oe=fe?1/fe:0,he=fe?Math.acos(T*B)*Math.sqrt(1/fe):0,ge=.5*(2*he*T*$+2*u/Math.PI)-s,me=.5*(he*k+p)-l,Le=.5*oe*(V*re+he*T*B*L)+1/Math.PI,Pe=oe*(Y*R/4-he*k*$),He=.125*oe*(R*$-he*k*V*Y),rt=.5*oe*(L*B+he*re*T)+.5,ze=Pe*He-rt*Le;b=(me*Pe-ge*rt)/ze,w=(ge*He-me*Le)/ze,u=pt(u-b,-Math.PI,Math.PI),p=pt(p-w,-Vk,Vk)}while((Math.abs(b)>v||Math.abs(w)>v)&&--m>0);return new bn(sr(u),sr(p))}}class Bk extends Hc{constructor(s){super(s),this.center=s.center||[0,0],this.parallels=s.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(ai(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(s,l){let{scale:u,cosPhi:p}=this;return{x:ai(s)*p*u+.5,y:-Math.sin(ai(l))/p*u+.5,z:0}}unproject(s,l){let{scale:u,cosPhi:p}=this,m=-(l-.5)/u,v=pt(sr((s-.5)/u)/p,-180,180),b=Math.asin(pt(m*p,-1,1)),w=pt(sr(b),-Qr,Qr);return new bn(v,w)}}class a4 extends zk{constructor(s){super(s),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(s,l,u){let p=Jm(s,l,u);return rr(p,p,eg($a(u))),{x:p[0],y:p[1],z:p[2]}}locationPoint(s,l){let u=Wh(l.lat,l.lng),p=vo([],u),m=s.elevation?s.elevation.getAtPointOrZero(s.locationCoordinate(l),s._centerAltitude):s._centerAltitude;Km(u,u,p,ba(1,0)*Ut*m);let v=va(new Float64Array(16));return hd(v,s.pixelMatrix,s.globeMatrix),rr(u,u,v),new tt(u[0],u[1])}pixelsPerMeter(s,l){return ba(1,0)*l}pixelSpaceConversion(s,l,u){let p=ba(1,s)*l,m=Wi(ba(1,45)*l,p,u);return this.pixelsPerMeter(s,l)/m}createTileMatrix(s,l,u){let p=_w($a(u.canonical));return hd(new Float64Array(16),s.globeMatrix,p)}createInversionMatrix(s,l){let{center:u}=s,p=eg($a(l));return dv(p,p,ai(u.lng)),aw(p,p,ai(u.lat)),pd(p,p,[s._pixelsPerMercatorPixel,s._pixelsPerMercatorPixel,1]),Float32Array.from(p)}pointCoordinate(s,l,u,p){return fM(s,l,u,!0)||new Kh(0,0)}pointCoordinate3D(s,l,u){let p=this.pointCoordinate(s,l,u,0);return[p.x,p.y,p.z]}isPointAboveHorizon(s,l){return!fM(s,l.x,l.y,!1)}farthestPixelDistance(s){let l=function(p,m){let v=p.cameraToCenterDistance,b=p._centerAltitude*m,w=p._camera,T=p._camera.forward(),k=$l([],ds([],T,-v),[0,0,b]),R=p.worldSize/(2*Math.PI),L=[0,0,-R],V=p.width/p.height,B=Math.tan(p.fovAboveCenter),$=ds([],w.up(),B),Y=ds([],w.right(),B*V),re=vo([],$l([],$l([],T,$),Y)),fe=[],oe;if(new dw(k,re).closestPointOnSphere(L,R,fe)){let he=$l([],fe,L),ge=ya([],he,k);oe=Math.cos(p.fovAboveCenter)*qm(ge)}else{let he=ya([],k,L),ge=ya([],L,k);vo(ge,ge);let me=qm(he)-R;oe=Math.sqrt(me*(me+2*R));let Le=Math.acos(oe/(R+me))-Math.acos(Fs(T,ge));oe*=Math.cos(Le)}return 1.01*oe}(s,this.pixelsPerMeter(s.center.lat,s.worldSize)),u=Zh(s.zoom);if(u>0){let p=Nk(s,ba(1,s.center.lat)*s.worldSize),m=s.worldSize/(2*Math.PI),v=Math.max(s.width,s.height)/s.worldSize*Math.PI;return Wi(l,p+m*(1-Math.cos(v)),Math.pow(u,10))}return l}upVector(s,l,u){return Jm(l,u,s,1)}upVectorScale(s){return{metersToTile:hv(fv($a(s)))}}}function Uk(a){let s=a.parallels,l=!!s&&Math.abs(s[0]+s[1])<.01;
8switch(a.name){case"mercator":return new zk(a);case"equirectangular":return new n4(a);case"naturalEarth":return new o4(a);case"equalEarth":return new i4(a);case"winkelTripel":return new s4(a);case"albers":return l?new Bk(a):new t4(a);case"lambertConformalConic":return l?new Bk(a):new r4(a);case"globe":return new a4(a)}throw new Error(`Invalid projection name: ${a.name}`)}let l4=Ev.types,c4=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function zv(a,s,l,u,p,m,v,b,w,T,k,R,L){let V=b?Math.min(Uc,Math.round(b[0])):0,B=b?Math.min(Uc,Math.round(b[1])):0;a.emplaceBack(s,l,Math.round(32*u),Math.round(32*p),m,v,(V<<1)+(w?1:0),B,16*T,16*k,256*R,256*L)}function jv(a,s,l,u,p,m,v){a.emplaceBack(s,l,u,p,m,v)}function Vv(a,s,l,u,p){a.emplaceBack(s,l,u,p),a.emplaceBack(s,l,u,p),a.emplaceBack(s,l,u,p),a.emplaceBack(s,l,u,p)}function u4(a){for(let s of a.sections)if(iw(s.text))return!0;return!1}class Zw{constructor(s){this.layoutVertexArray=new Je,this.indexArray=new Nt,this.programConfigurations=s,this.segments=new ur,this.dynamicLayoutVertexArray=new it,this.opacityVertexArray=new zt,this.placedSymbolArray=new cr,this.globeExtVertexArray=new lt}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(s,l,u,p){this.isEmpty()||(u&&(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,vV.members),this.indexBuffer=s.createIndexBuffer(this.indexArray,l),this.dynamicLayoutVertexBuffer=s.createVertexBuffer(this.dynamicLayoutVertexArray,bV.members,!0),this.opacityVertexBuffer=s.createVertexBuffer(this.opacityVertexArray,c4,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=s.createVertexBuffer(this.globeExtVertexArray,yV.members,!0)),this.opacityVertexBuffer.itemSize=1),(u||p)&&this.programConfigurations.upload(s))}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())}}Pt(Zw,"SymbolBuffers");class Kw{constructor(s,l,u){this.layoutVertexArray=new s,this.layoutAttributes=l,this.indexArray=new u,this.segments=new ur,this.collisionVertexArray=new Mi,this.collisionVertexArrayExt=new Ci}upload(s){this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=s.createVertexBuffer(this.collisionVertexArray,xV.members,!0),this.collisionVertexBufferExt=s.createVertexBuffer(this.collisionVertexArrayExt,wV.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
8stroy())}}Pt(Kw,"CollisionBuffers");class $c{constructor(s){this.collisionBoxArray=s.collisionBoxArray,this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(v=>v.id),this.index=s.index,this.pixelRatio=s.pixelRatio,this.sourceLayerIndex=s.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=va([]),this.placementViewportMatrix=va([]);let l=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Nw(this.zoom,l["text-size"]),this.iconSizeData=Nw(this.zoom,l["icon-size"]);let u=this.layers[0].layout,p=u.get("symbol-sort-key"),m=u.get("symbol-z-order");this.canOverlap=u.get("text-allow-overlap")||u.get("icon-allow-overlap")||u.get("text-ignore-placement")||u.get("icon-ignore-placement"),this.sortFeaturesByKey=m!=="viewport-y"&&p.constantOr(1)!==void 0,this.sortFeaturesByY=(m==="viewport-y"||m==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=u.get("text-writing-mode").map(v=>ps[v]),this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id),this.sourceID=s.sourceID,this.projection=s.projection}createArrays(){this.text=new Zw(new dd(this.layers,this.zoom,s=>/^text/.test(s))),this.icon=new Zw(new dd(this.layers,this.zoom,s=>/^icon/.test(s))),this.glyphOffsetArray=new _o,this.lineVertexArray=new Uh,this.symbolInstances=new On}calculateGlyphDependencies(s,l,u,p,m){for(let v=0;v<s.length;v++)if(l[s.charCodeAt(v)]=!0,p&&m){let b=dg[s.charAt(v)];b&&(l[b.charCodeAt(0)]=!0)}}populate(s,l,u,p){let m=this.layers[0],v=m.layout,b=this.projection.name==="globe",w=v.get("text-font"),T=v.get("text-field"),k=v.get("icon-image"),R=(T.value.kind!=="constant"||T.value.value instanceof go&&!T.value.value.isEmpty()||T.value.value.toString().length>0)&&(w.value.kind!=="constant"||w.value.value.length>0),L=k.value.kind!=="constant"||!!k.value.value||Object.keys(k.parameters).length>0,V=v.get("symbol-sort-key");if(this.features=[],!R&&!L)return;let B=l.iconDependencies,$=l.glyphDependencies,Y=l.availableImages,re=new O(this.zoom);for(let{feature:fe,id:oe,index:he,sourceLayerIndex:ge}of s){let me=m._featureFilter.needGeometry,Le=_d(fe,me);if(!m._featureFilter.filter(re,Le,u))continue;if(me||(Le.geometry=Gl(fe,u,p)),b&&fe.type!==1&&u.z<=5){let ze=Le.geometry,Ke=.98078528056,Xe=(et,dt)=>Fs(Jm(et.x,et.y,u,1),Jm(dt.x,dt.y,u,1))<Ke;for(let et=0;et<ze.length;et++)ze[et]=bj(ze[et],Xe)}let Pe,He;if(R){let ze=m.getValueAndResolveTokens("text-field",Le,u,Y),Ke=go.factory(ze);u4(Ke)&&(this.hasRTLText=!0),(!this.hasRTLText||x()==="unavailable"||this.hasRTLText&&D.isParsed())&&(Pe=SV(Ke,m,Le))}if(L){let ze=m.getValueAndResolveTokens("icon-image",Le,u,Y);He=ze instanceof $o?ze:$o.fromString(ze)}if(!Pe&&!He)continue;let rt=this.sortFeaturesByKey?V.evaluate(Le,{},u):void 0;if(this.features.push({id:oe,text:Pe,icon:He,index:he,sourceLayerIndex:ge,geometry:Le.geometry,properties:fe.properties,type:l4[fe.type],sortKey:rt}),He&&(B[He.name]=!0),Pe){let ze=w.evaluate(Le,{},u).join(","),Ke=v.get("text-rotation-alignment")==="map"&&v.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ps.vertical)>=0;for(let Xe of Pe.sections)if(Xe.image)B[Xe.image.name]=!0;else{let et=zm(Pe.toString()),dt=Xe.fontStack||ze,Be=$[dt]=$[dt]||{};this.calculateGlyphDependencies(Xe.text,Be,Ke,this.allowVerticalPlacement,et)}}}v.get("symbol-placement")==="line"&&(this.features=function(fe){let oe={},he={},ge=[],me=0;function Le(ze){ge.push(fe[ze]),me++}function Pe(ze,Ke,Xe){let et=he[ze];return delete he[ze],he[Ke]=et,ge[et].geometry[0].pop(),ge[et].geometry[0]=ge[et].geometry[0].concat(Xe[0]),et}function He(ze,Ke,Xe){let et=oe[Ke];return delete oe[Ke],oe[ze]=et,ge[et].geometry[0].shift(),ge[et].geometry[0]=Xe[0].concat(ge[et].geometry[0]),et}function rt(ze,Ke,Xe){let et=Xe?Ke[0][Ke[0].length-1]:Ke[0][0];return`${ze}:${et.x}:${et.y}`}for(let ze=0;ze<fe.length;ze++){let Ke=fe[ze],Xe=Ke.geometry,et=Ke.text?Ke.text.toString():null;if(!et){Le(ze);continue}let dt=rt(et,Xe),Be=rt(et,Xe,!0);if(dt in he&&Be in oe&&he[dt]!==oe[Be]){let xt=He(dt,Be,Xe),Rt=Pe(dt,Be,ge[xt].geometry);delete oe[dt],delete he[Be],he[rt(et,ge[Rt].geometry,!0)]=Rt,ge[xt].geometry=null}else dt in he?Pe(dt,Be,Xe):Be in oe?He(dt,Be,Xe):(Le(ze),oe[dt]=me-1,he[Be]=me-1)}return ge.filter(ze=>ze.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((fe,oe)=>fe.sortKey-oe.sortKey)}update(s,l,u,p){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(s,l,this.layers,u,p),this.icon.programConfigurations.updatePaintArrays(s,l,this.layers,u,p))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(s){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(s),this.iconCollisionBox.upload(s)),this.text.upload(s,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(s,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Uk(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(s,l){let u=this.lineVertexArray.length;if(s.segment!==void 0)for(let{x:p,y:m}of l)this.lineVertexArray.emplaceBack(p,m);return{lineStartIndex:u,lineLength:this.lineVertexArray.length-u}}addSymbols(s,l,u,p,m,v,b,w,T,k,R,L,V,B){let $=s.indexArray,Y=s.layoutVertexArray,re=s.globeExtVertexArray,fe=s.segments.prepareSegment(4*l.length,Y,$,this.canOverlap?v.sortKey:void 0),oe=this.glyphOffsetArray.length,he=fe.vertexLength,ge=this.allowVerticalPlacement&&b===ps.vertical?Math.PI/2:0,me=v.text&&v.text.sections;for(let Pe=0;Pe<l.length;Pe++){let{tl:He,tr:rt,bl:ze,br:Ke,tex:Xe,pixelOffsetTL:et,pixelOffsetBR:dt,minFontScaleX:Be,minFontScaleY:xt,glyphOffset:Rt,isSDF:wt,sectionIndex:li}=l[Pe],ht=fe.vertexLength,Vt=Rt[1];if(zv(Y,T.x,T.y,He.x,Vt+He.y,Xe.x,Xe.y,u,wt,et.x,et.y,Be,xt),zv(Y,T.x,T.y,rt.x,Vt+rt.y,Xe.x+Xe.w,Xe.y,u,wt,dt.x,et.y,Be,xt),zv(Y,T.x,T.y,ze.x,Vt+ze.y,Xe.x,Xe.y+Xe.h,u,wt,et.x,dt.y,Be,xt),zv(Y,T.x,T.y,Ke.x,Vt+Ke.y,Xe.x+Xe.w,Xe.y+Xe.h,u,wt,dt.x,dt.y,Be,xt),w){let{x:ci,y:Ki,z:ui}=w.anchor,[Kt,kn,fi]=w.up;jv(re,ci,Ki,ui,Kt,kn,fi),jv(re,ci,Ki,ui,Kt,kn,fi),jv(re,ci,Ki,ui,Kt,kn,fi),jv(re,ci,Ki,ui,Kt,kn,fi),Vv(s.dynamicLayoutVertexArray,ci,Ki,ui,ge)}else Vv(s.dynamicLayoutVertexArray,T.x,T.y,T.z,ge);$.emplaceBack(ht,ht+1,ht+2),$.emplaceBack(ht+1,ht+2,ht+3),fe.vertexLength+=4,fe.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Rt[0]),Pe!==l.length-1&&li===l[Pe+1].sectionIndex||s.programConfigurations.populatePaintArrays(Y.length,v,v.index,{},V,B,me&&me[li])}let Le=w?w.anchor:T;s.placedSymbolArray.emplaceBack(Le.x,Le.y,Le.z,T.x,T.y,oe,this.glyphOffsetArray.length-oe,he,k,R,T.segment,u?u[0]:0,u?u[1]:0,p[0],p[1],b,0,!1,0,L,0
8)}_commitLayoutVertex(s,l,u,p,m,v,b){s.emplaceBack(l,u,p,m,v,Math.round(b.x),Math.round(b.y))}_addCollisionDebugVertices(s,l,u,p,m,v,b){let w=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),T=w.vertexLength,k=b.tileAnchorX,R=b.tileAnchorY;for(let V=0;V<4;V++)u.collisionVertexArray.emplaceBack(0,0,0,0);u.collisionVertexArrayExt.emplaceBack(l,-s.padding,-s.padding),u.collisionVertexArrayExt.emplaceBack(l,s.padding,-s.padding),u.collisionVertexArrayExt.emplaceBack(l,s.padding,s.padding),u.collisionVertexArrayExt.emplaceBack(l,-s.padding,s.padding),this._commitLayoutVertex(u.layoutVertexArray,p,m,v,k,R,new tt(s.x1,s.y1)),this._commitLayoutVertex(u.layoutVertexArray,p,m,v,k,R,new tt(s.x2,s.y1)),this._commitLayoutVertex(u.layoutVertexArray,p,m,v,k,R,new tt(s.x2,s.y2)),this._commitLayoutVertex(u.layoutVertexArray,p,m,v,k,R,new tt(s.x1,s.y2)),w.vertexLength+=4;let L=u.indexArray;L.emplaceBack(T,T+1),L.emplaceBack(T+1,T+2),L.emplaceBack(T+2,T+3),L.emplaceBack(T+3,T),w.primitiveLength+=4}_addTextDebugCollisionBoxes(s,l,u,p,m,v){for(let b=p;b<m;b++){let w=u.get(b),T=this.getSymbolInstanceTextSize(s,v,l,b);this._addCollisionDebugVertices(w,T,this.textCollisionBox,w.projectedAnchorX,w.projectedAnchorY,w.projectedAnchorZ,v)}}_addIconDebugCollisionBoxes(s,l,u,p,m,v){for(let b=p;b<m;b++){let w=u.get(b),T=this.getSymbolInstanceIconSize(s,l,v.placedIconSymbolIndex);this._addCollisionDebugVertices(w,T,this.iconCollisionBox,w.projectedAnchorX,w.projectedAnchorY,w.projectedAnchorZ,v)}}generateCollisionDebugBuffers(s,l){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Kw(Ot,ak.members,Mr),this.iconCollisionBox=new Kw(Ot,ak.members,Mr);let u=ep(this.iconSizeData,s),p=ep(this.textSizeData,s);for(let m=0;m<this.symbolInstances.length;m++){let v=this.symbolInstances.get(m);this._addTextDebugCollisionBoxes(p,s,l,v.textBoxStartIndex,v.textBoxEndIndex,v),this._addTextDebugCollisionBoxes(p,s,l,v.verticalTextBoxStartIndex,v.verticalTextBoxEndIndex,v),this._addIconDebugCollisionBoxes(u,s,l,v.iconBoxStartIndex,v.iconBoxEndIndex,v),this._addIconDebugCollisionBoxes(u,s,l,v.verticalIconBoxStartIndex,v.verticalIconBoxEndIndex,v)}}getSymbolInstanceTextSize(s,l,u,p){let m=this.text.placedSymbolArray.get(l.rightJustifiedTextSymbolIndex>=0?l.rightJustifiedTextSymbolIndex:l.centerJustifiedTextSymbolIndex>=0?l.centerJustifiedTextSymbolIndex:l.leftJustifiedTextSymbolIndex>=0?l.leftJustifiedTextSymbolIndex:l.verticalPlacedTextSymbolIndex>=0?l.verticalPlacedTextSymbolIndex:p),v=Dv(this.textSizeData,s,m)/Vr;return this.tilePixelRatio*v}getSymbolInstanceIconSize(s,l,u){let p=this.icon.placedSymbolArray.get(u),m=Dv(this.iconSizeData,s,p);return this.tilePixelRatio*m}_commitDebugCollisionVertexUpdate(s,l,u){s.emplaceBack(l,-u,-u),s.emplaceBack(l,u,-u),s.emplaceBack(l,u,u),s.emplaceBack(l,-u,u)}_updateTextDebugCollisionBoxes(s,l,u,p,m,v){for(let b=p;b<m;b++){let w=u.get(b),T=this.getSymbolInstanceTextSize(s,v,l,b);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,T,w.padding)}}_updateIconDebugCollisionBoxes(s,l,u,p,m,v){for(let b=p;b<m;b++){let w=u.get(b),T=this.getSymbolInstanceIconSize(s,l,v);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,T,w.padding)}}updateCollisionDebugBuffers(s,l){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();let u=ep(this.iconSizeData,s),p=ep(this.textSizeData,s);for(let m=0;m<this.symbolInstances.length;m++){let v=this.symbolInstances.get(m);this._updateTextDebugCollisionBoxes(p,s,l,v.textBoxStartIndex,v.textBoxEndIndex,v),this._updateTextDebugCollisionBoxes(p,s,l,v.verticalTextBoxStartIndex,v.verticalTextBoxEndIndex,v),this._updateIconDebugCollisionBoxes(u,s,l,v.iconBoxStartIndex,v.iconBoxEndIndex,v.placedIconSymbolIndex),this._updateIconDebugCollisionBoxes(u,s,l,v.verticalIconBoxStartIndex,v.verticalIconBoxEndIndex,v.placedIconSymbolIndex)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(s,l,u,p,m,v,b,w,T){let k={};if(l<u){let{x1:R,y1:L,x2:V,y2:B,padding:$,projectedAnchorX:Y,projectedAnchorY:re,projectedAnchorZ:fe,tileAnchorX:oe,tileAnchorY:he,featureIndex:ge}=s.get(l);k.textBox={x1:R,y1:L,x2:V,y2:B,padding:$,projectedAnchorX:Y,projectedAnchorY:re,projectedAnchorZ:fe,tileAnchorX:oe,tileAnchorY:he},k.textFeatureIndex=ge}if(p<m){let{x1:R,y1:L,x2:V,y2:B,padding:$,projectedAnchorX:Y,projectedAnchorY:re,projectedAnchorZ:fe,tileAnchorX:oe,tileAnchorY:he,featureIndex:ge}=s.get(p);k.verticalTextBox={x1:R,y1:L,x2:V,y2:B,padding:$,projectedAnchorX:Y,projectedAnchorY:re,projectedAnchorZ:fe,tileAnchorX:oe,tileAnchorY:he},k.verticalTextFeatureIndex=ge}if(v<b){let{x1:R,y1:L,x2:V,y2:B,padding:$,projectedAnchorX:Y,projectedAnchorY:re,projectedAnchorZ:fe,tileAnchorX:oe,tileAnchorY:he,featureIndex:ge}=s.get(v);k.iconBox={x1:R,y1:L,x2:V,y2:B,padding:$,projectedAnchorX:Y,projectedAnchorY:re,projectedAnchorZ:fe,tileAnchorX:oe,tileAnchorY:he},k.iconFeatureIndex=ge}if(w<T){let{x1:R,y1:L,x2:V,y2:B,padding:$,projectedAnchorX:Y,projectedAnchorY:re,projectedAnchorZ:fe,tileAnchorX:oe,tileAnchorY:he,featureIndex:ge}=s.get(w);k.verticalIconBox={x1:R,y1:L,x2:V,y2:B,padding:$,projectedAnchorX:Y,projectedAnchorY:re,projectedAnchorZ:fe,tileAnchorX:oe,tileAnchorY:he},k.verticalIconFeatureIndex=ge}return k}deserializeCollisionBoxes(s){this.collisionArrays=[];for(let l=0;l<this.symbolInstances.length;l++){let u=this.symbolInstances.get(l);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(s,u.textBoxStartIndex,u.textBoxEndIndex,u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u.
8iconBoxStartIndex,u.iconBoxEndIndex,u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}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(s,l){let u=s.placedSymbolArray.get(l),p=u.vertexStartIndex+4*u.numGlyphs;for(let m=u.vertexStartIndex;m<p;m+=4)s.indexArray.emplaceBack(m,m+1,m+2),s.indexArray.emplaceBack(m+1,m+2,m+3)}getSortedSymbolIndexes(s){if(this.sortedAngle===s&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let l=Math.sin(s),u=Math.cos(s),p=[],m=[],v=[];for(let b=0;b<this.symbolInstances.length;++b){v.push(b);let w=this.symbolInstances.get(b);p.push(0|Math.round(l*w.tileAnchorX+u*w.tileAnchorY)),m.push(w.featureIndex)}return v.sort((b,w)=>p[b]-p[w]||m[w]-m[b]),v}addToSortKeyRanges(s,l){let u=this.sortKeyRanges[this.sortKeyRanges.length-1];u&&u.sortKey===l?u.symbolInstanceEnd=s+1:this.sortKeyRanges.push({sortKey:l,symbolInstanceStart:s,symbolInstanceEnd:s+1})}sortFeatures(s){if(this.sortFeaturesByY&&this.sortedAngle!==s&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(s),this.sortedAngle=s,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let l of this.symbolInstanceIndexes){let u=this.symbolInstances.get(l);this.featureSortOrder.push(u.featureIndex);let{rightJustifiedTextSymbolIndex:p,centerJustifiedTextSymbolIndex:m,leftJustifiedTextSymbolIndex:v,verticalPlacedTextSymbolIndex:b,placedIconSymbolIndex:w,verticalPlacedIconSymbolIndex:T}=u;p>=0&&this.addIndicesForPlacedSymbol(this.text,p),m>=0&&m!==p&&this.addIndicesForPlacedSymbol(this.text,m),v>=0&&v!==m&&v!==p&&this.addIndicesForPlacedSymbol(this.text,v),b>=0&&this.addIndicesForPlacedSymbol(this.text,b),w>=0&&this.addIndicesForPlacedSymbol(this.icon,w),T>=0&&this.addIndicesForPlacedSymbol(this.icon,T)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Pt($c,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),$c.MAX_GLYPHS=65535,$c.addDynamicAttributes=Vv;let d4=new ue({"symbol-placement":new H(Ue.layout_symbol["symbol-placement"]),"symbol-spacing":new H(Ue.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new H(Ue.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Q(Ue.layout_symbol["symbol-sort-key"]),"symbol-z-order":new H(Ue.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new H(Ue.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new H(Ue.layout_symbol["icon-ignore-placement"]),"icon-optional":new H(Ue.layout_symbol["icon-optional"]),"icon-rotation-alignment":new H(Ue.layout_symbol["icon-rotation-alignment"]),"icon-size":new Q(Ue.layout_symbol["icon-size"]),"icon-text-fit":new H(Ue.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new H(Ue.layout_symbol["icon-text-fit-padding"]),"icon-image":new Q(Ue.layout_symbol["icon-image"]),"icon-rotate":new Q(Ue.layout_symbol["icon-rotate"]),"icon-padding":new H(Ue.layout_symbol["icon-padding"]),"icon-keep-upright":new H(Ue.layout_symbol["icon-keep-upright"]),"icon-offset":new Q(Ue.layout_symbol["icon-offset"]),"icon-anchor":new Q(Ue.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new H(Ue.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new H(Ue.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new H(Ue.layout_symbol["text-rotation-alignment"]),"text-field":new Q(Ue.layout_symbol["text-field"]),"text-font":new Q(Ue.layout_symbol["text-font"]),"text-size":new Q(Ue.layout_symbol["text-size"]),"text-max-width":new Q(Ue.layout_symbol["text-max-width"]),"text-line-height":new Q(Ue.layout_symbol["text-line-height"]),"text-letter-spacing":new Q(Ue.layout_symbol["text-letter-spacing"]),"text-justify":new Q(Ue.layout_symbol["text-justify"]),"text-radial-offset":new Q(Ue.layout_symbol["text-radial-offset"]),"text-variable-anchor":new H(Ue.layout_symbol["text-variable-anchor"]),"text-anchor":new Q(Ue.layout_symbol["text-anchor"]),"text-max-angle":new H(Ue.layout_symbol["text-max-angle"]),"text-writing-mode":new H(Ue.layout_symbol["text-writing-mode"]),"text-rotate":new Q(Ue.layout_symbol["text-rotate"]),"text-padding":new H(Ue.layout_symbol["text-padding"]),"text-keep-upright":new H(Ue.layout_symbol["text-keep-upright"]),"text-transform":new Q(Ue.layout_symbol["text-transform"]),"text-offset":new Q(Ue.layout_symbol["text-offset"]),"text-allow-overlap":new H(Ue.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new H(Ue.layout_symbol["text-ignore-placement"]),"text-optional":new H(Ue.layout_symbol["text-optional"])});var Xw={paint:new ue({"icon-opacity":new Q(Ue.paint_symbol["icon-opacity"]),"icon-color":new Q(Ue.paint_symbol["icon-color"]),"icon-halo-color":new Q(Ue.paint_symbol["icon-halo-color"]),"icon-halo-width":new Q(Ue.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Q(Ue.paint_symbol["icon-halo-blur"]),"icon-translate":new H(Ue.paint_symbol["icon-translate"]),"icon-translate-anchor":new H(Ue.paint_symbol["icon-translate-anchor"]),"text-opacity":new Q(Ue.paint_symbol["text-opacity"]),"text-color":new Q(Ue.paint_symbol["text-color"],{runtimeType:Io,getOverride:a=>a.textColor,hasOverride:a=>!!a.textColor}),"text-halo-color":new Q(Ue.paint_symbol["text-halo-color"]),"text-halo-width":new Q(Ue.paint_symbol["text-halo-width"]),"text-halo-blur":new Q(Ue.paint_symbol["text-halo-blur"]),"text-translate":new H(Ue.paint_symbol["text-translate"]),"text-translate-anchor":new H(Ue.paint_symbol["text-translate-anchor"])}),layout:d4};class Hk{constructor(s){this.type=s.property.overrides?s.property.overrides.runtimeType:bc,this.defaultValue=s}evaluate(s){if(s.formattedSection){let l=this.defaultValue.property.overrides;if(l&&l.hasOverride(s.formattedSection))return l.getOverride(s.formattedSection)}return s.feature&&s.featureState?this.defaultValue.evaluate(s.feature,s.featureState):this.defaultValue.property.specification.default}eachChild(s){this.defaultValue.isConstant()||s(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Pt(Hk,"FormatSectionOverride",{omit:["defaultValue"]});class Bv extends _a{constructor(s){super(s,Xw)}recalculate(s,l){super.recalculate(s,l),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));let u=this.layout.get("text-writing-mode");if(u){let p=[];for(let m of u)p.indexOf(m)<0&&p.push(m);this.layout._values["text-writing-mode"]=p}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(s,l,u,p){let m=this.layout.get(s).evaluate(l,{},u,p),v=this._unevaluatedLayout._values[s];return v.isDataDriven()||Pc(v.value)||!m?m:function(b,w){return w.replace(/{([^{}]+)}/g,(T,k)=>k in b?String(b[k]):"")}(l.properties,m)}createBucket(s){return new $c(s)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(let s of Xw.paint.overridableProperties){if(!Bv.hasPaintOverride(this.layout,s))continue;let l=this.paint.get(s),u=new Hk(l),p=new Rh(u,l.property.specification),m=null;m=l.value.kind==="constant"||l.value.kind==="source"?new Im("source",p):new id("composite",p,l.value.zoomStops,l.value._interpolationType),this.paint._values[s]=new ee(l.property,m,l.parameters)}}_handleOverridablePaintPropertyUpdate(s,l,u){return!(!this.layout||l.isDataDriven()||u.isDataDriven())&&Bv.hasPaintOverride(this.layout,s)}static hasPaintOverride(s,l){let u=s.get("text-field"),p=Xw.paint.properties[l],m=!1,v=b=>{for(let w of b)if(p.overrides&&p.overrides.hasOverride(w))return void(m=!0)};if(u.value.kind==="constant"&&u.value.value instanceof go)v(u.value.value.sections);else if(u.value.kind==="source"){let b=T=>{m||(T instanceof Ol&&Jn(T.value)===ju?v(T.value.sections):T instanceof Va?v(T.sections):T.eachChild(b))},w=u.value;w._styleExpression&&b(w._styleExpression.expression)}return m}getProgramConfiguration(s){return new jc(this,s)}}var h4={paint:new ue({"background-color":new H(Ue.paint_background["background-color"]),"background-pattern":new H(Ue.paint_background["background-pattern"]),"background-opacity":new H(Ue.paint_background["background-opacity"])})},p4={paint:new ue({"raster-opacity":new H(Ue.paint_raster["raster-opacity"]),"raster-hue-rotate":new H(Ue.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new H(Ue.paint_raster["raster-brightness-min"]),"raster-brightness-max":new H(Ue.paint_raster["raster-brightness-max"]),"raster-saturation":new H(Ue.paint_raster["raster-saturation"]),"raster-contrast":new H(Ue.paint_raster["raster-contrast"]),"raster-resampling":new H(Ue.paint_raster["raster-resampling"]),"raster-fade-duration":new H(Ue.paint_raster["raster-fade-duration"])})};class f4 extends _a{constructor(s){super(s,{}),this.implementation=s}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isLayerDraped(){return this.implementation.renderToTile!==void 0}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(s){this.implementation.onAdd&&this.implementation.onAdd(s,s.painter.context.gl)}onRemove(s){this.implementation.onRemove&&this.implementation.onRemove(s,s.painter.context.gl)}}var m4={paint:new ue({"sky-type":new H(Ue.paint_sky["sky-type"]),"sky-atmosphere-sun":new H(Ue.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new H(Ue.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new H(Ue.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new H(Ue.paint_sky["sky-gradient-radius"]),"sky-gradient":new le(Ue.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new H(Ue.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new H(Ue.paint_sky["sky-atmosphere-color"]),"sky-opacity":new H(Ue.paint_sky["sky-opacity"])})};function Yw(a,s,l){let u=[0,0,1],p=lM([]);return uM(p,p,l?-ai(a)+Math.PI:ai(a)),cM(p,p,-ai(s)),rM(u,u,p),vo(u,u)}
8let g4={circle:class extends _a{constructor(a){super(a,Ij)}createBucket(a){return new Cw(a)}queryRadius(a){let s=a;return Xh("circle-radius",this,s)+Xh("circle-stroke-width",this,s)+_v(this.paint.get("circle-translate"))}queryIntersectsFeature(a,s,l,u,p,m,v,b){let w=PM(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),m.angle,a.pixelToTileUnitsFactor),T=this.paint.get("circle-radius").evaluate(s,l)+this.paint.get("circle-stroke-width").evaluate(s,l);return OM(a,u,m,v,b,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",w,T)}getProgramIds(){return["circle"]}getProgramConfiguration(a){return new jc(this,a)}},heatmap:class extends _a{createBucket(a){return new LM(a)}constructor(a){super(a,Aj),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(a){a==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Iw({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(a){return Xh("heatmap-radius",this,a)}queryIntersectsFeature(a,s,l,u,p,m,v,b){let w=this.paint.get("heatmap-radius").evaluate(s,l);return OM(a,u,m,v,b,!0,!0,new tt(0,0),w)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(a){return new jc(this,a)}},hillshade:class extends _a{constructor(a){super(a,Pj)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends _a{constructor(a){super(a,Zj)}getProgramIds(){let a=this.paint.get("fill-pattern"),s=a&&a.constantOr(1),l=[s?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&l.push(s&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),l}getProgramConfiguration(a){return new jc(this,a)}recalculate(a,s){super.recalculate(a,s);let l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(a){return new wv(a)}queryRadius(){return _v(this.paint.get("fill-translate"))}queryIntersectsFeature(a,s,l,u,p,m){return!a.queryGeometry.isAboveHorizon&&IM(AM(a.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),m.angle,a.pixelToTileUnitsFactor),u)}isTileClipped(){return!0}},"fill-extrusion":class extends _a{constructor(a){super(a,uV)}createBucket(a){return new lg(a)}queryRadius(){return _v(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(a){return new jc(this,a)}queryIntersectsFeature(a,s,l,u,p,m,v,b,w){let T=PM(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),m.angle,a.pixelToTileUnitsFactor),k=this.paint.get("fill-extrusion-height").evaluate(s,l),R=this.paint.get("fill-extrusion-base").evaluate(s,l),L=[0,0],V=b&&m.elevation,B=m.elevation?m.elevation.exaggeration():1,$=a.tile.getBucket(this);if(V&&$ instanceof lg){let he=$.centroidVertexArray,ge=w+1;ge<he.length&&(L[0]=he.geta_centroid_pos0(ge),L[1]=he.geta_centroid_pos1(ge))}if(L[0]===0&&L[1]===1)return!1;m.projection.name==="globe"&&(u=JM([u],[new tt(0,0),new tt(Ut,Ut)],a.tileID.canonical).map(he=>he.polygon).flat());let Y=V?b:null,[re,fe]=function(he,ge,me,Le,Pe,He,rt,ze,Ke,Xe,et){return he.projection.name==="globe"?function(dt,Be,xt,Rt,wt,li,ht,Vt,ci,Ki,ui){let Kt=[],kn=[],fi=dt.projection.upVectorScale(ui,dt.center.lat,dt.worldSize).metersToTile,mi=[0,0,0,1],xn=[0,0,0,1],Sn=(wn,$n,er,hr)=>{wn[0]=$n,wn[1]=er,wn[2]=hr,wn[3]=1},Tn=QM();xt>0&&(xt+=Tn),Rt+=Tn;for(let wn of Be){let $n=[],er=[];for(let hr of wn){let Cn=hr.x+wt.x,br=hr.y+wt.y,pr=dt.projection.projectTilePoint(Cn,br,ui),Kn=dt.projection.upVector(ui,hr.x,hr.y),Ji=xt,fr=Rt;if(ht){let In=nk(Cn,br,xt,Rt,ht,Vt,ci,Ki);Ji+=In.base,fr+=In.top}xt!==0?Sn(mi,pr.x+Kn[0]*fi*Ji,pr.y+Kn[1]*fi*Ji,pr.z+Kn[2]*fi*Ji):Sn(mi,pr.x,pr.y,pr.z),Sn(xn,pr.x+Kn[0]*fi*fr,pr.y+Kn[1]*fi*fr,pr.z+Kn[2]*fi*fr),rr(mi,mi,li),rr(xn,xn,li),$n.push(new Jh(mi[0],mi[1],mi[2])),er.push(new Jh(xn[0],xn[1],xn[2]))}Kt.push($n),kn.push(er)}return[Kt,kn]}(he,ge,me,Le,Pe,He,rt,ze,Ke,Xe,et):rt?function(dt,Be,xt,Rt,wt,li,ht,Vt,ci){let Ki=[],ui=[],Kt=[0,0,0,1];for(let kn of dt){let fi=[],mi=[];for(let xn of kn){let Sn=xn.x+Rt.x,Tn=xn.y+Rt.y,wn=nk(Sn,Tn,Be,xt,li,ht,Vt,ci);Kt[0]=Sn,Kt[1]=Tn,Kt[2]=wn.base,Kt[3]=1,fd(Kt,Kt,wt),Kt[3]=Math.max(Kt[3],1e-5);let $n=new Jh(Kt[0]/Kt[3],Kt[1]/Kt[3],Kt[2]/Kt[3]);Kt[0]=Sn,Kt[1]=Tn,Kt[2]=wn.top,Kt[3]=1,fd(Kt,Kt,wt),Kt[3]=Math.max(Kt[3],1e-5);let er=new Jh(Kt[0]/Kt[3],Kt[1]/Kt[3],Kt[2]/Kt[3]);fi.push($n),mi.push(er)}Ki.push(fi),ui.push(mi)}return[Ki,ui]}(ge,me,Le,Pe,He,rt,ze,Ke,Xe):function(dt,Be,xt,Rt,wt){let li=[],ht=[],Vt=wt[8]*Be,ci=wt[9]*Be,Ki=wt[10]*Be,ui=wt[11]*Be,Kt=wt[8]*xt,kn=wt[9]*xt,fi=wt[10]*xt,mi=wt[11]*xt;for(let xn of dt){let Sn=[],Tn=[];for(let wn of xn){let $n=wn.x+Rt.x,er=wn.y+Rt.y,hr=wt[0]*$n+wt[4]*er+wt[12],Cn=wt[1]*$n+wt[5]*er+wt[13],br=wt[2]*$n+wt[6]*er+wt[14],pr=wt[3]*$n+wt[7]*er+wt[15],Kn=hr+Vt,Ji=Cn+ci,fr=br+Ki,In=Math.max(pr+ui,1e-5),xo=hr+Kt,mr=Cn+kn,Br=br+fi,kr=Math.max(pr+mi,1e-5);Sn.push(new Jh(Kn/In,Ji/In,fr/In)),Tn.push(new Jh(xo/kr,mr/kr,Br/kr))}li.push(Sn),ht.push(Tn)}return[li,ht]}(ge,me,Le,Pe,He)}(m,u,R,k,T,v,Y,L,B,m.center.lat,a.tileID.canonical),oe=a.queryGeometry;return function(he,ge,me){let Le=1/0;IM(me,ge)&&(Le=ik(me,ge[0]));for(let Pe=0;Pe<ge.length;Pe++){let He=ge[Pe],rt=he[Pe];for(let ze=0;ze<He.length-1;ze++){let Ke=He[ze],Xe=[Ke,He[ze+1],rt[ze+1],rt[ze],Ke];TM(me,Xe)&&(Le=Math.min(Le,ik(me,Xe)))}}return Le!==1/0&&Le}(re,fe,oe.isPointQuery()?oe.screenBounds:oe.screenGeometry)}}
8,line:class extends _a{constructor(a){super(a,rk),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(a){if(a==="line-gradient"){let s=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=s._styleExpression&&s._styleExpression.expression instanceof fm,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(a,s){super.recalculate(a,s),this.paint._values["line-floorwidth"]=ok.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,a)}createBucket(a){return new Iv(a)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getProgramConfiguration(a){return new jc(this,a)}queryRadius(a){let s=a,l=sk(Xh("line-width",this,s),Xh("line-gap-width",this,s)),u=Xh("line-offset",this,s);return l/2+Math.abs(u)+_v(this.paint.get("line-translate"))}queryIntersectsFeature(a,s,l,u,p,m){if(a.queryGeometry.isAboveHorizon)return!1;let v=AM(a.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),m.angle,a.pixelToTileUnitsFactor),b=a.pixelToTileUnitsFactor/2*sk(this.paint.get("line-width").evaluate(s,l),this.paint.get("line-gap-width").evaluate(s,l)),w=this.paint.get("line-offset").evaluate(s,l);return w&&(u=function(T,k){let R=[],L=new tt(0,0);for(let V=0;V<T.length;V++){let B=T[V],$=[];for(let Y=0;Y<B.length;Y++){let re=B[Y],fe=B[Y+1],oe=Y===0?L:re.sub(B[Y-1])._unit()._perp(),he=Y===B.length-1?L:fe.sub(re)._unit()._perp(),ge=oe._add(he)._unit();ge._mult(1/(ge.x*he.x+ge.y*he.y)),$.push(ge._mult(k)._add(re))}R.push($)}return R}(u,w*a.pixelToTileUnitsFactor)),function(T,k,R){for(let L=0;L<k.length;L++){let V=k[L];if(T.length>=3){for(let B=0;B<V.length;B++)if(vd(T,V[B]))return!0}if(Cj(T,V,R))return!0}return!1}(v,u,b)}isTileClipped(){return!0}},symbol:Bv,background:class extends _a{constructor(a){super(a,h4)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends _a{constructor(a){super(a,p4)}getProgramIds(){return["raster"]}},sky:class extends _a{constructor(a){super(a,m4),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(a){a==="sky-gradient"?this._updateColorRamp():a!=="sky-atmosphere-sun"&&a!=="sky-atmosphere-halo-color"&&a!=="sky-atmosphere-color"&&a!=="sky-atmosphere-sun-intensity"||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=Iw({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(a){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){let s=a.style.light.properties.get("position");return this._lightPosition.azimuthal!==s.azimuthal||this._lightPosition.polar!==s.polar}return!1}getCenter(a,s){if(this.paint.get("sky-type")==="atmosphere"){let u=this.paint.get("sky-atmosphere-sun"),p=!u,m=a.style.light,v=m.properties.get("position");return p&&m.properties.get("anchor")==="viewport"&&Un("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),p?Yw(v.azimuthal,90-v.polar,s):Yw(u[0],90-u[1],s)}let l=this.paint.get("sky-gradient-center");return Yw(l[0],90-l[1],s)}is3D(){return!1}isSky(){return!0}markSkyboxValid(a){this._skyboxInvalidated=!1,this._lightPosition=a.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){let a=this.paint.get("sky-type");return a==="atmosphere"?["skyboxCapture","skybox"]:a==="gradient"?["skyboxGradient"]:null}}};class yg{constructor(s,l,u,p){this.context=s,this.format=u,this.texture=s.gl.createTexture(),this.update(l,p)}update(s,l,u){let{width:p,height:m}=s,{context:v}=this,{gl:b}=v,{HTMLImageElement:w,HTMLCanvasElement:T,HTMLVideoElement:k,ImageData:R,ImageBitmap:L}=d;if(b.bindTexture(b.TEXTURE_2D,this.texture),v.pixelStoreUnpackFlipY.set(!1),v.pixelStoreUnpack.set(1),v.pixelStoreUnpackPremultiplyAlpha.set(this.format===b.RGBA&&(!l||l.premultiply!==!1)),u||this.size&&this.size[0]===p&&this.size[1]===m){let{x:V,y:B}=u||{x:0,y:0};s instanceof w||s instanceof T||s instanceof k||s instanceof R||L&&s instanceof L?b.texSubImage2D(b.TEXTURE_2D,0,V,B,b.RGBA,b.UNSIGNED_BYTE,s):b.texSubImage2D(b.TEXTURE_2D,0,V,B,p,m,b.RGBA,b.UNSIGNED_BYTE,s.data)}else this.size=[p,m],s instanceof w||s instanceof T||s instanceof k||s instanceof R||L&&s instanceof L?b.texImage2D(b.TEXTURE_2D,0,this.format,this.format,b.UNSIGNED_BYTE,s):b.texImage2D(b.TEXTURE_2D,0,this.format,p,m,0,this.format,b.UNSIGNED_BYTE,s.data);this.useMipmap=!!(l&&l.useMipmap&&this.isSizePowerOfTwo()),this.useMipmap&&b.generateMipmap(b.TEXTURE_2D)}bind(s,l){let{context:u}=this,{gl:p}=u;p.bindTexture(p.TEXTURE_2D,this.texture),s!==this.filter&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,s),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,this.useMipmap?s===p.NEAREST?p.NEAREST_MIPMAP_NEAREST:p.LINEAR_MIPMAP_NEAREST:s),this.filter=s),l!==this.wrap&&(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,l),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,l),this.wrap=l)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:s}=this.context;s.deleteTexture(this.texture),this.texture=null}}class _4{constructor(s){this._callback=s,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{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 v4{constructor(){this.tasks={},this.taskQueue=[],Zn(["process"],this),this.invoker=new _4(this.process),this.nextId=0}add(s,l){let u=this.nextId++,p=function({type:m,isSymbolTile:v,zoom:b}){return b=b||0,m==="message"?0:m!=="maybePrepare"||v?m!=="parseTile"||v?m==="parseTile"&&v?300-b:m==="maybePrepare"&&v?400-b:500:200-b:100-b}(l);if(p===0){ra();try{s()}finally{}return{cancel:()=>{}}}return this.tasks[u]={fn:s,metadata:l,priority:p,id:u},this.taskQueue.push(u),this.invoker.trigger(),{cancel:()=>{delete this.tasks[u]}}}process(){ra();try{if(this.taskQueue=this.taskQueue.filter(u=>!!this.tasks[u]),!this.taskQueue.length)return;let s=this.pick();if(s===null)return;let l=this.tasks[s];if(delete this.tasks[s],this.taskQueue.length&&this.invoker.trigger(),!l)return;l.fn()}finally{}}pick(){let s=null,l=1/0;for(let p=0;p<this.taskQueue.length;p++){let m=this.tasks[this.taskQueue[p]];m.priority<l&&(l=m.priority,s=p)}if(s===null)return null;let u=this.taskQueue[s];return this.taskQueue.splice(s,1),u}remove(){this.invoker.remove()}}class $k{constructor(s){this._stringToNumber={},this._numberToString=[];for(let l=0;l<s.length;l++){let u=s[l];this._stringToNumber[u]=l,this._numberToString[l]=u}}encode(s){return this._stringToNumber[s]}decode(s){return this._numberToString[s]}}let y4=["tile","layer","source","sourceLayer","state"];class Gk{constructor(s,l,u,p,m){this.type="Feature",this._vectorTileFeature=s,this._z=l,this._x=u,this._y=p,this.properties=s.properties,this.id=m}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(s){this._geometry=s}toJSON(){let s={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};this.id!==void 0&&(s.id=this.id);for(let l of y4)this[l]!==void 0&&(s[l]=this[l]);return s}}let js=32,Wa=33,Gc=new Uint16Array(8184);for(let a=0;a<2046;a++){let s=a+2,l=0,u=0,p=0,m=0,v=0,b=0;for(1&s?p=m=v=js:l=u=b=js;(s>>=1)>1;){let T=l+p>>1,k=u+m>>1;1&s?(p=l,m=u,l=v,u=b):(l=p,u=m,p=v,m=b),v=T,b=k}let w=4*a;Gc[w+0]=l,Gc[w+1]=u,Gc[w+2]=p,Gc[w+3]=m}let Za=new Uint16Array(2178),qc=new Uint8Array(1089),Uv=new Uint16Array(1089);function qk(a){return a===0?-.03125:a===32?.03125:0}var Wk=Ie([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);let Zk={type:2,extent:Ut,loadGeometry:()=>[[new tt(0,0),new tt(Ut+1,0),new tt(Ut+1,Ut+1),new tt(0,Ut+1),new tt(0,0)]]};class Qw{constructor(s,l,u,p,m){this.tileID=s,this.uid=ao(),this.uses=0,this.tileSize=l,this.tileZoom=u,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=m,this.expiredRequestCount=0,this.state="loading",p&&p.transform&&(this.projection=p.transform.projection)}registerFadeDuration(s){let l=s+this.timeAdded;l<oa.now()||this.fadeEndTime&&l<this.fadeEndTime||(this.fadeEndTime=l)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}get tileTransform(){return this._tileTransform||(this._tileTransform=bd(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(s,l,u){if(this.unloadVectorData(),this.state="loaded",s){s.featureIndex&&(this.latestFeatureIndex=s.featureIndex,s.rawTileData?(this.latestRawTileData=s.rawTileData,this.latestFeatureIndex.rawTileData=s.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=s.collisionBoxArray,this.buckets=function(p,m){let v={};if(!m)return v;for(let b of p){let w=b.layerIds.map(T=>
8m.getLayer(T)).filter(Boolean);if(w.length!==0){b.layers=w,b.stateDependentLayerIds&&(b.stateDependentLayers=b.stateDependentLayerIds.map(T=>w.filter(k=>k.id===T)[0]));for(let T of w)v[T.id]=b}}return v}(s.buckets,l.style),this.hasSymbolBuckets=!1;for(let p in this.buckets){let m=this.buckets[p];if(m instanceof $c){if(this.hasSymbolBuckets=!0,!u)break;m.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let p in this.buckets){let m=this.buckets[p];if(m instanceof $c&&m.hasRTLText){this.hasRTLText=!0,D.isLoading()||D.isLoaded()||x()!=="deferred"||I();break}}this.queryPadding=0;for(let p in this.buckets){let m=this.buckets[p];this.queryPadding=Math.max(this.queryPadding,l.style.getLayer(p).queryRadius(m))}s.imageAtlas&&(this.imageAtlas=s.imageAtlas),s.glyphAtlasImage&&(this.glyphAtlasImage=s.glyphAtlasImage),s.lineAtlas&&(this.lineAtlas=s.lineAtlas)}else this.collisionBoxArray=new yn}unloadVectorData(){if(this.hasData()){for(let s in this.buckets)this.buckets[s].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(s){return this.buckets[s.id]}upload(s){for(let u in this.buckets){let p=this.buckets[u];p.uploadPending()&&p.upload(s)}let l=s.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new yg(s,this.imageAtlas.image,l.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new yg(s,this.glyphAtlasImage,l.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new yg(s,this.lineAtlas.image,l.ALPHA),this.lineAtlas.uploaded=!0)}prepare(s){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(s,this.imageAtlasTexture)}queryRenderedFeatures(s,l,u,p,m,v,b,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:p,pixelPosMatrix:b,transform:v,params:m,tileTransform:this.tileTransform},s,l,u):{}}querySourceFeatures(s,l){let u=this.latestFeatureIndex;if(!u||!u.rawTileData)return;let p=u.loadVTLayers(),m=l?l.sourceLayer:"",v=p._geojsonTileLayer||p[m];if(!v)return;let b=zh(l&&l.filter),{z:w,x:T,y:k}=this.tileID.canonical,R={z:w,x:T,y:k};for(let L=0;L<v.length;L++){let V=v.feature(L);if(b.needGeometry){let Y=_d(V,!0);if(!b.filter(new O(this.tileID.overscaledZ),Y,this.tileID.canonical))continue}else if(!b.filter(new O(this.tileID.overscaledZ),V))continue;let B=u.getId(V,m),$=new Gk(V,w,T,k,B);$.tile=R,s.push($)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(s){let l=this.expirationTime;if(s.cacheControl){let u=To(s.cacheControl);u["max-age"]&&(this.expirationTime=Date.now()+1e3*u["max-age"])}else s.expires&&(this.expirationTime=new Date(s.expires).getTime());if(this.expirationTime){let u=Date.now(),p=!1;if(this.expirationTime>u)p=!1;else if(l)if(this.expirationTime<l)p=!0;else{let m=this.expirationTime-l;m?this.expirationTime=u+Math.max(m,3e4):p=!0}else p=!0;p?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(s,l){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(s).length===0||!l)return;let u=this.latestFeatureIndex.loadVTLayers(),p=l.style.listImages();for(let m in this.buckets){if(!l.style.hasLayer(m))continue;let v=this.buckets[m],b=v.layers[0].sourceLayer||"_geojsonTileLayer",w=u[b],T=s[b];if(!w||!T||Object.keys(T).length===0)continue;if(v.update(T,w,p,this.imageAtlas&&this.imageAtlas.patternPositions||{}),v instanceof Iv||v instanceof wv){let R=l.style._getSourceCache(v.layers[0].source);l._terrain&&l._terrain.enabled&&R&&v.programConfigurations.needsUpload&&l._terrain._clearRenderCacheForTile(R.id,this.tileID)}let k=l&&l.style&&l.style.getLayer(m);k&&(this.queryPadding=Math.max(this.queryPadding,k.queryRadius(v)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<oa.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(s){this.symbolFadeHoldUntil=oa.now()+s}setTexture(s,l){let u=l.context,p=u.gl;this.texture=this.texture||l.getTileTexture(s.width),this.texture?this.texture.update(s,{useMipmap:!0}):(this.texture=new yg(u,s,p.RGBA,{useMipmap:!0}),this.texture.bind(p.LINEAR,p.CLAMP_TO_EDGE))}
8setDependencies(s,l){let u={};for(let p of l)u[p]=!0;this.dependencies[s]=u}hasDependency(s,l){for(let u of s){let p=this.dependencies[u];if(p){for(let m of l)if(p[m])return!0}}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(s,l){if(!l||l.name==="mercator"||this._tileDebugBuffer)return;let u=Gl(Zk,this.tileID.canonical,this.tileTransform)[0],p=new nt,m=new Wo;for(let v=0;v<u.length;v++){let{x:b,y:w}=u[v];p.emplaceBack(b,w),m.emplaceBack(v)}m.emplaceBack(0),this._tileDebugIndexBuffer=s.createIndexBuffer(m),this._tileDebugBuffer=s.createVertexBuffer(p,Ym.members),this._tileDebugSegments=ur.simpleSegment(0,0,p.length,m.length)}_makeTileBoundsBuffers(s,l){if(this._tileBoundsBuffer||!l||l.name==="mercator")return;let u=Gl(Zk,this.tileID.canonical,this.tileTransform)[0],p,m;if(this.isRaster){let v=function(b,w){let T=bd(b,w),k=Math.pow(2,b.z);for(let Y=0;Y<Wa;Y++)for(let re=0;re<Wa;re++){let fe=hs((b.x+(re+qk(re))/js)/k),oe=Yr((b.y+(Y+qk(Y))/js)/k),he=w.project(fe,oe),ge=Y*Wa+re;Za[2*ge+0]=Math.round((he.x*T.scale-T.x)*Ut),Za[2*ge+1]=Math.round((he.y*T.scale-T.y)*Ut)}qc.fill(0),Uv.fill(0);for(let Y=2045;Y>=0;Y--){let re=4*Y,fe=Gc[re+0],oe=Gc[re+1],he=Gc[re+2],ge=Gc[re+3],me=fe+he>>1,Le=oe+ge>>1,Pe=me+Le-oe,He=Le+fe-me,rt=oe*Wa+fe,ze=ge*Wa+he,Ke=Le*Wa+me,Xe=Math.hypot((Za[2*rt+0]+Za[2*ze+0])/2-Za[2*Ke+0],(Za[2*rt+1]+Za[2*ze+1])/2-Za[2*Ke+1])>=16;qc[Ke]=qc[Ke]||(Xe?1:0),Y<1022&&(qc[Ke]=qc[Ke]||qc[(oe+He>>1)*Wa+(fe+Pe>>1)]||qc[(ge+He>>1)*Wa+(he+Pe>>1)])}let R=new Ze,L=new Nt,V=0;function B(Y,re){let fe=re*Wa+Y;return Uv[fe]===0&&(R.emplaceBack(Za[2*fe+0],Za[2*fe+1],Y*Ut/js,re*Ut/js),Uv[fe]=++V),Uv[fe]-1}function $(Y,re,fe,oe,he,ge){let me=Y+fe>>1,Le=re+oe>>1;if(Math.abs(Y-he)+Math.abs(re-ge)>1&&qc[Le*Wa+me])$(he,ge,Y,re,me,Le),$(fe,oe,he,ge,me,Le);else{let Pe=B(Y,re),He=B(fe,oe),rt=B(he,ge);L.emplaceBack(Pe,He,rt)}}return $(0,0,js,js,js,0),$(js,js,0,0,0,js),{vertices:R,indices:L}}(this.tileID.canonical,l);p=v.vertices,m=v.indices}else{p=new Ze,m=new Nt;for(let{x:b,y:w}of u)p.emplaceBack(b,w,0,0);let v=Pw(p.int16,void 0,4);for(let b=0;b<v.length;b+=3)m.emplaceBack(v[b],v[b+1],v[b+2])}this._tileBoundsBuffer=s.createVertexBuffer(p,Wk.members),this._tileBoundsIndexBuffer=s.createIndexBuffer(m),this._tileBoundsSegments=ur.simpleSegment(0,0,p.length,m.length)}_makeGlobeTileDebugBuffers(s,l){let u=l.projection;if(!u||u.name!=="globe"||l.freezeTileCoverage)return;let p=this.tileID.canonical,m=eg(mM(p,l)),v=Zh(l.zoom),b;v>0&&(b=sw(new Float64Array(16),l.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(s,p,l,m,b,v),this._makeGlobeTileDebugTextBuffer(s,p,l,m,b,v)}_globePoint(s,l,u,p,m,v,b){let w=Jm(s,l,u);if(v){let T=1<<u.z,k=Ga(p.center.lng),R=qa(p.center.lat),L=(u.x+.5)/T-k,V=0;L>.5?V=-1:L<-.5&&(V=1);let B=(s/Ut+u.x)/T+V,$=(l/Ut+u.y)/T;B=(B-k)*p._pixelsPerMercatorPixel+k,$=($-R)*p._pixelsPerMercatorPixel+R;let Y=[B*p.worldSize,$*p.worldSize,0];rr(Y,Y,v),w=gd(w,Y,b)}return rr(w,w,m)}_makeGlobeTileDebugBorderBuffer(s,l,u,p,m,v){let b=new nt,w=new Wo,T=new Ae,k=(L,V,B,$,Y)=>{let re=(B-L)/(Y-1),fe=($-V)/(Y-1),oe=b.length;for(let he=0;he<Y;he++){let ge=L+he*re,me=V+he*fe;b.emplaceBack(ge,me);let Le=this._globePoint(ge,me,l,u,p,m,v);T.emplaceBack(Le[0],Le[1],Le[2]),w.emplaceBack(oe+he)}},R=Ut;k(0,0,R,0,16),k(R,0,R,R,16),k(R,R,0,R,16),k(0,R,0,0,16),this._tileDebugIndexBuffer=s.createIndexBuffer(w),this._tileDebugBuffer=s.createVertexBuffer(b,Ym.members),this._globeTileDebugBorderBuffer=s.createVertexBuffer(T,hM.members),this._tileDebugSegments=ur.simpleSegment(0,0,b.length,w.length)}_makeGlobeTileDebugTextBuffer(s,l,u,p,m,v){let b=Ut/4,w=new nt,T=new Nt,k=new Ae,R=25;T.reserve(32),w.reserve(R),k.reserve(R);let L=(V,B)=>R*V+B;for(let V=0;V<R;V++){let B=V*b;for(let $=0;$<R;$++){let Y=$*b;w.emplaceBack(Y,B);let re=this._globePoint(Y,B,l,u,p,m,v);k.emplaceBack(re[0],re[1],re[2])}}for(let V=0;V<4;V++)for(let B=0;B<4;B++){let $=L(V,B),Y=L(V,B+1),re=L(V+1,B),fe=L(V+1,B+1);T.emplaceBack($,Y,re),T.emplaceBack(re,Y,fe)}this._tileDebugTextIndexBuffer=s.createIndexBuffer(T),this._tileDebugTextBuffer=s.createVertexBuffer(w,Ym.members),this._globeTileDebugTextBuffer=s.createVertexBuffer(k,hM.members),this._tileDebugTextSegments=ur.simpleSegment(0,0,R,32)}}class b4{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(s,l,u){let p=String(l);if(this.stateChanges[s]=this.stateChanges[s]||{},this.stateChanges[s][p]=this.stateChanges[s][p]||{},cn(this.stateChanges[s][p],u),this.deletedStates[s]===null){this.deletedStates[s]={};
8for(let m in this.state[s])m!==p&&(this.deletedStates[s][m]=null)}else if(this.deletedStates[s]&&this.deletedStates[s][p]===null){this.deletedStates[s][p]={};for(let m in this.state[s][p])u[m]||(this.deletedStates[s][p][m]=null)}else for(let m in u)this.deletedStates[s]&&this.deletedStates[s][p]&&this.deletedStates[s][p][m]===null&&delete this.deletedStates[s][p][m]}removeFeatureState(s,l,u){if(this.deletedStates[s]===null)return;let p=String(l);if(this.deletedStates[s]=this.deletedStates[s]||{},u&&l!==void 0)this.deletedStates[s][p]!==null&&(this.deletedStates[s][p]=this.deletedStates[s][p]||{},this.deletedStates[s][p][u]=null);else if(l!==void 0)if(this.stateChanges[s]&&this.stateChanges[s][p])for(u in this.deletedStates[s][p]={},this.stateChanges[s][p])this.deletedStates[s][p][u]=null;else this.deletedStates[s][p]=null;else this.deletedStates[s]=null}getState(s,l){let u=String(l),p=cn({},(this.state[s]||{})[u],(this.stateChanges[s]||{})[u]);if(this.deletedStates[s]===null)return{};if(this.deletedStates[s]){let m=this.deletedStates[s][l];if(m===null)return{};for(let v in m)delete p[v]}return p}initializeTileState(s,l){s.setFeatureState(this.state,l)}coalesceChanges(s,l){let u={};for(let p in this.stateChanges){this.state[p]=this.state[p]||{};let m={};for(let v in this.stateChanges[p])this.state[p][v]||(this.state[p][v]={}),cn(this.state[p][v],this.stateChanges[p][v]),m[v]=this.state[p][v];u[p]=m}for(let p in this.deletedStates){this.state[p]=this.state[p]||{};let m={};if(this.deletedStates[p]===null)for(let v in this.state[p])m[v]={},this.state[p][v]={};else for(let v in this.deletedStates[p]){if(this.deletedStates[p][v]===null)this.state[p][v]={};else if(this.state[p][v])for(let b of Object.keys(this.deletedStates[p][v]))delete this.state[p][v][b];m[v]=this.state[p][v]}u[p]=u[p]||{},cn(u[p],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(u).length!==0)for(let p in s)s[p].setFeatureState(u,l)}}class Kk{constructor(s){this.size=s,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(s,l){let u=this.toIdx(s,l);return{min:this.minimums[u],max:this.maximums[u]}}isLeaf(s,l){return this.leaves[this.toIdx(s,l)]}toIdx(s,l){return l*this.size+s}}function Xk(a,s,l,u){let p=0,m=Number.MAX_VALUE;for(let v=0;v<3;v++)if(Math.abs(u[v])<1e-15){if(l[v]<a[v]||l[v]>s[v])return null}else{let b=1/u[v],w=(a[v]-l[v])*b,T=(s[v]-l[v])*b;if(w>T){let k=w;w=T,T=k}if(w>p&&(p=w),T<m&&(m=T),p>m)return null}return p}function Yk(a,s,l,u,p,m,v,b,w,T,k){let R=u-a,L=p-s,V=m-l,B=v-a,$=b-s,Y=w-l,re=k[1]*Y-k[2]*$,fe=k[2]*B-k[0]*Y,oe=k[0]*$-k[1]*B,he=R*re+L*fe+V*oe;if(Math.abs(he)<1e-15)return null;let ge=1/he,me=T[0]-a,Le=T[1]-s,Pe=T[2]-l,He=(me*re+Le*fe+Pe*oe)*ge;if(He<0||He>1)return null;let rt=Le*V-Pe*L,ze=Pe*R-me*V,Ke=me*L-Le*R,Xe=(k[0]*rt+k[1]*ze+k[2]*Ke)*ge;return Xe<0||He+Xe>1?null:(B*rt+$*ze+Y*Ke)*ge}function Qk(a,s,l){return(a-s)/(l-s)}function Jk(a,s,l,u,p,m,v,b,w){let T=1<<l,k=m-u,R=v-p,L=(a+1)/T*k+u,V=(s+0)/T*R+p,B=(s+1)/T*R+p;b[0]=(a+0)/T*k+u,b[1]=V,w[0]=L,w[1]=B}class e2{constructor(s){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=s,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;let l=function(m){let v=Math.ceil(Math.log2(m.dim/8)),b=[],w=Math.ceil(Math.pow(2,v)),T=1/w,k=(V,B,$,Y,re)=>{let fe=Y?1:0,oe=(V+1)*$-fe,he=B*$,ge=(B+1)*$-fe;re[0]=V*$,re[1]=he,re[2]=oe,re[3]=ge},R=new Kk(w),L=[];for(let V=0;V<w*w;V++){k(V%w,Math.floor(V/w),T,!1,L);let B=Wc(L[0],L[1],m),$=Wc(L[2],L[1],m),Y=Wc(L[2],L[3],m),re=Wc(L[0],L[3],m);R.minimums.push(Math.min(B,$,Y,re)),R.maximums.push(Math.max(B,$,Y,re)),R.leaves.push(1)}for(b.push(R),w/=2;w>=1;w/=2){let V=b[b.length-1];R=new Kk(w);for(let B=0;B<w*w;B++){k(B%w,Math.floor(B/w),2,!0,L);let $=V.getElevation(L[0],L[1]),Y=V.getElevation(L[2],L[1]),re=V.getElevation(L[2],L[3]),fe=V.getElevation(L[0],L[3]),oe=V.isLeaf(L[0],L[1]),he=V.isLeaf(L[2],L[1]),ge=V.isLeaf(L[2],L[3]),me=V.isLeaf(L[0],L[3]),Le=Math.min($.min,Y.min,re.min,fe.min),Pe=Math.max($.max,Y.max,re.max,fe.max),He=oe&&he&&ge&&me;R.maximums.push(Pe),R.minimums.push(Le),R.leaves.push(Pe-Le<=5&&He?1:0)}b.push(R)}return b}(this.dem),u=l.length-1,p=l[u];this._addNode(p.minimums[0],p.maximums[0],p.leaves[0]),this._construct(l,0,0,u,0)}raycastRoot(s,l,u,p,m,v,b=1){return Xk([s,l,-100],[u,p,this.maximums[0]*b],m,v)}raycast(s,l,u,p,m,v,b=1){if(!this.nodeCount)return null;let w=this.raycastRoot(s,l,u,p,m,v,b);if(w==null)return null;let T=[],k=[],R=[],L=[],V=[{idx:0,t:w,nodex:0,nodey:0,depth:0}];for(;V.length>0;){let{idx:B,t:$,nodex:Y,nodey:re,depth:fe}=V.pop();if(this.leaves[B]){Jk(Y,re,fe,s,l,u,p,R,L);let he=1<<fe,ge=(Y+0)/he,me=(Y+1)/he,Le=(re+0)/he,Pe=(re+1)/he,He=Wc(ge,Le,this.dem)*b,rt=Wc(me,Le,this.dem)*b,ze=Wc(me,Pe,this.dem)*b,Ke=Wc(ge,Pe,this.dem)*b,Xe=Yk(R[0],R[1],He,L[0],R[1],rt,L[0],L[1],ze,m,v),et=Yk(L[0],L[1],ze,R[0],L[1],Ke,R[0],R[1],He,m,v),dt=Math.min(Xe!==null?Xe:Number.MAX_VALUE,et!==null?et:Number.MAX_VALUE);if(dt!==Number.MAX_VALUE)return dt;{let Be=Km([],m,v,$);if(t2(He,rt,Ke,ze,Qk(Be[0],R[0],L[0]),Qk(Be[1],R[1],L[1]))>=Be[2])return $}continue}let oe=0;for(let he=0;he<this._siblingOffset.length;he++){Jk((Y<<1)+this._siblingOffset[he][0],(re<<1)+this._siblingOffset[he][1],fe+1,s,l,u,p,R,L),R[2]=-100,L[2]=this.maximums[this.childOffsets[B]+he]*b;let ge=Xk(R,L,m,v);if(ge!=null){let me=ge;T[he]=me;let Le=!1;for(let Pe=0;Pe<oe&&!Le;Pe++)me>=T[k[Pe]]&&(k.splice(Pe,0,he),Le=!0);Le||(k[oe]=he),oe++}}for(let he=0;he<oe;he++){let ge=k[he];V.push({idx:this.childOffsets[B]+ge,t:T[ge],nodex:(Y<<1)+this._siblingOffset[ge][0],nodey:(re<<1)+this._siblingOffset[ge][1],depth:fe+1})}}return null}_addNode(s,l,u){return this.minimums.push(s),this.maximums.push(l),this.leaves.push(u),this.childOffsets.push(0),this.nodeCount++}_construct(s,l,u,p,m){if(s[p].isLeaf(l,u)===1)return;this.childOffsets[m]||(this.childOffsets[m]=this.nodeCount);let v=p-1,b=s[v],w=0,T=0;for(let k=0;k<this._siblingOffset.length;k++){let R=2*l+this._siblingOffset[k][0],L=2*u+this._siblingOffset[k][1],V=b.getElevation(R,L),B=b.isLeaf(R,L),$=this._addNode(V.min,V.max,B);B&&(w|=1<<k),T||(T=$)}for(let k=0;k<this._siblingOffset.length;k++)w&1<<k||this._construct(s,2*l+this._siblingOffset[k][0],2*u+this._siblingOffset[k][1],v,T+k)}}function t2(a,s,l,u,p,m){return Wi(Wi(a,l,m),Wi(s,u,m),p)}function Wc(a,s,l){let u=l.dim,p=pt(a*u-.5,0,u-1),m=pt(s*u-.5,0,u-1),v=Math.floor(p),b=Math.floor(m),w=Math.min(v+1,u-1),T=Math.min(b+1,u-1);return t2(l.get(v,b),l.get(w,b),l.get(v,T),l.get(w,T),p-v,m-b)}let i2={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function x4(a,s,l){return(256*a*256+256*s+l)/10-1e4}function w4(a,s,l){return 256*a+s+l/256-32768}class Hv{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(s,l,u,p=!1,m=!1){if(this.uid=s,l.height!==l.width)throw new RangeError("DEM tiles must be square");if(u&&u!=="mapbox"&&u!=="terrarium")return Un(`"${u}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=l.height;
8let v=this.dim=l.height-2,b=new Uint32Array(l.data.buffer);if(this.pixels=new Uint8Array(l.data.buffer),this.encoding=u||"mapbox",this.borderReady=p,!p){for(let w=0;w<v;w++)b[this._idx(-1,w)]=b[this._idx(0,w)],b[this._idx(v,w)]=b[this._idx(v-1,w)],b[this._idx(w,-1)]=b[this._idx(w,0)],b[this._idx(w,v)]=b[this._idx(w,v-1)];b[this._idx(-1,-1)]=b[this._idx(0,0)],b[this._idx(v,-1)]=b[this._idx(v-1,0)],b[this._idx(-1,v)]=b[this._idx(0,v-1)],b[this._idx(v,v)]=b[this._idx(v-1,v-1)],m&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new e2(this)}get(s,l,u=!1){u&&(s=pt(s,-1,this.dim),l=pt(l,-1,this.dim));let p=4*this._idx(s,l);return(this.encoding==="terrarium"?w4:x4)(this.pixels[p],this.pixels[p+1],this.pixels[p+2])}static getUnpackVector(s){return i2[s]}get unpackVector(){return i2[this.encoding]}_idx(s,l){if(s<-1||s>=this.dim+1||l<-1||l>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(l+1)*this.stride+(s+1)}static pack(s,l){let u=[0,0,0,0],p=Hv.getUnpackVector(l),m=Math.floor((s+p[3])/p[2]);return u[2]=m%256,m=Math.floor(m/256),u[1]=m%256,m=Math.floor(m/256),u[0]=m,u}getPixels(){return new Ko({width:this.stride,height:this.stride},this.pixels)}backfillBorder(s,l,u){if(this.dim!==s.dim)throw new Error("dem dimension mismatch");let p=l*this.dim,m=l*this.dim+this.dim,v=u*this.dim,b=u*this.dim+this.dim;switch(l){case-1:p=m-1;break;case 1:m=p+1}switch(u){case-1:v=b-1;break;case 1:b=v+1}let w=-l*this.dim,T=-u*this.dim;for(let k=v;k<b;k++)for(let R=p;R<m;R++){let L=4*this._idx(R,k),V=4*this._idx(R+w,k+T);this.pixels[L+0]=s.pixels[V+0],this.pixels[L+1]=s.pixels[V+1],this.pixels[L+2]=s.pixels[V+2],this.pixels[L+3]=s.pixels[
8V+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}Pt(Hv,"DEMData"),Pt(e2,"DemMinMaxQuadTree",{omit:["dem"]});class C4{constructor(s,l){this.max=s,this.onRemove=l,this.reset()}reset(){for(let s in this.data)for(let l of this.data[s])l.timeout&&clearTimeout(l.timeout),this.onRemove(l.value);return this.data={},this.order=[],this}add(s,l,u){let p=s.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);let m={value:l,timeout:void 0};if(u!==void 0&&(m.timeout=setTimeout(()=>{this.remove(s,m)},u)),this.data[p].push(m),this.order.push(p),this.order.length>this.max){let v=this._getAndRemoveByKey(this.order[0]);v&&this.onRemove(v)}return this}has(s){return s.wrapped().key in this.data}getAndRemove(s){return this.has(s)?this._getAndRemoveByKey(s.wrapped().key):null}_getAndRemoveByKey(s){let l=this.data[s].shift();return l.timeout&&clearTimeout(l.timeout),this.data[s].length===0&&delete this.data[s],this.order.splice(this.order.indexOf(s),1),l.value}getByKey(s){let l=this.data[s];return l?l[0].value:null}get(s){return this.has(s)?this.data[s.wrapped().key][0].value:null}remove(s,l){if(!this.has(s))return this;let u=s.wrapped().key,p=l===void 0?0:this.data[u].indexOf(l),m=this.data[u][p];return this.data[u].splice(p,1),m.timeout&&clearTimeout(m.timeout),this.data[u].length===0&&delete this.data[u],this.onRemove(m.value),this.order.splice(this.order.indexOf(u),1),this}setMaxSize(s){for(this.max=s;this.order.length>this.max;){let l=this._getAndRemoveByKey(this.order[0]);l&&this.onRemove(l)}return this}filter(s){let l=[];for(let u in this.data)for(let p of this.data[u])s(p.value)||l.push(p);for(let u of l)this.remove(u.value.tileID,u)}}class cp{constructor(s,l,u){this.func=s,this.mask=l,this.range=u}}cp.ReadOnly=!1,cp.ReadWrite=!0,cp.disabled=new cp(519,cp.ReadOnly,[0,1]);let Jw=7680;class eC{constructor(s,l,u,p,m,v){this.test=s,this.ref=l,this.mask=u,this.fail=p,this.depthFail=m,this.pass=v}}eC.disabled=new eC({func:519,mask:0},0,0,Jw,Jw,Jw);class Ka{constructor(s,l,u){this.blendFunction=s,this.blendColor=l,this.mask=u}}Ka.Replace=[1,0],Ka.disabled=new Ka(Ka.Replace,nr.transparent,[!1,!1,!1,!1]),Ka.unblended=new Ka(Ka.Replace,nr.transparent,[!0,!0,!0,!0]),Ka.alphaBlended=new Ka([1,771],nr.transparent,[!0,!0,!0,!0]);let tC=1029,iC=2305;class Ca{constructor(s,l,u){this.enable=s,this.mode=l,this.frontFace=u}}Ca.disabled=new Ca(!1,tC,iC),Ca.backCCW=new Ca(!0,tC,iC),Ca.backCW=new Ca(!0,tC,2304),Ca.frontCW=new Ca(!0,1028,2304),Ca.frontCCW=new Ca(!0,1028,iC);class xd extends zu{constructor(s,l,u){super(),this.id=s,this._onlySymbols=u,l.on("data",p=>{p.dataType==="source"&&p.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&p.dataType==="source"&&p.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),l.on("error",()=>{this._sourceErrored=!0}),this._source=l,this._tiles={},this._cache=new C4(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=l.minTileCacheSize,this._maxTileCacheSize=l.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new b4,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(s){this.map=s,this._minTileCacheSize=this._minTileCacheSize===void 0&&s?s._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&s?s._maxTileC
8acheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(let s in this._tiles){let l=this._tiles[s];if(l.state!=="loaded"&&l.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let s=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,s&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(s,l){return s.isSymbolTile=this._onlySymbols,this._source.loadTile(s,l)}_unloadTile(s){if(this._source.unloadTile)return this._source.unloadTile(s,()=>{})}_abortTile(s){if(this._source.abortTile)return this._source.abortTile(s,()=>{})}serialize(){return this._source.serialize()}prepare(s){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let l in this._tiles){let u=this._tiles[l];u.upload(s),u.prepare(this.map.style.imageManager)}}getIds(){return Pn(this._tiles).map(s=>s.tileID).sort(n2).map(s=>s.key)}getRenderableIds(s){let l=[];for(let u in this._tiles)this._isIdRenderable(+u,s)&&l.push(this._tiles[u]);return s?l.sort((u,p)=>{let m=u.tileID,v=p.tileID,b=new tt(m.canonical.x,m.canonical.y)._rotate(this.transform.angle),w=new tt(v.canonical.x,v.canonical.y)._rotate(this.transform.angle);return m.overscaledZ-v.overscaledZ||w.y-b.y||w.x-b.x}).map(u=>u.tileID.key):l.map(u=>u.tileID).sort(n2).map(u=>u.key)}hasRenderableParent(s){let l=this.findLoadedParent(s,0);return!!l&&this._isIdRenderable(l.tileID.key)}_isIdRenderable(s,l){return this._tiles[s]&&this._tiles[s].hasData()&&!this._coveredTiles[s]&&(l||!this._tiles[s].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let s in this._tiles)this._tiles[s].state!=="errored"&&this._reloadTile(+s,"reloading")}}_reloadTile(s,l){let u=this._tiles[s];u&&(u.state!=="loading"&&(u.state=l),this._loadTile(u,this._tileLoaded.bind(this,u,s,l)))}_tileLoaded(s,l,u,p){if(p)if(s.state="errored",p.status!==404)this._source.fire(new sa(p,{tile:s}));else if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){let m=this.map.painter.terrain;this.update(this.transform,m.getScaledDemTileSize(),!0),m.resetTileLookupCache(this.id)}else this.update(this.transform);else s.timeAdded=oa.now(),u==="expired"&&(s.refreshedUponExpiration=!0),this._setTileReloadTimer(l,s),this._source.type==="raster-dem"&&s.dem&&this._backfillDEM(s),this._state.initializeTileState(s,this.map?this.map.painter:null),this._source.fire(new Al("data",{dataType:"source",tile:s,coord:s.tileID,sourceCacheId:this.id}))}_backfillDEM(s){let l=this.getRenderableIds();for(let p=0;p<l.length;p++){let m=l[p];if(s.neighboringTiles&&s.neighboringTiles[m]){let v=this.getTileByID(m);u(s,v),u(v,s)}}function u(p,m){if(!p.dem||p.dem.borderReady)return;p.needsHillshadePrepare=!0,p.needsDEMTextureUpload=!0;let v=m.tileID.canonical.x-p.tileID.canonical.x,b=m.tileID.canonical.y-p.tileID.canonical.y,w=Math.pow(2,p.tileID.canonical.z),T=m.tileID.key;v===0&&b===0||Math.abs(b)>1||(Math.abs(v)>1&&(Math.abs(v+w)===1?v+=w:Math.abs(v-w)===1&&(v-=w)),m.dem&&p.dem&&(p.dem.backfillBorder(m.dem,v,b),p.neighboringTiles&&p.neighboringTiles[T]&&(p.neighboringTiles[T].backfilled=!0)))}}getTile(s){return this.getTileByID(s.key)}getTileByID(s){return this._tiles[s]}_retainLoadedChildren(s,l,u,p){for(let m in this._tiles){let v=this._tiles[m];if(p[m]||!v.hasData()||v.tileID.overscaledZ<=l||v.tileID.overscaledZ>u)continue;let b=v.tileID;for(;v&&v.tileID.overscaledZ>l+1;){let T=v.tileID.scaledTo(v.tileID.overscaledZ-1);v=this._tiles[T.key],v&&v.hasData()&&(b=T)}let w=b;for(;w.overscaledZ>l;)if(w=w.scaledTo(w.overscaledZ-1),s[w.key]){p[b.key]=b;break}}}findLoadedParent(s,l){if(s.key in this._loadedParentTiles){let u=this._loadedParentTiles[s.key];return u&&u.tileID.overscaledZ>=l?u:null}for(let u=s.overscaledZ-1;u>=l;u--){let p=s.scaledTo(u),m=this._getLoadedTile(p);if(m)return m}}_getLoadedTile(s){let l=this._tiles[s.key];return l&&l.hasData()?l:this._cache.getByKey(this._source.reparseOverscaled?s.wrapped().key:s.canonical.key)}updateCacheSize(s,l){l=l||this._source.tileSize;let u=Math.ceil(s.width/l)+1,p=Math.ceil(s.height/l)+1,m=Math.floor(u*p*5),v=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,m):m,b=typeof this._maxTileC
8acheSize=="number"?Math.min(this._maxTileCacheSize,v):v;this._cache.setMaxSize(b)}handleWrapJump(s){let l=Math.round((s-(this._prevLng===void 0?s:this._prevLng))/360);if(this._prevLng=s,l){let u={};for(let p in this._tiles){let m=this._tiles[p];m.tileID=m.tileID.unwrapTo(m.tileID.wrap+l),u[m.tileID.key]=m}this._tiles=u;for(let p in this._timers)clearTimeout(this._timers[p]),delete this._timers[p];for(let p in this._tiles)this._setTileReloadTimer(+p,this._tiles[p])}}update(s,l,u){if(this.transform=s,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!u)return;let p;this.updateCacheSize(s,l),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?p=s.getVisibleUnwrappedCoordinates(this._source.tileID).map(b=>new bo(b.canonical.z,b.wrap,b.canonical.z,b.canonical.x,b.canonical.y)):(p=s.coveringTiles({tileSize:l||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!u,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(p=p.filter(b=>this._source.hasTile(b)))):p=[];let m=this._updateRetainedTiles(p);if(r2(this._source.type)&&p.length!==0){let b={},w={},T=Object.keys(m);for(let R of T){let L=m[R],V=this._tiles[R];if(!V||V.fadeEndTime&&V.fadeEndTime<=oa.now())continue;let B=this.findLoadedParent(L,Math.max(L.overscaledZ-xd.maxOverzooming,this._source.minzoom));B&&(this._addTile(B.tileID),b[B.tileID.key]=B.tileID),w[R]=L}let k=p[p.length-1].overscaledZ;for(let R in this._tiles){let L=this._tiles[R];if(m[R]||!L.hasData())continue;let V=L.tileID;for(;V.overscaledZ>k;){V=V.scaledTo(V.overscaledZ-1);let B=this._tiles[V.key];if(B&&B.hasData()&&w[V.key]){m[R]=L.tileID;break}}}for(let R in b)m[R]||(this._coveredTiles[R]=!0,m[R]=b[R])}for(let b in m)this._tiles[b].clearFadeHold();let v=function(b,w){let T=[];for(let k in b)k in w||T.push(k);return T}(this._tiles,m);for(let b of v){let w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(+b)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(let s in this._tiles)this._tiles[s].holdingForFade()&&this._removeTile(+s)}_updateRetainedTiles(s){let l={};if(s.length===0)return l;let u={},p=s.reduce((T,k)=>Math.min(T,k.overscaledZ),1/0),m=s[0].overscaledZ,v=Math.max(m-xd.maxOverzooming,this._source.minzoom),b=Math.max(m+xd.maxUnderzooming,this._source.minzoom),w={};for(let T of s){let k=this._addTile(T);l[T.key]=T,k.hasData()||p<this._source.maxzoom&&(w[T.key]=T)}this._retainLoadedChildren(w,p,b,l);for(let T of s){let k=this._tiles[T.key];if(k.hasData())continue;if(T.canonical.z>=this._source.maxzoom){let L=T.children(this._source.maxzoom)[0],V=this.getTile(L);if(V&&V.hasData()){l[L.key]=L;continue}}else{let L=T.children(this._source.maxzoom);if(l[L[0].key]&&l[L[1].key]&&l[L[2].key]&&l[L[3].key])continue}let R=k.wasRequested();for(let L=T.overscaledZ-1;L>=v;--L){let V=T.scaledTo(L);if(u[V.key]||(u[V.key]=!0,k=this.getTile(V),!k&&R&&(k=this._addTile(V)),k&&(l[V.key]=V,R=k.wasRequested(),k.hasData())))break}}return l}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let s in this._tiles){let l=[],u,p=this._tiles[s].tileID;for(;p.overscaledZ>0;){if(p.key in this._loadedParentTiles){u=this._loadedParentTiles[p.key];break}l.push(p.key);let m=p.scaledTo(p.overscaledZ-1);if(u=this._getLoadedTile(m),u)break;p=m}for(let m of l)this._loadedParentTiles[m]=u}}_addTile(s){let l=this._tiles[s.key];if(l)return l;l=this._cache.getAndRemove(s),l&&(this._setTileReloadTimer(s.key,l),l.tileID=s,this._state.initializeTileState(l,this.map?this.map.painter:null),this._cacheTimers[s.key]&&(clearTimeout(this._cacheTimers[s.key]),delete this._cacheTimers[s.key],this._setTileReloadTimer(s.key,l)));let u=!!l;if(!u){let p=this.map?this.map.painter:null;l=new Qw(s,this._source.tileSize*s.overscaleFactor(),this.transform.tileZoom,p,this._isRaster),this._loadTile(l,this._tileLoaded.bind(this,l,s.key,l.state))}return l?(l.uses++,this._tiles[s.key]=l,u||this._source.fire(new Al("dataloading",{tile:l,coord:l.tileID,dataType:"source"})),l):null}_setTileReloadTimer(s,l){s in this._timers&&(clearTimeout(this._timers[s]),delete this._timers[s]);let u=l.getExpiryTimeout();u&&(this._timers[s]=setTimeout(()=>{this._reloadTile(s,"expired"),delete this._timers[s]},u))}_removeTile(s){let l=this._tiles[s];l&&(l.uses--,delete this._tiles[s],this._timers[s]&&(clearTimeout(this._timers[s]),delete this._timers[s]),l.uses>0||(l.hasData()&&l.state!=="reloading"?this._cache.add(l.tileID,l,l.getExpiryTimeout()):(l.aborted=!0,this._abortTile(l),this._unloadTile(l))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let s in this._tiles)this._removeTile(+s);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id
8)}tilesIn(s,l,u){let p=[],m=this.transform;if(!m)return p;let v=m.projection.name==="globe",b=Ga(m.center.lng);for(let w in this._tiles){let T=this._tiles[w];if(u&&T.clearQueryDebugViz(),T.holdingForFade())continue;let k;if(v){let R=T.tileID.canonical;if(R.z===0){let L=[Math.abs(pt(b,...bg(R,-1))-b),Math.abs(pt(b,...bg(R,1))-b)];k=[0,2*L.indexOf(Math.min(...L))-1]}else{let L=[Math.abs(pt(b,...bg(R,-1))-b),Math.abs(pt(b,...bg(R,0))-b),Math.abs(pt(b,...bg(R,1))-b)];k=[L.indexOf(Math.min(...L))-1]}}else k=[0];for(let R of k){let L=s.containsTile(T,m,l,R);L&&p.push(L)}}return p}getVisibleCoordinates(s){let l=this.getRenderableIds(s).map(u=>this._tiles[u].tileID);for(let u of l)u.projMatrix=this.transform.calculateProjMatrix(u.toUnwrapped());return l}hasTransition(){if(this._source.hasTransition())return!0;if(r2(this._source.type))for(let s in this._tiles){let l=this._tiles[s];if(l.fadeEndTime!==void 0&&l.fadeEndTime>=oa.now())return!0}return!1}setFeatureState(s,l,u){this._state.updateState(s=s||"_geojsonTileLayer",l,u)}removeFeatureState(s,l,u){this._state.removeFeatureState(s=s||"_geojsonTileLayer",l,u)}getFeatureState(s,l){return this._state.getState(s=s||"_geojsonTileLayer",l)}setDependencies(s,l,u){let p=this._tiles[s];p&&p.setDependencies(l,u)}reloadTilesForDependencies(s,l){for(let u in this._tiles)this._tiles[u].hasDependency(s,l)&&this._reloadTile(+u,"reloading");this._cache.filter(u=>!u.hasDependency(s,l))}_preloadTiles(s,l){if(!this._sourceLoaded){let b=()=>{this._sourceLoaded&&(this._source.off("data",b),this._preloadTiles(s,l))};return void this._source.on("data",b)}let u=new Map,p=Array.isArray(s)?s:[s],m=this.map.painter.terrain,v=this.usedForTerrain&&m?m.getScaledDemTileSize():this._source.tileSize;for(let b of p){let w=b.coveringTiles({tileSize:v,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(let T of w)u.set(T.key,T);this.usedForTerrain&&b.updateElevation(!1)}ri(Array.from(u.values()),(b,w)=>{let T=new Qw(b,this._source.tileSize*b.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(T,k=>{this._source.type==="raster-dem"&&T.dem&&this._backfillDEM(T),w(k,T)})},l)}}function n2(a,s){let l=Math.abs(2*a.wrap)-+(a.wrap<0),u=Math.abs(2*s.wrap)-+(s.wrap<0);return a.overscaledZ-s.overscaledZ||u-l||s.canonical.y-a.canonical.y||s.canonical.x-a.canonical.x}function r2(a){return a==="raster"||a==="image"||a==="video"||a==="custom"}function bg(a,s){let l=1<<a.z;return[a.x/l+s,(a.x+1)/l+s]}xd.maxOverzooming=10,xd.maxUnderzooming=3;class $v{constructor(s,l,u){this._demTile=s,this._dem=this._demTile.dem,this._scale=l,this._offset=u}static create(s,l,u){let p=u||s.findDEMTileFor(l);if(!p||!p.dem)return;let m=p.dem,v=p.tileID,b=1<<l.canonical.z-v.canonical.z;return new $v(p,p.tileSize/Ut/b,[(l.canonical.x/b-v.canonical.x)*m.dim,(l.canonical.y/b-v.canonical.y)*m.dim])}tileCoordToPixel(s,l){let u=l*this._scale+this._offset[1],p=Math.floor(s*this._scale+this._offset[0]),m=Math.floor(u);return new tt(p,m)}getElevationAt(s,l,u,p){let m=s*this._scale+this._offset[0],v=l*this._scale+this._offset[1],b=Math.floor(m),w=Math.floor(v),T=this._dem;return p=!!p,u?Wi(Wi(T.get(b,w,p),T.get(b,w+1,p),v-w),Wi(T.get(b+1,w,p),T.get(b+1,w+1,p),v-w),m-b):T.get(b,w,p)}getElevationAtPixel(s,l,u){return this._dem.get(s,l,!!u)}getMeterToDEM(s){return(1<<this._demTile.tileID.canonical.z)*ba(1,s)*this._dem.stride}}class o2{constructor(s,l){this.tileID=s,this.x=s.canonical.x,this.y=s.canonical.y,this.z=s.canonical.z,this.grid=new zl(Ut,16,0),this.featureIndexArray=new cd,this.promoteId=l}insert(s,l,u,p,m,v=0){let b=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(u,p,m,v);let w=this.grid;for(let T=0;T<l.length;T++){let k=l[T],R=[1/0,1/0,-1/0,-1/0];for(let L=0;L<k.length;L++){let V=k[L];R[0]=Math.min(R[0],V.x),R[1]=Math.min(R[1],V.y),R[2]=Math.max(R[2],V.x),R[3]=Math.max(R[3],V.y)}R[0]<Ut&&R[1]<Ut&&R[2]>=0&&R[3]>=0&&w.insert(b,R[0],R[1],R[2],R[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Fw(new kv(this.rawTileData)).layers,this.sourceLayerCoder=new $k(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(let s in this.vtLayers)this.vtFeatures[s]=[]}return this.vtLayers}query(s,l,u,p){this.loadVTLayers();let m=s.params||{},v=zh(m.filter),b=s.tileResult,w=s.transform,T=b.bufferedTilespaceBounds,k=this.grid.query(T.min.x,T.min.y,T.max.x,T.max.y,(B,$,Y,re)=>kM(b.bufferedTilespaceGeometry,B,$,Y,re));k.sort(E4);let R=null;w.elevation&&k.length>0&&(R=$v.create(w.elevation,this.tileID));let L={},V;for(let B=0;B<k.length;B++){let $=k[B];if($===V)continue;V=$;let Y=this.featureIndexArray.get($),re=null;
8this.loadMatchingFeature(L,Y,v,m.layers,m.availableImages,l,u,p,(fe,oe,he,ge=0)=>(re||(re=Gl(fe,this.tileID.canonical,s.tileTransform)),oe.queryIntersectsFeature(b,fe,he,re,this.z,s.transform,s.pixelPosMatrix,R,ge)))}return L}loadMatchingFeature(s,l,u,p,m,v,b,w,T){let{featureIndex:k,bucketIndex:R,sourceLayerIndex:L,layoutVertexArrayOffset:V}=l,B=this.bucketLayerIDs[R];if(p&&!function(fe,oe){for(let he=0;he<fe.length;he++)if(oe.indexOf(fe[he])>=0)return!0;return!1}(p,B))return;let $=this.sourceLayerCoder.decode(L),Y=this.vtLayers[$].feature(k);if(u.needGeometry){let fe=_d(Y,!0);if(!u.filter(new O(this.tileID.overscaledZ),fe,this.tileID.canonical))return}else if(!u.filter(new O(this.tileID.overscaledZ),Y))return;let re=this.getId(Y,$);for(let fe=0;fe<B.length;fe++){let oe=B[fe];if(p&&p.indexOf(oe)<0)continue;let he=v[oe];if(!he)continue;let ge={};re!==void 0&&w&&(ge=w.getState(he.sourceLayer||"_geojsonTileLayer",re));let me=cn({},b[oe]);me.paint=s2(me.paint,he.paint,Y,ge,m),me.layout=s2(me.layout,he.layout,Y,ge,m);let Le=!T||T(Y,he,ge,V);if(!Le)continue;let Pe=new Gk(Y,this.z,this.x,this.y,re);Pe.layer=me;let He=s[oe];He===void 0&&(He=s[oe]=[]),He.push({featureIndex:k,feature:Pe,intersectionZ:Le})}}lookupSymbolFeatures(s,l,u,p,m,v,b,w){let T={};this.loadVTLayers();let k=zh(m);for(let R of s)this.loadMatchingFeature(T,{bucketIndex:u,sourceLayerIndex:p,featureIndex:R,layoutVertexArrayOffset:0},k,v,b,w,l);return T}loadFeature(s){let{featureIndex:l,sourceLayerIndex:u}=s;this.loadVTLayers();let p=this.sourceLayerCoder.decode(u),m=this.vtFeatures[p];if(m[l])return m[l];let v=this.vtLayers[p].feature(l);return m[l]=v,v}hasLayer(s){for(let l of this.bucketLayerIDs)for(let u of l)if(s===u)return!0;return!1}getId(s,l){let u=s.id;if(this.promoteId){let p=typeof this.promoteId=="string"?this.promoteId:this.promoteId[l];p!=null&&(u=s.properties[p]),typeof u=="boolean"&&(u=Number(u))}return u}}function s2(a,s,l,u,p){return ii(a,(m,v)=>{let b=s instanceof ne?s.get(v):null;return b&&b.evaluate?b.evaluate(l,u,p):b})}function E4(a,s){return s-a}Pt(o2,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class a2{constructor(s,l){this.width=s,this.height=l,this.nextRow=0,this.image=new ql({width:s,height:l}),this.positions={},this.uploaded=!1}getDash(s,l){let u=this.getKey(s,l);return this.positions[u]}trim(){let s=this.width,l=this.height=Vo(this.nextRow);this.image.resize({width:s,height:l})}getKey(s,l){return s.join(",")+l}getDashRanges(s,l,u){let p=[],m=s.length%2==1?-s[s.length-1]*u:0,v=s[0]*u,b=!0;p.push({left:m,right:v,isDash:b,zeroLength:s[0]===0});let w=s[0];for(let T=1;T<s.length;T++){b=!b;let k=s[T];m=w*u,w+=k,v=w*u,p.push({left:m,right:v,isDash:b,zeroLength:k===0})}return p}addRoundDash(s,l,u){let p=l/2;for(let m=-u;m<=u;m++){let v=this.width*(this.nextRow+u+m),b=0,w=s[b];for(let T=0;T<this.width;T++){T/w.right>1&&(w=s[++b]);let k=Math.abs(T-w.left),R=Math.abs(T-w.right),L=Math.min(k,R),V,B=m/u*(p+1);if(w.isDash){let $=p-Math.abs(B);V=Math.sqrt(L*L+$*$)}else V=p-Math.sqrt(L*L+B*B);this.image.data[v+T]=Math.max(0,Math.min(255,V+128))}}}addRegularDash(s,l){for(let w=s.length-1;w>=0;--w){let T=s[w],k=s[w+1];T.zeroLength?s.splice(w,1):k&&k.isDash===T.isDash&&(k.left=T.left,s.splice(w,1))}let u=s[0],p=s[s.length-1];u.isDash===p.isDash&&(u.left=p.left-this.width,p.right=u.right+this.width);let m=this.width*this.nextRow,v=0,b=s[v];for(let w=0;w<this.width;w++){w/b.right>1&&(b=s[++v]);let T=Math.abs(w-b.left),k=Math.abs(w-b.right),R=Math.min(T,k);this.image.data[m+w]=Math.max(0,Math.min(255,(b.isDash?R:-R)+l+128))}}
8addDash(s,l){let u=this.getKey(s,l);if(this.positions[u])return this.positions[u];let p=l==="round",m=p?7:0,v=2*m+1;if(this.nextRow+v>this.height)return Un("LineAtlas out of space"),null;s.length===0&&s.push(1);let b=0;for(let k=0;k<s.length;k++)s[k]<0&&(Un("Negative value is found in line dasharray, replacing values with 0"),s[k]=0),b+=s[k];if(b!==0){let k=this.width/b,R=this.getDashRanges(s,this.width,k);p?this.addRoundDash(R,k,m):this.addRegularDash(R,l==="square"?.5*k:0)}let w=this.nextRow+m;this.nextRow+=v;let T={tl:[w,m],br:[b,0]};return this.positions[u]=T,T}}Pt(a2,"LineAtlas");let l2=1*wa;class c2{constructor(s){let l={},u=[];for(let b in s){let w=s[b],T=l[b]={};for(let k in w.glyphs){let R=w.glyphs[+k];if(!R||R.bitmap.width===0||R.bitmap.height===0)continue;let L=R.metrics.localGlyph?l2:1,V={x:0,y:0,w:R.bitmap.width+2*L,h:R.bitmap.height+2*L};u.push(V),T[k]=V}}let{w:p,h:m}=Vw(u),v=new ql({width:p||1,height:m||1});for(let b in s){let w=s[b];for(let T in w.glyphs){let k=w.glyphs[+T];if(!k||k.bitmap.width===0||k.bitmap.height===0)continue;let R=l[b][T],L=k.metrics.localGlyph?l2:1;ql.copy(k.bitmap,v,{x:0,y:0},{x:R.x+L,y:R.y+L},k.bitmap)}}this.image=v,this.positions=l}}Pt(c2,"GlyphAtlas");class S4{constructor(s){this.tileID=new bo(s.tileID.overscaledZ,s.tileID.wrap,s.tileID.canonical.z,s.tileID.canonical.x,s.tileID.canonical.y),this.tileZoom=s.tileZoom,this.uid=s.uid,this.zoom=s.zoom,this.canonical=s.tileID.canonical,this.pixelRatio=s.pixelRatio,this.tileSize=s.tileSize,this.source=s.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=s.showCollisionBoxes,this.collectResourceTiming=!!s.collectResourceTiming,this.returnDependencies=!!s.returnDependencies,this.promoteId=s.promoteId,this.enableTerrain=!!s.enableTerrain,this.isSymbolTile=s.isSymbolTile,this.tileTransform=bd(s.tileID.canonical,s.projection),this.projection=s.projection}parse(s,l,u,p,m){this.status="parsing",this.data=s,this.collisionBoxArray=new yn;let v=new $k(Object.keys(s.layers).sort()),b=new o2(this.tileID,this.promoteId);b.bucketLayerIDs=[];let w={},T=new a2(256,256),k={featureIndex:b,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:T,availableImages:u},R=l.familiesBySource[this.source];for(let ge in R){let me=s.layers[ge];if(!me)continue;let Le=!1,Pe=!1;for(let ze of R[ge])ze[0].type==="symbol"?Le=!0:Pe=!0;if(this.isSymbolTile===!0&&!Le||this.isSymbolTile===!1&&!Pe)continue;me.version===1&&Un(`Vector tile source "${this.source}" layer "${ge}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let He=v.encode(ge),rt=[];for(let ze=0;ze<me.length;ze++){let Ke=me.feature(ze),Xe=b.getId(Ke,ge);rt.push({feature:Ke,id:Xe,index:ze,sourceLayerIndex:He})}for(let ze of R[ge]){let Ke=ze[0];this.isSymbolTile!==void 0&&Ke.type==="symbol"!==this.isSymbolTile||Ke.minzoom&&this.zoom<Math.floor(Ke.minzoom)||Ke.maxzoom&&this.zoom>=Ke.maxzoom||Ke.visibility!=="none"&&(nC(ze,this.zoom,u),(w[Ke.id]=Ke.createBucket({index:b.bucketLayerIDs.length,layers:ze,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:He,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:u})).populate(rt,k,this.tileID.canonical,this.tileTransform),b.bucketLayerIDs.push(ze.map(Xe=>Xe.id)))}}let L,V,B,$;T.trim();let Y={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},re=()=>{if(L)return m(L);if(V&&B&&$){let ge=new c2(V),me=new gk(B,$);for(let Le in w){let Pe=w[Le];Pe instanceof $c?(nC(Pe.layers,this.zoom,u),YV(Pe,V,ge.positions,B,me.iconPositions,this.showCollisionBoxes,u,this.tileID.canonical,this.tileZoom,this.projection)):Pe.hasPattern&&(Pe instanceof Iv||Pe instanceof wv||Pe instanceof lg)&&(nC(Pe.layers,this.zoom,u),Pe.addFeatures(k,this.tileID.canonical,me.patternPositions,u,this.tileTransform))}this.status="done",m(null,{buckets:Pn(w).filter(Le=>!Le.isEmpty()),featureIndex:b,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ge.image,lineAtlas:T,imageAtlas:me,glyphMap:this.returnDependencies?V:null,iconMap:this.returnDependencies?B:null,glyphPositions:this.returnDependencies?ge.positions:null})}},fe=ii(k.glyphDependencies,ge=>Object.keys(ge).map(Number));Object.keys(fe).length?p.send("getGlyphs",{uid:this.uid,stacks:fe},(ge,me)=>{L||(L=ge,V=me,re())},void 0,!1,Y):V={};let oe=Object.keys(k.iconDependencies);oe.length?p.send("getImages",{icons:oe,source:this.source,tileID:this.tileID,type:"icons"},(ge,me)=>{L||(L=ge,B=me,re())},void 0,!1,Y):B={};let he=Object.keys(k.patternDependencies);he.length?p.send("getImages",{icons:he,source:this.source,tileID:this.tileID,type:"patterns"},(ge,me)=>{L||(L=ge,$=me,re())},void 0,!1,Y):$={},re()}}function nC(a,s,l){let u=new O(s);for(let p of a)p.recalculate(u,l)}class u2{constructor(s){this.entries={}
8,this.scheduler=s}request(s,l,u,p){let m=this.entries[s]=this.entries[s]||{callbacks:[]};if(m.result){let[v,b]=m.result;return this.scheduler?this.scheduler.add(()=>{p(v,b)},l):p(v,b),()=>{}}return m.callbacks.push(p),m.cancel||(m.cancel=u((v,b)=>{m.result=[v,b];for(let w of m.callbacks)this.scheduler?this.scheduler.add(()=>{w(v,b)},l):w(v,b);setTimeout(()=>delete this.entries[s],3e3)})),()=>{m.result||(m.callbacks=m.callbacks.filter(v=>v!==p),m.callbacks.length||(m.cancel(),delete this.entries[s]))}}}function d2(a,s,l){let u=JSON.stringify(a.request);return a.data&&(this.deduped.entries[u]={result:[null,a.data]}),this.deduped.request(u,{type:"parseTile",isSymbolTile:a.isSymbolTile,zoom:a.tileZoom},p=>{let m=vc(a.request,(v,b,w,T)=>{v?p(v):b&&p(null,{vectorTile:l?void 0:new Fw(new kv(b)),rawData:b,cacheControl:w,expires:T})});return()=>{m.cancel(),p()}},s)}let h2=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class rC{static from(s){if(!(s instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[l,u]=new Uint8Array(s,0,2);if(l!==219)throw new Error("Data does not appear to be in a KDBush format.");let p=u>>4;if(p!==1)throw new Error(`Got v${p} data when expected v1.`);let m=h2[15&u];if(!m)throw new Error("Unrecognized array type.");let[v]=new Uint16Array(s,2,1),[b]=new Uint32Array(s,4,1);return new rC(b,v,m,s)}constructor(s,l=64,u=Float64Array,p){if(isNaN(s)||s<0)throw new Error(`Unpexpected numItems value: ${s}.`);this.numItems=+s,this.nodeSize=Math.min(Math.max(+l,2),65535),this.ArrayType=u,this.IndexArrayType=s<65536?Uint16Array:Uint32Array;let m=h2.indexOf(this.ArrayType),v=2*s*this.ArrayType.BYTES_PER_ELEMENT,b=s*this.IndexArrayType.BYTES_PER_ELEMENT,w=(8-b%8)%8;if(m<0)throw new Error(`Unexpected typed array class: ${u}.`);p&&p instanceof ArrayBuffer?(this.data=p,this.ids=new this.IndexArrayType(this.data,8,s),this.coords=new this.ArrayType(this.data,8+b+w,2*s),this._pos=2*s,this._finished=!0):(this.data=new ArrayBuffer(8+v+b+w),this.ids=new this.IndexArrayType(this.data,8,s),this.coords=new this.ArrayType(this.data,8+b+w,2*s),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+m]),new Uint16Array(this.data,2,1)[0]=l,new Uint32Array(this.data,4,1)[0]=s)}add(s,l){let u=this._pos>>1;return this.ids[u]=u,this.coords[this._pos++]=s,this.coords[this._pos++]=l,u}finish(){let s=this._pos>>1;if(s!==this.numItems)throw new Error(`Added ${s} items when expected ${this.numItems}.`);return oC(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(s,l,u,p){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:m,coords:v,nodeSize:b}=this,w=[0,m.length-1,0],T=[];for(;w.length;){let k=w.pop()||0,R=w.pop()||0,L=w.pop()||0;if(R-L<=b){for(let Y=L;Y<=R;Y++){let re=v[2*Y],fe=v[2*Y+1];re>=s&&re<=u&&fe>=l&&fe<=p&&T.push(m[Y])}continue}let V=L+R>>1,B=v[2*V],$=v[2*V+1];B>=s&&B<=u&&$>=l&&$<=p&&T.push(m[V]),(k===0?s<=B:l<=$)&&(w.push(L),w.push(V-1),w.push(1-k)),(k===0?u>=B:p>=$)&&(w.push(V+1),w.push(R),w.push(1-k))}return T}within(s,l,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:p,coords:m,nodeSize:v}=this,b=[0,p.length-1,0],w=[],T=u*u;for(;b.length;){let k=b.pop()||0,R=b.pop()||0,L=b.pop()||0;if(R-L<=v){for(let Y=L;Y<=R;Y++)f2(m[2*Y],m[2*Y+1],s,l)<=T&&w.push(p[Y]);continue}let V=L+R>>1,B=m[2*V],$=m[2*V+1];f2(B,$,s,l)<=T&&w.push(p[V]),(k===0?s-u<=B:l-u<=$)&&(b.push(L),b.push(V-1),b.push(1-k)),(k===0?s+u>=B:l+u>=$)&&(b.push(V+1),b.push(R),b.push(1-k))}return w}}function oC(a,s,l,u,p,m){if(p-u<=l)return;let v=u+p>>1;p2(a,s,v,u,p,m),oC(a,s,l,u,v-1,1-m),oC(a,s,l,v+1,p,1-m)}function p2(a,s,l,u,p,m){for(;p>u;){if(p-u>600){let T=p-u+1,k=l-u+1,R=Math.log(T),L=.5*Math.exp(2*R/3),V=.5*Math.sqrt(R*L*(T-L)/T)*(k-T/2<0?-1:1);p2(a,s,l,Math.max(u,Math.floor(l-k*L/T+V)),Math.min(p,Math.floor(l+(T-k)*L/T+V)),m)}let v=s[2*l+m],b=u,w=p;for(xg(a,s,u,l),s[2*p+m]>v&&xg(a,s,u,p);b<w;){for(xg(a,s,b,w),b++,w--;s[2*b+m]<v;)b++;for(;s[2*w+m]>v;)w--}s[2*u+m]===v?xg(a,s,u,w):(w++,xg(a,s,w,p)),w<=l&&(u=w+1),l<=w&&(p=w-1)}}function xg(a,s,l,u){sC(a,l,u),sC(s,2*l,2*u),sC(s,2*l+1,2*u+1)}function sC(a,s,l){let u=a[s];a[s]=a[l],a[l]=u}function f2(a,s,l,u){let p=a-l,m=s-u;return p*p+m*m}n.ARRAY_TYPE=Zo,n.AUTH_ERR_MSG=ve,n.Aabb=yo,n.Actor=class{constructor(a,s,l){this.target=a,this.parent=s,this.mapId=l,this.callbacks={},this.cancelCallbacks={},Zn(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=ra()?a:d,this.scheduler
8=new v4}send(a,s,l,u,p=!1,m){let v=Math.round(1e18*Math.random()).toString(36).substring(0,10);l&&(l.metadata=m,this.callbacks[v]=l);let b=mc(this.globalScope)?void 0:[];return this.target.postMessage({id:v,type:a,hasCallback:!!l,targetMapId:u,mustQueue:p,sourceMapId:this.mapId,data:Fc(s,b)},b),{cancel:()=>{l&&delete this.callbacks[v],this.target.postMessage({id:v,type:"<cancel>",targetMapId:u,sourceMapId:this.mapId})}}}receive(a){let s=a.data,l=s.id;if(l&&(!s.targetMapId||this.mapId===s.targetMapId))if(s.type==="<cancel>"){let u=this.cancelCallbacks[l];delete this.cancelCallbacks[l],u&&u.cancel()}else if(s.mustQueue||ra()){let u=this.callbacks[l];this.cancelCallbacks[l]=this.scheduler.add(()=>this.processTask(l,s),u&&u.metadata||{type:"message"})}else this.processTask(l,s)}processTask(a,s){if(s.type==="<response>"){let l=this.callbacks[a];delete this.callbacks[a],l&&(s.error?l(jl(s.error)):l(null,jl(s.data)))}else{let l=mc(this.globalScope)?void 0:[],u=s.hasCallback?(m,v)=>{delete this.cancelCallbacks[a],this.target.postMessage({id:a,type:"<response>",sourceMapId:this.mapId,error:m?Fc(m):null,data:Fc(v,l)},l)}:m=>{},p=jl(s.data);if(this.parent[s.type])this.parent[s.type](s.sourceMapId,p,u);else if(this.parent.getWorkerSource){let m=s.type.split(".");this.parent.getWorkerSource(s.sourceMapId,m[0],p.source)[m[1]](p,u)}else u(new Error(`Could not find function ${s.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},n.CanonicalTileID=Tv,n.Color=nr,n.ColorMode=Ka,n.CullFaceMode=Ca,n.DEMData=Hv,n.DataConstantProperty=H,n.DedupedRequest=u2,n.DepthMode=cp,n.EXTENT=Ut,n.Elevation=class{isDataAvailableAtPoint(a){let s=this._source();if(this.isUsingMockSource()||!s||a.y<0||a.y>1)return!1;let l=s.getSource().maxzoom,u=1<<l,p=Math.floor(a.x),m=Math.floor((a.x-p)*u),v=Math.floor(a.y*u),b=this.findDEMTileFor(new bo(l,p,l,m,v));return!(!b||!b.dem)}getAtPointOrZero(a,s=0){return this.getAtPoint(a,s)||0}getAtPoint(a,s,l=!0){if(this.isUsingMockSource())return null;s==null&&(s=null);let u=this._source();if(!u||a.y<0||a.y>1)return s;let p=u.getSource().maxzoom,m=1<<p,v=Math.floor(a.x),b=a.x-v,w=new bo(p,v,p,Math.floor(b*m),Math.floor(a.y*m)),T=this.findDEMTileFor(w);if(!T||!T.dem)return s;let k=T.dem,R=1<<T.tileID.canonical.z,L=(b*R-T.tileID.canonical.x)*k.dim,V=(a.y*R-T.tileID.canonical.y)*k.dim,B=Math.floor(L),$=Math.floor(V);return(l?this.exaggeration():1)*Wi(Wi(k.get(B,$),k.get(B,$+1),V-$),Wi(k.get(B+1,$),k.get(B+1,$+1),V-$),L-B)}getAtTileOffset(a,s,l){let u=1<<a.canonical.z;return this.getAtPointOrZero(new Kh(a.wrap+(a.canonical.x+s/Ut)/u,(a.canonical.y+l/Ut)/u))}getAtTileOffsetFunc(a,s,l,u){return p=>{let m=this.getAtTileOffset(a,p.x,p.y),v=u.upVector(a.canonical,p.x,p.y);return ds(v,v,m*u.upVectorScale(a.canonical,s,l).metersToTile),v}}getForTilePoints(a,s,l,u){if(this.isUsingMockSource())return!1;let p=$v.create(this,a,u);return!!p&&(s.forEach(m=>{m[2]=this.exaggeration()*p.getElevationAt(m[0],m[1],l)}),!0)}getMinMaxForTile(a){if(this.isUsingMockSource())return null;let s=this.findDEMTileFor(a);if(!s||!s.dem)return null;let l=s.dem.tree,u=s.tileID,p=1<<a.canonical.z-u.canonical.z,m=a.canonical.x/p-u.canonical.x,v=a.canonical.y/p-u.canonical.y,b=0;for(let w=0;w<a.canonical.z-u.canonical.z&&!l.leaves[b];w++){m*=2,v*=2;let T=2*Math.floor(v)+Math.floor(m);b=l.childOffsets[b]+T,m%=1,v%=1}return{min:this.exaggeration()*l.minimums[b],max:this.exaggeration()*l.maximums[b]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(a,s,l){throw new Error("Pure virtual method called.")}pointCoordinate(a){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(a){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},n.ErrorEvent=sa,n.EvaluationParameters=O,n.Event=Al,n.Evented=zu,n.FillExtrusionBucket=lg,n.Frustum=pw,n.FrustumCorners=hw,n.GLOBE_RADIUS=Ha,n.GLOBE_SCALE_MATCH_LATITUDE=45,n.GLOBE_ZOOM_THRESHOLD_MAX=pM,n.GLOBE_ZOOM_THRESHOLD_MIN=fw,n.GlobeSharedBuffers=class{constructor(a){this._createGrid(a),this._createPoles(a)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(let a of this._poleSegments)a.destroy();for(let a of this._gridSegments)a.withSkirts.destroy(),a.withoutSkirts.destroy();if(this._wireframeIndexBuffer){this._wireframeIndexBuffer.destroy();for(let a of this._wireframeSegments)a.destroy()}}_fillGridMeshWithLods(a,s){let l=new nt,u=new Nt,p=[],m=a+1+2,v=s[0]+1,b=s[0]+1+(1+s.length),w=(T,k,R)=>{let L=T===m-1?T-2:T===0?T:T-1;return L+=R?24575:0,[L,k]};for(let T=0;T<m;++T)l.emplaceBack(...w(T,0,!0));for(let T=0;T<v;++T)for(let k=0;k<m;++k)l.emplaceBack(...w(k,T,(k===0||k===m-1)&&!0));for(let T=0;T<s.length;++T){let k=s[T];for(let R=0;R<m;++R)l.emplaceBack(...w(R,k,!0))}for(let T=0;T<s.length;++T){let k=u.length,R=s[T]+1+2,L=new Nt;for(let $=0;$<R-1;$++){let Y=$===R-2,re=Y?m*(b-s.length+T-$):m;for(let fe=0;fe<m-1;fe++){let oe=$*m+fe;$===0||Y||fe===0||fe===m-2?(L.emplaceBack(oe+1,oe,oe+re),L.emplaceBack(oe+re,oe+re+1,oe+1)):(u.emplaceBack(oe+1,oe,oe+re),u.emplaceBack(oe+re,oe+re+1,oe+1))}}let V=ur.simpleSegment(0,k,l.length,u.length-k);for(let $=0;$<L.uint16.length;$+=3)u.emplaceBack(L.uint16[$],L.uint16[$+1],L.uint16[$+2]);let B=ur.simpleSegment(0,k,l.length,u.length-k);p.push({withoutSkirts:V,withSkirts:B})}return{vertices:l,indices:u,segments:p}}_createGrid(a){let s=this._fillGridMeshWithLods(md,Qm);this._gridSegments=s.segments,this._gridBuffer=a.createVertexBuffer(s.vertices,Ym.members),this._gridIndexBuffer=a.createIndexBuffer(s.indices,!0)}_createPoles(a){let s=new Nt;for(let p=0;p<=md;p++)s.emplaceBack(0,p+1,p+2);this._poleIndexBuffer=a.createIndexBuffer(s,!0);let l=new vn,u=new vn;this._poleSegments=[];for(let p=0,m=0;p<fw;p++){let v=360/(1<<p);l.emplaceBack(0,-Ha,0,.5,0),u.emplaceBack(0,-Ha,0,.5,1);for(let b=0;b<=md;b++){let w=b/md,T=Wi(0,v,w),[k,R,L]=qh(vj,yj,T,Ha);l.emplaceBack(k,R,L,w,0),u.emplaceBack(k,R,L,w,1)}this._poleSegments.push(ur.simpleSegment(m,0,66,64)),m+=66}
8this._poleNorthVertexBuffer=a.createVertexBuffer(l,dM,!1),this._poleSouthVertexBuffer=a.createVertexBuffer(u,dM,!1)}getGridBuffers(a,s){return[this._gridBuffer,this._gridIndexBuffer,s?this._gridSegments[a].withSkirts:this._gridSegments[a].withoutSkirts]}getPoleBuffers(a){return[this._poleNorthVertexBuffer,this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[a]]}getWirefameBuffers(a,s){if(!this._wireframeSegments){let l=new Mr,u=md,p=u+1+2,m=1;this._wireframeSegments=[];for(let v=0,b=0;v<Qm.length;v++){let w=Qm[v];for(let k=m;k<w+m;k++)for(let R=m;R<u+m;R++){let L=k*p+R;l.emplaceBack(L,L+1),l.emplaceBack(L,L+p),l.emplaceBack(L,L+p+1)}let T=w*u*3;this._wireframeSegments.push(ur.simpleSegment(0,b,(w+1)*p,T)),b+=T}this._wireframeIndexBuffer=a.createIndexBuffer(l)}return[this._gridBuffer,this._wireframeIndexBuffer,this._wireframeSegments[s]]}},n.GlyphManager=rp,n.ImagePosition=Bw,n.KDBush=rC,n.LivePerformanceUtils=R1,n.LngLat=bn,n.LngLatBounds=Vc,n.LocalGlyphMode=$w,n.MAX_MERCATOR_LATITUDE=Qr,n.MercatorCoordinate=Kh,n.ONE_EM=Vr,n.OverscaledTileID=bo,n.PerformanceMarkers=yc,n.Point=tt,n.Properties=ue,n.RGBAImage=Ko,n.Ray=dw,n.RequestManager=class{constructor(a,s,l){this._transformRequestFn=a,this._customAccessToken=s,this._silenceAuthErrors=!!l,this._createSkuToken()}_createSkuToken(){let a=function(){let s="";for(let l=0;l<10;l++)s+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",$e,s].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=a.token,this._skuTokenExpiresAt=a.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(a,s){return this._transformRequestFn&&this._transformRequestFn(a,s)||{url:a}}normalizeStyleURL(a,s){if(!Ce(a))return a;let l=vt(a);return l.path=`/styles/v1${l.path}`,this._makeAPIURL(l,this._customAccessToken||s)}normalizeGlyphsURL(a,s){if(!Ce(a))return a;let l=vt(a);return l.path=`/fonts/v1${l.path}`,this._makeAPIURL(l,this._customAccessToken||s)}normalizeSourceURL(a,s,l,u){if(!Ce(a))return a;let p=vt(a);return p.path=`/v4/${p.authority}.json`,p.params.push("secure"),l&&p.params.push(`language=${l}`),u&&p.params.push(`worldview=${u}`),this._makeAPIURL(p,this._customAccessToken||s)}normalizeSpriteURL(a,s,l,u){let p=vt(a);return Ce(a)?(p.path=`/styles/v1${p.path}/sprite${s}${l}`,this._makeAPIURL(p,this._customAccessToken||u)):(p.path+=`${s}${l}`,ut(p))}normalizeTileURL(a,s,l){if(this._isSkuTokenExpired()&&this._createSkuToken(),a&&!Ce(a))return a;let u=vt(a);u.path=u.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${s||l&&u.authority!=="raster"&&l===512?"@2x":""}${j.supported?".webp":"$1"}`),u.authority==="raster"?u.path=`/${M.RASTER_URL_PREFIX}${u.path}`:(u.path=u.path.replace(/^.+\/v4\//,"/"),u.path=`/${M.TILE_URL_VERSION}${u.path}`);let p=this._customAccessToken||function(m){for(let v of m){let b=v.match(/^access_token=(.*)$/);if(b)return b[1]}return null}(u.params)||M.ACCESS_TOKEN;return M.REQUIRE_ACCESS_TOKEN&&p&&this._skuToken&&u.params.push(`sku=${this._skuToken}`),this._makeAPIURL(u,p)}canonicalizeTileURL(a,s){let l=vt(a);if(!l.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!l.path.match(/\.[\w]+$/))return a;let u="mapbox://";l.path.match(/^\/raster\/v1\//)?u+=`raster/${l.path.replace(`/${M.RASTER_URL_PREFIX}/`,"")}`:u+=`tiles/${l.path.replace(`/${M.TILE_URL_VERSION}/`,"")}`;let p=l.params;return s&&(p=p.filter(m=>!m.match(/^access_token=/))),p.length&&(u+=`?${p.join("&")}`),u}canonicalizeTileset(a,s){let l=!!s&&Ce(s),u=[];for(let p of a.tiles||[])ke(p)?u.push(this.canonicalizeTileURL(p,l)):u.push(p);return u}_makeAPIURL(a,s){let l="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",u=vt(M.API_URL);if(a.protocol=u.protocol,a.authority=u.authority,a.protocol==="http"){let p=a.params.indexOf("secure");p>=0&&a.params.splice(p,1)}if(u.path!=="/"&&(a.path=`${u.path}${a.path}`),!M.REQUIRE_ACCESS_TOKEN)return ut(a);if(s=s||M.ACCESS_TOKEN,!this._silenceAuthErrors){if(!s)throw new Error(`An API access token is required to use Mapbox GL. ${l}`);if(s[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${l}`)}return a.params=a.params.filter(p=>p.indexOf("access_token")===-1),a.params.push(`access_token=${s||""}`),ut(a)}},n.ResourceType=Dl,n.SegmentVector=ur,n.SourceCache=xd,n.StencilMode=eC,n.StructArrayLayout1ui2=Wo,n.StructArrayLayout2f1f2i16=Gt,n.StructArrayLayout2i4=nt,n.StructArrayLayout2ui4=Mr,n.StructArrayLayout3f12=Ci,n.StructArrayLayout3ui6=Nt,n.StructArrayLayout4i8=Ze,n.StructArrayLayout5f20=vn,n.Texture=yg,n.Tile=Qw,n.Transitionable=U,n.Uniform1f=cv,n.Uniform1i=class extends Ul{constructor(a){
8super(a),this.current=0}set(a,s,l){this.fetchUniformLocation(a,s)&&this.current!==l&&(this.current=l,this.gl.uniform1i(this.location,l))}},n.Uniform2f=class extends Ul{constructor(a){super(a),this.current=[0,0]}set(a,s,l){this.fetchUniformLocation(a,s)&&(l[0]===this.current[0]&&l[1]===this.current[1]||(this.current=l,this.gl.uniform2f(this.location,l[0],l[1])))}},n.Uniform3f=class extends Ul{constructor(a){super(a),this.current=[0,0,0]}set(a,s,l){this.fetchUniformLocation(a,s)&&(l[0]===this.current[0]&&l[1]===this.current[1]&&l[2]===this.current[2]||(this.current=l,this.gl.uniform3f(this.location,l[0],l[1],l[2])))}},n.Uniform4f=ZD,n.UniformColor=KD,n.UniformMatrix2f=class extends Ul{constructor(a){super(a),this.current=ij}set(a,s,l){if(this.fetchUniformLocation(a,s)){for(let u=0;u<4;u++)if(l[u]!==this.current[u]){this.current=l,this.gl.uniformMatrix2fv(this.location,!1,l);break}}}},n.UniformMatrix3f=class extends Ul{constructor(a){super(a),this.current=tj}set(a,s,l){if(this.fetchUniformLocation(a,s)){for(let u=0;
8u<9;u++)if(l[u]!==this.current[u]){this.current=l,this.gl.uniformMatrix3fv(this.location,!1,l);break}}}},n.UniformMatrix4f=class extends Ul{constructor(a){super(a),this.current=ej}set(a,s,l){if(this.fetchUniformLocation(a,s)){if(l[12]!==this.current[12]||l[0]!==this.current[0])return this.current=l,void this.gl.uniformMatrix4fv(this.location,!1,l);for(let u=1;u<16;u++)if(l[u]!==this.current[u]){this.current=l,this.gl.uniformMatrix4fv(this.location,!1,l);break}}}},n.UnwrappedTileID=tk,n.ValidationError=Mt,n.VectorTileFeature=Ev,n.VectorTileWorkerSource=class extends zu{constructor(a,s,l,u,p){super(),this.actor=a,this.layerIndex=s,this.availableImages=l,this.loadVectorData=p||d2,this.loading={},this.loaded={},this.deduped=new u2(a.scheduler),this.isSpriteLoaded=u,this.scheduler=a.scheduler}loadTile(a,s){let l=a.uid,u=a&&a.request,p=u&&u.collectResourceTiming,m=this.loading[l]=new S4(a);m.abort=this.loadVectorData(a,(v,b)=>{let w=!this.loading[l];if(delete this.loading[l],w||v||!b)return m.status="done",w||(this.loaded[l]=m),s(v);let T=b.rawData,k={};b.expires&&(k.expires=b.expires),b.cacheControl&&(k.cacheControl=b.cacheControl),m.vectorTile=b.vectorTile||new Fw(new kv(T));let R=()=>{m.parse(m.vectorTile,this.layerIndex,this.availableImages,this.actor,(L,V)=>{if(L||!V)return s(L);let B={};if(p){let $=Zf(u);$.length>0&&(B.resourceTiming=JSON.parse(JSON.stringify($)))}s(null,cn({rawTileData:T.slice(0)},V,k,B))})};this.isSpriteLoaded?R():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(R,{type:"parseTile",isSymbolTile:a.isSymbolTile,zoom:a.tileZoom}):R()}),this.loaded=this.loaded||{},this.loaded[l]=m})}reloadTile(a,s){let l=this.loaded,u=a.uid,p=this;if(l&&l[u]){let m=l[u];m.showCollisionBoxes=a.showCollisionBoxes,m.enableTerrain=!!a.enableTerrain,m.projection=a.projection,m.tileTransform=bd(a.tileID.canonical,a.projection);let v=(b,w)=>{let T=m.reloadCallback;T&&(delete m.reloadCallback,m.parse(m.vectorTile,p.layerIndex,this.availableImages,p.actor,T)),s(b,w)};m.status==="parsing"?m.reloadCallback=v:m.status==="done"&&(m.vectorTile?m.parse(m.vectorTile,this.layerIndex,this.availableImages,this.actor,v):v())}}abortTile(a,s){let l=a.uid,u=this.loading[l];u&&(u.abort&&u.abort(),delete this.loading[l]),s()}removeTile(a,s){let l=this.loaded,u=a.uid;l&&l[u]&&delete l[u],s()}},n.WritingMode=ps,n.ZoomDependentExpression=id,n.add=$l,n.addDynamicAttributes=Vv,n.adjoint=function(a,s){var l=s[0],u=s[1],p=s[2],m=s[3],v=s[4],b=s[5],w=s[6],T=s[7],k=s[8];return a[0]=v*k-b*T,a[1]=p*T-u*k,a[2]=u*b-p*v,a[3]=b*w-m*k,a[4]=l*k-p*w,a[5]=p*m-l*b,a[6]=m*T-v*w,a[7]=u*w-l*T,a[8]=l*v-u*m,a},n.asyncAll=ri,n.bezier=Fa,n.bindAll=Zn,n.boundsAttributes=Wk,n.bufferConvexPolygon=function(a,s){let l=[];for(let u=0;u<a.length;u++){let p=Ft(u-1,-1,a.length-1),m=Ft(u+1,-1,a.length-1),v=a[u],b=a[m],w=a[p].sub(v).unit(),T=b.sub(v).unit(),k=T.angleWithSep(w.x,w.y),R=w.add(T).unit().mult(-1*s/Math.sin(k/2));l.push(v.add(R))}return l},n.cacheEntryPossiblyAdded=function(a){Fu++,Fu>hh&&(a.getActor().send("enforceCacheSizeLimit",dh),Fu=0)},n.calculateGlobeLabelMatrix=function(a,s){let{x:l,y:u}=a.point,p=vM(l,u,a.worldSize/a._pixelsPerMercatorPixel,0,0);return hd(p,p,_w($a(s)))},n.calculateGlobeMatrix=function(a){let{x:s,y:l}=a.point,{lng:u,lat:p}=a._center;return vM(s,l,a.worldSize,u,p)},n.calculateGlobeMercatorMatrix=function(a){let s=a.pixelsPerMeter,l=s/ba(1,a.center.lat),u=va(new Float64Array(16));return Gm(u,u,[a.point.x,a.point.y,0]),pd(u,u,[l,l,s]),Float32Array.from(u)},n.circumferenceAtLatitude=yw,n.clamp=pt,n.clearTileCache=function(a){if(!Lu())return;let s=d.caches.delete(gc);a&&s.catch(a).then(()=>a())},n.clipLine=Mk,n.clone=function(a){var s=new Zo(16);return s[0]=a[0],s[1]=a[1],s[2]=a[2],s[3]=a[3],s[4]=a[4],s[5]=a[5],s[6]=a[6],s[7]=a[7],s[8]=a[8],s[9]=a[9],s[10]=a[10],s[11]=a[11],s[12]=a[12],s[13]=a[13],s[14]=a[14],s[15]=a[15],s},n.clone$1=zr,n.collisionCircleLayout=CV,n.config=M,n.conjugate=function(a,s){return a[0]=-s[0],a[1]=-s[1],a[2]=-s[2],a[3]=s[3],a},n.create=function(){var a=new Zo(16);return Zo!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=0,a[12]=0,a[13]=0,a[14]=0),a[0]=1,a[5]=1,a[10]=1,a[15]=1,a},n.create$1=QD,n.createExpression=Oc,n.createLayout=Ie,n.createStyleLayer=function(a){return a.type==="custom"?new f4(a):new g4[a.type](a)},n.cross=uw,n.degToRad=ai,n.distance=function(a,s){return Math.hypot(s[0]-a[0],s[1]-a[1],s[2]-a[2])},n.div=function(a,s,l){return a[0]=s[0]/l[0],a[1]=s[1]/l[1],a[2]=s[2]/l[2],a}
8,n.dot=Fs,n.earthRadius=tg,n.ease=Tl,n.easeCubicInOut=jo,n.ecefToLatLng=function([a,s,l]){let u=Math.hypot(a,s,l),p=Math.atan2(a,l),m=.5*Math.PI-Math.acos(-s/u);return new bn(sr(p),sr(m))},n.emitValidationErrors=nv,n.endsWith=fo,n.enforceCacheSizeLimit=function(a){Il(),Uo&&Uo.then(s=>{s.keys().then(l=>{for(let u=0;u<l.length-a;u++)s.delete(l[u])})})},n.evaluateSizeForFeature=Dv,n.evaluateSizeForZoom=ep,n.evaluateVariableOffset=Rk,n.evented=y,n.exactEquals=function(a,s){return a[0]===s[0]&&a[1]===s[1]&&a[2]===s[2]&&a[3]===s[3]},n.exactEquals$1=function(a,s){return a[0]===s[0]&&a[1]===s[1]&&a[2]===s[2]},n.exported=oa,n.exported$1=j,n.extend=cn,n.extend$1=aa,n.fillExtrusionHeightLift=QM,n.filterObject=as,n.fromMat4=function(a,s){return a[0]=s[0],a[1]=s[1],a[2]=s[2],a[3]=s[4],a[4]=s[5],a[5]=s[6],a[6]=s[8],a[7]=s[9],a[8]=s[10],a},n.fromQuat=function(a,s){var l=s[0],u=s[1],p=s[2],m=s[3],v=l+l,b=u+u,w=p+p,T=l*v,k=u*v,R=u*b,L=p*v,V=p*b,B=p*w,$=m*v,Y=m*b,re=m*w;return a[0]=1-R-B,a[1]=k+re,a[2]=L-Y,a[3]=0,a[4]=k-re,a[5]=1-T-B,a[6]=V+$,a[7]=0,a[8]=L+Y,a[9]=V-$,a[10]=1-T-R,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},n.fromRotation=function(a,s){var l=Math.sin(s),u=Math.cos(s);return a[0]=u,a[1]=l,a[2]=0,a[3]=-l,a[4]=u,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},n.fromScaling=eM,n.furthestTileCorner=function(a){let s=Math.round((a+45+360)%360/90)%4;return na[s]},n.getAABBPointSquareDist=function(a,s,l){let u=0;for(let p=0;p<2;++p){let m=l?l[p]:0;a[p]>m&&(u+=(a[p]-m)*(a[p]-m)),s[p]<m&&(u+=(m-s[p])*(m-s[p]))}return u},n.getAnchorAlignment=Hw,n.getAnchorJustification=qw,n.getBounds=function(a){let s=1/0,l=1/0,u=-1/0,p=-1/0;for(let m of a)s=Math.min(s,m.x),l=Math.min(l,m.y),u=Math.max(u,m.x),p=Math.max(p,m.y);return{min:new tt(s,l),max:new tt(u,p)}},n.getColumn=Na,n.getDefaultExportFromCjs=at,n.getGridMatrix=function(a,s,l,u){let p=s.getNorth(),m=s.getSouth(),v=s.getWest(),b=s.getEast(),w=1<<a.z,T=b-v,k=p-m,R=T/md,L=-k/Qm[l],V=[0,R,0,L,0,0,p,v,0];if(a.z>0){let B=180/u;JD(V,V,[B/T+1,0,0,0,B/k+1,0,-.5*B/R,.5*B/L,1])}return V[2]=w,V[5]=a.x,V[8]=a.y,V},n.getImage=de,n.getJSON=function(a,s){return kl(cn(a,{type:"json"}),s)},n.getLatitudinalLod=function(a){let s=Qr-5;a=pt(a,-s,s)/s*90;let l=Math.pow(Math.abs(Math.sin(ai(a))),3);return Math.round(l*(Qm.length-1))},n.getMapSessionAPI=Tr,n.getPerformanceMeasurement=Zf,n.getProjection=Uk,n.getRTLTextPluginStatus=x,n.getReferrer=Ml,n.getTilePoint=function(a,{x:s,y:l},u=0){return new tt(((s-u)*a.scale-a.x)*Ut,(l*a.scale-a.y)*Ut)},n.getTileVec3=function(a,s,l=0){return Gh(((s.x-l)*a.scale-a.x)*Ut,(s.y*a.scale-a.y)*Ut,wM(s.z,s.y))},n.getVideo=function(a,s){let l=d.document.createElement("video");l.muted=!0,l.onloadstart=function(){s(null,l)};for(let u=0;u<a.length;u++){let p=d.document.createElement("source");ph(a[u])||(l.crossOrigin="Anonymous"),p.src=a[u],l.appendChild(p)}return{cancel:()=>{}}},n.globeCenterToScreenPoint=function(a){let s=[0,0,0],l=va(new Float64Array(16));return hd(l,a.pixelMatrix,a.globeMatrix),rr(s,s,l),new tt(s[0],s[1])},n.globeDenormalizeECEF=_w,n.globeECEFOrigin=function(a,s){let l=[0,0,0];return rr(l,l,eg($a(s.canonical))),rr(l,l,a),l},n.globeMetersToEcef=hv,n.globeNormalizeECEF=eg,n.globePixelsToTileUnits=function(a,s){return Ut/(512*Math.pow(2,a))*fv($a(s))},n.globePoleMatrixForTile=function(a,s,l){let u=va(new Float64Array(16)),p=(s/(1<<a)-.5)*Math.PI*2;return dv(u,l.globeMatrix,p),Float32Array.from(u)},n.globeTileBounds=$a,n.globeTiltAtLngLat=yM,n.globeToMercatorTransition=Zh,n.globeUseCustomAntiAliasing=function(a,s,l){let u=Zh(l.zoom),p=a.style.map._antialias,m=!!s.extStandardDerivatives,v=s.extStandardDerivativesForceOff||a.terrain&&a.terrain.exaggeration()>0;return u===0&&!p&&!v&&m},n.identity=va,n.identity$1=lM,n.invert=sw,n.isFullscreen=function(){return!!d.document.fullscreenElement||!!d.document.webkitFullscreenElement},n.isLngLatBehindGlobe=vw,n.isMapAuthenticated=function(a){return lo.has(a)},n.isMapboxURL=Ce,n.isSafariWithAntialiasingBug=function(a){let s=a.navigator?a.navigator.userAgent:null;return!!mc(a)&&s&&(s.match("Version/15.4")||s.match("Version/15.5")||s.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},n.latFromMercatorY=Yr,n.latLngToECEF=Wh,n.len=dj,n.length=qm,n.length$1=function(a){return Math.hypot(a[0],a[1],a[2],a[3])},n.lngFromMercatorX=hs,n.loadVectorTile=d2,n.makeRequest=kl,n.mapValue=function(a,s,l,u,p){return pt((a-s)/(l-s)*(p-u)+u,u,p)},n.mercatorScale=CM,n.mercatorXfromLng=Ga,n.mercatorYfromLat=qa,n.mercatorZfromAltitude=ba,n.mul=cj,n.mul$1=uj,n.multiply=hd,n.multiply$1=JD,n.multiply$2=nM,n.nextPowerOfTwo=Vo,n.normalize=vo,n.normalize$1=hj,n.normalize$2
8=sM,n.number=Wi,n.ortho=function(a,s,l,u,p,m,v){var b=1/(s-l),w=1/(u-p),T=1/(m-v);return a[0]=-2*b,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*w,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*T,a[11]=0,a[12]=(s+l)*b,a[13]=(p+u)*w,a[14]=(v+m)*T,a[15]=1,a},n.pbf=lk,n.perspective=function(a,s,l,u,p){var m,v=1/Math.tan(s/2);return a[0]=v/l,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=v,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=-1,a[12]=0,a[13]=0,a[15]=0,p!=null&&p!==1/0?(a[10]=(p+u)*(m=1/(u-p)),a[14]=2*p*u*m):(a[10]=-1,a[14]=-2*u),a},n.pick=function(a,s){let l={};for(let u=0;u<s.length;u++){let p=s[u];p in a&&(l[p]=a[p])}return l},n.plugin=D,n.pointGeometry=tn,n.polesInViewport=function(a){let s=va(new Float64Array(16));hd(s,a.pixelMatrix,a.globeMatrix);let l=[0,Ns,0],u=[0,zs,0];return rr(l,l,s),rr(u,u,s),[l[0]>0&&l[0]<=a.width&&l[1]>0&&l[1]<=a.height&&!vw(a,new bn(a.center.lat,90)),u[0]>0&&u[0]<=a.width&&u[1]>0&&u[1]<=a.height&&!vw(a,new bn(a.center.lat,-90))]},n.polygonContainsPoint=vd,n.polygonIntersectsBox=kM,n.polygonIntersectsPolygon=TM,n.polygonizeBounds=function(a,s,l=0,u=!0){let p=new tt(l,l),m=a.sub(p),v=s.add(p),b=[m,new tt(v.x,m.y),v,new tt(m.x,v.y)];return u&&b.push(m.clone()),b},n.posAttributes=Ym,n.postMapLoadEvent=ar,n.postPerformanceEvent=yr,n.postTurnstileEvent=Ni,n.potpack=Vw,n.prevPowerOfTwo=function(a){return a<=1?1:Math.pow(2,Math.floor(Math.log(a)/Math.LN2))},n.radToDeg=sr,n.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],n.registerForPluginStateChange=function(a){return a({pluginStatus:f,pluginURL:c}),y.on("pluginStateChange",a),a},n.removeAuthState=function(a){lo.delete(a)},n.renderColorRamp=Iw,n.resample=EM,n.rotateX=aw,n.rotateX$1=cM,n.rotateY=dv,n.rotateY$1=uM,n.rotateZ=function(a,s,l){var u=Math.sin(l),p=Math.cos(l),m=s[0],v=s[1],b=s[2],w=s[3],T=s[4],k=s[5],R=s[6],L=s[7];return s!==a&&(a[8]=s[8],a[9]=s[9],a[10]=s[10],a[11]=s[11],a[12]=s[12],a[13]=s[13],a[14]=s[14],a[15]=s[15]),a[0]=m*p+T*u,a[1]=v*p+k*u,a[2]=b*p+R*u,a[3]=w*p+L*u,a[4]=T*p-m*u,a[5]=k*p-v*u,a[6]=R*p-b*u,a[7]=L*p-w*u,a},n.rotateZ$1=function(a,s,l){l*=.5;var u=s[0],p=s[1],m=s[2],v=s[3],b=Math.sin(l),w=Math.cos(l);return a[0]=u*w+p*b,a[1]=p*w-u*b,a[2]=m*w+v*b,a[3]=v*w-m*b,a},n.scale=pd,n.scale$1=oM,n.scale$2=ds,n.scaleAndAdd=Km,n.set=function(a,s,l,u){return a[0]=s,a[1]=l,a[2]=u,a},n.setCacheLimits=function(a,s){dh=a,hh=s},n.setColumn=function(a,s,l){a[4*s+0]=l[0],a[4*s+1]=l[1],a[4*s+2]=l[2],a[4*s+3]=l[3]},n.setRTLTextPlugin=function(a,s,l=!1){if(f===Vm||f===Bm||f===Um)throw new Error("setRTLTextPlugin cannot be called multiple times.");c=oa.resolveURL(a),f=Vm,Nc=s,g(),l||I()},n.smoothstep=Zt,n.spec=Ue,n.squaredLength=function(a){var s=a[0],l=a[1],u=a[2];return s*s+l*l+u*u},n.storeAuthState=function(a,s){s?lo.add(a):lo.delete(a)},n.sub=ya,n.subtract=cw,n.symbolSize=EV,n.tileAABB=function(a,s,l,u,p,m,v,b,w){if(w.name==="globe")return _j(a,s,new Tv(l,u,p));let T=bd({z:l,x:u,y:p},w);return new yo([(m+T.x/T.scale)*s,s*(T.y/T.scale),v],[(m+T.x2/T.scale)*s,s*(T.y2/T.scale),b])},n.tileCornersToBounds=pv,n.tileTransform=bd,n.transformMat3=function(a,s,l){var u=s[0],p=s[1],m=s[2];return a[0]=u*l[0]+p*l[3]+m*l[6],a[1]=u*l[1]+p*l[4]+m*l[7],a[2]=u*l[2]+p*l[5]+m*l[8],a},n.transformMat4=rr,n.transformMat4$1=fd,n.transformQuat=rM,n.transitionTileAABBinECEF=mM,n.translate=Gm,n.transpose=function(a,s){if(a===s){var l=s[1],u=s[2],p=s[5];a[1]=s[3],a[2]=s[6],a[3]=l,a[5]=s[7],a[6]=u,a[7]=p}else a[0]=s[0],a[1]=s[3],a[2]=s[6],a[3]=s[1],a[4]=s[4],a[5]=s[7],a[6]=s[2],a[7]=s[5],a[8]=s[8];return a},n.triggerPluginCompletionEvent=h,n.uniqueId=ao,n.updateGlobeVertexNormal=function(a,s,l,u,p){let m=5*s+2;a.float32[m+0]=l,a.float32[m+1]=u,a.float32[m+2]=p},n.validateCustomStyleLayer=function(a){let s=[],l=a.id;return l===void 0&&s.push({message:`layers.${l}: missing required property "id"`}),a.render===void 0&&s.push({message:`layers.${l}: missing required method "render"`}),a.renderingMode&&a.renderingMode!=="2d"&&a.renderingMode!=="3d"&&s.push({message:`layers.${l}: property "renderingMode" must be either "2d" or "3d"`}),s},n.validateFilter=a=>qo(ad(a)),n.validateFog=a=>
8qo(ev(a)),n.validateLayer=a=>qo(X0(a)),n.validateLight=a=>qo(J0(a)),n.validateSource=a=>qo(Q0(a)),n.validateStyle=iv,n.validateTerrain=a=>qo(Lm(a)),n.values=Pn,n.vectorTile=Cv,n.version=_,n.warnOnce=Un,n.window=d,n.wrap=Ft}),t(["./shared"],function(n){"use strict";function d(pe){if(typeof pe=="number"||typeof pe=="boolean"||typeof pe=="string"||pe==null)return JSON.stringify(pe);if(Array.isArray(pe)){let K="[";for(let de of pe)K+=`${d(de)},`;return`${K}]`}let W="{";for(let K of Object.keys(pe).sort())W+=`${K}:${d(pe[K])},`;return`${W}}`}function _(pe){let W="";for(let K of n.refProperties)W+=`/${d(pe[K])}`;return W}class C{constructor(W){this.keyCache={},W&&this.replace(W)}replace(W){this._layerConfigs={},this._layers={},this.update(W,[])}update(W,K){for(let ve of W)this._layerConfigs[ve.id]=ve,(this._layers[ve.id]=n.createStyleLayer(ve)).compileFilter(),this.keyCache[ve.id]&&delete this.keyCache[ve.id];for(let ve of K)delete this.keyCache[ve],delete this._layerConfigs[ve],delete this._layers[ve];this.familiesBySource={};let de=function(ve,Ce){let ke={};for(let we=0;we<ve.length;we++){let je=Ce&&Ce[ve[we].id]||_(ve[we]);Ce&&(Ce[ve[we].id]=je);let ft=ke[je];ft||(ft=ke[je]=[]),ft.push(ve[we])}let Me=[];for(let we in ke)Me.push(ke[we]);return Me}(n.values(this._layerConfigs),this.keyCache);for(let ve of de){let Ce=ve.map(vt=>this._layers[vt.id]),ke=Ce[0];if(ke.visibility==="none")continue;let Me=ke.source||"",we=this.familiesBySource[Me];we||(we=this.familiesBySource[Me]={});let je=ke.sourceLayer||"_geojsonTileLayer",ft=we[je];ft||(ft=we[je]=[]),ft.push(Ce)}}}class M{loadTile(W,K){let{uid:de,encoding:ve,rawImageData:Ce,padding:ke,buildQuadTree:Me}=W,we=n.window.ImageBitmap&&Ce instanceof n.window.ImageBitmap?this.getImageData(Ce,ke):Ce;K(null,new n.DEMData(de,we,ve,ke<1,Me))}getImageData(W,K){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(W.width,W.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=W.width,this.offscreenCanvas.height=W.height,this.offscreenCanvasContext.drawImage(W,0,0,W.width,W.height);let de=this.offscreenCanvasContext.getImageData(-K,-K,W.width+2*K,W.height+2*K);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),de}}function j(pe,W){if(pe.length!==0){G(pe[0],W);for(var K=1;K<pe.length;K++)G(pe[K],!W)}}function G(pe,W){for(var K=0,de=0,ve=0,Ce=pe.length,ke=Ce-1;ve<Ce;ke=ve++){var Me=(pe[ve][0]-pe[ke][0])*(pe[ke][1]+pe[ve][1]),we=K+Me;de+=Math.abs(K)>=Math.abs(Me)?K-we+Me:Me-we+K,K=we}K+de>=0!=!!W&&pe.reverse()}var ie=n.getDefaultExportFromCjs(function pe(W,K){var de,ve=W&&W.type;if(ve==="FeatureCollection")for(de=0;de<W.features.length;de++)pe(W.features[de],K);else if(ve==="GeometryCollection")for(de=0;de<W.geometries.length;de++)pe(W.geometries[de],K);else if(ve==="Feature")pe(W.geometry,K);else if(ve==="Polygon")j(W.coordinates,K);
8else if(ve==="MultiPolygon")for(de=0;de<W.coordinates.length;de++)j(W.coordinates[de],K);return W});let _e=n.VectorTileFeature.prototype.toGeoJSON;var Ee={exports:{}},Ye=n.pointGeometry,$e=n.vectorTile.VectorTileFeature,at=Lt;function Lt(pe,W){this.options=W||{},this.features=pe,this.length=pe.length}function jt(pe,W){this.id=typeof pe.id=="number"?pe.id:void 0,this.type=pe.type,this.rawGeometry=pe.type===1?[pe.geometry]:pe.geometry,this.properties=pe.tags,this.extent=W||4096}Lt.prototype.feature=function(pe){return new jt(this.features[pe],this.options.extent)},jt.prototype.loadGeometry=function(){var pe=this.rawGeometry;this.geometry=[];for(var W=0;W<pe.length;W++){for(var K=pe[W],de=[],ve=0;ve<K.length;ve++)de.push(new Ye(K[ve][0],K[ve][1]));this.geometry.push(de)}return this.geometry},jt.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var pe=this.geometry,W=1/0,K=-1/0,de=1/0,ve=-1/0,Ce=0;Ce<pe.length;Ce++)for(var ke=pe[Ce],Me=0;Me<ke.length;Me++){var we=ke[Me];W=Math.min(W,we.x),K=Math.max(K,we.x),de=Math.min(de,we.y),ve=Math.max(ve,we.y)}return[W,de,K,ve]},jt.prototype.toGeoJSON=$e.prototype.toGeoJSON;var $t=n.pbf,tn=at;function Fi(pe){var W=new $t;return function(K,de){for(var ve in K.layers)de.writeMessage(3,tt,K.layers[ve])}(pe,W),W.finish()}function tt(pe,W){var K;W.writeVarintField(15,pe.version||1),W.writeStringField(1,pe.name||""),W.writeVarintField(5,pe.extent||4096);var de={keys:[],values:[],keycache:{},valuecache:{}};for(K=0;K<pe.length;K++)de.feature=pe.feature(K),W.writeMessage(2,Sr,de);var ve=de.keys;for(K=0;K<ve.length;K++)W.writeStringField(3,ve[K]);var Ce=de.values;for(K=0;K<Ce.length;K++)W.writeMessage(4,jo,Ce[K])}function Sr(pe,W){var K=pe.feature;K.id!==void 0&&W.writeVarintField(1,K.id),W.writeMessage(2,so,pe),W.writeVarintField(3,K.type),W.writeMessage(4,na,K)}function so(pe,W){var K=pe.feature,de=pe.keys,ve=pe.values,Ce=pe.keycache,ke=pe.valuecache;for(var Me in K.properties){var we=K.properties[Me],je=Ce[Me];if(we!==null){je===void 0&&(de.push(Me),Ce[Me]=je=de.length-1),W.writeVarint(je);var ft=typeof we;ft!=="string"&&ft!=="boolean"&&ft!=="number"&&(we=JSON.stringify(we));var vt=ft+":"+we,ut=ke[vt];ut===void 0&&(ve.push(we),ke[vt]=ut=ve.length-1),W.writeVarint(ut)}}}function ai(pe,W){return(W<<3)+(7&pe)}function sr(pe){return pe<<1^pe>>31}function na(pe,W){for(var K=pe.loadGeometry(),de=pe.type,ve=0,Ce=0,ke=K.length,Me=0;Me<ke;Me++){var we=K[Me],je=1;de===1&&(je=we.length),W.writeVarint(ai(1,je));for(var ft=de===3?we.length-1:we.length,vt=0;vt<ft;vt++){vt===1&&de!==1&&W.writeVarint(ai(2,ft-1));var ut=we[vt].x-ve,hi=we[vt].y-Ce;W.writeVarint(sr(ut)),W.writeVarint(sr(hi)),ve+=ut,Ce+=hi}de===3&&W.writeVarint(ai(7,1))}}function jo(pe,W){var K=typeof pe;K==="string"?W.writeStringField(1,pe):K==="boolean"?W.writeBooleanField(7,pe):K==="number"&&(pe%1!=0?W.writeDoubleField(3,pe):pe<0?W.writeSVarintField(6,pe):W.writeVarintField(5,pe))}Ee.exports=Fi,Ee.exports.fromVectorTileJs=Fi,Ee.exports.fromGeojsonVt=function(pe,W){W=W||{};var K={};for(var de in pe)K[de]=new tn(pe[de].features,W),K[de].name=de,K[de].version=W.version,K[de].extent=W.extent;return Fi({layers:K})},Ee.exports.GeoJSONWrapper=tn;var Fa=n.getDefaultExportFromCjs(Ee.exports);let Tl={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:pe=>pe},pt=Math.fround||(Zt=new Float32Array(1),pe=>(Zt[0]=+pe,Zt[0]));var Zt;let Ft=3,ri=5,Pn=6;class cn{constructor(W){this.options=Object.assign(Object.create(Tl),W),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(W){let{log:K,minZoom:de,maxZoom:ve}=this.options;K&&console.time("total time");let Ce=`prepare ${W.length} points`;K&&console.time(Ce),this.points=W;let ke=[];for(let we=0;we<W.length;we++){let je=W[we];if(!je.geometry)continue;let[ft,vt]=je.geometry.coordinates,ut=pt(un(ft)),hi=pt(Vo(vt));ke.push(ut,hi,1/0,we,-1,1),this.options.reduce&&ke.push(0)}let Me=this.trees[ve+1]=this._createTree(ke);K&&console.timeEnd(Ce);for(let we=ve;we>=de;we--){let je=+Date.now();Me=this.trees[we]=this._createTree(this._cluster(Me,we)),K&&console.log("z%d: %d clusters in %dms",we,Me.numItems,+Date.now()-je)}return K&&console.timeEnd("total time"),this}getClusters(W,K){let de=((W[0]+180)%360+360)%360-180,ve=Math.max(-90,Math.min(90,W[1])),Ce=W[2]===180?180:((W[2]+180)%360+360)%360-180,ke=Math.max(-90,Math.min(90,W[3]));if(W[2]-W[0]>=360)de=-180,Ce=180;else if(de>Ce){let vt=this.getClusters([de,ve,180,ke],K),ut=this.getClusters([-180,ve,Ce,ke],K);return vt.concat(ut)}let Me=this.trees[this._limitZoom(K)],we=Me.range(un(de),Vo(ke),un(Ce),Vo(ve)),je=Me.data,ft=[];for(let vt of we){let ut=this.stride*vt;ft.push(je[ut+ri]>1?ir(je,ut,this.clusterProps):this.points[je[ut+Ft]])}return ft}getChildren(W){let K=this._getOriginId(W),de=this._getOriginZoom(W),ve="No cluster with the specified id.",Ce=this.trees[de];if(!Ce)throw new Error(ve);let ke=Ce.data;if(K*this.stride>=ke.length)throw new Error(ve);let Me=this.options.radius/(this.options.extent*Math.pow(2,de-1)),we=Ce.within(ke[K*this.stride],ke[K*this.stride+1],Me),je=[];for(let ft of we){let vt=ft*this.stride;ke[vt+4]===W&&je.push(ke[vt+ri]>1?ir(ke,vt,this.clusterProps):this.points[ke[vt+Ft]])}if(je.length===0)throw new Error(ve);return je}getLeaves(W,K,de){let ve=[];return this._appendLeaves(ve,W,K=K||10,de=de||0,0),ve}getTile(W,K,de){let ve=this.trees[this._limitZoom(W)],Ce=Math.pow(2,W),{extent:ke,radiu
8s:Me}=this.options,we=Me/ke,je=(de-we)/Ce,ft=(de+1+we)/Ce,vt={features:[]};return this._addTileFeatures(ve.range((K-we)/Ce,je,(K+1+we)/Ce,ft),ve.data,K,de,Ce,vt),K===0&&this._addTileFeatures(ve.range(1-we/Ce,je,1,ft),ve.data,Ce,de,Ce,vt),K===Ce-1&&this._addTileFeatures(ve.range(0,je,we/Ce,ft),ve.data,-1,de,Ce,vt),vt.features.length?vt:null}getClusterExpansionZoom(W){let K=this._getOriginZoom(W)-1;for(;K<=this.options.maxZoom;){let de=this.getChildren(W);if(K++,de.length!==1)break;W=de[0].properties.cluster_id}return K}_appendLeaves(W,K,de,ve,Ce){let ke=this.getChildren(K);for(let Me of ke){let we=Me.properties;if(we&&we.cluster?Ce+we.point_count<=ve?Ce+=we.point_count:Ce=this._appendLeaves(W,we.cluster_id,de,ve,Ce):Ce<ve?Ce++:W.push(Me),W.length===de)break}return Ce}_createTree(W){let K=new n.KDBush(W.length/this.stride|0,this.options.nodeSize,Float32Array);for(let de=0;de<W.length;de+=this.stride)K.add(W[de],W[de+1]);return K.finish(),K.data=W,K}_addTileFeatures(W,K,de,ve,Ce,ke){for(let Me of W){let we=Me*this.stride,je=K[we+ri]>1,ft,vt,ut;if(je)ft=ao(K,we,this.clusterProps),vt=K[we],ut=K[we+1];else{let pi=this.points[K[we+Ft]];ft=pi.properties;let[wi,Ni]=pi.geometry.coordinates;vt=un(wi),ut=Vo(Ni)}let hi={type:1,geometry:[[Math.round(this.options.extent*(vt*Ce-de)),Math.round(this.options.extent*(ut*Ce-ve))]],tags:ft},xi;xi=je||this.options.generateId?K[we+Ft]:this.points[K[we+Ft]].id,xi!==void 0&&(hi.id=xi),ke.features.push(hi)}}_limitZoom(W){return Math.max(this.options.minZoom,Math.min(Math.floor(+W),this.options.maxZoom+1))}_cluster(W,K){let{radius:de,extent:ve,reduce:Ce,minPoints:ke}=this.options,Me=de/(ve*Math.pow(2,K)),we=W.data,je=[],ft=this.stride;for(let vt=0;vt<we.length;vt+=ft){if(we[vt+2]<=K)continue;we[vt+2]=K;let ut=we[vt],hi=we[vt+1],xi=W.within(we[vt],we[vt+1],Me),pi=we[vt+ri],wi=pi;for(let Ni of xi){let Hn=Ni*ft;we[Hn+2]>K&&(wi+=we[Hn+ri])}if(wi>pi&&wi>=ke){let Ni,Hn=ut*pi,ar=hi*pi,Zr=-1,yr=((vt/ft|0)<<5)+(K+1)+this.points.length;for(let Ms of xi){let Tr=Ms*ft;if(we[Tr+2]<=K)continue;we[Tr+2]=K;let lo=we[Tr+ri];Hn+=we[Tr]*lo,ar+=we[Tr+1]*lo,we[Tr+4]=yr,Ce&&(Ni||(Ni=this._map(we,vt,!0),Zr=this.clusterProps.length,this.clusterProps.push(Ni)),Ce(Ni,this._map(we,Tr)))}we[vt+4]=yr,je.push(Hn/wi,ar/wi,1/0,yr,-1,wi),Ce&&je.push(Zr)}else{for(let Ni=0;Ni<ft;Ni++)je.push(we[vt+Ni]);if(wi>1)for(let Ni of xi){let Hn=Ni*ft;if(!(we[Hn+2]<=K)){we[Hn+2]=K;for(let ar=0;ar<ft;ar++)je.push(we[Hn+ar])}}}}return je}_getOriginId(W){return W-this.points.length>>5}_getOriginZoom(W){return(W-this.points.length)%32}_map(W,K,de){if(W[K+ri]>1){let ke=this.clusterProps[W[K+Pn]];return de?Object.assign({},ke):ke}let ve=this.points[W[K+Ft]].properties,Ce=this.options.map(ve);return de&&Ce===ve?Object.assign({},Ce):Ce}}function ir(pe,W,K){return{type:"Feature",id:pe[W+Ft],properties:ao(pe,W,K),geometry:{type:"Point",coordinates:[(de=pe[W],360*(de-.5)),fc(pe[W+1])]}};var de}function ao(pe,W,K){let de=pe[W+ri],ve=de>=1e4?`${Math.round(de/1e3)}k`:de>=1e3?Math.round(de/100)/10+"k":de,Ce=pe[W+Pn],ke=Ce===-1?{}:Object.assign({},K[Ce]);return Object.assign(ke,{cluster:!0,cluster_id:pe[W+Ft],point_count:de,point_count_abbreviated:ve})}function un(pe){return pe/360+.5}function Vo(pe){let W=Math.sin(pe*Math.PI/180),K=.5-.25*Math.log((1+W)/(1-W))/Math.PI;return K<0?0:K>1?1:K}function fc(pe){let W=(180-360*pe)*Math.PI/180;return 360*Math.atan(Math.exp(W))/Math.PI-90}function Zn(pe,W,K,de){for(var ve,Ce=de,ke=K-W>>1,Me=K-W,we=pe[W],je=pe[W+1],ft=pe[K],vt=pe[K+1],ut=W+3;ut<K;ut+=3){var hi=fo(pe[ut],pe[ut+1],we,je,ft,vt);if(hi>Ce)ve=ut,Ce=hi;else if(hi===Ce){var xi=Math.abs(ut-ke);xi<Me&&(ve=ut,Me=xi)}}Ce>de&&(ve-W>3&&Zn(pe,W,ve,de),pe[ve+2]=Ce,K-ve>3&&Zn(pe,ve,K,de))}function fo(pe,W,K,de,ve,Ce){var ke=ve-K,Me=Ce-de;if(ke!==0||Me!==0){var we=((pe-K)*ke+(W-de)*Me)/(ke*ke+Me*Me);we>1?(K=ve,de=Ce):we>0&&(K+=ke*we,de+=Me*we)}return(ke=pe-K)*ke+(Me=W-de)*Me}function ii(pe,W,K,de){var ve={id:pe===void 0?null:pe,type:W,geometry:K,tags:de,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Ce){var ke=Ce.geometry,Me=Ce.type;if(Me==="Point"||Me==="MultiPoint"||Me==="LineString")as(Ce,ke);else if(Me==="Polygon"||Me==="MultiLineString")for(var we=0;we<ke.length;we++)as(Ce,ke[we]);else if(Me==="MultiPolygon")for(we=0;we<ke.length;we++)for(var je=0;je<ke[we].length;je++)as(Ce,ke[we][je])}(ve),ve}function as(pe,W){for(var K=0;K<W.length;K+=3)pe.minX=Math.min(pe.minX,W[K]),pe.minY=Math.min(pe.minY,W[K+1]),pe.maxX=Math.max(pe.maxX,W[K]),pe.maxY=Math.max(pe.maxY,W[K+1])}function zr(pe,W,K,de){if(W.geometry){var ve=W.geometry.coordinates,Ce=W.geometry.type,ke=Math.pow(K.tolerance/((1<<K.maxZoom)*K.extent),2),Me=[],we=W.id;if(K.promoteId?we=W.properties[K.promoteId]:K.generateId&&(we=de||0),Ce==="Point")Pu(ve,Me);else if(Ce==="MultiPoint")for(var je=0;je<ve.length;je++)Pu(ve[je],Me);else if(Ce==="LineString")Un(ve,Me,ke,!1);else if(Ce==="MultiLineString"){if(K.lineMetrics){for(je=0;je<ve.length;je++)Un(ve[je],Me=[],ke,!1),pe.push(ii(we,"LineString",Me,W.properties));return}Bo(ve,Me,ke,!1)}else if(Ce==="Polygon")Bo(ve,Me,ke,!0);else{if(Ce!=="MultiPolygon"){if(Ce==="GeometryCollection"){for(je=0;je<W.geometry.geometries.length;je++)zr(pe,{id:we,geometry:W.geometry.geometries[je],properties:W.properties},K,de);return}throw new Error("Input data is not a valid GeoJSON object.")}for(je=0;je<ve.length;je++){var ft=[];Bo(ve[je],ft,ke,!0),Me.push(ft)}}pe.push(ii(we,Ce,Me,W.properties))}}
vendor: 7,721 bytes, line 8
8function Pu(pe,W){W.push(uh(pe[0])),W.push(ra(pe[1])),W.push(0)}function Un(pe,W,K,de){for(var ve,Ce,ke=0,Me=0;Me<pe.length;Me++){var we=uh(pe[Me][0]),je=ra(pe[Me][1]);W.push(we),W.push(je),W.push(0),Me>0&&(ke+=de?(ve*je-we*Ce)/2:Math.sqrt(Math.pow(we-ve,2)+Math.pow(je-Ce,2))),ve=we,Ce=je}var ft=W.length-3;W[2]=1,Zn(W,0,ft,K),W[ft+2]=1,W.size=Math.abs(ke),W.start=0,W.end=W.size}function Bo(pe,W,K,de){for(var ve=0;ve<pe.length;ve++){var Ce=[];Un(pe[ve],Ce,K,de),W.push(Ce)}}function uh(pe){return pe/360+.5}function ra(pe){var W=Math.sin(pe*Math.PI/180),K=.5-.25*Math.log((1+W)/(1-W))/Math.PI;return K<0?0:K>1?1:K}function To(pe,W,K,de,ve,Ce,ke,Me){if(de/=W,Ce>=(K/=W)&&ke<de)return pe;if(ke<K||Ce>=de)return null;for(var we=[],je=0;je<pe.length;je++){var ft=pe[je],vt=ft.geometry,ut=ft.type,hi=ve===0?ft.minX:ft.minY,xi=ve===0?ft.maxX:ft.maxY;if(hi>=K&&xi<de)we.push(ft);else if(!(xi<K||hi>=de)){var pi=[];if(ut==="Point"||ut==="MultiPoint")Ou(vt,pi,K,de,ve);else if(ut==="LineString")mc(vt,pi,K,de,ve,!1,Me.lineMetrics);else if(ut==="MultiLineString")Na(vt,pi,K,de,ve,!1);else if(ut==="Polygon")Na(vt,pi,K,de,ve,!0);else if(ut==="MultiPolygon")for(var wi=0;wi<vt.length;wi++){var Ni=[];Na(vt[wi],Ni,K,de,ve,!0),Ni.length&&pi.push(Ni)}if(pi.length){if(Me.lineMetrics&&ut==="LineString"){for(wi=0;wi<pi.length;wi++)we.push(ii(ft.id,ut,pi[wi],ft.tags));continue}ut!=="LineString"&&ut!=="MultiLineString"||(pi.length===1?(ut="LineString",pi=pi[0]):ut="MultiLineString"),ut!=="Point"&&ut!=="MultiPoint"||(ut=pi.length===3?"Point":"MultiPoint"),we.push(ii(ft.id,ut,pi,ft.tags))}}}return we.length?we:null}function Ou(pe,W,K,de,ve){for(var Ce=0;Ce<pe.length;Ce+=3){var ke=pe[Ce+ve];ke>=K&&ke<=de&&(W.push(pe[Ce]),W.push(pe[Ce+1]),W.push(pe[Ce+2]))}}function mc(pe,W,K,de,ve,Ce,ke){for(var Me,we,je=Ru(pe),ft=ve===0?dh:hh,vt=pe.start,ut=0;ut<pe.length-3;ut+=3){var hi=pe[ut],xi=pe[ut+1],pi=pe[ut+2],wi=pe[ut+3],Ni=pe[ut+4],Hn=ve===0?hi:xi,ar=ve===0?wi:Ni,Zr=!1;ke&&(Me=Math.sqrt(Math.pow(hi-wi,2)+Math.pow(xi-Ni,2))),Hn<K?ar>K&&(we=ft(je,hi,xi,wi,Ni,K),ke&&(je.start=vt+Me*we)):Hn>de?ar<de&&(we=ft(je,hi,xi,wi,Ni,de),ke&&(je.start=vt+Me*we)):gc(je,hi,xi,pi),ar<K&&Hn>=K&&(we=ft(je,hi,xi,wi,Ni,K),Zr=!0),ar>de&&Hn<=de&&(we=ft(je,hi,xi,wi,Ni,de),Zr=!0),!Ce&&Zr&&(ke&&(je.end=vt+Me*we),W.push(je),je=Ru(pe)),ke&&(vt+=Me)}var yr=pe.length-3;hi=pe[yr],xi=pe[yr+1],pi=pe[yr+2],(Hn=ve===0?hi:xi)>=K&&Hn<=de&&gc(je,hi,xi,pi),yr=je.length-3,Ce&&yr>=3&&(je[yr]!==je[0]||je[yr+1]!==je[1])&&gc(je,je[0],je[1],je[2]),je.length&&W.push(je)}function Ru(pe){var W=[];return W.size=pe.size,W.start=pe.start,W.end=pe.end,W}function Na(pe,W,K,de,ve,Ce){for(var ke=0;ke<pe.length;ke++)mc(pe[ke],W,K,de,ve,Ce,!1)}function gc(pe,W,K,de){pe.push(W),pe.push(K),pe.push(de)}function dh(pe,W,K,de,ve,Ce){var ke=(Ce-W)/(de-W);return pe.push(Ce),pe.push(K+(ve-K)*ke),pe.push(1),ke}function hh(pe,W,K,de,ve,Ce){var ke=(Ce-K)/(ve-K);return pe.push(W+(de-W)*ke),pe.push(Ce),pe.push(1),ke}function Uo(pe,W){for(var K=[],de=0;de<pe.length;de++){var ve,Ce=pe[de],ke=Ce.type;if(ke==="Point"||ke==="MultiPoint"||ke==="LineString")ve=za(Ce.geometry,W);else if(ke==="MultiLineString"||ke==="Polygon"){ve=[];for(var Me=0;Me<Ce.geometry.length;Me++)ve.push(za(Ce.geometry[Me],W))}else if(ke==="MultiPolygon")for(ve=[],Me=0;Me<Ce.geometry.length;Me++){for(var we=[],je=0;je<Ce.geometry[Me].length;je++)we.push(za(Ce.geometry[Me][je],W));ve.push(we)}K.push(ii(Ce.id,ke,ve,Ce.tags))}return K}function za(pe,W){var K=[];K.size=pe.size,pe.start!==void 0&&(K.start=pe.start,K.end=pe.end);for(var de=0;de<pe.length;de+=3)K.push(pe[de]+W,pe[de+1],pe[de+2]);return K}function Lu(pe,W){if(pe.transformed)return pe;var K,de,ve,Ce=1<<pe.z,ke=pe.x,Me=pe.y;for(K=0;K<pe.features.length;K++){var we=pe.features[K],je=we.geometry,ft=we.type;if(we.geometry=[],ft===1)for(de=0;de<je.length;de+=2)we.geometry.push(Il(je[de],je[de+1],W,Ce,ke,Me));else for(de=0;de<je.length;de++){var vt=[];for(ve=0;ve<je[de].length;ve+=2)vt.push(Il(je[de][ve],je[de][ve+1],W,Ce,ke,Me));we.geometry.push(vt)}}return pe.transformed=!0,pe}function Il(pe,W,K,de,ve,Ce){return[Math.round(K*(pe*de-ve)),Math.round(K*(W*de-Ce))]}function _c(pe,W,K,de,ve){for(var Ce=W===ve.maxZoom?0:ve.tolerance/((1<<W)*ve.extent),ke={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:K,y:de,z:W,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Me=0;Me<pe.length;Me++){ke.numFeatures++,Fu(ke,pe[Me],Ce,ve);var we=pe[Me].minX,je=pe[Me].minY,ft=pe[Me].maxX,vt=pe[Me].maxY;we<ke.minX&&(ke.minX=we),je<ke.minY&&(ke.minY=je),ft>ke.maxX&&(ke.maxX=ft),vt>ke.maxY&&(ke.maxY=vt)}return ke}function Fu(pe,W,K,de){var ve=W.geometry,Ce=W.type,ke=[];if(Ce==="Point"||Ce==="MultiPoint")for(var Me=0;Me<ve.length;Me+=3)ke.push(ve[Me]),ke.push(ve[Me+1]),pe.numPoints++,pe.numSimplified++;else if(Ce==="LineString")Dl(ke,ve,pe,K,!1,!1);else if(Ce==="MultiLineString"||Ce==="Polygon")for(Me=0;Me<ve.length;Me++)Dl(ke,ve[Me],pe,K,Ce==="Polygon",Me===0);else if(Ce==="MultiPolygon")for(var we=0;we<ve.length;we++){var je=ve[we];for(Me=0;Me<je.length;Me++)Dl(ke,je[Me],pe,K,!0,Me===0)}if(ke.length){var ft=W.tags||null;if(Ce==="LineString"&&de.lineMetrics){for(var vt in ft={},W.tags)ft[vt]=W.tags[vt];ft.mapbox_clip_start=ve.start/ve.size,ft.mapbox_clip_end=ve.end/ve.size}var ut={geometry:ke,type:Ce==="Polygon"||Ce==="MultiPolygon"?3:Ce==="LineString"||Ce==="MultiLineString"?2:1,tags:ft};W.id!==null&&(ut.id=W.id),pe.features.push(ut)}}function Dl(pe,W,K,de,ve,Ce){var ke=de*de;if(de>0&&W.size<(ve?ke:de))K.numPoints+=W.length/3;else{for(var Me=[],we=0;we<W.length;we+=3)(de===0||W[we+2]>ke)&&(K.numSimplified++,Me.push(W[we]),Me.push(W[we+1])),K.numPoints++;ve&&function(je,ft){for(var vt=0,ut=0,hi=je.length,xi=hi-2;ut<hi;xi=ut,ut+=2)vt+=(je[ut]-je[xi])*(je[ut+1]+je[xi+1]);if(vt>0===ft)for(ut=0,hi=je.length;ut<hi/2;ut+=2){var pi=je[ut],wi=je[ut+1];je[ut]=je[hi-2-ut],je[ut+1]=je[hi-1-ut],je[hi-2-ut]=pi,je[hi-1-ut]=wi}}(Me,Ce),pe.push(Me)}}function ja(pe,W){var K=(W=this.options=function(ve,Ce){for(var ke in Ce)ve[ke]=Ce[ke];return ve}(Object.create(this.options),W)).debug;if(K&&console.time("preprocess data"),W.maxZoom<0||W.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(W.promoteId&&W.generateId)throw new Error("promoteId and generateId cannot be used together.");var de=function(ve,Ce){var ke=[];if(ve.type==="FeatureCollection")for(var Me=0;Me<ve.features.length;Me++)zr(ke,ve.features[Me],Ce,Me);else zr(ke,ve.type==="Feature"?ve:{geometry:ve},Ce);return ke}(pe,W);this.tiles={},this.tileCoords=[],K&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",W.indexMaxZoom,W.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),de=function(ve,Ce){var ke=Ce.buffer/Ce.extent,Me=ve,we=To(ve,1,-1-ke,ke,0,-1,2,Ce),je=To(ve,1,1-ke,2+ke,0,-1,2,Ce);return(we||je)&&(Me=To(ve,1,-ke,1+ke,0,-1,2,Ce)||[],we&&(Me=Uo(we,1).concat(Me)),je&&(Me=Me.concat(Uo(je,-1)))),Me}(de,W),de.length&&this.splitTile(de,0,0,0),K&&(de.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Ml(pe,W,K){return 32*((1<<pe)*K+W)+pe}function kl(pe,W){let K=pe.tileID.canonical;if(!this._geoJSONIndex)return W(null,null);let de=this._geoJSONIndex.getTile(K.z,K.x,K.y);if(!de)return W(null,null);let ve=new class{constructor(ke){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=n.EXTENT,this.length=ke.length,this._features=ke}feature(ke){return new class{constructor(Me){this._feature=Me,this.extent=n.EXTENT,this.type=Me.type,this.properties=Me.tags,"id"in Me&&!isNaN(Me.id)&&(this.id=p
8arseInt(Me.id,10))}loadGeometry(){if(this._feature.type===1){let Me=[];for(let we of this._feature.geometry)Me.push([new n.Point(we[0],we[1])]);return Me}{let Me=[];for(let we of this._feature.geometry){let je=[];for(let ft of we)je.push(new n.Point(ft[0],ft[1]));Me.push(je)}return Me}}toGeoJSON(Me,we,je){return _e.call(this,Me,we,je)}}(this._features[ke])}}(de.features),Ce=Fa(ve);Ce.byteOffset===0&&Ce.byteLength===Ce.buffer.byteLength||(Ce=new Uint8Array(Ce)),W(null,{vectorTile:ve,rawData:Ce.buffer})}ja.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ja.prototype.splitTile=function(pe,W,K,de,ve,Ce,ke){for(var Me=[pe,W,K,de],we=this.options,je=we.debug;Me.length;){de=Me.pop(),K=Me.pop(),W=Me.pop(),pe=Me.pop();var ft=1<<W,vt=Ml(W,K,de),ut=this.tiles[vt];if(!ut&&(je>1&&console.time("creation"),ut=this.tiles[vt]=_c(pe,W,K,de,we),this.tileCoords.push({z:W,x:K,y:de}),je)){je>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",W,K,de,ut.numFeatures,ut.numPoints,ut.numSimplified),console.timeEnd("creation"));var hi="z"+W;this.stats[hi]=(this.stats[hi]||0)+1,this.total++}if(ut.source=pe,ve){if(W===we.maxZoom||W===ve)continue;var xi=1<<ve-W;if(K!==Math.floor(Ce/xi)||de!==Math.floor(ke/xi))continue}else if(W===we.indexMaxZoom||ut.numPoints<=we.indexMaxPoints)continue;if(ut.source=null,pe.length!==0){je>1&&console.time("clipping");var pi,wi,Ni,Hn,ar,Zr,yr=.5*we.buffer/we.extent,Ms=.5-yr,Tr=.5+yr,lo=1+yr;pi=wi=Ni=Hn=null,ar=To(pe,ft,K-yr,K+Tr,0,ut.minX,ut.maxX,we),Zr=To(pe,ft,K+Ms,K+lo,0,ut.minX,ut.maxX,we),pe=null,ar&&(pi=To(ar,ft,de-yr,de+Tr,1,ut.minY,ut.maxY,we),wi=To(ar,ft,de+Ms,de+lo,1,ut.minY,ut.maxY,we),ar=null),Zr&&(Ni=To(Zr,ft,de-yr,de+Tr,1,ut.minY,ut.maxY,we),Hn=To(Zr,ft,de+Ms,de+lo,1,ut.minY,ut.maxY,we),Zr=null),je>1&&console.timeEnd("clipping"),Me.push(pi||[],W+1,2*K,2*de),Me.push(wi||[],W+1,2*K,2*de+1),Me.push(Ni||[],W+1,2*K+1,2*de),Me.push(Hn||[],W+1,2*K+1,2*de+1)}}},ja.prototype.getTile=function(pe,W,K){var de=this.options,ve=de.extent,Ce=de.debug;if(pe<0||pe>24)return null;var ke=1<<pe,Me=Ml(pe,W=(W%ke+ke)%ke,K);if(this.tiles[Me])return Lu(this.tiles[Me],ve);Ce>1&&console.log("drilling down to z%d-%d-%d",pe,W,K);for(var we,je=pe,ft=W,vt=K;!we&&je>0;)je--,ft=Math.floor(ft/2),vt=Math.floor(vt/2),we=this.tiles[Ml(je,ft,vt)];return we&&we.source?(Ce>1&&console.log("found parent tile z%d-%d-%d",je,ft,vt),Ce>1&&console.time("drilling down"),this.splitTile(we.source,je,ft,vt,pe,W,K),Ce>1&&console.timeEnd("drilling down"),this.tiles[Me]?Lu(this.tiles[Me],ve):null):null};class vc extends n.VectorTileWorkerSource{constructor(W,K,de,ve,Ce){super(W,K,de,ve,kl),Ce&&(this.loadGeoJSON=Ce)}loadData(W,K){let de=W&&W.request,ve=de&&de.collectResourceTiming;this.loadGeoJSON(W,(Ce,ke)=>{if(Ce||!ke)return K(Ce);if(typeof ke!="object")return K(new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`));{ie(ke,!0);try{if(W.filter){let we=n.createExpression(W.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(we.result==="error")throw new Error(we.value.map(ft=>
8`${ft.key}: ${ft.message}`).join(", "));ke={type:"FeatureCollection",features:ke.features.filter(ft=>we.value.evaluate({zoom:0},ft))}}this._geoJSONIndex=W.cluster?new cn(function({superclusterOptions:we,clusterProperties:je}){if(!je||!we)return we;let ft={},vt={},ut={accumulated:null,zoom:0},hi={properties:null},xi=Object.keys(je);for(let pi of xi){let[wi,Ni]=je[pi],Hn=n.createExpression(Ni),ar=n.createExpression(typeof wi=="string"?[wi,["accumulated"],["get",pi]]:wi);ft[pi]=Hn.value,vt[pi]=ar.value}return we.map=pi=>{hi.properties=pi;let wi={};for(let Ni of xi)wi[Ni]=ft[Ni].evaluate(ut,hi);return wi},we.reduce=(pi,wi)=>{hi.properties=wi;for(let Ni of xi)ut.accumulated=pi[Ni],pi[Ni]=vt[Ni].evaluate(ut,hi)},we}(W)).load(ke.features):function(we,je){return new ja(we,je)}(ke,W.geojsonVtOptions)}catch(we){return K(we)}this.loaded={};let Me={};if(ve){let we=n.getPerformanceMeasurement(de);we&&(Me.resourceTiming={},Me.resourceTiming[W.source]=JSON.parse(JSON.stringify(we)))}K(null,Me)}})}reloadTile(W,K){let de=this.loaded;return de&&de[W.uid]?super.reloadTile(W,K):this.loadTile(W,K)}loadGeoJSON(W,K){if(W.request)n.getJSON(W.request,K);else{if(typeof W.data!="string")return K(new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`));try{return K(null,JSON.parse(W.data))}catch{return K(new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(W,K){try{K(null,this._geoJSONIndex.getClusterExpansionZoom(W.clusterId))}catch(de){K(de)}}getClusterChildren(W,K){try{K(null,this._geoJSONIndex.getChildren(W.clusterId))}catch(de){K(de)}}getClusterLeaves(W,K){try{K(null,this._geoJSONIndex.getLeaves(W.clusterId,W.limit,W.offset))}catch(de){K(de)}}}class ph{constructor(W){this.self=W,this.actor=new n.Actor(W,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=n.getProjection({name:"mercator"}),this.workerSourceTypes={vector:n.VectorTileWorkerSource,geojson:vc},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(K,de)=>{if(this.workerSourceTypes[K])throw new Error(`Worker source with name "${K}" already registered.`);this.workerSourceTypes[K]=de},this.self.registerRTLTextPlugin=K=>{if(n.plugin.isParsed())throw new Error("RTL text plugin already registered.");n.plugin.applyArabicShaping=K.applyArabicShaping,n.plugin.processBidirectionalText=K.processBidirectionalText,n.plugin.processStyledBidirectionalText=K.processStyledBidirectionalText}}clearCaches(W,K,de){delete this.layerIndexes[W],delete this.availableImages[W],delete this.workerSources[W],delete this.demWorkerSources[W],de()}checkIfReady(W,K,de){de()}setReferrer(W,K){this.referrer=K}spriteLoaded(W,K){this.isSpriteLoaded[W]=K;for(let de in this.workerSources[W]){let ve=this.workerSources[W][de];for(let Ce in ve)ve[Ce]instanceof n.VectorTileWorkerSource&&(ve[Ce].isSpriteLoaded=K,ve[Ce].fire(new n.Event("isSpriteLoaded")))}}setImages(W,K,de){this.availableImages[W]=K;for(let ve in this.workerSources[W]){let Ce=this.workerSources[W][ve];for(let ke in Ce)Ce[ke].availableImages=K}de()}enableTerrain(W,K,de){this.terrain=K,de()}setProjection(W,K){this.projections[W]=n.getProjection(K)}setLayers(W,K,de){this.getLayerIndex(W).replace(K),de()}updateLayers(W,K,de){this.getLayerIndex(W).update(K.layers,K.removedIds),de()}loadTile(W,K,de){let ve=this.enableTerrain?n.extend({enableTerrain:this.terrain},K):K;ve.projection=this.projections[W]||this.defaultProjection,this.getWorkerSource(W,K.type,K.source).loadTile(ve,de)}loadDEMTile(W,K,de){let ve=this.enableTerrain?n.extend({buildQuadTree:this.terrain},K):K;this.getDEMWorkerSource(W,K.source).loadTile(ve,de)}reloadTile(W,K,de){let ve=this.enableTerrain?n.extend({enableTerrain:this.terrain},K):K;ve.projection=this.projections[W]||this.defaultProjection,this.getWorkerSource(W,K.type,K.source).reloadTile(ve,de)}abortTile(W,K,de){this.getWorkerSource(W,K.type,K.source).abortTile(K,de)}removeTile(W,K,de){this.getWorkerSource(W,K.type,K.source).removeTile(K,de)}removeSource(W,K,de){if(!this.workerSources[W]||!this.workerSources[W][K.type]||!this.workerSources[W][K.type][K.source])return;let ve=this.workerSources[W][K.type][K.source];delete this.workerSources[W][K.type][K.source],ve.removeSource!==void 0?ve.removeSource(K,de):de()}loadWorkerSource(W,K,de){try{this.self.importScripts(K.url),de()}catch(ve){de(ve.toString())}}syncRTLPluginState(W,K,de){try{n.plugin.setState(K);let ve=n.plugin.getPluginURL();if(n.plugin.isLoaded()&&!n.plugin.isParsed()&&ve!=null){this.self.importScripts(ve);let Ce=n.plugin.isParsed();de(Ce?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ve}`),Ce)}}catch(ve){de(ve.toString())}}getAvailableImages(W){let K=this.availableImages[W];return K||(K=[]),K}getLayerIndex(W){let K=this.layerIndexes[W];return K||(K=this.layerIndexes[W]=new C),K}getWorkerSource(W,K,de){if(this.workerSources[W]||(this.workerSources[W]={}),this.workerSources[W][K]||(this.workerSources[W][K]={}),!this.workerSources[W][K][de]){let ve={send:(Ce,ke,Me,we,je,ft)=>{this.actor.send(Ce,ke,Me,W,je,ft)},scheduler:this.actor.scheduler};this.workerSources[W][K][de]=new this.workerSourceTypes[K](ve,this.getLayerIndex(W),this.getAvailableImages(W),this.isSpriteLoaded[W])}return this.workerSources[W][K][de]}getDEMWorkerSource(W,K){return this.demWorkerSources[W]||(this.demWorkerSources[W]={}),this.demWorkerSources[W][K]||(this.demWorkerSources[W][K]=new M),this.demWorkerSources[W][K]}enforceCacheSizeLimit(W,K){n.enforceCacheSizeLimit(K)}getWorkerPerformanceMetrics(W,K,de){de(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new ph(self)),p
8h}),t(["./shared"],function(n){"use strict";function d(f,c){if(Array.isArray(f)){if(!Array.isArray(c)||f.length!==c.length)return!1;for(let h=0;h<f.length;h++)if(!d(f[h],c[h]))return!1;return!0}if(typeof f=="object"&&f!==null&&c!==null){if(typeof c!="object"||Object.keys(f).length!==Object.keys(c).length)return!1;for(let h in f)if(!d(f[h],c[h]))return!1;return!0}return f===c}var _=C;function C(f){return!function(c){return typeof window>"u"||typeof document>"u"?"not a browser":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 g,y,x=new Blob([""],{type:"text/javascript"}),I=URL.createObjectURL(x);try{y=new Worker(I),g=!0}catch{g=!1}return y&&y.terminate(),URL.revokeObjectURL(I),g}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var g=document.createElement("canvas");g.width=g.height=1;var y=g.getContext("2d");if(!y)return!1;var x=y.getImageData(0,0,1,1);return x&&x.width===g.width}()?(M[h=c&&c.failIfMajorPerformanceCaveat]===void 0&&(M[h]=function(g){var y,x=function(I){var D=document.createElement("canvas"),O=Object.create(C.webGLContextAttributes);return O.failIfMajorPerformanceCaveat=I,D.getContext("webgl",O)||D.getContext("experimental-webgl",O)}(g);if(!x)return!1;try{y=x.createShader(x.VERTEX_SHADER)}catch{return!1}return!(!y||x.isContextLost())&&(x.shaderSource(y,"void main() {}"),x.compileShader(y),x.getShaderParameter(y,x.COMPILE_STATUS)===!0)}(h)),M[h]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var h}(f)}var M={};function j(f,c,h){let g=n.window.document.createElement(f);return c!==void 0&&(g.className=c),h&&h.appendChild(g),g}function G(f,c,h){let g=n.window.document.createElementNS("http://www.w3.org/2000/svg",f);for(let y of Object.keys(c))g.setAttributeNS(null,y,c[y]);return h&&h.appendChild(g),g}C.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};let ie=n.window.document&&n.window.document.documentElement.style,_e=ie&&ie.userSelect!==void 0?"userSelect":"WebkitUserSelect",Ee;function Ye(){ie&&_e&&(Ee=ie[_e],ie[_e]="none")}function $e(){ie&&_e&&(ie[_e]=Ee)}function at(f){f.preventDefault(),f.stopPropagation(),n.window.removeEventListener("click",at,!0)}function Lt(){n.window.addEventListener("click",at,!0),n.window.setTimeout(()=>{n.window.removeEventListener("click",at,!0)},0)}function jt(f,c){let h=f.getBoundingClientRect();return Fi(f,h,c)}function $t(f,c){let h=f.getBoundingClientRect(),g=[];for(let y=0;y<c.length;y++)g.push(Fi(f,h,c[y]));return g}function tn(f){return n.window.InstallTrigger!==void 0&&f.button===2&&f.ctrlKey&&n.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:f.button}function Fi(f,c,h){let g=f.offsetWidth===c.width?1:f.offsetWidth/c.width;return new n.Point((h.clientX-c.left)*g,(h.clientY-c.top)*g)}function tt(f,c){var h=c[0],g=c[1],y=c[2],x=c[3],I=h*x-y*g;return I?(f[0]=x*(I=1/I),f[1]=-g*I,f[2]=-y*I,f[3]=h*I,f):null}function Sr(f){let{userImage:c}=f;return!!(c&&c.render&&c.render())&&(f.data.replace(new Uint8Array(c.data.buffer)),!0)}class so extends n.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new n.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(c){if(this.loaded!==c&&(this.loaded=c,c)){for(let{ids:h,callback:g}of this.requestors)this._notify(h,g);this.requestors=[]}}hasImage(c){return!!this.getImage(c)}getImage(c){return this.images[c]}
8addImage(c,h){this._validate(c,h)&&(this.images[c]=h)}_validate(c,h){let g=!0;return this._validateStretch(h.stretchX,h.data&&h.data.width)||(this.fire(new n.ErrorEvent(new Error(`Image "${c}" has invalid "stretchX" value`))),g=!1),this._validateStretch(h.stretchY,h.data&&h.data.height)||(this.fire(new n.ErrorEvent(new Error(`Image "${c}" has invalid "stretchY" value`))),g=!1),this._validateContent(h.content,h)||(this.fire(new n.ErrorEvent(new Error(`Image "${c}" has invalid "content" value`))),g=!1),g}_validateStretch(c,h){if(!c)return!0;let g=0;for(let y of c){if(y[0]<g||y[1]<y[0]||h<y[1])return!1;g=y[1]}return!0}_validateContent(c,h){return!(c&&(c.length!==4||c[0]<0||h.data.width<c[0]||c[1]<0||h.data.height<c[1]||c[2]<0||h.data.width<c[2]||c[3]<0||h.data.height<c[3]||c[2]<c[0]||c[3]<c[1]))}updateImage(c,h){h.version=this.images[c].version+1,this.images[c]=h,this.updatedImages[c]=!0}removeImage(c){let h=this.images[c];delete this.images[c],delete this.patterns[c],h.userImage&&h.userImage.onRemove&&h.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(c,h){let g=!0;if(!this.isLoaded())for(let y of c)this.images[y]||(g=!1);this.isLoaded()||g?this._notify(c,h):this.requestors.push({ids:c,callback:h})}_notify(c,h){let g={};for(let y of c){this.images[y]||this.fire(new n.Event("styleimagemissing",{id:y}));let x=this.images[y];x?g[y]={data:x.data.clone(),pixelRatio:x.pixelRatio,sdf:x.sdf,version:x.version,stretchX:x.stretchX,stretchY:x.stretchY,content:x.content,hasRenderCallback:!!(x.userImage&&x.userImage.render)}:n.warnOnce(`Image "${y}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}h(null,g)}getPixelSize(){let{width:c,height:h}=this.atlasImage;return{width:c,height:h}}getPattern(c){let h=this.patterns[c],g=this.getImage(c);if(!g)return null;if(h&&h.position.version===g.version)return h.position;if(h)h.position.version=g.version;else{let y={w:g.data.width+2,h:g.data.height+2,x:0,y:0},x=new n.ImagePosition(y,g);this.patterns[c]={bin:y,position:x}}return this._updatePatternAtlas(),this.patterns[c].position}bind(c){let h=c.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new n.Texture(c,this.atlasImage,h.RGBA),this.atlasTexture&&this.atlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE)}_updatePatternAtlas(){let c=[];for(let x in this.patterns)c.push(this.patterns[x].bin);let{w:h,h:g}=n.potpack(c),y=this.atlasImage;y.resize({width:h||1,height:g||1});for(let x in this.patterns){let{bin:I}=this.patterns[x],D=I.x+1,O=I.y+1,z=this.images[x].data,F=z.width,U=z.height;n.RGBAImage.copy(z,y,{x:0,y:0},{x:D,y:O},{width:F,height:U}),n.RGBAImage.copy(z,y,{x:0,y:U-1},{x:D,y:O-1},{width:F,height:1}),n.RGBAImage.copy(z,y,{x:0,y:0},{x:D,y:O+U},{width:F,height:1}),n.RGBAImage.copy(z,y,{x:F-1,y:0},{x:D-1,y:O},{width:1,height:U}),n.RGBAImage.copy(z,y,{x:0,y:0},{x:D+F,y:O},{width:1,height:U})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(c){for(let h of c){if(this.callbackDispatchedThisFrame[h])continue;this.callbackDispatchedThisFrame[h]=!0;let g=this.images[h];Sr(g)&&this.updateImage(h,g)}}}let ai=new n.Properties({anchor:new n.DataConstantProperty(n.spec.light.anchor),position:new class{constructor(){this.specification=n.spec.light.position}possiblyEvaluate(f,c){return function([h,g,y]){let x=n.degToRad(g+90),I=n.degToRad(y);return{x:h*Math.cos(x)*Math.sin(I),y:h*Math.sin(x)*Math.sin(I),z:h*Math.cos(I),azimuthal:g,polar:y}}(f.expression.evaluate(c))}interpolate(f,c,h){return{x:n.number(f.x,c.x,h),y:n.number(f.y,c.y,h),z:n.number(f.z,c.z,h),azimuthal:n.number(f.azimuthal,c.azimuthal,h),polar:n.number(f.polar,c.polar,h)}}},color:new n.DataConstantProperty(n.spec.light.color),intensity:new n.DataConstantProperty(n.spec.light.intensity)});class sr extends n.Evented{constructor(c){super(),this._transitionable=new n.Transitionable(ai),this.setLight(c),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(c,h={}
8){if(!this._validate(n.validateLight,c,h))for(let g in c){let y=c[g];n.endsWith(g,"-transition")?this._transitionable.setTransition(g.slice(0,-11),y):this._transitionable.setValue(g,y)}}updateTransitions(c){this._transitioning=this._transitionable.transitioned(c,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(c){this.properties=this._transitioning.possiblyEvaluate(c)}_validate(c,h,g){return(!g||g.validate!==!1)&&n.emitValidationErrors(this,c.call(n.validateStyle,n.extend({value:h,style:{glyphs:!0,sprite:!0},styleSpec:n.spec})))}}let na=new n.Properties({source:new n.DataConstantProperty(n.spec.terrain.source),exaggeration:new n.DataConstantProperty(n.spec.terrain.exaggeration)}),jo=class extends n.Evented{constructor(f,c){super(),this._transitionable=new n.Transitionable(na),this.set(f),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=c}get(){return this._transitionable.serialize()}set(f){for(let c in f){let h=f[c];n.endsWith(c,"-transition")?this._transitionable.setTransition(c.slice(0,-11),h):this._transitionable.setValue(c,h)}}updateTransitions(f){this._transitioning=this._transitionable.transitioned(f,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(f){this.properties=this._transitioning.possiblyEvaluate(f)}};function Fa(f,c,h,g){let y=n.smoothstep(45,65,h),[x,I]=Tl(f,g),D=n.length(c),O=1-Math.min(1,Math.exp((D-x)/(I-x)*-6));return O*=O*O,O=Math.min(1,1.00747*O),O*y*f.alpha}function Tl(f,c){let h=.5/Math.tan(.5*c);return[f.range[0]+h,f.range[1]+h]}let pt=new n.Properties({range:new n.DataConstantProperty(n.spec.fog.range),color:new n.DataConstantProperty(n.spec.fog.color),"high-color":new n.DataConstantProperty(n.spec.fog["high-color"]),"space-color":new n.DataConstantProperty(n.spec.fog["space-color"]),"horizon-blend":new n.DataConstantProperty(n.spec.fog["horizon-blend"]),"star-intensity":new n.DataConstantProperty(n.spec.fog["star-intensity"])});class Zt extends n.Evented{constructor(c,h){super(),this._transitionable=new n.Transitionable(pt),this.set(c),this._transitioning=this._transitionable.untransitioned(),this._transform=h}get state(){let c=this._transform,h=c.projection.name==="globe",g=n.globeToMercatorTransition(c.zoom),y=this.properties.get("range"),x=[.5,3];return{range:h?[n.number(x[0],y[0],g),n.number(x[1],y[1],g)]:y,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(c,h={}){if(!this._validate(n.validateFog,c,h)){for(let g of Object.keys(n.spec.fog))c&&c[g]===void 0&&(c[g]=n.spec.fog[g].default);for(let g in c){let y=c[g];n.endsWith(g,"-transition")?this._transitionable.setTransition(g.slice(0,-11),y):this._transitionable.setValue(g,y)}}}getOpacity(c){if(!this._transform.projection.supportsFog)return 0;let h=this.properties&&this.properties.get("color")||1;return(this._transform.projection.name==="globe"?1:n.smoothstep(45,65,c))*h.a}getOpacityAtLatLng(c,h){return this._transform.projection.supportsFog?function(g,y,x){let I=n.MercatorCoordinate.fromLngLat(y),D=x.elevation?x.elevation.getAtPointOrZero(I):0,O=[I.x,I.y,D];return n.transformMat4(O,O,x.mercatorFogMatrix),Fa(g,O,x.pitch,x._fov)}(this.state,c,h):0}getFovAdjustedRange(c){return this._transform.projection.supportsFog?Tl(this.state,c):[0,1]}updateTransitions(c){this._transitioning=this._transitionable.transitioned(c,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(c){this.properties=this._transitioning.possiblyEvaluate(c)}_validate(c,h,g){return(!g||g.validate!==!1)&&n.emitValidationErrors(this,c.call(n.validateStyle,n.extend({value:h,style:{glyphs:!0,sprite:!0},styleSpec:n.spec})))}}class Ft{constructor(c,h){this.workerPool=c,this.actors=[],this.currentActor=0,this.id=n.uniqueId();let g=this.workerPool.acquire(this.id);for(let y=0;y<g.length;y++){let x=new Ft.Actor(g[y],h,this.id);x.name=`Worker ${y}`,this.actors.push(x)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(c,h,g){n.asyncAll(this.actors,(y,x)=>{y.send(c,h,x)},g=g||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}
8remove(){this.actors.forEach(c=>{c.remove()}),this.actors=[],this.workerPool.release(this.id)}}function ri(f,c,h){return c*(n.EXTENT/(f.tileSize*Math.pow(2,h-f.tileID.overscaledZ)))}Ft.Actor=n.Actor;class Pn{constructor(c,h,g,y){this.screenBounds=c,this.cameraPoint=h,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=g,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,y)}static createFromScreenPoints(c,h){let g,y;if(c instanceof n.Point||typeof c[0]=="number"){let x=n.Point.convert(c);g=[x],y=h.isPointAboveHorizon(x)}else{let x=n.Point.convert(c[0]),I=n.Point.convert(c[1]);g=[x,I],y=n.polygonizeBounds(x,I).every(D=>h.isPointAboveHorizon(D))}return new Pn(g,h.getCameraPoint(),y,h)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(c){return n.polygonizeBounds(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],c)}bufferedCameraGeometry(c){let h=this.screenBounds[0],g=this.screenBounds.length===1?this.screenBounds[0].add(new n.Point(1,1)):this.screenBounds[1],y=n.polygonizeBounds(h,g,0,!1);return this.cameraPoint.y>g.y&&(this.cameraPoint.x>h.x&&this.cameraPoint.x<g.x?y.splice(3,0,this.cameraPoint):this.cameraPoint.x>=g.x?y[2]=this.cameraPoint:this.cameraPoint.x<=h.x&&(y[3]=this.cameraPoint)),n.bufferConvexPolygon(y,c)}bufferedCameraGeometryGlobe(c){let h=this.screenBounds[0],g=this.screenBounds.length===1?this.screenBounds[0].add(new n.Point(1,1)):this.screenBounds[1],y=n.polygonizeBounds(h,g,c),x=this.cameraPoint.clone();switch(3*((x.y>h.y)+(x.y>g.y))+((x.x>h.x)+(x.x>g.x))){case 0:y[0]=x,y[4]=x.clone();break;case 1:y.splice(1,0,x);break;case 2:y[1]=x;break;case 3:y.splice(4,0,x);break;case 5:y.splice(2,0,x);break;case 6:y[3]=x;break;case 7:y.splice(3,0,x);break;case 8:y[2]=x}return y}containsTile(c,h,g,y=0){let x=c.queryPadding/h._pixelsPerMercatorPixel+1,I=g?this._bufferedCameraMercator(x,h):this._bufferedScreenMercator(x,h),D=c.tileID.wrap+(I.unwrapped?y:0),O=I.polygon.map(ne=>n.getTilePoint(c.tileTransform,ne,D));if(!n.polygonIntersectsBox(O,0,0,n.EXTENT,n.EXTENT))return;D=c.tileID.wrap+(this.screenGeometryMercator.unwrapped?y:0);let z=this.screenGeometryMercator.polygon.map(ne=>n.getTileVec3(c.tileTransform,ne,D)),F=z.map(ne=>new n.Point(ne[0],ne[1])),U=h.getFreeCameraOptions().position||new n.MercatorCoordinate(0,0,0),X=n.getTileVec3(c.tileTransform,U,D),J=z.map(ne=>{let H=n.sub(ne,ne,X);return n.normalize(H,H),new n.Ray(X,H)}),te=ri(c,1,h.zoom)*h._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:F,tilespaceRays:J,bufferedTilespaceGeometry:O,bufferedTilespaceBounds:(ee=n.getBounds(O),ee.min.x=n.clamp(ee.min.x,0,n.EXTENT),ee.min.y=n.clamp(ee.min.y,0,n.EXTENT),ee.max.x=n.clamp(ee.max.x,0,n.EXTENT),ee.max.y=n.clamp(ee.max.y,0,n.EXTENT),ee),tile:c,tileID:c.tileID,pixelToTileUnitsFactor:te};var ee}_bufferedScreenMercator(c,h){let g=ao(c);if(this._screenRaycastCache[g])return this._screenRaycastCache[g];{let y;return y=h.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(c),h):{polygon:this.bufferedScreenGeometry(c).map(x=>h.pointCoordinate3D(x)),unwrapped:!0},this._screenRaycastCache[g]=y,y}}_bufferedCameraMercator(c,h){let g=ao(c);if(this._cameraRaycastCache[g])return this._cameraRaycastCache[g];{let y;return y=h.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(c),h):{polygon:this.bufferedCameraGeometry(c).map(x=>h.pointCoordinate3D(x)),unwrapped:!0},this._cameraRaycastCache[g]=y,y}}_projectAndResample(c,h){let g=function(x,I){let D=n.multiply([],I.pixelMatrix,I.globeMatrix),O=[0,-n.GLOBE_RADIUS,0,1],z=[0,n.GLOBE_RADIUS,0,1],F=[0,0,0,1];n.transformMat4$1(O,O,D),n.transformMat4$1(z,z,D),n.transformMat4$1(F,F,D);let U=new n.Point(O[0]/O[3],O[1]/O[3]),X=new n.Point(z[0]/z[3],z[1]/z[3]),J=n.polygonContainsPoint(x,U)&&O[3]<F[3],te=n.polygonContainsPoint(x,X)&&z[3]<F[3];if(!J&&!te)return null;let ee=function(be,De,Ie){for(let Re=1;Re<be.length;Re++){let nt=ir(De.pointCoordinate3D(be[Re-1]).x),Ae=ir(De.pointCoordinate3D(be[Re]).x);if(Ie<0){if(nt<Ae)return{idx:Re,t:-nt/(Ae-1-nt)}}else if(Ae<nt)return{idx:Re,t:(1-nt)/(Ae+1-nt)}}return null}(x,I,J?-1:1);if(!ee)return null;let{idx:ne,t:H}=ee,Q=ne>1?cn(x.slice(0,ne),I):[],le=ne<x.length?cn(x.slice(ne),I):[];Q=Q.map(be=>new n.Point(ir(be.x),be.y)),le=le.map(be=>new n.Point(ir(be.x),be.y));let ue=[...Q];ue.length===0&&ue.push(le[le.length-1]);let ye=n.number(ue[ue.length-1].y,(le.length===0?Q[0]:le[0]).y,H),xe;return xe=J?[new n.Point(0,ye),new n.Point(0,0),new n.Point(1,0),new n.Point(1,ye)]:[new n.Point(1,ye),new n.Point(1,1),new n.Point(0,1),new n.Point(0,ye)],ue.push(...xe),le.length===0?ue.push(Q[0]):ue.push(...le),{polygon:ue.map(be=>
8new n.MercatorCoordinate(be.x,be.y)),unwrapped:!1}}(c,h);if(g)return g;let y=function(x,I){let D=!1,O=-1/0,z=0;for(let U=0;U<x.length-1;U++)x[U].x>O&&(O=x[U].x,z=U);for(let U=0;U<x.length-1;U++){let X=(z+U)%(x.length-1),J=x[X],te=x[X+1];Math.abs(J.x-te.x)>.5&&(J.x<te.x?(J.x+=1,X===0&&(x[x.length-1].x+=1)):(te.x+=1,X+1===x.length-1&&(x[0].x+=1)),D=!0)}let F=n.mercatorXfromLng(I.center.lng);return D&&F<Math.abs(F-1)&&x.forEach(U=>{U.x-=1}),{polygon:x,unwrapped:D}}(cn(c,h).map(x=>new n.Point(ir(x.x),x.y)),h);return{polygon:y.polygon.map(x=>new n.MercatorCoordinate(x.x,x.y)),unwrapped:y.unwrapped}}}function cn(f,c){return n.resample(f,h=>{let g=c.pointCoordinate3D(h);h.x=g.x,h.y=g.y},1/256)}function ir(f){return f<0?1+f%1:f%1}function ao(f){return 100*f|0}function un(f,c,h,g,y){let x=function(I,D){if(I)return y(I);if(D){f.url&&D.tiles&&f.tiles&&delete f.tiles;let O=n.pick(n.extend(D,f),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);D.vector_layers&&(O.vectorLayers=D.vector_layers,O.vectorLayerIds=O.vectorLayers.map(z=>z.id)),O.tiles=c.canonicalizeTileset(O,f.url),y(null,O)}};return f.url?n.getJSON(c.transformRequest(c.normalizeSourceURL(f.url,null,h,g),n.ResourceType.Source),x):n.exported.frame(()=>x(null,f))}class Vo{constructor(c,h,g){this.bounds=n.LngLatBounds.convert(this.validateBounds(c)),this.minzoom=h||0,this.maxzoom=g||24}validateBounds(c){return Array.isArray(c)&&c.length===4?[Math.max(-180,c[0]),Math.max(-90,c[1]),Math.min(180,c[2]),Math.min(90,c[3])]:[-180,-90,180,90]}contains(c){let h=Math.pow(2,c.z),g=Math.floor(n.mercatorXfromLng(this.bounds.getWest())*h),y=Math.floor(n.mercatorYfromLat(this.bounds.getNorth())*h),x=Math.ceil(n.mercatorXfromLng(this.bounds.getEast())*h),I=Math.ceil(n.mercatorYfromLat(this.bounds.getSouth())*h);return c.x>=g&&c.x<x&&c.y>=y&&c.y<I}}class fc{constructor(c,h,g){this.context=c;let y=c.gl;this.buffer=y.createBuffer(),this.dynamicDraw=!!g,this.context.unbindVAO(),c.bindElementBuffer.set(this.buffer),y.bufferData(y.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||h.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(c){let h=this.context.gl;this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,c.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Zn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class fo{constructor(c,h,g,y){this.length=h.length,this.attributes=g,this.itemSize=h.bytesPerElement,this.dynamicDraw=y,this.context=c;let x=c.gl;this.buffer=x.createBuffer(),c.bindVertexBuffer.set(this.buffer),x.bufferData(x.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?x.DYNAMIC_DRAW:x.STATIC_DRAW),this.dynamicDraw||h.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(c){let h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,c.arrayBuffer)}enableAttributes(c,h){for(let g=0;g<this.attributes.length;g++){let y=h.attributes[this.attributes[g].name];y!==void 0&&c.enableVertexAttribArray(y)}}setVertexAttribPointers(c,h,g){for(let y=0;y<this.attributes.length;y++){let x=this.attributes[y],I=h.attributes[x.name];I!==void 0&&c.vertexAttribPointer(I,x.components,c[Zn[x.type]],!1,this.itemSize,x.offset+this.itemSize*(g||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class ii{constructor(c){this.gl=c.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(c){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class as extends ii{getDefault(){return n.Color.transparent}set(c){let h=this.current;(c.r!==h.r||c.g!==h.g||c.b!==h.b||c.a!==h.a||this.dirty)&&(this.gl.clearColor(c.r,c.g,c.b,c.a),this.current=c,this.dirty=!1)}}class zr extends ii{getDefault(){return 1}set(c){(c!==this.current||this.dirty)&&(this.gl.clearDepth(c),this.current=c,this.dirty=!1)}}class Pu extends ii{getDefault(){return 0}set(c){(c!==this.current||this.dirty)&&(this.gl.clearStencil(c),this.current=c,this.dirty=!1)}}
8class Un extends ii{getDefault(){return[!0,!0,!0,!0]}set(c){let h=this.current;(c[0]!==h[0]||c[1]!==h[1]||c[2]!==h[2]||c[3]!==h[3]||this.dirty)&&(this.gl.colorMask(c[0],c[1],c[2],c[3]),this.current=c,this.dirty=!1)}}class Bo extends ii{getDefault(){return!0}set(c){(c!==this.current||this.dirty)&&(this.gl.depthMask(c),this.current=c,this.dirty=!1)}}class uh extends ii{getDefault(){return 255}set(c){(c!==this.current||this.dirty)&&(this.gl.stencilMask(c),this.current=c,this.dirty=!1)}}class ra extends ii{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(c){let h=this.current;(c.func!==h.func||c.ref!==h.ref||c.mask!==h.mask||this.dirty)&&(this.gl.stencilFunc(c.func,c.ref,c.mask),this.current=c,this.dirty=!1)}}class To extends ii{getDefault(){let c=this.gl;return[c.KEEP,c.KEEP,c.KEEP]}set(c){let h=this.current;(c[0]!==h[0]||c[1]!==h[1]||c[2]!==h[2]||this.dirty)&&(this.gl.stencilOp(c[0],c[1],c[2]),this.current=c,this.dirty=!1)}}class Ou extends ii{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;c?h.enable(h.STENCIL_TEST):h.disable(h.STENCIL_TEST),this.current=c,this.dirty=!1}}class mc extends ii{getDefault(){return[0,1]}set(c){let h=this.current;(c[0]!==h[0]||c[1]!==h[1]||this.dirty)&&(this.gl.depthRange(c[0],c[1]),this.current=c,this.dirty=!1)}}class Ru extends ii{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;c?h.enable(h.DEPTH_TEST):h.disable(h.DEPTH_TEST),this.current=c,this.dirty=!1}}class Na extends ii{getDefault(){return this.gl.LESS}set(c){(c!==this.current||this.dirty)&&(this.gl.depthFunc(c),this.current=c,this.dirty=!1)}}class gc extends ii{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;c?h.enable(h.BLEND):h.disable(h.BLEND),this.current=c,this.dirty=!1}}class dh extends ii{getDefault(){let c=this.gl;return[c.ONE,c.ZERO]}set(c){let h=this.current;(c[0]!==h[0]||c[1]!==h[1]||this.dirty)&&(this.gl.blendFunc(c[0],c[1]),this.current=c,this.dirty=!1)}}class hh extends ii{getDefault(){return n.Color.transparent}set(c){let h=this.current;(c.r!==h.r||c.g!==h.g||c.b!==h.b||c.a!==h.a||this.dirty)&&(this.gl.blendColor(c.r,c.g,c.b,c.a),this.current=c,this.dirty=!1)}}class Uo extends ii{getDefault(){return this.gl.FUNC_ADD}set(c){(c!==this.current||this.dirty)&&(this.gl.blendEquation(c),this.current=c,this.dirty=!1)}}class za extends ii{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;c?h.enable(h.CULL_FACE):h.disable(h.CULL_FACE),this.current=c,this.dirty=!1}}class Lu extends ii{getDefault(){return this.gl.BACK}set(c){(c!==this.current||this.dirty)&&(this.gl.cullFace(c),this.current=c,this.dirty=!1)}}class Il extends ii{getDefault(){return this.gl.CCW}set(c){(c!==this.current||this.dirty)&&(this.gl.frontFace(c),this.current=c,this.dirty=!1)}}let _c,Fu=class extends ii{getDefault(){return null}set(f){(f!==this.current||this.dirty)&&(this.gl.useProgram(f),this.current=f,this.dirty=!1)}};class Dl extends ii{getDefault(){return this.gl.TEXTURE0}set(c){(c!==this.current||this.dirty)&&(this.gl.activeTexture(c),this.current=c,this.dirty=!1)}}class ja extends ii{getDefault(){let c=this.gl;return[0,0,c.drawingBufferWidth,c.drawingBufferHeight]}set(c){let h=this.current;(c[0]!==h[0]||c[1]!==h[1]||c[2]!==h[2]||c[3]!==h[3]||this.dirty)&&(this.gl.viewport(c[0],c[1],c[2],c[3]),this.current=c,this.dirty=!1)}}class Ml extends ii{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,c),this.current=c,this.dirty=!1}}class kl extends ii{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;h.bindRenderbuffer(h.RENDERBUFFER,c),this.current=c,this.dirty=!1}}class vc extends ii{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;h.bindTexture(h.TEXTURE_2D,c),this.current=c,this.dirty=!1}}class ph extends ii{getDefault(){return null}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;h.bindBuffer(h.ARRAY_BUFFER,c),this.current=c,this.dirty=!1}}class pe extends ii{getDefault(){return null}set(c){let h=this.gl;h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,c),this.current=c,this.dirty=!1}}class W extends ii{constructor(c){super(c),this.vao=c.extVertexArrayObject}getDefault(){return null}set(c){this.vao&&(c!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(c),this.current=c,this.dirty=!1)}}class K extends ii{getDefault(){return 4}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;h.pixelStorei(h.UNPACK_ALIGNMENT,c),this.current=c,this.dirty=!1}}class de extends ii{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c),this.current=c,this.dirty=!1}}class ve extends ii{getDefault(){return!1}set(c){if(c===this.current&&!this.dirty)return;let h=this.gl;h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),this.current=c,this.dirty=!1}}class Ce extends ii{constructor(c,h){super(c),this.context=c,this.parent=h}getDefault(){return null}}class ke extends Ce{setDirty(){this.dirty=!0}set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let h=this.gl;h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,c,0),this.current=c,this.dirty=!1}}class Me extends Ce{attachment(){return this.gl.DEPTH_ATTACHMENT}set(c){if(c===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let h=this.gl;h.framebufferRenderbuffer(h.FRAMEBUFFER,this.attachment(),h.RENDERBUFFER,c),this.current=c,this.dirty=!1}}class we extends Me{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class je{constructor(c,h,g,y){this.context=c,this.width=h,this.height=g;let x=this.framebuffer=c.gl.createFramebuffer();
8this.colorAttachment=new ke(c,x),y&&(this.depthAttachment=new Me(c,x))}destroy(){let c=this.context.gl,h=this.colorAttachment.get();if(h&&c.deleteTexture(h),this.depthAttachment){let g=this.depthAttachment.get();g&&c.deleteRenderbuffer(g)}c.deleteFramebuffer(this.framebuffer)}}class ft{constructor(c,h=!1){if(this.gl=c,this.isWebGL2=h,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),h){let g=c;this.extVertexArrayObject={createVertexArrayOES:g.createVertexArray.bind(c),deleteVertexArrayOES:g.deleteVertexArray.bind(c),bindVertexArrayOES:g.bindVertexArray.bind(c)}}this.clearColor=new as(this),this.clearDepth=new zr(this),this.clearStencil=new Pu(this),this.colorMask=new Un(this),this.depthMask=new Bo(this),this.stencilMask=new uh(this),this.stencilFunc=new ra(this),this.stencilOp=new To(this),this.stencilTest=new Ou(this),this.depthRange=new mc(this),this.depthTest=new Ru(this),this.depthFunc=new Na(this),this.blend=new gc(this),this.blendFunc=new dh(this),this.blendColor=new hh(this),this.blendEquation=new Uo(this),this.cullFace=new za(this),this.cullFaceSide=new Lu(this),this.frontFace=new Il(this),this.program=new Fu(this),this.activeTexture=new Dl(this),this.viewport=new ja(this),this.bindFramebuffer=new Ml(this),this.bindRenderbuffer=new kl(this),this.bindTexture=new vc(this),this.bindVertexBuffer=new ph(this),this.bindElementBuffer=new pe(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new W(this),this.pixelStoreUnpack=new K(this),this.pixelStoreUnpackPremultiplyAlpha=new de(this),this.pixelStoreUnpackFlipY=new ve(this),this.extTextureFilterAnisotropic=c.getExtension("EXT_texture_filter_anisotropic")||c.getExtension("MOZ_EXT_texture_filter_anisotropic")||c.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=c.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extStandardDerivativesForceOff=!1,this.extDebugRendererInfo=c.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=c.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=c.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),h||(this.extTextureHalfFloat=c.getExtension("OES_texture_half_float")),(h||this.extTextureHalfFloat&&c.getExtension("OES_texture_half_float_linear"))&&(this.extRenderToTextureHalfFloat=c.getExtension("EXT_color_buffer_half_float")),this.extStandardDerivatives=h||c.getExtension("OES_standard_derivatives"),this.extTimerQuery=c.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=c.getParameter(c.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(c,h){return new fc(this,c,h)}createVertexBuffer(c,h,g){return new fo(this,c,h,g)}createRenderbuffer(c,h,g){let y=this.gl,x=y.createRenderbuffer();return this.bindRenderbuffer.set(x),y.renderbufferStorage(y.RENDERBUFFER,c,h,g),this.bindRenderbuffer.set(null),x}createFramebuffer(c,h,g){return new je(this,c,h,g)}clear({color:c,depth:h,stencil:g}){let y=this.gl,x=0;c&&(x|=y.COLOR_BUFFER_BIT,this.clearColor.set(c),this.colorMask.set([!0,!0,!0,!0])),h!==void 0&&(x|=y.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(h),this.depthMask.set(!0)),g!==void 0&&(x|=y.STENCIL_BUFFER_BIT,this.clearStencil.set(g),this.stencilMask.set(255)),y.clear(x)}setCullFace(c){c.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(c.mode),this.frontFace.set(c.frontFace))}setDepthMode(c){c.func!==this.gl.ALWAYS||c.mask?(this.depthTest.set(!0),this.depthFunc.set(c.func),this.depthMask.set(c.mask),this.depthRange.set(c.range)):this.depthTest.set(!1)}setStencilMode(c){c.test.func!==this.gl.ALWAYS||c.mask?(this.stencilTest.set(!0),this.stencilMask.set(c.mask),this.stencilOp.set([c.fail,c.depthFail,c.pass]),this.stencilFunc.set({func:c.test.func,ref:c.ref,mask:c.test.mask})):this.stencilTest.set(!1)}setColorMode(c){d(c.blendFunction,n.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(c.blendFunction),this.blendColor.set(c.blendColor)),this.colorMask.set(c.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class vt extends n.Evented{constructor(c,h,g,y){if(super(),this.id=c,this.dispatcher=g,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,n.extend(this,n.pick(h,["url","scheme","tileSize","promoteId"])),this._options=n.extend({type:"vector"},h),this._collectResourceTiming=h.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(y),this._tileWorkers={},this._deduped=new n.DedupedRequest}load(c){this._loaded=!1,this.fire(new n.Event("dataloading",{dataType:"source"}));let h=Array.isArray(this.map._language)?this.map._language.join():this.map._language,g=this.map._worldview;this._tileJSONRequest=un(this._options,this.map._requestManager,h,g,(y,x)=>{this._tileJSONRequest=null,this._loaded=!0,y?(h&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${h}`),g&&g.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${g}`),this.fire(new n.ErrorEvent(y))):x&&(n.extend(this,x),x.bounds&&(this.tileBounds=new Vo(x.bounds,this.minzoom,this.maxzoom)),n.postTurnstileEvent(x.tiles,this.map._requestManager._customAccessToken),this.fire(new n.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new n.Event("data",{dataType:"source",sourceDataType:"content"}))),c&&c(y)})}loaded(){return this._loaded}hasTile(c){return!this.tileBounds||this.tileBounds.contains(c.canonical)}onAdd(c){this.map=c,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>
8this.map.style._clearSource(this.id))}setTiles(c){return this._options.tiles=c,this.reload(),this}setUrl(c){return this.url=c,this._options.url=c,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return n.extend({},this._options)}loadTile(c,h){let g=this.map._requestManager.normalizeTileURL(c.tileID.canonical.url(this.tiles,this.scheme)),y={request:this.map._requestManager.transformRequest(g,n.ResourceType.Tile),data:void 0,uid:c.uid,tileID:c.tileID,tileZoom:c.tileZoom,zoom:c.tileID.overscaledZ,tileSize:this.tileSize*c.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:n.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:c.isSymbolTile};if(y.request.collectResourceTiming=this._collectResourceTiming,c.actor&&c.state!=="expired")c.state==="loading"?c.reloadCallback=h:c.request=c.actor.send("reloadTile",y,x.bind(this));else if(c.actor=this._tileWorkers[g]=this._tileWorkers[g]||this.dispatcher.getActor(),this.dispatcher.ready)c.request=c.actor.send("loadTile",y,x.bind(this),void 0,!0);else{let I=n.loadVectorTile.call({deduped:this._deduped},y,(D,O)=>{D||!O?x.call(this,D):(y.data={cacheControl:O.cacheControl,expires:O.expires,rawData:O.rawData.slice(0)},c.actor&&c.actor.send("loadTile",y,x.bind(this),void 0,!0))},!0);c.request={cancel:I}}function x(I,D){return delete c.request,c.aborted?h(null):I&&I.status!==404?h(I):(D&&D.resourceTiming&&(c.resourceTiming=D.resourceTiming),this.map._refreshExpiredTiles&&D&&c.setExpiryData(D),c.loadVectorData(D,this.map.painter),n.cacheEntryPossiblyAdded(this.dispatcher),h(null),void(c.reloadCallback&&(this.loadTile(c,c.reloadCallback),c.reloadCallback=null)))}}abortTile(c){c.request&&(c.request.cancel(),delete c.request),c.actor&&c.actor.send("abortTile",{uid:c.uid,type:this.t
8ype,source:this.id})}unloadTile(c){c.unloadVectorData(),c.actor&&c.actor.send("removeTile",{uid:c.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class ut extends n.Evented{constructor(c,h,g,y){super(),this.id=c,this.dispatcher=g,this.setEventedParent(y),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=n.extend({type:"raster"},h),n.extend(this,n.pick(h,["url","scheme","tileSize"]))}load(c){this._loaded=!1,this.fire(new n.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=un(this._options,this.map._requestManager,null,null,(h,g)=>{this._tileJSONRequest=null,this._loaded=!0,h?this.fire(new n.ErrorEvent(h)):g&&(n.extend(this,g),g.bounds&&(this.tileBounds=new Vo(g.bounds,this.minzoom,this.maxzoom)),n.postTurnstileEvent(g.tiles),this.fire(new n.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new n.Event("data",{dataType:"source",sourceDataType:"content"}))),c&&c(h)})}loaded(){return this._loaded}onAdd(c){this.map=c,this.load()}reload(){this.cancelTileJSONRequest(),this.load(()=>this.map.style._clearSource(this.id))}setTiles(c){return this._options.tiles=c,this.reload(),this}setUrl(c){return this.url=c,this._options.url=c,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return n.extend({},this._options)}hasTile(c){return!this.tileBounds||this.tileBounds.contains(c.canonical)}loadTile(c,h){let g=n.exported.devicePixelRatio>=2,y=this.map._requestManager.normalizeTileURL(c.tileID.canonical.url(this.tiles,this.scheme),g,this.tileSize);c.request=n.getImage(this.map._requestManager.transformRequest(y,n.ResourceType.Tile),(x,I,D,O)=>(delete c.request,c.aborted?(c.state="unloaded",h(null)):x?(c.state="errored",h(x)):I?(this.map._refreshExpiredTiles&&c.setExpiryData({cacheControl:D,expires:O}),c.setTexture(I,this.map.painter),c.state="loaded",n.cacheEntryPossiblyAdded(this.dispatcher),void h(null)):h(null)))}static loadTileData(c,h,g){c.setTexture(h,g)}static unloadTileData(c,h){c.texture&&h.saveTileTexture(c.texture)}abortTile(c,h){c.request&&(c.request.cancel(),delete c.request),h()}unloadTile(c,h){c.texture&&this.map.painter.saveTileTexture(c.texture),h()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function hi(f,c,h,g,y,x,I,D){let O=[f,h,y,c,g,x,1,1,1],z=[I,D,1],F=n.adjoint([],O),[U,X,J]=n.transformMat3(z,z,n.transpose(F,F));return n.multiply$1(O,[U,0,0,0,X,0,0,0,J],O)}class xi extends n.Evented{constructor(c,h,g,y){super(),this.id=c,this.dispatcher=g,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(y),this.options=h,this._dirty=!1}load(c,h){this._loaded=h||!1,this.fire(new n.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=n.getImage(this.map._requestManager.transformRequest(this.url,n.ResourceType.Image),(g,y)=>{if(this._imageRequest=null,this._loaded=!0,g)this.fire(new n.ErrorEvent(g));else if(y){let{HTMLImageElement:x}=n.window;this.image=y instanceof x?n.exported.getImageData(y):y,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,c&&(this.coordinates=c),this._finishLoading()}})}loaded(){return this._loaded}updateImage(c){return this.image&&c.url?(this._imageRequest&&c.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=c.url,this.load(c.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new n.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(c){this.map=c,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(c){this.coordinates=c,this._boundsArray=void 0;let h=c.map(n.MercatorCoordinate.fromLngLat);return this.tileID=function(g){let y=1/0,x=1/0,I=-1/0,D=-1/0;for(let U of g)y=Math.min(y,U.x),x=Math.min(x,U.y),I=Math.max(I,U.x),D=Math.max(D,U.y);let O=Math.max(I-y,D-x),z=Math.max(0,Math.floor(-Math.log(O)/Math.LN2)),F=Math.pow(2,z);return new n.CanonicalTileID(z,Math.floor((y+I)/2*F),Math.floor((x+D)/2*F))}(h),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new n.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(c){for(let O in this.tiles){let z=this.tiles[O];
8z.state!=="loaded"&&(z.state="loaded",z.texture=this.texture)}if(this._boundsArray)return;let h=n.tileTransform(this.tileID,this.map.transform.projection),[g,y,x,I]=this.coordinates.map(O=>{let z=h.projection.project(O[0],O[1]);return n.getTilePoint(h,z)._round()});this.perspectiveTransform=function(O,z,F,U,X,J,te,ee,ne,H){let Q=hi(0,0,O,0,0,z,O,z),le=hi(F,U,X,J,te,ee,ne,H);return n.multiply$1(le,n.adjoint(Q,Q),le),[le[6]/le[8]*O/n.EXTENT,le[7]/le[8]*z/n.EXTENT]}(this.width,this.height,g.x,g.y,y.x,y.y,I.x,I.y,x.x,x.y);let D=this._boundsArray=new n.StructArrayLayout4i8;D.emplaceBack(g.x,g.y,0,0),D.emplaceBack(y.x,y.y,n.EXTENT,0),D.emplaceBack(I.x,I.y,0,n.EXTENT),D.emplaceBack(x.x,x.y,n.EXTENT,n.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=c.createVertexBuffer(D,n.boundsAttributes.members),this.boundsSegments=n.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let c=this.map.painter.context,h=c.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new n.Texture(c,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(c)}loadTile(c,h){this.tileID&&this.tileID.equals(c.tileID.canonical)?(this.tiles[String(c.tileID.wrap)]=c,c.buckets={},h(null)):(c.state="errored",h(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}let pi={vector:vt,raster:ut,"raster-dem":class extends ut{constructor(f,c,h,g){super(f,c,h,g),this.type="raster-dem",this.maxzoom=22,this._options=n.extend({type:"raster-dem"},c),this.encoding=c.encoding||"mapbox"}loadTile(f,c){let h=this.map._requestManager.normalizeTileURL(f.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function g(y,x){y&&(f.state="errored",c(y)),x&&(f.dem=x,f.dem.onDeserialize(),f.needsHillshadePrepare=!0,f.needsDEMTextureUpload=!0,f.state="loaded",c(null))}f.request=n.getImage(this.map._requestManager.transformRequest(h,n.ResourceType.Tile),(function(y,x,I,D){if(delete f.request,f.aborted)f.state="unloaded",c(null);else if(y)f.state="errored",c(y);else if(x){this.map._refreshExpiredTiles&&f.setExpiryData({cacheControl:I,expires:D});let O=n.window.ImageBitmap&&x instanceof n.window.ImageBitmap&&(_c==null&&(_c=n.window.OffscreenCanvas&&new n.window.OffscreenCanvas(1,1).getContext("2d")&&typeof n.window.createImageBitmap=="function"),_c),z=1-(x.width-n.prevPowerOfTwo(x.width))/2;z<1||f.neighboringTiles||(f.neighboringTiles=this._getNeighboringTiles(f.tileID));let F=O?x:n.exported.getImageData(x,z),U={uid:f.uid,coord:f.tileID,source:this.id,rawImageData:F,encoding:this.encoding,padding:z};f.actor&&f.state!=="expired"||(f.actor=this.dispatcher.getActor(),f.actor.send("loadDEMTile",U,g.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(f){let c=f.canonical,h=Math.pow(2,c.z),g=(c.x-1+h)%h,y=c.x===0?f.wrap-1:f.wrap,x=(c.x+1+h)%h,I=c.x+1===h?f.wrap+1:f.wrap,D={};return D[new n.OverscaledTileID(f.overscaledZ,y,c.z,g,c.y).key]={backfilled:!1},D[new n.OverscaledTileID(f.overscaledZ,I,c.z,x,c.y).key]={backfilled:!1},c.y>0&&(D[new n.OverscaledTileID(f.overscaledZ,y,c.z,g,c.y-1).key]={backfilled:!1},D[new n.OverscaledTileID(f.overscaledZ,f.wrap,c.z,c.x,c.y-1).key]={backfilled:!1},D[new n.OverscaledTileID(f.overscaledZ,I,c.z,x,c.y-1).key]={backfilled:!1}),c.y+1<h&&(D[new n.OverscaledTileID(f.overscaledZ,y,c.z,g,c.y+1).key]={backfilled:!1},D[new n.OverscaledTileID(f.overscaledZ,f.wrap,c.z,c.x,c.y+1).key]={backfilled:!1},D[new n.OverscaledTileID(f.overscaledZ,I,c.z,x,c.y+1).key]={backfilled:!1}),D}unloadTile(f){f.demTexture&&this.map.painter.saveTileTexture(f.demTexture),f.fbo&&(f.fbo.destroy(),delete f.fbo),f.dem&&delete f.dem,delete f.neighboringTiles,f.state="unloaded"}},geojson:class extends n.Evented{constructor(f,c,h,g){super(),this.id=f,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=h.getActor(),this.setEventedParent(g),this._data=c.data,this._options=n.extend({},c),this._collectResourceTiming=c.collectResourceTiming,c.maxzoom!==void 0&&(this.maxzoom=c.maxzoom),c.type&&(this.t
8ype=c.type),c.attribution&&(this.attribution=c.attribution),this.promoteId=c.promoteId;let y=n.EXTENT/this.tileSize;this.workerOptions=n.extend({source:this.id,cluster:c.cluster||!1,geojsonVtOptions:{buffer:(c.buffer!==void 0?c.buffer:128)*y,tolerance:(c.tolerance!==void 0?c.tolerance:.375)*y,extent:n.EXTENT,maxZoom:this.maxzoom,lineMetrics:c.lineMetrics||!1,generateId:c.generateId||!1},superclusterOptions:{maxZoom:c.clusterMaxZoom!==void 0?c.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,c.clusterMinPoints||2),extent:n.EXTENT,radius:(c.clusterRadius!==void 0?c.clusterRadius:50)*y,log:!1,generateId:c.generateId||!1},clusterProperties:c.clusterProperties,filter:c.filter},c.workerOptions)}onAdd(f){this.map=f,this.setData(this._data)}setData(f){return this._data=f,this._updateWorkerData(),this}getClusterExpansionZoom(f,c){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:f,source:this.id},c),this}getClusterChildren(f,c){return this.actor.send("geojson.getClusterChildren",{clusterId:f,source:this.id},c),this}getClusterLeaves(f,c,h,g){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:f,limit:c,offset:h},g),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new n.Event("dataloading",{dataType:"source"})),this._loaded=!1;let f=n.extend({},this.workerOptions),c=this._data;typeof c=="string"?(f.request=this.map._requestManager.transformRequest(n.exported.resolveURL(c),n.ResourceType.Source),f.request.collectResourceTiming=this._collectResourceTiming):f.data=JSON.stringify(c),this._pendingLoad=this.actor.send(`${this.type}.loadData`,f,(h,g)=>{if(this._loaded=!0,this._pendingLoad=null,h)this.fire(new n.ErrorEvent(h));else{let y={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&g&&g.resourceTiming&&g.resourceTiming[this.id]&&(y.resourceTiming=g.resourceTiming[this.id]),this.fire(new n.Event("data",y)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)})}loaded(){return this._loaded}loadTile(f,c){let h=f.actor?"reloadTile":"loadTile";
8f.actor=this.actor,f.request=this.actor.send(h,{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:n.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(g,y)=>(delete f.request,f.unloadVectorData(),f.aborted?c(null):g?c(g):(f.loadVectorData(y,this.map.painter,h==="reloadTile"),c(null))),void 0,h==="loadTile")}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 n.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends xi{constructor(f,c,h,g){super(f,c,h,g),this.roundZoom=!0,this.type="video",this.options=c}load(){this._loaded=!1;let f=this.options;this.urls=[];for(let c of f.urls)this.urls.push(this.map._requestManager.transformRequest(c,n.ResourceType.Source).url);n.getVideo(this.urls,(c,h)=>{this._loaded=!0,c?this.fire(new n.ErrorEvent(c)):h&&(this.video=h,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){let c=this.video.seekable;f<c.start(0)||f>c.end(0)?this.fire(new n.ErrorEvent(new n.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${c.start(0)} and ${c.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(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let f=this.map.painter.context,c=f.gl;this.texture?this.video.paused||(this.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE),c.texSubImage2D(c.TEXTURE_2D,0,0,0,c.RGBA,c.UNSIGNED_BYTE,this.video)):(this.texture=new n.Texture(f,this.video,c.RGBA),this.texture.bind(c.LINEAR,c.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:xi,canvas:class extends xi{constructor(f,c,h,g){super(f,c,h,g),c.coordinates?Array.isArray(c.coordinates)&&c.coordinates.length===4&&!c.coordinates.some(y=>!Array.isArray(y)||y.length!==2||y.some(x=>typeof x!="number"))||this.fire(new n.ErrorEvent(new n.ValidationError(`sources.${f}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new n.ErrorEvent(new n.ValidationError(`sources.${f}`,null,'missing required property "coordinates"'))),c.animate&&typeof c.animate!="boolean"&&this.fire(new n.ErrorEvent(new n.ValidationError(`sources.${f}`,null,'optional "animate" property must be a boolean value'))),c.canvas?typeof c.canvas=="string"||c.canvas instanceof n.window.HTMLCanvasElement||this.fire(new n.ErrorEvent(new n.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 n.ErrorEvent(new n.ValidationError(`sources.${f}`,null,'missing required property "canvas"'))),this.options=c,this.animate=c.animate===void 0||c.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof n.window.HTMLCanvasElement?this.options.canvas:n.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new n.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()||Object.keys(this.tiles).length===0)return;let c=this.map.painter.context;this.texture?(f||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new n.Texture(c,this.canvas,c.gl.RGBA,{premultiply:!0}),this._prepareData(c)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let f of[this.canvas.width,this.canvas.height])if(isNaN(f)||f<=0)return!0;return!1}},custom:class extends n.Evented{constructor(f,c,h,g){super(),this.id=f,this.type="custom",this._dataType="raster",this._dispatcher=h,this._implementation=c,this.setEventedParent(g),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new n.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new n.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new Vo(this._implementation.bounds,this.minzoom,this.maxzoom)),c.update=this._update.bind(this),c.clearTiles=this._clearTiles.bind(this),c.coveringTiles=this._coveringTiles.bind(this),n.extend(this,n.pick(c,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileC
8acheSize"]))}serialize(){return n.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new n.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new n.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(f){this._map=f,this._loaded=!1,this.fire(new n.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){let{x:c,y:h,z:g}=f.canonical;return this._implementation.hasTile({x:c,y:h,z:g})}return!this.tileBounds||this.tileBounds.contains(f.canonical)}loadTile(f,c){let{x:h,y:g,z:y}=f.tileID.canonical,x=new n.window.AbortController;f.request=Promise.resolve(this._implementation.loadTile({x:h,y:g,z:y},{signal:x.signal})).then((function(I){return delete f.request,f.aborted?(f.state="unloaded",c(null)):I===void 0?(f.state="errored",c(null)):I===null?(this.loadTileData(f,{width:this.tileSize,height:this.tileSize,data:null}),f.state="loaded",c(null)):function(D){return D instanceof n.window.ImageData||D instanceof n.window.HTMLCanvasElement||D instanceof n.window.ImageBitmap||D instanceof n.window.HTMLImageElement}(I)?(this.loadTileData(f,I),f.state="loaded",void c(null)):(f.state="errored",c(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(I=>{I.code!==20&&(f.state="errored",c(I))}),f.request.cancel=()=>x.abort()}loadTileData(f,c){ut.loadTileData(f,c,this._map.painter)}unloadTileData(f){ut.unloadTileData(f,this._map.painter)}unloadTile(f,c){if(this.unloadTileData(f),this._implementation.unloadTile){let{x:h,y:g,z:y}=f.tileID.canonical;this._implementation.unloadTile({x:h,y:g,z:y})}c()}abortTile(f,c){f.request&&f.request.cancel&&(f.request.cancel(),delete f.request),c()}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 n.Event("data",{dataType:"source",sourceDataType:"content"}))}}},wi=function(f,c,h,g){let y=new pi[c.type](f,c,h,g);if(y.id!==f)throw new Error(`Expected Source id to be ${f} instead of ${y.id}`);return n.bindAll(["load","abort","unload","serialize","prepare"],y),y};function Ni(f,c){let h=n.identity([]);return n.scale(h,h,[.5*f.width,.5*-f.height,1]),n.translate(h,h,[1,-1,0]),n.multiply(h,h,f.calculateProjMatrix(c.toUnwrapped())),Float32Array.from(h)}function Hn(f,c,h,g,y,x,I,D=!1){let O=f.tilesIn(g,I,D);O.sort(Zr);let z=[];for(let U of O)z.push({wrappedTileID:U.tile.tileID.wrapped().key,queryResults:U.tile.queryRenderedFeatures(c,h,f._state,U,y,x,Ni(f.transform,U.tile.tileID),D)});let F=function(U){let X={},J={};for(let te of U){let ee=te.queryResults,ne=te.wrappedTileID,H=J[ne]=J[ne]||{};for(let Q in ee){let le=ee[Q],ue=H[Q]=H[Q]||{},ye=X[Q]=X[Q]||[];for(let xe of le)ue[xe.featureIndex]||(ue[xe.featureIndex]=!0,ye.push(xe))}}return X}(z);for(let U in F)F[U].forEach(X=>{let J=X.feature,te=J.layer;te&&te.type!=="background"&&te.type!=="sky"&&(J.source=te.source,te["source-layer"]&&(J.sourceLayer=te["source-layer"]),J.state=J.id!==void 0?f.getFeatureState(te["source-layer"],J.id):{})});return F}function ar(f,c){let h=f.getRenderableIds().map(x=>f.getTileByID(x)),g=[],y={};for(let x=0;x<h.length;x++){let I=h[x],D=I.tileID.canonical.key;y[D]||(y[D]=!0,I.querySourceFeatures(g,c))}return g}function Zr(f,c){let h=f.tileID,g=c.tileID;return h.overscaledZ-g.overscaledZ||h.canonical.y-g.canonical.y||h.wrap-g.wrap||h.canonical.x-g.canonical.x}function yr(){return Nc.workerClass!=null?new Nc.workerClass:new n.window.Worker(Nc.workerUrl)}let Ms="mapboxgl_preloaded_worker_pool";class Tr{constructor(){this.active={}}acquire(c){if(!this.workers)for(this.workers=[];this.workers.length<Tr.workerCount;)this.workers.push(new yr);return this.active[c]=!0,this.workers.slice()}release(c){delete this.active[c],this.numActive()===0&&(this.workers.forEac
8h(h=>{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ms]}numActive(){return Object.keys(this.active).length}}let lo;function yc(){return lo||(lo=new Tr),lo}function R1(f,c){let h={};for(let g in f)g!=="ref"&&(h[g]=f[g]);return n.refProperties.forEach(g=>{g in c&&(h[g]=c[g])}),h}function b0(f){f=f.slice();let c=Object.create(null);for(let h=0;h<f.length;h++)c[f[h].id]=f[h];for(let h=0;h<f.length;h++)"ref"in f[h]&&(f[h]=R1(f[h],c[f[h].ref]));return f}Tr.workerCount=2;let nn={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setProjection:"setProjection"};function Zf(f,c,h){h.push({command:nn.addSource,args:[f,c[f]]})}function Nu(f,c,h){c.push({command:nn.removeSource,args:[f]}),h[f]=!0}function Kf(f,c,h,g){Nu(f,h,g),Zf(f,c,h)}function fh(f,c,h){let g;for(g in f[h])if(f[h].hasOwnProperty(g)&&g!=="data"&&!d(f[h][g],c[h
8][g]))return!1;for(g in c[h])if(c[h].hasOwnProperty(g)&&g!=="data"&&!d(f[h][g],c[h][g]))return!1;return!0}function ks(f,c,h,g,y,x){let I;for(I in c=c||{},f=f||{})f.hasOwnProperty(I)&&(d(f[I],c[I])||h.push({command:x,args:[g,I,c[I],y]}));for(I in c)c.hasOwnProperty(I)&&!f.hasOwnProperty(I)&&(d(f[I],c[I])||h.push({command:x,args:[g,I,c[I],y]}))}function oa(f){return f.id}function Xf(f,c){return f[c.id]=c,f}class Yf{constructor(c,h){this.reset(c,h)}reset(c,h){this.points=c||[],this._distances=[0];for(let g=1;g<this.points.length;g++)this._distances[g]=this._distances[g-1]+this.points[g].dist(this.points[g-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(h||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(c){if(this.points.length===1)return this.points[0];c=n.clamp(c,0,1);let h=1,g=this._distances[h],y=c*this.paddedLength+this.padding;for(;g<y&&h<this._distances.length;)g=this._distances[++h];let x=h-1,I=this._distances[x],D=g-I,O=D>0?(y-I)/D:0;return this.points[x].mult(1-O).add(this.points[h].mult(O))}}class Al{constructor(c,h,g){let y=this.boxCells=[],x=this.circleCells=[];this.xCellCount=Math.ceil(c/g),this.yCellCount=Math.ceil(h/g);for(let I=0;I<this.xCellCount*this.yCellCount;I++)y.push([]),x.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=c,this.height=h,this.xScale=this.xCellCount/c,this.yScale=this.yCellCount/h,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(c,h,g,y,x){this._forEachCell(h,g,y,x,this._insertBoxCell,this.boxUid++),this.boxKeys.push(c),this.bboxes.push(h),this.bboxes.push(g),this.bboxes.push(y),this.bboxes.push(x)}insertCircle(c,h,g,y){this._forEachCell(h-y,g-y,h+y,g+y,this._insertCircleCell,this.circleUid++),this.circleKeys.push(c),this.circles.push(h),this.circles.push(g),this.circles.push(y)}_insertBoxCell(c,h,g,y,x,I){this.boxCells[x].push(I)}_insertCircleCell(c,h,g,y,x,I){this.circleCells[x].push(I)}_query(c,h,g,y,x,I){if(g<0||c>this.width||y<0||h>this.height)return!x&&[];let D=[];if(c<=0&&h<=0&&this.width<=g&&this.height<=y){if(x)return!0;for(let O=0;O<this.boxKeys.length;O++)D.push({key:this.boxKeys[O],x1:this.bboxes[4*O],y1:this.bboxes[4*O+1],x2:this.bboxes[4*O+2],y2:this.bboxes[4*O+3]});for(let O=0;O<this.circleKeys.length;O++){let z=this.circles[3*O],F=this.circles[3*O+1],U=this.circles[3*O+2];D.push({key:this.circleKeys[O],x1:z-U,y1:F-U,x2:z+U,y2:F+U})}return I?D.filter(I):D}return this._forEachCell(c,h,g,y,this._queryCell,D,{hitTest:x,seenUids:{box:{},circle:{}}},I),x?D.length>0:D}_queryCircle(c,h,g,y,x){let I=c-g,D=c+g,O=h-g,z=h+g;if(D<0||I>this.width||z<0||O>this.height)return!y&&[];let F=[];return this._forEachCell(I,O,D,z,this._queryCellCircle,F,{hitTest:y,circle:{x:c,y:h,radius:g},seenUids:{box:{},circle:{}}},x),y?F.length>0:F}query(c,h,g,y,x){return this._query(c,h,g,y,!1,x)}hitTest(c,h,g,y,x){return this._query(c,h,g,y,!0,x)}hitTestCircle(c,h,g,y){return this._queryCircle(c,h,g,!0,y)}_queryCell(c,h,g,y,x,I,D,O){let z=D.seenUids,F=this.boxCells[x];if(F!==null){let X=this.bboxes;for(let J of F)if(!z.box[J]){z.box[J]=!0;let te=4*J;if(c<=X[te+2]&&h<=X[te+3]&&g>=X[te+0]&&y>=X[te+1]&&(!O||O(this.boxKeys[J]))){if(D.hitTest)return I.push(!0),!0;I.push({key:this.boxKeys[J],x1:X[te],y1:X[te+1],x2:X[te+2],y2:X[te+3]})}}}let U=this.circleCells[x];if(U!==null){let X=this.circles;for(let J of U)if(!z.circle[J]){z.circle[J]=!0;let te=3*J;if(this._circleAndRectCollide(X[te],X[te+1],X[te+2],c,h,g,y)&&(!O||O(this.circleKeys[J]))){if(D.hitTest)return I.push(!0),!0;{let ee=X[te],ne=X[te+1],H=X[te+2];I.push({key:this.circleKeys[J],x1:ee-H,y1:ne-H,x2:ee+H,y2:ne+H})}}}}}_queryCellCircle(c,h,g,y,x,I,D,O){let z=D.circle,F=D.seenUids,U=this.boxCells[x];if(U!==null){let J=this.bboxes;for(let te of U)if(!F.box[te]){F.box[te]=!0;let ee=4*te;if(this._circleAndRectCollide(z.x,z.y,z.radius,J[ee+0],J[ee+1],J[ee+2],J[ee+3])&&(!O||O(this.boxKeys[te])))return I.push(!0),!0}}let X=this.circleCells[x];if(X!==null){let J=this.circles;for(let te of X)if(!F.circle[te]){F.circle[te]=!0;let ee=3*te;
8if(this._circlesCollide(J[ee],J[ee+1],J[ee+2],z.x,z.y,z.radius)&&(!O||O(this.circleKeys[te])))return I.push(!0),!0}}}_forEachCell(c,h,g,y,x,I,D,O){let z=this._convertToXCellCoord(c),F=this._convertToYCellCoord(h),U=this._convertToXCellCoord(g),X=this._convertToYCellCoord(y);for(let J=z;J<=U;J++)for(let te=F;te<=X;te++)if(x.call(this,c,h,g,y,this.xCellCount*te+J,I,D,O))return}_convertToXCellCoord(c){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(c*this.xScale)))}_convertToYCellCoord(c){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(c*this.yScale)))}_circlesCollide(c,h,g,y,x,I){let D=y-c,O=x-h,z=g+I;return z*z>D*D+O*O}_circleAndRectCollide(c,h,g,y,x,I,D){let O=(I-y)/2,z=Math.abs(c-(y+O));if(z>O+g)return!1;let F=(D-x)/2,U=Math.abs(h-(x+F));if(U>F+g)return!1;if(z<=O||U<=F)return!0;let X=z-O,J=U-F;return X*X+J*J<=g*g}}let sa={unknown:0,flipRequired:1,flipNotRequired:2},zu=Math.tan(85*Math.PI/180);function Ue(f,c,h,g,y,x,I){let D=n.create();if(h)if(x.name==="globe"){let O=n.calculateGlobeLabelMatrix(y,c);n.multiply(D,D,O)}else{let O=tt([],I);D[0]=O[0],D[1]=O[1],D[4]=O[2],D[5]=O[3],g||n.rotateZ(D,D,y.angle)}else n.multiply(D,y.labelPlaneMatrix,f);return D}function aa(f,c,h,g,y,x,I){let D=Ue(f,c,h,g,y,x,I);return x.name==="globe"&&h||(D[2]=D[6]=D[10]=D[14]=0),D}function lr(f,c,h,g,y,x,I){if(h){if(x.name==="globe"){let D=Ue(f,c,h,g,y,x,I);return n.invert(D,D),n.multiply(D,f,D),D}{let D=n.clone(f),O=n.identity([]);return O[0]=I[0],O[1]=I[1],O[4]=I[2],O[5]=I[3],n.multiply(D,D,O),g||n.rotateZ(D,D,-y.angle),D}}return y.glCoordMatrix}function Ir(f,c,h,g){let y=[f,c,h,1];h?n.transformMat4$1(y,y,g):Di(y,y,g);let x=y[3];return y[0]/=x,y[1]/=x,y[2]/=x,y}function x0(f,c){return Math.min(.5+f/c*.5,1.5)}function As(f,c){let h=f[0]/f[3],g=f[1]/f[3];return h>=-c[0]&&h<=c[0]&&g>=-c[1]&&g<=c[1]}function Qf(f,c,h,g,y,x,I,D,O,z){let F=h.transform,U=g?f.textSizeData:f.iconSizeData,X=n.evaluateSizeForZoom(U,h.transform.zoom),J=F.projection.name==="globe",te=[256/h.width*2+1,256/h.height*2+1],ee=g?f.text.dynamicLayoutVertexArray:f.icon.dynamicLayoutVertexArray;ee.clear();let ne=null;J&&(ne=g?f.text.globeExtVertexArray:f.icon.globeExtVertexArray);let H=f.lineVertexArray,Q=g?f.text.placedSymbolArray:f.icon.placedSymbolArray,le=h.transform.width/h.transform.height,ue,ye=!1;for(let xe=0;xe<Q.length;xe++){let be=Q.get(xe),{numGlyphs:De,writingMode:Ie}=be;if(Ie!==n.WritingMode.vertical||ye||ue===n.WritingMode.horizontal||(ye=!0),ue=Ie,(be.hidden||Ie===n.WritingMode.vertical)&&!ye){ls(De,ee);continue}ye=!1;let Re=new n.Point(be.tileAnchorX,be.tileAnchorY),{x:nt,y:Ae,z:Ze}=F.projection.projectTilePoint(Re.x,Re.y,z.canonical);if(O){let[oi,Ot,Gt]=O(Re);nt+=oi,Ae+=Ot,Ze+=Gt}let Ne=[nt,Ae,Ze,1];if(n.transformMat4$1(Ne,Ne,c),!As(Ne,te)){ls(De,ee);continue}let it=x0(h.transform.cameraToCenterDistance,Ne[3]),Oe=n.evaluateSizeForFeature(U,X,be),qe=I?Oe/it:Oe*it,ot=Ir(nt,Ae,Ze,y);if(ot[3]<=0){ls(De,ee);continue}let Je={},lt=I?null:O,zt=Tt(be,qe,!1,D,c,y,x,f.glyphOffsetArray,H,ee,ne,ot,Re,Je,le,lt,F.projection,z,I);ye=zt.useVertical,lt&&zt.needsFlipping&&(Je={}),(zt.notEnoughRoom||ye||zt.needsFlipping&&Tt(be,qe,!0,D,c,y,x,f.glyphOffsetArray,H,ee,ne,ot,Re,Je,le,lt,F.projection,z,I).notEnoughRoom)&&ls(De,ee)}g?(f.text.dynamicLayoutVertexBuffer.updateData(ee),ne&&f.text.globeExtVertexBuffer.updateData(ne)):(f.icon.dynamicLayoutVertexBuffer.updateData(ee),ne&&f.icon.globeExtVertexBuffer.updateData(ne))}function w0(f,c,h,g,y,x,I,D,O,z,F,U,X,J,te,ee){let{lineStartIndex:ne,glyphStartIndex:H,segment:Q}=D,le=H+D.numGlyphs,ue=ne+D.lineLength,ye=c.getoffsetX(H),xe=c.getoffsetX(le-1),be=Io(f*ye,h,g,y,x,I,Q,ne,ue,O,z,F,U,X,!0,J,te,ee);if(!be)return null;let De=Io(f*xe,h,g,y,x,I,Q,ne,ue,O,z,F,U,X,!0,J,te,ee);return De?{first:be,last:De}:null}function bc(f,c,h,g){return f===n.WritingMode.horizontal&&Math.abs(g)>Math.abs(h)?{useVertical:!0}:f===n.WritingMode.vertical?g>0?{needsFlipping:!0}:null:c!==sa.unknown&&function(y,x){return y===0||Math.abs(x/y)>zu}(h,g)?c===sa.flipRequired?{needsFlipping:!0}:null:h<0?{needsFlipping:!0}:null}function Tt(f,c,h,g,y,x,I,D,O,z,F,U,X,J,te,ee,ne,H,Q){let le=c/24,ue=f.lineOffsetX*le,ye=f.lineOffsetY*le,{lineStartIndex:xe,glyphStartIndex:be,numGlyphs:De,segment:Ie,writingMode:Re,flipState:nt}=f,Ae=xe+f.lineLength,Ze=Ne=>{if(F){let[ot,Je,lt]=Ne.up,zt=z.length;n.updateGlobeVertexNormal(F,zt+0,ot,Je,lt),n.updateGlobeVertexNormal(F,zt+1,ot,Je,lt),n.updateGlobeVertexNormal(F,zt+2,ot,Je,lt),n.updateGlobeVertexNormal(F,zt+3,ot,Je,lt)}let[it,Oe,qe]=Ne.point;n.addDynamicAttributes(z,it,Oe,qe,Ne.angle)};if(De>1){let Ne=w0(le,D,ue,ye,h,U,X,f,O,x,J,ee,!1,ne,H,Q);if(!Ne)return{notEnoughRoom:!0};if(g&&!h){let[it,Oe,qe]=Ne.first.point,[ot,Je,lt]=Ne.last.point;[it,Oe]=Ir(it,Oe,qe,I),[ot,Je]=Ir(ot,Je,lt,I);let zt=bc(Re,nt,(ot-it)*te,Je-Oe);if(f.flipState=zt&&zt.needsFlipping?sa.flipRequired:sa.flipNotRequired,zt)return zt}Ze(Ne.first);for(let it=be+1;it<be+De-1;it++){let Oe=Io(le*D.getoffsetX(it),ue,ye,h,U,X,Ie,xe,Ae,O,x,J,ee,!1,!1,ne,H,Q);if(!Oe)return z.length-=4*(it-be),{notEnoughRoom:!0};Ze(Oe)}Ze(Ne.last)}else{if(g&&!h){let it=Ir(X.x,X.y,0,y),Oe=xe+Ie+1,qe=new n.Point(O.getx(Oe),O.gety(Oe)),ot=Ir(qe.x,qe.y,0,y),Je=ot[3]>0?ot:Ii(X,qe,it,1,y,void 0,ne,H.canonical),lt=bc(Re,nt,(Je[0]-it[0])*te,Je[1]-it[1]);if(f.flipState=lt&&lt.needsFlipping?sa.flipRequired:sa.flipNotRequired,lt)return lt}let Ne=Io(le*D.getoffsetX(be),ue,ye,h,U,X,Ie,xe,Ae,O,x,J,ee,!1,!1,ne,H,Q);if(!Ne)return{notEnoughRoom:!0};Ze(Ne)}return{}}function Oi(f,c,h,g,y){let{x,y:I,z:D}=g.projectTilePoint(f.x,f.y,c);if(!y)return Ir(x,I,D,h);let[O,z,F]=y(f);return Ir(x+O,I+z,D+F,h)}function Ii(f,c,h,g,y,x,I,D){let O=Oi(f.sub(c)._unit()._add(f),D,y,I,x);return n.sub(O,h,O),n.normalize(O,O),n.scaleAndAdd(O,h,O,g)}function Io(f,c,h,g,y,x,I,D,O,z,F,U,X,J,te,ee,ne,H){let Q=g?f-c:f+c,le=Q>0?1:-1,ue=0;g&&(le*=-1,ue=Math.PI),le<0&&(ue+=Math.PI);let ye=D+I+(le>0?0:1)|0,xe=y,be=y,De=0,Ie=0,Re=Math.abs(Q),nt=[],Ae=[],Ze=x,Ne=Ze,it=()=>Ii(Ne,Ze,be,Re-De+1,F,X,ee,ne.canonical);for(;De+Ie<=Re;){if(ye+=le,ye<D||ye>=O)return null;if(be=xe,Ne=Ze,nt.push(be),J&&Ae.push(Ne),Ze=new n.Point(z.getx(ye),z.gety(ye)),xe=U[ye],!xe){let Gt=Oi(Ze,ne.canonical,F,ee,X);xe=Gt[3]>0?U[ye]=Gt:it()}De+=Ie,Ie=n.distance(be,xe)}te&&X&&(U[ye]&&(xe=it(),Ie=n.distance(be,xe)),U[ye]=xe);let Oe=(Re-De)/Ie,qe=Ze.sub(Ne)._mult(Oe)._add(Ne),ot=n.sub([],xe,be),Je=n.scaleAndAdd([],be,ot,Oe),lt=[0,0,1],zt=ot[0],oi=ot[1];if(H&&(lt=ee.upVector(ne.canonical,qe.x,qe.y),lt[0]!==0||lt[1]!==0||lt[2]!==1)){let Gt=[lt[2],0,-lt[0]],Mi=n.cross([],lt,Gt);n.normalize(Gt,Gt),n.normalize(Mi,Mi),zt=n.dot(ot,Gt),oi=n.dot(ot,Mi)}if(h){let Gt=n.cross([],lt,ot);n.normalize(Gt,Gt),n.scaleAndAdd(Je,Je,Gt,h*le)}let Ot=ue+Math.atan2(oi,zt);return nt.push(Je),J&&Ae.push(qe),{point:Je,angle:Ot,path:nt,tilePath:Ae,up:lt}}function ls(f,c){let h=c.length,g=h+4*f;c.resize(g),c.float32.fill(-1/0,4*h,4*g)}function Di(f,c,h){let g=c[0],y=c[1];return f[0]=h[0]*g+h[4]*y+h[12],f[1]=h[1]*g+h[5]*y+h[13],f[3]=h[3]*g+h[7]*y+h[15],f}let Do=100;class ju{constructor(c,h,g=new Al(c.width+200,c.height+200,25),y=new Al(c.width+200,c.height+200,25)){this.transform=c,this.grid=g,this.ignoredGrid=y,this.pitchfactor=Math.cos(c._pitch)*c.cameraToCenterDistance,this.screenRightBoundary=c.width+Do,this.screenBottomBoundary=c.height+D
8o,this.gridRightBoundary=c.width+200,this.gridBottomBoundary=c.height+200,this.fogState=h}placeCollisionBox(c,h,g,y,x,I,D,O){let z=g.projectedAnchorX,F=g.projectedAnchorY,U=g.projectedAnchorZ,X=g.elevation,J=g.tileID,te=c.getProjection();if(X&&J){let[xe,be,De]=te.upVector(J.canonical,g.tileAnchorX,g.tileAnchorY),Ie=te.upVectorScale(J.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;z+=xe*X*Ie,F+=be*X*Ie,U+=De*X*Ie}let ee=this.projectAndGetPerspectiveRatio(D,z,F,U,g.tileID,te.name==="globe"||!!X||this.transform.pitch>0,te),ne=I*ee.perspectiveRatio,H=(g.x1*h+y.x-g.padding)*ne+ee.point.x,Q=(g.y1*h+y.y-g.padding)*ne+ee.point.y,le=(g.x2*h+y.x+g.padding)*ne+ee.point.x,ue=(g.y2*h+y.y+g.padding)*ne+ee.point.y,ye=ee.perspectiveRatio<=.55||ee.occluded;return!this.isInsideGrid(H,Q,le,ue)||!x&&this.grid.hitTest(H,Q,le,ue,O)||ye?{box:[],offscreen:!1,occluded:ee.occluded}:{box:[H,Q,le,ue],offscreen:this.isOffscreen(H,Q,le,ue),occluded:!1}}placeCollisionCircles(c,h,g,y,x,I,D,O,z,F,U,X,J,te,ee){let ne=[],H=this.transform.elevation,Q=c.getProjection(),le=H?H.getAtTileOffsetFunc(ee,this.transform.center.lat,this.transform.worldSize,Q):null,ue=new n.Point(g.tileAnchorX,g.tileAnchorY),{x:ye,y:xe,z:be}=Q.projectTilePoint(ue.x,ue.y,ee.canonical);if(le){let[qe,ot,Je]=le(ue);ye+=qe,xe+=ot,be+=Je}let De=Q.name==="globe",Ie=this.projectAndGetPerspectiveRatio(D,ye,xe,be,ee,De||!!H||this.transform.pitch>0,Q),{perspectiveRatio:Re}=Ie,nt=(U?I/Re:I*Re)/n.ONE_EM,Ae=Ir(ye,xe,be,O),Ze=Ie.signedDistanceFromCamera>0?w0(nt,x,g.lineOffsetX*nt,g.lineOffsetY*nt,!1,Ae,ue,g,y,O,{},H&&!U?le:null,U&&!!H,Q,ee,U):null,Ne=!1,it=!1,Oe=!0;if(Ze&&!Ie.occluded){let qe=.5*J*Re+te,ot=new n.Point(-100,-100),Je=new n.Point(this.screenRightBoundary,this.screenBottomBoundary),lt=new Yf,{first:zt,last:oi}=Ze,Ot=zt.path.length,Gt=[];for(let Nt=Ot-1;Nt>=1;Nt--)Gt.push(zt.path[Nt]);for(let Nt=1;Nt<oi.path.length;Nt++)Gt.push(oi.path[Nt]);let Mi=2.5*qe;z&&(Gt=Gt.map(([Nt,an,gn],_n)=>(le&&!De&&(gn=le(_n<Ot-1?zt.tilePath[Ot-1-_n]:oi.tilePath[_n-Ot+2])[2]),Ir(Nt,an,gn,z))),Gt.some(Nt=>Nt[3]<=0)&&(Gt=[]));let Ci=[];if(Gt.length>0){let Nt=1/0,an=-1/0,gn=1/0,_n=-1/0;for(let vn of Gt)Nt=Math.min(Nt,vn[0]),gn=Math.min(gn,vn[1]),an=Math.max(an,vn[0]),_n=Math.max(_n,vn[1]);an>=ot.x&&Nt<=Je.x&&_n>=ot.y&&gn<=Je.y&&(Ci=[Gt.map(vn=>new n.Point(vn[0],vn[1]))],(Nt<ot.x||an>Je.x||gn<ot.y||_n>Je.y)&&(Ci=n.clipLine(Ci,ot.x,ot.y,Je.x,Je.y)))}for(let Nt of Ci){lt.reset(Nt,.25*qe);let an=0;an=lt.length<=.5*qe?1:Math.ceil(lt.paddedLength/Mi)+1;for(let gn=0;gn<an;gn++){let _n=gn/Math.max(an-1,1),vn=lt.lerp(_n),Xr=vn.x+Do,Mr=vn.y+Do;ne.push(Xr,Mr,qe,0);let Wo=Xr-qe,Ls=Mr-qe,Nn=Xr+qe,yn=Mr+qe;if(Oe=Oe&&this.isOffscreen(Wo,Ls,Nn,yn),it=it||this.isInsideGrid(Wo,Ls,Nn,yn),!h&&this.grid.hitTestCircle(Xr,Mr,qe,X)&&(Ne=!0,!F))return{circles:[],offscreen:!1,collisionDetected:Ne,occluded:!1}}}}return{circles:!F&&Ne||!it?[]:ne,offscreen:Oe,collisionDetected:Ne,occluded:Ie.occluded}}queryRenderedSymbols(c){if(c.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let h=[],g=1/0,y=1/0,x=-1/0,I=-1/0;for(let F of c){let U=new n.Point(F.x+Do,F.y+Do);g=Math.min(g,U.x),y=Math.min(y,U.y),x=Math.max(x,U.x),I=Math.max(I,U.y),h.push(U)}let D=this.grid.query(g,y,x,I).concat(this.ignoredGrid.query(g,y,x,I)),O={},z={};for(let F of D){let U=F.key;if(O[U.bucketInstanceId]===void 0&&(O[U.bucketInstanceId]={}),O[U.bucketInstanceId][U.featureIndex])continue;let X=[new n.Point(F.x1,F.y1),new n.Point(F.x2,F.y1),new n.Point(F.x2,F.y2),new n.Point(F.x1,F.y2)];n.polygonIntersectsPolygon(h,X)&&(O[U.bucketInstanceId][U.featureIndex]=!0,z[U.bucketInstanceId]===void 0&&(z[U.bucketInstanceId]=[]),z[U.bucketInstanceId].push(U.featureIndex))}return z}insertCollisionBox(c,h,g,y,x){(h?this.ignoredGrid:this.grid).insert({bucketInstanceId:g,featureIndex:y,collisionGroupID:x},c[0],c[1],c[2],c[3])}insertCollisionCircles(c,h,g,y,x){let I=h?this.ignoredGrid:this.grid,D={bucketInstanceId:g,featureIndex:y,collisionGroupID:x};for(let O=0;O<c.length;O+=4)I.insertCircle(D,c[O],c[O+1],c[O+2])}projectAndGetPerspectiveRatio(c,h,g,y,x,I,D){let O=[h,g,y,1],z=!1;y||this.transform.pitch>0?(n.transformMat4$1(O,O,c),this.fogState&&x&&D.name!=="globe"&&(z=function(X,J,te,ee,ne,H){let Q=H.calculateFogTileMatrix(ne),le=[J,te,ee];return n.transformMat4(le,le,Q),Fa(X,le,H.pitch,H._fov)}(this.fogState,h,g,y,x.toUnwrapped(),this.transform)>.9)):Di(O,O,c);let F=O[3];return{point:new n.Point((O[0]/F+1)/2*this.transform.width+Do,(-O[1]/F+1)/2*this.transform.height+D
8o),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(D)/F*.5,1.5),signedDistanceFromCamera:F,occluded:I&&O[2]>F||z}}isOffscreen(c,h,g,y){return g<Do||c>=this.screenRightBoundary||y<Do||h>this.screenBottomBoundary}isInsideGrid(c,h,g,y){return g>=0&&c<this.gridRightBoundary&&y>=0&&h<this.gridBottomBoundary}getViewportMatrix(){let c=n.identity([]);return n.translate(c,c,[-100,-100,0]),c}}function Pl(f,c,h){let g=c.createTileMatrix(f,f.worldSize,h.toUnwrapped());return n.multiply(new Float32Array(16),f.projMatrix,g)}function Ho(f,c,h){if(c.projection.name===h.projection.name)return f.projMatrix;let g=h.clone();return g.setProjection(c.projection),Pl(g,c.getProjection(),f)}function Fn(f,c,h){return c.name===h.projection.name?f.projMatrix:Pl(h,c,f)}class C0{constructor(c,h,g,y){this.opacity=c?Math.max(0,Math.min(1,c.opacity+(c.placed?h:-h))):y&&g?1:0,this.placed=g}isHidden(){return this.opacity===0&&!this.placed}}class la{constructor(c,h,g,y,x,I=!1){this.text=new C0(c?c.text:null,h,g,x),this.icon=new C0(c?c.icon:null,h,y,x),this.clipped=I}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Vu{constructor(c,h,g,y=!1){this.text=c,this.icon=h,this.skipFade=g,this.clipped=y}}class Bu{constructor(){this.invProjMatrix=n.create(),this.viewportMatrix=n.create(),this.circles=[]}}class Jf{constructor(c,h,g,y,x){this.bucketInstanceId=c,this.featureIndex=h,this.sourceLayerIndex=g,this.bucketIndex=y,this.tileID=x}}class E0{constructor(c){this.crossSourceCollisions=c,this.maxGroupID=0,this.collisionGroups={}}get(c){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[c]){let h=++this.maxGroupID;this.collisionGroups[c]={ID:h,predicate:g=>g.collisionGroupID===h}}return this.collisionGroups[c]}}function Uu(f,c,h,g,y){let{horizontalAlign:x,verticalAlign:I}=n.getAnchorAlignment(f),D=-(x-.5)*c,O=-(I-.5)*h,z=n.evaluateVariableOffset(f,g);return new n.Point(D+z[0]*y,O+z[1]*y)}function Hu(f,c,h,g,y){let x=new n.Point(f,c);return h&&x._rotate(g?y:-y),x}class mh{constructor(c,h,g,y,x){this.transform=c.clone(),this.projection=c.projection.name,this.collisionIndex=new ju(this.transform,x),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=h,this.retainedQueryData={},this.collisionGroups=new E0(g),this.collisionCircleArrays={},this.prevPlacement=y,y&&(y.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(c,h,g,y){let x=g.getBucket(h),I=g.latestFeatureIndex;if(!x||!I||h.id!==x.layerIds[0])return;let D=x.layers[0].layout,O=g.collisionBoxArray,z=Math.pow(2,this.transform.zoom-g.tileID.overscaledZ),F=g.tileSize/n.EXTENT,U=g.tileID.toUnwrapped();this.transform.setProjection(x.projection);let X=(J=g.tileID,te=x.getProjection(),ee=this.transform,te.name===this.projection?ee.calculateProjMatrix(J.toUnwrapped()):Pl(ee,te,J));var J,te,ee;let ne=D.get("text-pitch-alignment")==="map",H=D.get("text-rotation-alignment")==="map";h.compileFilter();let Q=h.dynamicFilter(),le=h.dynamicFilterNeedsFeature(),ue=this.transform.calculatePixelsToTileUnitsMatrix(g),ye=aa(X,g.tileID.canonical,ne,H,this.transform,x.getProjection(),ue),xe=null;if(ne){let Ie=lr(X,g.tileID.canonical,ne,H,this.transform,x.getProjection(),ue);xe=n.multiply([],this.transform.labelPlaneMatrix,Ie)}let be=null;Q&&g.latestFeatureIndex&&(be={unwrappedTileID:U,dynamicFilter:Q,dynamicFilterNeedsFeature:le,featureIndex:g.latestFeatureIndex}),this.retainedQueryData[x.bucketInstanceId]=new Jf(x.bucketInstanceId,I,x.sourceLayerIndex,x.index,g.tileID);let De={bucket:x,layout:D,posMatrix:X,textLabelPlaneMatrix:ye,labelToScreenMatrix:xe,clippingData:be,scale:z,textPixelRatio:F,holdingForFade:g.holdingForFade(),collisionBoxArray:O,partiallyEvaluatedTextSize:n.evaluateSizeForZoom(x.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:n.evaluateSizeForZoom(x.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(x.sourceID)};if(y)for(let Ie of x.sortKeyRanges){let{sortKey:Re,symbolInstanceStart:nt,symbolInstanceEnd:Ae}=Ie;c.push({sortKey:Re,symbolInstanceStart:nt,symbolInstanceEnd:Ae,parameters:De})}else c.push({symbolInstanceStart:0,symbolInstanceEnd:x.symbolInstances.length,parameters:De})}attemptAnchorPlacement(c,h,g,y,x,I,D,O,z,F,U,X,J,te,ee,ne,H,Q){let{textOffset0:le,textOffset1:ue,crossTileID:ye}=X,xe=[le,ue],be=Uu(c,g,y,xe,x),De=this.collisionIndex.placeCollisionBox(te,x,h,Hu(be.x,be.y,I,D,this.transform.angle),U,O,z,F.predicate);if(ne){let Ie=te.getSymbolInstanceIconSize(Q,this.transform.zoom,X.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(te,Ie,ne,Hu(be.x,be.y,I,D,this.transform.angle),U,O,z,F.predicate).box.length===0)return}if(De.box.length>0){let Ie;return this.prevPlacement&&this.prevPlacement.variableOffsets[ye]&&this.prevPlacement.placements[ye]&&this.prevPlacement.placements[ye].text&&(Ie=this.prevPlacement.variableOffsets[ye].anch
8or),this.variableOffsets[ye]={textOffset:xe,width:g,height:y,anchor:c,textScale:x,prevAnchor:Ie},this.markUsedJustification(te,c,X,ee),te.allowVerticalPlacement&&(this.markUsedOrientation(te,ee,X),this.placedOrientations[ye]=ee),{shift:be,placedGlyphBoxes:De}}}placeLayerBucketPart(c,h,g,y){let{bucket:x,layout:I,posMatrix:D,textLabelPlaneMatrix:O,labelToScreenMatrix:z,clippingData:F,textPixelRatio:U,holdingForFade:X,collisionBoxArray:J,partiallyEvaluatedTextSize:te,partiallyEvaluatedIconSize:ee,collisionGroup:ne}=c.parameters,H=I.get("text-optional"),Q=I.get("icon-optional"),le=I.get("text-allow-overlap"),ue=I.get("icon-allow-overlap"),ye=I.get("text-rotation-alignment")==="map",xe=I.get("text-pitch-alignment")==="map",be=I.get("icon-text-fit")!=="none",De=I.get("symbol-z-order")==="viewport-y";this.transform.setProjection(x.projection);let Ie=le&&(ue||!x.hasIconData()||Q),Re=ue&&(le||!x.hasTextData()||H);!x.collisionArrays&&J&&x.deserializeCollisionBoxes(J),g&&y&&x.updateCollisionDebugBuffers(this.transform.zoom,J);let nt=(Ae,Ze,Ne)=>{let{crossTileID:it,numVerticalGlyphVertices:Oe}=Ae;if(F){let Nn={zoom:this.transform.zoom,pitch:this.transform.pitch},yn=null;if(F.dynamicFilterNeedsFeature){let Qi=this.retainedQueryData[x.bucketInstanceId];yn=F.featureIndex.loadFeature({featureIndex:Ae.featureIndex,bucketIndex:Qi.bucketIndex,sourceLayerIndex:Qi.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,F.dynamicFilter)(Nn,yn,this.retainedQueryData[x.bucketInstanceId].tileID.canonical,new n.Point(Ae.tileAnchorX,Ae.tileAnchorY),this.transform.calculateDistanceTileData(F.unwrappedTileID)))return this.placements[it]=new Vu(!1,!1,!1,!0),void h.add(it)}if(h.has(it))return;if(X)return void(this.placements[it]=new Vu(!1,!1,!1));let qe=!1,ot=!1,Je=!0,lt=!1,zt=!1,oi=null,Ot={box:null,offscreen:null,occluded:null},Gt={box:null,offscreen:null,occluded:null},Mi=null,Ci=null,Nt=null,an=0,gn=0,_n=0;Ne.textFeatureIndex?an=Ne.textFeatureIndex:Ae.useRuntimeCollisionCircles&&(an=Ae.featureIndex),Ne.verticalTextFeatureIndex&&(gn=Ne.verticalTextFeatureIndex);let vn=Nn=>{Nn.tileID=this.retainedQueryData[x.bucketInstanceId].tileID;let yn=this.transform.elevation;(yn||Nn.elevation)&&(Nn.elevation=yn?yn.getAtTileOffset(Nn.tileID,Nn.tileAnchorX,Nn.tileAnchorY):0)},Xr=Ne.textBox;if(Xr){vn(Xr);let Nn=Qi=>{let cr=n.WritingMode.horizontal;if(x.allowVerticalPlacement&&!Qi&&this.prevPlacement){let co=this.prevPlacement.placedOrientations[it];co&&(this.placedOrientations[it]=co,cr=co,this.markUsedOrientation(x,cr,Ae))}return cr},yn=(Qi,cr)=>{if(x.allowVerticalPlacement&&Oe>0&&Ne.verticalTextBox){for(let co of x.writingModes)if(co===n.WritingMode.vertical?(Ot=cr(),Gt=Ot):Ot=Qi(),Ot&&Ot.box&&Ot.box.length)break}else Ot=Qi()};if(I.get("text-variable-anchor")){let Qi=I.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[it]){let On=this.prevPlacement.variableOffsets[it];Qi.indexOf(On.anchor)>0&&(Qi=Qi.filter(_o=>_o!==On.anchor),Qi.unshift(On.anchor))}let cr=(On,_o,Uh)=>{let Vl=x.getSymbolInstanceTextSize(te,Ae,this.transform.zoom,Ze),cd=(On.x2-On.x1)*Vl+2*On.padding,ma=(On.y2-On.y1)*Vl+2*On.padding,Ua=be&&!ue?_o:null;Ua&&vn(Ua);let Bl={box:[],offscreen:!1,occluded:!1},Hh=le?2*Qi.length:Qi.length;for(let ud=0;ud<Hh;++ud){let Hm=this.attemptAnchorPlacement(Qi[ud%Qi.length],On,cd,ma,Vl,ye,xe,U,D,ne,ud>=Qi.length,Ae,Ze,x,Uh,Ua,te,ee);if(Hm&&(Bl=Hm.placedGlyphBoxes,Bl&&Bl.box&&Bl.box.length)){qe=!0,oi=Hm.shift;break}}return Bl};yn(()=>cr(Xr,Ne.iconBox,n.WritingMode.horizontal),()=>{let On=Ne.verticalTextBox;return On&&vn(On),x.allowVerticalPlacement&&!(Ot&&Ot.box&&Ot.box.length)&&Oe>0&&On?cr(On,Ne.verticalIconBox,n.WritingMode.vertical):{box:null,offscreen:null,occluded:null}}),Ot&&(qe=Ot.box,Je=Ot.offscreen,lt=Ot.occluded);let co=Nn(!(!Ot||!Ot.box));if(!qe&&this.prevPlacement){let On=this.prevPlacement.variableOffsets[it];On&&(this.variableOffsets[it]=On,this.markUsedJustification(x,On.anchor,Ae,co))}}else{let Qi=(cr,co)=>{let On=x.getSymbolInstanceTextSize(te,Ae,this.transform.zoom,Ze),_o=this.collisionIndex.placeCollisionBox(x,On,cr,new n.Point(0,0),le,U,D,ne.predicate);return _o&&_o.box&&_o.box.length&&(this.markUsedOrientation(x,co,Ae),this.placedOrientations[it]=co),_o};yn(()=>Qi(Xr,n.WritingMode.horizontal),()=>{let cr=Ne.verticalTextBox;return x.allowVerticalPlacement&&Oe>0&&cr?(vn(cr),Qi(cr,n.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}}),Nn(!!(Ot&&Ot.box&&Ot.box.length))}}if(Mi=Ot,qe=Mi&&Mi.box&&Mi.box.length>0,Je=Mi&&Mi.offscreen,lt=Mi&&Mi.occluded,Ae.useRuntimeCollisionCircles){let Nn=x.text.placedSymbolArray.get(Ae.centerJustifiedTextSymbolIndex>=0?Ae.centerJustifiedTextSymbolIndex:Ae.verticalPlacedTextSymbolIndex),yn=n.evaluateSizeForFeature
8(x.textSizeData,te,Nn),Qi=I.get("text-padding");Ci=this.collisionIndex.placeCollisionCircles(x,le,Nn,x.lineVertexArray,x.glyphOffsetArray,yn,D,O,z,g,xe,ne.predicate,Ae.collisionCircleDiameter*yn/n.ONE_EM,Qi,this.retainedQueryData[x.bucketInstanceId].tileID),qe=le||Ci.circles.length>0&&!Ci.collisionDetected,Je=Je&&Ci.offscreen,lt=Ci.occluded}if(Ne.iconFeatureIndex&&(_n=Ne.iconFeatureIndex),Ne.iconBox){let Nn=yn=>{vn(yn);let Qi=be&&oi?Hu(oi.x,oi.y,ye,xe,this.transform.angle):new n.Point(0,0),cr=x.getSymbolInstanceIconSize(ee,this.transform.zoom,Ae.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(x,cr,yn,Qi,ue,U,D,ne.predicate)};Gt&&Gt.box&&Gt.box.length&&Ne.verticalIconBox?(Nt=Nn(Ne.verticalIconBox),ot=Nt.box.length>0):(Nt=Nn(Ne.iconBox),ot=Nt.box.length>0),Je=Je&&Nt.offscreen,zt=Nt.occluded}let Mr=H||Ae.numHorizontalGlyphVertices===0&&Oe===0,Wo=Q||Ae.numIconVertices===0;if(Mr||Wo?Wo?Mr||(ot=ot&&qe):qe=ot&&qe:ot=qe=ot&&qe,qe&&Mi&&Mi.box&&this.collisionIndex.insertCollisionBox(Mi.box,I.get("text-ignore-placement"),x.bucketInstanceId,Gt&&Gt.box&&gn?gn:an,ne.ID),ot&&Nt&&this.collisionIndex.insertCollisionBox(Nt.box,I.get("icon-ignore-placement"),x.bucketInstanceId,_n,ne.ID),Ci&&(qe&&this.collisionIndex.insertCollisionCircles(Ci.circles,I.get("text-ignore-placement"),x.bucketInstanceId,an,ne.ID),g)){let Nn=x.bucketInstanceId,yn=this.collisionCircleArrays[Nn];yn===void 0&&(yn=this.collisionCircleArrays[Nn]=new Bu);for(let Qi=0;Qi<Ci.circles.length;Qi+=4)yn.circles.push(Ci.circles[Qi+0]),yn.circles.push(Ci.circles[Qi+1]),yn.circles.push(Ci.circles[Qi+2]),yn.circles.push(Ci.collisionDetected?1:0)}let Ls=x.projection.name!=="globe";Ie=Ie&&(Ls||!lt),Re=Re&&(Ls||!zt),this.placements[it]=new Vu(qe||Ie,ot||Re,Je||x.justReloaded),h.add(it)};if(De){let Ae=x.getSortedSymbolIndexes(this.transform.angle);for(let Ze=Ae.length-1;Ze>=0;--Ze){let Ne=Ae[Ze];nt(x.symbolInstances.get(Ne),Ne,x.collisionArrays[Ne])}}else for(let Ae=c.symbolInstanceStart;Ae<c.symbolInstanceEnd;Ae++)nt(x.symbolInstances.get(Ae),Ae,x.collisionArrays[Ae]);if(g&&x.bucketInstanceId in this.collisionCircleArrays){let Ae=this.collisionCircleArrays[x.bucketInstanceId];n.invert(Ae.invProjMatrix,D),Ae.viewportMatrix=this.collisionIndex.getViewportMatrix()}x.justReloaded=!1}markUsedJustification(c,h,g,y){let{leftJustifiedTextSymbolIndex:x,centerJustifiedTextSymbolIndex:I,rightJustifiedTextSymbolIndex:D,verticalPlacedTextSymbolIndex:O,crossTileID:z}=g,F=n.getAnchorJustification(h),U=y===n.WritingMode.vertical?O:F==="left"?x:F==="center"?I:F==="right"?D:-1;x>=0&&(c.text.placedSymbolArray.get(x).crossTileID=U>=0&&x!==U?0:z),I>=0&&(c.text.placedSymbolArray.get(I).crossTileID=U>=0&&I!==U?0:z),D>=0&&(c.text.placedSymbolArray.get(D).crossTileID=U>=0&&D!==U?0:z),O>=0&&(c.text.placedSymbolArray.get(O).crossTileID=U>=0&&O!==U?0:z)}markUsedOrientation(c,h,g){let y=h===n.WritingMode.horizontal||h===n.WritingMode.horizontalOnly?h:0,x=h===n.WritingMode.vertical?h:0,{leftJustifiedTextSymbolIndex:I,centerJustifiedTextSymbolIndex:D,rightJustifiedTextSymbolIndex:O,verticalPlacedTextSymbolIndex:z}=g,F=c.text.placedSymbolArray;I>=0&&(F.get(I).placedOrientation=y),D>=0&&(F.get(D).placedOrientation=y),O>=0&&(F.get(O).placedOrientation=y),z>=0&&(F.get(z).placedOrientation=x)}commit(c){this.commitTime=c,this.zoomAtLastRecencyCheck=this.transform.zoom;let h=this.prevPlacement,g=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;let y=h?h.symbolFadeChange(c):1,x=h?h.opacities:{},I=h?h.variableOffsets:{},D=h?h.placedOrientations:{};for(let O in this.placements){let z=this.placements[O],F=x[O];F?(this.opacities[O]=new la(F,y,z.text,z.icon,null,z.clipped),g=g||z.text!==F.text.placed||z.icon!==F.icon.placed):(this.opacities[O]=new la(null,y,z.text,z.icon,z.skipFade,z.clipped),g=g||z.text||z.icon)}for(let O in x){let z=x[O];if(!this.opacities[O]){let F=new la(z,y,!1,!1);F.isHidden()||(this.opacities[O]=F,g=g||z.text.placed||z.icon.placed)}}for(let O in I)this.variableOffsets[O]||!this.opacities[O]||this.opacities[O].isHidden()||(this.variableOffsets[O]=I[O]);for(let O in D)this.placedOrientations[O]||!this.opacities[O]||this.opacities[O].isHidden()||(this.placedOrientations[O]=D[O]);g?this.lastPlacementChangeTime=c:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:c)}updateLayerOpacities(c,h){let g=new Set;for(let y of h){let x=y.getBucket(c);x&&y.latestFeatureIndex&&c.id===x.layerIds[0]&&this.updateBucketOpacities(x,g,y.collisionBoxArray)}}updateBucketOpacities(c,h,g){c.hasTextData()&&c.text.opacityVertexArray.clear(),c.hasIconData()&&c.icon.opacityVertexArray.clear(),c.hasIconCollisionBoxData()&&c.iconCollisionBox.collisionVertexArray.clear(),c.hasTextCollisionBoxData()&&c.textCollisionBox.collisionVertexArray.clear();let y=c.layers[0].layout,x=!!c.layers[0].dynamicFilter(),I=new la(null,0,!1,!1,
8!0),D=y.get("text-allow-overlap"),O=y.get("icon-allow-overlap"),z=y.get("text-variable-anchor"),F=y.get("text-rotation-alignment")==="map",U=y.get("text-pitch-alignment")==="map",X=y.get("icon-text-fit")!=="none",J=new la(null,0,D&&(O||!c.hasIconData()||y.get("icon-optional")),O&&(D||!c.hasTextData()||y.get("text-optional")),!0);!c.collisionArrays&&g&&(c.hasIconCollisionBoxData()||c.hasTextCollisionBoxData())&&c.deserializeCollisionBoxes(g);let te=(ne,H,Q)=>{for(let le=0;le<H/4;le++)ne.opacityVertexArray.emplaceBack(Q)},ee=0;for(let ne=0;ne<c.symbolInstances.length;ne++){let H=c.symbolInstances.get(ne),{numHorizontalGlyphVertices:Q,numVerticalGlyphVertices:le,crossTileID:ue,numIconVertices:ye}=H,xe=h.has(ue),be=this.opacities[ue];xe?be=I:be||(be=J,this.opacities[ue]=be),h.add(ue);let De=Q>0||le>0,Ie=ye>0,Re=this.placedOrientations[ue],nt=Re===n.WritingMode.vertical,Ae=Re===n.WritingMode.horizontal||Re===n.WritingMode.horizontalOnly;if(!De&&!Ie||be.isHidden()||ee++,De){let Ze=$u(be.text);te(c.text,Q,nt?Jn:Ze),te(c.text,le,Ae?Jn:Ze);let Ne=be.text.isHidden(),{leftJustifiedTextSymbolIndex:it,centerJustifiedTextSymbolIndex:Oe,rightJustifiedTextSymbolIndex:qe,verticalPlacedTextSymbolIndex:ot}=H,Je=c.text.placedSymbolArray,lt=Ne||nt?1:0;it>=0&&(Je.get(it).hidden=lt),Oe>=0&&(Je.get(Oe).hidden=lt),qe>=0&&(Je.get(qe).hidden=lt),ot>=0&&(Je.get(ot).hidden=Ne||Ae?1:0);let zt=this.variableOffsets[ue];zt&&this.markUsedJustification(c,zt.anchor,H,Re);let oi=this.placedOrientations[ue];oi&&(this.markUsedJustification(c,"left",H,oi),this.markUsedOrientation(c,oi,H))}if(Ie){let Ze=$u(be.icon),{placedIconSymbolIndex:Ne,verticalPlacedIconSymbolIndex:it}=H,Oe=c.icon.placedSymbolArray,qe=be.icon.isHidden()?1:0;Ne>=0&&(te(c.icon,ye,nt?Jn:Ze),Oe.get(Ne).hidden=qe),it>=0&&(te(c.icon,H.numVerticalIconVertices,Ae?Jn:Ze),Oe.get(it).hidden=qe)}if(c.hasIconCollisionBoxData()||c.hasTextCollisionBoxData()){let Ze=c.collisionArrays[ne];if(Ze){let Ne=new n.Point(0,0),it=!0;if(Ze.textBox||Ze.verticalTextBox){if(z){let qe=this.variableOffsets[ue];qe?(Ne=Uu(qe.anchor,qe.width,qe.height,qe.textOffset,qe.textScale),F&&Ne._rotate(U?this.transform.angle:-this.transform.angle)):it=!1}x&&(it=!be.clipped),Ze.textBox&&xc(c.textCollisionBox.collisionVertexArray,be.text.placed,!it||nt,Ne.x,Ne.y),Ze.verticalTextBox&&xc(c.textCollisionBox.collisionVertexArray,be.text.placed,!it||Ae,Ne.x,Ne.y)}let Oe=it&&!!(!Ae&&Ze.verticalIconBox);Ze.iconBox&&xc(c.iconCollisionBox.collisionVertexArray,be.icon.placed,Oe,X?Ne.x:0,X?Ne.y:0),Ze.verticalIconBox&&xc(c.iconCollisionBox.collisionVertexArray,be.icon.placed,!Oe,X?Ne.x:0,X?Ne.y:0)}}}if(c.fullyClipped=ee===0,c.sortFeatures(this.transform.angle),this.retainedQueryData[c.bucketInstanceId]&&(this.retainedQueryData[c.bucketInstanceId].featureSortOrder=c.featureSortOrder),c.hasTextData()&&c.text.opacityVertexBuffer&&c.text.opacityVertexBuffer.updateData(c.text.opacityVertexArray),c.hasIconData()&&c.icon.opacityVertexBuffer&&c.icon.opacityVertexBuffer.updateData(c.icon.opacityVertexArray),c.hasIconCollisionBoxData()&&c.iconCollisionBox.collisionVertexBuffer&&c.iconCollisionBox.collisionVertexBuffer.updateData(c.iconCollisionBox.collisionVertexArray),c.hasTextCollisionBoxData()&&c.textCollisionBox.collisionVertexBuffer&&c.textCollisionBox.collisionVertexBuffer.updateData(c.textCollisionBox.collisionVertexArray),c.bucketInstanceId in this.collisionCircleArrays){let ne=this.collisionCircleArrays[c.bucketInstanceId];c.placementInvProjMatrix=ne.invProjMatrix,c.placementViewportMatrix=ne.viewportMatrix,c.collisionCircleArray=ne.circles,delete this.collisionCircleArrays[c.bucketInstanceId]}}symbolFadeChange(c){return this.fadeDuration===0?1:(c-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(c){return Math.max(0,(this.transform.zoom-c)/1.5)}hasTransitions(c){return this.stale||c-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(c,h){let g=this.zoomAtLastRecencyCheck===h?1-this.zoomAdjustment(h):1;return this.zoomAtLastRecencyCheck=h,this.commitTime+this.fadeDuration*g>c}setStale(){this.stale=!0}}function xc(f,c,h,g,y){f.emplaceBack(c?1:0,h?1:0,g||0,y||0),f.emplaceBack(c?1:0,h?1:0,g||0,y||0),f.emplaceBack(c?1:0,h?1:0,g||0,y||0),f.emplaceBack(c?1:0,h?1:0,g||0,y||0)}
8let mo=Math.pow(2,25),nr=Math.pow(2,24),em=Math.pow(2,17),tm=Math.pow(2,16),go=Math.pow(2,9),$o=Math.pow(2,8),S0=Math.pow(2,1);function $u(f){if(f.opacity===0&&!f.placed)return 0;if(f.opacity===1&&f.placed)return 4294967295;let c=f.placed?1:0,h=Math.floor(127*f.opacity);return h*mo+c*nr+h*em+c*tm+h*go+c*$o+h*S0+c}let Jn=0;class Gu{constructor(c){this._sortAcrossTiles=c.layout.get("symbol-z-order")!=="viewport-y"&&c.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(c,h,g,y,x){let I=this._bucketParts;for(;this._currentTileIndex<c.length;)if(h.getBucketParts(I,y,c[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,x())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,I.sort((D,O)=>D.sortKey-O.sortKey));this._currentPartIndex<I.length;){let D=I[this._currentPartIndex];if(h.placeLayerBucketPart(D,this._seenCrossTileIDs,g,D.symbolInstanceStart===0),this._currentPartIndex++,x())return!0}return!1}}class im{constructor(c,h,g,y,x,I,D,O){this.placement=new mh(c,x,I,D,O),this._currentPlacementIndex=h.length-1,this._forceFullPlacement=g,this._showCollisionBoxes=y,this._done=!1}isDone(){return this._done}continuePlacement(c,h,g){let y=n.exported.now(),x=()=>{let I=n.exported.now()-y;return!this._forceFullPlacement&&I>2};for(;this._currentPlacementIndex>=0;){let I=h[c[this._currentPlacementIndex]],D=this.placement.collisionIndex.transform.zoom;if(I.type==="symbol"&&(!I.minzoom||I.minzoom<=D)&&(!I.maxzoom||I.maxzoom>D)){if(this._inProgressLayer||(this._inProgressLayer=new Gu(I)),this._inProgressLayer.continuePlacement(g[I.source],this.placement,this._showCollisionBoxes,I,x))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(c){return this.placement.commit(c),this.placement}}let Ol=512/n.EXTENT/2;class jr{constructor(c,h,g){this.tileID=c,this.bucketInstanceId=g,this.index=new n.KDBush(h.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];let y=c.canonical.x*n.EXTENT,x=c.canonical.y*n.EXTENT;for(let I=0;I<h.length;I++){let{key:D,crossTileID:O,tileAnchorX:z,tileAnchorY:F}=h.get(I),U=Math.floor((y+z)*Ol),X=Math.floor((x+F)*Ol);this.index.add(U,X),this.keys.push(D),this.crossTileIDs.push(O)}this.index.finish()}findMatches(c,h,g){let y=this.tileID.canonical.z<h.canonical.z?1:Math.pow(2,this.tileID.canonical.z-h.canonical.z),x=Ol/Math.pow(2,h.canonical.z-this.tileID.canonical.z),I=h.canonical.x*n.EXTENT,D=h.canonical.y*n.EXTENT;for(let O=0;O<c.length;O++){let z=c.get(O);if(z.crossTileID)continue;let{key:F,tileAnchorX:U,tileAnchorY:X}=z,J=Math.floor((I+U)*x),te=Math.floor((D+X)*x),ee=this.index.range(J-y,te-y,J+y,te+y);for(let ne of ee){let H=this.crossTileIDs[ne];if(this.keys[ne]===F&&!g.has(H)){g.add(H),z.crossTileID=H;break}}}}}class nm{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class rm{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(c){let h=Math.round((c-this.lng)/360);if(h!==0)for(let g in this.indexes){let y=this.indexes[g],x={};for(let I in y){let D=y[I];D.tileID=D.tileID.unwrapTo(D.tileID.wrap+h),x[D.tileID.key]=D}this.indexes[g]=x}this.lng=c}addBucket(c,h,g){if(this.indexes[c.overscaledZ]&&this.indexes[c.overscaledZ][c.key]){if(this.indexes[c.overscaledZ][c.key].bucketInstanceId===h.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(c.overscaledZ,this.indexes[c.overscaledZ][c.key])}for(let x=0;x<h.symbolInstances.length;x++)h.symbolInstances.get(x).crossTileID=0;this.usedCrossTileIDs[c.overscaledZ]||(this.usedCrossTileIDs[c.overscaledZ]=new Set);let y=this.usedCrossTileIDs[c.overscaledZ];for(let x in this.indexes){let I=this.indexes[x];if(Number(x)>c.overscaledZ)for(let D in I){let O=I[D];O.tileID.isChildOf(c)&&O.findMatches(h.symbolInstances,c,y)}else{let D=I[c.scaledTo(Number(x)).key];D&&D.findMatches(h.symbolInstances,c,y)}}for(let x=0;x<h.symbolInstances.length;x++){let I=h.symbolInstances.get(x);I.crossTileID||(I.crossTileID=g.generate(),y.add(I.crossTileID))}return this.indexes[c.overscaledZ]===void 0&&(this.indexes[c.overscaledZ]={}),this.indexes[c.overscaledZ][c.key]=new jr(c,h.symbolInstances,h.bucketInstanceId),!0}removeBucketCrossTileIDs(c,h){for(let g of h.crossTileIDs)this.usedCrossTileIDs[c].delete(g)}removeStaleBuckets(c){let h=!1;for(let g in this.indexes){let y=this.indexes[g];for(let x in y)c[y[x].bucketInstanceId]||(this.removeBucketCrossTileIDs(g,y[x]),delete y[x],h=!0)}return h}}class ca{constructor(){this.layerIndexes={},this.crossTileIDs=new nm,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(c,h,g,y){let x=this.layerIndexes[c.id];x===void 0&&(x=this.layerIndexes[c.id]=new rm);let I=!1,D={};y.name!=="globe"&&x.handleWrapJump(g);for(let O of h){let z=O.getBucket(c);z&&c.id===z.layerIds[0]&&(z.bucketInstanceId||(z.bucketInstanceId=++this.maxBucketInstanceId),x.addBucket(O.tileID,z,this.crossTileIDs)&&(I=!0),D[z.bucketInstanceId]=!0)}return x.removeStaleBuckets(D)&&(I=!0),I}pruneUnusedLayers(c){let h={};
8c.forEach(g=>{h[g]=!0});for(let g in this.layerIndexes)h[g]||delete this.layerIndexes[g]}}let Va=(f,c)=>n.emitValidationErrors(f,c&&c.filter(h=>h.identifier!=="source.canvas")),gh=n.pick(nn,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),L1=n.pick(nn,["setCenter","setZoom","setBearing","setPitch"]),om={version:8,layers:[],sources:{}},wc={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class Ps extends n.Evented{constructor(c,h={}){super(),this.map=c,this.dispatcher=new Ft(yc(),this),this.imageManager=new so,this.imageManager.setEventedParent(this),this.glyphManager=new n.GlyphManager(c._requestManager,h.localFontFamily?n.LocalGlyphMode.all:h.localIdeographFontFamily?n.LocalGlyphMode.ideographs:n.LocalGlyphMode.none,h.localFontFamily||h.localIdeographFontFamily),this.crossTileSymbolIndex=new ca,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",n.getReferrer());let g=this;this._rtlTextPluginCallback=Ps.registerForPluginStateChange(y=>{g.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:y.pluginStatus,pluginURL:y.pluginURL},(x,I)=>
8{if(n.triggerPluginCompletionEvent(x),I&&I.every(D=>D))for(let D in g._sourceCaches){let O=g._sourceCaches[D],z=O.getSource().type;z!=="vector"&&z!=="geojson"||O.reload()}})}),this.on("data",y=>{if(y.dataType!=="source"||y.sourceDataType!=="metadata")return;let x=this.getSource(y.sourceId);if(x&&x.vectorLayerIds)for(let I in this._layers){let D=this._layers[I];D.source===x.id&&this._validateLayer(D)}})}loadURL(c,h={}){this.fire(new n.Event("dataloading",{dataType:"style"}));let g=typeof h.validate=="boolean"?h.validate:!n.isMapboxURL(c);c=this.map._requestManager.normalizeStyleURL(c,h.accessToken);let y=this.map._requestManager.transformRequest(c,n.ResourceType.Style);this._request=n.getJSON(y,(x,I)=>{this._request=null,x?this.fire(new n.ErrorEvent(x)):I&&this._load(I,g)})}loadJSON(c,h={}){this.fire(new n.Event("dataloading",{dataType:"style"})),this._request=n.exported.frame(()=>{this._request=null,this._load(c,h.validate!==!1)})}loadEmpty(){this.fire(new n.Event("dataloading",{dataType:"style"})),this._load(om,!1)}_updateLayerCount(c,h){let g=h?1:-1;c.is3D()&&(this._num3DLayers+=g),c.type==="circle"&&(this._numCircleLayers+=g),c.type==="symbol"&&(this._numSymbolLayers+=g)}_load(c,h){if(h&&Va(this,n.validateStyle(c)))return;this._loaded=!0,this.stylesheet=n.clone$1(c),this._updateMapProjection();for(let y in c.sources)this.addSource(y,c.sources[y],{validate:!1});this._changed=!1,c.sprite?this._loadSprite(c.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(c.glyphs);let g=b0(this.stylesheet.layers);this._order=g.map(y=>y.id),this._layers={},this._serializedLayers={};for(let y of g){let x=n.createStyleLayer(y);x.setEventedParent(this,{layer:{id:x.id}}),this._layers[x.id]=x,this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new sr(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 n.Event("data",{dataType:"style"})),this.fire(new n.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}setProjection(c){c?this.stylesheet.projection=c: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(c){this._spriteRequest=function(h,g,y){let x,I,D,O=n.exported.devicePixelRatio>1?"@2x":"",z=n.getJSON(g.transformRequest(g.normalizeSpriteURL(h,O,".json"),n.ResourceType.SpriteJSON),(X,J)=>{z=null,D||(D=X,x=J,U())}),F=n.getImage(g.transformRequest(g.normalizeSpriteURL(h,O,".png"),n.ResourceType.SpriteImage),(X,J)=>{F=null,D||(D=X,I=J,U())});function U(){if(D)y(D);else if(x&&I){let X=n.exported.getImageData(I),J={};for(let te in x){let{width:ee,height:ne,x:H,y:Q,sdf:le,pixelRatio:ue,stretchX:ye,stretchY:xe,content:be}=x[te],De=new n.RGBAImage({width:ee,height:ne});n.RGBAImage.copy(X,De,{x:H,y:Q},{x:0,y:0},{width:ee,height:ne}),J[te]={data:De,pixelRatio:ue,sdf:le,stretchX:ye,stretchY:xe,content:be}}y(null,J)}}return{cancel(){z&&(z.cancel(),z=null),F&&(F.cancel(),F=null)}}}(c,this.map._requestManager,(h,g)=>{if(this._spriteRequest=null,h)this.fire(new n.ErrorEvent(h));else if(g)for(let y in g)this.imageManager.addImage(y,g[y]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new n.Event("data",{dataType:"style"}))})}_validateLayer(c){let h=this.getSource(c.source);if(!h)return;let g=c.sourceLayer;g&&(h.type==="geojson"||h.vectorLayerIds&&h.vectorLayerIds.indexOf(g)===-1)&&this.fire(new n.ErrorEvent(new Error(`Source layer "${g}" does not exist on source "${h.id}" as specified by style layer "${c.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let c in this._sourceCaches)if(!this._sourceCaches[c].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(c){let h=[];for(let g of c){let y=this._layers[g];y.type!=="custom"&&h.push(y.serialize())}return h}hasTransitions(){if(this.light&&this.light.hasTransition()||this.fog&&this.fog.hasTransition())return!0;for(let c in this._sourceCaches)if(this._sourceCaches[c].hasTransition())return!0;for(let c in this._layers)if(this._layers[c].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(c){return!!this.terrain&&(typeof c.isLayerDraped=="function"?c.isLayerDraped():wc[c.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}
8update(c){if(!this._loaded)return;let h=this._changed;if(this._changed){let y=Object.keys(this._updatedLayers),x=Object.keys(this._removedLayers);(y.length||x.length)&&this._updateWorkerLayers(y,x);for(let I in this._updatedSources){let D=this._updatedSources[I];D==="reload"?this._reloadSource(I):D==="clear"&&this._clearSource(I)}this._updateTilesForChangedImages();for(let I in this._updatedPaintProps)this._layers[I].updateTransitions(c);this.light.updateTransitions(c),this.fog&&this.fog.updateTransitions(c),this._resetUpdates()}let g={};for(let y in this._sourceCaches){let x=this._sourceCaches[y];g[y]=x.used,x.used=!1}for(let y of this._order){let x=this._layers[y];if(x.recalculate(c,this._availableImages),!x.isHidden(c.zoom)){let D=this._getLayerSourceCache(x);D&&(D.used=!0)}let I=this.map.painter;if(I){let D=x.getProgramIds();if(!D)continue;let O=x.getProgramConfiguration(c.zoom);for(let z of D)I.useProgram(z,O)}}for(let y in g){let x=this._sourceCaches[y];g[y]!==x.used&&x.getSource().fire(new n.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:x.getSource().id}))}this.light.recalculate(c),this.terrain&&this.terrain.recalculate(c),this.fog&&this.fog.recalculate(c),this.z=c.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),h&&this.fire(new n.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){let c=Object.keys(this._changedImages);if(c.length){for(let h in this._sourceCaches)this._sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],c);this._changedImages={}}}_updateWorkerLayers(c,h){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(c),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(c){if(this._checkLoaded(),Va(this,n.validateStyle(c)))return!1;(c=n.clone$1(c)).layers=b0(c.layers);let h=function(y,x){if(!y)return[{command:nn.setStyle,args:[x]}];let I=[];try{if(!d(y.version,x.version))return[{command:nn.setStyle,args:[x]}];d(y.center,x.center)||I.push({command:nn.setCenter,args:[x.center]}),d(y.zoom,x.zoom)||I.push({command:nn.setZoom,args:[x.zoom]}),d(y.bearing,x.bearing)||I.push({command:nn.setBearing,args:[x.bearing]}),d(y.pitch,x.pitch)||I.push({command:nn.setPitch,args:[x.pitch]}),d(y.sprite,x.sprite)||I.push({command:nn.setSprite,args:[x.sprite]}),d(y.glyphs,x.glyphs)||I.push({command:nn.setGlyphs,args:[x.glyphs]}),d(y.transition,x.transition)||I.push({command:nn.setTransition,args:[x.transition]}),d(y.light,x.light)||I.push({command:nn.setLight,args:[x.light]}),d(y.fog,x.fog)||I.push({command:nn.setFog,args:[x.fog]}),d(y.projection,x.projection)||I.push({command:nn.setProjection,args:[x.projection]});let D={},O=[];(function(U,X,J,te){let ee;for(ee in X=X||{},U=U||{})U.hasOwnProperty(ee)&&(X.hasOwnProperty(ee)||Nu(ee,J,te));for(ee in X){if(!X.hasOwnProperty(ee))continue;let ne=X[ee];U.hasOwnProperty(ee)?d(U[ee],ne)||(U[ee].type==="geojson"&&ne.type==="geojson"&&fh(U,X,ee)?J.push({command:nn.setGeoJSONSourceData,args:[ee,ne.data]}):Kf(ee,X,J,te)):Zf(ee,X,J)}})(y.sources,x.sources,O,D);let z=[];y.layers&&y.layers.forEach(U=>{U.source&&D[U.source]?I.push({command:nn.removeLayer,args:[U.id]}):z.push(U)});let F=y.terrain;F&&D[F.source]&&(I.push({command:nn.setTerrain,args:[void 0]}),F=void 0),I=I.concat(O),d(F,x.terrain)||I.push({command:nn.setTerrain,args:[x.terrain]}),function(U,X,J){X=X||[];let te=(U=U||[]).map(oa),ee=X.map(oa),ne=U.reduce(Xf,{}),H=X.reduce(Xf,{}),Q=te.slice(),le=Object.create(null),ue,ye,xe,be,De,Ie,Re;for(ue=0,ye=0;ue<te.length;ue++)xe=te[ue],H.hasOwnProperty(xe)?ye++:(J.push({command:nn.removeLayer,args:[xe]}),Q.splice(Q.indexOf(xe,ye),1));for(ue=0,ye=0;ue<ee.length;ue++)xe=ee[ee.length-1-ue],Q[Q.length-1-ue]!==xe&&(ne.hasOwnProperty(xe)?(J.push({command:nn.removeLayer,args:[xe]}),Q.splice(Q.lastIndexOf(xe,Q.length-ye),1)):ye++,Ie=Q[Q.length-ue],J.push({command:nn.addLayer,args:[H[xe],Ie]}),Q.splice(Q.length-ue,0,xe),le[xe]=!0);for(ue=0;ue<ee.length;ue++)if(xe=ee[ue],be=ne[xe],De=H[xe],!le[xe]&&!d(be,De))if(d(be.source,De.source)&&d(be["source-layer"],De["source-layer"])&&d(be.type,De.type)){for(Re in ks(be.layout,De.layout,J,xe,null,nn.setLayoutProperty),ks(be.paint,De.paint,J,xe,null,nn.setPaintProperty),d(be.filter,De.filter)||J.push({command:nn.setFilter,args:[xe,De.filter]}),d(be.minzoom,De.minzoom)&&d(be.maxzoom,De.maxzoom)||J.push({command:nn.setLayerZoomRange,args:[xe,De.minzoom,De.maxzoom]}),be)be.hasOwnProperty(Re)&&Re!=="layout"&&Re!=="paint"&&Re!=="filter"&&Re!=="metadata"&&Re!=="minzoom"&&Re!=="maxzoom"&&(Re.indexOf("paint.")===0?ks(be[Re],De[Re],J,xe,Re.slice(6),nn.setPaintProperty):d(be[Re],De[Re])||J.push({command:nn.setLayerProperty,args:[xe,Re,De[Re]]}));for(Re in De)De.hasOwnProperty(Re)&&!be.hasOwnProperty(Re)&&Re!=="layout"&&Re!=="paint"&&Re!=="filter"&&Re!=="metadata"&&Re!=="minzoom"&&Re!=="maxzoom"&&(Re.indexOf("paint.")===0?ks(be[Re],De[Re],J,xe,Re.slice(6),nn.setPaintProperty):d(be[Re],De[Re])||J.push({command:nn.setLayerProperty,args:[xe,Re,De[Re]]}))}else J.push({command:nn.removeLayer,args:[xe]}),Ie=Q[Q.lastIndexOf(xe)+1],J.push({command:nn.addLayer,args:[De,Ie]})}(z,x.layers,I)}catch(D){console.warn("Unable to compute style diff:",D),I=[{command:nn.setStyle,args:[x]}]}return I}(this.serialize(),c).filter(y=>!(y.command in L1));if(h.length===0)return!1;let g=h.filter(y=>!(y.command in gh));if(g.length>0)throw new Error(`Unimplemented: ${g.map(y=>y.command).join(", ")}.`);return h.forEach(y=>{y.command!=="setTransition"&&y.command!=="setProjection"&&this[y.command].apply(this,y.args)}),this.stylesheet=c,this._updateMapProjection(),!0}addImage(c,h){return this.getImage(c)?this.fire(new n.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(c,h),this._afterImageUpdated(c),this)}updateImage(c,h){this.imageManager.updateImage(c,h)}getImage(c){return this.imageManager.getImage(c)}removeImage(c){return this.getImage(c)?(this.imageManager.removeImage(c),this._afterImageUpdated(c),this):this.fire(new n.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(c){this._availableImages=this.imageManager.listImages(),this._changedImages[c]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new n.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(c,h,g={}
8){if(this._checkLoaded(),this.getSource(c)!==void 0)throw new Error("There is already a source with this ID");if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(n.validateSource,`sources.${c}`,h,null,g))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);let y=wi(c,h,this.dispatcher,this);y.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(c),source:y.serialize(),sourceId:c}));let x=I=>{let D=(I?"symbol:":"other:")+c,O=this._sourceCaches[D]=new n.SourceCache(D,y,I);(I?this._symbolSourceCaches:this._otherSourceCaches)[c]=O,O.style=this,O.onAdd(this.map)};x(!1),h.type!=="vector"&&h.type!=="geojson"||x(!0),y.onAdd&&y.onAdd(this.map),this._changed=!0}removeSource(c){this._checkLoaded();let h=this.getSource(c);if(!h)throw new Error("There is no source with this ID");for(let y in this._layers)if(this._layers[y].source===c)return this.fire(new n.ErrorEvent(new Error(`Source "${c}" cannot be removed while layer "${y}" is using it.`)));if(this.terrain&&this.terrain.get().source===c)return this.fire(new n.ErrorEvent(new Error(`Source "${c}" cannot be removed while terrain is using it.`)));let g=this._getSourceCaches(c);for(let y of g)delete this._sourceCaches[y.id],delete this._updatedSources[y.id],y.fire(new n.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:y.getSource().id})),y.setEventedParent(null),y.clearTiles();return delete this._otherSourceCaches[c],delete this._symbolSourceCaches[c],h.setEventedParent(null),h.onRemove&&h.onRemove(this.map),this._changed=!0,this}
8setGeoJSONSourceData(c,h){this._checkLoaded(),this.getSource(c).setData(h),this._changed=!0}getSource(c){let h=this._getSourceCache(c);return h&&h.getSource()}_getSources(){let c=[];for(let h in this._otherSourceCaches){let g=this._getSourceCache(h);g&&c.push(g.getSource())}return c}addLayer(c,h,g={}){this._checkLoaded();let y=c.id;if(this.getLayer(y))return void this.fire(new n.ErrorEvent(new Error(`Layer with id "${y}" already exists on this map`)));let x;if(c.type==="custom"){if(Va(this,n.validateCustomStyleLayer(c)))return;x=n.createStyleLayer(c)}else{if(typeof c.source=="object"&&(this.addSource(y,c.source),c=n.clone$1(c),c=n.extend(c,{source:y})),this._validate(n.validateLayer,`layers.${y}`,c,{arrayIndex:-1},g))return;x=n.createStyleLayer(c),this._validateLayer(x),x.setEventedParent(this,{layer:{id:y}}),this._serializedLayers[x.id]=x.serialize(),this._updateLayerCount(x,!0)}let I=h?this._order.indexOf(h):this._order.length;if(h&&I===-1)return void this.fire(new n.ErrorEvent(new Error(`Layer with id "${h}" does not exist on this map.`)));this._order.splice(I,0,y),this._layerOrderChanged=!0,this._layers[y]=x;let D=this._getLayerSourceCache(x);if(this._removedLayers[y]&&x.source&&D&&x.type!=="custom"){let O=this._removedLayers[y];delete this._removedLayers[y],O.type!==x.type?this._updatedSources[x.source]="clear":(this._updatedSources[x.source]="reload",D.pause())}this._updateLayer(x),x.onAdd&&x.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(c,h){if(this._checkLoaded(),this._changed=!0,!this._layers[c])return void this.fire(new n.ErrorEvent(new Error(`The layer '${c}' does not exist in the map's style and cannot be moved.`)));if(c===h)return;let g=this._order.indexOf(c);this._order.splice(g,1);let y=h?this._order.indexOf(h):this._order.length;
8h&&y===-1?this.fire(new n.ErrorEvent(new Error(`Layer with id "${h}" does not exist on this map.`))):(this._order.splice(y,0,c),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(c){this._checkLoaded();let h=this._layers[c];if(!h)return void this.fire(new n.ErrorEvent(new Error(`The layer '${c}' does not exist in the map's style and cannot be removed.`)));h.setEventedParent(null),this._updateLayerCount(h,!1);let g=this._order.indexOf(c);this._order.splice(g,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[c]=h,delete this._layers[c],delete this._serializedLayers[c],delete this._updatedLayers[c],delete this._updatedPaintProps[c],h.onRemove&&h.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(c){return this._layers[c]}hasLayer(c){return c in this._layers}hasLayerType(c){for(let h in this._layers)if(this._layers[h].type===c)return!0;return!1}setLayerZoomRange(c,h,g){this._checkLoaded();let y=this.getLayer(c);y?y.minzoom===h&&y.maxzoom===g||(h!=null&&(y.minzoom=h),g!=null&&(y.maxzoom=g),this._updateLayer(y)):this.fire(new n.ErrorEvent(new Error(`The layer '${c}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(c,h,g={}){this._checkLoaded();let y=this.getLayer(c);if(y){if(!d(y.filter,h))return h==null?(y.filter=void 0,void this._updateLayer(y)):void(this._validate(n.validateFilter,`layers.${y.id}.filter`,h,{layerType:y.type},g)||(y.filter=n.clone$1(h),this._updateLayer(y)))}else this.fire(new n.ErrorEvent(new Error(`The layer '${c}' does not exist in the map's style and cannot be filtered.`)))}getFilter(c){let h=this.getLayer(c);return h&&n.clone$1(h.filter)}setLayoutProperty(c,h,g,y={}){this._checkLoaded();let x=this.getLayer(c);x?d(x.getLayoutProperty(h),g)||(x.setLayoutProperty(h,g,y),this._updateLayer(x)):this.fire(new n.ErrorEvent(new Error(`The layer '${c}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(c,h){let g=this.getLayer(c);if(g)return g.getLayoutProperty(h);this.fire(new n.ErrorEvent(new Error(`The layer '${c}' does not exist in the map's style.`)))}setPaintProperty(c,h,g,y={}){this._checkLoaded();let x=this.getLayer(c);x?d(x.getPaintProperty(h),g)||(x.setPaintProperty(h,g,y)&&this._updateLayer(x),this._changed=!0,this._updatedPaintProps[c]=!0):this.fire(new n.ErrorEvent(new Error(`The layer '${c}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(c,h){let g=this.getLayer(c);return g&&g.getPaintProperty(h)}setFeatureState(c,h){this._checkLoaded();let g=c.source,y=c.sourceLayer,x=this.getSource(g);if(!x)return void this.fire(new n.ErrorEvent(new Error(`The source '${g}' does not exist in the map's style.`)));let I=x.type;if(I==="geojson"&&y)return void this.fire(new n.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(I==="vector"&&!y)return void this.fire(new n.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));c.id===void 0&&this.fire(new n.ErrorEvent(new Error("The feature id parameter must be provided.")));let D=this._getSourceCaches(g);for(let O of D)O.setFeatureState(y,c.id,h)}removeFeatureState(c,h){this._checkLoaded();let g=c.source,y=this.getSource(g);if(!y)return void this.fire(new n.ErrorEvent(new Error(`The source '${g}' does not exist in the map's style.`)));let x=y.type,I=x==="vector"?c.sourceLayer:void 0;if(x==="vector"&&!I)return void this.fire(new n.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(h&&typeof c.id!="string"&&typeof c.id!="number")return void this.fire(new n.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));let D=this._getSourceCaches(g);for(let O of D)O.removeFeatureState(I,c.id,h)}getFeatureState(c){this._checkLoaded();let h=c.source,g=c.sourceLayer,y=this.getSource(h);if(y){if(y.type!=="vector"||g)return c.id===void 0&&this.fire(new n.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(h)[0].getFeatureState(g,c.id);this.fire(new n.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new n.ErrorEvent(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return n.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){let c={};for(let h in this._sourceCaches){let g=this._sourceCaches[h].getSource();c[g.id]||(c[g.id]=g.serialize())}return n.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:c,layers:this._serializeLayers(this._order)},h=>h!==void 0)}_updateLayer(c){this._updatedLayers[c.id]=!0;let h=this._getLayerSourceCache(c);c.source&&!this._updatedSources[c.source]&&h&&h.getSource().type!=="raster"&&(this._updatedSources[c.source]="reload",h.pause()),this._changed=!0,c.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(c){let h=I=>this._layers[I].type==="fill-extrusion",g={},y=[];for(let I=this._order.length-1;I>=0;I--){let D=this._order[I];if(h(D)){g[D]=I;for(let O of c){let z=O[D];if(z)for(let F of z)y.push(F)}}}y.sort((I,D)=>D.intersectionZ-I.intersectionZ);let x=[];for(let I=this._order.length-1;I>=0;I--){let D=this._order[I];if(h(D))for(let O=y.length-1;O>=0;O--){let z=y[O].feature;if(g[z.layer.id]<I)break;x.push(z),y.pop()}else for(let O of c){let z=O[D];if(z)for(let F of z)x.push(F.feature)}}return x}
8queryRenderedFeatures(c,h,g){h&&h.filter&&this._validate(n.validateFilter,"queryRenderedFeatures.filter",h.filter,null,h);let y={};if(h&&h.layers){if(!Array.isArray(h.layers))return this.fire(new n.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(let O of h.layers){let z=this._layers[O];if(!z)return this.fire(new n.ErrorEvent(new Error(`The layer '${O}' does not exist in the map's style and cannot be queried for features.`))),[];y[z.source]=!0}}let x=[];h.availableImages=this._availableImages;let I=h&&h.layers?h.layers.some(O=>{let z=this.getLayer(O);return z&&z.is3D()}):this.has3DLayers(),D=Pn.createFromScreenPoints(c,g);for(let O in this._sourceCaches){let z=this._sourceCaches[O].getSource().id;h.layers&&!y[z]||x.push(Hn(this._sourceCaches[O],this._layers,this._serializedLayers,D,h,g,I,!!this.map._showQueryGeometry))}return this.placement&&x.push(function(O,z,F,U,X,J,te){let ee={},ne=J.queryRenderedSymbols(U),H=[];for(let Q of Object.keys(ne).map(Number))H.push(te[Q]);H.sort(Zr);for(let Q of H){let le=Q.featureIndex.lookupSymbolFeatures(ne[Q.bucketInstanceId],z,Q.bucketIndex,Q.sourceLayerIndex,X.filter,X.layers,X.availableImages,O);for(let ue in le){let ye=ee[ue]=ee[ue]||[],xe=le[ue];xe.sort((be,De)=>{let Ie=Q.featureSortOrder;if(Ie){let Re=Ie.indexOf(be.featureIndex);return Ie.indexOf(De.featureIndex)-Re}return De.featureIndex-be.featureIndex});for(let be of xe)ye.push(be)}}for(let Q in ee)ee[Q].forEach(le=>{let ue=le.feature,ye=F(O[Q]);if(!ye)return;let xe=ye.getFeatureState(ue.layer["source-layer"],ue.id);ue.source=ue.layer.source,ue.layer["source-layer"]&&(ue.sourceLayer=ue.layer["source-layer"]),ue.state=xe});return ee}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),D.screenGeometry,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(x)}querySourceFeatures(c,h){h&&h.filter&&this._validate(n.validateFilter,"querySourceFeatures.filter",h.filter,null,h);let g=this._getSourceCaches(c),y=[];for(let x of g)y=y.concat(ar(x,h));return y}addSourceType(c,h,g){return Ps.getSourceType(c)?g(new Error(`A source type called "${c}" already exists.`)):(Ps.setSourceType(c,h),h.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:c,url:h.workerSourceURL},g):g(null,null))}getLight(){return this.light.getLight()}setLight(c,h={}){this._checkLoaded();let g=this.light.getLight(),y=!1;for(let I in c)if(!d(c[I],g[I])){y=!0;break}if(!y)return;let x=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(c,h),this.light.updateTransitions(x)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(c,h=1){if(this._checkLoaded(),!c)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let g=c;if(h===1){if(typeof g.source=="object"){let y="terrain-dem-src";this.addSource(y,g.source),g=n.clone$1(g),g=n.extend(g,{source:y})}if(this._validate(n.validateTerrain,"terrain",g))return}if(!this.terrain||this.terrain&&h!==this.terrain.drapeRenderMode){if(!g)return;this._createTerrain(g,h)}else{let y=this.terrain,x=y.get();for(let I of Object.keys(n.spec.terrain))!g.hasOwnProperty(I)&&n.spec.terrain[I].default&&(g[I]=n.spec.terrain[I].default);for(let I in g)if(!d(g[I],x[I])){y.set(g),this.stylesheet.terrain=g;let D=this._setTransitionParameters({duration:0});y.updateTransitions(D);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(c){let h=this.fog=new Zt(c,this.map.transform);this.stylesheet.fog=c;let g=this._setTransitionParameters({duration:0});h.updateTransitions(g)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(let c of this.map._markers)c._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(c){if(this._checkLoaded(),!c)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){let h=this.fog,g=h.get();Object.keys(c).length===0&&h.set(c);for(let y in c)if(!d(c[y],g[y])){h.set(c),this.stylesheet.fog=c;let x=this._setTransitionParameters({duration:0});h.updateTransitions(x);break}}else this._createFog(c);
8this._markersNeedUpdate=!0}_setTransitionParameters(c){return{now:n.exported.now(),transition:n.extend(c,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;let c=this._order.filter(g=>this.isLayerDraped(this._layers[g])),h=this._order.filter(g=>!this.isLayerDraped(this._layers[g]));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...c),this._drapedFirstOrder.push(...h)}_createTerrain(c,h){let g=this.terrain=new jo(c,h);this.stylesheet.terrain=c,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();let y=this._setTransitionParameters({duration:0});g.updateTransitions(y)}_force3DLayerUpdate(){for(let c in this._layers){let h=this._layers[c];h.type==="fill-extrusion"&&this._updateLayer(h)}}_forceSymbolLayerUpdate(){for(let c in this._layers){let h=this._layers[c];h.type==="symbol"&&this._updateLayer(h)}}_validate(c,h,g,y,x={}){return(!x||x.validate!==!1)&&Va(this,c.call(n.validateStyle,n.extend({key:h,style:this.serialize(),value:g,styleSpec:n.spec},y)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),n.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(let c in this._layers)this._layers[c].setEventedParent(null);for(let c in this._sourceCaches)this._sourceCaches[c].clearTiles(),this._sourceCaches[c].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(c){let h=this._getSourceCaches(c);for(let g of h)g.clearTiles()}_reloadSource(c){let h=this._getSourceCaches(c);for(let g of h)g.resume(),g.reload()}_reloadSources(){for(let c of this._getSources())c.reload&&c.reload()}_updateSources(c){for(let h in this._sourceCaches)this._sourceCaches[h].update(c)}_generateCollisionBoxes(){for(let c in this._sourceCaches){let h=this._sourceCaches[c];h.resume(),h.reload()}}_updatePlacement(c,h,g,y,x=!1){let I=!1,D=!1,O={};for(let z of this._order){let F=this._layers[z];if(F.type!=="symbol")continue;if(!O[F.source]){let X=this._getLayerSourceCache(F);if(!X)continue;O[F.source]=X.getRenderableIds(!0).map(J=>X.getTileByID(J)).sort((J,te)=>te.tileID.overscaledZ-J.tileID.overscaledZ||(J.tileID.isLessThan(te.tileID)?-1:1))}let U=this.crossTileSymbolIndex.addLayer(F,O[F.source],c.center.lng,c.projection);I=I||U}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),x=x||this._layerOrderChanged||g===0,this._layerOrderChanged&&this.fire(new n.Event("neworder")),(x||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(n.exported.now(),c.zoom))&&(this.pauseablePlacement=new im(c,this._order,x,h,g,y,this.placement,this.fog&&c.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,O),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(n.exported.now()),D=!0),I&&this.pauseablePlacement.placement.setStale()),D||I)for(let z of this._order){let F=this._layers[z];F.type==="symbol"&&this.placement.updateLayerOpacities(F,O[F.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(n.exported.now())}_releaseSymbolFadeTiles(){for(let c in this._sourceCaches)this._sourceCaches[c].releaseSymbolFadeTiles()}getImages(c,h,g){this.imageManager.getImages(h.icons,g),this._updateTilesForChangedImages();let y=x=>{x&&x.setDependencies(h.tileID.key,h.type,h.icons)};y(this._otherSourceCaches[h.source]),y(this._symbolSourceCaches[h.source])}getGlyphs(c,h,g){this.glyphManager.getGlyphs(h.stacks,g)}getResource(c,h,g){return n.makeRequest(h,g)}_getSourceCache(c){return this._otherSourceCaches[c]}_getLayerSourceCache(c){return c.type==="symbol"?this._symbolSourceCaches[c.source]:this._otherSourceCaches[c.source]}_getSourceCaches(c){let h=[];return this._otherSourceCaches[c]&&h.push(this._otherSourceCaches[c]),this._symbolSourceCaches[c]&&h.push(this._symbolSourceCaches[c]),h}_isSourceCacheLoaded(c){let h=this._getSourceCaches(c);return h.length===0?(this.fire(new n.ErrorEvent(new Error(`There is no source with ID '${c}'`))),!1):h.every(g=>g.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)}}Ps.getSourceType=function(f){return pi[f]},Ps.setSourceType=function(f,c){pi[f]=c},Ps.registerForPluginStateChange=n.registerForPluginStateChange;var sm=`
9#define EPSILON 0.0000001
10#define PI 3.141592653589793
11#define EXTENT 8192.0
12#define HALF_PI PI/2.0
13#define QUARTER_PI PI/4.0
14#define RAD_TO_DEG 180.0/PI
15#define DEG_TO_RAD PI/180.0
16#define GLOBE_RADIUS EXTENT/PI/2.0`,Rl="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;
16void 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;}",ua=`
17#define ELEVATION_SCALE 7.0
18#define ELEVATION_OFFSET 450.0
19#ifdef PROJECTION_GLOBE_VIEW
20uniform 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(
21mix(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;}
22#else
23vec3 elevationVector(vec2 pos) { return vec3(0,0,1); }
24#endif
25const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)
26{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}
27#ifdef TERRAIN
28#ifdef TERRAIN_DEM_FLOAT_FORMAT
29uniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;
30#else
31uniform sampler2D u_dem;uniform sampler2D u_dem_prev;
32#endif
33uniform 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) {
34#ifdef TERRAIN_DEM_FLOAT_FORMAT
35vec2 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;
36#else
37float 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));
38#ifdef TERRAIN_DEM_NEAREST_FILTER
39return u_exaggeration*tl;
40#endif
41float 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);
42#endif
43}float prevElevation(vec2 apos) {
44#ifdef TERRAIN_DEM_FLOAT_FORMAT
45vec2 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;
46#else
47float 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);
48#endif
49}
50#ifdef TERRAIN_VERTEX_MORPHING
51float elevation(vec2 apos) {
52#ifdef ZERO_EXAGGERATION
53return 0.0;
54#endif
55float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}
56#else
57float elevation(vec2 apos) {
58#ifdef ZERO_EXAGGERATION
59return 0.0;
60#endif
61return currentElevation(apos);}
62#endif
63highp float unpack_depth(highp vec4 rgba_depth)
64{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(
65unpack_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))
66);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) {
67#ifdef TERRAIN_DEM_FLOAT_FORMAT
68float 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;
69#else
70vec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);
70vec4 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);
71#endif
72return 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);}
73#else
74float elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }
75#endif`,qu=`#ifdef FOG
76uniform 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);}
77#endif`,da=`#ifdef FOG
78uniform 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(
79mix(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);}
80#endif`;let _h={},Cc={},Wu=[];Ec(sm,Wu),Ec(ua,Wu),Ec(qu,Wu),Ec(da,Wu),_h=rn("",ua),Cc=rn(da,qu);let T0=rn(`
81#if __VERSION__ >=300
82#define varying in
83#define gl_FragColor glFragColor
84#define texture2D texture
85#define textureCube texture
86out vec4 glFragColor;
87#endif
88highp 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);}
88vec3 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)
89{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;}`,`
90#if __VERSION__ >=300
91#define attribute in
92#define varying out
93#define texture2D texture
94#endif
95float 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;}
96#ifdef PROJECTION_GLOBE_VIEW
97vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {
98#ifndef PROJECTED_POS_ON_VIEWPORT
99float 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;
100#else
101return vec3(0.0);
102#endif
103}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);}
104#endif
105vec2 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(
106unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
107);}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.`),vh=sm,am=`
108#ifdef GL_ES
109precision mediump float;
110#else
111
112#if !defined(lowp)
113#define lowp
114#endif
115
116#if !defined(mediump)
117#define mediump
118#endif
119
120#if !defined(highp)
121#define highp
122#endif
123
124#endif`;var lm={background:rn(`uniform vec4 u_color;uniform float u_opacity;
125#ifdef LIGHTING_3D_MODE
126varying vec4 v_color;
127#endif
128void main() {vec4 out_color;
129#ifdef LIGHTING_3D_MODE
130out_color=v_color;
131#else
132out_color=u_color;
133#endif
134#ifdef FOG
135out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
136#endif
137gl_FragColor=out_color*u_opacity;
138#ifdef OVERDRAW_INSPECTOR
139gl_FragColor=vec4(1.0);
140#endif
141}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
142#ifdef LIGHTING_3D_MODE
143uniform vec4 u_color;varying vec4 v_color;
144#endif
145void main() {gl_Position=u_matrix*vec4(a_pos,0,1);
146#ifdef LIGHTING_3D_MODE
147v_color=apply_lighting(u_color);
148#endif
149#ifdef FOG
150v_fog_pos=fog_position(a_pos);
151#endif
152}`),backgroundPattern:rn(`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);
153#ifdef LIGHTING_3D_MODE
154out_color=apply_lighting(out_color);
155#endif
156#ifdef FOG
157out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
158#endif
159gl_FragColor=out_color*u_opacity;
160#ifdef OVERDRAW_INSPECTOR
161gl_FragColor=vec4(1.0);
162#endif
163}`,`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);
164#ifdef FOG
165v_fog_pos=fog_position(a_pos);
166#endif
167}`),circle:rn(`varying vec3 v_data;varying float v_visibility;
168#pragma mapbox: define highp vec4 color
169#pragma mapbox: define mediump float radius
170#pragma mapbox: define lowp float blur
171#pragma mapbox: define lowp float opacity
172#pragma mapbox: define highp vec4 stroke_color
173#pragma mapbox: define mediump float stroke_width
174#pragma mapbox: define lowp float stroke_opacity
175void main() {
176#pragma mapbox: initialize highp vec4 color
177#pragma mapbox: initialize mediump float radius
178#pragma mapbox: initialize lowp float blur
179#pragma mapbox: initialize lowp float opacity
180#pragma mapbox: initialize highp vec4 stroke_color
181#pragma mapbox: initialize mediump float stroke_width
182#pragma mapbox: initialize lowp float stroke_opacity
183vec2 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(
184antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)
185);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);
186#ifdef LIGHTING_3D_MODE
187out_color=apply_lighting(out_color);
188#endif
189#ifdef FOG
190out_color=fog_apply_premultiplied(out_color,v_fog_pos);
191#endif
192gl_FragColor=out_color*(v_visibility*opacity_t);
193#ifdef OVERDRAW_INSPECTOR
194gl_FragColor=vec4(1.0);
195#endif
196}`,`#define NUM_VISIBILITY_RINGS 2
197#define INV_SQRT2 0.70710678
198#define ELEVATION_BIAS 0.0001
199#define NUM_SAMPLES_PER_RING 16
200uniform 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;
201#ifdef PROJECTION_GLOBE_VIEW
202attribute 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;
203#endif
204varying vec3 v_data;varying float v_visibility;
205#pragma mapbox: define highp vec4 color
206#pragma mapbox: define mediump float radius
207#pragma mapbox: define lowp float blur
208#pragma mapbox: define lowp float opacity
209#pragma mapbox: define highp vec4 stroke_color
210#pragma mapbox: define mediump float stroke_width
211#pragma mapbox: define lowp float stroke_opacity
212vec2 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) {
213#if defined(TERRAIN)
214return elevation(pos)+ELEVATION_BIAS;
215#else
216return 0.0;
217#endif
218}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);
219#ifdef PITCH_WITH_MAP
220#ifdef PROJECTION_GLOBE_VIEW
221return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );
222#else
223return u_matrix*( world_center+vec4(sample_offset,0,0) );
224#endif
225#else
226return projected_center+vec4(sample_offset,0,0);
227#endif
228}float get_sample_step() {
229#ifdef PITCH_WITH_MAP
230return 2.0*PI/float(NUM_SAMPLES_PER_RING);
231#else
232return PI/float(NUM_SAMPLES_PER_RING);
233#endif
234}void main(void) {
235#pragma mapbox: initialize highp vec4 color
236#pragma mapbox: initialize mediump float radius
237#pragma mapbox: initialize lowp float blur
238#pragma mapbox: initialize lowp float opacity
239#pragma mapbox: initialize highp vec4 stroke_color
240#pragma mapbox: initialize mediump float stroke_width
241#pragma mapbox: initialize lowp float stroke_opacity
242vec2 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;
243#ifdef PROJECTION_GLOBE_VIEW
244vec3 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);
245#else 
246surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);
247#endif
248vec4 projected_center=u_matrix*world_center;float view_scale=0.0;
249#ifdef PITCH_WITH_MAP
250#ifdef SCALE_WITH_MAP
251view_scale=1.0;
252#else
253view_scale=projected_center.w/u_camera_to_center_distance;
254#endif
255#else
256#ifdef SCALE_WITH_MAP
257view_scale=u_camera_to_center_distance;
258#else
259view_scale=projected_center.w;
260#endif
261#endif
262gl_Position=project_vertex(extrude,world_center,projected_center,radiu
262s,stroke_width,view_scale,surface_vectors);float visibility=0.0;
263#ifdef TERRAIN
264float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;
265#ifdef PITCH_WITH_MAP
266float 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;
267#else
268occlusion_world_center=world_center;occlusion_projected_center=projected_center;
269#endif
270for(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);
271#else
272visibility=1.0;
273#endif
274#ifdef PROJECTION_GLOBE_VIEW
275visibility=1.0;
276#endif
277v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);
278#ifdef FOG
279v_fog_pos=fog_position(world_center.xyz);
280#endif
281}`),clippingMask:rn("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:rn(`uniform highp float u_intensity;varying vec2 v_extrude;
282#pragma mapbox: define highp float weight
283#define GAUSS_COEF 0.3989422804014327
284void main() {
285#pragma mapbox: initialize highp float weight
286float 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);
287#ifdef FOG
288if (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}
289#endif
290#ifdef OVERDRAW_INSPECTOR
291gl_FragColor=vec4(1.0);
292#endif
293}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;
294#ifdef PROJECTION_GLOBE_VIEW
295attribute 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;
296#endif
297varying vec2 v_extrude;
298#pragma mapbox: define highp float weight
299#pragma mapbox: define mediump float radius
300const highp float ZERO=1.0/255.0/16.0;
301#define GAUSS_COEF 0.3989422804014327
302void main(void) {
303#pragma mapbox: initialize highp float weight
304#pragma mapbox: initialize mediump float radius
305vec2 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;
306#ifdef PROJECTION_GLOBE_VIEW
307vec3 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);
308#else
309pos=vec3(tilePos+extrude,elevation(tilePos));
310#endif
311gl_Position=u_matrix*vec4(pos,1);
312#ifdef FOG
313v_fog_pos=fog_position(pos);
314#endif
315}`),heatmapTexture:rn(`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;
316#ifdef OVERDRAW_INSPECTOR
317gl_FragColor=vec4(0.0);
318#endif
319}`,"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:rn("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(
3200.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:rn("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(
321mix(-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(
3220.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:rn("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;
323#ifdef PROJECTION_GLOBE_VIEW
324attribute vec3 a_pos_3;
325#endif
326varying 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;
327#ifdef PROJECTION_GLOBE_VIEW
328gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);
329#else
330gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);
331#endif
332}`),fill:rn(`#pragma mapbox: define highp vec4 color
333#pragma mapbox: define lowp float opacity
334void main() {
335#pragma mapbox: initialize highp vec4 color
336#pragma mapbox: initialize lowp float opacity
337vec4 out_color=color;
338#ifdef LIGHTING_3D_MODE
339out_color=apply_lighting(out_color);
340#endif
341#ifdef FOG
342out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
343#endif
344gl_FragColor=out_color*opacity;
345#ifdef OVERDRAW_INSPECTOR
346gl_FragColor=vec4(1.0);
347#endif
348}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
349#pragma mapbox: define highp vec4 color
350#pragma mapbox: define lowp float opacity
351void main() {
352#pragma mapbox: initialize highp vec4 color
353#pragma mapbox: initialize lowp float opacity
354gl_Position=u_matrix*vec4(a_pos,0,1);
355#ifdef FOG
356v_fog_pos=fog_position(a_pos);
357#endif
358}`),fillOutline:rn(`varying vec2 v_pos;
359#pragma mapbox: define highp vec4 outline_color
360#pragma mapbox: define lowp float opacity
361void main() {
362#pragma mapbox: initialize highp vec4 outline_color
363#pragma mapbox: initialize lowp float opacity
364float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;
365#ifdef LIGHTING_3D_MODE
366out_color=apply_lighting(out_color);
367#endif
368#ifdef FOG
369out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
370#endif
371gl_FragColor=out_color*(alpha*opacity);
372#ifdef OVERDRAW_INSPECTOR
373gl_FragColor=vec4(1.0);
374#endif
375}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
376#pragma mapbox: define highp vec4 outline_color
377#pragma mapbox: define lowp float opacity
378void main() {
379#pragma mapbox: initialize highp vec4 outline_color
380#pragma mapbox: initialize lowp float opacity
381gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
382#ifdef FOG
383v_fog_pos=fog_position(a_pos);
384#endif
385}`),fillOutlinePattern:rn(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;
386#pragma mapbox: define lowp float opacity
387#pragma mapbox: define lowp vec4 pattern
388void main() {
389#pragma mapbox: initialize lowp float opacity
390#pragma mapbox: initialize mediump vec4 pattern
391vec2 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);
392#ifdef LIGHTING_3D_MODE
393out_color=apply_lighting(out_color);
394#endif
395#ifdef FOG
396out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
397#endif
398gl_FragColor=out_color*(alpha*opacity);
399#ifdef OVERDRAW_INSPECTOR
400gl_FragColor=vec4(1.0);
401#endif
402}`,`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;
403#pragma mapbox: define lowp float opacity
404#pragma mapbox: define lowp vec4 pattern
405#pragma mapbox: define lowp float pixel_ratio
406void main() {
407#pragma mapbox: initialize lowp float opacity
408#pragma mapbox: initialize mediump vec4 pattern
409#pragma mapbox: initialize lowp float pixel_ratio
410vec2 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;
411#ifdef FOG
412v_fog_pos=fog_position(a_pos);
413#endif
414}`),fillPattern:rn(`uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;
415#pragma mapbox: define lowp float opacity
416#pragma mapbox: define lowp vec4 pattern
417void main() {
418#pragma mapbox: initialize lowp float opacity
419#pragma mapbox: initialize mediump vec4 pattern
420vec2 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);
421#ifdef LIGHTING_3D_MODE
422out_color=apply_lighting(out_color);
423#endif
424#ifdef FOG
425out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
426#endif
427gl_FragColor=out_color*opacity;
428#ifdef OVERDRAW_INSPECTOR
429gl_FragColor=vec4(1.0);
430#endif
431}`,`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;
432#pragma mapbox: define lowp float opacity
433#pragma mapbox: define lowp vec4 pattern
434#pragma mapbox: define lowp float pixel_ratio
435void main() {
436#pragma mapbox: initialize lowp float opacity
437#pragma mapbox: initialize mediump vec4 pattern
438#pragma mapbox: initialize lowp float pixel_ratio
439vec2 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);
440#ifdef FOG
441v_fog_pos=fog_position(a_pos);
442#endif
443}`),fillExtrusion:rn(`varying vec4 v_color;
444#ifdef RENDER_SHADOWS
445varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;
446#endif
447#ifdef FAUX_AO
448uniform lowp vec2 u_ao;varying vec3 v_ao;
449#endif
450#ifdef ZERO_ROOF_RADIUS
451varying vec4 v_roof_color;
452#endif
453#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
454varying highp vec3 v_normal;
455#endif
456void main() {
457#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
458vec3 normal=v_normal;
459#endif
460float z;vec4 color;
461#ifdef ZERO_ROOF_RADIUS
462z=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);
463#else
464color=v_color;
465#endif
466#ifdef FAUX_AO
467float 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
467),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;
468#ifdef ZERO_ROOF_RADIUS
469concave*=(1.0-z);
470#endif
471float 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;
472#endif
473#ifdef RENDER_SHADOWS
474#ifdef ZERO_ROOF_RADIUS
475normal=mix(normal,vec3(0.0,0.0,1.0),z);
476#endif
477color.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);
478#endif
479#ifdef FOG
480color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
481#endif
482gl_FragColor=color;
483#ifdef OVERDRAW_INSPECTOR
484gl_FragColor=vec4(1.0);
485#endif
486}`,`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;
487#ifdef PROJECTION_GLOBE_VIEW
488attribute 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;
489#endif
490varying vec4 v_color;
491#ifdef RENDER_SHADOWS
492uniform 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;
493#endif
494#ifdef ZERO_ROOF_RADIUS
495varying vec4 v_roof_color;
496#endif
497#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
498varying highp vec3 v_normal;
499#endif
500#ifdef FAUX_AO
501uniform lowp vec2 u_ao;varying vec3 v_ao;
502#endif
503#pragma mapbox: define highp float base
504#pragma mapbox: define highp float height
505#pragma mapbox: define highp vec4 color
506void main() {
507#pragma mapbox: initialize highp float base
508#pragma mapbox: initialize highp float height
509#pragma mapbox: initialize highp vec4 color
510vec4 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));
511#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)
512v_normal=normal;
513#endif
514base=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);
515#if defined(HAS_CENTROID) || defined(TERRAIN)
516centroid_pos=a_centroid_pos;
517#endif
518float ele=0.0;float h=0.0;float c_ele;vec3 pos;
519#ifdef TERRAIN
520bool 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);
521#else
522h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);
523#endif
524#ifdef PROJECTION_GLOBE_VIEW
525float 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);
526#endif
527float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);
528#ifdef RENDER_SHADOWS
529v_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;
530#endif
531float NdotL=0.0;float colorvalue=0.0;
532#ifdef LIGHTING_3D_MODE
533NdotL=calculate_NdotL(normal);
534#else
535colorvalue=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);
536#endif
537if (normal.y !=0.0) {float r=0.84;
538#ifndef LIGHTING_3D_MODE
539r=mix(0.7,0.98,1.0-u_lightintensity);
540#endif
541NdotL*=(
542(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);
543#ifdef FAUX_AO
544float 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;
545#ifdef TERRAIN
546top_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);
547#endif
548v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);
549#ifdef PROJECTION_GLOBE_VIEW
550top_height+=u_height_lift;
551#endif
552gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;
553#endif
554#ifdef LIGHTING_3D_MODE
555v_color=apply_lighting(color,NdotL);
556#else
557v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));
558#endif
559v_color*=u_opacity;
560#ifdef ZERO_ROOF_RADIUS
561v_roof_color=vec4(0.0,0.0,0.0,1.0);
562#ifdef LIGHTING_3D_MODE
563v_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));
564#else
565float 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));
566#endif
567v_roof_color*=u_opacity;
568#endif
569#ifdef FOG
570v_fog_pos=fog_position(pos);
571#endif
572}`),fillExtrusionPattern:rn(`uniform vec2 u_texsize;uniform sampler2D u_image;
573#ifdef FAUX_AO
574uniform lowp vec2 u_ao;varying vec3 v_ao;
575#endif
576#ifdef LIGHTING_3D_MODE
577varying float v_NdotL;
578#endif
579varying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;
580#pragma mapbox: define lowp float base
581#pragma mapbox: define lowp float height
582#pragma mapbox: define lowp vec4 pattern
583#pragma mapbox: define lowp float pixel_ratio
584void main() {
585#pragma mapbox: initialize lowp float base
586#pragma mapbox: initialize lowp float height
587#pragma mapbox: initialize mediump vec4 pattern
588#pragma mapbox: initialize lowp float pixel_ratio
589vec2 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);
590#ifdef LIGHTING_3D_MODE
591out_color=apply_lighting(out_color,v_NdotL)*u_opacity;
592#else
593out_color=out_color*v_lighting;
594#endif
595#ifdef FAUX_AO
596float 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;
597#endif
598#ifdef FOG
599out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
600#endif
601gl_FragColor=out_color;
602#ifdef OVERDRAW_INSPECTOR
603gl_FragColor=vec4(1.0);
604#endif
605}`,`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;
606#ifdef PROJECTION_GLOBE_VIEW
607attribute 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;
608#endif
609varying vec2 v_pos;varying vec4 v_lighting;
610#ifdef FAUX_AO
611uniform lowp vec2 u_ao;varying vec3 v_ao;
612#endif
613#ifdef LIGHTING_3D_MODE
614varying float v_NdotL;
615#endif
616#pragma mapbox: define lowp float base
617#pragma mapbox: define lowp float height
618#pragma mapbox: define lowp vec4 pattern
619#pragma mapbox: define lowp float pixel_ratio
620void main() {
621#pragma mapbox: initialize lowp float base
622#pragma mapbox: initialize lowp float height
623#pragma mapbox: initialize mediump vec4 pattern
624#pragma mapbox: initialize lowp float pixel_ratio
625vec2 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;
625base=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);
626#if defined(HAS_CENTROID) || defined(TERRAIN)
627centroid_pos=a_centroid_pos;
628#endif
629float ele=0.0;float h=z;vec3 p;float c_ele;
630#ifdef TERRAIN
631bool 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);
632#else
633p=vec3(pos_nx.xy,z);
634#endif
635#ifdef PROJECTION_GLOBE_VIEW
636float 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);
637#endif
638float 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
639? pos_nx.xy
640: 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;
641#ifdef LIGHTING_3D_MODE
642NdotL=calculate_NdotL(normal);
643#else
644NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);
645#endif
646if (normal.y !=0.0) {float r=0.84;
647#ifndef LIGHTING_3D_MODE
648r=mix(0.7,0.98,1.0-u_lightintensity);
649#endif
650NdotL*=(
651(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}
652#ifdef FAUX_AO
653float 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;
654#ifdef TERRAIN
655top_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(ce
655ntroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);
656#endif
657v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);
658#ifdef PROJECTION_GLOBE_VIEW
659top_height+=u_height_lift;
660#endif
661gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;
662#endif
663#ifdef LIGHTING_3D_MODE
664v_NdotL=NdotL;
665#else
666v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;
667#endif 
668#ifdef FOG
669v_fog_pos=fog_position(p);
670#endif
671}`),hillshadePrepare:rn(`#ifdef GL_ES
672precision highp float;
673#endif
674uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {
675#ifdef TERRAIN_DEM_FLOAT_FORMAT
676return texture2D(u_image,coord).a/4.0;
677#else
678vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;
679#endif
680}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(
681(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)
682)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(
683deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
684#ifdef OVERDRAW_INSPECTOR
685gl_FragColor=vec4(1.0);
686#endif
687}`,"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:rn(`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;
688#ifdef LIGHTING_3D_MODE
689gl_FragColor=apply_lighting(gl_FragColor);
690#endif
691#ifdef FOG
692gl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));
693#endif
694#ifdef OVERDRAW_INSPECTOR
695gl_FragColor=vec4(1.0);
696#endif
697}`,`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;
698#ifdef FOG
699v_fog_pos=fog_position(a_pos);
700#endif
701}`),line:rn(`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;
702#ifdef RENDER_LINE_DASH
703uniform sampler2D u_dash_image;varying vec2 v_tex;
704#endif
705#ifdef RENDER_LINE_GRADIENT
706uniform sampler2D u_gradient_image;
707#endif
708uniform 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;}
709#pragma mapbox: define highp vec4 color
710#pragma mapbox: define lowp float floorwidth
711#pragma mapbox: define lowp vec4 dash
712#pragma mapbox: define lowp float blur
713#pragma mapbox: define lowp float opacity
714float linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {
715#pragma mapbox: initialize highp vec4 color
716#pragma mapbox: initialize lowp float floorwidth
717#pragma mapbox: initialize lowp vec4 dash
718#pragma mapbox: initialize lowp float blur
719#pragma mapbox: initialize lowp float opacity
720float 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);
721#ifdef RENDER_LINE_DASH
722float 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);
723#endif
724highp vec4 out_color;
725#ifdef RENDER_LINE_GRADIENT
726out_color=texture2D(u_gradient_image,v_uv.xy);
727#else
728out_color=color;
729#endif
730float trimmed=1.0;
731#ifdef RENDER_LINE_TRIM_OFFSET
732highp 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;}}
733#endif
734#ifdef LIGHTING_3D_MODE
735out_color=apply_lighting(out_color);
736#endif
737#ifdef FOG
738out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
739#endif
740#ifdef RENDER_LINE_ALPHA_DISCARD
741if (alpha < u_alpha_discard_threshold) {discard;}
742#endif
743#ifdef RENDER_LINE_BORDER
744float 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);
745#ifdef RENDER_LINE_BORDER_AUTO
746float 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);}
747#else
748out_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha);
749#endif
750}
751#endif
752gl_FragColor=out_color*(alpha*opacity);
753#ifdef OVERDRAW_INSPECTOR
754gl_FragColor=vec4(1.0);
755#endif
756}`,`
757#define EXTRUDE_SCALE 0.015873016
758attribute vec2 a_pos_normal;attribute vec4 a_data;
759#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)
760attribute highp vec4 a_packed;
761#endif
762#ifdef RENDER_LINE_DASH
763attribute float a_linesofar;
764#endif
765uniform 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;
766#ifdef RENDER_LINE_DASH
767uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;
768#endif
769#ifdef RENDER_LINE_GRADIENT
770uniform float u_image_height;
771#endif
772#pragma mapbox: define highp vec4 color
773#pragma mapbox: define lowp float floorwidth
774#pragma mapbox: define lowp vec4 dash
775#pragma mapbox: define lowp float blur
776#pragma mapbox: define lowp float opacity
777#pragma mapbox: define mediump float gapwidth
778#pragma mapbox: define lowp float offset
779#pragma mapbox: define mediump float width
780void main() {
781#pragma mapbox: initialize highp vec4 color
782#pragma mapbox: initialize lowp float floorwidth
783#pragma mapbox: initialize lowp vec4 dash
784#pragma mapbox: initialize lowp float blur
785#pragma mapbox: initialize lowp float opacity
786#pragma mapbox: initialize mediump float gapwidth
787#pragma mapbox: initialize lowp float offset
788#pragma mapbox: initialize mediump float width
789float 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;
790#ifndef RENDER_TO_TEXTURE
791float 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;
792#else
793v_gamma_scale=1.0;
794#endif
795#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)
796float 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];
797#ifdef RENDER_LINE_GRADIENT
798highp 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);
799#else
800v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);
801#endif
802#endif
803#ifdef RENDER_LINE_DASH
804float 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);
805#endif
806v_width2=vec2(outset,inset);
807#ifdef FOG
808v_fog_pos=fog_position(pos);
809#endif
810}`),linePattern:rn(`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;
811#pragma mapbox: define lowp vec4 pattern
812#pragma mapbox: define lowp float pixel_ratio
813#pragma mapbox: define lowp float blur
814#pragma mapbox: define lowp float opacity
815void main() {
816#pragma mapbox: initialize mediump vec4 pattern
817#pragma mapbox: initialize lowp float pixel_ratio
818#pragma mapbox: initialize lowp float blur
819#pragma mapbox: initialize lowp float opacity
820vec2 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);
821#ifdef LIGHTING_3D_MODE
822color=apply_lighting(color);
823#endif
824#ifdef FOG
825color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
826#endif
827gl_FragColor=color*(alpha*opacity);
828#ifdef OVERDRAW_INSPECTOR
829gl_FragColor=vec4(1.0);
830#endif
831}`,`
832#define scale 0.015873016
833attribute 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;
834#pragma mapbox: define lowp float blur
835#pragma mapbox: define lowp float opacity
836#pragma mapbox: define lowp float offset
837#pragma mapbox: define mediump float gapwidth
838#pragma mapbox: define mediump float width
839#pragma mapbox: define lowp float floorwidth
840#pragma mapbox: define lowp vec4 pattern
841#pragma mapbox: define lowp float pixel_ratio
842void main() {
843#pragma mapbox: initialize lowp float blur
844#pragma mapbox: initialize lowp float opacity
845#pragma mapbox: initialize lowp float offset
846#pragma mapbox: initialize mediump float gapwidth
847#pragma mapbox: initialize mediump float width
848#pragma mapbox: initialize lowp float floorwidth
849#pragma mapbox: initialize mediump vec4 pattern
850#pragma mapbox: initialize lowp float pixel_ratio
851float 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;
852#ifndef RENDER_TO_TEXTURE
853float 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;
854#else
855v_gamma_scale=1.0;
856#endif
857v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;
858#ifdef FOG
859v_fog_pos=fog_position(pos);
860#endif
861}`),raster:rn(`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(
862dot(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);
863#ifdef LIGHTING_3D_MODE
864out_color=apply_lighting(out_color);
865#endif
866#ifdef FOG
867out_color=fog_dither(fog_apply(out_color,v_fog_pos));
868#endif
869gl_FragColor=vec4(out_color*color.a,color.a);
870#ifdef OVERDRAW_INSPECTOR
871gl_FragColor=vec4(1.0);
872#endif
873}`,`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;
874#ifdef FOG
875v_fog_pos=fog_position(a_pos);
876#endif
877}`),symbolIcon:rn(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
878#pragma mapbox: define lowp float opacity
879void main() {
880#pragma mapbox: initialize lowp float opacity
881lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
882#ifdef OVERDRAW_INSPECTOR
883gl_FragColor=vec4(1.0);
884#endif
885}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
886#ifdef PROJECTION_GLOBE_VIEW
887attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
888#endif
889uniform 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;
890#ifdef PROJECTION_GLOBE_VIEW
891uniform 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;
892#endif
893varying vec2 v_tex;varying float v_fade_opacity;
894#pragma mapbox: define lowp float opacity
895void main() {
896#pragma mapbox: initialize lowp float opacity
897vec2 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;
898#ifdef PROJECTION_GLOBE_VIEW
899mercator_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;
900#else
901world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
902#endif
903vec4 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 ?
904camera_to_anchor_distance/u_camera_to_center_distance :
905u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
9060.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;
907#ifdef PROJECTION_GLOBE_VIEW
908vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);
909#else
910offsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);
911#endif
912vec2 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;
913#ifdef PROJECTION_GLOBE_VIEW
914vec3 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);
915#else
916projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
917#endif
918highp 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);
919#ifdef TERRAIN
920#ifdef PITCH_WITH_MAP_TERRAIN
921vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
922#endif
923#endif
924float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
925#ifdef PROJECTION_GLOBE_VIEW
926vec3 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));
927#else
928gl_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));
929#endif
930float projection_transition_fade=1.0;
931#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
932projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
933#endif
934v_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:rn(`#define SDF_PX 8.0
935uniform 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;
936#pragma mapbox: define highp vec4 fill_color
937#pragma mapb
937ox: define highp vec4 halo_color
938#pragma mapbox: define lowp float opacity
939#pragma mapbox: define lowp float halo_width
940#pragma mapbox: define lowp float halo_blur
941void main() {
942#pragma mapbox: initialize highp vec4 fill_color
943#pragma mapbox: initialize highp vec4 halo_color
944#pragma mapbox: initialize lowp float opacity
945#pragma mapbox: initialize lowp float halo_width
946#pragma mapbox: initialize lowp float halo_blur
947float 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);
948#ifdef OVERDRAW_INSPECTOR
949gl_FragColor=vec4(1.0);
950#endif
951}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
952#ifdef PROJECTION_GLOBE_VIEW
953attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
954#endif
955uniform 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;
956#ifdef PROJECTION_GLOBE_VIEW
957uniform 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;
958#endif
959varying vec2 v_data0;varying vec3 v_data1;
960#pragma mapbox: define highp vec4 fill_color
961#pragma mapbox: define highp vec4 halo_color
962#pragma mapbox: define lowp float opacity
963#pragma mapbox: define lowp float halo_width
964#pragma mapbox: define lowp float halo_blur
965void main() {
966#pragma mapbox: initialize highp vec4 fill_color
967#pragma mapbox: initialize highp vec4 halo_color
968#pragma mapbox: initialize lowp float opacity
969#pragma mapbox: initialize lowp float halo_width
970#pragma mapbox: initialize lowp float halo_blur
971vec2 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;
972#ifdef PROJECTION_GLOBE_VIEW
973mercator_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;
974#else
975world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
976#endif
977vec4 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 ?
978camera_to_anchor_distance/u_camera_to_center_distance :
979u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
9800.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;
981#ifdef PROJECTION_GLOBE_VIEW
982vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);
983#else
984offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);
985#endif
986vec2 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;
987#ifdef PROJECTION_GLOBE_VIEW
988vec3 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);
989#else
990projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
991#endif
992highp 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);
993#ifdef TERRAIN
994#ifdef PITCH_WITH_MAP_TERRAIN
995vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
996#endif
997#endif
998float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
999#ifdef PROJECTION_GLOBE_VIEW
1000vec3 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));
1001#else
1002gl_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));
1003#endif
1004float gamma_scale=gl_Position.w;float projection_transition_fade=1.0;
1005#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
1006projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
1007#endif
1008vec2 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:rn(`#define SDF_PX 8.0
1009#define SDF 1.0
1010#define ICON 0.0
1011uniform 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;
1012#pragma mapbox: define highp vec4 fill_color
1013#pragma mapbox: define highp vec4 halo_color
1014#pragma mapbox: define lowp float opacity
1015#pragma mapbox: define lowp float halo_width
1016#pragma mapbox: define lowp float halo_blur
1017void main() {
1018#pragma mapbox: initialize highp vec4 fill_color
1019#pragma mapbox: initialize highp vec4 halo_color
1020#pragma mapbox: initialize lowp float opacity
1021#pragma mapbox: initialize lowp float halo_width
1022#pragma mapbox: initialize lowp float halo_blur
1023float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
1023gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
1024#ifdef OVERDRAW_INSPECTOR
1025gl_FragColor=vec4(1.0);
1026#endif
1027return;}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);
1028#ifdef OVERDRAW_INSPECTOR
1029gl_FragColor=vec4(1.0);
1030#endif
1031}`,`attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;
1032#ifdef PROJECTION_GLOBE_VIEW
1033attribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;
1034#endif
1035uniform 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;
1036#ifdef PROJECTION_GLOBE_VIEW
1037uniform 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;
1038#endif
1039varying vec4 v_data0;varying vec4 v_data1;
1040#pragma mapbox: define highp vec4 fill_color
1041#pragma mapbox: define highp vec4 halo_color
1042#pragma mapbox: define lowp float opacity
1043#pragma mapbox: define lowp float halo_width
1044#pragma mapbox: define lowp float halo_blur
1045void main() {
1046#pragma mapbox: initialize highp vec4 fill_color
1047#pragma mapbox: initialize highp vec4 halo_color
1048#pragma mapbox: initialize lowp float opacity
1049#pragma mapbox: initialize lowp float halo_width
1050#pragma mapbox: initialize lowp float halo_blur
1051vec2 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;
1052#ifdef PROJECTION_GLOBE_VIEW
1053mercator_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;
1054#else
1055world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
1056#endif
1057vec4 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 ?
1058camera_to_anchor_distance/u_camera_to_center_distance :
1059u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
10600.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;
1061#ifdef PROJECTION_GLOBE_VIEW
1062vec3 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);
1063#else
1064projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
1065#endif
1066highp 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);
1067#ifdef TERRAIN
1068#ifdef PITCH_WITH_MAP_TERRAIN
1069vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
1070#endif
1071#endif
1072float occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;
1073#ifdef PROJECTION_GLOBE_VIEW
1074vec3 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));
1075#else
1076gl_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));
1077#endif
1078float 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;
1079#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)
1080projection_transition_fade=1.0-step(EPSILON,u_zoom_transition);
1081#endif
1082v_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_s
1082df);}`),terrainRaster:rn(`uniform sampler2D u_image0;varying vec2 v_pos0;
1083#ifdef FOG
1084varying float v_fog_opacity;
1085#endif
1086#ifdef RENDER_SHADOWS
1087varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;
1088#endif
1089void main() {vec4 color=texture2D(u_image0,v_pos0);
1090#ifdef RENDER_SHADOWS
1091color.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);
1092#endif
1093#ifdef FOG
1094#ifdef ZERO_EXAGGERATION
1095color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
1096#else
1097color=fog_dither(fog_apply_from_vert(color,v_fog_opacity));
1098#endif
1099#endif
1100gl_FragColor=color;
1101#ifdef TERRAIN_WIREFRAME
1102gl_FragColor=vec4(1.0,0.0,0.0,0.8);
1103#endif
1104#ifdef OVERDRAW_INSPECTOR
1105gl_FragColor=vec4(1.0);
1106#endif
1107}`,`uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0;
1108#ifdef FOG
1109varying float v_fog_opacity;
1110#endif
1111#ifdef RENDER_SHADOWS
1112uniform 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;
1113#endif
1114const 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;
1115#ifdef TERRAIN_WIREFRAME
1116elevation+=wireframeOffset;
1117#endif
1118v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);
1119#ifdef FOG
1120#ifdef ZERO_EXAGGERATION
1121v_fog_pos=fog_position(decodedPos);
1122#else
1123v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));
1124#endif
1125#endif
1126#ifdef RENDER_SHADOWS
1127vec3 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;
1128#endif
1129}`),terrainDepth:rn(`#ifdef GL_ES
1130precision highp float;
1131#endif
1132varying 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:rn(`
1133varying 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(
1134cos_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))/(e
1134nd-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;
1135#ifdef FOG
1136sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);
1137#endif
1138sky_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);
1139#ifdef OVERDRAW_INSPECTOR
1140gl_FragColor=vec4(1.0);
1141#endif
1142}`,Rl),skyboxGradient:rn(`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));
1143#ifdef FOG
1144color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;
1145#endif
1146color*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;
1147#ifdef OVERDRAW_INSPECTOR
1148gl_FragColor=vec4(1.0);
1149#endif
1150}`,Rl),skyboxCapture:rn(`
1151varying 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;
1152#ifdef GL_ES
1153precision highp float;
1154#endif
1155#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)
1156#define BETA_M                  vec3(21e-6,21e-6,21e-6)
1157#define MIE_G                   0.76
1158#define DENSITY_HEIGHT_SCALE_R  8000.0
1159#define DENSITY_HEIGHT_SCALE_M  1200.0
1160#define PLANET_RADIUS           6360e3
1161#define ATMOSPHERE_RADIUS       6420e3
1162#define SAMPLE_STEPS            10
1163#define DENSITY_STEPS           4
1164float 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);}
1164float 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))/(e
1164nd-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:rn(`uniform sampler2D u_image0;varying vec2 v_pos0;
1165#ifndef FOG
1166uniform 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;
1167#endif
1168void main() {vec4 color;
1169#ifdef CUSTOM_ANTIALIASING
1170vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(
1171mix(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);
1172#else
1173color=texture2D(u_image0,v_pos0);
1174#endif
1175#ifdef FOG
1176color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
1177#endif
1178gl_FragColor=color;
1179#ifdef TERRAIN_WIREFRAME
1180gl_FragColor=vec4(1.0,0.0,0.0,0.8);
1181#endif
1182#ifdef OVERDRAW_INSPECTOR
1183gl_FragColor=vec4(1.0);
1184#endif
1185}`,`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;
1186#ifdef GLOBE_POLES
1187attribute vec3 a_globe_pos;attribute vec2 a_uv;
1188#else
1189attribute vec2 a_pos;
1190#endif
1191varying 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() {
1192#ifdef GLOBE_POLES
1193vec3 globe_pos=a_globe_pos;vec2 uv=a_uv;
1194#else
1195float 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);
1196#endif
1197v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;
1198#ifdef GLOBE_POLES
1199vec3 up_vector=globe_derived_up_vector;
1200#else
1201vec3 up_vector=elevationVector(tile_pos);
1202#endif
1203float height=elevation(tile_pos);
1204#ifdef TERRAIN_WIREFRAME
1205height+=wireframeOffset;
1206#endif
1207globe_pos+=up_vector*height;
1208#ifndef GLOBE_POLES
1209globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;
1210#endif
1211#ifdef GLOBE_POLES
1212vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);
1213#else
1214vec4 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);
1215#endif
1216gl_Position=u_proj_matrix*interpolated_pos;
1217#ifdef FOG
1218v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);
1219#endif
1220}`),globeAtmosphere:rn(`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;
1220highp 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;
1221#ifdef PROJECTION_GLOBE_VIEW
1222globe_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;}
1223#endif
1224highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?
12250.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;
1226#ifdef PROJECTION_GLOBE_VIEW
1227highp 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 ?
1228PI-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);
1229#else
1230horizon_angle=horizon_angle_mercator;
1231#endif
1232horizon_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:
1233(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:
1234uv_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(
1235mix(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(
1236mix(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 Ec(f,c){let h=f.replace(/\s*\/\/[^\n]*\n/g,`
1237`).split(`
1238`);for(let g of h)if(g=g.trim(),g[0]==="#"&&g.includes("if")&&!g.includes("endif")){g=g.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();let y=g.split(" ");for(let x of y)c.includes(x)||c.push(x)}}function rn(f,c){let h=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,g=c.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),y={},x=[...Wu];return Ec(f,x),Ec(c,x),{fragmentSource:f=f.replace(h,(I,D,O,z,F)=>(y[F]=!0,D==="define"?`
1239#ifndef HAS_UNIFORM_u_${F}
1240varying ${O} ${z} ${F};
1241#else
1242uniform ${O} ${z} u_${F};
1243#endif
1244`:`
1245#ifdef HAS_UNIFORM_u_${F}
1246    ${O} ${z} ${F} = u_${F};
1247#endif
1248`)),vertexSource:c=c.replace(h,(I,D,O,z,F)=>{let U=z==="float"?"vec2":"vec4",X=F.match(/color/)?"color":U;return y[F]?D==="define"?`
1249#ifndef HAS_UNIFORM_u_${F}
1250uniform lowp float u_${F}_t;
1251attribute ${O} ${U} a_${F};
1252varying ${O} ${z} ${F};
1253#else
1254uniform ${O} ${z} u_${F};
1255#endif
1256`:X==="vec4"?`
1257#ifndef HAS_UNIFORM_u_${F}
1258    ${F} = a_${F};
1259#else
1260    ${O} ${z} ${F} = u_${F};
1261#endif
1262`:`
1263#ifndef HAS_UNIFORM_u_${F}
1264    ${F} = unpack_mix_${X}(a_${F}, u_${F}_t);
1265#else
1266    ${O} ${z} ${F} = u_${F};
1267#endif
1268`:D==="define"?`
1269#ifndef HAS_UNIFORM_u_${F}
1270uniform lowp float u_${F}_t;
1271attribute ${O} ${U} a_${F};
1272#else
1273uniform ${O} ${z} u_${F};
1274#endif
1275`:X==="vec4"?`
1276#ifndef HAS_UNIFORM_u_${F}
1277    ${O} ${z} ${F} = a_${F};
1278#else
1279    ${O} ${z} ${F} = u_${F};
1280#endif
1281`:`
1282#ifndef HAS_UNIFORM_u_${F}
1283    ${O} ${z} ${F} = unpack_mix_${X}(a_${F}, u_${F}_t);
1284#else
1285    ${O} ${z} ${F} = u_${F};
1286#endif
1287`}),staticAttributes:g,usedDefines:x}}class F1{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(c,h,g,y,x,I,D){this.context=c;let O=this.boundPaintVertexBuffers.length!==y.length;for(let F=0;!O&&F<y.length;F++)this.boundPaintVertexBuffers[F]!==y[F]&&(O=!0);let z=this.boundDynamicVertexBuffers.length!==D.length;for(let F=0;!z&&F<D.length;F++)this.boundDynamicVertexBuffers[F]!==D[F]&&(z=!0);if(!c.extVertexArrayObject||!this.vao||this.boundProgram!==h||this.boundLayoutVertexBuffer!==g||O||z||this.boundIndexBuffer!==x||this.boundVertexOffset!==I)this.freshBind(h,g,y,x,I,D);else{c.bindVertexArrayOES.set(this.vao);for(let F of D)F&&F.bind();x&&x.dynamicDraw&&x.bind()}}freshBind(c,h,g,y,x,I){let D,O=c.numAttributes,z=this.context,F=z.gl;if(z.extVertexArrayObject)this.vao&&this.destroy(),this.vao=z.extVertexArrayObject.createVertexArrayOES(),z.bindVertexArrayOES.set(this.vao),D=0,this.boundProgram=c,this.boundLayoutVertexBuffer=h,this.boundPaintVertexBuffers=g,this.boundIndexBuffer=y,this.boundVertexOffset=x,this.boundDynamicVertexBuffers=I;else{D=z.currentNumAttributes||0;for(let U=O;U<D;U++)F.disableVertexAttribArray(U)}h.enableAttributes(F,c),h.bind(),h.setVertexAttribPointers(F,c,x);for(let U of g)U.enableAttributes(F,c),U.bind(),U.setVertexAttribPointers(F,c,x);for(let U of I)U&&(U.enableAttributes(F,c),U.bind(),U.setVertexAttribPointers(F,c,x));y&&y.bind(),z.currentNumAttributes=O}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function cm(f,c){let h=Math.pow(2,c.canonical.z),g=c.canonical.y;return[new n.MercatorCoordinate(0,g/h).toLngLat().lat,new n.MercatorCoordinate(0,(g+1)/h).toLngLat().lat]}function I0(f,c,h,g,y,x,I){let D=f.context,O=D.gl,z=h.fbo;if(!z)return;f.prepareDrawTile();let F=f.useProgram("hillshade");D.activeTexture.set(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,z.colorAttachment.get());let U=((ee,ne,H,Q)=>{let le=H.paint.get("hillshade-shadow-color"),ue=H.paint.get("hillshade-highlight-color"),ye=H.paint.get("hillshade-accent-color"),xe=H.paint.get("hillshade-illumination-direction")*(Math.PI/180);H.paint.get("hillshade-illumination-anchor")==="viewport"&&(xe-=ee.transform.angle);let be=!ee.options.moving;
1287return{u_matrix:Q||ee.transform.calculateProjMatrix(ne.tileID.toUnwrapped(),be),u_image:0,u_latrange:cm(0,ne.tileID),u_light:[H.paint.get("hillshade-exaggeration"),xe],u_shadow:le,u_highlight:ue,u_accent:ye}})(f,h,g,f.terrain?c.projMatrix:null);f.prepareDrawProgram(D,F,c.toUnwrapped());let{tileBoundsBuffer:X,tileBoundsIndexBuffer:J,tileBoundsSegments:te}=f.getTileBoundsBuffers(h);F.draw(D,O.TRIANGLES,y,x,I,n.CullFaceMode.disabled,U,g.id,X,J,te)}function um(f,c,h){if(!c.needsDEMTextureUpload)return;let g=f.context,y=g.gl;g.pixelStoreUnpackPremultiplyAlpha.set(!1),c.demTexture=c.demTexture||f.getTileTexture(h.stride);let x=h.getPixels();c.demTexture?c.demTexture.update(x,{premultiply:!1}):c.demTexture=new n.Texture(g,x,y.RGBA,{premultiply:!1}),c.needsDEMTextureUpload=!1}function D0(f,c,h,g,y,x){let I=f.context,D=I.gl;if(!c.dem)return;let O=c.dem;if(I.activeTexture.set(D.TEXTURE1),um(f,c,O),!c.demTexture)return;c.demTexture.bind(D.NEAREST,D.CLAMP_TO_EDGE);let z=O.dim;I.activeTexture.set(D.TEXTURE0);let F=c.fbo;if(!F){let te=new n.Texture(I,{width:z,height:z,data:null},D.RGBA);te.bind(D.LINEAR,D.CLAMP_TO_EDGE),F=c.fbo=I.createFramebuffer(z,z,!0),F.colorAttachment.set(te.texture)}I.bindFramebuffer.set(F.framebuffer),I.viewport.set([0,0,z,z]);let{tileBoundsBuffer:U,tileBoundsIndexBuffer:X,tileBoundsSegments:J}=f.getMercatorTileBoundsBuffers();f.useProgram("hillshadePrepare").draw(I,D.TRIANGLES,g,y,x,n.CullFaceMode.disabled,((te,ee)=>{let ne=ee.stride,H=n.create();return n.ortho(H,0,n.EXTENT,-n.EXTENT,0,0,1),n.translate(H,H,[0,-n.EXTENT,0]),{u_matrix:H,u_image:1,u_dimension:[ne,ne],u_zoom:te.overscaledZ,u_unpack:ee.unpackVector}})(c.tileID,O),h.id,U,X,J),c.needsHillshadePrepare=!1}let dm=f=>({u_matrix:new n.UniformMatrix4f(f),u_image0:new n.Uniform1i(f),u_skirt_height:new n.Uniform1f(f)}),Sc=(f,c)=>({u_matrix:f,u_image0:0,u_skirt_height:c}),yh=(f,c,h,g,y,x,I,D,O,z,F,U,X,J,te)=>({u_proj_matrix:Float32Array.from(f),u_globe_matrix:c,u_normalize_matrix:Float32Array.from(g),u_merc_matrix:h,u_zoom_transition:y,u_merc_center:x,u_image0:0,u_frustum_tl:I,u_frustum_tr:D,u_frustum_br:O,u_frustum_bl:z,u_globe_pos:F,u_globe_radius:U,u_viewport:X,u_grid_matrix:te?Float32Array.from(te):new Float32Array(9),u_skirt_height:J});function Tc(f,c){return f!=null&&c!=null&&!(!f.hasData()||!c.hasData())&&f.demTexture!=null&&c.demTexture!=null&&f.tileID.key!==c.tileID.key}let ha=new class{constructor(){this.operations={}}newMorphing(f,c,h,g,y){if(f in this.operations){let x=this.operations[f];x.to.tileID.key!==h.tileID.key&&(x.queued=h)}else this.operations[f]={startTime:g,phase:0,duration:y,from:c,to:h,queued:null}}getMorphValuesForProxy(f){if(!(f in this.operations))return null;let c=this.operations[f];return{from:c.from,to:c.to,phase:c.phase}}update(f){for(let c in this.operations){let h=this.operations[c];for(h.phase=(f-h.startTime)/h.duration;h.phase>=1||!this._validOp(h);)if(!this._nextOp(h,f)){delete this.operations[c];break}}}_nextOp(f,c){return!!f.queued&&(f.from=f.to,f.to=f.queued,f.queued=null,f.phase=0,f.startTime=c,!0)}_validOp(f){return f.from.hasData()&&f.to.hasData()}},Ll={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function bh(f){return 6*Math.pow(1.5,22-f)}function M0(f,c){let h=1<<f.z;return!c&&(f.x===0||f.x===h-1)||f.y===0||f.y===h-1}let Zu=f=>({u_matrix:f});function hm(f,c,h,g,y){if(y>0){let x=n.exported.now(),I=(x-f.timeAdded)/y,D=c?(x-c.timeAdded)/y:-1,O=h.getSource(),z=g.coveringZoomLevel({tileSize:O.tileSize,roundZoom:O.roundZoom}),F=!c||Math.abs(c.tileID.overscaledZ-z)>Math.abs(f.tileID.overscaledZ-z),U=F&&f.refreshedUponExpiration?1:n.clamp(F?I:1-D,0,1);return f.refreshedUponExpiration&&I>=1&&(f.refreshedUponExpiration=!1),c?{opacity:1,mix:1-U}:{opacity:U,mix:0}}return{opacity:1,mix:0}}class pm extends n.SourceCache{constructor(c){let h={type:"raster-dem",maxzoom:c.transform.maxZoom},g=new Ft(yc(),null),y=wi("mock-dem",h,g,c.style);super("mock-dem",y,!1),y.setEventedParent(this),this._sourceLoaded=!0}_loadTile(c,h){c.state="loaded",h(null)}}class xh extends n.SourceCache{constructor(c){let h=wi("proxy",{type:"geojson",maxzoom:c.transform.maxZoom},new Ft(yc(),null),c.style);super("proxy",h,!1),h.setEventedParent(this),this.map=this.getSource().map=c,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(c,h,g){if(c.freezeTileCoverage)return;this.transform=c;let y=c.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((x,I)=>
1287{if(x[I.key]="",!this._tiles[I.key]){let D=new n.Tile(I,this._source.tileSize*I.overscaleFactor(),c.tileZoom);D.state="loaded",this._tiles[I.key]=D}return x},{});for(let x in this._tiles)x in y||(this.freeFBO(x),this._tiles[x].unloadVectorData(),delete this._tiles[x])}freeFBO(c){let h=this.proxyCachedFBO[c];if(h!==void 0){let g=Object.values(h);this.renderCachePool.push(...g),delete this.proxyCachedFBO[c]}}deallocRenderCache(){this.renderCache.forEach(c=>c.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class wh extends n.OverscaledTileID{constructor(c,h,g){super(c.overscaledZ,c.wrap,c.canonical.z,c.canonical.x,c.canonical.y),this.proxyTileKey=h,this.projMatrix=g}}class fm extends n.Elevation{constructor(c,h){super(),this.painter=c,this.terrainTileForTile={},this.prevTerrainTileForTile={};let[g,y,x]=function(O){let z=new n.StructArrayLayout2i4,F=new n.StructArrayLayout3ui6,U=131;z.reserve(17161),F.reserve(33800);let X=n.EXTENT/128,J=n.EXTENT+X/2,te=J+X;for(let ne=-X;ne<te;ne+=X)for(let H=-X;H<te;H+=X){let Q=H<0||H>J||ne<0||ne>J?24575:0,le=n.clamp(Math.round(H),0,n.EXTENT),ue=n.clamp(Math.round(ne),0,n.EXTENT);z.emplaceBack(le+Q,ue)}let ee=(ne,H)=>{let Q=H*U+ne;F.emplaceBack(Q+1,Q,Q+U),F.emplaceBack(Q+U,Q+U+1,Q+1)};for(let ne=1;ne<129;ne++)for(let H=1;H<129;H++)ee(H,ne);return[0,129].forEach(ne=>{for(let H=0;H<130;H++)ee(H,ne),ee(ne,H)}),[z,F,32768]}(),I=c.context;this.gridBuffer=I.createVertexBuffer(g,n.posAttributes.members),this.gridIndexBuffer=I.createIndexBuffer(y),this.gridSegments=n.SegmentVector.simpleSegment(0,0,g.length,y.length),this.gridNoSkirtSegments=n.SegmentVector.simpleSegment(0,0,g.length,x),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new xh(h.map),this.orthoMatrix=n.create(),n.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,n.EXTENT,0,n.EXTENT,0,1);let D=I.gl;this._overlapStencilMode=new n.StencilMode({func:D.GEQUAL,mask:255},0,255,D.KEEP,D.KEEP,D.REPLACE),this._previousZoom=c.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=h,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new pm(h.map)}set style(c){c.on("data",this._onStyleDataEvent.bind(this)),c.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=c,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(c,h,g){if(c&&c.terrain){this._style!==c&&(this.style=c),this.enabled=!0;let y=c.terrain.properties;this.sourceCache=c.terrain.drapeRenderMode===0?this._mockSourceCache:c._getSourceCache(y.get("source")),this._exaggeration=y.get("exaggeration");let x=()=>{this.sourceCache.used&&n.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.
1288This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);let I=this.getScaledDemTileSize();this.sourceCache.update(h,I,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,x(),this._initializing=!0),x(),h.updateElevation(!0,g),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(h),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(c){this._findCoveringTileCache[c]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){let c=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||c.efficiency!==100&&n.warnOnce(`Terrain render cache efficiency is not optimal (${c.efficiency}%) and performance
1289                may be affected negatively, consider placing all background, fill and line layers before layer
1290                with id '${c.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}
1290_onStyleDataEvent(c){c.coord&&c.dataType==="source"?this._clearRenderCacheForTile(c.sourceCacheId,c.coord):c.dataType==="style"&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(let c in this._style._sourceCaches)this._style._sourceCaches[c].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach(c=>c.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(){let c=2*this.proxySourceCache.getSource().tileSize;return[c,c]}set useVertexMorphing(c){this._useVertexMorphing=c}updateTileBinding(c){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;let h=this.proxySourceCache,g=this.painter.transform;this._initializing&&(this._initializing=g._centerAltitude===0&&this.getAtPointOrZero(n.MercatorCoordinate.fromLngLat(g.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);let y=this.proxyCoords=h.getIds().map(O=>{let z=h.getTileByID(O).tileID;return z.projMatrix=g.calculateProjMatrix(z.toUnwrapped()),z});(function(O,z){let F=z.transform.pointCoordinate(z.transform.getCameraPoint()),U=new n.Point(F.x,F.y);O.sort((X,J)=>{if(J.overscaledZ-X.overscaledZ)return J.overscaledZ-X.overscaledZ;let te=new n.Point(X.canonical.x+(1<<X.canonical.z)*X.wrap,X.canonical.y),ee=new n.Point(J.canonical.x+(1<<J.canonical.z)*J.wrap,J.canonical.y),ne=U.mult(1<<X.canonical.z);return ne.x-=.5,ne.y-=.5,ne.distSqr(te)-ne.distSqr(ee)})})(y,this.painter),this._previousZoom=g.zoom;let x=this.proxyToSource||{};this.proxyToSource={}
1290,y.forEach(O=>{this.proxyToSource[O.key]={}}),this.terrainTileForTile={};let I=this._style._sourceCaches;for(let O in I){let z=I[O];if(!z.used||(z!==this.sourceCache&&this.resetTileLookupCache(z.id),this._setupProxiedCoordsForOrtho(z,c[O],x),z.usedForTerrain))continue;let F=c[O];z.getSource().reparseOverscaled&&this._assignTerrainTiles(F)}this.proxiedCoords[h.id]=y.map(O=>new wh(O,O.key,this.orthoMatrix)),this._assignTerrainTiles(y),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(x),this.renderingToTexture=!1,this._updateTimestamp=n.exported.now();let D={};this._visibleDemTiles=[];for(let O of this.proxyCoords){let z=this.terrainTileForTile[O.key];if(!z)continue;let F=z.tileID.key;F in D||(this._visibleDemTiles.push(z),D[F]=F)}}_assignTerrainTiles(c){this._initializing||c.forEach(h=>{if(this.terrainTileForTile[h.key])return;let g=this._findTileCoveringTileID(h,this.sourceCache);g&&(this.terrainTileForTile[h.key]=g)})}_prepareDEMTextures(){let c=this.painter.context,h=c.gl;for(let g in this.terrainTileForTile){let y=this.terrainTileForTile[g],x=y.dem;!x||y.demTexture&&!y.needsDEMTextureUpload||(c.activeTexture.set(h.TEXTURE1),um(this.painter,y,x))}}_prepareDemTileUniforms(c,h,g,y){if(!h||h.demTexture==null)return!1;let x=c.tileID.canonical,I=Math.pow(2,h.tileID.canonical.z-x.z),D=y||"";return g[`u_dem_tl${D}`]=[x.x*I%1,x.y*I%1],g[`u_dem_scale${D}`]=I,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){let c=this.painter.context,h=c.gl;if(!this._emptyDepthBufferTexture){let g=new n.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new n.Texture(c,g,h.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let c=0,h=this._visibleDemTiles.reduce((g,y)=>{if(!y.dem)return g;let x=y.dem.tree.minimums[0];return x>0&&c++,g+x},0);return c?h/c:0}_updateEmptyDEMTexture(){let c=this.painter.context,h=c.gl;c.activeTexture.set(h.TEXTURE2);let g=this._getLoadedAreaMinimum(),y=new n.RGBAImage({width:1,height:1},new Uint8Array(n.DEMData.pack(g,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let x=this._emptyDEMTexture;return x?x.update(y,{premultiply:!1}):x=this._emptyDEMTexture=new n.Texture(c,y,h.RGBA,{premultiply:!1}),x}setupElevationDraw(c,h,g){let y=this.painter.context,x=y.gl,I=(D=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:n.DEMData.getUnpackVector(D),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 D;I.u_dem_size=this.sourceCache.getSource().tileSize,I.u_exaggeration=this.exaggeration();let O=null,z=null,F=1;if(g&&g.morphing&&this._useVertexMorphing){let U=g.morphing.srcDemTile,X=g.morphing.dstDemTile;F=g.morphing.phase,U&&X&&(this._prepareDemTileUniforms(c,U,I,"_prev")&&(z=U),this._prepareDemTileUniforms(c,X,I)&&(O=X))}if(z&&O?(y.activeTexture.set(x.TEXTURE2),O.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),y.activeTexture.set(x.TEXTURE4),z.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE,x.NEAREST),I.u_dem_lerp=F):(O=this.terrainTileForTile[c.tileID.key],y.activeTexture.set(x.TEXTURE2),(this._prepareDemTileUniforms(c,O,I)?O.demTexture:this.emptyDEMTexture).bind(x.NEAREST,x.CLAMP_TO_EDGE)),y.activeTexture.set(x.TEXTURE3),g&&g.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),this._depthFBO&&(I.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE),I.u_depth_size_inv=[1,1]),g&&g.useMeterToDem&&O){let U=(1<<O.tileID.canonical.z)*n.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;I.u_meter_to_dem=U}if(g&&g.labelPlaneMatrixInv&&(I.u_label_plane_matrix_inv=g.labelPlaneMatrixInv),h.setTerrainUniformValues(y,I),this.painter.transform.projection.name==="globe"){let U=this.globeUniformValues(this.painter.transform,c.tileID.canonical,g&&g.useDenormalizedUpVectorScale);h.setGlobeUniformValues(y,U)}}globeUniformValues(c,h,g){let y=c.projection;return{u_tile_tl_up:y.upVector(h,0,0),u_tile_tr_up:y.upVector(h,n.EXTENT,0),u_tile_br_up:y.upVector(h,n.EXTENT,n.EXTENT),u_tile_bl_up:y.upVector(h,0,n.EXTENT),u_tile_up_scale:g?n.globeMetersToEcef(1):y.upVectorScale(h,c.center.lat,c.worldSize).metersToTile}}renderToBackBuffer(c){let h=this.painter,g=this.painter.context;c.length!==0&&(g.bindFramebuffer.set(null),g.viewport.set([0,0,h.width,h.height]),h.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(y,x,I,D,O){if(y.transform.projection.name==="globe")(function(z,F,U,X,J){let te=z.context,ee=te.gl,ne,H,Q=z.options.showTerrainWireframe?2:0,le=z.transform,ue=n.globeUseCustomAntiAliasing(z,te,le),ye=(it,Oe)=>{if(H===it)return;let qe=[Ll[it],"PROJECTION_GLOBE_VIEW"];ue&&qe.push("CUSTOM_ANTIALIASING"),Oe&&qe.push(Ll[Q]),ne=z.useProgram("globeRaster",null,qe),H=it},xe=z.colorModeForRenderPass(),be=new n.DepthMode(ee.LEQUAL,n.DepthMode.ReadWrite,z.depthRangeFor3D);ha.update(J);let De=n.calculateGlobeMercatorMatrix(le),Ie=[n.mercatorXfromLng(le.center.lng),n.mercatorYfromLat(le.center.lat)],Re=Q?[!1,!0]:[!1],nt=z.globeSharedBuffers,Ae=[le.width*n.exported.devicePixelRatio,le.height*n.exported.devicePixelRatio],Ze=Float32Array.from(le.globeMatrix),Ne={useDenormalizedUpVectorScale:!0};if(Re.forEach(it=>{let Oe=z.transform,qe=bh(Oe.zoom)*F.exaggeration();H=-1;let ot=it?ee.LINES:ee.TRIANGLES;for(let Je of X){let lt=U.getTile(Je),zt=n.StencilMode.disabled,oi=F.prevTerrainTileForTile[Je.key],Ot=F.terrainTileForTile[Je.key];Tc(oi,Ot)&&ha.newMorphing(Je.key,oi,Ot,J,250),te.activeTexture.set(ee.TEXTURE0),lt.texture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE);let Gt=ha.getMorphValuesForProxy(Je.key),Mi=Gt?1:0;Gt&&n.extend$1(Ne,{morphing:{srcDemTile:Gt.from,dstDemTile:Gt.to,phase:n.easeCubicInOut(Gt.phase)}});let Ci=n.tileCornersToBounds(Je.canonical),Nt=n.getLatitudinalLod(Ci.getCenter().lat),an=n.getGridMatrix(Je.canonical,Ci,Nt,Oe.worldSize/Oe._pixelsPerMercatorPixel),gn=n.globeNormalizeECEF(n.globeTileBounds(Je.canonical)),_n=yh(Oe.projMatrix,Ze,De,gn,n.globeToMercatorTransition(Oe.zoom),Ie,Oe.frustumCorners.TL,Oe.frustumCorners.TR,Oe.frustumCorners.BR,Oe.frustumCorners.BL,Oe.globeCenterInViewSpace,Oe.globeRadius,Ae,qe,an);if(ye(Mi,it),F.setupElevationDraw(lt,ne,Ne),z.prepareDrawProgram(te,ne,Je.toUnwrapped()),nt){let[vn,Xr,Mr]=it?nt.getWirefameBuffers(z.context,Nt):nt.getGridBuffers(Nt,qe!==0);ne.draw(te,ot,be,zt,xe,n.CullFaceMode.backCCW,_n,"globe_raster",vn,Xr,Mr)}}}),nt){let it=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];ue&&it.push("CUSTOM_ANTIALIASING"),ne=z.useProgram("globeRaster",null,it);for(let Oe of X){let{x:qe,y:ot,z:Je}=Oe.canonical,lt=ot===0,zt=ot===(1<<Je)-1,[oi,Ot,Gt,Mi]=nt.getPoleBuffers(Je);if(Mi&&(lt||zt)){let Ci=U.getTile(Oe);te.activeTexture.set(ee.TEXTURE0),Ci.texture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE);let Nt=n.globePoleMatrixForTile(Je,qe,le),an=n.globeNormalizeECEF(n.globeTileBounds(Oe.canonical)),gn=(_n,vn)=>_n.draw(te,ee.TRIANGLES,be,n.StencilMode.disabled,xe,n.CullFaceMode.disabled,yh(le.projMatrix,Nt,Nt,an,0,Ie,le.frustumCorners.TL,le.frustumCorners.TR,le.frustumCorners.BR,le.frustumCorners.BL,le.globeCenterInViewSpace,le.globeRadius,Ae,0),"globe_pole_raster",vn,Gt,Mi);F.setupElevationDraw(Ci,ne,Ne),z.prepareDrawProgram(te,ne,Oe.toUnwrapped()),lt&&gn(ne,oi),zt&&(Nt=n.scale(n.create(),Nt,[1,-1,1]),gn(ne,Ot))}}}})(y,x,I,D,O);else{let z=y.context,F=z.gl,U,X,J=y.options.showTerrainWireframe?2:0,te=(le,ue)=>{if(X===le)return;let ye=[Ll[le]];ue&&ye.push(Ll[J]),U=y.useProgram("terrainRaster",null,ye),X=le},ee=y.colorModeForRenderPass(),ne=new n.DepthMode(F.LEQUAL,n.DepthMode.ReadWrite,y.depthRangeFor3D);ha.update(O);let H=y.transform,Q=bh(H.zoom)*x.exaggeration();
1290(J?[!1,!0]:[!1]).forEach(le=>{X=-1;let ue=le?F.LINES:F.TRIANGLES,[ye,xe]=le?x.getWirefameBuffer():[x.gridIndexBuffer,x.gridSegments];for(let be of D){let De=I.getTile(be),Ie=n.StencilMode.disabled,Re=x.prevTerrainTileForTile[be.key],nt=x.terrainTileForTile[be.key];Tc(Re,nt)&&ha.newMorphing(be.key,Re,nt,O,250),z.activeTexture.set(F.TEXTURE0),De.texture.bind(F.LINEAR,F.CLAMP_TO_EDGE,F.LINEAR_MIPMAP_NEAREST);let Ae=ha.getMorphValuesForProxy(be.key),Ze=Ae?1:0,Ne;Ae&&(Ne={morphing:{srcDemTile:Ae.from,dstDemTile:Ae.to,phase:n.easeCubicInOut(Ae.phase)}});let it=Sc(be.projMatrix,M0(be.canonical,H.renderWorldCopies)?Q/10:Q);te(Ze,le),x.setupElevationDraw(De,U,Ne),y.prepareDrawProgram(z,U,be.toUnwrapped()),U.draw(z,ue,ne,Ie,ee,n.CullFaceMode.backCCW,it,"terrain_raster",x.gridBuffer,ye,xe)}})}}(h,this,this.proxySourceCache,c,this._updateTimestamp),this.renderingToTexture=!0,h.gpuTimingDeferredRenderEnd(),c.splice(0,c.length))}renderBatch(c){if(this._drapedRenderBatches.length===0)return c+1;this.renderingToTexture=!0;let h=this.painter,g=this.painter.context,y=this.proxySourceCache,x=this.proxiedCoords[y.id],I=this._drapedRenderBatches.shift(),D=[],O=h.style.order,z=0;for(let F of x){let U=y.getTileByID(F.proxyTileKey),X=y.proxyCachedFBO[F.key]?y.proxyCachedFBO[F.key][c]:void 0,J=X!==void 0?y.renderCache[X]:this.pool[z++],te=X!==void 0;if(U.texture=J.tex,te&&!J.dirty){D.push(U.tileID);continue}let ee;g.bindFramebuffer.set(J.fb.framebuffer),this.renderedToTile=!1,J.dirty&&(g.clear({color:n.Color.transparent,stencil:0}),J.dirty=!1);for(let ne=I.start;ne<=I.end;++ne){let H=h.style._layers[O[ne]];if(H.isHidden(h.transform.zoom))continue;let Q=h.style._getLayerSourceCache(H),le=Q?this.proxyToSource[F.key][Q.id]:[F];if(!le)continue;let ue=le;g.viewport.set([0,0,J.fb.width,J.fb.height]),ee!==(Q?Q.id:null)&&(this._setupStencil(J,le,H,Q),ee=Q?Q.id:null),h.renderLayer(h,Q,H,ue)}this.renderedToTile?(J.dirty=!0,D.push(U.tileID)):te||--z,z===5&&(z=0,this.renderToBackBuffer(D))}return this.renderToBackBuffer(D),this.renderingToTexture=!1,g.bindFramebuffer.set(null),g.viewport.set([0,0,h.width,h.height]),I.end+1}postRender(){}renderCacheEfficiency(c){let h=c.order.length;if(h===0)return{efficiency:100};let g,y=0,x=0,I=!1;for(let D=0;D<h;++D){let O=c._layers[c.order[D]];this._style.isLayerDraped(O)?(I&&++y,++x):I||(I=!0,g=O.id)}return x===0?{efficiency:100}:{efficiency:100*(1-y/x),firstUndrapedLayer:g}}getMinElevationBelowMSL(){let c=0;return this._visibleDemTiles.filter(h=>h.dem).forEach(h=>{c=Math.min(c,h.dem.tree.minimums[0])}),c===0?c:(c-30)*this._exaggeration}raycast(c,h,g){if(!this._visibleDemTiles)return null;let y=this._visibleDemTiles.filter(x=>x.dem).map(x=>{let I=x.tileID,D=1<<I.overscaledZ,{x:O,y:z}=I.canonical,F=O/D,U=(O+1)/D,X=z/D,J=(z+1)/D;return{minx:F,miny:X,maxx:U,maxy:J,t:x.dem.tree.raycastRoot(F,X,U,J,c,h,g),tile:x}});y.sort((x,I)=>(x.t!==null?x.t:Number.MAX_VALUE)-(I.t!==null?I.t:Number.MAX_VALUE));for(let x of y){if(x.t==null)return null;let I=x.tile.dem.tree.raycast(x.minx,x.miny,x.maxx,x.maxy,c,h,g);if(I!=null)return I}return null}_createFBO(){let c=this.painter.context,h=c.gl,g=this.drapeBufferSize;c.activeTexture.set(h.TEXTURE0);let y=new n.Texture(c,{width:g[0],height:g[1],data:null},h.RGBA);y.bind(h.LINEAR,h.CLAMP_TO_EDGE);let x=c.createFramebuffer(g[0],g[1],!1);return x.colorAttachment.set(y.texture),x.depthAttachment=new we(c,x.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=c.createRenderbuffer(c.gl.DEPTH_STENCIL,g[0],g[1]),this._stencilRef=0,x.depthAttachment.set(this._sharedDepthStencil),c.clear({stencil:0})):x.depthAttachment.set(this._sharedDepthStencil),c.extTextureFilterAnisotropic&&!c.extTextureFilterAnisotropicForceOff&&h.texParameterf(h.TEXTURE_2D,c.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,c.extTextureFilterAnisotropicMax),{fb:x,tex:y,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.light&&this._style.light.hasTransition())return!0;for(let c in this._style._sourceCaches)if(this._style._sourceCaches[c].hasTransition())return!0;return this._style.order.some(c=>
1290{let h=this._style._layers[c],g=h.isHidden(this.painter.transform.zoom);return h.type==="custom"?!g&&h.shouldRedrape():!g&&h.hasTransition()})}_clearLineLayersFromRenderCache(){let c=!1;for(let g of this._style._getSources())if(g instanceof vt){c=!0;break}if(!c)return;let h={};for(let g=0;g<this._style.order.length;++g){let y=this._style._layers[this._style.order[g]],x=this._style._getLayerSourceCache(y);if(x&&!h[x.id]&&!y.isHidden(this.painter.transform.zoom)&&y.type==="line"&&y.widthExpression()instanceof n.ZoomDependentExpression){h[x.id]=!0;for(let I of this.proxyCoords){let D=this.proxyToSource[I.key][x.id];if(D)for(let O of D)this._clearRenderCacheForTile(x.id,O)}}}}_clearRasterLayersFromRenderCache(){let c=!1;for(let g in this._style._sourceCaches)if(this._style._sourceCaches[g]._source instanceof ut){c=!0;break}if(!c)return;let h={};for(let g=0;g<this._style.order.length;++g){let y=this._style._layers[this._style.order[g]],x=this._style._getLayerSourceCache(y);if(!x||h[x.id]||y.isHidden(this.painter.transform.zoom)||y.type!=="raster")continue;let I=y.paint.get("raster-fade-duration");for(let D of this.proxyCoords){let O=this.proxyToSource[D.key][x.id];if(O)for(let z of O){let F=hm(x.getTile(z),x.findLoadedParent(z,0),x,this.painter.transform,I);(F.opacity!==1||F.mix!==0)&&this._clearRenderCacheForTile(x.id,z)}}}}_setupDrapedRenderBatches(){let c=this._style.order,h=c.length;if(h===0)return;let g=[],y,x=0,I=this._style._layers[c[x]];for(;!this._style.isLayerDraped(I)&&I.isHidden(this.painter.transform.zoom)&&++x<h;)I=this._style._layers[c[x]];for(;x<h;++x){let D=this._style._layers[c[x]];D.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(D)?y===void 0&&(y=x):y!==void 0&&(g.push({start:y,end:x-1}),y=void 0))}y!==void 0&&g.push({start:y,end:x-1}),this._drapedRenderBatches=g}_setupRenderCache(c){let h=this.proxySourceCache;if(this._shouldDisableRenderCache()||this._invalidateRenderCache){if(this._invalidateRenderCache=!1,h.renderCache.length>h.renderCachePool.length){let I=Object.values(h.proxyCachedFBO);h.proxyCachedFBO={};for(let D=0;D<I.length;++D){let O=Object.values(I[D]);h.renderCachePool.push(...O)}}return}this._clearRasterLayersFromRenderCache();let g=this.proxyCoords,y=this._tilesDirty;for(let I=g.length-1;I>=0;I--){let D=g[I];if(h.getTileByID(D.key),h.proxyCachedFBO[D.key]!==void 0){let O=c[D.key],z=this.proxyToSource[D.key],F=0;for(let U in z){let X=z[U],J=O[U];if(!J||J.length!==X.length||X.some((te,ee)=>te!==J[ee]||y[U]&&y[U].hasOwnProperty(te.key))){F=-1;break}++F}for(let U in h.proxyCachedFBO[D.key])h.renderCache[h.proxyCachedFBO[D.key][U]].dirty=F<0||F!==Object.values(O).length}}let x=[...this._drapedRenderBatches];x.sort((I,D)=>D.end-D.start-(I.end-I.start));for(let I of x)for(let D of g){if(h.proxyCachedFBO[D.key])continue;let O=h.renderCachePool.pop();O===void 0&&h.renderCache.length<50&&(O=h.renderCache.length,h.renderCache.push(this._createFBO())),O!==void 0&&(h.proxyCachedFBO[D.key]={},h.proxyCachedFBO[D.key][I.start]=O,h.renderCache[O].dirty=!0)}this._tilesDirty={}}_setupStencil(c,h,g,y){if(!y||!this._sourceTilesOverlap[y.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));let x=this.painter.context,I=x.gl;if(h.length<=1)return void(this._overlapStencilType=!1);let D;if(g.isTileClipped())D=h.length,this._overlapStencilMode.test={func:I.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(h[0].overscaledZ>h[h.length-1].overscaledZ))return void(this._overlapStencilType=!1);D=1,this._overlapStencilMode.test={func:I.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+D>255&&(x.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=D,this._overlapStencilMode.ref=this._stencilRef,g.isTileClipped()&&this._renderTileClippingMasks(h,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(c){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[c.key]),this._overlapStencilMode):n.StencilMode.disabled}_renderTileClippingMasks(c,h){let g=this.painter,y=this.painter.context,x=y.gl;g._tileClippingMaskIDs={},y.setColorMode(n.ColorMode.disabled),y.setDepthMode(n.DepthMode.disabled);let I=g.useProgram("clippingMask");for(let D of c){let O=g._tileClippingMaskIDs[D.key]=--h;I.draw(y,x.TRIANGLES,n.DepthMode.disabled,new n.StencilMode({func:x.ALWAYS,mask:0},O,255,x.KEEP,x.KEEP,x.REPLACE),n.ColorMode.disabled,n.CullFaceMode.disabled,Zu(D.projMatrix),"$clipping",g.tileExtentBuffer,g.quadTriangleIndexBuffer,g.tileExtentSegments)}}pointCoordinate(c){let h=this.painter.transform;if(c.x<0||c.x>h.width||c.y<0||c.y>h.height)return null;let g=[c.x,c.y,1,1];n.transformMat4$1(g,g,h.pixelMatrixInverse),n.scale$1(g,g,1/g[3]),g[0]/=h.worldSize,g[1]/=h.worldSize;let y=h._camera.position,x=n.mercatorZfromAltitude(1,h.center.lat),I=[y[0],y[1],y[2]/x,0],D=n.subtract([],g.slice(0,3),I);n.normalize(D,D);let O=this.raycast(I,D,this._exaggeration);return O!==null&&O?(n.scaleAndAdd(I,I,D,O),I[3]=I[2],I[2]*=x,I):null}drawDepth(){let c=this.painter,h=c.context,g=this.proxySourceCache,y=Math.ceil(c.width),x=Math.ceil(c.height);if(!this._depthFBO||this._depthFBO.width===y&&this._depthFBO.height===x||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){let I=h.gl,D=h.createFramebuffer(y,x,!0);h.activeTexture.set(I.TEXTURE0);let O=new n.Texture(h,{width:y,height:x,data:null},I.RGBA);O.bind(I.NEAREST,I.CLAMP_TO_EDGE),D.colorAttachment.set(O.texture);let z=h.createRenderbuffer(h.gl.DEPTH_COMPONENT16,y,x);D.depthAttachment.set(z),this._depthFBO=D,this._depthTexture=O}h.bindFramebuffer.set(this._depthFBO.framebuffer),h.viewport.set([0,0,y,x]),function(I,D,O,z){if(I.transform.projection.name==="globe")return;let F=I.context,U=F.gl;F.clear({depth:1});let X=I.useProgram("terrainDepth"),J=new n.DepthMode(U.LESS,n.DepthMode.ReadWrite,I.depthRangeFor3D);for(let te of z){let ee=O.getTile(te),ne=Sc(te.projMatrix,0);D.setupElevationDraw(ee,X),X.draw(F,U.TRIANGLES,J,n.StencilMode.disabled,n.ColorMode.unblended,n.CullFaceMode.backCCW,ne,"terrain_depth",D.gridBuffer,D.gridIndexBuffer,D.gridNoSkirtSegments)}}(c,this,g,this.proxyCoords)}
1290_setupProxiedCoordsForOrtho(c,h,g){if(c.getSource()instanceof xi)return this._setupProxiedCoordsForImageSource(c,h,g);this._findCoveringTileCache[c.id]=this._findCoveringTileCache[c.id]||{};let y=this.proxiedCoords[c.id]=[],x=this.proxyCoords;for(let D=0;D<x.length;D++){let O=x[D],z=this._findTileCoveringTileID(O,c);if(z){let F=this._createProxiedId(O,z,g[O.key]&&g[O.key][c.id]);y.push(F),this.proxyToSource[O.key][c.id]=[F]}}let I=!1;for(let D=0;D<h.length;D++){let O=c.getTile(h[D]);if(!O||!O.hasData())continue;let z=this._findTileCoveringTileID(O.tileID,this.proxySourceCache);if(z&&z.tileID.canonical.z!==O.tileID.canonical.z){let F=this.proxyToSource[z.tileID.key][c.id],U=this._createProxiedId(z.tileID,O,g[z.tileID.key]&&g[z.tileID.key][c.id]);F?F.splice(F.length-1,0,U):this.proxyToSource[z.tileID.key][c.id]=[U],y.push(U),I=!0}}this._sourceTilesOverlap[c.id]=I}_setupProxiedCoordsForImageSource(c,h,g){if(!c.getSource().loaded())return;let y=this.proxiedCoords[c.id]=[],x=this.proxyCoords,I=c.getSource(),D=new n.Point(I.tileID.x,I.tileID.y)._div(1<<I.tileID.z),O=I.coordinates.map(n.MercatorCoordinate.fromLngLat).reduce((F,U)=>(F.min.x=Math.min(F.min.x,U.x-D.x),F.min.y=Math.min(F.min.y,U.y-D.y),F.max.x=Math.max(F.max.x,U.x-D.x),F.max.y=Math.max(F.max.y,U.y-D.y),F),{min:new n.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new n.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),z=(F,U)=>{let X=F.wrap+F.canonical.x/(1<<F.canonical.z),J=F.canonical.y/(1<<F.canonical.z),te=n.EXTENT/(1<<F.canonical.z),ee=U.wrap+U.canonical.x/(1<<U.canonical.z),ne=U.canonical.y/(1<<U.canonical.z);return X+te<ee+O.min.x||X>ee+O.max.x||J+te<ne+O.min.y||J>ne+O.max.y};for(let F=0;F<x.length;F++){let U=x[F];for(let X=0;X<h.length;X++){let J=c.getTile(h[X]);if(!J||!J.hasData()||z(U,J.tileID))continue;let te=this._createProxiedId(U,J,g[U.key]&&g[U.key][c.id]),ee=this.proxyToSource[U.key][c.id];ee?ee.push(te):this.proxyToSource[U.key][c.id]=[te],y.push(te)}}}_createProxiedId(c,h,g){let y=this.orthoMatrix;if(g){let x=g.find(I=>I.key===h.tileID.key);if(x)return x}if(h.tileID.key!==c.key){let x=c.canonical.z-h.tileID.canonical.z,I,D,O;y=n.create();let z=h.tileID.wrap-c.wrap<<c.overscaledZ;x>0?(I=n.EXTENT>>x,D=I*((h.tileID.canonical.x<<x)-c.canonical.x+z),O=I*((h.tileID.canonical.y<<x)-c.canonical.y)):(I=n.EXTENT<<-x,D=n.EXTENT*(h.tileID.canonical.x-(c.canonical.x+z<<-x)),O=n.EXTENT*(h.tileID.canonical.y-(c.canonical.y<<-x))),n.ortho(y,0,I,0,I,0,1),n.translate(y,y,[D,O,0])}return new wh(h.tileID,c.key,y)}_findTileCoveringTileID(c,h){let g=h.getTile(c);if(g&&g.hasData())return g;let y=this._findCoveringTileCache[h.id],x=y[c.key];if(g=x?h.getTileByID(x):null,g&&g.hasData()||x===null)return g;let I=g?g.tileID:c,D=I.overscaledZ,O=h.getSource().minzoom,z=[];if(!x){let U=h.getSource().maxzoom;if(c.canonical.z>=U){let X=c.canonical.z-U;h.getSource().reparseOverscaled?(D=Math.max(c.canonical.z+2,h.transform.tileZoom),I=new n.OverscaledTileID(D,c.wrap,U,c.canonical.x>>X,c.canonical.y>>X)):X!==0&&(D=U,I=new n.OverscaledTileID(D,c.wrap,U,c.canonical.x>>X,c.canonical.y>>X))}I.key!==c.key&&(z.push(I.key),g=h.getTile(I))}let F=U=>{z.forEach(X=>{y[X]=U}),z.length=0};for(D-=1;D>=O&&(!g||!g.hasData());D--){g&&F(g.tileID.key);let U=I.calculateScaledKey(D);if(g=h.getTileByID(U),g&&g.hasData())break;let X=y[U];if(X===null)break;X===void 0?z.push(U):g=h.getTileByID(X)}return F(g?g.tileID.key:null),g&&g.hasData()?g:null}findDEMTileFor(c){return this.enabled?this._findTileCoveringTileID(c,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(c,h){let g=this._tilesDirty[c];g||(g=this._tilesDirty[c]={}),g[h.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){let c=function(h){let g=0,y=new n.StructArrayLayout2ui4,x=131;for(let I=1;I<129;I++){for(let D=1;D<129;D++)g=I*x+D,y.emplaceBack(g,g+1),y.emplaceBack(g,g+x),y.emplaceBack(g+1,g+x),I===128&&y.emplaceBack(g+x,g+x+1);y.emplaceBack(g+1,g+1+x)}return y}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(c),this.wireframeSegments=n.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,c.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}
1290class Wi{static cacheKey(c,h,g,y){let x=`${h}${y?y.cacheKey:""}`;for(let I of g)c.usedDefines.includes(I)&&(x+=`/${I}`);return x}constructor(c,h,g,y,x,I){let D=c.gl;this.program=D.createProgram();let O=function(H){let Q=[];for(let le=0;le<H.length;le++){if(H[le]===null)continue;let ue=H[le].split(" ");Q.push(ue.pop())}return Q}(g.staticAttributes),z=y?y.getBinderAttributes():[],F=O.concat(z),U=y?y.defines():[];U=U.concat(I.map(H=>`#define ${H}`));let X=c.isWebGL2?`#version 300 es
1291`:"",J=X+U.concat(c.extStandardDerivatives&&X.length===0?`#extension GL_OES_standard_derivatives : enable
1292`.concat(am):am,am,vh,T0.fragmentSource,Cc.fragmentSource,g.fragmentSource).join(`
1293`),te=X+U.concat(`
1294#ifdef GL_ES
1295precision highp float;
1296#else
1297
1298#if !defined(lowp)
1299#define lowp
1300#endif
1301
1302#if !defined(mediump)
1303#define mediump
1304#endif
1305
1306#if !defined(highp)
1307#define highp
1308#endif
1309
1310#endif`,vh,T0.vertexSource,Cc.vertexSource,_h.vertexSource,g.vertexSource).join(`
1311`),ee=D.createShader(D.FRAGMENT_SHADER);if(D.isContextLost())return void(this.failedToCreate=!0);D.shaderSource(ee,J),D.compileShader(ee),D.attachShader(this.program,ee);let ne=D.createShader(D.VERTEX_SHADER);if(D.isContextLost())this.failedToCreate=!0;else{D.shaderSource(ne,te),D.compileShader(ne),D.attachShader(this.program,ne),this.attributes={},this.numAttributes=F.length;for(let H=0;H<this.numAttributes;H++)F[H]&&(D.bindAttribLocation(this.program,H,F[H]),this.attributes[F[H]]=H);D.linkProgram(this.program),D.deleteShader(ne),D.deleteShader(ee),this.fixedUniforms=x(c),this.binderUniforms=y?y.getUniforms(c):[],I.includes("TERRAIN")&&(this.terrainUniforms=(H=>({u_dem:new n.Uniform1i(H),u_dem_prev:new n.Uniform1i(H),u_dem_unpack:new n.Uniform4f(H),u_dem_tl:new n.Uniform2f(H),u_dem_scale:new n.Uniform1f(H),u_dem_tl_prev:new n.Uniform2f(H),u_dem_scale_prev:new n.Uniform1f(H),u_dem_size:new n.Uniform1f(H),u_dem_lerp:new n.Uniform1f(H),u_exaggeration:new n.Uniform1f(H),u_depth:new n.Uniform1i(H),u_depth_size_inv:new n.Uniform2f(H),u_meter_to_dem:new n.Uniform1f(H),u_label_plane_matrix_inv:new n.UniformMatrix4f(H)}))(c)),I.includes("GLOBE")&&(this.globeUniforms=(H=>({u_tile_tl_up:new n.Uniform3f(H),u_tile_tr_up:new n.Uniform3f(H),u_tile_br_up:new n.Uniform3f(H),u_tile_bl_up:new n.Uniform3f(H),u_tile_up_scale:new n.Uniform1f(H)}))(c)),I.includes("FOG")&&(this.fogUniforms=(H=>({u_fog_matrix:new n.UniformMatrix4f(H),u_fog_range:new n.Uniform2f(H),u_fog_color:new n.Uniform4f(H),u_fog_horizon_blend:new n.Uniform1f(H),u_fog_temporal_offset:new n.Uniform1f(H),u_frustum_tl:new n.Uniform3f(H),u_frustum_tr:new n.Uniform3f(H),u_frustum_br:new n.Uniform3f(H),u_frustum_bl:new n.Uniform3f(H),u_globe_pos:new n.Uniform3f(H),u_globe_radius:new n.Uniform1f(H),u_globe_transition:new n.Uniform1f(H),u_is_globe:new n.Uniform1i(H),u_viewport:new n.Uniform2f(H)}))(c))}}setTerrainUniformValues(c,h){if(!this.terrainUniforms)return;let g=this.terrainUniforms;if(!this.failedToCreate){c.program.set(this.program);for(let y in h)g[y]&&g[y].set(this.program,y,h[y])}}setGlobeUniformValues(c,h){if(!this.globeUniforms)return;let g=this.globeUniforms;if(!this.failedToCreate){c.program.set(this.program);for(let y in h)g[y]&&g[y].set(this.program,y,h[y])}}setFogUniformValues(c,h){if(!this.fogUniforms)return;let g=this.fogUniforms;if(!this.failedToCreate){c.program.set(this.program);for(let y in h)g[y].set(this.program,y,h[y])}}draw(c,h,g,y,x,I,D,O,z,F,U,X,J,te,ee){let ne=c.gl;if(this.failedToCreate)return;c.program.set(this.program),c.setDepthMode(g),c.setStencilMode(y),c.setColorMode(x),c.setCullFace(I);for(let Q of Object.keys(this.fixedUniforms))this.fixedUniforms[Q].set(this.program,Q,D[Q]);te&&te.setUniforms(this.program,c,this.binderUniforms,X,{zoom:J});let H={[ne.LINES]:2,[ne.TRIANGLES]:3,[ne.LINE_STRIP]:1}[h];for(let Q of U.get()){let le=Q.vaos||(Q.vaos={});(le[O]||(le[O]=new F1)).bind(c,this,z,te?te.getPaintVertexBuffers():[],F,Q.vertexOffset,ee||[]),ne.drawElements(h,Q.primitiveLength*H,ne.UNSIGNED_SHORT,Q.primitiveOffset*H*2)}}}function Ku(f,c){let h=Math.pow(2,c.tileID.overscaledZ),g=c.tileSize*Math.pow(2,f.transform.tileZoom)/h,y=g*(c.tileID.canonical.x+c.tileID.wrap*h),x=g*c.tileID.canonical.y;return{u_image:0,u_texsize:c.imageAtlasTexture.size,u_tile_units_to_pixels:1/ri(c,1,f.transform.tileZoom),u_pixel_coord_upper:[y>>16,x>>16],u_pixel_coord_lower:[65535&y,65535&x]}}let k0=n.create(),mm=(f,c,h,g,y,x,I,D,O,z,F)=>{let U=c.style.light,X=U.properties.get("position"),J=[X.x,X.y,X.z],te=n.create$1();U.properties.get("anchor")==="viewport"&&(n.fromRotation(te,-c.transform.angle),n.transformMat3(J,J,te));let ee=U.properties.get("color"),ne=c.transform,H={u_matrix:f,u_lightpos:J,u_lightintensity:U.properties.get("intensity"),u_lightcolor:[ee.r,ee.g,ee.b],u_vertical_gradient:+h,u_opacity:g,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:k0,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:y,u_edge_radius:x};return ne.projection.name==="globe"&&(H.u_tile_id=[I.canonical.x,I.canonical.y,1<<I.canonical.z],H.u_zoom_transition=O,H.u_inv_rot_matrix=F,H.u_merc_center=z,H.u_up_dir=ne.projection.upVector(new n.CanonicalTileID(0,0,0),z[0]*n.EXTENT,z[1]*n.EXTENT),H.u_height_lift=D),H},A0=(f,c,h,g,y,x,I,D,O,z,F,U)=>{let X=mm(f,c,h,g,y,x,I,O,z,F,U),J={u_height_factor:-Math.pow(2,I.overscaledZ
1311)/D.tileSize/8};return n.extend(X,Ku(c,D),J)},Fl=f=>({u_matrix:f}),gm=(f,c,h)=>n.extend(Fl(f),Ku(c,h)),N1=(f,c)=>({u_matrix:f,u_world:c}),z1=(f,c,h,g)=>n.extend(gm(f,c,h),{u_world:g}),j1=n.create(),_m=(f,c,h,g,y,x)=>{let I=f.transform,D=I.projection.name==="globe",O;if(x.paint.get("circle-pitch-alignment")==="map")if(D){let F=n.globePixelsToTileUnits(I.zoom,c.canonical)*I._pixelsPerMercatorPixel;O=Float32Array.from([F,0,0,F])}else O=I.calculatePixelsToTileUnitsMatrix(h);else O=new Float32Array([I.pixelsToGLUnits[0],0,0,I.pixelsToGLUnits[1]]);let z={u_camera_to_center_distance:I.cameraToCenterDistance,u_matrix:f.translatePosMatrix(c.projMatrix,h,x.paint.get("circle-translate"),x.paint.get("circle-translate-anchor")),u_device_pixel_ratio:n.exported.devicePixelRatio,u_extrude_scale:O,u_inv_rot_matrix:j1,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(D){z.u_inv_rot_matrix=g,z.u_merc_center=y,z.u_tile_id=[c.canonical.x,c.canonical.y,1<<c.canonical.z],z.u_zoom_transition=n.globeToMercatorTransition(I.zoom);let F=y[0]*n.EXTENT,U=y[1]*n.EXTENT;z.u_up_dir=I.projection.upVector(new n.CanonicalTileID(0,0,0),F,U)}return z},vm=f=>{let c=[];return f.paint.get("circle-pitch-alignment")==="map"&&c.push("PITCH_WITH_MAP"),f.paint.get("circle-pitch-scale")==="map"&&c.push("SCALE_WITH_MAP"),c},ym=(f,c,h,g)=>{let y=n.EXTENT/h.tileSize;return{u_matrix:f,u_camera_to_center_distance:c.getCameraToCenterDistance(g),u_extrude_scale:[c.pixelsToGLUnits[0]/y,c.pixelsToGLUnits[1]/y]}},Ch=(f,c,h=1)=>({u_matrix:f,u_color:c,u_overlay:0,u_overlay_scale:h}),P0=n.create(),O0=(f,c,h,g,y,x,I)=>{let D=f.transform,O=D.projection.name==="globe",z=O?n.globePixelsToTileUnits(D.zoom,c.canonical)*D._pixelsPerMercatorPixel:ri(h,1,x),F={u_matrix:c.projMatrix,u_extrude_scale:z,u_intensity:I,u_inv_rot_matrix:P0,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(O){F.u_inv_rot_matrix=g,F.u_merc_center=y,F.u_tile_id=[c.canonical.x,c.canonical.y,1<<c.canonical.z],F.u_zoom_transition=n.globeToMercatorTransition(D.zoom);let U=y[0]*n.EXTENT,X=y[1]*n.EXTENT;F.u_up_dir=D.projection.upVector(new n.CanonicalTileID(0,0,0),U,X)}return F},V1=(f,c,h,g,y,x,I)=>{let D=f.transform,O=D.calculatePixelsToTileUnitsMatrix(c);return{u_matrix:bm(f,c,h,g),u_pixels_to_tile_units:O,u_device_pixel_ratio:x,u_units_to_pixels:[1/D.pixelsToGLUnits[0],1/D.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:y,u_texsize:Yu(h)?c.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Ic(c,f.transform),u_alpha_discard_threshold:0,u_trim_offset:I}},Xu=(f,c,h,g,y)=>{let x=f.transform;return{u_matrix:bm(f,c,h,g),u_texsize:c.imageAtlasTexture.size,u_pixels_to_tile_units:x.calculatePixelsToTileUnitsMatrix(c),u_device_pixel_ratio:y,u_image:0,u_tile_units_to_pixels:Ic(c,x),u_units_to_pixels:[1/x.pixelsToGLUnits[0],1/x.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function Ic(f,c){return 1/ri(f,1,c.tileZoom)}function bm(f,c,h,g){return f.translatePosMatrix(g||c.tileID.projMatrix,c,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}function Yu(f){let c=f.paint.get("line-dasharray").value;return c.value||c.kind!=="constant"}let xm=(f,c,h,g,y,x)=>{return{u_matrix:f,u_tl_parent:c,u_scale_parent:h,u_fade_t:g.mix,u_opacity:g.opacity*y.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:y.paint.get("raster-brightness-min"),u_brightness_high:y.paint.get("raster-brightness-max"),u_saturation_factor:(D=y.paint.get("raster-saturation"),D>0?1-1/(1.001-D):-D),u_contrast_factor:(I=y.paint.get("raster-contrast"),I>0?1/(1-I):1+I),u_spin_weights:Os(y.paint.get("raster-hue-rotate")),u_perspective_transform:x};var I,D};function Os(f){f*=Math.PI/180;let c=Math.sin(f),h=Math.cos(f);return[(2*h+1)/3,(-Math.sqrt(3)*c-h+1)/3,(Math.sqrt(3)*c-h+1)/3]}let Eh=n.create(),wm=(f,c,h,g,y,x,I,D,O,z,F,U,X,J,te,ee)=>{let ne=y.transform,H={u_is_size_zoom_constant:+(f==="constant"||f==="source"),u_is_size_feature_constant:+(f==="constant"||f==="camera"),u_size_t:c?c.uSizeT:0,u_size:c?c.uSize:0,u_camera_to_center_distance:ne.cameraToCenterDistance,u_rotate_symbol:+h,u_aspect_ratio:ne.width/ne.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_matrix:x,u_label_plane_matrix:I,u_coord_matrix:D,u_is_text:+O,u_pitch_with_map:+g,u_texsize:z,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Eh,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Eh,u_up_vector:[0,-1,0]};return ee.name==="globe"&&(H.u_tile_id=[F.canonical.x,F.canonical.y,1<<F.c
1311anonical.z],H.u_zoom_transition=U,H.u_inv_rot_matrix=J,H.u_merc_center=X,H.u_camera_forward=ne._camera.forward(),H.u_ecef_origin=n.globeECEFOrigin(ne.globeMatrix,F.toUnwrapped()),H.u_tile_matrix=Float32Array.from(ne.globeMatrix),H.u_up_vector=te),H},Sh=(f,c,h,g,y,x,I,D,O,z,F,U,X,J,te,ee,ne)=>n.extend(wm(f,c,h,g,y,x,I,D,O,z,U,X,J,te,ee,ne),{u_gamma_scale:g?y.transform.cameraToCenterDistance*Math.cos(y.terrain?0:y.transform._pitch):1,u_device_pixel_ratio:n.exported.devicePixelRatio,u_is_halo:+F}),R0=(f,c,h,g,y,x,I,D,O,z,F,U,X,J,te,ee)=>n.extend(Sh(f,c,h,g,y,x,I,D,!0,O,!0,F,U,X,J,te,ee),{u_texsize_icon:z,u_texture_icon:1}),Cm=(f,c,h)=>({u_matrix:f,u_opacity:c,u_color:h}),B1=(f,c,h,g,y)=>n.extend(function(x,I,D){let O=I.imageManager.getPattern(x.toString()),{width:z,height:F}=I.imageManager.getPixelSize(),U=Math.pow(2,D.tileID.overscaledZ),X=D.tileSize*Math.pow(2,I.transform.tileZoom)/U,J=X*(D.tileID.canonical.x+D.tileID.wrap*U),te=X*D.tileID.canonical.y;return{u_image:0,u_pattern_tl:O.tl,u_pattern_br:O.br,u_texsize:[z,F],u_pattern_size:O.displaySize,u_tile_units_to_pixels:1/ri(D,1,I.transform.tileZoom),u_pixel_coord_upper:[J>>16,te>>16],u_pixel_coord_lower:[65535&J,65535&te]}}(g,h,y),{u_matrix:f,u_opacity:c}),Em={fillExtrusion:f=>({u_matrix:new n.UniformMatrix4f(f),u_lightpos:new n.Uniform3f(f),u_lightintensity:new n.Uniform1f(f),u_lightcolor:new n.Uniform3f(f),u_vertical_gradient:new n.Uniform1f(f),u_opacity:new n.Uniform1f(f),u_edge_radius:new n.Uniform1f(f),u_ao:new n.Uniform2f(f),u_tile_id:new n.Uniform3f(f),u_zoom_transition:new n.Uniform1f(f),u_inv_rot_matrix:new n.UniformMatrix4f(f),u_merc_center:new n.Uniform2f(f),u_up_dir:new n.Uniform3f(f),u_height_lift:new n.Uniform1f(f)}),fillExtrusionPattern:f=>({u_matrix:new n.UniformMatrix4f(f),u_lightpos:new n.Uniform3f(f),u_lightintensity:new n.Uniform1f(f),u_lightcolor:new n.Uniform3f(f),u_vertical_gradient:new n.Uniform1f(f),u_height_factor:new n.Uniform1f(f),u_edge_radius:new n.Uniform1f(f),u_ao:new n.Uniform2f(f),u_tile_id:new n.Uniform3f(f),u_zoom_transition:new n.Uniform1f(f),u_inv_rot_matrix:new n.UniformMatrix4f(f),u_merc_center:new n.Uniform2f(f),u_up_dir:new n.Uniform3f(f),u_height_lift:new n.Uniform1f(f),u_image:new n.Uniform1i(f),u_texsize:new n.Uniform2f(f),u_pixel_coord_upper:new n.Uniform2f(f),u_pixel_coord_lower:new n.Uniform2f(f),u_tile_units_to_pixels:new n.Uniform1f(f),u_opacity:new n.Uniform1f(f)}),fill:f=>({u_matrix:new n.UniformMatrix4f(f)}),fillPattern:f=>({u_matrix:new n.UniformMatrix4f(f),u_image:new n.Uniform1i(f),u_texsize:new n.Uniform2f(f),u_pixel_coord_upper:new n.Uniform2f(f),u_pixel_coord_lower:new n.Uniform2f(f),u_tile_units_to_pixels:new n.Uniform1f(f)}),fillOutline:f=>({u_matrix:new n.UniformMatrix4f(f),u_world:new n.Uniform2f(f)}),fillOutlinePattern:f=>({u_matrix:new n.UniformMatrix4f(f),u_world:new n.Uniform2f(f),u_image:new n.Uniform1i(f),u_texsize:new n.Uniform2f(f),u_pixel_coord_upper:new n.Uniform2f(f),u_pixel_coord_lower:new n.Uniform2f(f),u_tile_units_to_pixels:new n.Uniform1f(f)}),circle:f=>({u_camera_to_center_distance:new n.Uniform1f(f),u_extrude_scale:new n.UniformMatrix2f(f),u_device_pixel_ratio:new n.Uniform1f(f),u_matrix:new n.UniformMatrix4f(f),u_inv_rot_matrix:new n.UniformMatrix4f(f),u_merc_center:new n.Uniform2f(f),u_tile_id:new n.Uniform3f(f),u_zoom_transition:new n.Uniform1f(f),u_up_dir:new n.Uniform3f(f)}),collisionBox:f=>({u_matrix:new n.UniformMatrix4f(f),u_camera_to_center_distance:new n.Uniform1f(f),u_extrude_scale:new n.Uniform2f(f)}),collisionCircle:f=>({u_matrix:new n.UniformMatrix4f(f),u_inv_matrix:new n.UniformMatrix4f(f),u_camera_to_center_distance:new n.Uniform1f(f),u_viewport_size:new n.Uniform2f(f)}),debug:f=>
1311({u_color:new n.UniformColor(f),u_matrix:new n.UniformMatrix4f(f),u_overlay:new n.Uniform1i(f),u_overlay_scale:new n.Uniform1f(f)}),clippingMask:f=>({u_matrix:new n.UniformMatrix4f(f)}),heatmap:f=>({u_extrude_scale:new n.Uniform1f(f),u_intensity:new n.Uniform1f(f),u_matrix:new n.UniformMatrix4f(f),u_inv_rot_matrix:new n.UniformMatrix4f(f),u_merc_center:new n.Uniform2f(f),u_tile_id:new n.Uniform3f(f),u_zoom_transition:new n.Uniform1f(f),u_up_dir:new n.Uniform3f(f)}),heatmapTexture:f=>({u_image:new n.Uniform1i(f),u_color_ramp:new n.Uniform1i(f),u_opacity:new n.Uniform1f(f)}),hillshade:f=>({u_matrix:new n.UniformMatrix4f(f),u_image:new n.Uniform1i(f),u_latrange:new n.Uniform2f(f),u_light:new n.Uniform2f(f),u_shadow:new n.UniformColor(f),u_highlight:new n.UniformColor(f),u_accent:new n.UniformColor(f)}),hillshadePrepare:f=>({u_matrix:new n.UniformMatrix4f(f),u_image:new n.Uniform1i(f),u_dimension:new n.Uniform2f(f),u_zoom:new n.Uniform1f(f),u_unpack:new n.Uniform4f(f)}),line:f=>({u_matrix:new n.UniformMatrix4f(f),u_pixels_to_tile_units:new n.UniformMatrix2f(f),u_device_pixel_ratio:new n.Uniform1f(f),u_units_to_pixels:new n.Uniform2f(f),u_dash_image:new n.Uniform1i(f),u_gradient_image:new n.Uniform1i(f),u_image_height:new n.Uniform1f(f),u_texsize:new n.Uniform2f(f),u_tile_units_to_pixels:new n.Uniform1f(f),u_alpha_discard_threshold:new n.Uniform1f(f),u_trim_offset:new n.Uniform2f(f)}),linePattern:f=>({u_matrix:new n.UniformMatrix4f(f),u_texsize:new n.Uniform2f(f),u_pixels_to_tile_units:new n.UniformMatrix2f(f),u_device_pixel_ratio:new n.Uniform1f(f),u_image:new n.Uniform1i(f),u_units_to_pixels:new n.Uniform2f(f),u_tile_units_to_pixels:new n.Uniform1f(f),u_alpha_discard_threshold:new n.Uniform1f(f)}),raster:f=>({u_matrix:new n.UniformMatrix4f(f),u_tl_parent:new n.Uniform2f(f),u_scale_parent:new n.Uniform1f(f),u_fade_t:new n.Uniform1f(f),u_opacity:new n.Uniform1f(f),u_image0:new n.Uniform1i(f),u_image1:new n.Uniform1i(f),u_brightness_low:new n.Uniform1f(f),u_brightness_high:new n.Uniform1f(f),u_saturation_factor:new n.Uniform1f(f),u_contrast_factor:new n.Uniform1f(f),u_spin_weights:new n.Uniform3f(f),u_perspective_transform:new n.Uniform2f(f)}),symbolIcon:f=>({u_is_size_zoom_constant:new n.Uniform1i(f),u_is_size_feature_constant:new n.Uniform1i(f),u_size_t:new n.Uniform1f(f),u_size:new n.Uniform1f(f),u_camera_to_center_distance:new n.Uniform1f(f),u_rotate_symbol:new n.Uniform1i(f),u_aspect_ratio:new n.Uniform1f(f),u_fade_change:new n.Uniform1f(f),u_matrix:new n.UniformMatrix4f(f),u_label_plane_matrix:new n.UniformMatrix4f(f),u_coord_matrix:new n.UniformMatrix4f(f),u_is_text:new n.Uniform1i(f),u_pitch_with_map:new n.Uniform1i(f),u_texsize:new n.Uniform2f(f),u_tile_id:new n.Uniform3f(f),u_zoom_transition:new n.Uniform1f(f),u_inv_rot_matrix:new n.UniformMatrix4f(f),u_merc_center:new n.Uniform2f(f),u_camera_forward:new n.Uniform3f(f),u_tile_matrix:new n.UniformMatrix4f(f),u_up_vector:new n.Uniform3f(f),u_ecef_origin:new n.Uniform3f(f),u_texture:new n.Uniform1i(f)}),symbolSDF:f=>({u_is_size_zoom_constant:new n.Uniform1i(f),u_is_size_feature_constant:new n.Uniform1i(f),u_size_t:new n.Uniform1f(f),u_size:new n.Uniform1f(f),u_camera_to_center_distance:new n.Uniform1f(f),u_rotate_symbol:new n.Uniform1i(f),u_aspect_ratio:new n.Uniform1f(f),u_fade_change:new n.Uniform1f(f),u_matrix:new n.UniformMatrix4f(f),u_label_plane_matrix:new n.UniformMatrix4f(f),u_coord_matrix:new n.UniformMatrix4f(f),u_is_text:new n.Uniform1i(f),u_pitch_with_map:new n.Uniform1i(f),u_texsize:new n.Uniform2f(f),u_texture:new n.Uniform1i(f),u_gamma_scale:new n.Uniform1f(f),u_device_pixel_ratio:new n.Uniform1f(f),u_tile_id:new n.Uniform3f(f),u_zoom_transition:new n.Uniform1f(f),u_inv_rot_matrix:new n.UniformMatrix4f(f),u_merc_center:new n.Uniform2f(f),u_camera_forward:new n.Uniform3f(f),u_tile_matrix:new n.UniformMatrix4f(f),u_up_vector:new n.Uniform3f(f),u_ecef_origin:new n.Uniform3f(f),u_is_halo:new n.Uniform1i(f)}),symbolTextAndIcon:f=>({u_is_size_zoom_constant:new n.Uniform1i(f),u_is_size_feature_constant:new n.Uniform1i(f),u_size_t:new n.Uniform1f(f),u_size:new n.Uniform1f(f),u_camera_to_center_distance:new n.Uniform1f(f),u_rotate_symbol:new n.Uniform1i(f),u_aspect_ratio:new n.Uniform1f(f),u_fade_change:new n.Uniform1f(f),u_matrix:new n.UniformMatrix4f(f),u_label_plane_matrix:new n.UniformMatrix4f(f),u_coord_matrix:new n.UniformMatrix4f(f),u_is_text:new n.Uniform1i(f),u_pitch_with_map:new n.Uniform1i(f),u_texsize:new n.Uniform2f(f),u_texsize_icon:new n.Uniform2f(f),u_texture:new n.Uniform1i(f),u_texture_icon:new n.Uniform1i(f),u_gamma_scale:new n.Uniform1f(f),u_device_pixel_ratio:new n.Uniform1f(f),u_is_halo:new n.Uniform1i(f)}),background:f=>({u_matrix:new n.UniformMatrix4f(f),u_opacity:new n.Uniform1f(f),u_color:new n.UniformColor(f)}),backgroundPattern:f=>({u_matrix:new n.UniformMatrix4f(f),u_opacity:new n.Uniform1f(f),u_image:new n.Uniform1i(f),u_pattern_tl:new n.Uniform2f(f),u_pattern_br:new n.Uniform2f(f),u_texsize:new n.Uniform2f(f),u_pattern_size:new n.Uniform2f(f),u_pixel_coord_upper:new n.Uniform2f(f),u_pixel_coord_lower:new n.Uniform2f(f),u_tile_units_to_pixels:new n.Uniform1f(f)}),terrainRaster:dm,terrainDepth:dm,skybox:f=>({u_matrix:new n.UniformMatrix4f(f),u_sun_direction:new n.Uniform3f(f),u_cubemap:new n.Uniform1i(f),u_opacity:new n.Uniform1f(f),u_temporal_offset:new n.Uniform1f(f)}),skyboxGradient:f=>({u_matrix:new n.UniformMatrix4f(f),u_color_ramp:new n.Uniform1i(f),u_center_direction:new n.Uniform3f(f),u_radius:new n.Uniform1f(f),u_opacity:new n.Uniform1f(f),u_temporal_offset:new n.Uniform1f(f)}),skyboxCapture:f=>({u_matrix_3f:new n.UniformMatrix3f(f),u_sun_direction:new n.Uniform3f(f),u_sun_intensity:new n.Uniform1f(f),u_color_tint_r:new n.Uniform4f(f),u_color_tint_m:new n.Uniform4f(f),u_luminance:new n.Uniform1f(f)}),globeRaster:f=>({u_proj_matrix:new n.UniformMatrix4f(f),u_globe_matrix:new n.UniformMatrix4f(f),u_normalize_matrix:new n.UniformMatrix4f(f),u_merc_matrix:new n.UniformMatrix4f(f),u_zoom_transition:new n.Uniform1f(f),u_merc_center:new n.Uniform2f(f),u_image0:new n.Uniform1i(f),u_grid_matrix:new n.UniformMatrix3f(f),u_skirt_height:new n.Uniform1f(f),u_frustum_tl:new n.Uniform3f(f),u_frustum_tr:new n.Uniform3f(f),u_frustum_br:new n.Uniform3f(f),u_frustum_bl:new n.Uniform3f(f),u_globe_pos:new n.Uniform3f(f),u_globe_radius:new n.Uniform1f(f),u_viewport:new n.Uniform2f(f)}),globeAtmosphere:f=>({u_frustum_tl:new n.Uniform3f(f),u_frustum_tr:new n.Uniform3f(f),u_frustum_br:new n.Uniform3f(f),u_frustum_bl:new n.Uniform3f(f),u_horizon:new n.Uniform1f(f),u_transition:new n.Uniform1f(f),u_fadeout_range:new n.Uniform1f(f),u_color:new n.Uniform4f(f),u_high_color:new n.Uniform4f(f),u_space_color:new n.Uniform4f(f),u_star_intensity:new n.Uniform1f(f),u_star_density:new n.Uniform1f(f),u_star_size:new n.Uniform1f(f),u_temporal_offset:new n.Uniform1f(f),u_horizon_angle:new n.Uniform1f(f),u_rotation_matrix:new n.UniformMatrix4f(f)})},Th;function Qu(f,c,h,g,y,x,I){let D=f.context,O=D.gl,z=f.transform,F=f.useProgram("collisionBox"),U=[],X=0,J=0;for(let ue=0;ue<g.length;ue++){let ye=g[ue],xe=c.getTile(ye),be=xe.getBucket(h);if(!be)continue;let De=Ho(ye,be,z),Ie=De;y[0]===0&&y[1]===0||(Ie=f.translatePosMatrix(De,xe,y,x));let Re=I?be.textCollisionBox:be.iconCollisionBox,nt=be.collisionCircleArray;
1311if(nt.length>0){let Ae=n.create(),Ze=Ie;n.mul(Ae,be.placementInvProjMatrix,z.glCoordMatrix),n.mul(Ae,Ae,be.placementViewportMatrix),U.push({circleArray:nt,circleOffset:J,transform:Ze,invTransform:Ae,projection:be.getProjection()}),X+=nt.length/4,J=X}Re&&(f.terrain&&f.terrain.setupElevationDraw(xe,F),F.draw(D,O.LINES,n.DepthMode.disabled,n.StencilMode.disabled,f.colorModeForRenderPass(),n.CullFaceMode.disabled,ym(Ie,z,xe,be.getProjection()),h.id,Re.layoutVertexBuffer,Re.indexBuffer,Re.segments,null,z.zoom,null,[Re.collisionVertexBuffer,Re.collisionVertexBufferExt]))}if(!I||!U.length)return;let te=f.useProgram("collisionCircle"),ee=new n.StructArrayLayout2f1f2i16;ee.resize(4*X),ee._trim();let ne=0;for(let ue of U)for(let ye=0;ye<ue.circleArray.length/4;ye++){let xe=4*ye,be=ue.circleArray[xe+0],De=ue.circleArray[xe+1],Ie=ue.circleArray[xe+2],Re=ue.circleArray[xe+3];ee.emplace(ne++,be,De,Ie,Re,0),ee.emplace(ne++,be,De,Ie,Re,1),ee.emplace(ne++,be,De,Ie,Re,2),ee.emplace(ne++,be,De,Ie,Re,3)}(!Th||Th.length<2*X)&&(Th=function(ue){let ye=2*ue,xe=new n.StructArrayLayout3ui6;xe.resize(ye),xe._trim();for(let be=0;be<ye;be++){let De=6*be;xe.uint16[De+0]=4*be+0,xe.uint16[De+1]=4*be+1,xe.uint16[De+2]=4*be+2,xe.uint16[De+3]=4*be+2,xe.uint16[De+4]=4*be+3,xe.uint16[De+5]=4*be+0}return xe}(X));let H=D.createIndexBuffer(Th,!0),Q=D.createVertexBuffer(ee,n.collisionCircleLayout.members,!0);for(let ue of U){let ye={u_matrix:ue.transform,u_inv_matrix:ue.invTransform,u_camera_to_center_distance:(le=z).getCameraToCenterDistance(ue.projection),u_viewport_size:[le.width,le.height]};te.draw(D,O.TRIANGLES,n.DepthMode.disabled,n.StencilMode.disabled,f.colorModeForRenderPass(),n.CullFaceMode.disabled,ye,h.id,Q,H,n.SegmentVector.simpleSegment(0,2*ue.circleOffset,ue.circleArray.length,ue.circleArray.length/2),null,z.zoom)}var le;Q.destroy(),H.destroy()}let L0=n.create();function Sm({width:f,height:c,anchor:h,textOffset:g,textScale:y},x){let{horizontalAlign:I,verticalAlign:D}=n.getAnchorAlignment(h),O=-(I-.5)*f,z=-(D-.5)*c,F=n.evaluateVariableOffset(h,g);return new n.Point((O/y+F[0])*x,(z/y+F[1])*x)}function U1(f,c,h,g,y,x,I,D,O,z,F){let U=f.text.placedSymbolArray,X=f.text.dynamicLayoutVertexArray,J=f.icon.dynamicLayoutVertexArray,te={},ee=f.getProjection(),ne=Fn(D,ee,x),H=x.elevation,Q=ee.upVectorScale(D.canonical,x.center.lat,x.worldSize).metersToTile;X.clear();for(let le=0;le<U.length;le++){let ue=U.get(le),{tileAnchorX:ye,tileAnchorY:xe,numGlyphs:be}=ue,De=ue.hidden||!ue.crossTileID||f.allowVerticalPlacement&&!ue.placedOrientation?null:g[ue.crossTileID];if(De){let Ie=0,Re=0,nt=0;if(H){let lt=H?H.getAtTileOffset(D,ye,xe):0,[zt,oi,Ot]=ee.upVector(D.canonical,ye,xe);Ie=lt*zt*Q,Re=lt*oi*Q,nt=lt*Ot*Q}let[Ae,Ze,Ne,it]=Ir(ue.projectedAnchorX+Ie,ue.projectedAnchorY+Re,ue.projectedAnchorZ+nt,h?ne:I),Oe=x0(x.getCameraToCenterDistance(ee),it),qe=y.evaluateSizeForFeature(f.textSizeData,z,ue)*Oe/n.ONE_EM;h&&(qe*=f.tilePixelRatio/O);let ot=Sm(De,qe);h?({x:Ae,y:Ze,z:Ne}=ee.projectTilePoint(ye+ot.x,xe+ot.y,D.canonical),[Ae,Ze,Ne]=Ir(Ae+Ie,Ze+Re,Ne+nt,I)):(c&&ot._rotate(-x.angle),Ae+=ot.x,Ze+=ot.y,Ne=0);let Je=f.allowVerticalPlacement&&ue.placedOrientation===n.WritingMode.vertical?Math.PI/2:0;for(let lt=0;lt<be;lt++)n.addDynamicAttributes(X,Ae,Ze,Ne,Je);F&&ue.associatedIconIndex>=0&&(te[ue.associatedIconIndex]={x:Ae,y:Ze,z:Ne,angle:Je})}else ls(be,X)}if(F){J.clear();let le=f.icon.placedSymbolArray;for(let ue=0;ue<le.length;ue++){let ye=le.get(ue),{numGlyphs:xe}=ye,be=te[ue];if(ye.hidden||!be)ls(xe,J);else{let{x:De,y:Ie,z:Re,angle:nt}=be;for(let Ae=0;Ae<xe;Ae++)n.addDynamicAttributes(J,De,Ie,Re,nt)}}f.icon.dynamicLayoutVertexBuffer.updateData(J)}f.text.dynamicLayoutVertexBuffer.updateData(X)}function Tm(f,c,h){return h.iconsInText&&c?"symbolTextAndIcon":f?"symbolSDF":"symbolIcon"}function F0(f,c,h,g,y,x,I,D,O,z,F,U){let X=f.context,J=X.gl,te=f.transform,ee=D==="map",ne=O==="map",H=ee&&h.layout.get("symbol-placement")!=="point",Q=ee&&!ne&&!H,le=h.layout.get("symbol-sort-key").constantOr(1)!==void 0,ue=!1,ye=f.depthModeForSublayer(0,n.DepthMode.ReadOnly),xe=[n.mercatorXfromLng(te.center.lng),n.mercatorYfromLat(te.center.lat)],be=h.layout.get("text-variable-anchor"),De=te.projection.name==="globe",Ie
1311=[],Re=[0,-1,0],nt=Re;!De&&!te.mercatorFromTransition||ee||(nt=function(Ae){let Ze=Ae._camera.getWorldToCamera(Ae.worldSize,1),Ne=n.multiply([],Ze,Ae.globeMatrix);n.invert(Ne,Ne);let it=[0,0,0],Oe=[0,1,0,0];return n.transformMat4$1(Oe,Oe,Ne),it[0]=Oe[0],it[1]=Oe[1],it[2]=Oe[2],n.normalize(it,it),it}(te));for(let Ae of g){let Ze=c.getTile(Ae),Ne=Ze.getBucket(h);if(!Ne||Ne.projection.name==="mercator"&&De)continue;let it=y?Ne.text:Ne.icon;if(!it||Ne.fullyClipped||!it.segments.get().length)continue;let Oe=it.programConfigurations.get(h.id),qe=y||Ne.sdfIcons,ot=y?Ne.textSizeData:Ne.iconSizeData,Je=ne||te.pitch!==0,lt=n.evaluateSizeForZoom(ot,te.zoom),zt,oi,Ot,Gt,Mi=[0,0],Ci=null;if(y)oi=Ze.glyphAtlasTexture,Ot=J.LINEAR,zt=Ze.glyphAtlasTexture.size,Ne.iconsInText&&(Mi=Ze.imageAtlasTexture.size,Ci=Ze.imageAtlasTexture,Gt=Je||f.options.rotating||f.options.zooming||ot.kind==="composite"||ot.kind==="camera"?J.LINEAR:J.NEAREST);else{let ma=h.layout.get("icon-size").constantOr(0)!==1||Ne.iconsNeedLinear;oi=Ze.imageAtlasTexture,Ot=qe||f.options.rotating||f.options.zooming||ma||Je?J.LINEAR:J.NEAREST,zt=Ze.imageAtlasTexture.size}let Nt=Ne.projection.name==="globe",an=Nt?nt:Re,gn=Nt?n.globeToMercatorTransition(te.zoom):0,_n=Fn(Ae,Ne.getProjection(),te),vn=te.calculatePixelsToTileUnitsMatrix(Ze),Xr=Ue(_n,Ze.tileID.canonical,ne,ee,te,Ne.getProjection(),vn),Mr=f.terrain&&ne&&H?n.invert(n.create(),Xr):L0,Wo=lr(_n,Ze.tileID.canonical,ne,ee,te,Ne.getProjection(),vn),Ls=be&&Ne.hasTextData(),Nn=h.layout.get("icon-text-fit")!=="none"&&Ls&&Ne.hasIconData();if(H){let ma=te.elevation,Ua=ma?ma.getAtTileOffsetFunc(Ae,te.center.lat,te.worldSize,Ne.getProjection()):null,Bl=aa(_n,Ze.tileID.canonical,ne,ee,te,Ne.getProjection(),vn);Qf(Ne,_n,f,y,Bl,Wo,ne,z,Ua,Ae)}
1311let yn=H||y&&be||Nn,Qi=f.translatePosMatrix(_n,Ze,x,I),cr=yn?L0:Xr,co=f.translatePosMatrix(Wo,Ze,x,I,!0),On=Ne.getProjection().createInversionMatrix(te,Ae.canonical),_o=[];f.terrainRenderModeElevated()&&ne&&_o.push("PITCH_WITH_MAP_TERRAIN"),Nt&&_o.push("PROJECTION_GLOBE_VIEW"),yn&&_o.push("PROJECTED_POS_ON_VIEWPORT");let Uh=qe&&h.paint.get(y?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Vl;Vl=qe?Ne.iconsInText?R0(ot.kind,lt,Q,ne,f,Qi,cr,co,zt,Mi,Ae,gn,xe,On,an,Ne.getProjection()):Sh(ot.kind,lt,Q,ne,f,Qi,cr,co,y,zt,!0,Ae,gn,xe,On,an,Ne.getProjection()):wm(ot.kind,lt,Q,ne,f,Qi,cr,co,y,zt,Ae,gn,xe,On,an,Ne.getProjection());let cd={program:f.useProgram(Tm(qe,y,Ne),Oe,_o),buffers:it,uniformValues:Vl,atlasTexture:oi,atlasTextureIcon:Ci,atlasInterpolation:Ot,atlasInterpolationIcon:Gt,isSDF:qe,hasHalo:Uh,tile:Ze,labelPlaneMatrixInv:Mr};if(le&&Ne.canOverlap){ue=!0;let ma=it.segments.get();for(let Ua of ma)Ie.push({segments:new n.SegmentVector([Ua]),sortKey:Ua.sortKey,state:cd})}else Ie.push({segments:it.segments,sortKey:0,state:cd})}ue&&Ie.sort((Ae,Ze)=>Ae.sortKey-Ze.sortKey);for(let Ae of Ie){let Ze=Ae.state;if(f.terrain&&f.terrain.setupElevationDraw(Ze.tile,Ze.program,{useDepthForOcclusion:!De,labelPlaneMatrixInv:Ze.labelPlaneMatrixInv}),X.activeTexture.set(J.TEXTURE0),Ze.atlasTexture.bind(Ze.atlasInterpolation,J.CLAMP_TO_EDGE),Ze.atlasTextureIcon&&(X.activeTexture.set(J.TEXTURE1),Ze.atlasTextureIcon&&Ze.atlasTextureIcon.bind(Ze.atlasInterpolationIcon,J.CLAMP_TO_EDGE)),Ze.isSDF){let Ne=Ze.uniformValues;Ze.hasHalo&&(Ne.u_is_halo=1,Ju(Ze.buffers,Ae.segments,h,f,Ze.program,ye,F,U,Ne)),Ne.u_is_halo=0}Ju(Ze.buffers,Ae.segments,h,f,Ze.program,ye,F,U,Ze.uniformValues)}}function Ju(f,c,h,g,y,x,I,D,O){let z=g.context,F=[f.dynamicLayoutVertexBuffer,f.opacityVertexBuffer,f.globeExtVertexBuffer];y.draw(z,z.gl.TRIANGLES,x,I,D,n.CullFaceMode.disabled,O,h.id,f.layoutVertexBuffer,f.indexBuffer,c,h.paint,g.transform.zoom,f.programConfigurations.get(h.id),F)}function N0(f,c,h,g,y,x,I){let D=f.context.gl,O=h.paint.get("fill-pattern"),z=O&&O.constantOr(1),F,U,X,J,te;I?(U=z&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",F=D.LINES):(U=z?"fillPattern":"fill",F=D.TRIANGLES);for(let ee of g){let ne=c.getTile(ee);if(z&&!ne.patternsLoaded())continue;let H=ne.getBucket(h);if(!H)continue;f.prepareDrawTile();let Q=H.programConfigurations.get(h.id),le=f.useProgram(U,Q);z&&(f.context.activeTexture.set(D.TEXTURE0),ne.imageAtlasTexture.bind(D.LINEAR,D.CLAMP_TO_EDGE),Q.updatePaintBuffers());let ue=O.constantOr(null);if(ue&&ne.imageAtlas){let xe=ne.imageAtlas.patternPositions[ue.toString()];xe&&Q.setConstantPatternPositions(xe)}let ye=f.translatePosMatrix(ee.projMatrix,ne,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(I){J=H.indexBuffer2,te=H.segments2;let xe=f.terrain&&f.terrain.renderingToTexture?f.terrain.drapeBufferSize:[D.drawingBufferWidth,D.drawingBufferHeight];X=U==="fillOutlinePattern"&&z?z1(ye,f,ne,xe):N1(ye,xe)}else J=H.indexBuffer,te=H.segments,X=z?gm(ye,f,ne):Fl(ye);f.prepareDrawProgram(f.context,le,ee.toUnwrapped()),le.draw(f.context,F,y,f.stencilModeForClipping(ee),x,n.CullFaceMode.disabled,X,h.id,H.layoutVertexBuffer,J,te,h.paint,f.transform.zoom,Q)}}function Ih(f,c,h,g,y,x,I){let D=f.context,O=D.gl,z=f.transform,F=h.paint.get("fill-extrusion-pattern"),U=F.constantOr(1),X=h.paint.get("fill-extrusion-opacity"),J=[h.paint.get("fill-extrusion-ambient-occlusion-intensity"),h.paint.get("fill-extrusion-ambient-occlusion-radius")],te=h.layout.get("fill-extrusion-edge-radius"),ee=te>0&&!h.paint.get("fill-extrusion-rounded-roof"),ne=ee?0:te,H=z.projection.name==="globe"?n.fillExtrusionHeightLift():0,Q=z.projection.name==="globe",le=Q?n.globeToMercatorTransition(z.zoom):0,ue=[n.mercatorXfromLng(z.center.lng),n.mercatorYfromLat(z.center.lat)],ye=[];Q&&ye.push("PROJECTION_GLOBE_VIEW"),J[0]>0&&ye.push("FAUX_AO"),ee&&ye.push("ZERO_ROOF_RADIUS");for(let xe of g){let be=c.getTile(xe),De=be.getBucket(h);if(!De||De.projection.name!==z.projection.name)continue;let Ie=De.programConfigurations.get(h.id),Re=f.useProgram(U?"fillExtrusionPattern":"fillExtrusion",Ie,ye);
1311if(f.terrain){let qe=f.terrain;if(f.style.terrainSetForDrapingOnly())qe.setupElevationDraw(be,Re,{useMeterToDem:!0});else{if(!De.enableTerrain)continue;if(qe.setupElevationDraw(be,Re,{useMeterToDem:!0}),z0(D,c,xe,De,h,qe),!De.centroidVertexBuffer){let ot=Re.attributes.a_centroid_pos;ot!==void 0&&O.vertexAttrib2f(ot,0,0)}}}U&&(f.context.activeTexture.set(O.TEXTURE0),be.imageAtlasTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE),Ie.updatePaintBuffers());let nt=F.constantOr(null);if(nt&&be.imageAtlas){let qe=be.imageAtlas.patternPositions[nt.toString()];qe&&Ie.setConstantPatternPositions(qe)}let Ae=f.translatePosMatrix(xe.projMatrix,be,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),Ze=z.projection.createInversionMatrix(z,xe.canonical),Ne=h.paint.get("fill-extrusion-vertical-gradient"),it=U?A0(Ae,f,Ne,X,J,ne,xe,be,H,le,ue,Ze):mm(Ae,f,Ne,X,J,ne,xe,H,le,ue,Ze);f.prepareDrawProgram(D,Re,xe.toUnwrapped());let Oe=[];f.terrain&&Oe.push(De.centroidVertexBuffer),Q&&Oe.push(De.layoutVertexExtBuffer),Re.draw(D,D.gl.TRIANGLES,y,x,I,n.CullFaceMode.backCCW,it,h.id,De.layoutVertexBuffer,De.indexBuffer,De.segments,h.paint,f.transform.zoom,Ie,Oe)}}function z0(f,c,h,g,y,x){let I=[H=>{let Q=H.canonical.x-1,le=H.wrap;return Q<0&&(Q=(1<<H.canonical.z)-1,le--),new n.OverscaledTileID(H.overscaledZ,le,H.canonical.z,Q,H.canonical.y)},H=>{let Q=H.canonical.x+1,le=H.wrap;return Q===1<<H.canonical.z&&(Q=0,le++),new n.OverscaledTileID(H.overscaledZ,le,H.canonical.z,Q,H.canonical.y)},H=>new n.OverscaledTileID(H.overscaledZ,H.wrap,H.canonical.z,H.canonical.x,(H.canonical.y===0?1<<H.canonical.z:H.canonical.y)-1),H=>new n.OverscaledTileID(H.overscaledZ,H.wrap,H.canonical.z,H.canonical.x,H.canonical.y===(1<<H.canonical.z)-1?0:H.canonical.y+1)],D=H=>{let Q=c.getSource().minzoom,le=ye=>{let xe=c.getTileByID(ye);if(xe&&xe.hasData())return xe.getBucket(y)},ue=[0,-1,1];for(let ye of ue){if(H.overscaledZ+ye<Q)continue;let xe=le(H.calculateScaledKey(H.overscaledZ+ye));if(xe)return xe}},O=[0,0,0],z=(H,Q)=>(O[0]=Math.min(H.min.y,Q.min.y),O[1]=Math.max(H.max.y,Q.max.y),O[2]=n.EXTENT-Q.min.x>H.max.x?Q.min.x-n.EXTENT:H.max.x,O),F=(H,Q)=>(O[0]=Math.min(H.min.x,Q.min.x),O[1]=Math.max(H.max.x,Q.max.x),O[2]=n.EXTENT-Q.min.y>H.max.y?Q.min.y-n.EXTENT:H.max.y,O),U=[(H,Q)=>z(H,Q),(H,Q)=>z(Q,H),(H,Q)=>F(H,Q),(H,Q)=>F(Q,H)],X=new n.Point(0,0),J,te,ee,ne=(H,Q,le,ue,ye)=>{let xe=[[ue?le:H,ue?H:le,0],[ue?le:Q,ue?Q:le,0]],be=ye<0?n.EXTENT+ye:ye,De=[ue?be:(H+Q)/2,ue?(H+Q)/2:be,0];return le===0&&ye<0||le!==0&&ye>0?x.getForTilePoints(ee,[De],!0,te):xe.push(De),x.getForTilePoints(h,xe,!0,J),Math.max(xe[0][2],xe[1][2],De[2])/x.exaggeration()};for(let H=0;H<4;H++){let Q=(H<2?1:5)-H,le=g.borders[H];if(le.length===0)continue;let ue=ee=I[H](h),ye=D(ue);if(!(ye&&ye instanceof n.FillExtrusionBucket&&ye.enableTerrain)||g.borderDoneWithNeighborZ[H]===ye.canonical.z&&ye.borderDoneWithNeighborZ[Q]===g.canonical.z||(te=x.findDEMTileFor(ue),!te||!te.dem))continue;if(!J){let Ie=x.findDEMTileFor(h);if(!Ie||!Ie.dem)return;J=Ie}let xe=ye.borders[Q],be=0,De=ye.borderDoneWithNeighborZ[Q]!==g.canonical.z;if(g.canonical.z===ye.canonical.z){for(let Ie=0;Ie<le.length;Ie++){let Re=g.featuresOnBorder[le[Ie]],nt=Re.borders[H],Ae;for(;be<xe.length&&(Ae=ye.featuresOnBorder[xe[be]],!(Ae.borders[Q][1]>nt[0]+3));)De&&ye.encodeCentroid(void 0,Ae,!1),be++;
1311if(Ae&&be<xe.length){let Ze=be,Ne=0;for(;!(Ae.borders[Q][0]>nt[1]-3)&&(Ne++,++be!==xe.length);)Ae=ye.featuresOnBorder[xe[be]];if(Ae=ye.featuresOnBorder[xe[Ze]],Re.intersectsCount()>1||Ae.intersectsCount()>1||Ne!==1){Ne!==1&&(be=Ze),g.encodeCentroid(void 0,Re,!1),De&&ye.encodeCentroid(void 0,Ae,!1);continue}let it=U[H](Re,Ae),Oe=H%2?n.EXTENT-1:0;X.x=ne(it[0],Math.min(n.EXTENT-1,it[1]),Oe,H<2,it[2]),X.y=0,g.encodeCentroid(X,Re,!1),De&&ye.encodeCentroid(X,Ae,!1)}else g.encodeCentroid(void 0,Re,!1)}g.borderDoneWithNeighborZ[H]=ye.canonical.z,g.needsCentroidUpdate=!0,De&&(ye.borderDoneWithNeighborZ[Q]=g.canonical.z,ye.needsCentroidUpdate=!0)}else{for(let Ie of le)g.encodeCentroid(void 0,g.featuresOnBorder[Ie],!1);if(De){for(let Ie of xe)ye.encodeCentroid(void 0,ye.featuresOnBorder[Ie],!1);ye.borderDoneWithNeighborZ[Q]=g.canonical.z,ye.needsCentroidUpdate=!0}g.borderDoneWithNeighborZ[H]=ye.canonical.z,g.needsCentroidUpdate=!0}}(g.needsCentroidUpdate||!g.centroidVertexBuffer&&g.centroidVertexArray.length!==0)&&g.uploadCentroid(f)}let Dc=new n.Color(1,0,0,1),H1=new n.Color(0,1,0,1),$1=new n.Color(0,0,1,1),G1=new n.Color(1,0,1,1),q1=new n.Color(0,1,1,1);function W1(f,c,h){let g=f.context,y=f.transform,x=g.gl,I=y.projection.name==="globe",D=I?["PROJECTION_GLOBE_VIEW"]:null,O=h.projMatrix;if(I&&n.globeToMercatorTransition(y.zoom)>0){let Re=n.transitionTileAABBinECEF(h.canonical,y),nt=n.globeDenormalizeECEF(Re);O=n.multiply(new Float32Array(16),y.globeMatrix,nt),n.multiply(O,y.projMatrix,O)}let z=f.useProgram("debug",null,D),F=c.getTileByID(h.key);f.terrain&&f.terrain.setupElevationDraw(F,z);let U=n.DepthMode.disabled,X=n.StencilMode.disabled,J=f.colorModeForRenderPass(),te="$debug";g.activeTexture.set(x.TEXTURE0),f.emptyTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),I?F._makeGlobeTileDebugBuffers(f.context,y):F._makeDebugTileBoundsBuffers(f.context,y.projection);let ee=F._tileDebugBuffer||f.debugBuffer,ne=F._tileDebugIndexBuffer||f.debugIndexBuffer,H=F._tileDebugSegments||f.debugSegments;z.draw(g,x.LINE_STRIP,U,X,J,n.CullFaceMode.disabled,Ch(O,n.Color.red),te,ee,ne,H,null,null,null,[F._globeTileDebugBorderBuffer]);let Q=F.latestRawTileData,le=Math.floor((Q&&Q.byteLength||0)/1024),ue=c.getTile(h).tileSize,ye=512/Math.min(ue,512)*(h.overscaledZ/y.zoom)*.5,xe=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(xe+=` => ${h.overscaledZ}`),xe+=` ${le}kb`,function(Re,nt){Re.initDebugOverlayCanvas();let Ae=Re.debugOverlayCanvas,Ze=Re.context.gl,Ne=Re.debugOverlayCanvas.getContext("2d");Ne.clearRect(0,0,Ae.width,Ae.height),Ne.shadowColor="white",Ne.shadowBlur=2,Ne.lineWidth=1.5,Ne.strokeStyle="white",Ne.textBaseline="top",Ne.font="bold 36px Open Sans, sans-serif",Ne.fillText(nt,5,5),Ne.strokeText(nt,5,5),Re.debugOverlayTexture.update(Ae),Re.debugOverlayTexture.bind(Ze.LINEAR,Ze.CLAMP_TO_EDGE)}(f,xe);let be=F._tileDebugTextBuffer||f.debugBuffer,De=F._tileDebugTextIndexBuffer||f.quadTriangleIndexBuffer,Ie=F._tileDebugTextSegments||f.debugSegments;z.draw(g,x.TRIANGLES,U,X,n.ColorMode.alphaBlended,n.CullFaceMode.disabled,Ch(O,n.Color.transparent,ye),te,be,De,Ie,null,null,null,[F._globeTileDebugTextBuffer])}function j0(f,c,h,g){Mc(f,0,c+h/2,f.transform.width,h,g)}function Dh(f,c,h,g){Mc(f,c-h/2,0,h,f.transform.height,g)}function Mc(f,c,h,g,y,x){let I=f.context,D=I.gl;D.enable(D.SCISSOR_TEST),D.scissor(c*n.exported.devicePixelRatio,h*n.exported.devicePixelRatio,g*n.exported.devicePixelRatio,y*n.exported.devicePixelRatio),I.clear({color:x}),D.disable(D.SCISSOR_TEST)}let V0=n.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:B0}=V0;function pa(f,c,h,g){f.emplaceBack(c,h,g)}class Mh{constructor(c){this.vertexArray=new n.StructArrayLayout3f12,this.indices=new n.StructArrayLayout3ui6,pa(this.vertexArray,-1,-1,1),pa(this.vertexArray,1,-1,1),pa(this.vertexArray,-1,1,1),pa(this.vertexArray,1,1,1),pa(this.vertexArray,-1,-1,-1),pa(this.vertexArray,1,-1,-1),pa(this.vertexArray,-1,1,-1),pa(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=c.createVertexBuffer(this.vertexArray,B0),this.indexBuffer=c.createIndexBuffer(this.indices),this.segment=n.SegmentVector.simpleSegment(0,0,36,12)}}function Go(f,c,h,g,y,x){let I=f.gl,D=c.paint.get("sky-atmosphere-color"),O=c.paint.get("sky-atmosphere-halo-color"),z=c.paint.get("sky-atmosphere-sun-intensity"),F=((U,X,J,te,ee)=>({u_matrix_3f:U,u_sun_direction:X,u_sun_intensity:J,u_color_tint_r:[te.r,te.g,te.b,te.a],u_color_tint_m:[ee.r,ee.g,ee.b,ee.a],u_luminance:5e-5}))(n.fromMat4(n.create$1(),g),y,z,D,O);I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_CUBE_MAP_POSITIVE_X+x,c.skyboxTexture,0),h.draw(f,I.TRIANGLES,n.DepthMode.disabled,n.StencilMode.disabled,n.ColorMode.unblended,n.CullFaceMode.frontCW,F,"skyboxCapture",c.skyboxGeometry.vertexBuffer,c.skyboxGeometry.indexBuffer,c.skyboxGeometry.segment)}let ed=n.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class U0{constructor(c){let h=new n.StructArrayLayout5f20;h.emplaceBack(-1,1,1,0,0),h.emplaceBack(1,1,1,1,0),h.emplaceBack(1,-1,1,1,1),h.emplaceBack(-1,-1,1,0,1);let g=new n.StructArrayLayout3ui6;g.emplaceBack(0,1,2),g.emplaceBack(2,3,0),this.vertexBuffer=c.createVertexBuffer(h,ed.members),this.indexBuffer=c.createIndexBuffer(g),this.segments=n.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}let Nl={symbol:function(f,c,h,g,y){if(f.renderPass!=="translucent")return;let x=n.StencilMode.disabled,I=f.colorModeForRenderPass();h.layout.get("text-variable-anchor")&&function(D,O,z,F,U,X,J){let te=O.transform,ee=U==="map",ne=X==="map";for(let H of D){let Q=F.getTile(H),le=Q.getBucket(z);if(!le||!le.text||!le.text.segments.get().length)continue;let ue=n.evaluateSizeForZoom(le.textSizeData,te.zoom),ye=Fn(H,le.getProjection(),te),xe=te.calculatePixelsToTileUnitsMatrix(Q),be=Ue(ye,Q.tileID.canonical,ne,ee,te,le.getProjection(),xe),De=z.layout.get("icon-text-fit")!=="none"&&le.hasIconData();
1311if(ue){let Ie=Math.pow(2,te.zoom-Q.tileID.overscaledZ);U1(le,ee,ne,J,n.symbolSize,te,be,H,Ie,ue,De)}}}(g,f,h,c,h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),y),h.paint.get("icon-opacity").constantOr(1)!==0&&F0(f,c,h,g,!1,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),h.layout.get("icon-rotation-alignment"),h.layout.get("icon-pitch-alignment"),h.layout.get("icon-keep-upright"),x,I),h.paint.get("text-opacity").constantOr(1)!==0&&F0(f,c,h,g,!0,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),h.layout.get("text-rotation-alignment"),h.layout.get("text-pitch-alignment"),h.layout.get("text-keep-upright"),x,I),c.map.showCollisionBoxes&&(Qu(f,c,h,g,h.paint.get("text-translate"),h.paint.get("text-translate-anchor"),!0),Qu(f,c,h,g,h.paint.get("icon-translate"),h.paint.get("icon-translate-anchor"),!1))},circle:function(f,c,h,g){if(f.renderPass!=="translucent")return;let y=h.paint.get("circle-opacity"),x=h.paint.get("circle-stroke-width"),I=h.paint.get("circle-stroke-opacity"),D=h.layout.get("circle-sort-key").constantOr(1)!==void 0;if(y.constantOr(1)===0&&(x.constantOr(1)===0||I.constantOr(1)===0))return;let O=f.context,z=O.gl,F=f.transform,U=f.depthModeForSublayer(0,n.DepthMode.ReadOnly),X=n.StencilMode.disabled,J=f.colorModeForRenderPass(),te=F.projection.name==="globe",ee=[n.mercatorXfromLng(F.center.lng),n.mercatorYfromLat(F.center.lat)],ne=[];for(let Q=0;Q<g.length;Q++){let le=g[Q],ue=c.getTile(le),ye=ue.getBucket(h);if(!ye||ye.projection.name!==F.projection.name)continue;let xe=ye.programConfigurations.get(h.id),be=vm(h);te&&be.push("PROJECTION_GLOBE_VIEW");let De=f.useProgram("circle",xe,be),Ie=ye.layoutVertexBuffer,Re=ye.globeExtVertexBuffer,nt=ye.indexBuffer,Ae=F.projection.createInversionMatrix(F,le.canonical),Ze={programConfiguration:xe,program:De,layoutVertexBuffer:Ie,globeExtVertexBuffer:Re,indexBuffer:nt,uniformValues:_m(f,le,ue,Ae,ee,h),tile:ue};if(D){let Ne=ye.segments.get();for(let it of Ne)ne.push({segments:new n.SegmentVector([it]),sortKey:it.sortKey,state:Ze})}else ne.push({segments:ye.segments,sortKey:0,state:Ze})}D&&ne.sort((Q,le)=>Q.sortKey-le.sortKey);let H={useDepthForOcclusion:!te};for(let Q of ne){let{programConfiguration:le,program:ue,layoutVertexBuffer:ye,globeExtVertexBuffer:xe,indexBuffer:be,uniformValues:De,tile:Ie}=Q.state,Re=Q.segments;f.terrain&&f.terrain.setupElevationDraw(Ie,ue,H),f.prepareDrawProgram(O,ue,Ie.tileID.toUnwrapped()),ue.draw(O,z.TRIANGLES,U,X,J,n.CullFaceMode.disabled,De,h.id,ye,be,Re,h.paint,F.zoom,le,[xe])}},heatmap:function(f,c,h,g){if(h.paint.get("heatmap-opacity")!==0)if(f.renderPass==="offscreen"){let y=f.context,x=y.gl,I=n.StencilMode.disabled,D=new n.ColorMode([x.ONE,x.ONE],n.Color.transparent,[!0,!0,!0,!0]);(function(J,te,ee,ne){let H=J.gl,Q=te.width*ne,le=te.height*ne;J.activeTexture.set(H.TEXTURE1),J.viewport.set([0,0,Q,le]);let ue=ee.heatmapFbo;if(!ue||ue&&(ue.width!==Q||ue.height!==le)){ue&&ue.destroy();let ye=H.createTexture();H.bindTexture(H.TEXTURE_2D,ye),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,H.LINEAR),ue=ee.heatmapFbo=J.createFramebuffer(Q,le,!1),function(xe,be,De,Ie,Re,nt){let Ae=xe.gl;Ae.texImage2D(Ae.TEXTURE_2D,0,xe.isWebGL2&&xe.extRenderToTextureHalfFloat?Ae.RGBA16F:Ae.RGBA,Re,nt,0,Ae.RGBA,xe.extRenderToTextureHalfFloat?xe.isWebGL2?Ae.HALF_FLOAT:xe.extTextureHalfFloat.HALF_FLOAT_OES:Ae.UNSIGNED_BYTE,null),Ie.colorAttachment.set(De)}(J,0,ye,ue,Q,le)}else H.bindTexture(H.TEXTURE_2D,ue.colorAttachment.get()),J.bindFramebuffer.set(ue.framebuffer)})(y,f,h,f.transform.projection.name==="globe"?.5:.25),y.clear({color:n.Color.transparent});let O=f.transform,z=O.projection.name==="globe",F=z?["PROJECTION_GLOBE_VIEW"]:null,U=z?n.CullFaceMode.frontCCW:n.CullFaceMode.disabled,X=[n.mercatorXfromLng(O.center.lng),n.mercatorYfromLat(O.center.lat)];for(let J=0;J<g.length;J++){let te=g[J];if(c.hasRenderableParent(te))continue;let ee=c.getTile(te),ne=ee.getBucket(h);if(!ne||ne.projection.name!==O.projection.name)continue;let H=ne.programConfigurations.get(h.id),Q=f.useProgram("heatmap",H,F),{zoom:le}=f.transform;f.terrain&&f.terrain.setupElevationDraw(ee,Q),f.prepareDrawProgram(y,Q,te.toUnwrapped());let ue=O.projection.createInversionMatrix(O,te.canonical);Q.draw(y,x.TRIANGLES,n.DepthMode.disabled,I,D,U,O0(f,te,ee,ue,X,le,h.paint.get("heatmap-intensity")),h.id,ne.layoutVertexBuffer,ne.indexBuffer,ne.segments,h.paint,f.transform.zoom,H,z?[ne.globeExtVertexBuffer]:null)}y.viewport.set([0,0,f.width,f.height])}else f.renderPass==="translucent"&&(f.context.setColorMode(f.colorModeForRenderPass()),function(y,x){let I=y.context,D=I.gl,O=x.heatmapFbo;if(!O)return;I.activeTexture.set(D.TEXTURE0),D.bindTexture(D.TEXTURE_2D,O.colorAttachment.get()),I.activeTexture.set(D.TEXTURE1);let z=x.colorRampTexture;z||(z=x.colorRampTexture=new n.Texture(I,x.colorRamp,D.RGBA)),z.bind(D.LINEAR,D.CLAMP_TO_EDGE),y.useProgram("heatmapTexture").draw(I,D.TRIANGLES,n.DepthMode.disabled,n.StencilMode.disabled,y.colorModeForRenderPass(),n.CullFaceMode.disabled,((F,U,X,J)=>({u_image:0,u_color_ramp:1,u_opacity:U.paint.get("heatmap-opacity")}))(0,x),x.id,y.viewportBuffer,y.quadTriangleIndexBuffer,y.viewportSegments,x.paint,y.transform.zoom)}(f,h))},line:function(f,c,h,g){if(f.renderPass!=="translucent")return;let y=h.paint.get("line-opacity"),x=h.paint.get("line-width");if(y.constantOr(1)===0||x.constantOr(1)===0)return;let I=f.depthModeForSublayer(0,n.DepthMode.ReadOnly),D=f.colorModeForRenderPass(),O=f.terrain&&f.terrain.renderingToTexture?1:n.exported.devicePixelRatio,z=h.paint.get("line-dasharray"),F=z.constantOr(1),U=h.layout.get("line-cap"),X=h.paint.get("line-pattern"),J=X.
1311constantOr(1),te=h.paint.get("line-gradient"),ee=J?"linePattern":"line",ne=f.context,H=ne.gl,Q=(ue=>{let ye=[];Yu(ue)&&ye.push("RENDER_LINE_DASH"),ue.paint.get("line-gradient")&&ye.push("RENDER_LINE_GRADIENT");let xe=ue.paint.get("line-trim-offset");xe[0]===0&&xe[1]===0||ye.push("RENDER_LINE_TRIM_OFFSET");let be=ue.paint.get("line-pattern").constantOr(1),De=ue.paint.get("line-opacity").constantOr(1)!==1;return!be&&De&&ye.push("RENDER_LINE_ALPHA_DISCARD"),ye})(h),le=Q.includes("RENDER_LINE_ALPHA_DISCARD");f.terrain&&f.terrain.clipOrMaskOverlapStencilType()&&(le=!1);for(let ue of g){let ye=c.getTile(ue);if(J&&!ye.patternsLoaded())continue;let xe=ye.getBucket(h);if(!xe)continue;f.prepareDrawTile();let be=xe.programConfigurations.get(h.id),De=f.useProgram(ee,be,Q),Ie=X.constantOr(null);if(Ie&&ye.imageAtlas){let qe=ye.imageAtlas.patternPositions[Ie.toString()];qe&&be.setConstantPatternPositions(qe)}let Re=z.constantOr(null),nt=U.constantOr(null);if(!J&&Re&&nt&&ye.lineAtlas){let qe=ye.lineAtlas.getDash(Re,nt);qe&&be.setConstantPatternPositions(qe)}let[Ae,Ze]=h.paint.get("line-trim-offset");(nt==="round"||nt==="square")&&Ae!==Ze&&(Ae===0&&(Ae-=1),Ze===1&&(Ze+=1));let Ne=f.terrain?ue.projMatrix:null,it=J?Xu(f,ye,h,Ne,O):V1(f,ye,h,Ne,xe.lineClipsArray.length,O,[Ae,Ze]);if(te){let qe=xe.gradients[h.id],ot=qe.texture;if(h.gradientVersion!==qe.version){let Je=256;if(h.stepInterpolant){let lt=c.getSource().maxzoom,zt=ue.canonical.z===lt?Math.ceil(1<<f.transform.maxZoom-ue.canonical.z):1;Je=n.clamp(n.nextPowerOfTwo(xe.maxLineLength/n.EXTENT*1024*zt),256,ne.maxTextureSize)}qe.gradient=n.renderColorRamp({expression:h.gradientExpression(),evaluationKey:"lineProgress",resolution:Je,image:qe.gradient||void 0,clips:xe.lineClipsArray}),qe.texture?qe.texture.update(qe.gradient):qe.texture=new n.Texture(ne,qe.gradient,H.RGBA),qe.version=h.gradientVersion,ot=qe.texture}ne.activeTexture.set(H.TEXTURE1),ot.bind(h.stepInterpolant?H.NEAREST:H.LINEAR,H.CLAMP_TO_EDGE)}F&&(ne.activeTexture.set(H.TEXTURE0),ye.lineAtlasTexture.bind(H.LINEAR,H.REPEAT),be.updatePaintBuffers()),J&&(ne.activeTexture.set(H.TEXTURE0),ye.imageAtlasTexture.bind(H.LINEAR,H.CLAMP_TO_EDGE),be.updatePaintBuffers()),f.prepareDrawProgram(ne,De,ue.toUnwrapped());let Oe=qe=>{De.draw(ne,H.TRIANGLES,I,qe,D,n.CullFaceMode.disabled,it,h.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,h.paint,f.transform.zoom,be,[xe.layoutVertexBuffer2])};if(le){let qe=f.stencilModeForClipping(ue).ref;qe===0&&f.terrain&&ne.clear({stencil:0});let ot={func:H.EQUAL,mask:255};it.u_alpha_discard_threshold=.8,Oe(new n.StencilMode(ot,qe,255,H.KEEP,H.KEEP,H.INVERT)),it.u_alpha_discard_threshold=0,Oe(new n.StencilMode(ot,qe,255,H.KEEP,H.KEEP,H.KEEP))}else Oe(f.stencilModeForClipping(ue))}le&&(f.resetStencilClippingMasks(),f.terrain&&ne.clear({stencil:0}))},fill:function(f,c,h,g){let y=h.paint.get("fill-color"),x=h.paint.get("fill-opacity");if(x.constantOr(1)===0)return;let I=f.colorModeForRenderPass(),D=h.paint.get("fill-pattern"),O=f.opaquePassEnabledForLayer()&&!D.constantOr(1)&&y.constantOr(n.Color.transparent).a===1&&x.constantOr(0)===1?"opaque":"translucent";if(f.renderPass===O){let z=f.depthModeForSublayer(1,f.renderPass==="opaque"?n.DepthMode.ReadWrite:n.DepthMode.ReadOnly);N0(f,c,h,g,z,I,!1)}if(f.renderPass==="translucent"&&h.paint.get("fill-antialias")){let z=f.depthModeForSublayer(h.getPaintProperty("fill-outline-color")?2:0,n.DepthMode.ReadOnly);N0(f,c,h,g,z,I,!0)}},"fill-extrusion":function(f,c,h,g){let y=h.paint.get("fill-extrusion-opacity");if(y!==0&&f.renderPass==="translucent"){let x=new n.DepthMode(f.context.gl.LEQUAL,n.DepthMode.ReadWrite,f.depthRangeFor3D);if(y!==1||h.paint.get("fill-extrusion-pattern").constantOr(1))Ih(f,c,h,g,x,n.StencilMode.disabled,n.ColorMode.disabled),Ih(f,c,h,g,x,f.stencilModeFor3D(),f.colorModeForRenderPass()),f.resetStencilClippingMasks();else{let I=f.colorModeForRenderPass();Ih(f,c,h,g,x,n.StencilMode.disabled,I)}}},hillshade:function(f,c,h,g){if(f.renderPass!=="offscreen"&&f.renderPass!=="translucent")return;let y=f.context,x=f.depthModeForSublayer(0,n.DepthMode.ReadOnly),I=f.colorModeForRenderPass(),D=f.terrain&&f.terrain.renderingToTexture,[O,z]=f.renderPass!=="translucent"||D?[{},g]:f.stencilConfigForOverlap(g);for(let F of z){let U=c.getTile(F);if(U.needsHillshadePrepare&&f.renderPass==="offscreen")D0(f,U,h,x,n.StencilMode.disabled,I);else if(f.renderPass==="translucent"){let X=D&&f.terrain?f.terrain.stencilModeForRTTOverlap(F):O[F.overscaledZ];I0(f,F,U,h,x,X,I)}}y.viewport.set([0,0,f.width,f.height]),f.resetStencilClippingMasks()},raster:function(f,c,h,g,y,x){if(f.renderPass!=="translucent"||h.paint.get("raster-opacity")===0||!g.length)return;let I=f.context,D=I.gl,O=c.getSource(),z=f.useProgram("raster"),F=f.colorModeForRenderPass(),U=f.terrain&&f.terrain.renderingToTexture,[X,J]=O instanceof xi||U?[{},g]:f.stencilConfigForOverlap(g),te=J[J.length-1].overscaledZ,ee=!f.options.moving;for(let ne of J){let H=U?n.DepthMode.disabled:f.depthModeForSublayer(ne.overscaledZ-te,h.paint.get("raster-opacity")===1?n.DepthMode.ReadWrite:n.DepthMode.ReadOnly,D.LESS),Q=ne.toUnwrapped(),le=c.getTile(ne);if(U&&(!le||!le.hasData()))continue;let ue=U?ne.projMatrix:f.transform.calculateProjMatrix(Q,ee),ye=f.terrain&&U?f.terrain.stencilModeForRTTOverlap(ne):X[ne.overscaledZ],xe=x?0:h.paint.get("raster-fade-duration");le.registerFadeDuration(xe);let be=c.findLoadedParent(ne,0),De=hm(le,be,c,f.transform,xe),Ie,Re;f.terrain&&f.terrain.prepareDrawTile();let nt=h.paint.get("raster-resampling")==="nearest"?D.NEAREST:D.LINEAR;I.activeTexture.set(D.TEXTURE0),le.texture.bind(nt,D.CLAMP_TO_EDGE),I.activeTexture.set(D.TEXTURE1),be?(be.texture.bind(nt,D.CLAMP_TO_EDGE),Ie=Math.pow(2,be.tileID.overscaledZ-le.tileID.overscaledZ
1311),Re=[le.tileID.canonical.x*Ie%1,le.tileID.canonical.y*Ie%1]):le.texture.bind(nt,D.CLAMP_TO_EDGE),le.texture.useMipmap&&I.extTextureFilterAnisotropic&&f.transform.pitch>20&&D.texParameterf(D.TEXTURE_2D,I.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,I.extTextureFilterAnisotropicMax);let Ae=xm(ue,Re||[0,0],Ie||1,De,h,O instanceof xi?O.perspectiveTransform:[0,0]);if(f.prepareDrawProgram(I,z,Q),O instanceof xi)O.boundsBuffer&&O.boundsSegments&&z.draw(I,D.TRIANGLES,H,n.StencilMode.disabled,F,n.CullFaceMode.disabled,Ae,h.id,O.boundsBuffer,f.quadTriangleIndexBuffer,O.boundsSegments);else{let{tileBoundsBuffer:Ze,tileBoundsIndexBuffer:Ne,tileBoundsSegments:it}=f.getTileBoundsBuffers(le);z.draw(I,D.TRIANGLES,H,ye,F,n.CullFaceMode.disabled,Ae,h.id,Ze,Ne,it)}}f.resetStencilClippingMasks()},background:function(f,c,h,g){let y=h.paint.get("background-color"),x=h.paint.get("background-opacity");if(x===0)return;let I=f.context,D=I.gl,O=f.transform,z=O.tileSize,F=h.paint.get("background-pattern");if(f.isPatternMissing(F))return;let U=!F&&y.a===1&&x===1&&f.opaquePassEnabledForLayer()?"opaque":"translucent";if(f.renderPass!==U)return;let X=n.StencilMode.disabled,J=f.depthModeForSublayer(0,U==="opaque"?n.DepthMode.ReadWrite:n.DepthMode.ReadOnly),te=f.colorModeForRenderPass(),ee=f.useProgram(F?"backgroundPattern":"background"),ne,H=g;H||(ne=f.getBackgroundTiles(),H=Object.values(ne).map(Q=>Q.tileID)),F&&(I.activeTexture.set(D.TEXTURE0),f.imageManager.bind(f.context));for(let Q of H){let le=Q.toUnwrapped(),ue=g?Q.projMatrix:f.transform.calculateProjMatrix(le);f.prepareDrawTile();let ye=c?c.getTile(Q):ne?ne[Q.key]:new n.Tile(Q,z,O.zoom,f),xe=F?B1(ue,x,f,F,{tileID:Q,tileSize:z}):Cm(ue,x,y);f.prepareDrawProgram(I,ee,le);let{tileBoundsBuffer:be,tileBoundsIndexBuffer:De,tileBoundsSegments:Ie}=f.getTileBoundsBuffers(ye);ee.draw(I,D.TRIANGLES,J,X,te,n.CullFaceMode.disabled,xe,h.id,be,De,Ie)}},sky:function(f,c,h){let g=f.transform,y=g.projection.name==="mercator"||g.projection.name==="globe"?1:n.smoothstep(7,8,g.zoom),x=h.paint.get("sky-opacity")*y;if(x===0)return;let I=f.context,D=h.paint.get("sky-type"),O=new n.DepthMode(I.gl.LEQUAL,n.DepthMode.ReadOnly,[0,1]),z=f.frameCounter/1e3%1;D==="atmosphere"?f.renderPass==="offscreen"?h.needsSkyboxCapture(f)&&(function(F,U,X,J){let te=F.context,ee=te.gl,ne=U.skyboxFbo;if(!ne){ne=U.skyboxFbo=te.createFramebuffer(32,32,!1),U.skyboxGeometry=new Mh(te),U.skyboxTexture=te.gl.createTexture(),ee.bindTexture(ee.TEXTURE_CUBE_MAP,U.skyboxTexture),ee.texParameteri(ee.TEXTURE_CUBE_MAP,ee.TEXTURE_WRAP_S,ee.CLAMP_TO_EDGE),ee.texParameteri(ee.TEXTURE_CUBE_MAP,ee.TEXTURE_WRAP_T,ee.CLAMP_TO_EDGE),ee.texParameteri(ee.TEXTURE_CUBE_MAP,ee.TEXTURE_MIN_FILTER,ee.LINEAR),ee.texParameteri(ee.TEXTURE_CUBE_MAP,ee.TEXTURE_MAG_FILTER,ee.LINEAR);for(let ue=0;ue<6;++ue)ee.texImage2D(ee.TEXTURE_CUBE_MAP_POSITIVE_X+ue,0,ee.RGBA,32,32,0,ee.RGBA,ee.UNSIGNED_BYTE,null)}te.bindFramebuffer.set(ne.framebuffer),te.viewport.set([0,0,32,32]);let H=U.getCenter(F,!0),Q=F.useProgram("skyboxCapture"),le=new Float64Array(16);n.identity(le),n.rotateY(le,le,.5*-Math.PI),Go(te,U,Q,le,H,0),n.identity(le),n.rotateY(le,le,.5*Math.PI),Go(te,U,Q,le,H,1),n.identity(le),n.rotateX(le,le,.5*-Math.PI),Go(te,U,Q,le,H,2),n.identity(le),n.rotateX(le,le,.5*Math.PI),Go(te,U,Q,le,H,3),n.identity(le),Go(te,U,Q,le,H,4),n.identity(le),n.rotateY(le,le,Math.PI),Go(te,U,Q,le,H,5),te.viewport.set([0,0,F.width,F.height])}(f,h),h.markSkyboxValid(f)):f.renderPass==="sky"&&function(F,U,X,J,te){let ee=F.context,ne=ee.gl,H=F.transform,Q=F.useProgram("skybox");ee.activeTexture.set(ne.TEXTURE0),ne.bindTexture(ne.TEXTURE_CUBE_MAP,U.skyboxTexture);let le=((ue,ye,xe,be,De)=>({u_matrix:ue,u_sun_direction:ye,u_cubemap:0,u_opacity:be,u_temporal_offset:De}))(H.skyboxMatrix,U.getCenter(F,!1),0,J,te);F.prepareDrawProgram(ee,Q),Q.draw(ee,ne.TRIANGLES,X,n.StencilMode.disabled,F.colorModeForRenderPass(),n.CullFaceMode.backCW,le,"skybox",U.skyboxGeometry.vertexBuffer,U.skyboxGeometry.indexBuffer,U.skyboxGeometry.segment)}(f,h,O,x,z):D==="gradient"&&f.renderPass==="sky"&&function(F,U,X,J,te){let ee=F.context,ne=ee.gl,H=F.transform,Q=F.useProgram("skyboxGradient");U.skyboxGeometry||(U.skyboxGeometry=new Mh(ee)),ee.activeTexture.set(ne.TEXTURE0);let le=U.colorRampTexture;le||(le=U.colorRampTexture=new n.Texture(ee,U.colorRamp,ne.RGBA)),le.bind(ne.LINEAR,ne.CLAMP_TO_EDGE);let ue=((ye,xe,be,De,Ie)=>({u_matrix:ye,u_color_ramp:0,u_center_direction:xe,u_radius:n.degToRad(be),u_opacity:De,u_temporal_offset:Ie}))(H.skyboxMatrix,U.getCenter(F,!1),U.paint.get("sky-gradient-radius"),J,te);F.prepareDrawProgram(ee,Q),Q.draw(ee,ne.TRIANGLES,X,n.StencilMode.disabled,F.colorModeForRenderPass(),n.CullFaceMode.backCW,ue,"skyboxGradient",U.skyboxGeometry.vertexBuffer,
1311U.skyboxGeometry.indexBuffer,U.skyboxGeometry.segment)}(f,h,O,x,z)},debug:function(f,c,h){for(let g=0;g<h.length;g++)W1(f,c,h[g])},custom:function(f,c,h,g){let y=f.context,x=h.implementation;if(!f.transform.projection.unsupportedLayers||!f.transform.projection.unsupportedLayers.includes("custom")||f.terrain&&(f.terrain.renderingToTexture||f.renderPass==="offscreen")&&h.isLayerDraped()){if(f.renderPass==="offscreen"){let I=x.prerender;if(I){if(f.setCustomLayerDefaults(),y.setColorMode(f.colorModeForRenderPass()),f.transform.projection.name==="globe"){let D=f.transform.pointMerc;I.call(x,y.gl,f.transform.customLayerMatrix(),f.transform.getProjection(),f.transform.globeToMercatorMatrix(),n.globeToMercatorTransition(f.transform.zoom),[D.x,D.y],f.transform.pixelsPerMeterRatio)}else I.call(x,y.gl,f.transform.customLayerMatrix());y.setDirty(),f.setBaseState()}}else if(f.renderPass==="translucent"){if(f.terrain&&f.terrain.renderingToTexture){let D=x.renderToTile;if(D){let O=g[0].canonical,z=new n.MercatorCoordinate(O.x+g[0].wrap*(1<<O.z),O.y,O.z);y.setDepthMode(n.DepthMode.disabled),y.setStencilMode(n.StencilMode.disabled),y.setColorMode(f.colorModeForRenderPass()),f.setCustomLayerDefaults(),D.call(x,y.gl,z),y.setDirty(),f.setBaseState()}return}f.setCustomLayerDefaults(),y.setColorMode(f.colorModeForRenderPass()),y.setStencilMode(n.StencilMode.disabled);let I=x.renderingMode==="3d"?new n.DepthMode(f.context.gl.LEQUAL,n.DepthMode.ReadWrite,f.depthRangeFor3D):f.depthModeForSublayer(0,n.DepthMode.ReadOnly);if(y.setDepthMode(I),f.transform.projection.name==="globe"){let D=f.transform.pointMerc;x.render(y.gl,f.transform.customLayerMatrix(),f.transform.getProjection(),f.transform.globeToMercatorMatrix(),n.globeToMercatorTransition(f.transform.zoom),[D.x,D.y],f.transform.pixelsPerMeterRatio)}else x.render(y.gl,f.transform.customLayerMatrix());y.setDirty(),f.setBaseState(),y.bindFramebuffer.set(null)}}else n.warnOnce("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")}};class kc{constructor(c,h,g=!1){this.context=new ft(c,g),this.transform=h,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=n.SourceCache.maxUnderzooming+n.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={}}updateTerrain(c,h){let g=!!c&&!!c.terrain&&this.transform.projection.supportsTerrain;if(!(g||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new fm(this,c));let y=this._terrain;this.transform.elevation=g?y:null,y.update(c,this.transform,h)}_updateFog(c){let h=c.fog;if(!h||this.transform.projection.name==="globe"||h.getOpacity(this.transform.pitch)<1||h.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);let[g,y]=h.getFovAdjustedRange(this.transform._fov);if(g>y)return void(this.transform.fogCullDistSq=null);let x=g+.78*(y-g);this.transform.fogCullDistSq=x*x}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(c,h){if(this.width=c*n.exported.devicePixelRatio,this.height=h*n.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let g of this.style.order)this.style._layers[g].resize()}setup(){let c=this.context,h=new n.StructArrayLayout2i4;h.emplaceBack(0,0),h.emplaceBack(n.EXTENT,0),h.emplaceBack(0,n.EXTENT),h.emplaceBack(n.EXTENT,n.EXTENT),this.tileExtentBuffer=c.createVertexBuffer(h,n.posAttributes.members),this.tileExtentSegments=n.SegmentVector.simpleSegment(0,0,4,2);let g=new n.StructArrayLayout2i4;g.emplaceBack(0,0),g.emplaceBack(n.EXTENT,0),g.emplaceBack(0,n.EXTENT),g.emplaceBack(n.EXTENT,n.EXTENT),this.debugBuffer=c.createVertexBuffer(g,n.posAttributes.members),this.debugSegments=n.SegmentVector.simpleSegment(0,0,4,5);let y=new n.StructArrayLayout2i4;y.emplaceBack(-1,-1),y.emplaceBack(1,-1),y.emplaceBack(-1,1),y.emplaceBack(1,1),this.viewportBuffer=c.createVertexBuffer(y,n.posAttributes.members),this.viewportSegments=n.SegmentVector.simpleSegment(0,0,4,2);let x=new n.StructArrayLayout4i8;x.emplaceBack(0,0,0,0),x.emplaceBack(n.EXTENT,0,n.EXTENT,0),x.emplaceBack(0,n.EXTENT,0,n.EXTENT),x.emplaceBack(n.EXTENT,n.EXTENT,n.EXTENT,n.EXTENT),this.mercatorBoundsBuffer=c.createVertexBuffer(x,n.boundsAttributes.members),this.mercatorBoundsSegments=n.SegmentVector.simpleSegment(0,0,4,2);let I=new n.StructArrayLayout3ui6;I.emplaceBack(0,1,2),I.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=c.createIndexBuffer(I);let D=new n.StructArrayLayout1ui2;for(let z of[0,1,3,2,0])D.emplaceBack(z);this.debugIndexBuffer=c.createIndexBuffer(D),this.emptyTexture=new n.Texture(c,new n.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),c.gl.RGBA),this.identityMat=n.create();let O=this.context.gl;this.stencilClearMode=new n.StencilMode({func:O.ALWAYS,mask:0},0,255,O.ZERO,O.ZERO,O.ZERO),this.loadTimeStamps.push(n.window.performance.now()),this.atmosphereBuffer=new U0(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(c){return c._makeTileBoundsBuffers(this.context,this.transform.projection),c._tileBoundsBuffer?{tileBoundsBuffer:c._tileBoundsBuffer,tileBoundsIndexBuffer:c._tileBoundsIndexBuffer,tileBoundsSegments:c._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){let c=this.context,h=c.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(c,h.TRIANGLES,n.DepthMode.disabled,this.stencilClearMode,n.ColorMode.disabled,n.CullFaceMode.disabled,Zu(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(c,h,g){if(!h||this.currentStencilSource===h.id||!c.isTileClipped()||!g||g.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let D=!1;
1311for(let O of g)if(this._tileClippingMaskIDs[O.key]===void 0){D=!0;break}if(!D)return}this.currentStencilSource=h.id;let y=this.context,x=y.gl;this.nextStencilID+g.length>256&&this.clearStencil(),y.setColorMode(n.ColorMode.disabled),y.setDepthMode(n.DepthMode.disabled);let I=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let D of g){let O=h.getTile(D),z=this._tileClippingMaskIDs[D.key]=this.nextStencilID++,{tileBoundsBuffer:F,tileBoundsIndexBuffer:U,tileBoundsSegments:X}=this.getTileBoundsBuffers(O);I.draw(y,x.TRIANGLES,n.DepthMode.disabled,new n.StencilMode({func:x.ALWAYS,mask:0},z,255,x.KEEP,x.KEEP,x.REPLACE),n.ColorMode.disabled,n.CullFaceMode.disabled,Zu(D.projMatrix),"$clipping",F,U,X)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let c=this.nextStencilID++,h=this.context.gl;return new n.StencilMode({func:h.NOTEQUAL,mask:255},c,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(c){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(c);let h=this.context.gl;return new n.StencilMode({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[c.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(c){let h=this.context.gl,g=c.sort((I,D)=>D.overscaledZ-I.overscaledZ),y=g[g.length-1].overscaledZ,x=g[0].overscaledZ-y+1;if(x>1){this.currentStencilSource=void 0,this.nextStencilID+x>256&&this.clearStencil();let I={};for(let D=0;D<x;D++)I[D+y]=new n.StencilMode({func:h.GEQUAL,mask:255},D+this.nextStencilID,255,h.KEEP,h.KEEP,h.REPLACE);return this.nextStencilID+=x,[I,g]}return[{[y]:n.StencilMode.disabled},g]}colorModeForRenderPass(){let c=this.context.gl;return this._showOverdrawInspector?new n.ColorMode([c.CONSTANT_COLOR,c.ONE],new n.Color(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?n.ColorMode.unblended:n.ColorMode.alphaBlended}depthModeForSublayer(c,h,g){if(!this.opaquePassEnabledForLayer())return n.DepthMode.disabled;let y=1-((1+this.currentLayer)*this.numSublayers+c)*this.depthEpsilon;return new n.DepthMode(g||this.context.gl.LEQUAL,h,[y,y])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(c,h){this.style=c,this.options=h,this.imageManager=c.imageManager,this.glyphManager=c.glyphManager,this.symbolFadeChange=c.placement.symbolFadeChange(n.exported.now()),this.imageManager.beginFrame();let g=this.style.order,y=this.style._sourceCaches;for(let z in y){let F=y[z];F.used&&F.prepare(this.context)}let x={},I={},D={};for(let z in y){let F=y[z];x[z]=F.getVisibleCoordinates(),I[z]=x[z].slice().reverse(),D[z]=F.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let z=0;z<g.length;z++)if(this.style._layers[g[z]].is3D()){this.opaquePassCutoff=z;break}if(this.terrain&&(this.terrain.updateTileBinding(D),this.opaquePassCutoff=0),this.transform.projection.name!=="globe"||this.globeSharedBuffers||(this.globeSharedBuffers=new n.GlobeSharedBuffers(this.context)),!n.isMapAuthenticated(this.context.gl))return;this.renderPass="offscreen";for(let z of g){let F=this.style._layers[z],U=c._getLayerSourceCache(F);if(!F.hasOffscreenPass()||F.isHidden(this.transform.zoom))continue;let X=U?I[U.id]:void 0;(F.type==="custom"||F.isSky()||X&&X.length)&&this.renderLayer(this,U,F,X)}this.depthRangeFor3D=[0,1-(c.order.length+2)*this.numSublayers*this.depthEpsilon];let O=this.terrain;if(O&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&O.drawDepth(),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]),this.context.clear({color:h.showOverdrawInspector?n.Color.black:n.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=h.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=g.length-1;this.currentLayer>=0;this.currentLayer--){let z=this.style._layers[g[this.currentLayer]],F=c._getLayerSourceCache(z);if(z.isSky())continue;let U=F?I[F.id]:void 0;this._renderTileClippingMasks(z,F,U),this.renderLayer(this,F,z,U)}if(this.style.fog&&this.transform.projection.supportsFog&&function(z,F){let U=z.context,X=U.gl,J=z.transform,te=new n.DepthMode(X.LEQUAL,n.DepthMode.ReadOnly,[0,1]),ee=z.useProgram("globeAtmosphere",null,J.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),ne=n.globeToMercatorTransition(J.zoom),H=F.properties.get("color").toArray01(),Q=F.properties.get("high-color").toArray01(),le=F.properties.get("space-color").toArray01PremultipliedAlpha(),ue=n.identity$1([]);n.rotateY$1(ue,ue,-n.degToRad(J._center.lng)),n.rotateX$1(ue,ue,
1311n.degToRad(J._center.lat)),n.rotateZ$1(ue,ue,J.angle),n.rotateX$1(ue,ue,-J._pitch);let ye=n.fromQuat(new Float32Array(16),ue),xe=n.mapValue(F.properties.get("star-intensity"),0,1,0,.25),be=5e-4,De=n.mapValue(F.properties.get("horizon-blend"),0,1,be,.25),Ie=n.globeUseCustomAntiAliasing(z,U,J)&&De===be?J.worldSize/(2*Math.PI*1.025)-1:J.globeRadius,Re=z.frameCounter/1e3%1,nt=n.length(J.globeCenterInViewSpace),Ae=Math.sqrt(Math.pow(nt,2)-Math.pow(Ie,2)),Ze=Math.acos(Ae/nt),Ne=((Oe,qe,ot,Je,lt,zt,oi,Ot,Gt,Mi,Ci,Nt,an,gn)=>({u_frustum_tl:Oe,u_frustum_tr:qe,u_frustum_br:ot,u_frustum_bl:Je,u_horizon:lt,u_transition:zt,u_fadeout_range:oi,u_color:Ot,u_high_color:Gt,u_space_color:Mi,u_star_intensity:Ci,u_star_size:5*n.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:Nt,u_horizon_angle:an,u_rotation_matrix:gn}))(J.frustumCorners.TL,J.frustumCorners.TR,J.frustumCorners.BR,J.frustumCorners.BL,J.frustumCorners.horizon,ne,De,H,Q,le,xe,Re,Ze,ye);z.prepareDrawProgram(U,ee);let it=z.atmosphereBuffer;it&&ee.draw(U,X.TRIANGLES,te,n.StencilMode.disabled,n.ColorMode.alphaBlended,n.CullFaceMode.backCW,Ne,"skybox",it.vertexBuffer,it.indexBuffer,it.segments)}(this,this.style.fog),this.renderPass="sky",(n.globeToMercatorTransition(this.transform.zoom)>0||this.transform.projection.name!=="globe")&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<g.length;this.currentLayer++){let z=this.style._layers[g[this.currentLayer]],F=c._getLayerSourceCache(z);z.isSky()&&this.renderLayer(this,F,z,F?I[F.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<g.length;){let z=this.style._layers[g[this.currentLayer]],F=c._getLayerSourceCache(z);if(z.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(z)){if(z.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}let U=F?(z.type==="symbol"?D:I)[F.id]:void 0;this._renderTileClippingMasks(z,F,F?x[F.id]:void 0),this.renderLayer(this,F,z,U),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let z=null;n.values(this.style._layers).forEach(F=>{let U=c._getLayerSourceCache(F);U&&!F.isHidden(this.transform.zoom)&&(!z||z.getSource().maxzoom<U.getSource().maxzoom)&&(z=U)}),z&&this.options.showTileBoundaries&&Nl.debug(this,z,z.getVisibleCoordinates())}this.options.showPadding&&function(z){let F=z.transform.padding;j0(z,z.transform.height-(F.top||0),3,Dc),j0(z,F.bottom||0,3,H1),Dh(z,F.left||0,3,$1),Dh(z,z.transform.width-(F.right||0),3,G1);let U=z.transform.centerPoint;(function(X,J,te,ee){Mc(X,J-1,te-10,2,20,ee),Mc(X,J-10,te-1,20,2,ee)})(z,U.x,z.transform.height-U.y,q1)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(n.window.performance.now()),this.saveC
1311anvasCopy())}renderLayer(c,h,g,y){g.isHidden(this.transform.zoom)||(g.type==="background"||g.type==="sky"||g.type==="custom"||y&&y.length)&&(this.id=g.id,this.gpuTimingStart(g),(!c.transform.projection.unsupportedLayers||!c.transform.projection.unsupportedLayers.includes(g.type)||c.terrain&&g.type==="custom")&&Nl[g.type](c,h,g,y,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(c){if(!this.options.gpuTiming)return;let h=this.context.extTimerQuery,g=this.gpuTimers[c.id];g||(g=this.gpuTimers[c.id]={calls:0,cpuTime:0,query:h.createQueryEXT()}),g.calls++,h.beginQueryEXT(h.TIME_ELAPSED_EXT,g.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){let c=this.context.extTimerQuery,h=c.createQueryEXT();this.deferredRenderGpuTimeQueries.push(h),c.beginQueryEXT(c.TIME_ELAPSED_EXT,h)}}gpuTimingDeferredRenderEnd(){if(!this.options.gpuTimingDeferredRender)return;let c=this.context.extTimerQuery;c.endQueryEXT(c.TIME_ELAPSED_EXT)}gpuTimingEnd(){if(!this.options.gpuTiming)return;let c=this.context.extTimerQuery;c.endQueryEXT(c.TIME_ELAPSED_EXT)}collectGpuTimers(){let c=this.gpuTimers;return this.gpuTimers={},c}collectDeferredRenderGpuQueries(){let c=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],c}queryGpuTimers(c){let h={};for(let g in c){let y=c[g],x=this.context.extTimerQuery,I=x.getQueryObjectEXT(y.query,x.QUERY_RESULT_EXT)/1e6;x.deleteQueryEXT(y.query),h[g]=I}return h}queryGpuTimeDeferredRender(c){if(!this.options.gpuTimingDeferredRender)return 0;let h=this.context.extTimerQuery,g=0;for(let y of c)g+=h.getQueryObjectEXT(y,h.QUERY_RESULT_EXT)/1e6,h.deleteQueryEXT(y);return g}translatePosMatrix(c,h,g,y,x){if(!g[0]&&!g[1])return c;let I=x?y==="map"?this.transform.angle:0:y==="viewport"?-this.transform.angle:0;if(I){let z=Math.sin(I),F=Math.cos(I);g=[g[0]*F-g[1]*z,g[0]*z+g[1]*F]}let D=[x?g[0]:ri(h,g[0],this.transform.zoom),x?g[1]:ri(h,g[1],this.transform.zoom),0],O=new Float32Array(16);return n.translate(O,c,D),O}saveTileTexture(c){let h=this._tileTextures[c.size[0]];h?h.push(c):this._tileTextures[c.size[0]]=[c]}getTileTexture(c){let h=this._tileTextures[c];return h&&h.length>0?h.pop():null}isPatternMissing(c){return c===null||c!==void 0&&!this.imageManager.getPattern(c.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){let c=this.terrain&&this.terrain.renderingToTexture,h=this.terrain&&this.terrain.exaggeration()===0,g=this.style&&this.style.fog,y=[];return this.terrainRenderModeElevated()&&y.push("TERRAIN"),this.transform.projection.name==="globe"&&y.push("GLOBE"),h&&y.push("ZERO_EXAGGERATION"),g&&!c&&g.getOpacity(this.transform.pitch)!==0&&y.push("FOG"),c&&y.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&y.push("OVERDRAW_INSPECTOR"),y}useProgram(c,h,g){this.cache=this.cache||{};let y=g||[],x=this.currentGlobalDefines().concat(y),I=Wi.cacheKey(lm[c],c,x,h);return this.cache[I]||(this.cache[I]=new Wi(this.context,c,lm[c],h,Em[c],x)),this.cache[I]}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(){let c=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(c.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=n.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new n.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(c,h,g){if(this.terrain&&this.terrain.renderingToTexture)return;let y=this.style.fog;if(y){let x=y.getOpacity(this.transform.pitch),I=((D,O,z,F,U,X,J,te,ee,ne,H)=>{let Q=D.transform,le=O.properties.get("color").toArray01();le[3]=F;let ue=D.frameCounter/1e3%1;return{u_fog_matrix:z?Q.calculateFogTileMatrix(z):D.identityMat,u_fog_range:O.getFovAdjustedRange(Q._fov),u_fog_color:le,u_fog_horizon_blend:O.properties.get("horizon-blend"),u_fog_temporal_offset:ue,u_frustum_tl:U,u_frustum_tr:X,u_frustum_br:J,u_frustum_bl:te,u_globe_pos:ee,u_globe_radius:ne,u_viewport:H,u_globe_transition:n.globeToMercatorTransition(Q.zoom),u_is_globe:+(Q.projection.name==="globe")}})(this,y,g,x,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*n.exported.devicePixelRatio,this.transform.height*n.exported.devicePixelRatio]);h.setFogUniformValues(c,I)}}setTileLoadedFlag(c){this.tileLoaded=c}saveCanvasCopy(){let c=this.canvasCopy();c&&(this.frameCopies.push(c),this.tileLoaded=!1)}canvasCopy(){let c=this.context.gl,h=c.createTexture();return c.bindTexture(c.TEXTURE_2D,h),c.copyTexImage2D(c.TEXTURE_2D,0,c.RGBA,0,0,c.drawingBufferWidth,c.drawingBufferHeight,0),h}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;let c=this.style&&this.style.fog;return!!c&&c.getOpacity(this.transform.pitch)!==0}
1311getBackgroundTiles(){let c=this._backgroundTiles,h=this._backgroundTiles={},g=this.transform.coveringTiles({tileSize:512});for(let y of g)h[y.key]=c[y.key]||new n.Tile(y,512,this.transform.tileZoom,this);return h}clearBackgroundTiles(){this._backgroundTiles={}}}class kh{constructor(c=0,h=0,g=0,y=0){if(isNaN(c)||c<0||isNaN(h)||h<0||isNaN(g)||g<0||isNaN(y)||y<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=c,this.bottom=h,this.left=g,this.right=y}interpolate(c,h,g){return h.top!=null&&c.top!=null&&(this.top=n.number(c.top,h.top,g)),h.bottom!=null&&c.bottom!=null&&(this.bottom=n.number(c.bottom,h.bottom,g)),h.left!=null&&c.left!=null&&(this.left=n.number(c.left,h.left,g)),h.right!=null&&c.right!=null&&(this.right=n.number(c.right,h.right,g)),this}getCenter(c,h){let g=n.clamp((this.left+c-this.right)/2,0,c),y=n.clamp((this.top+h-this.bottom)/2,0,h);return new n.Point(g,y)}equals(c){return this.top===c.top&&this.bottom===c.bottom&&this.left===c.left&&this.right===c.right}clone(){return new kh(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Ah(f,c){let h=n.getColumn(f,3);n.fromQuat(f,c),n.setColumn(f,3,h)}function Zi(f,c){let h=n.identity$1([]);return n.rotateZ$1(h,h,-c),n.rotateX$1(h,h,-f),h}function td(f,c){let h=[f[0],f[1],0],g=[c[0],c[1],0];if(n.length(h)>=1e-15){let I=n.normalize([],h);n.scale$2(g,I,n.dot(g,I)),c[0]=g[0],c[1]=g[1]}let y=n.cross([],c,f);if(n.len(y)<1e-15)return null;let x=Math.atan2(-y[1],y[0]);return Zi(Math.atan2(Math.sqrt(f[0]*f[0]+f[1]*f[1]),-f[2]),x)}class H0{constructor(c,h){this.position=c,this.orientation=h}get position(){return this._position}set position(c){if(c){let h=c instanceof n.MercatorCoordinate?c:new n.MercatorCoordinate(c[0],c[1],c[2]);
1311this._renderWorldCopies&&(h.x=n.wrap(h.x,0,1)),this._position=h}else this._position=null}lookAtPoint(c,h){if(this.orientation=null,!this.position)return;let g=this.position,y=this._elevation?this._elevation.getAtPointOrZero(n.MercatorCoordinate.fromLngLat(c)):0,x=n.MercatorCoordinate.fromLngLat(c,y),I=[x.x-g.x,x.y-g.y,x.z-g.z];h||(h=[0,0,1]),h[2]=Math.abs(h[2]),this.orientation=td(I,h)}setPitchBearing(c,h){this.orientation=Zi(n.degToRad(c),n.degToRad(-h))}}class Ph{constructor(c,h){this._transform=n.identity([]),this.orientation=h,this.position=c}get mercatorPosition(){let c=this.position;return new n.MercatorCoordinate(c[0],c[1],c[2])}get position(){let c=n.getColumn(this._transform,3);return[c[0],c[1],c[2]]}set position(c){var h;c&&n.setColumn(this._transform,3,[(h=c)[0],h[1],h[2],1])}get orientation(){return this._orientation}set orientation(c){this._orientation=c||n.identity$1([]),c&&Ah(this._transform,this._orientation)}getPitchBearing(){let c=this.forward(),h=this.right();return{bearing:Math.atan2(-h[1],h[0]),pitch:Math.atan2(Math.sqrt(c[0]*c[0]+c[1]*c[1]),-c[2])}}setPitchBearing(c,h){this._orientation=Zi(c,h),Ah(this._transform,this._orientation)}forward(){let c=n.getColumn(this._transform,2);return[-c[0],-c[1],-c[2]]}up(){let c=n.getColumn(this._transform,1);return[-c[0],-c[1],-c[2]]}right(){let c=n.getColumn(this._transform,0);return[c[0],c[1],c[2]]}getCameraToWorld(c,h){let g=new Float64Array(16);return n.invert(g,this.getWorldToCamera(c,h)),g}getWorldToCameraPosition(c,h,g){let y=this.position;n.scale$2(y,y,-c);let x=new Float64Array(16);return n.fromScaling(x,[g,g,g]),n.translate(x,x,y),x[10]*=h,x}getWorldToCamera(c,h){let g=new Float64Array(16),y=new Float64Array(4),x=this.position;return n.conjugate(y,this._orientation),n.scale$2(x,x,-c),n.fromQuat(g,y),n.translate(g,g,x),g[1]*=-1,g[5]*=-1,g[9]*=-1,g[13]*=-1,g[8]*=h,g[9]*=h,g[10]*=h,g[11]*=h,g}getCameraToClipPerspective(c,h,g,y){let x=new Float64Array(16);return n.perspective(x,c,h,g,y),x}getDistanceToElevation(c,h=!1){let g=c===0?0:n.mercatorZfromAltitude(c,h?n.latFromMercatorY(this.position[1]):this.position[1]),y=this.forward();return(g-this.position[2])/y[2]}clone(){return new Ph([...this.position],[...this.orientation])}}function Ac(f,c){let h=Oh(f.projection,f.zoom,f.width,f.height),g=function(x,I,D,O,z){let F=new n.LngLat(D.lng-180*fa,D.lat),U=new n.LngLat(D.lng+180*fa,D.lat),X=x.project(F.lng,F.lat),J=x.project(U.lng,U.lat),te=-Math.atan2(J.y-X.y,J.x-X.x),ee=n.MercatorCoordinate.fromLngLat(D);ee.y=n.clamp(ee.y,-1+fa,1-fa);let ne=ee.toLngLat(),H=x.project(ne.lng,ne.lat),Q=n.MercatorCoordinate.fromLngLat(ne);Q.x+=fa;let le=Q.toLngLat(),ue=x.project(le.lng,le.lat),ye=Rh(ue.x-H.x,ue.y-H.y,te),xe=n.MercatorCoordinate.fromLngLat(ne);xe.y+=fa;let be=xe.toLngLat(),De=x.project(be.lng,be.lat),Ie=Rh(De.x-H.x,De.y-H.y,te),Re=Math.abs(ye.x)/Math.abs(Ie.y),nt=n.identity([]);n.rotateZ(nt,nt,-te*(1-(z?0:O)));let Ae=n.identity([]);return n.scale(Ae,Ae,[1,1-(1-Re)*O,1]),Ae[4]=-Ie.x/Ie.y*O,n.rotateZ(Ae,Ae,te),n.multiply(Ae,nt,Ae),Ae}(f.projection,0,f.center,h,c),y=$0(f);return n.scale(g,g,[y,y,1]),g}function $0(f){let c=f.projection,h=Oh(f.projection,f.zoom,f.width,f.height),g=G
13110(c,f.center),y=G0(c,n.LngLat.convert(c.center));return Math.pow(2,g*h+(1-h)*y)}function Oh(f,c,h,g,y=1/0){let x=f.range;if(!x)return 0;let I=Math.min(y,Math.max(h,g)),D=Math.log(I/1024)/Math.LN2;return n.smoothstep(x[0]+D,x[1]+D,c)}let fa=1/4e4;function G0(f,c){let h=n.clamp(c.lat,-n.MAX_MERCATOR_LATITUDE,n.MAX_MERCATOR_LATITUDE),g=new n.LngLat(c.lng-180*fa,h),y=new n.LngLat(c.lng+180*fa,h),x=f.project(g.lng,h),I=f.project(y.lng,h),D=n.MercatorCoordinate.fromLngLat(g),O=n.MercatorCoordinate.fromLngLat(y),z=I.x-x.x,F=I.y-x.y,U=O.x-D.x,X=O.y-D.y,J=Math.sqrt((U*U+X*X)/(z*z+F*F));return Math.log(J)/Math.LN2}function Rh(f,c,h){let g=Math.cos(h),y=Math.sin(h);return{x:f*g-c*y,y:f*y+c*g}}class Pc{constructor(c,h,g,y,x,I,D){this.tileSize=512,this._renderWorldCopies=x===void 0||x,this._minZoom=c||0,this._maxZoom=h||22,this._minPitch=g??0,this._maxPitch=y??60,this.setProjection(I),this.setMaxBounds(D),this.width=0,this.height=0,this._center=new n.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 kh,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Ph,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){let c=new Pc(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return c._elevation=this._elevation,c._centerAltitude=this._centerAltitude,c._centerAltitudeValidForE
1311xaggeration=this._centerAltitudeValidForExaggeration,c.tileSize=this.tileSize,c.mercatorFromTransition=this.mercatorFromTransition,c.width=this.width,c.height=this.height,c.cameraElevationReference=this.cameraElevationReference,c._center=this._center,c._setZoom(this.zoom),c._seaLevelZoom=this._seaLevelZoom,c.angle=this.angle,c._fov=this._fov,c._pitch=this._pitch,c._nearZ=this._nearZ,c._farZ=this._farZ,c._averageElevation=this._averageElevation,c._unmodified=this._unmodified,c._edgeInsets=this._edgeInsets.clone(),c._camera=this._camera.clone(),c._calcMatrices(),c.freezeTileCoverage=this.freezeTileCoverage,c.frustumCorners=this.frustumCorners,c}get elevation(){return this._elevation}set elevation(c){this._elevation!==c&&(this._elevation=c,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(c,h=!1){let g=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(this._seaLevelZoom==null||g)&&this._updateCameraOnTerrain(),(c||g)&&this._constrainCamera(h),this._calcMatrices()}getProjection(){return n.pick(this.projection,["name","center","parallels"])}setProjection(c){this.projectionOptions=c||{name:"mercator"};let h=this.projection?this.getProjection():void 0;this.projection=n.getProjection(this.projectionOptions);let g=!d(h,this.getProjection());return g&&this._calcMatrices(),this.mercatorFromTransition=!1,g}setMercatorFromTransition(){let c=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=n.getProjection({name:"mercator"});let h=c!==this.projection.name;return h&&this._calcMatrices(),h}get minZoom(){return this._minZoom}set minZoom(c){this._minZoom!==c&&(this._minZoom=c,this.zoom=Math.max(this.zoom,c))}get maxZoom(){return this._maxZoom}set maxZoom(c){this._maxZoom!==c&&(this._maxZoom=c,this.zoom=Math.min(this.zoom,c))}get minPitch(){return this._minPitch}set minPitch(c){this._minPitch!==c&&(this._minPitch=c,this.pitch=Math.max(this.pitch,c))}get maxPitch(){return this._maxPitch}set maxPitch(c){this._maxPitch!==c&&(this._maxPitch=c,this.pitch=Math.min(this.pitch,c))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(c){c===void 0?c=!0:c===null&&(c=!1),this._renderWorldCopies=c}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){let c=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(c))}get cameraWorldSize(){let c=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(c))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return n.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new n.Point(this.width,this.height)}get bearing(){return n.wrap(this.rotation,-180,180)}set bearing(c){this.rotation=c}get rotation(){return-this.angle/Math.PI*180}set rotation(c){let h=-c*Math.PI/180;var g;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(g=new n.ARRAY_TYPE(4),n.ARRAY_TYPE!=Float32Array&&(g[1]=0,g[2]=0),g[0]=1,g[3]=1,g),function(y,x,I){var D=x[0],O=x[1],z=x[2],F=x[3],U=Math.sin(I),X=Math.cos(I);y[0]=D*X+z*U,y[1]=O*X+F*U,y[2]=D*-U+z*X,y[3]=O*-U+F*X}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(c){let h=n.clamp(c,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){let c=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/c)}set fov(c){c=Math.max(.01,Math.min(60,c)),this._fov!==c&&(this._unmodified=!1,this._fov=n.degToRad(c),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(c){this._averageElevation=c,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(c){let h=Math.min(Math.max(c,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._setZoom(h),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(c){this._zoom=c,this.scale=this.zoomScale(c),this.tileZoom=Math.floor(c),this.zoomFraction=c-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForE
1311xaggeration=void 0);let c=this._elevation;this._centerAltitude=c.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=c.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;let c=this._elevation,h=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],g=this.horizonLineFromTop(),y=0,x=0;for(let I=0;I<h.length;I++){let D=new n.Point(h[I][0]*this.width,g+h[I][1]*(this.height-g)),O=c.pointCoordinate(D);if(!O)continue;let z=1/Math.hypot(O[0]-this._camera.position[0],O[1]-this._camera.position[1]);y+=O[3]*z,x+=z}return x===0?NaN:y/x}get center(){return this._center}set center(c){c.lat===this._center.lat&&c.lng===this._center.lng||(this._unmodified=!1,this._center=c,this._terrainEnabled()&&(this.cameraElevationReference==="ground"?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(this._seaLevelZoom==null||!this._elevation)return;let c=this._seaLevelZoom,h=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),g=this.pixelsPerMeter/this.worldSize*h,y=this._mercatorZfromZoom(c),x=this._mercatorZfromZoom(this._maxZoom),I=Math.max(y-g,x);this._setZoom(this._zoomFromMercatorZ(I))}get padding(){return this._edgeInsets.toJSON()}set padding(c){this._edgeInsets.equals(c)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,c,1),this._calcMatrices())}computeZoomRelativeTo(c){let h=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,c.toAltitude())),g;g=c.z<this._camera.position[2]?[h.x,h.y,h.z]:[c.x,c.y,c.z];let y=n.length(n.sub([],this._camera.position,g));return n.clamp(this._zoomFromMercatorZ(y),this._minZoom,this._maxZoom)}setFreeCameraOptions(c){if(!this.height||!c.position&&!c.orientation)return;this._updateCameraState();let h=!1;if(c.orientation&&!n.exactEquals(c.orientation,this._camera.orientation)&&(h=this._setCameraOrientation(c.orientation)),c.position){let g=[c.position.x,c.position.y,c.position.z];n.exactEquals$1(g,this._camera.position)||(this._setCameraPosition(g),h=!0)}h&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();let c=this._camera.position,h=new H0;return h.position=new n.MercatorCoordinate(c[0],c[1],c[2]),h.orientation=this._camera.orientation,h._elevation=this.elevation,h._renderWorldCopies=this.renderWorldCopies,h}_setCameraOrientation(c){if(!n.length$1(c))return!1;n.normalize$1(c,c);let h=n.transformQuat([],[0,0,-1],c),g=n.transformQuat([],[0,-1,0],c);if(g[2]<0)return!1;let y=td(h,g);return!!y&&(this._camera.orientation=y,!0)}_setCameraPosition(c){let h=this.zoomScale(this.minZoom)*this.tileSize,g=this.zoomScale(this.maxZoom)*this.tileSize,y=this.cameraToCenterDistance;c[2]=n.clamp(c[2],y/g,y/h),this._camera.position=c}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(c){return this._edgeInsets.equals(c)}interpolatePadding(c,h,g){this._unmodified=!1,this._edgeInsets.interpolate(c,h,g),this._constrain(),this._calcMatrices()}coveringZoomLevel(c){let h=(c.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/c.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(c){let h=[new n.UnwrappedTileID(0,c)];if(this.renderWorldCopies){let g=this.pointCoordinate(new n.Point(0,0)),y=this.pointCoordinate(new n.Point(this.width,0)),x=this.pointCoordinate(new n.Point(this.width,this.height)),I=this.pointCoordinate(new n.Point(0,this.height)),D=Math.floor(Math.min(g.x,y.x,x.x,I.x)),O=Math.floor(Math.max(g.x,y.x,x.x,I.x)),z=1;for(let F=D-z;F<=O+z;F++)F!==0&&h.push(new n.UnwrappedTileID(F,c))}return h}coveringTiles(c){let h=this.coveringZoomLevel(c),g=h,y=this.elevation&&!c.isTerrainDEM,x=this.projection.name==="mercator";if(c.minzoom!==void 0&&h<c.minzoom)return[];c.maxzoom!==void 0&&h>c.maxzoom&&(h=c.maxzoom);let I=this.locationCoordinate(this.center),D=this.center.lat,O=1<<h,z=[O*I.x,O*I.y,0],F=this.projection.name==="globe",U=!
1311F,X=n.Frustum.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,h,U),J=F?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),te=O*n.mercatorZfromAltitude(1,this.center.lat),ee=this._camera.position[2]/n.mercatorZfromAltitude(1,this.center.lat),ne=[O*J.x,O*J.y,ee*(U?1:te)],H=this.cameraToCenterDistance/c.tileSize*(c.roundZoom?1:.502),Q=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace?h:0,le=c.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,ue=c.isTerrainDEM?-le:this._elevation?this._elevation.getMinElevationBelowMSL():0,ye=this.projection.isReprojectedInTileSpace?$0(this):1,xe=Oe=>{let ot=new n.MercatorCoordinate(Oe.x+25e-6,Oe.y,Oe.z),Je=new n.MercatorCoordinate(Oe.x,Oe.y+25e-6,Oe.z),lt=Oe.toLngLat(),zt=ot.toLngLat(),oi=Je.toLngLat(),Ot=this.locationCoordinate(lt),Gt=this.locationCoordinate(zt),Mi=this.locationCoordinate(oi),Ci=Math.hypot(Gt.x-Ot.x,Gt.y-Ot.y),Nt=Math.hypot(Mi.x-Ot.x,Mi.y-Ot.y);return Math.sqrt(Ci*Nt)*ye/25e-6},be=Oe=>{let qe=le,ot=ue;return{aabb:n.tileAABB(this,O,0,0,0,Oe,ot,qe,this.projection),zoom:0,x:0,y:0,minZ:ot,maxZ:qe,wrap:Oe,fullyVisible:!1}},De=[],Ie=[],Re=h,nt=c.reparseOverscaled?g:h,Ae=Oe=>Oe*Oe,Ze=Ae((ee-this._centerAltitude)*te),Ne=Oe=>{if(!this._elevation||!Oe.tileID||!x)return;let qe=this._elevation.getMinMaxForTile(Oe.tileID),ot=Oe.aabb;qe?(ot.min[2]=qe.min,ot.max[2]=qe.max,ot.center[2]=(ot.min[2]+ot.max[2])/2):(Oe.shouldSplit=it(Oe),Oe.shouldSplit||(ot.min[2]=ot.max[2]=ot.center[2]=this._centerAltitude))},it=Oe=>{if(Oe.zoom<Q)return!0;if(Oe.zoom===Re)return!1;if(Oe.shouldSplit!=null)return Oe.shouldSplit;let qe=Oe.aabb.distanceX(ne),ot=Oe.aabb.distanceY(ne),Je=Ze,lt=1;if(F){Je=Ae(Oe.aabb.distanceZ(ne));let Ot=Math.pow(2,Oe.zoom),Gt=n.latFromMercatorY((Oe.y+1)/Ot),Mi=n.latFromMercatorY(Oe.y/Ot),Ci=Math.min(Math.max(D,Gt),Mi),Nt=n.circumferenceAtLatitude(Ci)/n.circumferenceAtLatitude(D);if(lt=Ci===D?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,Nt/this._mercatorScaleRatio),this.zoom<=n.GLOBE_ZOOM_THRESHOLD_MIN&&Oe.zoom===Re-1&&Nt>=.9)return!0}else if(y&&(Je=Ae(Oe.aabb.distanceZ(ne)*te)),this.projection.isReprojectedInTileSpace&&g<=5){let Ot=Math.pow(2,Oe.zoom),Gt=xe(new n.MercatorCoordinate((Oe.x+.5)/Ot,(Oe.y+.5)/Ot));lt=Gt>.85?1:Gt}let zt=qe*qe+ot*ot+Je,oi=Ae((1<<Re-Oe.zoom)*H*lt*((Ot,Gt)=>{if(Gt*Ae(.707)<Ot)return 1;let Mi=Math.sqrt(Gt/Ot);return Mi/(1.4144271570014144+(Math.pow(1.1,Mi-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(Je,Ze),zt));return zt<oi};if(this.renderWorldCopies)for(let Oe=1;Oe<=3;Oe++)De.push(be(-Oe)),De.push(be(Oe));for(De.push(be(0));De.length>0;){let Oe=De.pop(),qe=Oe.x,ot=Oe.y,Je=Oe.fullyVisible;if(!Je){let lt=Oe.aabb.intersects(X);if(lt===0)continue;Je=lt===2}if(Oe.zoom!==Re&&it(Oe))for(let lt=0;lt<4;lt++){let zt=(qe<<1)+lt%2,oi=(ot<<1)+(lt>>1),Ot={aabb:x?Oe.aabb.quadrant(lt):n.tileAABB(this,O,Oe.zoom+1,zt,oi,Oe.wrap,Oe.minZ,Oe.maxZ,this.projection),zoom:Oe.zoom+1,x:zt,y:oi,wrap:Oe.wrap,fullyVisible:Je,tileID:void 0,shouldSplit:void 0,minZ:Oe.minZ,maxZ:Oe.maxZ};y&&!F&&(Ot.tileID=new n.OverscaledTileID(Oe.zoom+1===Re?nt:Oe.zoom+1,Oe.wrap,Oe.zoom+1,zt,oi),Ne(Ot)),De.push(Ot)}else{let lt=Oe.zoom===Re?nt:Oe.zoom;if(c.minzoom&&c.minzoom>lt)continue;let zt=z[0]-(.5+qe+(Oe.wrap<<Oe.zoom))*(1<<h-Oe.zoom),oi=z[1]-.5-ot,Ot=Oe.tileID?Oe.tileID:new n.OverscaledTileID(lt,Oe.wrap,Oe.zoom,qe,ot);Ie.push({tileID:Ot,distanceSq:zt*zt+oi*oi})}}if(this.fogCullDistSq){let Oe=this.fogCullDistSq,qe=this.horizonLineFromTop();Ie=Ie.filter(ot=>{let Je=[0,0,0,1],lt=[n.EXTENT,n.EXTENT,0,1],zt=this.calculateFogTileMatrix(ot.tileID.toUnwrapped());n.transformMat4$1(Je,Je,zt),n.transformMat4$1(lt,lt,zt);let oi=n.getAABBPointSquareDist(Je,lt);if(oi===0)return!0;let Ot=!1,Gt=this._elevation;if(Gt&&oi>Oe&&qe!==0){let Mi=this.calculateProjMatrix(ot.tileID.toUnwrapped()),Ci;c.isTerrainDEM||(Ci=Gt.getMinMaxForTile(ot.tileID)),Ci||(Ci={min:ue,max:le});let Nt=n.furthestTileCorner(this.rotation),an=[Nt[0]*n.EXTENT,Nt[1]*n.EXTENT,Ci.max];n.transformMat4(an,an,Mi),Ot=(1-an[1])*this.height*.5<qe}return oi<Oe||Ot})}return Ie.sort((Oe,qe)=>Oe.distanceSq-qe.distanceSq).map(Oe=>Oe.tileID)}resize(c,h){this.width=c,this.height=h,this.pixelsToGLUnits=[2/c,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(c){return Math.pow(2,c)}scaleZoom(c){return Math.log(c)/Math.LN2}project(c){let h=n.clamp(c.lat,-n.MAX_MERCATOR_LATITUDE,n.MAX_MERCATOR_LATITUDE),g=this.projection.project(c.lng,h);return new n.Point(g.x*this.worldSize,g.y*this.worldSize)}unproject(c){return this.projection.unproject(c.x/this.worldSize,c.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/n.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(c,h){let g,y,x=this.centerPoint;if(this.projection.name==="globe"){let D=this.worldSize;g=(h.x-x.x)/D,y=(h.y-x.y)/D}else{let D=this.pointCoordinate(h),O=this.pointCoordinate(x);g=D.x-O.x,y=D.y-O.y}let I=this.locationCoordinate(c);this.setLocation(new n.MercatorCoordinate(I.x-g,I.y-y))}setLocation(c){this.center=this.coordinateLocation(c),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(c){return this.projection.locationPoint(this,c)}locationPoint3D(c){return this.projection.locationPoint(this,c,!0)}pointLocation(c){return this.coordinateLocation(this.pointCoordinate(c))}pointLocation3D(c){return this.coordinateLocation(this.pointCoordinate3D(c))}locationCoordinate(c,h){let g=h?n.mercatorZfromAltitude(h,c.lat):void 0,y=this.projection.project(c.lng,c.lat);return new n.MercatorCoordinate(y.x,y.y,g)}coordinateLocation(c){return this.projection.unproject(c.x,c.y)}pointRayIntersection(c,h){let g=h??this._centerAltitude,y=[c.x,c.y,0,1],x=[c.x,c.y,1,1];n.transformMat4$1(y,y,this.pixelMatrixInverse),n.transformMat4$1(x,x,this.pixelMatrixInverse);let I=x[3];n.scale$1(y,y,1/y[3]),n.scale$1(x,x,1/I);let D=y[2],O=x[2];return{p0:y,p1:x,t:D===O?0:(g-D)/(O-D)}}
1311screenPointToMercatorRay(c){let h=[c.x,c.y,0,1],g=[c.x,c.y,1,1];return n.transformMat4$1(h,h,this.pixelMatrixInverse),n.transformMat4$1(g,g,this.pixelMatrixInverse),n.scale$1(h,h,1/h[3]),n.scale$1(g,g,1/g[3]),h[2]=n.mercatorZfromAltitude(h[2],this._center.lat)*this.worldSize,g[2]=n.mercatorZfromAltitude(g[2],this._center.lat)*this.worldSize,n.scale$1(h,h,1/this.worldSize),n.scale$1(g,g,1/this.worldSize),new n.Ray([h[0],h[1],h[2]],n.normalize([],n.sub([],g,h)))}rayIntersectionCoordinate(c){let{p0:h,p1:g,t:y}=c,x=n.mercatorZfromAltitude(h[2],this._center.lat),I=n.mercatorZfromAltitude(g[2],this._center.lat);return new n.MercatorCoordinate(n.number(h[0],g[0],y)/this.worldSize,n.number(h[1],g[1],y)/this.worldSize,n.number(x,I,y))}pointCoordinate(c,h=this._centerAltitude){return this.projection.pointCoordinate(this,c.x,c.y,h)}pointCoordinate3D(c){if(!this.elevation)return this.pointCoordinate(c);let h=this.projection.pointCoordinate3D(this,c.x,c.y);if(h)return new n.MercatorCoordinate(h[0],h[1],h[2]);let g=0,y=this.horizonLineFromTop();if(c.y>y)return this.pointCoordinate(c);let x=.02*y,I=c.clone();for(let D=0;D<10&&y-g>x;D++){I.y=n.number(g,y,.66);let O=this.projection.pointCoordinate3D(this,I.x,I.y);O?(y=I.y,h=O):g=I.y}return h?new n.MercatorCoordinate(h[0],h[1],h[2]):this.pointCoordinate(c)}isPointAboveHorizon(c){return this.projection.isPointAboveHorizon(this,c)}isPointOnSurface(c){if(c.y<0||c.y>this.height||c.x<0||c.x>this.width)return!1;if(this.elevation||this.zoom>=n.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(c);let h=this.pointCoordinate(c);return h.y>=0&&h.y<=1}_coordinatePoint(c,h){let g=h&&this.elevation?this.elevation.getAtPointOrZero(c,this._centerAltitude):this._centerAltitude,y=[c.x*this.worldSize,c.y*this.worldSize,g+c.toAltitude(),1];return n.transformMat4$1(y,y,this.pixelMatrix),y[3]>
13110?new n.Point(y[0]/y[3],y[1]/y[3]):new n.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){let{top:c,left:h}=this._edgeInsets,g=this.height-this._edgeInsets.bottom,y=this.width-this._edgeInsets.right,x=this.pointLocation3D(new n.Point(h,c)),I=this.pointLocation3D(new n.Point(y,c)),D=this.pointLocation3D(new n.Point(y,g)),O=this.pointLocation3D(new n.Point(h,g)),z=Math.min(x.lng,I.lng,D.lng,O.lng),F=Math.max(x.lng,I.lng,D.lng,O.lng),U=Math.min(x.lat,I.lat,D.lat,O.lat),X=Math.max(x.lat,I.lat,D.lat,O.lat),J=Math.pow(2,-this.zoom)/16*270,te=this.projection.name==="globe"?1:4,ee=(ne,H,Q,le,ue)=>{let ye=(ne+Q)/2,xe=(H+le)/2,be=new n.Point(ye,xe),{lng:De,lat:Ie}=this.pointLocation3D(be),Re=Math.max(0,z-De,U-Ie,De-F,Ie-X);z=Math.min(z,De),F=Math.max(F,De),U=Math.min(U,Ie),X=Math.max(X,Ie),(ue<te||Re>J)&&(ee(ne,H,ye,xe,ue+1),ee(ye,xe,Q,le,ue+1))};if(ee(h,c,y,c,1),ee(y,c,y,g,1),ee(y,g,h,g,1),ee(h,g,h,c,1),this.projection.name==="globe"){let[ne,H]=n.polesInViewport(this);ne?(X=90,F=180,z=-180):H&&(U=-90,F=180,z=-180)}return new n.LngLatBounds(new n.LngLat(z,U),new n.LngLat(F,X))}_getBoundsRectangular(c,h){let{top:g,left:y}=this._edgeInsets,x=this.height-this._edgeInsets.bottom,I=this.width-this._edgeInsets.right,D=new n.Point(y,g),O=new n.Point(I,g),z=new n.Point(I,x),F=new n.Point(y,x),U=this.pointCoordinate(D,c),X=this.pointCoordinate(O,c),J=this.pointCoordinate(z,h),te=this.pointCoordinate(F,h),ee=(ne,H)=>(H.y-ne.y)/(H.x-ne.x);return U.y>1&&X.y>=0?U=new n.MercatorCoordinate((1-te.y)/ee(te,U)+te.x,1):U.y<0&&X.y<=1&&(U=new n.MercatorCoordinate(-te.y/ee(te,U)+te.x,0)),X.y>1&&U.y>=0?X=new n.MercatorCoordinate((1-J.y)/ee(J,X)+J.x,1):X.y<0&&U.y<=1&&(X=new n.MercatorCoordinate(-J.y/ee(J,X)+J.x,0)),new n.LngLatBounds().extend(this.coordinateLocation(U)).extend(this.coordinateLocation(X)).extend(this.coordinateLocation(te)).extend(this.coordinateLocation(J))}_getBoundsRectangularTerrain(){let c=this.elevation;if(!c.visibleDemTiles.length||c.isUsingMockSource())return this._getBoundsRectangular(0,0);let h=c.visibleDemTiles.reduce((g,y)=>{if(y.dem){let x=y.dem.tree;g.min=Math.min(g.min,x.minimums[0]),g.max=Math.max(g.max,x.maximums[0])}return g},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(h.min*c.exaggeration(),h.max*c.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(c=!0){let h=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,g=this.height/2-h*(1-this._horizonShift);return c?Math.max(0,g):g}getMaxBounds(){return this.maxBounds}setMaxBounds(c){this.maxBounds=c,this.minLat=-n.MAX_MERCATOR_LATITUDE,this.maxLat=n.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,c&&(this.minLat=c.getSouth(),this.maxLat=c.getNorth(),this.minLng=c.getWest(),this.maxLng=c.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=n.mercatorXfromLng(this.minLng)*this.tileSize,this.worldMaxX=n.mercatorXfromLng(this.maxLng)*this.tileSize,this.worldMinY=n.mercatorYfromLat(this.maxLat)*this.tileSize,this.worldMaxY=n.mercatorYfromLat(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(c,h){return this.projection.createTileMatrix(this,h,c)}calculateDistanceTileData(c){let h=c.key,g=this._distanceTileDataCache;if(g[h])return g[h];let y=c.canonical,x=1/this.height,I=this.cameraWorldSize,D=I/this.zoomScale(y.z),O=(y.x+Math.pow(2,y.z)*c.wrap)*D,z=y.y*D,F=this.point;F.x*=I/this.worldSize,F.y*=I/this.worldSize;let U=this.angle,X=Math.sin(-U),J=-Math.cos(-U);return g[h]={bearing:[X,J],center:[(F.x-O)*x,(F.y-z)*x],scale:D/n.EXTENT*x},g[h]}calculateFogTileMatrix(c){let h=c.key,g=this._fogTileMatrixCache;if(g[h])return g[h];let y=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,c);return n.multiply(y,this.worldToFogMatrix,y),g[h]=new Float32Array(y),g[h]}calculateProjMatrix(c,h=!1){let g=c.key,y=h?this._alignedProjMatrixCache:this._projMatrixCache;if(y[g])return y[g];let x=this.calculatePosMatrix(c,this.worldSize);return n.multiply(x,this.projection.isReprojectedInTileSpace?this.mercatorMatrix:h?this.alignedProjMatrix:this.projMatrix,x),y[g]=new Float32Array(x),y[g]}calculatePixelsToTileUnitsMatrix(c){let h=c.tileID.key,g=this._pixelsToTileUnitsCache;if(g[h])return g[h];let y=function(x,I){let{scale:D}=x.tileTransform,O=D*n.EXTENT/(x.tileSize*Math.pow(2,I.zoom-x.tileID.overscaledZ+x.tileID.canonical.z));return z=new Float32Array(4),X=(F=I.inverseAdjustmentMatrix)[1],J=F[2],te=F[3],ne=(U=[O,O])[1],z[0]=F[0]*(ee=U[0]),z[1]=X*ee,z[2]=J*ne,z[3]=te*ne,z;var z,F,U,X,J,te,ee,ne}(c,this);return g[h]=y,g[h]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if(this.projection.name==="globe"){let c=1/this.worldSize,h=n.fromScaling([],[c,c,c]);return n.multiply(h,h,this.globeMatrix),h}}recenterOnTerrain(){if(!this._elevation||this.projection.name==="globe")return;let c=this._elevation;this._updateCameraState();let h=n.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,g=this._computeCameraPosition(h),y=this._camera.forward(),x=n.mercatorZfromAltitude(1,this._center.lat);g[2]/=x,y[2]/=x,n.normalize(y,y);let I=c.raycast(g,y,c.exaggeration());if(I){let D=n.scaleAndAdd([],g,y,I),O=new n.MercatorCoordinate(D[0],D[1],n.mercatorZfromAltitude(D[2],n.latFromMercatorY(D[1]))),z=(O.z+n.length([O.x-g[0],O.y-g[1],O.z-g[2]*x]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(z),this._centerAltitude=O.toAltitude(),this._center=this.coordinateLocation(O),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(c=!1){if(!this._elevation)return;let h=this._elevation,g=n.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,y=this._computeCameraPosition(g),x=h.getAtPointOrZero(new n.MercatorCoordinate(...y)),I=this.pixelsPerMeter/this.worldSize*x,D=this._minimumHeightOverTerrain(),O=y[2]-I;if(O<=D)if(O<0||c){let z=this.locationCoordinate(this._center,this._centerAltitude),F=[y[0],y[1],z.z-y[2]],U=n.length(F);F[2]-=(D-O)/this._pixelsPerMercatorPixel;let X=n.length(F);if(X===0)return;n.scale$2(F,F,U/X*this._pixelsPerMercatorPixel),this._camera.position=[y[0],y[1],z.z*this._pixelsPerMercatorPixel-F[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let c=this.projection.name==="globe"||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||c){let X=this.center;return X.lat=n.clamp(X.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!c)&&(X.lng=n.clamp(X.lng,this.minLng,this.maxLng)),this.center=X,void(this._constraining=!1)}let h=this._unmodified,{x:g,y}=this.point,x=0,I=g,D=y,O=this.width/2,z=this.height/2,F=this.worldMinY*this.scale,U=this.worldMaxY*this.scale;if(y-z<F&&(D=F+z),y+z>
1311U&&(D=U-z),U-F<this.height&&(x=Math.max(x,this.height/(U-F)),D=(U+F)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){let X=this.worldMinX*this.scale,J=this.worldMaxX*this.scale,te=this.worldSize/2-(X+J)/2;I=(g+te+this.worldSize)%this.worldSize-te,I-O<X&&(I=X+O),I+O>J&&(I=J-O),J-X<this.width&&(x=Math.max(x,this.width/(J-X)),I=(J+X)/2)}I===g&&D===y||(this.center=this.unproject(new n.Point(I,D))),x&&(this.zoom+=this.scaleZoom(x)),this._constrainCamera(),this._unmodified=h,this._constraining=!1}_minZoomForBounds(){let c=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(c=Math.max(c,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),c}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;let c=this.centerOffset,h=this.pixelsPerMeter;this.projection.name==="globe"&&(this._mercatorScaleRatio=n.mercatorZfromAltitude(1,this.center.lat)/n.mercatorZfromAltitude(1,n.GLOBE_SCALE_MATCH_LATITUDE));let g=Oh(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,g),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;let y=this.projection.zAxisUnit==="meters"?h:1,x=this._camera.getWorldToCamera(this.worldSize,y),I=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);I[8]=2*-c.x/this.width,I[9]=2*c.y/this.height;let D=n.mul([],I,x);if(this.projection.isReprojectedInTileSpace){let xe=this.locationCoordinate(this.center),be=n.identity([]);n.translate(be,be,[xe.x*this.worldSize,xe.y*this.worldSize,0]),n.multiply(be,be,Ac(this)),n.translate(be,be,[-xe.x*this.worldSize,-xe.y*this.worldSize,0]),n.multiply(D,D,be),this.inverseAdjustmentMatrix=function(De){let Ie=Ac(De,!0);return tt([],[Ie[0],Ie[1],Ie[4],Ie[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];this.mercatorMatrix=n.scale([],D,[this.worldSize,this.worldSize,this.worldSize/y,1]),this.projMatrix=D,this.invProjMatrix=n.invert(new Float64Array(16),this.projMatrix);let O=n.invert([],I);this.frustumCorners=n.FrustumCorners.fromInvProjectionMatrix(O,this.horizonLineFromTop(),this.height);let z=new Float32Array(16);n.identity(z),n.scale(z,z,[1,-1,1]),n.rotateX(z,z,this._pitch),n.rotateZ(z,z,this.angle);let F=n.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ),U=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;F[8]=2*-c.x/this.width,F[9]=2*(c.y+U)/this.height,this.skyboxMatrix=n.multiply(z,F,z);let X=this.point,J=X.x,te=X.y,ee=this.width%2/2,ne=this.height%2/2,H=Math.cos(this.angle),Q=Math.sin(this.angle),le=J-Math.round(J)+H*ee+Q*ne,ue=te-Math.round(te)+H*ne+Q*ee,ye=new Float64Array(D);if(n.translate(ye,ye,[le>.5?le-1:le,ue>.5?ue-1:ue,0]),this.alignedProjMatrix=ye,D=n.create(),n.scale(D,D,[this.width/2,-this.height/2,1]),n.translate(D,D,[1,-1,0]),this.labelPlaneMatrix=D,D=n.create(),n.scale(D,D,[1,-1,1]),n.translate(D,D,[-1,-1,0]),n.scale(D,D,[2/this.width,2/this.height,1]),this.glCoordMatrix=D,this.pixelMatrix=n.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},D=n.invert(new Float64Array(16),this.pixelMatrix),!D)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=D,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=n.calculateGlobeMatrix(this);let xe=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=n.transformMat4(xe,xe,x),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=D;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};let c=this.cameraWorldSizeForFog,h=this.cameraPixelsPerMeter,g=this._camera.position,y=1/this.height/this._pixelsPerMercatorPixel,x=[c,c,h];n.scale$2(x,x,y),n.scale$2(g,g,-1),n.multiply$2(g,g,x);let I=n.create();n.translate(I,I,g),n.scale(I,I,x),this.mercatorFogMatrix=I,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(c,h,y)}_computeCameraPosition(c){let h=(c=c||this.pixelsPerMeter)/this.pixelsPerMeter,g=this._camera.forward(),y=this.point,x=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*h-c/this.worldSize*this._centerAltitude;return[y.x/this.worldSize-g[0]*x,y.y/this.worldSize-g[1]*x,c/this.worldSize*this._centerAltitude-g[2]*x]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(c){let h=this._maxCameraBoundsDistance()*Math.cos(this._pitch),g=this._camera.position[2],y=c[2],x=1;this.projection.wrap&&(this.center=this.center.wrap()),y>0&&(x=Math.min((h-g)/y,1)),this._camera.position=n.scaleAndAdd([],this._camera.position,c,x),this._updateStateFromCamera()}_updateStateFromCamera(){let c=this._camera.position,h=this._camera.forward(),{pitch:g,bearing:y}=this._camera.getPitchBearing(),x=n.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,I=this._mercatorZfromZoom(this._maxZoom)*Math.cos(n.degToRad(this._maxPitch)),D=Math.max((c[2]-x)/Math.cos(g),I),O=this._zoomFromMercatorZ(D);n.scaleAndAdd(c,c,h,D),this._pitch=n.clamp(g,n.degToRad(this.minPitch),n.degToRad(this.maxPitch)),this.angle=n.wrap(y,-Math.PI,Math.PI),this._setZoom(n.clamp(O,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new n.MercatorCoordinate(c[0],c[1],c[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(c){return Math.pow(2,c)*this.tileSize}_mercatorZfromZoom(c){return this.cameraToCenterDistance/this._worldSizeFromZoom(c)}_minimumHeightOverTerrain(){let c=Math.min((this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(c)}_zoomFromMercatorZ(c){return this.scaleZoom(this.cameraToCenterDistance/(c*this.tileSize))}zoomFromMercatorZAdjusted(c){let h=0,g=n.GLOBE_ZOOM_THRESHOLD_MAX,y=0,x=1/0;for(;g-h>1e-6&&g>h;){let I=h+.5*(g-h),D=this.tileSize*Math.pow(2,I),O=this.getCameraToCenterDistance(this.projection,I,D),z=this.scaleZoom(O/(c*this.tileSize)),F=Math.abs(I-z);F<x&&(x=F,y=I),I<z?h=I:g=I}return y}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(n.warnOnce("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(c,h){let g=Math.min(c.x,h.x),y=Math.max(c.x,h.x),x=Math.min(c.y,h.y),I=Math.max(c.y,h.y);if(x<this.horizonLineFromTop(!1))return!0;
1311if(this.projection.name!=="mercator")return!1;let D=[new n.Point(g,x),new n.Point(y,I),new n.Point(g,I),new n.Point(y,x)],O=this.renderWorldCopies?-3:0,z=this.renderWorldCopies?4:1;for(let F of D){let U=this.pointRayIntersection(F);if(U.t<0)return!0;let X=this.rayIntersectionCoordinate(U);if(X.x<O||X.y<0||X.x>z||X.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+n.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new n.Point(0,0),new n.Point(this.width,this.height))}zoomDeltaToMovement(c,h){let g=n.length(n.sub([],this._camera.position,c)),y=this._zoomFromMercatorZ(g)+h;return g-this._mercatorZfromZoom(y)}getCameraPoint(){if(this.projection.name==="globe"){let c=function([h,g,y],x){let I=[h,g,y,1];n.transformMat4$1(I,I,x);let D=I[3]=Math.max(I[3],1e-6);return I[0]/=D,I[1]/=D,I[2]/=D,I}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new n.Point(c[0],c[1])}{let c=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n.Point(0,c))}}getCameraToCenterDistance(c,h=this.zoom,g=this.worldSize){let y=Oh(c,h,this.width,this.height,1024),x=c.pixelSpaceConversion(this.center.lat,g,y);return .5/Math.tan(.5*this._fov)*this.height*x}getWorldToCameraMatrix(){let c=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&n.multiply(c,c,this.globeMatrix),c}}function Oc(f,c){let h=!1,g=null,y=()=>{g=null,h&&(f(),g=setTimeout(y,c),h=!1)};return()=>(h=!0,g||y(),g)}class Im{constructor(c){this._hashName=c&&encodeURIComponent(c),n.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Oc(this._updateHashUnthrottled.bind(this),300)}addTo(c){return this._map=c,n.window.addEventListener("hashchange",this._onHashChange,!1),c.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),n.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){let c=this._map;if(!c)return"";let h=id(c);if(this._hashName){let g=this._hashName,y=!1,x=n.window.location.hash.slice(1).split("&").map(I=>{let D=I.split("=")[0];return D===g?(y=!0,`${D}=${h}`):I}).filter(I=>I);return y||x.push(`${g}=${h}`),`#${x.join("&")}`}return`#${h}`}_getCurrentHash(){let c=n.window.location.hash.replace("#","");if(this._hashName){let h;return c.split("&").map(g=>g.split("=")).forEach(g=>{g[0]===this._hashName&&(h=g)}),(h&&h[1]||"").split("/")}return c.split("/")}_onHashChange(){let c=this._map;if(!c)return!1;let h=this._getCurrentHash();if(h.length>=3&&!h.some(g=>isNaN(g))){let g=c.dragRotate.isEnabled()&&c.touchZoomRotate.isEnabled()?+(h[3]||0):c.getBearing();return c.jumpTo({center:[+h[2],+h[1]],zoom:+h[0],bearing:g,pitch:+(h[4]||0)}),!0}return!1}_updateHashUnthrottled(){let c=n.window.location.href.replace(/(#.+)?$/,this.getHashString());n.window.history.replaceState(n.window.history.state,null,c)}}function id(f,c){let h=f.getCenter(),g=Math.round(100*f.getZoom())/100,y=Math.ceil((g*Math.LN2+Math.log(512/360/.5))/Math.LN10),x=Math.pow(10,y),I=Math.round(h.lng*x)/x,D=Math.round(h.lat*x)/x,O=f.getBearing(),z=f.getPitch(),F=c?`/${I}/${D}/${g}`:`${g}/${D}/${I}`;return(O||z)&&(F+="/"+Math.round(10*O)/10),z&&(F+=`/${Math.round(z)}`),F}let nd={linearity:.3,easing:n.bezier(0,0,.3,1)},Lh=n.extend({deceleration:2500,maxSpeed:1400},nd),Fh=n.extend({deceleration:20,maxSpeed:1400},nd),Mt=n.extend({deceleration:1e3,maxSpeed:360},nd),cs=n.extend({deceleration:1e3,maxSpeed:90},nd);class q0{constructor(c){this._map=c,this.clear()}clear(){this._inertiaBuffer=[]}record(c){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:n.exported.now(),settings:c})}_drainInertiaBuffer(){let c=this._inertiaBuffer,h=n.exported.now();for(;c.length>0&&h-c[0].time>160;)c.shift()}_onMoveEnd(c){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;let h={zoom:0,bearing:0,pitch:0,pan:new n.Point(0,0),pinchAround:void 0,around:void 0};for(let{settings:x}of this._inertiaBuffer)h.zoom+=x.zoomDelta||0,h.bearing+=x.bearingDelta||0,h.pitch+=x.pitchDelta||0,x.panDelta&&h.pan._add(x.panDelta),x.around&&(h.around=x.around),x.pinchAround&&(h.pinchAround=x.pinchAround);let g=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,y={};if(h.pan.mag()){let x=od(h.pan.mag(),g,n.extend({},Lh,c||{}));y.offset=h.pan.mult(x.amount/h.pan.mag()),y.center=this._map.transform.center,rd(y,x)}if(h.zoom){let x=od(h.zoom,g,Fh);y.zoom=this._map.transform.zoom+x.amount,rd(y,x)}if(h.bearing){let x=od(h.bearing,g,Mt);
1311y.bearing=this._map.transform.bearing+n.clamp(x.amount,-179,179),rd(y,x)}if(h.pitch){let x=od(h.pitch,g,cs);y.pitch=this._map.transform.pitch+x.amount,rd(y,x)}if(y.zoom||y.bearing){let x=h.pinchAround===void 0?h.around:h.pinchAround;y.around=x?this._map.unproject(x):this._map.getCenter()}return this.clear(),y.noMoveStart=!0,y}}function rd(f,c){(!f.duration||f.duration<c.duration)&&(f.duration=c.duration,f.easing=c.easing)}function od(f,c,h){let{maxSpeed:g,linearity:y,deceleration:x}=h,I=n.clamp(f*y/(c/1e3),-g,g),D=Math.abs(I)/(x*y);return{easing:h.easing,duration:1e3*D,amount:I*(D/2)}}class Dr extends n.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,h,g,y={}){let x=jt(h.getCanvasContainer(),g),I=h.unproject(x);super(c,n.extend({point:x,lngLat:I,originalEvent:g},y)),this._defaultPrevented=!1,this.target=h}}class sd extends n.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,h,g){let y=c==="touchend"?g.changedTouches:g.touches,x=$t(h.getCanvasContainer(),y),I=x.map(O=>h.unproject(O)),D=x.reduce((O,z,F,U)=>O.add(z.div(U.length)),new n.Point(0,0));super(c,{points:x,point:D,lngLats:I,lngLat:h.unproject(D),originalEvent:g}),this._defaultPrevented=!1}}class Nh extends n.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,h,g){super(c,{originalEvent:g}),this._defaultPrevented=!1}}class Dm{constructor(c,h){this._map=c,this._clickTolerance=h.clickTolerance}reset(){this._mousedownPos=void 0}wheel(c){return this._firePreventable(new Nh(c.type,this._map,c))}mousedown(c,h){return this._mousedownPos=h,this._firePreventable(new Dr(c.type,this._map,c))}mouseup(c){this._map.fire(new Dr(c.type,this._map,c))}preclick(c){let h=n.extend({},c);h.type="preclick",this._map.fire(new Dr(h.type,this._map,h))}click(c,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||(this.preclick(c),this._map.fire(new Dr(c.type,this._map,c)))}dblclick(c){return this._firePreventable(new Dr(c.type,this._map,c))}mouseover(c){this._map.fire(new Dr(c.type,this._map,c))}mouseout(c){this._map.fire(new Dr(c.type,this._map,c))}touchstart(c){return this._firePreventable(new sd(c.type,this._map,c))}touchmove(c){this._map.fire(new sd(c.type,this._map,c))}touchend(c){this._map.fire(new sd(c.type,this._map,c))}touchcancel(c){this._map.fire(new sd(c.type,this._map,c))}_firePreventable(c){if(this._map.fire(c),c.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class zh{constructor(c){this._map=c}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(c){this._map.fire(new Dr(c.type,this._map,c))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(c){this._delayContextMenu?this._contextMenuEvent=c:this._map.fire(new Dr(c.type,this._map,c)),this._map.listens("contextmenu")&&c.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class W0{constructor(c,h){this._map=c,this._el=c.getCanvasContainer(),this._container=c.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(c,h){this.isEnabled()&&c.shiftKey&&c.button===0&&(Ye(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(c,h){if(!this._active)return;let g=h,y=this._startPos,x=this._lastPos;if(!y||!x||x.equals(g)||!this._box&&g.dist(y)<this._clickTolerance)return;this._lastPos=g,this._box||(this._box=j("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",c));let I=Math.min(y.x,g.x),D=Math.max(y.x,g.x),O=Math.min(y.y,g.y),z=Math.max(y.y,g.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${I}px,${O}px)`,this._box.style.width=D-I+"px",this._box.style.height=z-O+"px")})}mouseupWindow(c,h){if(!this._active)return;let g=this._startPos,y=h;if(g&&c.button===0){if(this.reset(),Lt(),g.x!==y.x||g.y!==y.y)return this._map.fire(new n.Event("boxzoomend",{originalEvent:c})),{cameraAnimation:x=>x.fitScreenCoordinates(g,y,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",c)}}keydown(c){this._active&&c.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",c))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),$e(),delete this._startPos,delete this._lastPos}_fireEvent(c,h){return this._map.fire(new n.Event(c,{originalEvent:h}))}}function jh(f,c){let h={};for(let g=0;g<f.length;g++)h[f[g].identifier]=c[g];return h}class Rc{constructor(c){this.reset(),this.numTouches=c.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(c,h,g){(this.centroid||g.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=c.timeStamp),g.length===this.numTouches&&(this.centroid=function(y){let x=new n.Point(0,0);for(let I of y)x._add(I);return x.div(y.length)}(h),this.touches=jh(g,h)))}touchmove(c,h,g){if(this.aborted||!this.centroid)return;let y=jh(g,h);for(let x in this.touches){let I=y[x];(!I||I.dist(this.touches[x])>30)&&(this.aborted=!0)}}touchend(c,h,g){if((!this.centroid||c.timeStamp-this.startTime>500)&&(this.aborted=!0),g.length===0){let y=!this.aborted&&this.centroid;if(this.reset(),y)return y}}}class Mm{constructor(c){this.singleTap=new Rc(c),this.numTaps=c.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(c,h,g){this.singleTap.touchstart(c,h,g)}touchmove(c,h,g){this.singleTap.touchmove(c,h,g)}touchend(c,h,g){let y=this.singleTap.touchend(c,h,g);
1311if(y){let x=c.timeStamp-this.lastTime<500,I=!this.lastTap||this.lastTap.dist(y)<30;if(x&&I||this.reset(),this.count++,this.lastTime=c.timeStamp,this.lastTap=y,this.count===this.numTaps)return this.reset(),y}}}class Z1{constructor(){this._zoomIn=new Mm({numTouches:1,numTaps:2}),this._zoomOut=new Mm({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(c,h,g){this._zoomIn.touchstart(c,h,g),this._zoomOut.touchstart(c,h,g)}touchmove(c,h,g){this._zoomIn.touchmove(c,h,g),this._zoomOut.touchmove(c,h,g)}touchend(c,h,g){let y=this._zoomIn.touchend(c,h,g),x=this._zoomOut.touchend(c,h,g);return y?(this._active=!0,c.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:I.getZoom()+1,around:I.unproject(y)},{originalEvent:c})}):x?(this._active=!0,c.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:I.getZoom()-1,around:I.unproject(x)},{originalEvent:c})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}let Z0={0:1,2:2};class Lc{constructor(c){this.reset(),this._clickTolerance=c.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(c,h){return!1}_move(c,h){return{}}mousedown(c,h){if(this._lastPoint)return;let g=tn(c);this._correctButton(c,g)&&(this._lastPoint=h,this._eventButton=g)}mousemoveWindow(c,h){let g=this._lastPoint;if(g){if(c.preventDefault(),this._eventButton!=null&&function(y,x){let I=Z0[x];return y.buttons===void 0||(y.buttons&I)!==I}(c,this._eventButton))this.reset();else if(this._moved||!(h.dist(g)<this._clickTolerance))return this._moved=!0,this._lastPoint=h,this._move(g,h)}}mouseupWindow(c){this._lastPoint&&tn(c)===this._eventButton&&(this._moved&&Lt(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class km extends Lc{mousedown(c,h){super.mousedown(c,h),this._lastPoint&&(this._active=!0)}_correctButton(c,h){return h===0&&!c.ctrlKey}_move(c,h){return{around:h,panDelta:h.sub(c)}}}class Am extends Lc{_correctButton(c,h){return h===0&&c.ctrlKey||h===2}_move(c,h){let g=.8*(h.x-c.x);if(g)return this._active=!0,{bearingDelta:g}}contextmenu(c){c.preventDefault()}}class Pm extends Lc{_correctButton(c,h){return h===0&&c.ctrlKey||h===2}_move(c,h){let g=-.5*(h.y-c.y);if(g)return this._active=!0,{pitchDelta:g}}contextmenu(c){c.preventDefault()}}class Vh{constructor(c,h){this._map=c,this._el=c.getCanvasContainer(),this._minTouches=1,this._clickTolerance=h.clickTolerance||1,this.reset(),n.bindAll(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new n.Point(0,0)}touchstart(c,h,g){return this._calculateTransform(c,h,g)}touchmove(c,h,g){if(this._active&&!(g.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(g.length===1&&!n.isFullscreen())return void this._showTouchPanBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return c.cancelable&&c.preventDefault(),this._calculateTransform(c,h,g)}}touchend(c,h,g){this._calculateTransform(c,h,g),this._active&&g.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(c,h,g){g.length>0&&(this._active=!0);let y=jh(g,h),x=new n.Point(0,0),I=new n.Point(0,0),D=0;for(let z in y){let F=y[z],U=this._touches[z];U&&(x._add(F),I._add(F.sub(U)),D++,y[z]=F)}if(this._touches=y,D<this._minTouches||!I.mag())return;let O=I.div(D);return this._sum._add(O),this._sum.mag()<this._clickTolerance?void 0:{around:x.div(D),panDelta:O}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=j("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")},500)}}class ad{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(c){}_move(c,h,g){return{}}touchstart(c,h,g){this._firstTwoTouches||g.length<2||(this._firstTwoTouches=[g[0].identifier,g[1].identifier],this._start([h[0],h[1]]))}touchmove(c,h,g){let y=this._firstTwoTouches;if(!y)return;c.preventDefault();let[x,I]=y,D=ld(g,h,x),O=ld(g,h,I);if(!D||!O)return;let z=this._aroundCenter?null:D.add(O).div(2);return this._move([D,O],z,c)}touchend(c,h,g){if(!this._firstTwoTouches)return;let[y,x]=this._firstTwoTouches,I=ld(g,h,y),D=ld(g,h,x);I&&D||(this._active&&Lt(),this.reset())}touchcancel(){this.reset()}enable(c){this._enabled=!0,this._aroundCenter=!!c&&c.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ld(f,c,h){for(let g=0;g<f.length;g++)if(f[g].identifier===h)return c[g]}
1311function Om(f,c){return Math.log(f/c)/Math.LN2}class K0 extends ad{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(c){this._startDistance=this._distance=c[0].dist(c[1])}_move(c,h){let g=this._distance;if(this._distance=c[0].dist(c[1]),this._active||!(Math.abs(Om(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Om(this._distance,g),pinchAround:h}}}function Rm(f,c){return 180*f.angleWith(c)/Math.PI}class X0 extends ad{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(c){this._startVector=this._vector=c[0].sub(c[1]),this._minDiameter=c[0].dist(c[1])}_move(c,h){let g=this._vector;if(this._vector=c[0].sub(c[1]),g&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Rm(this._vector,g),pinchAround:h}}_isBelowThreshold(c){this._minDiameter=Math.min(this._minDiameter,c.mag());let h=25/(Math.PI*this._minDiameter)*360,g=this._startVector;if(!g)return!1;let y=Rm(c,g);return Math.abs(y)<h}}function Ba(f){return Math.abs(f.y)>Math.abs(f.x)}class Y0 extends ad{constructor(c){super(),this._map=c}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(c){this._lastPoints=c,Ba(c[0].sub(c[1]))&&(this._valid=!1)}_move(c,h,g){let y=this._lastPoints;if(!y)return;let x=c[0].sub(y[0]),I=c[1].sub(y[1]);return this._map._cooperativeGestures&&!n.isFullscreen()&&g.touches.length<3||(this._valid=this.gestureBeginsVertically(x,I,g.timeStamp),!this._valid)?void 0:(this._lastPoints=c,this._active=!0,{pitchDelta:(x.y+I.y)/2*-.5})}gestureBeginsVertically(c,h,g){if(this._valid!==void 0)return this._valid;let y=c.mag()>=2,x=h.mag()>=2;if(!y&&!x)return;if(!y||!x)return this._firstMove==null&&(this._firstMove=g),g-this._firstMove<100&&void 0;let I=c.y>0==h.y>0;return Ba(c)&&Ba(h)&&I}}let Q0={panStep:100,bearingStep:15,pitchStep:10};class K1{constructor(){let c=Q0;this._panStep=c.panStep,this._bearingStep=c.bearingStep,this._pitchStep=c.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(c){if(c.altKey||c.ctrlKey||c.metaKey)return;let h=0,g=0,y=0,x=0,I=0;switch(c.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:c.shiftKey?g=-1:(c.preventDefault(),x=-1);break;case 39:c.shiftKey?g=1:(c.preventDefault(),x=1);break;case 38:c.shiftKey?y=1:(c.preventDefault(),I=-1);break;case 40:c.shiftKey?y=-1:(c.preventDefault(),I=1);break;default:return}return this._rotationDisabled&&(g=0,y=0),{cameraAnimation:D=>{let O=D.getZoom();D.easeTo({duration:300,easeId:"keyboardHandler",easing:J0,zoom:h?Math.round(O)+h*(c.shiftKey?2:1):O,bearing:D.getBearing()+g*this._bearingStep,pitch:D.getPitch()+y*this._pitchStep,offset:[-x*this._panStep,-I*this._panStep],center:D.getCenter()},{originalEvent:c})}}}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 J0(f){return f*(2-f)}let Lm=4.000244140625;class ev{constructor(c,h){this._map=c,this._el=c.getCanvasContainer(),this._handler=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,n.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(c){this._defaultZoomRate=c}setWheelZoomRate(c){this._wheelZoomRate=c}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(c){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!c&&c.around==="center",this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(c){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(c.ctrlKey||c.metaKey||this.isZooming()||n.isFullscreen()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let h=c.deltaMode===n.window.WheelEvent.DOM_DELTA_LINE?40*c.deltaY:c.deltaY,g=n.exported.now(),y=g-(this._lastWheelEventTime||0);this._lastWheelEventTime=g,h!==0&&h%Lm==0?this._type="wheel":h!==0&&Math.abs(h)<4?this._type="trackpad":y>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,c)):this._type||(this._type=Math.abs(y*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),c.shift
1311Key&&h&&(h/=4),this._type&&(this._lastWheelEvent=c,this._delta-=h,this._active||this._start(c)),c.preventDefault()}_onTimeout(c){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(c)}_start(c){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);let h=jt(this._el,c);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:h,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;let c=this._map.transform;this._type==="wheel"&&c.projection.wrap&&(c._center.lng>=180||c._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);let h=()=>c._terrainEnabled()&&this._aroundCoord?c.computeZoomRelativeTo(this._aroundCoord):c.zoom;if(this._delta!==0){let O=this._type==="wheel"&&Math.abs(this._delta)>Lm?this._wheelZoomRate:this._defaultZoomRate,z=2/(1+Math.exp(-Math.abs(this._delta*O)));this._delta<0&&z!==0&&(z=1/z);let F=h(),U=Math.pow(2,F),X=typeof this._targetZoom=="number"?c.zoomScale(this._targetZoom):U;this._targetZoom=Math.min(c.maxZoom,Math.max(c.minZoom,c.scaleZoom(X*z))),this._type==="wheel"&&(this._startZoom=F,this._easing=this._smoothOutEasing(200)),this._delta=0}let g=typeof this._targetZoom=="number"?this._targetZoom:h(),y=this._startZoom,x=this._easing,I,D=!1;if(this._type==="wheel"&&y&&x){let O=Math.min((n.exported.now()-this._lastWheelEventTime)/200,1),z=x(O);I=n.number(y,g,z),O<1?this._frameId||(this._frameId=!0):D=!0}else I=g,D=!0;return this._active=!0,D&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!D,zoomDelta:I-h(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(c){let h=n.ease;if(this._prevEase){let g=this._prevEase,y=(n.exported.now()-g.start)/g.duration,x=g.easing(y+.01)-g.easing(y),I=.27/Math.sqrt(x*x+1e-4)*.01,D=Math.sqrt(.0729-I*I);h=n.bezier(I,D,.25,1)}return this._prevEase={start:n.exported.now(),duration:c,easing:h},h}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=j("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(n.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 tv{constructor(c,h){this._clickZoom=c,this._tapZoom=h}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 Kr{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(c,h){return c.preventDefault(),{cameraAnimation:g=>{g.easeTo({duration:300,zoom:g.getZoom()+(c.shiftKey?-1:1),around:g.unproject(h)},{originalEvent:c})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class X1{constructor(){this._tap=new Mm({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(c,h,g){this._swipePoint||(this._tapTime&&c.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?g.length>0&&(this._swipePoint=h[0],this._swipeTouch=g[0].identifier):this._tap.touchstart(c,h,g))}touchmove(c,h,g){if(this._tapTime){if(this._swipePoint){if(g[0].identifier!==this._swipeTouch)return;let y=h[0],x=y.y-this._swipePoint.y;return this._swipePoint=y,c.preventDefault(),this._active=!0,{zoomDelta:x/128}}}else this._tap.touchmove(c,h,g)}touchend(c,h,g){this._tapTime?this._swipePoint&&g.length===0&&this.reset():this._tap.touchend(c,h,g)&&(this._tapTime=c.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class iv{constructor(c,h,g){this._el=c,this._mousePan=h,this._touchPan=g}enable(c){this._inertiaOptions=c||{},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 Y1{constructor(c,h,g){this._pitchWithRotate=c.pitchWithRotate,this._mouseRotate=h,this._mousePitch=g}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 Q1{constructor(c,h,g,y){this._el=c,this._touchZoom=h,this._touchRotate=g,this._tapDragZoom=y,this._rotationDisabled=!1,this._enabled=!0}enable(c){this._touchZoom.enable(c),this._rotationDisabled||this._touchRotate.enable(c),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()}}let qo=f=>f.zoom||f.drag||f.pitch||f.rotate;class nv extends n.Event{}class J1{constructor(){this.constants=[1,1,.01],this.radius=0}setup(c,h){let g=n.sub([],h,c);this.radius=n.length(g[2]<0?n.div([],g,this.constants):[g[0],g[1],0])}projectRay(c){n.div(c,c,this.constants),n.normalize(c,c),n.mul$1(c,c,this.constants);let h=n.scale$2([],c,this.radius);if(h[2]>0){let g=n.scale$2([],[0,0,1],n.dot(h,[0,0,1])),y=n.scale$2([],n.normalize([],[h[0],h[1],0]),this.radius),x=n.add([],h,n.scale$2([],n.sub([],n.add([],y,g),h),2));h[0]=x[0],h[1]=x[1]}return h}}function us(f){return f.panDelta&&f.panDelta.mag()||f.zoomDelta||f.bearingDelta||f.pitchDelta}class Rs{constructor(c,h){this._map=c,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new q0(c),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new J1,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(h),n.bindAll(["handleEvent","handleWindowEvent"],this);let g=this._el;this._listeners=[[g,"touchstart",{passive:!0}],[g,"touchmove",{passive:!1}],[g,"touchend",void 0],[g,"touchcancel",void 0],[g,"mousedown",void 0],[g,"mousemove",void 0],[g,"mouseup",void 0],[n.window.document,"mousemove",{capture:!0}],[n.window.document,"mouseup",void 0],[g,"mouseover",void 0],[g,"mouseout",void 0],[g,"dblclick",void 0],[g,"click",void 0],[g,"keydown",{capture:!1}],[g,"keyup",void 0],[g,"wheel",{passive:!1}],[g,"contextmenu",void 0],[n.window,"blur",void 0]];for(let[y,x,I]of this._listeners)y.addEventListener(x,y===n.window.document?this.handleWindowEvent:this.handleEvent,I)}destroy(){for(let[c,h,g]of this._listeners)c.removeEventListener(h,c===n.window.document?this.handleWindowEvent:this.handleEvent,g)}_addDefaultHandlers(c){let h=this._map,g=h.getCanvasContainer();this._add("mapEvent",new Dm(h,c));let y=h.boxZoom=new W0(h,c);this._add("boxZoom",y);let x=new Z1,I=new Kr;h.doubleClickZoom=new tv(I,x),this._add("tapZoom",x),this._add("clickZoom",I);let D=new X1;this._add("tapDragZoom",D);let O=h.touchPitch=new Y0(h);this._add("touchPitch",O);let z=new Am(c),F=new Pm(c);h.dragRotate=new Y1(c,z,F),this._add("mouseRotate",z,["mousePitch"]),this._add("mousePitch",F,["mouseRotate"]);let U=new km(c),X=new Vh(h,c);h.dragPan=new iv(g,U,X),this._add("mousePan",U),this._add("touchPan",X,["touchZoom","touchRotate"]);let J=new X0,te=new K0;h.touchZoomRotate=new Q1(g,te,J,D),this._add("touchRotate",J,["touchPan","touchZoom"]),this._add("touchZoom",te,["touchPan","touchRotate"]),this._add("blockableMapEvent",new zh(h));let ee=h.scrollZoom=new ev(h,this);this._add("scrollZoom",ee,["mousePan"]);let ne=h.keyboard=new K1;this._add("keyboard",ne);for(let H of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])c.interactive&&c[H]&&h[H].enable(c[H])}_add(c,h,g){this._handlers.push({handlerName:c,handler:h,allowed:g}),this._handlersById[c]=h}stop(c){if(!this._updatingCamera){for(let{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},c),this._changes=[]}}isActive(){for(let{handler:c}of this._handlers)if(c.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!qo(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(c,h,g){for(let y in c)if(y!==g&&(!h||h.indexOf(y)<0))return!0;return!1}handleWindowEvent(c){this.handleEvent(c,`${c.type}Window`)}_getMapTouches(c){let h=[];for(let g of c)this._el.contains(g.target)&&h.push(g);return h}handleEvent(c,h){this._updatingCamera=!0;
1311let g=c.type==="renderFrame",y=g?void 0:c,x={needsRenderFrame:!1},I={},D={},O=c.touches?this._getMapTouches(c.touches):void 0,z=O?$t(this._el,O):g?void 0:jt(this._el,c);for(let{handlerName:X,handler:J,allowed:te}of this._handlers){if(!J.isEnabled())continue;let ee;this._blockedByActive(D,te,X)?J.reset():J[h||c.type]&&(ee=J[h||c.type](c,z,O),this.mergeHandlerResult(x,I,ee,X,y),ee&&ee.needsRenderFrame&&this._triggerRenderFrame()),(ee||J.isActive())&&(D[X]=J)}let F={};for(let X in this._previousActiveHandlers)D[X]||(F[X]=y);this._previousActiveHandlers=D,(Object.keys(F).length||us(x))&&(this._changes.push([x,I,F]),this._triggerRenderFrame()),(Object.keys(D).length||us(x))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:U}=x;U&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],U(this._map))}mergeHandlerResult(c,h,g,y,x){if(!g)return;n.extend(c,g);let I={handlerName:y,originalEvent:g.originalEvent||x};g.zoomDelta!==void 0&&(h.zoom=I),g.panDelta!==void 0&&(h.drag=I),g.pitchDelta!==void 0&&(h.pitch=I),g.bearingDelta!==void 0&&(h.rotate=I)}_applyChanges(){let c={},h={},g={};for(let[y,x,I]of this._changes)y.panDelta&&(c.panDelta=(c.panDelta||new n.Point(0,0))._add(y.panDelta)),y.zoomDelta&&(c.zoomDelta=(c.zoomDelta||0)+y.zoomDelta),y.bearingDelta&&(c.bearingDelta=(c.bearingDelta||0)+y.bearingDelta),y.pitchDelta&&(c.pitchDelta=(c.pitchDelta||0)+y.pitchDelta),y.around!==void 0&&(c.around=y.around),y.aroundCoord!==void 0&&(c.aroundCoord=y.aroundCoord),y.pinchAround!==void 0&&(c.pinchAround=y.pinchAround),y.noInertia&&(c.noInertia=y.noInertia),n.extend(h,x),n.extend(g,I);this._updateMapTransform(c,h,g),this._changes=[]}_updateMapTransform(c,h,g){let y=this._map,x=y.transform,I=Q=>[Q.x,Q.y,Q.z];if((Q=>{let le=this._eventsInProgress.drag;return le&&!this._handlersById[le.handlerName].isActive()})()&&!us(c)){let Q=x.zoom;x.cameraElevationReference="sea",x.recenterOnTerrain(),x.cameraElevationReference="ground",Q!==x.zoom&&this._map._update(!0)}if(x._isCameraConstrained&&y._stop(!0),!us(c))return void this._fireEvents(h,g,!0);let{panDelta:D,zoomDelta:O,bearingDelta:z,pitchDelta:F,around:U,aroundCoord:X,pinchAround:J}=c;x._isCameraConstrained&&(O>0&&(O=0),x._isCameraConstrained=!1),J!==void 0&&(U=J),(O||(Q=>h[Q]&&!this._eventsInProgress[Q])("drag"))&&U&&(this._dragOrigin=I(x.pointCoordinate3D(U)),this._trackingEllipsoid.setup(x._camera.position,this._dragOrigin)),x.cameraElevationReference="sea",y._stop(!0),U=U||y.transform.centerPoint,z&&(x.bearing+=z),F&&(x.pitch+=F),x._updateCameraState();let te=[0,0,0];if(D)if(x.projection.name==="mercator"){let Q=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(U).dir),le=this._trackingEllipsoid.projectRay(x.screenPointToMercatorRay(U.sub(D)).dir);te[0]=le[0]-Q[0],te[1]=le[1]-Q[1]}else{let Q=x.pointCoordinate(U);if(x.projection.name==="globe"){D=D.rotate(-x.angle);let le=x._pixelsPerMercatorPixel/x.worldSize;te[0]=-D.x*n.mercatorScale(n.latFromMercatorY(Q.y))*le,te[1]=-D.y*n.mercatorScale(x.center.lat)*le}else{let le=x.pointCoordinate(U.sub(D));Q&&le&&(te[0]=le.x-Q.x,te[1]=le.y-Q.y)}}let ee=x.zoom,ne=[0,0,0];if(O){let Q=I(X||x.pointCoordinate3D(U)),le={dir:n.normalize([],n.sub([],Q,x._camera.position))};if(le.dir[2]<0){let ue=x.zoomDeltaToMovement(Q,O);n.scale$2(ne,le.dir,ue)}}let H=n.add(te,te,ne);x._translateCameraConstrained(H),O&&Math.abs(x.zoom-ee)>1e-4&&x.recenterOnTerrain(),x.cameraElevationReference="ground",this._map._update(),c.noInertia||this._inertia.record(c),this._fireEvents(h,g,!0)}_fireEvents(c,h,g){let y=qo(this._eventsInProgress),x=qo(c),I={};for(let F in c){let{originalEvent:U}=c[F];this._eventsInProgress[F]||(I[`${F}start`]=U),this._eventsInProgress[F]=c[F]}!y&&x&&this._fireEvent("movestart",x.originalEvent);for(let F in I)this._fireEvent(F,I[F]);x&&this._fireEvent("move",x.originalEvent);for(let F in c){let{originalEvent:U}=c[F];this._fireEvent(F,U)}let D={},O;for(let F in this._eventsInProgress){let{handlerName:U,originalEvent:X}=this._eventsInProgress[F];this._handlersById[U].isActive()||(delete this._eventsInProgress[F],O=h[U]||X,D[`${F}end`]=O)}for(let F in D)this._fireEvent(F,D[F]);let z=qo(this._eventsInProgress);if(g&&(y||x)&&!z){this._updatingCamera=!0;let F=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),U=X=>X!==0&&-this._bearingSnap<X&&X<this._bearingSnap;
1311F?(U(F.bearing||this._map.getBearing())&&(F.bearing=0),this._map.easeTo(F,{originalEvent:O})):(this._map.fire(new n.Event("moveend",{originalEvent:O})),U(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(c,h){this._map.fire(new n.Event(c,h?{originalEvent:h}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(c=>{this._frameId=void 0,this.handleEvent(new nv("renderFrame",{timeStamp:c})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}let zl="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Bh extends n.Evented{constructor(c,h){super(),this._moving=!1,this._zooming=!1,this.transform=c,this._bearingSnap=h.bearingSnap,this._respectPrefersReducedMotion=h.respectPrefersReducedMotion!==!1,n.bindAll(["_renderFrameCallback"],this)}getCenter(){return new n.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(c,h){return this.jumpTo({center:c},h)}panBy(c,h,g){return c=n.Point.convert(c).mult(-1),this.panTo(this.transform.center,n.extend({offset:c},h),g)}panTo(c,h,g){return this.easeTo(n.extend({center:c},h),g)}getZoom(){return this.transform.zoom}setZoom(c,h){return this.jumpTo({zoom:c},h),this}zoomTo(c,h,g){return this.easeTo(n.extend({zoom:c},h),g)}zoomIn(c,h){return this.zoomTo(this.getZoom()+1,c,h),this}zoomOut(c,h){return this.zoomTo(this.getZoom()-1,c,h),this}getBearing(){return this.transform.bearing}setBearing(c,h){return this.jumpTo({bearing:c},h),this}getPadding(){return this.transform.padding}setPadding(c,h){return this.jumpTo({padding:c},h),this}rotateTo(c,h,g){return this.easeTo(n.extend({bearing:c},h),g)}resetNorth(c,h){return this.rotateTo(0,n.extend({duration:1e3},c),h),this}resetNorthPitch(c,h){return this.easeTo(n.extend({bearing:0,pitch:0,duration:1e3},c),h),this}snapToNorth(c,h){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(c,h):this}getPitch(){return this.transform.pitch}setPitch(c,h){return this.jumpTo({pitch:c},h),this}cameraForBounds(c,h){c=n.LngLatBounds.convert(c);let g=h&&h.bearing||0,y=h&&h.pitch||0,x=c.getNorthWest(),I=c.getSouthEast();return this._cameraForBounds(this.transform,x,I,g,y,h)}_extendCameraOptions(c){let h={top:0,bottom:0,right:0,left:0};if(typeof(c=n.extend({padding:h,offset:[0,0],maxZoom:this.transform.maxZoom},c)).padding=="number"){let g=c.padding;c.padding={top:g,bottom:g,right:g,left:g}}return c.padding=n.extend(h,c.padding),c}_minimumAABBFrustumDistance(c,h){let g=h.max[0]-h.min[0],y=h.max[1]-h.min[1];return g/y>c.aspect?g/(2*Math.tan(.5*c.fovX)*c.aspect):y/(2*Math.tan(.5*c.fovY)*c.aspect)}_cameraForBoundsOnGlobe(c,h,g,y,x,I){let D=c.clone(),O=this._extendCameraOptions(I);D.bearing=y,D.pitch=x;let z=n.LngLat.convert(h),F=n.LngLat.convert(g),U=.5*(z.lat+F.lat),X=.5*(z.lng+F.lng),J=n.latLngToECEF(U,X),te=n.normalize([],J),ee=n.normalize([],n.cross([],te,[0,1,0])),ne=n.cross([],ee,te),H=[ee[0],ee[1],ee[2],0,ne[0],ne[1],ne[2],0,te[0],te[1],te[2],0,0,0,0,1],Q=[J,n.latLngToECEF(z.lat,z.lng),n.latLngToECEF(F.lat,z.lng),n.latLngToECEF(F.lat,F.lng),n.latLngToECEF(z.lat,F.lng),n.latLngToECEF(U,z.lng),n.latLngToECEF(U,F.lng),n.latLngToECEF(z.lat,X),n.latLngToECEF(F.lat,X)],le=n.Aabb.fromPoints(Q.map(Je=>[n.dot(ee,Je),n.dot(ne,Je),n.dot(te,Je)])),ue=n.transformMat4([],le.center,H);n.squaredLength(ue)===0&&n.set(ue,0,0,1),n.normalize(ue,ue),n.scale$2(ue,ue,n.GLOBE_RADIUS),D.center=n.ecefToLatLng(ue);let ye=D.getWorldToCameraMatrix(),xe=n.invert(new Float64Array(16),ye);le=n.Aabb.applyTransform(le,n.multiply([],ye,H)),n.transformMat4(ue,ue,ye);let be=.5*(le.max[2]-le.min[2]),De=this._minimumAABBFrustumDistance(D,le),Ie=n.scale$2([],[0,0,1],be),Re=n.add(Ie,ue,Ie),nt=De+(D.pitch===0?0:n.distance(ue,Re)),Ae=D.globeCenterInViewSpace,Ze=n.sub([],ue,[Ae[0],Ae[1],Ae[2]]);n.normalize(Ze,Ze),n.scale$2(Ze,Ze,nt);let Ne=n.add([],ue,Ze);n.transformMat4(Ne,Ne,xe);let it=n.earthRadius/n.GLOBE_RADIUS,Oe=n.length(Ne),qe=n.mercatorZfromAltitude(Math.max(Oe*it-n.earthRadius,Number.EPSILON),0),ot=Math.min(D.zoomFromMercatorZAdjusted(qe),O.maxZoom);return ot>.5*(n.GLOBE_ZOOM_THRESHOLD_MIN+n.GLOBE_ZOOM_THRESHOLD_MAX)?(D.setProjection({name:"mercator"}),D.zoom=ot,this._cameraForBounds(D,h,g,y,x,I)):{center:D.center,zoom:ot,bearing:y,pitch:x}}queryTerrainElevation(c,h){let g=this.transform.elevation;return g?(h=n.extend({},{exaggerated:!0},h),g.getAtPoint(n.MercatorCoordinate.fromLngLat(c),null,h.exaggerated)):null}_cameraForBounds(c,h,g,y,x,I){if(c.projection.name==="globe")return this._cameraForBoundsOnGlobe(c,h,g,y,x,I);let D=c.clone(),O=this._extendCameraOptions(I),z=D.padding;D.bearing=y,D.pitch=x;let F=n.LngLat.convert(h),U=n.LngLat.convert(g),X=new n.LngLat(F.lng,U.lat),J=new n.LngLat(U.lng,F.lat),te=D.project(F),ee=D.project(U),ne=this.queryTerrainElevation(F),H=this.queryTerrainElevation(U),Q=this.queryTerrainElevation(X),le=this.queryTerrainElevation(J),ue=[[te.x,te.y,Math.min(ne||0,H||0,Q||0,le||0)],[ee.x,ee.y,Math.max(ne||0,H||0,Q||0,le||0)]],ye=n.Aabb.fromPoints(ue),xe=D.getWorldToCameraMatrix(),be=n.invert(new Float64Array(16),xe);ye=n.Aabb.applyTransform(ye,xe);let De=n.sub([],ye.max,ye.min),Ie=z.left||0,Re=z.right||0,nt=z.bottom||0,Ae=z.top||0,{left:Ze,right:Ne,top:it,bottom:Oe}=O.padding,qe=.5*(Ie+Re),ot=.5*(Ae+nt),Je=Math.min(D.scaleZoom(D.scale*Math.min((D.width-(Ie+Re+Ze+Ne))/De[0],(D.height-(nt+Ae+Oe+it))/De[1])),O.maxZoom),lt=D.scale/D.zoomScale(Je);ye=new n.Aabb([ye.min[0]-(Ze+qe)*lt,ye.min[1]-(Oe+ot)*lt,ye.min[2]],[ye.max[0]+(Ne+qe)*lt,ye.max[1]+(it+ot)*lt,ye.max[2]]);let zt=.5*De[2],oi=this._minimumAABBFrustumDistance(D,ye),Ot=[0,0,1,0];n.transformMat4$1(Ot,Ot,xe),n.normalize$2(Ot,Ot);let Gt=n.scale$2([],Ot,oi+zt),Mi=n.add([],ye.center,Gt),Ci=(typeof O.offset.x=="number"&&typeof O.offset.y=="number"?new n.Point(O.offset.x,O.offset.y):n.Point.convert(O.offset)).rotate(-n.degToRad(y));ye.center[0]-=Ci.x*lt,ye.center[1]+=Ci.y*lt,n.transformMat4(ye.center,ye.center,be),n.transformMat4(Mi,Mi,be);let Nt=[ye.center[0],ye.center[1],Mi[2]*D.pixelsPerMeter];n.scale$2(Nt,Nt,1/D.worldSize);let an=n.lngFromMercatorX(Nt[0]),gn=n.latFromMercatorY(Nt[1]),_n=Math.min(D._zoomFromMercatorZ(Nt[2]),O.maxZoom),vn=new n.LngLat(an,gn);return D.mercatorFromTransition&&_n<.5*(n.GLOBE_ZOOM_THRESHOLD_MIN+n.GLOBE_ZOOM_THRESHOLD_MAX)?(D.setProjection({name:"globe"}),D.zoom=_n,this._cameraForBounds(D,h,g,y,x,I)):{center:vn,zoom:_n,bearing:y,pitch:x}}fitBounds(c,h,g){let y=this.cameraForBounds(c,h);return this._fitInternal(y,h,g)}fitScreenCoordinates(c,h,g,y,x){let I=n.Point.convert(c),D=n.Point.convert(h),O=new n.Point(Math.min(I.x,D.x),Math.min(I.y,D.y)),z=new n.Point(Math.max(I.x,D.x),Math.max(I.y,D.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(I,D))return this;let F=this.transform.pointLocation3D(O),U=this.transform.pointLocation3D(z),X=this.transform.pointLocation3D(new n.Point(O.x,z.y)),J=this.transform.pointLocation3D(new n.Point(z.x,O.y)),te=[Math.min(F.lng,U.lng,X.lng,J.lng),Math.min(F.lat,U.lat,X.lat,J.lat)],ee=[Math.max(F.lng,U.lng,X.lng,J.lng),Math.max(F.lat,U.lat,X.lat,J.lat)],ne=y&&y.pitch?y.pitch:this.getPitch(),H=this._cameraForBounds(this.transform,te,ee,g,ne,y);return this._fitInternal(H,y,x)}_fitInternal(c,h,g){return c?(delete(h=n.extend(c,h)).padding,h.linear?this.easeTo(h,g):this.flyTo(h,g)):this}jumpTo(c,h){this.stop();let g=c.preloadOnly?this.transform.clone():this.transform,y=!1,x=!1,I=!1;return"zoom"in c&&g.zoom!==+c.zoom&&(y=!0,g.zoom=+c.zoom),c.center!==void 0&&(g.center=n.LngLat.convert(c.center)),"bearing"in c&&g.bearing!==+c.bearing&&(x=!0,g.bearing=+c.bearing),"pitch"in c&&g.pitch!==+c.pitch&&(I=!0,g.pitch=+c.pitch),c.padding==null||g.isPaddingEqual(c.padding)||(g.padding=c.padding),c.preloadOnly?(this._preloadTiles(g),this):(this.fire(new n.Event("movestart",h)).fire(new n.Event("move",h)),y&&this.fire(new n.Event("zoomstart",h)).fire(new n.Event("zoom",h)).fire(new n.Event("zoomend",h)),x&&this.fire(new n.Event("rotatestart",h)).fire(new n.Event("rotate",h)).fire(new n.Event("rotateend",h)),I&&this.fire(new n.Event("pitchstart",h)).fire(new n.Event("pitch",h)).fire(new n.Event("pitchend",h)),this.fire(new n.Event("moveend",h)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||n.warnOnce(zl),this.transform.getFreeCameraOptions()}setFreeCameraOptions(c,h){let g=this.transform;if(!g.projection.supportsFreeCamera)return n.warnOnce(zl),this;this.stop();let y=g.zoom,x=g.pitch,I=g.bearing;g.setFreeCameraOptions(c);let D=y!==g.zoom,O=x!==g.pitch,z=I!==g.bearing;return this.fire(new n.Event("movestart",h)).fire(new n.Event("move",h)),D&&this.fire(new n.Event("zoomstart",h)).fire(new n.Event("zoom",h)).fire(new n.Event("zoomend",h)),z&&this.fire(new n.Event("rotatestart",h)).fire(new n.Event("rotate",h)).fire(new n.Event("rotateend",h)),O&&this.fire(new n.Event("pitchstart",h)).fire(new n.Event("pitch",h)).fire(new n.Event("pitchend",h)),this.fire(new n.Event("moveend",h)),this}easeTo(c,h){this._stop(!1,c.easeId),((c=n.extend({offset:[0,0],duration:500,easing:n.ease}
1311,c)).animate===!1||this._prefersReducedMotion(c))&&(c.duration=0);let g=this.transform,y=this.getZoom(),x=this.getBearing(),I=this.getPitch(),D=this.getPadding(),O="zoom"in c?+c.zoom:y,z="bearing"in c?this._normalizeBearing(c.bearing,x):x,F="pitch"in c?+c.pitch:I,U="padding"in c?c.padding:g.padding,X=n.Point.convert(c.offset),J,te,ee;if(g.projection.name==="globe"){let Ie=n.MercatorCoordinate.fromLngLat(g.center),Re=X.rotate(-g.angle);Ie.x+=Re.x/g.worldSize,Ie.y+=Re.y/g.worldSize;let nt=Ie.toLngLat(),Ae=n.LngLat.convert(c.center||nt);this._normalizeCenter(Ae),J=g.centerPoint.add(Re),te=new n.Point(Ie.x,Ie.y).mult(g.worldSize),ee=new n.Point(n.mercatorXfromLng(Ae.lng),n.mercatorYfromLat(Ae.lat)).mult(g.worldSize).sub(te)}else{J=g.centerPoint.add(X);let Ie=g.pointLocation(J),Re=n.LngLat.convert(c.center||Ie);this._normalizeCenter(Re),te=g.project(Ie),ee=g.project(Re).sub(te)}let ne=g.zoomScale(O-y),H,Q;c.around&&(H=n.LngLat.convert(c.around),Q=g.locationPoint(H));let le=this._zooming||O!==y,ue=this._rotating||x!==z,ye=this._pitching||F!==I,xe=!g.isPaddingEqual(U),be=Ie=>Re=>{if(le&&(Ie.zoom=n.number(y,O,Re)),ue&&(Ie.bearing=n.number(x,z,Re)),ye&&(Ie.pitch=n.number(I,F,Re)),xe&&(Ie.interpolatePadding(D,U,Re),J=Ie.centerPoint.add(X)),H)Ie.setLocationAtPoint(H,Q);else{let nt=Ie.zoomScale(Ie.zoom-y),Ae=O>y?Math.min(2,ne):Math.max(.5,ne),Ze=Math.pow(Ae,1-Re),Ne=Ie.unproject(te.add(ee.mult(Re*Ze)).mult(nt));Ie.setLocationAtPoint(Ie.renderWorldCopies?Ne.wrap():Ne,J)}return c.preloadOnly||this._fireMoveEvents(h),Ie};if(c.preloadOnly){let Ie=this._emulate(be,c.duration,g);return this._preloadTiles(Ie),this}let De={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=le,this._rotating=ue,this._pitching=ye,this._padding=xe,this._easeId=c.easeId,this._prepareEase(h,c.noMoveStart,De),this._ease(be(g),Ie=>{g.recenterOnTerrain(),this._afterEase(h,Ie)},c),this}_prepareEase(c,h,g={}){this._moving=!0,this.transform.cameraElevationReference="sea",h||g.moving||this.fire(new n.Event("movestart",c)),this._zooming&&!g.zooming&&this.fire(new n.Event("zoomstart",c)),this._rotating&&!g.rotating&&this.fire(new n.Event("rotatestart",c)),this._pitching&&!g.pitching&&this.fire(new n.Event("pitchstart",c))}_fireMoveEvents(c){this.fire(new n.Event("move",c)),this._zooming&&this.fire(new n.Event("zoom",c)),this._rotating&&this.fire(new n.Event("rotate",c)),this._pitching&&this.fire(new n.Event("pitch",c))}_afterEase(c,h){if(this._easeId&&h&&this._easeId===h)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";let g=this._zooming,y=this._rotating,x=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,g&&this.fire(new n.Event("zoomend",c)),y&&this.fire(new n.Event("rotateend",c)),x&&this.fire(new n.Event("pitchend",c)),this.fire(new n.Event("moveend",c))}flyTo(c,h){if(this._prefersReducedMotion(c)){let Je=n.pick(c,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Je,h)}this.stop(),c=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},c);let g=this.transform,y=this.getZoom(),x=this.getBearing(),I=this.getPitch(),D=this.getPadding(),O="zoom"in c?n.clamp(+c.zoom,g.minZoom,g.maxZoom):y,z="bearing"in c?this._normalizeBearing(c.bearing,x):x,F="pitch"in c?+c.pitch:I,U="padding"in c?c.padding:g.padding,X=g.zoomScale(O-y),J=n.Point.convert(c.offset),te=g.centerPoint.add(J),ee=g.pointLocation(te),ne=n.LngLat.convert(c.center||ee);this._normalizeCenter(ne);let H=g.project(ee),Q=g.project(ne).sub(H),le=c.curve,ue=Math.max(g.width,g.height),ye=ue/X,xe=Q.mag();if("minZoom"in c){let Je=n.clamp(Math.min(c.minZoom,y,O),g.minZoom,g.maxZoom),lt=ue/g.zoomScale(Je-y);le=Math.sqrt(lt/xe*2)}let be=le*le;function De(Je){let lt=(ye*ye-ue*ue+(Je?-1:1)*be*be*xe*xe)/(2*(Je?ye:ue)*be*xe);return Math.log(Math.sqrt(lt*lt+1)-lt)}function Ie(Je){return(Math.exp(Je)-Math.exp(-Je))/2}function Re(Je){return(Math.exp(Je)+Math.exp(-Je))/2}let nt=De(0),Ae=function(Je){return Re(nt)/Re(nt+le*Je)},Ze=function(Je){return ue*((Re(nt)*(Ie(lt=nt+le*Je)/Re(lt))-Ie(nt))/be)/xe;var lt},Ne=(De(1)-nt)/le;if(Math.abs(xe)<1e-6||!isFinite(Ne)){if(Math.abs(ue-ye)<1e-6)return this.easeTo(c,h);let Je=ye<ue?-1:1;Ne=Math.abs(Math.log(ye/ue))/le,Ze=function(){return 0},Ae=function(lt){return Math.exp(Je*le*lt)}}c.duration="duration"in c?+c.duration:1e3*Ne/("screenSpeed"in c?+c.screenSpeed/le:+c.speed),c.maxDuration&&c.duration>c.maxDuration&&(c.duration=0);let it=x!==z,Oe=F!==I,qe=!g.isPaddingEqual(U),ot=Je=>lt=>{let zt=lt*Ne,oi=1/Ae(zt);Je.zoom=lt===1?O:y+Je.scaleZoom(oi),it&&(Je.bearing=n.number(x,z,lt)),Oe&&(Je.pitch=n.number(I,F,lt)),qe&&(Je.interpolatePadding(D,U,lt),te=Je.centerPoint.add(J));let Ot=lt===1?ne:Je.unproject(H.add(Q.mult(Ze(zt))).mult(oi));return Je.setLocationAtPoint(Je.renderWorldCopies?Ot.wrap():Ot,te),Je._updateCameraOnTerrain(),c.preloadOnly||this._fireMoveEvents(h),Je};if(c.preloadOnly){let Je=this._emulate(ot,c.duration,g);return this._preloadTiles(Je),this}return this._zooming=!0,this._rotating=it,this._pitching=Oe,this._padding=qe,this._prepareEase(h,!1),this._ease(ot(g),()=>this._afterEase(h),c),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(c,h){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){let g=this._onEaseEnd;this._onEaseEnd=void 0,g.call(this,h)}if(!c){let g=this.handlers;g&&g.stop(!1)}return this}_ease(c,h,g){g.animate===!1||g.duration===0?(c(1),h()):(this._easeStart=n.exported.now(),this._easeOptions=g,this._onEaseFrame=c,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){let c=Math.min((n.exported.now()-this._easeStart)/this._easeOptions.duration,1),h=this._onEaseFrame;h&&h(this._easeOptions.easing(c)),c<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(c,h){c=n.wrap(c,-180,180);let g=Math.abs(c-h);return Math.abs(c-360-h)<g&&(c-=360),Math.abs(c+360-h)<g&&(c+=360),c}_normalizeCenter(c){let h=this.transform;if(!h.renderWorldCopies||h.maxBounds)return;let g=c.lng-h.center.lng;c.lng+=g>180?-360:g<-180?360:0}_prefersReducedMotion(c){return this._respectPrefersReducedMotion&&n.exported.prefersReducedMotion&&!(c&&c.essential)}_emulate(c,h,g){let y=Math.ceil(15*h/1e3),x=[],I=c(g.clone());for(let D=0;D<=y;D++){let O=I(D/y);x.push(O.clone())}return x}}class Pt{constructor(c={}){this.options=c,n.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(c){let h=this.options&&this.options.compact;return this._map=c,this._container=j("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=j("button","mapboxgl-ctrl-attrib-button",this._container),j("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=j("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),h&&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),h===void 0&&(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(c,h){let g=this._map._getUIString(`AttributionControl.${h}`);c.setAttribute("aria-label",g),c.removeAttribute("title"),c.firstElementChild&&c.firstElementChild.setAttribute("title",g)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
1311se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let c=this._editLink;c||(c=this._editLink=this._container.querySelector(".mapbox-improve-map"));let h=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||n.config.ACCESS_TOKEN}];if(c){let g=h.reduce((y,x,I)=>(x.value&&(y+=`${x.key}=${x.value}${I<h.length-1?"&":""}`),y),"?");c.href=`${n.config.FEEDBACK_URL}/${g}#${id(this._map,!0)}`,c.rel="noopener nofollow",this._setElementTitle(c,"MapFeedback")}}_updateData(c){!c||c.sourceDataType!=="metadata"&&c.sourceDataType!=="visibility"&&c.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let c=[];if(this._map.style.stylesheet){let y=this._map.style.stylesheet;this.styleOwner=y.owner,this.styleId=y.id}let h=this._map.style._sourceCaches;for(let y in h){let x=h[y];if(x.used){let I=x.getSource();I.attribution&&c.indexOf(I.attribution)<0&&c.push(I.attribution)}}c.sort((y,x)=>y.length-x.length),c=c.filter((y,x)=>{for(let I=x+1;I<c.length;I++)if(c[I].indexOf(y)>=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?c=[...this.options.customAttribution,...c]:c.unshift(this.options.customAttribution));let g=c.join(" | ");g!==this._attribHTML&&(this._attribHTML=g,c.length?(this._innerContainer.innerHTML=g,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 Fm{constructor(){n.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(c){this._map=c,this._container=j("div","mapboxgl-ctrl");let h=j("a","mapboxgl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://www.mapbox.com/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),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(c){c&&c.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;let c=this._map.style._sourceCaches;if(Object.entries(c).length===0)return!0;for(let h in c){let g=c[h].getSource();if(g.hasOwnProperty("mapbox_logo")&&!g.mapbox_logo)return!1}return!0}_updateCompact(){let c=this._container.children;if(c.length){let h=c[0];this._map.getCanvasContainer().offsetWidth<250?h.classList.add("mapboxgl-compact"):h.classList.remove("mapboxgl-compact")}}}class Nm{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(c){let h=++this._id;return this._queue.push({callback:c,id:h,cancelled:!1}),h}remove(c){let h=this._currentlyRunning,g=h?this._queue.concat(h):this._queue;for(let y of g)if(y.id===c)return void(y.cancelled=!0)}run(c=0){let h=this._currentlyRunning=this._queue;this._queue=[];for(let g of h)if(!g.cancelled&&(g.callback(c),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Fc(f,c,h){if(f=new n.LngLat(f.lng,f.lat),c){let g=new n.LngLat(f.lng-360,f.lat),y=new n.LngLat(f.lng+360,f.lat),x=360*Math.ceil(Math.abs(f.lng-h.center.lng)/360),I=h.locationPoint(f).distSqr(c),D=c.x<0||c.y<0||c.x>h.width||c.y>h.height;h.locationPoint(g).distSqr(c)<I&&(D||Math.abs(g.lng-h.center.lng)<x)?f=g:h.locationPoint(y).distSqr(c)<I&&(D||Math.abs(y.lng-h.center.lng)<x)&&(f=y)}for(;Math.abs(f.lng-h.center.lng)>180;){let g=h.locationPoint(f);if(g.x>=0&&g.y>=0&&g.x<=h.width&&g.y<=h.height)break;f.lng>h.center.lng?f.lng-=360:f.lng+=360}return f}
1311let jl={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 St extends n.Evented{constructor(c,h){if(super(),(c instanceof n.window.HTMLElement||h)&&(c=n.extend({element:c},h)),n.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=c&&c.anchor||"center",this._color=c&&c.color||"#3FB1CE",this._scale=c&&c.scale||1,this._draggable=c&&c.draggable||!1,this._clickTolerance=c&&c.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=c&&c.rotation||0,this._rotationAlignment=c&&c.rotationAlignment||"auto",this._pitchAlignment=c&&c.pitchAlignment&&c.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=c&&c.occludedOpacity||.2,c&&c.element)this._element=c.element,this._offset=n.Point.convert(c&&c.offset||[0,0]);else{this._defaultMarker=!0,this._element=j("div");let y=41,x=27,I=G("svg",{display:"block",height:y*this._scale+"px",width:x*this._scale+"px",viewBox:`0 0 ${x} ${y}`},this._element),D=G("radialGradient",{id:"shadowGradient"},G("defs",{},I));G("stop",{offset:"10%","stop-opacity":.4},D),G("stop",{offset:"100%","stop-opacity":.05},D),G("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},I),G("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"},I),G("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"},I),G("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},I),this._offset=n.Point.convert(c&&c.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",y=>{y.preventDefault()}),this._element.addEventListener("mousedown",y=>{y.preventDefault()});let g=this._element.classList;for(let y in jl)g.remove(`mapboxgl-marker-anchor-${y}`);g.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(c){return c===this._map||(this.remove(),this._map=c,c.getCanvasContainer().appendChild(this._element),c.on("move",this._updateMoving),c.on("moveend",this._update),c.on("remove",this._clearFadeTimer),c._addMarker(this),this.setDraggable(this._draggable),this._update(),c.on("click",this._onMapClick)),this}remove(){let c=this._map;return c&&(c.off("click",this._onMapClick),c.off("move",this._updateMoving),c.off("moveend",this._update),c.off("mousedown",this._addDragHandler),c.off("touchstart",this._addDragHandler),c.off("mouseup",this._onUp),c.off("touchend",this._onUp),c.off("mousemove",this._onMove),c.off("touchmove",this._onMove),c.off("remove",this._clearFadeTimer),c._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(c){return this._lngLat=n.LngLat.convert(c),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(c){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")),c){if(!("offset"in c.options)){let y=Math.sqrt(Math.pow(13.5,2)/2);c.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[y,-1*(38.1-13.5+y)],"bottom-right":[-y,-1*(38.1-13.5+y)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=c,c._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","fal
1311se")}return this}_onKeyPress(c){let h=c.code,g=c.charCode||c.keyCode;h!=="Space"&&h!=="Enter"&&g!==32&&g!==13||this.togglePopup()}_onMapClick(c){let h=c.originalEvent.target,g=this._element;this._popup&&(h===g||g.contains(h))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){let c=this._popup;return c?(c.isOpen()?(c.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(c.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){let c=this._map,h=this._pos;if(!c||!h)return!1;let g=c.unproject(h),y=c.getFreeCameraOptions();if(!y.position)return!1;let x=y.position.toLngLat();return x.distanceTo(g)<.9*x.distanceTo(this._lngLat)}_evaluateOpacity(){let c=this._map;if(!c)return;let h=this._pos;if(!h||h.x<0||h.x>c.transform.width||h.y<0||h.y>c.transform.height)return void this._clearFadeTimer();let g=c.unproject(h),y;c._showingGlobe()&&n.isLngLatBehindGlobe(c.transform,this._lngLat)?y=0:(y=1-c._queryFogOpacity(g),c.transform._terrainEnabled()&&c.getTerrain()&&this._behindTerrain()&&(y*=this._occludedOpacity)),this._element.style.opacity=`${y}`,this._element.style.pointerEvents=y>0?"auto":"none",this._popup&&this._popup._setOpacity(y),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){let c=this._pos;if(!c||!this._map)return;let h=this._offset.mult(this._scale);this._element.style.transform=`
1312            translate(${c.x}px,${c.y}px)
1313            ${jl[this._anchor]}
1314            ${this._calculateXYTransform()} ${this._calculateZTransform()}
1315            translate(${h.x}px,${h.y}px)
1316        `}_calculateXYTransform(){let c=this._pos,h=this._map,g=this.getPitchAlignment();if(!h||!c||g!=="map")return"";if(!h._showingGlobe()){let O=h.getPitch();return O?`rotateX(${O}deg)`:""}let y=n.radToDeg(n.globeTiltAtLngLat(h.transform,this._lngLat)),x=c.sub(n.globeCenterToScreenPoint(h.transform)),I=Math.abs(x.x)+Math.abs(x.y);if(I===0)return"";let D=y/I;return`rotateX(${-x.y*D}deg) rotateY(${x.x*D}deg)`}_calculateZTransform(){let c=this._pos,h=this._map;if(!h||!c)return"";let g=0,y=this.getRotationAlignment();if(y==="map")if(h._showingGlobe()){let x=h.project(new n.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),I=h.project(new n.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(x);g=n.radToDeg(Math.atan2(I.y,I.x))-90}else g=-h.getBearing();else if(y==="horizon"){let x=n.smoothstep(4,6,h.getZoom()),I=n.globeCenterToScreenPoint(h.transform);I.y+=x*h.transform.height;let D=c.sub(I),O=n.radToDeg(Math.atan2(D.y,D.x));g=(O>90?O-270:O+90)*(1-x)}return g+=this._rotation,g?`rotateZ(${g}deg)`:""}_update(c){n.window.cancelAnimationFrame(this._updateFrameId);let h=this._map;
1316h&&(h.transform.renderWorldCopies&&(this._lngLat=Fc(this._lngLat,this._pos,h.transform)),this._pos=h.project(this._lngLat),c===!0?this._updateFrameId=n.window.requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),h._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(h._showingGlobe()||h.getTerrain()||h.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(c){return this._offset=n.Point.convert(c),this._update(),this}_onMove(c){let h=this._map;if(!h)return;let g=this._pointerdownPos,y=this._positionDelta;if(g&&y){if(!this._isDragging){let x=this._clickTolerance||h._clickTolerance;if(c.point.dist(g)<x)return;this._isDragging=!0}this._pos=c.point.sub(y),this._lngLat=h.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new n.Event("dragstart"))),this.fire(new n.Event("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;let c=this._map;c&&(c.off("mousemove",this._onMove),c.off("touchmove",this._onMove)),this._state==="active"&&this.fire(new n.Event("dragend")),this._state="inactive"}_addDragHandler(c){let h=this._map,g=this._pos;h&&g&&this._element.contains(c.originalEvent.target)&&(c.preventDefault(),this._positionDelta=c.point.sub(g),this._pointerdownPos=c.point,this._state="pending",h.on("mousemove",this._onMove),h.on("touchmove",this._onMove),h.once("mouseup",this._onUp),h.once("touchend",this._onUp))}setDraggable(c){this._draggable=!!c;let h=this._map;return h&&(c?(h.on("mousedown",this._addDragHandler),h.on("touchstart",this._addDragHandler)):(h.off("mousedown",this._addDragHandler),h.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(c){return this._rotation=c||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(c){return this._rotationAlignment=c||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment==="auto"||this._rotationAlignment==="horizon"&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(c){return this._pitchAlignment=c||"auto",this._update(),this}getPitchAlignment(){return this._pitchAlignment==="auto"?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(c){return this._occludedOpacity=c||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}let zm={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ew=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function rv(f=new n.Point(0,0),c="bottom"){if(typeof f=="number"){let h=Math.round(Math.sqrt(.5*Math.pow(f,2)));switch(c){case"top":return new n.Point(0,f);case"top-left":return new n.Point(h,h);case"top-right":return new n.Point(-h,h);case"bottom":return new n.Point(0,-f);case"bottom-left":return new n.Point(h,-h);case"bottom-right":return new n.Point(-h,-h);case"left":return new n.Point(f,0);case"right":return new n.Point(-f,0)}return new n.Point(0,0)}return f instanceof n.Point||Array.isArray(f)?n.Point.convert(f):n.Point.convert(f[c]||[0,0])}class jm{constructor(c){this.jumpTo(c)}getValue(c){if(c<=this._startTime)return this._start;if(c>=this._endTime)return this._end;let h=n.easeCubicInOut((c-this._startTime)/(this._endTime-this._startTime));return this._start*(1-h)+this._end*h}isEasing(c){return c>=this._startTime&&c<=this._endTime}jumpTo(c){this._startTime=-1/0,this._endTime=-1/0,this._start=c,this._end=c}easeTo(c,h,g){this._start=this.getValue(h),this._end=c,this._startTime=h,this._endTime=h+g}}let ov={"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"},sv={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,maxTileC
1316acheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},tw={showCompass:!0,showZoom:!0,visualizePitch:!1};class iw{constructor(c,h,g=!1){this._clickTolerance=10,this.element=h,this.mouseRotate=new Am({clickTolerance:c.dragRotate._mouseRotate._clickTolerance}),this.map=c,g&&(this.mousePitch=new Pm({clickTolerance:c.dragRotate._mousePitch._clickTolerance})),n.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),h.addEventListener("mousedown",this.mousedown),h.addEventListener("touchstart",this.touchstart,{passive:!1}),h.addEventListener("touchmove",this.touchmove),h.addEventListener("touchend",this.touchend),h.addEventListener("touchcancel",this.reset)}down(c,h){this.mouseRotate.mousedown(c,h),this.mousePitch&&this.mousePitch.mousedown(c,h),Ye()}move(c,h){let g=this.map,y=this.mouseRotate.mousemoveWindow(c,h),x=y&&y.bearingDelta;if(x&&g.setBearing(g.getBearing()+x),this.mousePitch){let I=this.mousePitch.mousemoveWindow(c,h),D=I&&I.pitchDelta;D&&g.setPitch(g.getPitch()+D)}}off(){let c=this.element;c.removeEventListener("mousedown",this.mousedown),c.removeEventListener("touchstart",this.touchstart,{passive:!1}),c.removeEventListener("touchmove",this.touchmove),c.removeEventListener("touchend",this.touchend),c.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){$e(),n.window.removeEventListener("mousemove",this.mousemove),n.window.removeEventListener("mouseup",this.mouseup)}mousedown(c){this.down(n.extend({},c,{ctrlKey:!0,preventDefault:()=>c.preventDefault()}),jt(this.element,c)),n.window.addEventListener("mousemove",this.mousemove),n.window.addEventListener("mouseup",this.mouseup)}mousemove(c){this.move(c,jt(this.element,c))}mouseup(c){this.mouseRotate.mouseupWindow(c),this.mousePitch&&this.mousePitch.mouseupWindow(c),this.offTemp()}touchstart(c){c.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=$t(this.element,c.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>c.preventDefault()},this._startPos))}touchmove(c){c.targetTouches.length!==1?this.reset():(this._lastPos=$t(this.element,c.targetTouches)[0],this.move({preventDefault:()=>c.preventDefault()},this._lastPos))}touchend(c){c.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}let Vm={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},Bm={maxWidth:100,unit:"metric"},Um={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},Nc={version:n.version,supported:_,setRTLTextPlugin:n.setRTLTextPlugin,getRTLTextPluginStatus:n.getRTLTextPluginStatus,Map:class extends Bh{constructor(f){if(n.LivePerformanceUtils.mark(n.PerformanceMarkers.create),(f=n.extend({},sv,f)).minZoom!=null&&f.maxZoom!=null&&f.minZoom>f.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(f.minPitch!=null&&f.maxPitch!=null&&f.minPitch>f.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(f.minPitch!=null&&f.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(f.maxPitch!=null&&f.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(f.antialias&&n.isSafariWithAntialiasingBug(n.window)&&(f.antialias=!1,n.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Pc(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 Nm,this._domRenderTaskQueue=new Nm,this._controls=[],this._markers=[],this._popups=[],this._mapId=n.uniqueId(),this._locale=n.extend({},ov,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 jm(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new n.RequestManager(f.transformRequest,f.accessToken,f.testMode),this._silenceAuthErrors=!!f.testMode,typeof f.container=="string"){if(this._container=n.window.document.getElementById(f.container),!this._container)throw new Error(`Container '${f.container}' not found.`)}else{if(!(f.container instanceof n.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=f.container}if(this._container.childNodes.length>0&&n.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),n.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)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)),n.window!==void 0&&(n.window.addEventListener("online",this._onWindowOnline,!1),n.window.addEventListener("resize",this._onWindowResize,!1),n.window.addEventListener("orientationchange",this._onWindowResize,!1),n.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),n.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new Rs(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 Im(typeof f.hash=="string"&&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,n.extend({},f.fitBoundsOptions,{duration:0})))),this.resize(),f.attributionControl&&this.addControl(new Pt({customAttribution:f.customAttribution}
1316)),this._logoControl=new Fm,this.addControl(this._logoControl,f.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",c=>{this._update(c.dataType==="style"),this.fire(new n.Event(`${c.dataType}data`,c))}),this.on("dataloading",c=>{this.fire(new n.Event(`${c.dataType}dataloading`,c))})}_getMapId(){return this._mapId}addControl(f,c){if(c===void 0&&(c=f.getDefaultPosition?f.getDefaultPosition():"top-right"),!f||!f.onAdd)return this.fire(new n.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let h=f.onAdd(this);this._controls.push(f);let g=this._controlPositions[c];return c.indexOf("bottom")!==-1?g.insertBefore(h,g.firstChild):g.appendChild(h),this}removeControl(f){if(!f||!f.onRemove)return this.fire(new n.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let c=this._controls.indexOf(f);return c>-1&&this._controls.splice(c,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));let c=!this._moving;return c&&this.fire(new n.Event("movestart",f)).fire(new n.Event("move",f)),this.fire(new n.Event("resize",f)),c&&this.fire(new n.Event("moveend",f)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(f){return this.transform.setMaxBounds(n.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()<f?this.setZoom(f):this.fire(new n.Event("zoomstart")).fire(new n.Event("zoom")).fire(new n.Event("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(f){if((f=f??22)>=this.transform.minZoom)return this.transform.maxZoom=f,this._update(),this.getZoom()>f?this.setZoom(f):this.fire(new n.Event("zoomstart")).fire(new n.Event("zoom")).fire(new n.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()<f?this.setPitch(f):this.fire(new n.Event("pitchstart")).fire(new n.Event("pitch")).fire(new n.Event("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(f){if((f=f??85)>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 n.Event("pitchstart")).fire(new n.Event("pitch")).fire(new n.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 f==="auto"?n.window.navigator.language:Array.isArray(f)?f.length===0?void 0:f.map(c=>c==="auto"?n.window.navigator.language:c):f}setLanguage(f){let c=this._parseLanguage(f);if(!this.style||c===this._language)return this;this._language=c,this.style._reloadSources();
1316for(let h of this._controls)h._setLanguage&&h._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 this.transform.projection.name==="globe"}setProjection(f){return this._lazyInitEmptyStyle(),f?typeof f=="string"&&(f={name:f}):f=null,this._useExplicitProjection=!!f,this._prioritizeAndUpdateProjection(f,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;let f=this.transform,c=f.projection.name,h;c==="globe"&&f.zoom>=n.GLOBE_ZOOM_THRESHOLD_MAX?(f.setMercatorFromTransition(),h=!0):c==="mercator"&&f.zoom<n.GLOBE_ZOOM_THRESHOLD_MAX&&(f.setProjection({name:"globe"}),h=!0),h&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate())}_prioritizeAndUpdateProjection(f,c){return this._updateProjection(f||c||{name:"mercator"})}_updateProjection(f){let c;if(c=f.name==="globe"&&this.transform.zoom>=n.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(f),this.style.applyProjectionUpdate(),c){this.painter.clearBackgroundTiles();for(let h in this.style._sourceCaches)this.style._sourceCaches[h].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(f){return this.transform.locationPoint3D(n.LngLat.convert(f))}unproject(f){return this.transform.pointLocation3D(n.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,c,h){if(f==="mouseenter"||f==="mouseover"){let g=!1,y=I=>{let D=c.filter(z=>this.getLayer(z)),O=D.length?this.queryRenderedFeatures(I.point,{layers:D}):[];O.length?g||(g=!0,h.call(this,new Dr(f,this,I.originalEvent,{features:O}))):g=!1},x=()=>{g=!1};return{layers:new Set(c),listener:h,delegates:{mousemove:y,mouseout:x}}}if(f==="mouseleave"||f==="mouseout"){let g=!1,y=I=>{let D=c.filter(O=>this.getLayer(O));(D.length?this.queryRenderedFeatures(I.point,{layers:D}):[]).length?g=!0:g&&(g=!1,h.call(this,new Dr(f,this,I.originalEvent)))},x=I=>{g&&(g=!1,h.call(this,new Dr(f,this,I.originalEvent)))};return{layers:new Set(c),listener:h,delegates:{mousemove:y,mouseout:x}}}{let g=y=>{let x=c.filter(D=>this.getLayer(D)),I=x.length?this.queryRenderedFeatures(y.point,{layers:x}):[];I.length&&(y.features=I,h.call(this,y),delete y.features)};return{layers:new Set(c),listener:h,delegates:{[f]:g}}}}on(f,c,h){if(h===void 0)return super.on(f,c);Array.isArray(c)||(c=[c]);let g=this._createDelegatedListener(f,c,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[f]=this._delegatedListeners[f]||[],this._delegatedListeners[f].push(g);for(let y in g.delegates)this.on(y,g.delegates[y]);return this}once(f,c,h){if(h===void 0)return super.once(f,c);Array.isArray(c)||(c=[c]);let g=this._createDelegatedListener(f,c,h);for(let y in g.delegates)this.once(y,g.delegates[y]);return this}off(f,c,h){if(h===void 0)return super.off(f,c);c=new Set(Array.isArray(c)?c:[c]);let g=(x,I)=>{if(x.size!==I.size)return!1;for(let D of x)if(!I.has(D))return!1;return!0},y=this._delegatedListeners?this._delegatedListeners[f]:void 0;return y&&(x=>{for(let I=0;I<x.length;I++){let D=x[I];if(D.listener===h&&g(D.layers,c)){for(let O in D.delegates)this.off(O,D.delegates[O]);return x.splice(I,1),this}}})(y),this}queryRenderedFeatures(f,c){return this.style?(c!==void 0||f===void 0||f instanceof n.Point||Array.isArray(f)||(c=f,f=void 0),this.style.queryRenderedFeatures(f=f||[[0,0],[this.transform.width,this.transform.height]],c=c||{},this.transform)):[]}querySourceFeatures(f,c){return this.style.querySourceFeatures(f,c)}isPointOnSurface(f){let{name:c}=this.transform.projection;return c!=="globe"&&c!=="mercator"&&n.warnOnce(`${c} projection does not support isPointOnSurface, this API may behave unex
1316pectedly.`),this.transform.isPointOnSurface(n.Point.convert(f))}setStyle(f,c){return(c=n.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},c)).diff!==!1&&c.localIdeographFontFamily===this._localIdeographFontFamily&&c.localFontFamily===this._localFontFamily&&this.style&&f?(this._diffStyle(f,c),this):(this._localIdeographFontFamily=c.localIdeographFontFamily,this._localFontFamily=c.localFontFamily,this._updateStyle(f,c))}_getUIString(f){let c=this._locale[f];if(c==null)throw new Error(`Missing UI string '${f}'`);return c}_updateStyle(f,c){return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),f&&(this.style=new Ps(this,c||{}),this.style.setEventedParent(this,{style:this.style}),typeof f=="string"?this.style.loadURL(f):this.style.loadJSON(f)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Ps(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(f,c){if(typeof f=="string"){let h=this._requestManager.normalizeStyleURL(f),g=this._requestManager.transformRequest(h,n.ResourceType.Style);n.getJSON(g,(y,x)=>{y?this.fire(new n.ErrorEvent(y)):x&&this._updateDiff(x,c)})}else typeof f=="object"&&this._updateDiff(f,c)}_updateDiff(f,c){try{this.style.setState(f)&&this._update(!0)}catch(h){n.warnOnce(`Unable to perform style diff: ${h.message||h.error||h}.  Rebuilding the style from scratch.`),this._updateStyle(f,c)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(n.warnOnce("There is no style added to the map."),!1)}addSource(f,c){return this._lazyInitEmptyStyle(),this.style.addSource(f,c),this._update(!0)}isSourceLoaded(f){return!!this.style&&this.style._isSourceCacheLoaded(f)}areTilesLoaded(){let f=this.style&&this.style._sourceCaches;for(let c in f){let h=f[c]._tiles;for(let g in h){let y=h[g];if(y.state!=="loaded"&&y.state!=="errored")return!1}}return!0}addSourceType(f,c,h){this._lazyInitEmptyStyle(),this.style.addSourceType(f,c,h)}removeSource(f){return this.style.removeSource(f),this._updateTerrain(),this._update(!0)}getSource(f){return this.style.getSource(f)}addImage(f,c,{pixelRatio:h=1,sdf:g=!1,stretchX:y,stretchY:x,content:I}={}){if(this._lazyInitEmptyStyle(),c instanceof n.window.HTMLImageElement||n.window.ImageBitmap&&c instanceof n.window.ImageBitmap){let{width:D,height:O,data:z}=n.exported.getImageData(c);this.style.addImage(f,{data:new n.RGBAImage({width:D,height:O},z),pixelRatio:h,stretchX:y,stretchY:x,content:I,sdf:g,version:0})}else if(c.width===void 0||c.height===void 0)this.fire(new n.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{let{width:D,height:O}=c,z=c;this.style.addImage(f,{data:new n.RGBAImage({width:D,height:O},new Uint8Array(z.data)),pixelRatio:h,stretchX:y,stretchY:x,content:I,sdf:g,version:0,userImage:z}),z.onAdd&&z.onAdd(this,f)}}updateImage(f,c){let h=this.style.getImage(f);if(!h)return void this.fire(new n.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let g=c instanceof n.window.HTMLImageElement||n.window.ImageBitmap&&c instanceof n.window.ImageBitmap?n.exported.getImageData(c):c,{width:y,height:x}=g;y!==void 0&&x!==void 0?y===h.data.width&&x===h.data.height?(h.data.replace(g.data,!(c instanceof n.window.HTMLImageElement||n.window.ImageBitmap&&c instanceof n.window.ImageBitmap)),this.style.updateImage(f,h)):this.fire(new n.ErrorEvent(new Error(`The width and height of the updated image (${y}, ${x})
1317                must be that same as the previous version of the image
1318                (${h.data.width}, ${h.data.height})`))):this.fire(new n.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 n.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(f){this.style.removeImage(f)}loadImage(f,c){n.getImage(this._requestManager.transformRequest(f,n.ResourceType.Image),(h,g)=>{c(h,g instanceof n.window.HTMLImageElement?n.exported.getImageData(g):g)})}listImages(){return this.style.listImages()}addLayer(f,c){return this._lazyInitEmptyStyle(),this.style.addLayer(f,c),this._update(!0)}moveLayer(f,c){return this.style.moveLayer(f,c),this._update(!0)}removeLayer(f){return this.style.removeLayer(f),this._update(!0)}getLayer(f){return this.style.getLayer(f)}setLayerZoomRange(f,c,h){return this.style.setLayerZoomRange(f,c,h),this._update(!0)}setFilter(f,c,h={}){return this.style.setFilter(f,c,h),this._update(!0)}getFilter(f){return this.style.getFilter(f)}
1318setPaintProperty(f,c,h,g={}){return this.style.setPaintProperty(f,c,h,g),this._update(!0)}getPaintProperty(f,c){return this.style.getPaintProperty(f,c)}setLayoutProperty(f,c,h,g={}){return this.style.setLayoutProperty(f,c,h,g),this._update(!0)}getLayoutProperty(f,c){return this.style.getLayoutProperty(f,c)}setLight(f,c={}){return this._lazyInitEmptyStyle(),this.style.setLight(f,c),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(n.LngLat.convert(f),this.transform):0}setFeatureState(f,c){return this.style.setFeatureState(f,c),this._update()}removeFeatureState(f,c){return this.style.removeFeatureState(f,c),this._update()}getFeatureState(f){return this.style.getFeatureState(f)}_updateContainerDimensions(){if(!this._container)return;let f=this._container.getBoundingClientRect().width||400,c=this._container.getBoundingClientRect().height||300,h,g,y,x=this._container;for(;x&&(!g||!y);){let I=n.window.getComputedStyle(x).transform;I&&I!=="none"&&(h=I.match(/matrix.*\((.+)\)/)[1].split(", "),h[0]&&h[0]!=="0"&&h[0]!=="1"&&(g=h[0]),h[3]&&h[3]!=="0"&&h[3]!=="1"&&(y=h[3])),x=x.parentElement}this._containerWidth=g?Math.abs(f/g):f,this._containerHeight=y?Math.abs(c/y):c}_detectMissingCSS(){n.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&n.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(){let f=this._container;f.classList.add("mapboxgl-map"),(this._missingCSSCanary=j("div","mapboxgl-canary",f)).style.visibility="hidden",this._detectMissingCSS();let c=this._canvasContainer=j("div","mapboxgl-canvas-container",f);this._interactive&&c.classList.add("mapboxgl-interactive"),this._canvas=j("canvas","mapboxgl-canvas",c),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);let h=this._controlContainer=j("div","mapboxgl-control-container",f),g=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(y=>{g[y]=j("div",`mapboxgl-ctrl-${y}`,h)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(f,c){let h=n.exported.devicePixelRatio||1;this._canvas.width=h*Math.ceil(f),this._canvas.height=h*Math.ceil(c),this._canvas.style.width=`${f}px`,this._canvas.style.height=`${c}px`}_addMarker(f){this._markers.push(f)}_removeMarker(f){let c=this._markers.indexOf(f);c!==-1&&this._markers.splice(c,1)}_addPopup(f){this._popups.push(f)}_removePopup(f){let c=this._popups.indexOf(f);c!==-1&&this._popups.splice(c,1)}_setupPainter(){let f=n.extend({},_.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),c=this._useWebGL2&&this._canvas.getContext("webgl2",f),h=c||this._canvas.getContext("webgl",f)||this._canvas.getContext("experimental-webgl",f);h?(this._useWebGL2&&!c&&n.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),n.storeAuthState(h,!0),this.painter=new kc(h,this.transform,!!c),this.on("data",g=>{g.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),n.exported$1.testSupport(h)):this.fire(new n.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(f){f.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new n.Event("webglcontextlost",{originalEvent:f}))}_contextRestored(f){this._setupPainter(),this.resize(),this._update(),this.fire(new n.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 c,h=this.painter.context.extTimerQuery,g=n.exported.now();if(this.listens("gpu-timing-frame")&&(c=h.createQueryEXT(),h.beginQueryEXT(h.TIME_ELAPSED_EXT,c)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&
1318(this._interactionRange[0]=Math.min(this._interactionRange[0],n.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],n.window.performance.now())),this._renderTaskQueue.run(f),this._domRenderTaskQueue.run(f),this._removed)return;this._updateProjectionTransition();let y=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;let D=this.transform.zoom,O=this.transform.pitch,z=n.exported.now(),F=new n.EvaluationParameters(D,{now:z,fadeDuration:y,pitch:O,transition:this.style.getTransition()});this.style.update(F)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let x=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),x=this._updateAverageElevation(g),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):x=this._updateAverageElevation(g),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,y,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:y,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 n.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new n.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),c){let D=n.exported.now()-g;h.endQueryEXT(h.TIME_ELAPSED_EXT,c),setTimeout(()=>{let O=h.getQueryObjectEXT(c,h.QUERY_RESULT_EXT)/1e6;h.deleteQueryEXT(c),this.fire(new n.Event("gpu-timing-frame",{cpuTime:D,gpuTime:O})),n.window.performance.mark("frame-gpu",{startTime:g,detail:{gpuTime:O}})},50)}if(this.listens("gpu-timing-layer")){let D=this.painter.collectGpuTimers();setTimeout(()=>{let O=this.painter.queryGpuTimers(D);this.fire(new n.Event("gpu-timing-layer",{layerTimes:O}))},50)}if(this.listens("gpu-timing-deferred-render")){let D=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{let O=this.painter.queryGpuTimeDeferredRender(D);this.fire(new n.Event("gpu-timing-deferred-render",{gpuTime:O}))},50)}let I=this._sourcesDirty||this._styleDirty||this._placementDirty||x;if(I||this._repaint)this.triggerRepaint();else{let D=!this.isMoving()&&this.loaded();if(D&&(x=this._updateAverageElevation(g,!0)),x)this.triggerRepaint();else if(this._triggerFrame(!1),D&&(this.fire(new n.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){let O=this._calculateSpeedIndex();this.fire(new n.Event("speedindexcompleted",{speedIndex:O})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||I||(this._fullyLoaded=!0,n.LivePerformanceUtils.mark(n.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&n.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(let c of this._markers)f&&!this.getRenderWorldCopies()&&(c._lngLat=c._lngLat.wrap()),c._update();for(let c of this._popups)!f||this.getRenderWorldCopies()||c._trackPointer||(c._lngLat=c._lngLat.wrap()),c._update()}_updateAverageElevation(f,c=!1){let h=g=>(this.transform.averageElevation=g,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&h(0);if((c||f-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(f)){let g=this.transform.averageElevation,y=this.transform.sampleAverageElevation(),x=!1;this.transform.elevation&&(x=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(y)?y=0:this._averageElevationLastSampledAt=f;let I=Math.abs(g-y);if(I>1){if(this._isInitialLoad||x)return this._averageElevation.jumpTo(y),h(y);this._averageElevation.easeTo(y,f,300)}else if(I>1e-4)return this._averageElevation.jumpTo(y),h(y)}return!!this._averageElevation.isEasing(f)&&h(this._averageElevation.getValue(f))}_authenticate(){n.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,f=>{if(f&&(f.message===n.AUTH_ERR_MSG||f.status===401)){let c=this.painter.context.gl;n.storeAuthState(c,!1),this._logoControl instanceof Fm&&this._logoControl._updateLogo(),c&&c.clear(c.DEPTH_BUFFER_BIT|c.COLOR_BUFFER_BIT|c.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new n.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/")))}}),n.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_updateTerrain(){let f=this._isDragging();this.painter.updateTerrain(this.style,f)}_calculateSpeedIndex(){let f=this.painter.canvasCopy(),c=this.painter.getCanvasCopiesAndTimestamps();c.timeStamps.push(performance.now());let h=this.painter.context.gl,g=h.createFramebuffer();function y(x){h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,x,0);let I=new Uint8Array(h.drawingBufferWidth*h.drawingBufferHeight*4);return h.readPixels(0,0,h.drawingBufferWidth,h.drawingBufferHeight,h.RGBA,h.UNSIGNED_BYTE,I),I}return h.bindFramebuffer(h.FRAMEBUFFER,g),this._canvasPixelComparison(y(f),c.canvasCopies.map(y),c.timeStamps)}_canvasPixelComparison(f,c,h){let g=h[1]-h[0],y=f.length/4;for(let x=0;x<c.length;x++){let I=c[x],D=0;for(let O=0;O<I.length;O+=4)I[O]===f[O]&&I[O+1]===f[O+1]&&I[O+2]===f[O+2]&&I[O+3]===f[O+3]&&(D+=1);g+=(h[x+2]-h[x+1])*(1-D/y)}return g}remove(){this._hash&&this._hash.remove();for(let c of this._controls)c.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),n.window!==void 0&&(n.window.removeEventListener("resize",this._onWindowResize,!1),n.window.removeEventListener("orientationchange",this._onWindowResize,!1),n.window.removeEventListener("webkitfullscreenchange",this._onWindowResize,!1),n.window.removeEventListener("online",this._onWindowOnline,!1),n.window.removeEventListener("visibilitychange",this._onVisibilityChange,!1));let f=this.painter.context.gl.getExtension("WEBGL_lose_context");f&&f.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),n.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new n.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(f){this._renderNextFrame=this._renderNextFrame||f,this.style&&!this._frame&&(this._frame=n.exported.frame(c=>{let h=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,h&&this._render(c)}))}_preloadTiles(f){let c=this.style?Object.values(this.style._sourceCaches):[];return n.asyncAll(c,(h,g)=>h._preloadTiles(f,g),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(f){this._trackResize&&this.resize({originalEvent:f})._update()}_onVisibilityChange(){n.window.document.visibilityState==="hidden"&&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,c){n.setCacheLimits(f,c)}get version(){return n.version}},NavigationControl:class{constructor(f){this.options=n.extend({},tw,f),this._container=j("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",c=>c.preventDefault()),this.options.showZoom&&(n.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",c=>{this._map&&this._map.zoomIn({},{originalEvent:c})}),j("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",c=>{this._map&&this._map.zoomOut({},{originalEvent:c})}),j("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(n.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",c=>{let h=this._map;h&&(this.options.visualizePitch?h.resetNorthPitch({},{originalEvent:c}):h.resetNorth({},{originalEvent:c}))}),this._compassIcon=j("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){let f=this._map;if(!f)return;let c=f.getZoom(),h=c===f.getMaxZoom(),g=c===f.getMinZoom();this._zoomInButton.disabled=h,this._zoomOutButton.disabled=g,this._zoomInButton.setAttribute("aria-disabled",h.toString()),this._zoomOutButton.setAttribute("aria-disabled",g.toString())}_rotateCompassArrow(){let f=this._map;if(!f)return;let c=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(f.transform.pitch*(Math.PI/180)
1318),.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=c)})}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 iw(f,this._compass,this.options.visualizePitch)),this._container}onRemove(){let 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,c){let h=j("button",f,this._container);return h.type="button",h.addEventListener("click",c),h}_setButtonTitle(f,c){if(!this._map)return;let h=this._map._getUIString(`NavigationControl.${c}`);f.setAttribute("aria-label",h),f.firstElementChild&&f.firstElementChild.setAttribute("title",h)}},GeolocateControl:class extends n.Evented{constructor(f){super(),this.options=n.extend({geolocation:n.window.navigator.geolocation},Vm,f),n.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Oc(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(f){return this._map=f,this._container=j("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(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){let c=(h=!!this.options.geolocation)=>{this._supportsGeolocation=h,f(h)};this._supportsGeolocation!==void 0?f(this._supportsGeolocation):n.window.navigator.permissions!==void 0?n.window.navigator.permissions.query({name:"geolocation"}).then(h=>c(h.state!=="denied")).catch(()=>c()):c()}_isOutOfMapMaxBounds(f){let c=this._map.getMaxBounds(),h=f.coords;return!!c&&(h.longitude<c.getWest()||h.longitude>c.getEast()||h.latitude<c.getSouth()||h.latitude>c.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 n.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&&this._watchState!=="OFF"&&this._updateMarker(f),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(f),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new n.Event("geolocate",f)),this._finish()}}_updateCamera(f){let c=new n.LngLat(f.coords.longitude,f.coords.latitude),h=f.coords.accuracy,g=this._map.getBearing(),y=n.extend({bearing:g},this.options.fitBoundsOptions);this._map.fitBounds(c.toBounds(h),y,{geolocateSource:!0})}_updateMarker(f){if(f){let c=new n.LngLat(f.coords.longitude,f.coords.latitude);this._accuracyCircleMarker.setLngLat(c).addTo(this._map),this._userLocationDotMarker.setLngLat(c).addTo(this._map),this._accuracy=f.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){let f=this._map.transform,c=n.mercatorZfromAltitude(1,f._center.lat)*f.worldSize,h=Math.ceil(2*this._accuracy*c);this._circleElement.style.width=`${h}px`,this._circleElement.style.height=`${h}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(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(f.code===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._geolocateButton.disabled=!0;let c=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",c),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",c),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(f.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new n.Event("error",f)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(f){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",c=>c.preventDefault()),this._geolocateButton=j("button","mapboxgl-ctrl-geolocate",this._container),j("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",f===!1){n.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");let c=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",c),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",c)}else{let c=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",c),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",c)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
1318se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=j("div","mapboxgl-user-location"),this._dotElement.appendChild(j("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(j("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new St({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=j("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new St({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",c=>{c.geolocateSource||this._watchState!=="ACTIVE_LOCK"||c.originalEvent&&c.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new n.Event("trackuserlocationend")))})}}_onDeviceOrientation(f){this._userLocationDotMarker&&(f.webkitCompassHeading?this._heading=f.webkitCompassHeading:f.absolute===!0&&(this._heading=-1*f.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return n.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 n.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 n.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 n.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(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){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(){let f=()=>{n.window.addEventListener("ondeviceorientationabsolute"in n.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};n.window.DeviceMotionEvent!==void 0&&typeof n.window.DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(c=>{c==="granted"&&f()}).catch(console.error):f()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),n.window.removeEventListener("deviceorientation",this._onDeviceOrientation),n.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
1318se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Pt,ScaleControl:class{constructor(f){this.options=n.extend({},Bm,f),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),n.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){let f=this.options.maxWidth||100,c=this._map,h=c._containerHeight/2,g=c._containerWidth/2-f/2,y=c.unproject([g,h]),x=c.unproject([g+f,h]),I=y.distanceTo(x);if(this.options.unit==="imperial"){let D=3.2808*I;D>5280?this._setScale(f,D/5280,"mile"):this._setScale(f,D,"foot")}else this.options.unit==="nautical"?this._setScale(f,I/1852,"nautical-mile"):I>=1e3?this._setScale(f,I/1e3,"kilometer"):this._setScale(f,I,"meter")}_setScale(f,c,h){this._map._requestDomTask(()=>{let g=function(x){let I=Math.pow(10,`${Math.floor(x)}`.length-1),D=x/I;return D=D>=10?10:D>=5?5:D>=3?3:D>=2?2:D>=1?1:function(O){let z=Math.pow(10,Math.ceil(-Math.log(O)/Math.LN10));return Math.round(O*z)/z}(D),I*D}(c),y=g/c;this._container.innerHTML=this._isNumberFormatSupported&&h!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:h}).format(g):`${g}&nbsp;${Um[h]}`,this._container.style.width=f*y+"px"})}onAdd(f){return this._map=f,this._language=f.getLanguage(),this._container=j("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 n.window.HTMLElement?this._container=f.container:n.warnOnce("Full screen control 'container' must be a DOM element.")),n.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in n.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in n.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(f){return this._map=f,this._container||(this._container=this._map.getContainer()),this._controlContainer=j("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",n.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,n.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!n.window.document.fullscreenEnabled&&!n.window.document.webkitFullscreenEnabled)}_setupUI(){let f=this._fullscreenButton=j("button","mapboxgl-ctrl-fullscreen",this._controlContainer);j("span","mapboxgl-ctrl-icon",f).setAttribute("aria-hidden","true"),f.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),n.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){let 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(){(n.window.document.fullscreenElement||n.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()?n.window.document.exitFullscreen?n.window.document.exitFullscreen():n.window.document.webkitCancelFullScreen&&n.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends n.Evented{constructor(f){super(),this.options=n.extend(Object.create(zm),f),n.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 n.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);let 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 n.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(f){this._lngLat=n.LngLat.convert(f),this._pos=null,this._trackPointer=!1,this._update();let c=this._map;
1318return c&&(c.on("move",this._update),c.off("mousemove",this._onMouseEvent),c._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();let 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(n.window.document.createTextNode(f))}setHTML(f){let c=n.window.document.createDocumentFragment(),h=n.window.document.createElement("body"),g;for(h.innerHTML=f;g=h.firstChild,g;)c.appendChild(g);return this.setDOMContent(c)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(f){return this.options.maxWidth=f,this._update(),this}setDOMContent(f){let c=this._content;if(c)for(;c.hasChildNodes();)c.firstChild&&c.removeChild(c.firstChild);else c=this._content=j("div","mapboxgl-popup-content",this._container||void 0);if(c.appendChild(f),this.options.closeButton){let h=this._closeButton=j("button","mapboxgl-popup-close-button",c);h.type="button",h.setAttribute("aria-label","Close popup"),h.setAttribute("aria-hidden","true"),h.innerHTML="&#215;",h.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 c;return this._classList.delete(f)?c=!1:(this._classList.add(f),c=!0),this._updateClassList(),c}_onMouseEvent(f){this._update(f.point)}_getAnchor(f){if(this.options.anchor)return this.options.anchor;let c=this._map,h=this._container,g=this._pos;if(!c||!h||!g)return"bottom";let y=h.offsetWidth,x=h.offsetHeight,I=g.x<y/2,D=g.x>c.transform.width-y/2;if(g.y+f<x)return I?"top-left":D?"top-right":"top";if(g.y>c.transform.height-x){if(I)return"bottom-left";if(D)return"bottom-right"}return I?"left":D?"right":"bottom"}_updateClassList(){let f=this._container;if(!f)return;let c=[...this._classList];c.push("mapboxgl-popup"),this._anchor&&c.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&c.push("mapboxgl-popup-track-pointer"),f.className=c.join(" ")}_update(f){let c=this._map,h=this._content;if(!c||!this._lngLat&&!this._trackPointer||!h)return;let g=this._container;if(g||(g=this._container=j("div","mapboxgl-popup",c.getContainer()),this._tip=j("div","mapboxgl-popup-tip",g),g.appendChild(h)),this.options.maxWidth&&g.style.maxWidth!==this.options.maxWidth&&(g.style.maxWidth=this.options.maxWidth),c.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Fc(this._lngLat,this._pos,c.transform)),!this._trackPointer||f){let y=this._pos=this._trackPointer&&f?f:c.project(this._lngLat),x=rv(this.options.offset),I=this._anchor=this._getAnchor(x.y),D=rv(this.options.offset,I),O=y.add(D).round();c._requestDomTask(()=>{this._container&&I&&(this._container.style.transform=`${jl[I]} translate(${O.x}
1318px,${O.y}px)`)})}if(!this._marker&&c._showingGlobe()){let y=n.isLngLatBehindGlobe(c.transform,this._lngLat)?0:1;this._setOpacity(y)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let f=this._container.querySelector(ew);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:St,Style:Ps,LngLat:n.LngLat,LngLatBounds:n.LngLatBounds,Point:n.Point,MercatorCoordinate:n.MercatorCoordinate,FreeCameraOptions:H0,Evented:n.Evented,config:n.config,prewarm:function(){yc().acquire(Ms)},clearPrewarmedResources:function(){let f=lo;f&&(f.isPreloaded()&&f.numActive()===1?(f.release(Ms),lo=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 n.config.ACCESS_TOKEN},set accessToken(f){n.config.ACCESS_TOKEN=f},get baseApiUrl(){return n.config.API_URL},set baseApiUrl(f){n.config.API_URL=f},get workerCount(){return Tr.workerCount},set workerCount(f){Tr.workerCount=f},get maxParallelImageRequests(){return n.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(f){n.config.MAX_PARALLEL_IMAGE_REQUESTS=f},clearStorage(f){n.clearTileCache(f)},workerUrl:"",workerClass:null,setNow:n.exported.setNow,restoreNow:n.exported.restoreNow};return Nc});var o=r;return o})});var E2=null;var gC=1;function ko(i){let e=E2;return E2=i,e}var S2={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function L4(i){if(!(yC(i)&&!i.dirty)&&!(!i.dirty&&i.lastCleanEpoch===gC)){if(!i.producerMustRecompute(i)&&!_C(i)){i.dirty=!1,i.lastCleanEpoch=gC;return}i.producerRecomputeValue(i),i.dirty=!1,i.lastCleanEpoch=gC}}function T2(i){return i&&(i.nextProducerIndex=0),ko(i)}function I2(i,e){if(ko(e),!(!i||i.producerNode===void 0||i.producerIndexOfThis===void 0||i.producerLastReadVersion===void 0)){if(yC(i))for(let r=i.nextProducerIndex;r<i.producerNode.length;r++)vC(i.producerNode[r],i.producerIndexOfThis[r]);for(;i.producerNode.length>i.nextProducerIndex;)i.producerNode.pop(),i.producerLastReadVersion.pop(),i.producerIndexOfThis.pop()}}function _C(i){qv(i);for(let e=0;e<i.producerNode.length;e++){let r=i.producerNode[e],t=i.producerLastReadVersion[e];if(t!==r.version||(L4(r),t!==r.version))return!0}return!1}function D2(i){if(qv(i),yC(i))for(let e=0;e<i.producerNode.length;e++)vC(i.producerNode[e],i.producerIndexOfThis[e]);i.producerNode.length=i.producerLastReadVersion.length=i.producerIndexOfThis.length=0,i.liveConsumerNode&&(i.liveConsumerNode.length=i.liveConsumerIndexOfThis.length=0)}function vC(i,e){if(F4(i),qv(i),i.liveConsumerNode.length===1)for(let t=0;t<i.producerNode.length;t++)vC(i.producerNode[t],i.producerIndexOfThis[t]);let r=i.liveConsumerNode.length-1;if(i.liveConsumerNode[e]=i.liveConsumerNode[r],i.liveConsumerIndexOfThis[e]=i.liveConsumerIndexOfThis[r],i.liveConsumerNode.length--,i.liveConsumerIndexOfThis.length--,e<i.liveConsumerNode.length){let t=i.liveConsumerIndexOfThis[e],o=i.liveConsumerNode[e];qv(o),o.producerIndexOfThis[t]=e}}function yC(i){return i.consumerIsAlwaysLive||(i?.liveConsumerNode?.length??0)>0}function qv(i){i.producerNode??=[],i.producerIndexOfThis??=[],i.producerLastReadVersion??=[]}function F4(i){i.liveConsumerNode??=[],i.liveConsumerIndexOfThis??=[]}function N4(){throw new Error}var z4=N4;function M2(i){z4=i}function di(i){return typeof i=="function"}function hp(i){let r=i(t=>{Error.call(t),t.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Wv=hp(i=>function(r){i(this),this.message=r?`${r.length} errors occurred during unsubscription:
1319${r.map((t,o)=>`${o+1}) ${t.toString()}`).join(`
1320  `)}`:"",this.name="UnsubscriptionError",this.errors=r});function Ed(i,e){if(i){let r=i.indexOf(e);0<=r&&i.splice(r,1)}}var pn=class i{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}
vendor: 11,234 bytes, line 1320
1320unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let n of r)n.remove(this);else r.remove(this);let{initialTeardown:t}=this;if(di(t))try{t()}catch(n){e=n instanceof Wv?n.errors:[n]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let n of o)try{k2(n)}catch(d){e=e??[],d instanceof Wv?e=[...e,...d.errors]:e.push(d)}}if(e)throw new Wv(e)}}add(e){var r;if(e&&e!==this)if(this.closed)k2(e);else{if(e instanceof i){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}}_hasParent(e){let{_parentage:r}=this;return r===e||Array.isArray(r)&&r.includes(e)}_addParent(e){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e}_removeParent(e){let{_parentage:r}=this;r===e?this._parentage=null:Array.isArray(r)&&Ed(r,e)}remove(e){let{_finalizers:r}=this;r&&Ed(r,e),e instanceof i&&e._removeParent(this)}};pn.EMPTY=(()=>{let i=new pn;return i.closed=!0,i})();var bC=pn.EMPTY;function Zv(i){return i instanceof pn||i&&"closed"in i&&di(i.remove)&&di(i.add)&&di(i.unsubscribe)}function k2(i){di(i)?i():i.unsubscribe()}var Sa={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var pp={setTimeout(i,e,...r){let{delegate:t}=pp;return t?.setTimeout?t.setTimeout(i,e,...r):setTimeout(i,e,...r)},clearTimeout(i){let{delegate:e}=pp;return(e?.clearTimeout||clearTimeout)(i)},delegate:void 0};function Kv(i){pp.setTimeout(()=>{let{onUnhandledError:e}=Sa;if(e)e(i);else throw i})}function Sd(){}var A2=(()=>xC("C",void 0,void 0))();function P2(i){return xC("E",void 0,i)}function O2(i){return xC("N",i,void 0)}function xC(i,e,r){return{kind:i,value:e,error:r}}var Td=null;function fp(i){if(Sa.useDeprecatedSynchronousErrorHandling){let e=!Td;if(e&&(Td={errorThrown:!1,error:null}),i(),e){let{errorThrown:r,error:t}=Td;if(Td=null,r)throw t}}else i()}function R2(i){Sa.useDeprecatedSynchronousErrorHandling&&Td&&(Td.errorThrown=!0,Td.error=i)}var Id=class extends pn{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Zv(e)&&e.add(this)):this.destination=B4}static create(e,r,t){return new mp(e,r,t)}next(e){this.isStopped?CC(O2(e),this):this._next(e)}error(e){this.isStopped?CC(P2(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?CC(A2,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},j4=Function.prototype.bind;function wC(i,e){return j4.call(i,e)}var EC=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:r}=this;if(r.next)try{r.next(e)}catch(t){Xv(t)}}error(e){let{partialObserver:r}=this;if(r.error)try{r.error(e)}catch(t){Xv(t)}else Xv(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(r){Xv(r)}}},mp=class extends Id{constructor(e,r,t){super();let o;if(di(e)||!e)o={next:e??void 0,error:r??void 0,complete:t??void 0};else{let n;this&&Sa.useDeprecatedNextContext?(n=Object.create(e),n.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&wC(e.next,n),error:e.error&&wC(e.error,n),complete:e.complete&&wC(e.complete,n)}):o=e}this.destination=new EC(o)}};function Xv(i){Sa.useDeprecatedSynchronousErrorHandling?R2(i):Kv(i)}function V4(i){throw i}function CC(i,e){let{onStoppedNotification:r}=Sa;r&&pp.setTimeout(()=>r(i,e))}var B4={closed:!0,next:Sd,error:V4,complete:Sd};var gp=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function Ao(i){return i}function SC(...i){return TC(i)}function TC(i){return i.length===0?Ao:i.length===1?i[0]:function(r){return i.reduce((t,o)=>o(t),r)}}var gi=(()=>{class i{constructor(r){r&&(this._subscribe=r)}lift(r){let t=new i;return t.source=this,t.operator=r,t}subscribe(r,t,o){let n=H4(r)?r:new mp(r,t,o);return fp(()=>{let{operator:d,source:_}=this;n.add(d?d.call(n,_):_?this._subscribe(n):this._trySubscribe(n))}),n}_trySubscribe(r){try{return this._subscribe(r)}catch(t){r.error(t)}}forEach(r,t){return t=L2(t),new t((o,n)=>{let d=new mp({next:_=>{try{r(_)}catch(C){n(C),d.unsubscribe()}},error:n,complete:o});this.subscribe(d)})}_subscribe(r){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(r)}[gp](){return this}pipe(...r){return TC(r)(this)}toPromise(r){return r=L2(r),new r((t,o)=>{let n;this.subscribe(d=>n=d,d=>o(d),()=>t(n))})}}return i.create=e=>new i(e),i})();function L2(i){var e;return(e=i??Sa.Promise)!==null&&e!==void 0?e:Promise}function U4(i){return i&&di(i.next)&&di(i.error)&&di(i.complete)}function H4(i){return i&&i instanceof Id||U4(i)&&Zv(i)}function IC(i){return di(i?.lift)}function Ai(i){return e=>{if(IC(e))return e.lift(function(r){try{return i(r,this)}catch(t){this.error(t)}});throw new TypeError("Unable to lift unknown Observable type")}}function _i(i,e,r,t,o){return new DC(i,e,r,t,o)}var DC=class extends Id{constructor(e,r,t,o,n,d){super(e),this.onFinalize=n,this.shouldUnsubscribe=d,this._next=r?function(_){try{r(_)}catch(C){e.error(C)}}:super._next,this._error=o?function(_){try{o(_)}catch(C){e.error(C)}finally{this.unsubscribe()}}:super._error,this._complete=t?function(){try{t()}catch(_){e.error(_)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:r}=this;super.unsubscribe(),!r&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};function _p(){return Ai((i,e)=>{let r=null;i._refCount++;let t=_i(e,void 0,void 0,void 0,()=>{if(!i||i._refCount<=0||0<--i._refCount){r=null;return}let o=i._connection,n=r;r=null,o&&(!n||o===n)&&o.unsubscribe(),e.unsubscribe()});i.subscribe(t),t.closed||(r=i.connect())})}var vp=class extends gi{constructor(e,r){super(),this.source=e,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,IC(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){let e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new pn;let r=this.getSubject();e.add(this.source.subscribe(_i(r,void 0,()=>{this._teardown(),r.complete()},t=>{this._teardown(),r.error(t)},()=>this._teardown()))),e.closed&&(this._connection=null,e=pn.EMPTY)}return e}refCount(){return _p()(this)}};var yp={schedule(i){let e=requestAnimationFrame,r=cancelAnimationFrame,{delegate:t}=yp;t&&(e=t.requestAnimationFrame,r=t.cancelAnimationFrame);let o=e(n=>{r=void 0,i(n)});return new pn(()=>r?.(o))},requestAnimationFrame(...i){let{delegate:e}=yp;return(e?.requestAnimationFrame||requestAnimationFrame)(...i)},cancelAnimationFrame(...i){let{delegate:e}=yp;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...i)},delegate:void 0};var F2=hp(i=>function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Jt=(()=>{class i extends gi{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let t=new Yv(this,this);return t.operator=r,t}_throwIfClosed(){if(this.closed)throw new F2}next(r){fp(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let t of this.currentObservers)t.next(r)}})}error(r){fp(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:t}=this;for(;t.length;)t.shift().error(r)}})}complete(){fp(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:t,isStopped:o,observers:n}=this;return t||o?bC:(this.currentObservers=null,n.push(r),new pn(()=>{this.currentObservers=null,Ed(n,r)}))}_checkFinalizedStatuses(r){let{hasError:t,thrownError:o,isStopped:n}=this;t?r.error(o):n&&r.complete()}asObservable(){let r=new gi;return r.source=this,r}}return i.create=(e,r)=>new Yv(e,r),i})(),Yv=class extends Jt{constructor(e,r){super(),this.destination=e,this.source=r}next(e){var r,t;(t=(r=this.destination)===null||r===void 0?void 0:r.next)===null||t===void 0||t.call(r,e)}error(e){var r,t;(t=(r=this.destination)===null||r===void 0?void 0:r.error)===null||t===void 0||t.call(r,e)}complete(){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||r===void 0||r.call(e)}_subscribe(e){var r,t;return(t=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&t!==void 0?t:bC}};var Cr=class extends Jt{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let r=super._subscribe(e);return!r.closed&&e.next(this._value),r}getValue(){let{hasError:e,thrownError:r,_value:t}=this;if(e)throw r;return this._throwIfClosed(),t}next(e){super.next(this._value=e)}};var Sg={now(){return(Sg.delegate||Date).now()},delegate:void 0};var Tg=class extends Jt{constructor(e=1/0,r=1/0,t=Sg){super(),this._bufferSize=e,this._windowTime=r,this._timestampProvider=t,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,r)}next(e){let{isStopped:r,_buffer:t,_infiniteTimeWindow:o,_timestampProvider:n,_windowTime:d}=this;r||(t.push(e),!o&&t.push(n.now()+d)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let r=this._innerSubscribe(e),{_infiniteTimeWindow:t,_buffer:o}=this,n=o.slice();for(let d=0;d<n.length&&!e.closed;d+=t?1:2)e.next(n[d]);return this._checkFinalizedStatuses(e),r}_trimBuffer(){let{_bufferSize:e,_timestampProvider:r,_buffer:t,_infiniteTimeWindow:o}=this,n=(o?1:2)*e;if(e<1/0&&n<t.length&&t.splice(0,t.length-n),!o){let d=r.now(),_=0;for(let C=1;C<t.length&&t[C]<=d;C+=2)_=C;_&&t.splice(0,_+1)}}};var bp=class extends Jt{constructor(){super(...arguments),this._value=null,this._hasValue=!1,this._isComplete=!1}_checkFinalizedStatuses(e){let{hasError:r,_hasValue:t,_value:o,thrownError:n,isStopped:d,_isComplete:_}=this;r?e.error(n):(d||_)&&(t&&e.next(o),e.complete())}next(e){this.isStopped||(this._value=e,this._hasValue=!0)}complete(){let{_hasValue:e,_value:r,_isComplete:t}=this;t||(this._isComplete=!0,e&&super.next(r),super.complete())}};var Qv=class extends pn{constructor(e,r){super()}schedule(e,r=0){return this}};var Ig={setInterval(i,e,...r){let{delegate:t}=Ig;return t?.setInterval?t.setInterval(i,e,...r):setInterval(i,e,...r)},clearInterval(i){let{delegate:e}=Ig;return(e?.clearInterval||clearInterval)(i)},delegate:void 0};var xp=class extends Qv{constructor(e,r){super(e,r),this.scheduler
vendor: 4,658 bytes, line 1320
1320=e,this.work=r,this.pending=!1}schedule(e,r=0){var t;if(this.closed)return this;this.state=e;let o=this.id,n=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(n,o,r)),this.pending=!0,this.delay=r,this.id=(t=this.id)!==null&&t!==void 0?t:this.requestAsyncId(n,this.id,r),this}requestAsyncId(e,r,t=0){return Ig.setInterval(e.flush.bind(e,this),t)}recycleAsyncId(e,r,t=0){if(t!=null&&this.delay===t&&this.pending===!1)return r;r!=null&&Ig.clearInterval(r)}execute(e,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let t=this._execute(e,r);if(t)return t;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,r){let t=!1,o;try{this.work(e)}catch(n){t=!0,o=n||new Error("Scheduled action threw falsy error")}if(t)return this.unsubscribe(),o}unsubscribe(){if(!this.closed){let{id:e,scheduler:r}=this,{actions:t}=r;this.work=this.state=this.scheduler=null,this.pending=!1,Ed(t,this),e!=null&&(this.id=this.recycleAsyncId(r,e,null)),this.delay=null,super.unsubscribe()}}};var wp=class i{constructor(e,r=i.now){this.schedulerActionCtor=e,this.now=r}schedule(e,r=0,t){return new this.schedulerActionCtor(this,e).schedule(t,r)}};wp.now=Sg.now;var Cp=class extends wp{constructor(e,r=wp.now){super(e,r),this.actions=[],this._active=!1}flush(e){let{actions:r}=this;if(this._active){r.push(e);return}let t;this._active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}}};var Kl=new Cp(xp),N2=Kl;var Jv=class extends xp{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}requestAsyncId(e,r,t=0){return t!==null&&t>0?super.requestAsyncId(e,r,t):(e.actions.push(this),e._scheduled||(e._scheduled=yp.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,r,t=0){var o;if(t!=null?t>0:this.delay>0)return super.recycleAsyncId(e,r,t);let{actions:n}=e;r!=null&&((o=n[n.length-1])===null||o===void 0?void 0:o.id)!==r&&(yp.cancelAnimationFrame(r),e._scheduled=void 0)}};var ey=class extends Cp{flush(e){this._active=!0;let r=this._scheduled;this._scheduled=void 0;let{actions:t}=this,o;e=e||t.shift();do if(o=e.execute(e.state,e.delay))break;while((e=t[0])&&e.id===r&&t.shift());if(this._active=!1,o){for(;(e=t[0])&&e.id===r&&t.shift();)e.unsubscribe();throw o}}};var ty=new ey(Jv);var Qo=new gi(i=>i.complete());function iy(i){return i&&di(i.schedule)}function MC(i){return i[i.length-1]}function ny(i){return di(MC(i))?i.pop():void 0}function Ya(i){return iy(MC(i))?i.pop():void 0}function z2(i,e){return typeof MC(i)=="number"?i.pop():e}function V2(i,e,r,t){function o(n){return n instanceof r?n:new r(function(d){d(n)})}return new(r||(r=Promise))(function(n,d){function _(j){try{M(t.next(j))}catch(G){d(G)}}function C(j){try{M(t.throw(j))}catch(G){d(G)}}function M(j){j.done?n(j.value):o(j.value).then(_,C)}M((t=t.apply(i,e||[])).next())})}function j2(i){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&i[e],t=0;if(r)return r.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&t>=i.length&&(i=void 0),{value:i&&i[t++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dd(i){return this instanceof Dd?(this.v=i,this):new Dd(i)}function B2(i,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r.apply(i,e||[]),o,n=[];return o={},d("next"),d("throw"),d("return"),o[Symbol.asyncIterator]=function(){return this},o;function d(ie){t[ie]&&(o[ie]=function(_e){return new Promise(function(Ee,Ye){n.push([ie,_e,Ee,Ye])>1||_(ie,_e)})})}function _(ie,_e){try{C(t[ie](_e))}catch(Ee){G(n[0][3],Ee)}}function C(ie){ie.value instanceof Dd?Promise.resolve(ie.value.v).then(M,j):G(n[0][2],ie)}function M(ie){_("next",ie)}function j(ie){_("throw",ie)}function G(ie,_e){ie(_e),n.shift(),n.length&&_(n[0][0],n[0][1])}}function U2(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],r;return e?e.call(i):(i=typeof j2=="function"?j2(i):i[Symbol.iterator](),r={},t("next"),t("throw"),t("return"),r[Symbol.asyncIterator]=function(){return this},r);function t(n){r[n]=i[n]&&function(d){return new Promise(function(_,C){d=i[n](d),o(_,C,d.done,d.value)})}}function o(n,d,_,C){Promise.resolve(C).then(function(M){n({value:M,done:_})},d)}}var Ep=i=>i&&typeof i.length=="number"&&typeof i!="function";function ry(i){return di(i?.then)}function oy(i){return di(i[gp])}function sy(i){return Symbol.asyncIterator&&di(i?.[Symbol.asyncIterator])}function ay(i){return new TypeError(`You provided ${i!==null&&typeof i=="object"?"an invali
1320d object":`'${i}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function $4(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ly=$4();function cy(i){return di(i?.[ly])}function uy(i){return B2(this,arguments,function*(){let r=i.getReader();try{for(;;){let{value:t,done:o}=yield Dd(r.read());if(o)return yield Dd(void 0);yield yield Dd(t)}}finally{r.releaseLock()}})}function dy(i){return di(i?.getReader)}function zn(i){if(i instanceof gi)return i;if(i!=null){if(oy(i))return G4(i);if(Ep(i))return q4(i);if(ry(i))return W4(i);if(sy(i))return H2(i);if(cy(i))return Z4(i);if(dy(i))return K4(i)}throw ay(i)}function G4(i){return new gi(e=>{let r=i[gp]();if(di(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function q4(i){return new gi(e=>{for(let r=0;r<i.length&&!e.closed;r++)e.next(i[r]);e.complete()})}function W4(i){return new gi(e=>{i.then(r=>{e.closed||(e.next(r),e.complete())},r=>e.error(r)).then(null,Kv)})}function Z4(i){return new gi(e=>{for(let r of i)if(e.next(r),e.closed)return;e.complete()})}function H2(i){return new gi(e=>{X4(i,e).catch(r=>e.error(r))})}function K4(i){return H2(uy(i))}function X4(i,e){var r,t,o,n;return V2(this,void 0,void 0,function*(){try{for(r=U2(i);t=yield r.next(),!t.done;){let d=t.value;if(e.next(d),e.closed)return}}catch(d){o={error:d}}finally{try{t&&!t.done&&(n=r.return)&&(yield n.call(r))}finally{if(o)throw o.error}}e.complete()})}function Jo(i,e,r,t=0,o=!1){let n=e.schedule(function(){r(),o?i.add(this.schedule(null,t)):this.unsubscribe()},t);if(i.add(n),!o)return n}function hy(i,e=0){return Ai((r,t)=>{r.subscribe(_i(t,o=>Jo(t,i,()=>t.next(o),e),()=>Jo(t,i,()=>t.complete(),e),o=>Jo(t,i,()=>t.error(o),e)))})}function py(i,e=0){return Ai((r,t)=>{t.add(i.schedule(()=>r.subscribe(t),e))})}function $2(i,e){return zn(i).pipe(py(e),hy(e))}function G2(i,e){return zn(i).pipe(py(e),hy(e))}function q2(i,e){return new gi(r=>{let t=0;return e.schedule(function(){t===i.length?r.complete():(r.next(i[t++]),r.closed||this.schedule())})})}function W2(i,e){return new gi(r=>{let t;return Jo(r,e,()=>{t=i[ly](),Jo(r,e,()=>{let o,n;try{({value:o,done:n}=t.next())}catch(d){r.error(d);return}n?r.complete():r.next(o)},0,!0)}),()=>di(t?.return)&&t.return()})}function fy(i,e){if(!i)throw new Error("Iterable cannot be null");return new gi(r=>{Jo(r,e,()=>{let t=i[Symbol.asyncIterator]();Jo(r,e,()=>{t.next().then(o=>{o.done?r.complete():r.next(o.value)})},0,!0)})})}function Z2(i,e){return fy(uy(i),e)}function K2(i,e){if(i!=null){if(oy(i))return $2(i,e);if(Ep(i))return q2(i,e);if(ry(i))return G2(i,e);if(sy(i))return fy(i,e);if(cy(i))return W2(i,e);if(dy(i))return Z2(i,e)}throw ay(i)}function Rn(i,e){return e?K2(i,e):zn(i)}function Bt(...i){let e=Ya(i);return Rn(i,e)}function Sp(i,e){let r=di(i)?i:()=>i,t=o=>o.error(r());return new gi(e?o=>e.schedule(t,0,o):t)}function my(i){return!!i&&(i instanceof gi||di(i.lift)&&di(i.subscribe))}var Ta=hp(i=>function(){i(this),this.name="EmptyError",this.message="no elements in sequence"});function kC(i,e){let r=typeof e=="object";return new Promise((t,o)=>{let n=!1,d;i.subscribe({next:_=>{d=_,n=!0},error:o,complete:()=>{n?t(d):r?t(e.defaultValue):o(new Ta)}})})}function X2(i){return i instanceof Date&&!isNaN(i)}function ei(i,e){return Ai((r,t)=>{let o=0;r.subscribe(_i(t,n=>{t.next(i.call(e,n,o++))}))})}var{isArray:Y4}=Array;function Q4(i,e){return Y4(e)?i(...e):i(e)}function Tp(i){return ei(e=>Q4(i,e))}var{isArray:J4}=Array,{getPrototypeOf:eB,prototype:tB,keys:iB}=Object;function gy(i){if(i.length===1){let e=i[0];if(J4(e))return{args:e,keys:null};if(nB(e)){let r=iB(e);return{args:r.map(t=>e[t]),keys:r}}}return{args:i,keys:null}}function nB(i){return i&&typeof i=="object"&&eB(i)===tB}function _y(i,e){return i.reduce((r,t,o)=>(r[t]=e[o],r),{})}function Md(...i){let e=Ya(i),r=ny(i),{args:t,keys:o}=gy(i);if(t.length===0)return Rn([],e);let n=new gi(rB(t,e,o?d=>_y(o,d):Ao));return r?n.pipe(Tp(r)):n}function rB(i,e,r=Ao){return t=>{Y2(e,()=>{let{length:o}=i,n=new Array(o),d=o,_=o;for(let C=0;C<o;C++)Y2(e,()=>{let M=Rn(i[C],e),j=!1;M.subscribe(_i(t,G=>{n[C]=G,j||(j=!0,_--),_||t.next(r(n.slice()))},()=>{--d||t.complete()}
vendor: 4,181 bytes, line 1320
1320))},t)},t)}}function Y2(i,e,r){i?Jo(r,i,e):e()}function Q2(i,e,r,t,o,n,d,_){let C=[],M=0,j=0,G=!1,ie=()=>{G&&!C.length&&!M&&e.complete()},_e=Ye=>M<t?Ee(Ye):C.push(Ye),Ee=Ye=>{n&&e.next(Ye),M++;let $e=!1;zn(r(Ye,j++)).subscribe(_i(e,at=>{o?.(at),n?_e(at):e.next(at)},()=>{$e=!0},void 0,()=>{if($e)try{for(M--;C.length&&M<t;){let at=C.shift();d?Jo(e,d,()=>Ee(at)):Ee(at)}ie()}catch(at){e.error(at)}}))};return i.subscribe(_i(e,_e,()=>{G=!0,ie()})),()=>{_?.()}}function jn(i,e,r=1/0){return di(e)?jn((t,o)=>ei((n,d)=>e(t,n,o,d))(zn(i(t,o))),r):(typeof e=="number"&&(r=e),Ai((t,o)=>Q2(t,o,i,r)))}function Kc(i=1/0){return jn(Ao,i)}function J2(){return Kc(1)}function Xc(...i){return J2()(Rn(i,Ya(i)))}function vy(i){return new gi(e=>{zn(i()).subscribe(e)})}function Dg(...i){let e=ny(i),{args:r,keys:t}=gy(i),o=new gi(n=>{let{length:d}=r;if(!d){n.complete();return}let _=new Array(d),C=d,M=d;for(let j=0;j<d;j++){let G=!1;zn(r[j]).subscribe(_i(n,ie=>{G||(G=!0,M--),_[j]=ie},()=>C--,void 0,()=>{(!C||!G)&&(M||n.next(t?_y(t,_):_),n.complete())}))}});return e?o.pipe(Tp(e)):o}var oB=["addListener","removeListener"],sB=["addEventListener","removeEventListener"],aB=["on","off"];function Yc(i,e,r,t){if(di(r)&&(t=r,r=void 0),t)return Yc(i,e,r).pipe(Tp(t));let[o,n]=uB(i)?sB.map(d=>_=>i[d](e,_,r)):lB(i)?oB.map(eA(i,e)):cB(i)?aB.map(eA(i,e)):[];if(!o&&Ep(i))return jn(d=>Yc(d,e,r))(zn(i));if(!o)throw new TypeError("Invalid event target");return new gi(d=>{let _=(...C)=>d.next(1<C.length?C:C[0]);return o(_),()=>n(_)})}function eA(i,e){return r=>t=>i[r](e,t)}function lB(i){return di(i.addListener)&&di(i.removeListener)}function cB(i){return di(i.on)&&di(i.off)}function uB(i){return di(i.addEventListener)&&di(i.removeEventListener)}function Ip(i=0,e,r=N2){let t=-1;return e!=null&&(iy(e)?r=e:t=e),new gi(o=>{let n=X2(i)?+i-r.now():i;n<0&&(n=0);let d=0;return r.schedule(function(){o.closed||(o.next(d++),0<=t?this.schedule(void 0,t):o.complete())},n)})}function AC(i=0,e=Kl){return i<0&&(i=0),Ip(i,i,e)}function Dp(...i){let e=Ya(i),r=z2(i,1/0),t=i;return t.length?t.length===1?zn(t[0]):Kc(r)(Rn(t,e)):Qo}var dB=new gi(Sd);function PC(){return dB}function dn(i,e){return Ai((r,t)=>{let o=0;r.subscribe(_i(t,n=>i.call(e,n,o++)&&t.next(n)))})}function tA(i){return Ai((e,r)=>{let t=!1,o=null,n=null,d=!1,_=()=>{if(n?.unsubscribe(),n=null,t){t=!1;let M=o;o=null,r.next(M)}d&&r.complete()},C=()=>{n=null,d&&r.complete()};e.subscribe(_i(r,M=>{t=!0,o=M,n||zn(i(M)).subscribe(n=_i(r,_,C))},()=>{d=!0,(!t||!n||n.closed)&&r.complete()}))})}function yy(i,e=Kl){return tA(()=>Ip(i,e))}function Vs(i){return Ai((e,r)=>{let t=null,o=!1,n;t=e.subscribe(_i(r,void 0,void 0,d=>{n=zn(i(d,Vs(i)(e))),t?(t.unsubscribe(),t=null,n.subscribe(r)):o=!0})),o&&(t.unsubscribe(),t=null,n.subscribe(r))})}function iA(i,e,r,t,o){return(n,d)=>{let _=r,C=e,M=0;n.subscribe(_i(d,j=>{let G=M++;C=_?i(C,j,G):(_=!0,j),t&&d.next(C)},o&&(()=>{_&&d.next(C),d.complete()})))}}function Xl(i,e){return di(e)?jn(i,e,1):jn(i,1)}function Mg(i,e=Kl){return Ai((r,t)=>{let o=null,n=null,d=null,_=()=>{if(o){o.unsubscribe(),o=null;let M=n;n=null,t.next(M)}};function C(){let M=d+i,j=e.now();if(j<M){o=this.schedule(void 0,M-j),t.add(o);return}_()}r.subscribe(_i(t,M=>{n=M,d=e.now(),o||(o=e.schedule(C,i),t.add(o))},()=>{_(),t.complete()},void 0,()=>{n=o=null}))})}function Qc(i){return Ai((e,r)=>{let t=!1;e.subscribe(_i(r,o=>{t=!0,r.next(o)},()=>{t||r.next(i),r.complete()}))})}function Ur(i){return i<=0?()=>Qo:Ai((e,r)=>{let t=0;e.subscribe(_i(r,o=>{++t<=i&&(r.next(o),i<=t&&r.complete())}))})}function by(i){return ei(()=>i)}function kd(i,e=Ao){return i=i??hB,Ai((r,t)=>{let o,n=!0;r.subscribe(_i(t,d=>{let _=e(d);(n||!i(o,_))&&(n=!1,o=_,t.next(d))}))})}function hB(i,e){return i===e}function xy(i=pB){return Ai((e,r)=>{let t=!1;e.subscribe(_i(r,o=>{t=!0,r.next(o)},()=>t?r.complete():r.error(i())))})}function pB(){return new Ta}function Ad(i){return Ai((e,r)=>{try{e.subscribe(r)}finally{r.add(i)}})}function fs(i,e){let r=arguments.length>=2;return t=>t.pipe(i?dn((o,n)=>i(o,n,t)):Ao,Ur(1),r?Qc(e):xy(()=>new Ta))}function Mp(i){return i<=0?()=>Qo:Ai((e,r)=>{let t=[];e.subscribe(_i(r,o=>{t.push(o),i<t.length&&t.shift()},()=>
1320{for(let o of t)r.next(o);r.complete()},void 0,()=>{t=null}))})}function OC(i,e){let r=arguments.length>=2;return t=>t.pipe(i?dn((o,n)=>i(o,n,t)):Ao,Mp(1),r?Qc(e):xy(()=>new Ta))}function wy(){return Ai((i,e)=>{let r,t=!1;i.subscribe(_i(e,o=>{let n=r;r=o,t&&e.next([n,o]),t=!0}))})}function RC(i,e){return Ai(iA(i,e,arguments.length>=2,!0))}function kg(i){return dn((e,r)=>i<=r)}function Bs(...i){let e=Ya(i);return Ai((r,t)=>{(e?Xc(i,r,e):Xc(i,r)).subscribe(t)})}function xr(i,e){return Ai((r,t)=>{let o=null,n=0,d=!1,_=()=>d&&!o&&t.complete();r.subscribe(_i(t,C=>{o?.unsubscribe();let M=0,j=n++;zn(i(C,j)).subscribe(o=_i(t,G=>t.next(e?e(C,G,j,M++):G),()=>{o=null,_()}))},()=>{d=!0,_()}))})}function es(i){return Ai((e,r)=>{zn(i).subscribe(_i(r,()=>r.complete(),Sd)),!r.closed&&e.subscribe(r)})}function Vi(i,e,r){let t=di(i)||e||r?{next:i,error:e,complete:r}:i;return t?Ai((o,n)=>{var d;(d=t.subscribe)===null||d===void 0||d.call(t);let _=!0;o.subscribe(_i(n,C=>{var M;(M=t.next)===null||M===void 0||M.call(t,C),n.next(C)},()=>{var C;_=!1,(C=t.complete)===null||C===void 0||C.call(t),n.complete()},C=>{var M;_=!1,(M=t.error)===null||M===void 0||M.call(t,C),n.error(C)},()=>{var C,M;_&&((C=t.unsubscribe)===null||C===void 0||C.call(t)),(M=t.finalize)===null||M===void 0||M.call(t)}))}):Ao}function nA(i,e){return Ai((r,t)=>{let{leading:o=!0,trailing:n=!1}=e??{},d=!1,_=null,C=null,M=!1,j=()=>{C?.unsubscribe(),C=null,n&&(_e(),M&&t.complete())},G=()=>{C=null,M&&t.complete()},ie=Ee=>C=zn(i(Ee)).subscribe(_i(t,j,G)),_e=()=>{if(d){d=!1;let Ee=_;_=null,t.next(Ee),!M&&ie(Ee)}};r.subscribe(_i(t,Ee=>{d=!0,_=Ee,!(C&&!C.closed)&&(o?_e():ie(Ee))},()=>{M=!0,!(n&&d&&C&&!C.closed)&&t.complete()}))})}function kp(i,e=Kl,r){let t=Ip(i,e);return nA(()=>t,r)}function Gn(i){for(let e in i)if(i[e]===Gn)return e;throw Error("Could not find renamed property on target object.")}function Cy(i,e){for(let r in e)e.hasOwnProperty(r)&&!i.hasOwnProperty(r)&&(i[r]=e[r])}function Co(i){if(typeof i=="string")return i;if(Array.isArray(i))return"["+i.map(Co).join(", ")+"]";if(i==null)return""+i;if(i.overriddenName)return`${i.overriddenName}`;if(i.name)return`${i.name}`;let e=i.toString();if(e==null)return""+e;let r=e.indexOf(`
1321`);return r===-1?e:e.substring(0,r)}function JC(i,e){return i==null||i===""?e===null?"":e:e==null||e===""?i:i+" "+e}var fB=Gn({__forward_ref__:Gn});function Jr(i){return i.__forward_ref__=Jr,i.toString=function(){return Co(this())},i}function Po(i){return qA(i)?i():i}function qA(i){return typeof i=="function"&&i.hasOwnProperty(fB)&&i.__forward_ref__===Jr}function WA(i){return i&&!!i.\u0275providers}var ZA="https://g.co/ng/security#xss",yt=class extends Error{constructor(e,r){super(lb(e,r)),this.code=e}};function lb(i,e){return`${`NG0${Math.abs(i)}`}${e?": "+e:""}`}var mB=Gn({\u0275cmp:Gn}),gB=Gn({\u0275dir:Gn}),_B=Gn({\u0275pipe:Gn}),vB=Gn({\u0275mod:Gn}),zy=Gn({\u0275fac:Gn}),Pg=Gn({__NG_ELEMENT_ID__:Gn}),rA=Gn({__NG_ENV_ID__:Gn});function el(i){return typeof i=="string"?i:i==null?"":String(i)}function yB(i){return typeof i=="function"?i.name||i.toString():typeof i=="object"&&i!=null&&typeof i.type=="function"?i.type.name||i.type.toString():el(i)}function bB(i,e){let r=e?`. Dependency path: ${e.join(" > ")} > ${i}`:"";throw new yt(-200,`Circular dependency in DI detected for ${i}${r}`)}function sS(i,e){let r=e?` in ${e}`:"";throw new yt(-201,!1)}function xB(i,e){i==null&&wB(e,i,null,"!=")}function wB(i,e,r,t){throw new Error(`ASSERTION ERROR: ${i}`+(t==null?"":` [Expected=> ${r} ${t} ${e} <=Actual]`))}function Qe(i){return{token:i.token,providedIn:i.providedIn||null,factory:i.factory,value:void 0}}function Bi(i){return{providers:i.providers||[],imports:i.imports||[]}}function cb(i){return oA(i,XA)||oA(i,YA)}function KA(i){return cb(i)!==null}function oA(i,e){return i.hasOwnProperty(e)?i[e]:null}function CB(i){let e=i&&(i[XA]||i[YA]);return e||null}function sA(i){return i&&(i.hasOwnProperty(aA)||i.hasOwnProperty(EB))?i[aA]:null}var XA=Gn({\u0275prov:Gn}),aA=Gn({\u0275inj:Gn}),YA=Gn({ngInjectableDef:Gn}),EB=Gn({ngInjectorDef:Gn}),Xi=function(i){return i[i.Default=0]="Default",i[i.Host=1]="Host",i[i.Self=2]="Self",i[i.SkipSelf=4]="SkipSelf",i[i.Optional=8]="Optional",i}(Xi||{}),eE;function QA(){return eE}function ts(i){let e=eE;return eE=i,e}function JA(i,e,r){let t=cb(i);if(t&&t.providedIn=="root")return t.value===void 0?t.value=t.factory():t.value;if(r&Xi.Optional)return null;if(e!==void 0)return e;sS(Co(i),"Injector")}var ms=globalThis;var Ct=class{constructor(e,r){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,typeof r=="number"?this.__NG_ELEMENT_ID__=r:r!==void 0&&(this.\u0275prov=Qe({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};var SB={},Og=SB,tE="__NG_DI_FLAG__",jy="ngTempTokenPath",TB="ngTokenPath",IB=/\n/gm,DB="\u0275",lA="__source",Lp;function MB(){return Lp}
1321function Jc(i){let e=Lp;return Lp=i,e}function kB(i,e=Xi.Default){if(Lp===void 0)throw new yt(-203,!1);return Lp===null?JA(i,void 0,e):Lp.get(i,e&Xi.Optional?null:void 0,e)}function Ve(i,e=Xi.Default){return(QA()||kB)(Po(i),e)}function _t(i,e=Xi.Default){return Ve(i,ub(e))}function ub(i){return typeof i>"u"||typeof i=="number"?i:0|(i.optional&&8)|(i.host&&1)|(i.self&&2)|(i.skipSelf&&4)}function iE(i){let e=[];for(let r=0;r<i.length;r++){let t=Po(i[r]);if(Array.isArray(t)){if(t.length===0)throw new yt(900,!1);let o,n=Xi.Default;for(let d=0;d<t.length;d++){let _=t[d],C=AB(_);typeof C=="number"?C===-1?o=_.token:n|=C:o=_}e.push(Ve(o,n))}else e.push(Ve(t))}return e}function eP(i,e){return i[tE]=e,i.prototype[tE]=e,i}function AB(i){return i[tE]}function PB(i,e,r,t){let o=i[jy];throw e[lA]&&o.unshift(e[lA]),i.message=OB(`
1322`+i.message,o,r,t),i[TB]=o,i[jy]=null,i}function OB(i,e,r,t=null){i=i&&i.charAt(0)===`
1323`&&i.charAt(1)==DB?i.slice(2):i;let o=Co(e);if(Array.isArray(e))o=e.map(Co).join(" -> ");else if(typeof e=="object"){let n=[];for(let d in e)if(e.hasOwnProperty(d)){let _=e[d];n.push(d+":"+(typeof _=="string"?JSON.stringify(_):Co(_)))}o=`{${n.join(", ")}}`}return`${r}${t?"("+t+")":""}[${o}]: ${i.replace(IB,`
1324  `)}`}function Hg(i){return{toString:i}.toString()}var tP=function(i){return i[i.OnPush=0]="OnPush",i[i.Default=1]="Default",i}(tP||{}),nl=function(i){return i[i.Emulated=0]="Emulated",i[i.None=2]="None",i[i.ShadowDom=3]="ShadowDom",i}(nl||{}),Np={},Oo=[];function iP(i,e,r){let t=i.length;for(;;){let o=i.indexOf(e,r);if(o===-1)return o;if(o===0||i.charCodeAt(o-1)<=32){let n=e.length;if(o+n===t||i.charCodeAt(o+n)<=32)return o}r=o+1}}function nE(i,e,r){let t=0;for(;t<r.length;){let o=r[t];if(typeof o=="number"){if(o!==0)break;t++;let n=r[t++],d=r[t++],_=r[t++];i.setAttribute(e,d,_,n)}else{let n=o,d=r[++t];RB(n)?i.setProperty(e,n,d):i.setAttribute(e,n,d),t++}}return t}function nP(i){return i===3||i===4||i===6}function RB(i){return i.charCodeAt(0)===64}function Rg(i,e){if(!(e===null||e.length===0))if(i===null||i.length===0)i=e.slice();else{let r=-1;for(let t=0;t<e.length;t++){let o=e[t];typeof o=="number"?r=o:r===0||(r===-1||r===2?cA(i,r,o,null,e[++t]):cA(i,r,o,null,null))}}return i}function cA(i,e,r,t,o){let n=0,d=i.length;if(e===-1)d=-1;else for(;n<i.length;){let _=i[n++];if(typeof _=="number"){if(_===e){d=-1;break}else if(_>e){d=n-1;break}}}for(;n<i.length;){let _=i[n];if(typeof _=="number")break;if(_===r){if(t===null){o!==null&&(i[n+1]=o);return}else if(t===i[n+1]){i[n+2]=o;return}}n++,t!==null&&n++,o!==null&&n++}d!==-1&&(i.splice(d,0,e),n=d+1),i.splice(n++,0,r),t!==null&&i.splice(n++,0,t),o!==null&&i.splice(n++,0,o)}var rP="ng-template";function LB(i,e,r){let t=0,o=!0;for(;t<i.length;){let n=i[t++];if(typeof n=="string"&&o){let d=i[t++];if(r&&n==="class"&&iP(d.toLowerCase(),e,0)!==-1)return!0}else if(n===1){for(;t<i.length&&typeof(n=i[t++])=="string";)if(n.toLowerCase()===e)return!0;return!1}else typeof n=="number"&&(o=!1)}return!1}function oP(i){return i.type===4&&i.value!==rP}function FB(i,e,r){let t=i.type===4&&!r?rP:i.value;return e===t}function NB(i,e,r){let t=4,o=i.attrs||[],n=VB(o),d=!1;for(let _=0;_<e.length;_++){let C=e[_];if(typeof C=="number"){if(!d&&!Ia(t)&&!Ia(C))return!1;if(d&&Ia(C))continue;d=!1,t=C|t&1;continue}if(!d)if(t&4){if(t=2|t&1,C!==""&&!FB(i,C,r)||C===""&&e.length===1){if(Ia(t))return!1;d=!0}}else{let M=t&8?C:e[++_];if(t&8&&i.attrs!==null){if(!LB(i.attrs,M,r)){if(Ia(t))return!1;d=!0}continue}let j=t&8?"class":C,G=zB(j,o,oP(i),r);if(G===-1){if(Ia(t))return!1;d=!0;continue}if(M!==""){let ie;G>n?ie="":ie=o[G+1].toLowerCase();let _e=t&8?ie:null;if(_e&&iP(_e,M,0)!==-1||t&2&&M!==ie){if(Ia(t))return!1;d=!0}}}}return Ia(t)||d}function Ia(i){return(i&1)===0}function zB(i,e,r,t){if(e===null)return-1;let o=0;if(t||!r){let n=!1;for(;o<e.length;){let d=e[o];if(d===i)return o;if(d===3||d===6)n=!0;else if(d===1||d===2){let _=e[++o];for(;typeof _=="string";)_=e[++o];continue}else{if(d===4)break;if(d===0){o+=4;continue}}o+=n?1:2}return-1}else return BB(e,i)}function sP(i,e,r=!1){for(let t=0;t<e.length;t++)if(NB(i,e[t],r))return!0;return!1}function jB(i){let e=i.attrs;if(e!=null){let r=e.indexOf(5);
1324if(!(r&1))return e[r+1]}return null}function VB(i){for(let e=0;e<i.length;e++){let r=i[e];if(nP(r))return e}return i.length}function BB(i,e){let r=i.indexOf(4);if(r>-1)for(r++;r<i.length;){let t=i[r];if(typeof t=="number")return-1;if(t===e)return r;r++}return-1}function UB(i,e){e:for(let r=0;r<e.length;r++){let t=e[r];if(i.length===t.length){for(let o=0;o<i.length;o++)if(i[o]!==t[o])continue e;return!0}}return!1}function uA(i,e){return i?":not("+e.trim()+")":e}function HB(i){let e=i[0],r=1,t=2,o="",n=!1;for(;r<i.length;){let d=i[r];if(typeof d=="string")if(t&2){let _=i[++r];o+="["+d+(_.length>0?'="'+_+'"':"")+"]"}else t&8?o+="."+d:t&4&&(o+=" "+d);else o!==""&&!Ia(d)&&(e+=uA(n,o),o=""),t=d,n=n||!Ia(t);r++}return o!==""&&(e+=uA(n,o)),e}function $B(i){return i.map(HB).join(",")}function GB(i){let e=[],r=[],t=1,o=2;for(;t<i.length;){let n=i[t];if(typeof n=="string")o===2?n!==""&&e.push(n,i[++t]):o===8&&r.push(n);else{if(!Ia(o))break;o=n}t++}return{attrs:e,classes:r}}function st(i){return Hg(()=>{let e=dP(i),r=en(bt({},e),{decls:i.decls,vars:i.vars,template:i.template,consts:i.consts||null,ngContentSelectors:i.ngContentSelectors,onPush:i.changeDetection===tP.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&i.dependencies||null,getStandaloneInjector:null,signals:i.signals??!1,data:i.data||{},encapsulation:i.encapsulation||nl.Emulated,styles:i.styles||Oo,_:null,schemas:i.schemas||null,tView:null,id:""});hP(r);let t=i.dependencies;return r.directiveDefs=hA(t,!1),r.pipeDefs=hA(t,!0),r.id=ZB(r),r})}function qB(i){return tu(i)||aP(i)}function WB(i){return i!==null}function Ui(i){return Hg(()=>({type:i.type,bootstrap:i.bootstrap||Oo,declarations:i.declarations||Oo,imports:i.imports||Oo,exports:i.exports||Oo,transitiveCompileScopes:null,schemas:i.schemas||null,id:i.id||null}))}function dA(i,e){if(i==null)return Np;let r={};for(let t in i)if(i.hasOwnProperty(t)){let o=i[t],n=o;Array.isArray(o)&&(n=o[1],o=o[0]),r[o]=t,e&&(e[o]=n)}return r}function bi(i){return Hg(()=>{let e=dP(i);return hP(e),e})}function aS(i){return{type:i.type,name:i.name,factory:null,pure:i.pure!==!1,standalone:i.standalone===!0,onDestroy:i.type.prototype.ngOnDestroy||null}}function tu(i){return i[mB]||null}function aP(i){return i[gB]||null}function lP(i){return i[_B]||null}function cP(i){let e=tu(i)||aP(i)||lP(i);return e!==null?e.standalone:!1}function uP(i,e){let r=i[vB]||null;if(!r&&e===!0)throw new Error(`Type ${Co(i)} does not have '\u0275mod' property.`);return r}function dP(i){let e={};return{type:i.type,providersResolver:null,factory:null,hostBindings:i.hostBindings||null,hostVars:i.hostVars||0,hostAttrs:i.hostAttrs||null,contentQueries:i.contentQueries||null,declaredInputs:e,inputTransforms:null,inputConfig:i.inputs||Np,exportAs:i.exportAs||null,standalone:i.standalone===!0,signals:i.signals===!0,selectors:i.selectors||Oo,viewQuery:i.viewQuery||null,features:i.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:dA(i.inputs,e),outputs:dA(i.outputs),debugInfo:null}}function hP(i){i.features?.forEach(e=>e(i))}function hA(i,e){if(!i)return null;let r=e?lP:qB;return()=>(typeof i=="function"?i():i).map(t=>r(t)).filter(WB)}function ZB(i){let e=0,r=[i.selectors,i.ngContentSelectors,i.hostVars,i.hostAttrs,i.consts,i.vars,i.decls,i.encapsulation,i.standalone,i.signals,i.exportAs,JSON.stringify(i.inputs),JSON.stringify(i.outputs),Object.getOwnPropertyNames(i.type.prototype),!!i.contentQueries,!!i.viewQuery].join("|");for(let o of r)e=Math.imul(31,e)+o.charCodeAt(0)<<0;return e+=2147483647+1,"c"+e}var gs=0,Ri=1,vi=2,Er=3,Da=4,vs=5,rl=6,Lg=7,Us=8,zp=9,Yl=10,Vn=11,Fg=12,pA=13,qp=14,_s=15,$g=16,Ap=17,tl=18,db=19,pP=20,eu=21,LC=22,Rd=23,Pr=25,fP=1,Ng=6,Ql=7,Vy=8,jp=9,Ro=10,Vp=function(i){return i[i.None=0]="None",i[i.HasTransplantedViews=2]="HasTransplantedViews",i[i.HasChildViewsToRefresh=4]="HasChildViewsToRefresh",i}(Vp||{});function il(i){return Array.isArray(i)&&typeof i[fP]=="object"}function Hs(i){return Array.isArray(i)&&i[fP]===!0}function lS(i){return(i.flags&4)!==0}function Gg(i){return i.componentOffset>-1}function hb(i){return(i.flags&1)===1}function iu(i){return!!i.template}function mP(i){return(i[vi]&512)!==0}function Ld(i,e){let r=i.hasOwnProperty(zy);return r?i[zy]:null}var rE=class{constructor(e,r,t){this.previousValue=e,this.currentValue=r,this.firstChange=t}isFirstChange(){return this.firstChange}};function hn(){return gP}function gP(i){return i.type.prototype.ngOnChanges&&(i.setInput=XB),KB}hn.ngInherit=!0;function KB(){let i=vP(this),e=i?.current;if(e){let r=i.previous;if(r===Np)i.previous=e;else for(let t in e)r[t]=e[t];i.current=null,this.ngOnChanges(e)}}function XB(i,e,r,t){let o=this.declaredInputs[r],n=vP(i)||YB(i,{previous:N
1324p,current:null}),d=n.current||(n.current={}),_=n.previous,C=_[o];d[o]=new rE(C&&C.currentValue,e,_===Np),i[t]=e}var _P="__ngSimpleChanges__";function vP(i){return i[_P]||null}function YB(i,e){return i[_P]=e}var fA=null;var Qa=function(i,e,r){fA?.(i,e,r)},yP="svg",QB="math",JB=!1;function e5(){return JB}function Ma(i){for(;Array.isArray(i);)i=i[gs];return i}function bP(i,e){return Ma(e[i])}function ys(i,e){return Ma(e[i.index])}function cS(i,e){return i.data[e]}function xP(i,e){return i[e]}function ou(i,e){let r=e[i];return il(r)?r:r[gs]}function t5(i){return(i[vi]&4)===4}function uS(i){return(i[vi]&128)===128}function i5(i){return Hs(i[Er])}function Bp(i,e){return e==null?null:i[e]}function wP(i){i[Ap]=0}function n5(i){i[vi]&1024||(i[vi]|=1024,uS(i)&&zg(i))}function r5(i,e){for(;i>0;)e=e[qp],i--;return e}function CP(i){return i[vi]&9216||i[Rd]?.dirty}function oE(i){CP(i)?zg(i):i[vi]&64&&(e5()?(i[vi]|=1024,zg(i)):i[Yl].changeDetectionScheduler?.notify())}function zg(i){i[Yl].changeDetectionScheduler?.notify();let e=i[Er];for(;e!==null&&!(Hs(e)&&e[vi]&Vp.HasChildViewsToRefresh||il(e)&&e[vi]&8192);){if(Hs(e))e[vi]|=Vp.HasChildViewsToRefresh;else if(e[vi]|=8192,!uS(e))break;e=e[Er]}}function EP(i,e){if((i[vi]&256)===256)throw new yt(911,!1);i[eu]===null&&(i[eu]=[]),i[eu].push(e)}function o5(i,e){if(i[eu]===null)return;let r=i[eu].indexOf(e);r!==-1&&i[eu].splice(r,1)}var zi={lFrame:AP(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function s5(){return zi.lFrame.elementDepthCount}function a5(){zi.lFrame.elementDepthCount++}function l5(){zi.lFrame.elementDepthCount--}function SP(){return zi.bindingsEnabled}function Wp(){return zi.skipHydrationRootTNode!==null}function c5(i){return zi.skipHydrationRootTNode===i}function u5(i){zi.skipHydrationRootTNode=i}function d5(){zi.skipHydrationRootTNode=null}function yi(){return zi.lFrame.lView}function gr(){return zi.lFrame.tView}function Se(i){return zi.lFrame.contextLView=i,i[Us]}function Te(i){return zi.lFrame.contextLView=null,i}function Fo(){let i=TP();for(;i!==null&&i.type===64;)i=i.parent;return i}function TP(){return zi.lFrame.currentTNode}function h5(){let i=zi.lFrame,e=i.currentTNode;return i.isParent?e:e.parent}function Hd(i,e){let r=zi.lFrame;r.currentTNode=i,r.isParent=e}function dS(){return zi.lFrame.isParent}function hS(){zi.lFrame.isParent=!1}function p5(){return zi.lFrame.contextLView}function Zp(){let i=zi.lFrame,e=i.bindingRootIndex;return e===-1&&(e=i.bindingRootIndex=i.tView.bindingStartIndex),e}function IP(){return zi.lFrame.bindingIndex}function f5(i){return zi.lFrame.bindingIndex=i}function qg(){return zi.lFrame.bindingIndex++}function pb(i){let e=zi.lFrame,r=e.bindingIndex;return e.bindingIndex=e.bindingIndex+i,r}function m5(){return zi.lFrame.inI18n}function g5(i,e){let r=zi.lFrame;r.bindingIndex=r.bindingRootIndex=i,sE(e)}function _5(){return zi.lFrame.currentDirectiveIndex}function sE(i){zi.lFrame.currentDirectiveIndex=i}function v5(i){let e=zi.lFrame.currentDirectiveIndex;return e===-1?null:i[e]}function DP(){return zi.lFrame.currentQueryIndex}function pS(i){zi.lFrame.currentQueryIndex=i}function y5(i){let e=i[Ri];return e.type===2?e.declTNode:e.type===1?i[vs]:null}function MP(i,e,r){if(r&Xi.SkipSelf){let o=e,n=i;for(;o=o.parent,o===null&&!(r&Xi.Host);)if(o=y5(n),o===null||(n=n[qp],o.type&10))break;if(o===null)return!1;e=o,i=n}let t=zi.lFrame=kP();return t.currentTNode=e,t.lView=i,!0}function fS(i){let e=kP(),r=i[Ri];zi.lFrame=e,e.currentTNode=r.firstChild,e.lView=i,e.tView=r,e.contextLView=i,e.bindingIndex=r.bindingStartIndex,e.inI18n=!1}function kP(){let i=zi.lFrame,e=i===null?null:i.child;return e===null?AP(i):e}function AP(i){let e={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:i,child:null,inI18n:!1};return i!==null&&(i.child=e),e}function PP(){let i=zi.lFrame;return zi.lFrame=i.parent,i.currentTNode=null,i.lView=null,i}var OP=PP;function mS(){let i=PP();i.isParent=!0,i.tView=null,i.selectedIndex=-1,i.contextLView=null,i.elementDepthCount=0,i.currentDirectiveIndex=-1,i.currentNamespace=null,i.bindingRootIndex=-1,i.bindingIndex=-1,i.currentQueryIndex=0}function b5(i){return(zi.lFrame.contextLView=r5(i,zi.lFrame.contextLView))[Us]}function ec(){return zi.lFrame.selectedIndex}function Fd(i){zi.lFrame.selectedIndex=i}function Kp(){let i=zi.lFrame;return cS(i.tView,i.selectedIndex)}function RP(){zi.lFrame.currentNamespace=yP}function LP(){return zi.lFrame.currentNamespace}var FP=!0;function fb(){return FP}function su(i){FP=i}function x5(i,e,r){let{ngOnChanges:t,ngOnInit:o,ngDoCheck:n}=e.type.prototype;if(t){let d=gP(e);(r.preOrderHooks??=[]).push(i,d),(r.preOrderCheckHooks??=[]).push(i,d)}o&&(r.preOrderHooks??=[]).push(0-i,o),n&&((r.preOrderHooks??=[]).push(i,n),(r.preOrderCheckHooks??=[]).push(i,n))}function mb(i,e){for(let r=e.directiveStart,t=e.directiveEnd;r<t;r++){let n=i.data[r].type.prototype,{ngAfterContentInit:d,ngAfterContentChecked:_,ngAfterViewInit:C,ngAfterViewChecked:M,ngOnDestroy:j}=n;d&&(i.contentHooks??=[]).push(-r,d),_&&((i.contentHooks??=[]).push(r,_),(i.contentCheckHooks??=[]).push(r,_)),C&&(i.viewHooks??=[]).push(-r,C),M&&((i.viewHooks??=[]).push(r,M),(i.viewCheckHooks??=[]).push(r,M)),j!=null&&(i.destroyHooks??=[]).push(r,j)}}function Py(i,e,r){NP(i,e,3,r)}function Oy(i,e,r,t){(i[vi]&3)===r&&NP(i,e,r,t)}function FC(i,e){let r=i[vi];(r&3)===e&&(r&=16383,r+=1,i[vi]=r)}function NP(i,e,r,t){let o=t!==void 0?i[Ap]&65535:0,n=t??-1,d=e.length-1,_=0;for(let C=o;C<d;C++)if(typeof e[C+1]=="number"){if(_=e[C],t!=null&&_>=t)break}else e[C]<0&&(i[Ap]+=65536),(_<n||n==-1)&&(w5(i,r,e,C),i[Ap]=(i[Ap]&4294901760)+C+2),C++}function mA(i,e){Qa(4,i,e);let r=ko(null);try{e.call(i)}finally{ko(r),Qa(5,i,e)}}function w5(i,e,r,t){let o=r[t]<0,n=r[t+1],d=o?-r[t]:r[t],_=i[d];o?i[vi]>>14<i[Ap]>>16&&(i[vi]&3)===e&&(i[vi]+=16384,mA(_,n)):mA(_,n)}var Fp=-1,Nd=class{constructor(e,r,t){this.factory=e,this.resolving=!1,this.canSeeViewProviders=r,this.injectImpl=t}};function C5(i){return i instanceof Nd}function E5(i){return(i.flags&8)!==0}function S5(i){return(i.flags&16)!==0}function zP(i){return i!==Fp}function By(i){let e=i&32767;return i&32767}function T5(i){return i>>16}function Uy(i,e){let r=T5(i),t=e;for(;r>0;)t=t[qp],r--;return t}var aE=!0;function Hy(i){let e=aE;return aE=i,e}var I5=256,jP=I5-1,VP=5,D5=0,Ja={};function M5(i,e,r){let t;typeof r=="string"?t=r.charCodeAt(0)||0:r.hasOwnProperty(Pg)&&(t=r[Pg]),t==null&&(t=r[Pg]=D5++);let o=t&jP,n=1<<o;e.data[i+(o>>VP)]|=n}function $y(i,e){let r=BP(i,e);if(r!==-1)return r;let t=e[Ri];t.firstCreatePass&&(i.injectorIndex=e.length,NC(t.data,i),NC(e,null),NC(t.blueprint,null));let o=gS(i,e),n=i.injectorIndex;if(zP(o)){let d=By(o),_=Uy(o,e),C=_[Ri].data;for(let M=0;M<8;M++)e[n+M]=_[d+M]|C[d+M]}return e[n+8]=o,n}function NC(i,e){i.push(0,0,0,0,0,0,0,0,e)}function BP(i,e){return i.injectorIndex===-1||i.parent&&i.parent.injectorIndex===i.injectorIndex||e[i.injectorIndex+8]===null?-1:i.injectorIndex}function gS(i,e){if(i.parent&&i.parent.injectorIndex!==-1)return i.parent.injectorIndex;let r=0,t=null,o=e;for(;o!==null;){if(t=qP(o),t===null)return Fp;if(r++,o=o[qp],t.injectorIndex!==-1)return t.injectorIndex|r<<16}return Fp}function lE(i,e,r){M5(i,e,r)}function k5(i,e){if(e==="class")return i.classes;if(e==="style")return i.styles;let r=i.attrs;if(r){let t=r.length,o=0;for(;o<t;){let n=r[o];if(nP(n))break;if(n===0)o=o+2;else if(typeof n=="number")for(o++;o<t&&typeof r[o]=="string";)o++;else{if(n===e)return r[o+1];o=o+2}}}return null}function UP(i,e,r){if(r&Xi.Optional||i!==void 0)return i;sS(e,"NodeInjector")}function HP(i,e,r,t){if(r&Xi.Optional&&t===void 0&&(t=null),!(r&(Xi.Self|Xi.Host))){let o=i[zp],n=ts(void 0);try{return o?o.get(e,t,r&Xi.Optional):JA(e,t,r&Xi.Optional)}finally{ts(n)}}return UP(t,e,r)}function $P(i,e,r,t=Xi.Default,o){if(i!==null){if(e[vi]&2048&&!(t&Xi.Self)){let d=R5(i,e,r,t,Ja);if(d!==Ja)return d}let n=GP(i,e,r,t,Ja);if(n!==Ja)return n}return HP(e,r,t,o)}function GP(i,e,r,t,o){let n=P5(r);if(typeof n=="function"){if(!MP(e,i,t))return t&Xi.Host?UP(o,r,t):HP(e,r,t,o);try{let d;if(d=n(t),d==null&&!(t&Xi.Optional))sS(r);else return d}finally{OP()}}else if(typeof n=="number"){let d=null,_=BP(i,e),C=Fp,M=t&Xi.Host?e[_s][vs]:null;for((_===-1||t&Xi.SkipSelf)&&(C=_===-1?gS(i,e):e[_+8],C===Fp||!_A(t,!1)?_=-1:(d=e[Ri],_=By(C),e=Uy(C,e)));_!==-1;){let j=e[Ri];if(gA(n,_,j.data)){let G=A5(_,e,r,d,t,M);if(G!==Ja)return G}C=e[_+8],C!==Fp&&_A(t,e[Ri].data[_+8]===M)&&gA(n,_,e)?(d=j,_=By(C),e=Uy(C,e)):_=-1}}return o}function A5(i,e,r,t,o,n){let d=e[Ri],_=d.data[i+8],C=t==null?Gg(_)&&aE:t!=d&&(_.type&3)!==0,M=o&Xi.Host&&n===_,j=Ry(_,d,r,C,M);return j!==null?zd(e,d,j,_):Ja}function Ry(i,e,r,t,o){let n=i.providerIndexes,d=e.data,_=n&1048575,C=i.directiveStart,M=i.directiveEnd,j=n>>20,G=t?_:_+j,ie=o?_+j:M;for(let _e=G;_e<ie;_e++){let Ee=d[_e];if(_e<C&&r===Ee||_e>=C&&Ee.type===r)return _e}if(o){let _e=d[C];if(_e&&iu(_e)&&_e.type===r)return C}return null}function zd(i,e,r,t){let o=i[r],n=e.data;if(C5(o)){let d=o;d.resolving&&bB(yB(n[r]));let _=Hy(d.canSeeViewProviders);d.resolving=!0;let C,M=d.injectImpl?ts(d.injectImpl):null,j=MP(i,t,Xi.Default);try{o=i[r]=d.factory(void 0,n,i,t),e.firstCreatePass&&r>=t.directiveStart&&x5(r,n[r],e)}finally{M!==null&&ts(M),Hy(_),d.resolving=!1,OP()}}return o}
vendor: 4,281 bytes, line 1324
1324function P5(i){if(typeof i=="string")return i.charCodeAt(0)||0;let e=i.hasOwnProperty(Pg)?i[Pg]:void 0;return typeof e=="number"?e>=0?e&jP:O5:e}function gA(i,e,r){let t=1<<i;return!!(r[e+(i>>VP)]&t)}function _A(i,e){return!(i&Xi.Self)&&!(i&Xi.Host&&e)}var Od=class{constructor(e,r){this._tNode=e,this._lView=r}get(e,r,t){return $P(this._tNode,this._lView,e,ub(t),r)}};function O5(){return new Od(Fo(),yi())}function uo(i){return Hg(()=>{let e=i.prototype.constructor,r=e[zy]||cE(e),t=Object.prototype,o=Object.getPrototypeOf(i.prototype).constructor;for(;o&&o!==t;){let n=o[zy]||cE(o);if(n&&n!==r)return n;o=Object.getPrototypeOf(o)}return n=>new n})}function cE(i){return qA(i)?()=>{let e=cE(Po(i));return e&&e()}:Ld(i)}function R5(i,e,r,t,o){let n=i,d=e;for(;n!==null&&d!==null&&d[vi]&2048&&!(d[vi]&512);){let _=GP(n,d,r,t|Xi.Self,Ja);if(_!==Ja)return _;let C=n.parent;if(!C){let M=d[pP];if(M){let j=M.get(r,Ja,t);if(j!==Ja)return j}C=qP(d),d=d[qp]}n=C}return o}function qP(i){let e=i[Ri],r=e.type;return r===2?e.declTNode:r===1?i[vs]:null}function Wg(i){return k5(Fo(),i)}var Ey="__parameters__";function L5(i){return function(...r){if(i){let t=i(...r);for(let o in t)this[o]=t[o]}}}function WP(i,e,r){return Hg(()=>{let t=L5(e);function o(...n){if(this instanceof o)return t.apply(this,n),this;let d=new o(...n);return _.annotation=d,_;function _(C,M,j){let G=C.hasOwnProperty(Ey)?C[Ey]:Object.defineProperty(C,Ey,{value:[]})[Ey];for(;G.length<=j;)G.push(null);return(G[j]=G[j]||[]).push(d),C}}return r&&(o.prototype=Object.create(r.prototype)),o.prototype.ngMetadataName=i,o.annotationCls=o,o})}function F5(i){return typeof i=="function"}function N5(i,e,r){if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++){let o=i[t],n=e[t];if(r&&(o=r(o),n=r(n)),n!==o)return!1}return!0}function z5(i){return i.flat(Number.POSITIVE_INFINITY)}function _S(i,e){i.forEach(r=>Array.isArray(r)?_S(r,e):e(r))}function ZP(i,e,r){e>=i.length?i.push(r):i.splice(e,0,r)}function Gy(i,e){return e>=i.length-1?i.pop():i.splice(e,1)[0]}function KP(i,e){let r=[];for(let t=0;t<i;t++)r.push(e);return r}function j5(i,e,r,t){let o=i.length;if(o==e)i.push(r,t);else if(o===1)i.push(t,i[0]),i[0]=r;else{for(o--,i.push(i[o-1],i[o]);o>e;){let n=o-2;i[o]=i[n],o--}i[e]=r,i[e+1]=t}}function $d(i,e,r){let t=Zg(i,e);return t>=0?i[t|1]=r:(t=~t,j5(i,t,e,r)),t}function zC(i,e){let r=Zg(i,e);if(r>=0)return i[r|1]}function Zg(i,e){return V5(i,e,1)}function V5(i,e,r){let t=0,o=i.length>>r;for(;o!==t;){let n=t+(o-t>>1),d=i[n<<r];if(e===d)return n<<r;d>e?o=n:t=n+1}return~(o<<r)}var Kg=eP(WP("Optional"),8);var gb=eP(WP("SkipSelf"),4);var jd=new Ct("ENVIRONMENT_INITIALIZER"),XP=new Ct("INJECTOR",-1),YP=new Ct("INJECTOR_DEF_TYPES"),qy=class{get(e,r=Og){if(r===Og){let t=new Error(`NullInjectorError: No provider for ${Co(e)}!`);throw t.name="NullInjectorError",t}return r}};function au(i){return{\u0275providers:i}}function vS(...i){return{\u0275providers:QP(!0,i),\u0275fromNgModule:!0}}function QP(i,...e){let r=[],t=new Set,o,n=d=>{r.push(d)};return _S(e,d=>{let _=d;uE(_,n,[],t)&&(o||=[],o.push(_))}),o!==void 0&&JP(o,n),r}function JP(i,e){for(let r=0;r<i.length;r++){let{ngModule:t,providers:o}=i[r];yS(o,n=>{e(n,t)})}}function uE(i,e,r,t){if(i=Po(i),!i)return!1;let o=null,n=sA(i),d=!n&&tu(i);if(!n&&!d){let C=i.ngModule;if(n=sA(C),n)o=C;else return!1}else{if(d&&!d.standalone)return!1;o=i}let _=t.has(o);if(d){if(_)return!1;if(t.add(o),d.dependencies){let C=typeof d.dependencies=="function"?d.dependencies():d.dependencies;for(let M of C)uE(M,e,r,t)}}else if(n){if(n.imports!=null&&!_){t.add(o);let M;try{_S(n.imports,j=>{uE(j,e,r,t)&&(M||=[],M.push(j))})}finally{}M!==void 0&&JP(M,e)}if(!_){let M=Ld(o)||(()=>new o);e({provide:o,useFactory:M,deps:Oo},o),e({provide:YP,useValue:o,multi:!0},o),e({provide:jd,useValue:()=>Ve(o),multi:!0},o)}let C=n.providers;if(C!=null&&!_){let M=i;yS(C,j=>{e(j,M)})}}else return!1;return o!==i&&i.providers!==void 0}function yS(i,e){for(let r of i)WA(r)&&(r=r.\u0275providers),Array.isArray(r)?yS(r,e):e(r)}var B5=Gn({provide:String,useValue:Gn});function eO(i){return i!==null&&typeof i=="object"&&B5 in i}function U5(i){return!!(i&&i.useExisting)}function H5(i){return!!(i&&i.useFactory)}function Up(i){return typeof i=="function"}function $5(i){return!!i.useClass}
1324var _b=new Ct("Set Injector scope."),Ly={},G5={},jC;function bS(){return jC===void 0&&(jC=new qy),jC}var Lo=class{},jg=class extends Lo{get destroyed(){return this._destroyed}constructor(e,r,t,o){super(),this.parent=r,this.source=t,this.scopes=o,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,hE(e,d=>this.processProvider(d)),this.records.set(XP,Pp(void 0,this)),o.has("environment")&&this.records.set(Lo,Pp(void 0,this));let n=this.records.get(_b);n!=null&&typeof n.value=="string"&&this.scopes.add(n.value),this.injectorDefTypes=new Set(this.get(YP,Oo,Xi.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{for(let r of this._ngOnDestroyHooks)r.ngOnDestroy();let e=this._onDestroyHooks;this._onDestroyHooks=[];for(let r of e)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear()}}onDestroy(e){return this.assertNotDestroyed(),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){this.assertNotDestroyed();let r=Jc(this),t=ts(void 0),o;try{return e()}finally{Jc(r),ts(t)}}get(e,r=Og,t=Xi.Default){if(this.assertNotDestroyed(),e.hasOwnProperty(rA))return e[rA](this);t=ub(t);let o,n=Jc(this),d=ts(void 0);try{if(!(t&Xi.SkipSelf)){let C=this.records.get(e);if(C===void 0){let M=X5(e)&&cb(e);M&&this.injectableDefInScope(M)?C=Pp(dE(e),Ly):C=null,this.records.set(e,C)}if(C!=null)return this.hydrate(e,C)}let _=t&Xi.Self?bS():this.parent;return r=t&Xi.Optional&&r===Og?null:r,_.get(e,r)}catch(_){if(_.name==="NullInjectorError"){if((_[jy]=_[jy]||[]).unshift(Co(e)),n)throw _;return PB(_,e,"R3InjectorError",this.source)}else throw _}finally{ts(d),Jc(n)}}resolveInjectorInitializers(){let e=Jc(this),r=ts(void 0),t;try{let o=this.get(jd,Oo,Xi.Self);for(let n of o)n()}finally{Jc(e),ts(r)}}toString(){let e=[],r=this.records;for(let t of r.keys())e.push(Co(t));return`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new yt(205,!1)}processProvider(e){e=Po(e);let r=Up(e)?e:Po(e&&e.provide),t=W5(e);if(!Up(e)&&e.multi===!0){let o=this.records.get(r);o||(o=Pp(void 0,Ly,!0),o.factory=()=>iE(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}else{let o=this.records.get(r)}this.records.set(r,t)}hydrate(e,r){return r.value===Ly&&(r.value=G5,r.value=r.factory()),typeof r.value=="object"&&r.value&&K5(r.value)&&this._ngOnDestroyHooks.add(r.value),r.value}injectableDefInScope(e){if(!e.providedIn)return!1;let r=Po(e.providedIn);return typeof r=="string"?r==="any"||this.scopes.has(r):this.injectorDefTypes.has(r)}removeOnDestroy(e){let r=this._onDestroyHooks.indexOf(e);r!==-1&&this._onDestroyHooks.splice(r,1)}};function dE(i){let e=cb(i),r=e!==null?e.factory:Ld(i);if(r!==null)return r;if(i instanceof Ct)throw new yt(204,!1);if(i instanceof Function)return q5(i);throw new yt(204,!1)}function q5(i){let e=i.length;if(e>0){let t=KP(e,"?");throw new yt(204,!1)}let r=CB(i);return r!==null?()=>r.factory(i):()=>new i}function W5(i){if(eO(i))return Pp(void 0,i.useValue);{let e=tO(i);return Pp(e,Ly)}}function tO(i,e,r){let t;if(Up(i)){let o=Po(i);return Ld(o)||dE(o)}else if(eO(i))t=()=>Po(i.useValue);else if(H5(i))t=()=>i.useFactory(...iE(i.deps||[]));else if(U5(i))t=()=>Ve(Po(i.useExisting));else{let o=Po(i&&(i.useClass||i.provide));if(Z5(i))t=()=>new o(...iE(i.deps));else return Ld(o)||dE(o)}return t}function Pp(i,e,r=!1){return{factory:i,value:e,multi:r?[]:void 0}}function Z5(i){return!!i.deps}function K5(i){return i!==null&&typeof i=="object"&&typeof i.ngOnDestroy=="function"}function X5(i){return typeof i=="function"||typeof i=="object"&&i instanceof Ct}function hE(i,e){for(let r of i)Array.isArray(r)?hE(r,e):r&&WA(r)?hE(r.\u0275providers,e):e(r)}function ll(i,e){i instanceof jg&&i.assertNotDestroyed();let r,t=Jc(i),o=ts(void 0);try{return e()}finally{Jc(t),ts(o)}}function Y5(i){if(!QA()&&!MB())throw new yt(-203,!1)}function vA(i,e=null,r=null,t){let o=iO(i,e,r,t);return o.resolveInjectorInitializers(),o}function iO(i,e=null,r=null,t,o=new Set){let n=[r||Oo,vS(i)];return t=t||(typeof i=="object"?void 0:Co(i)),new jg(n,e||bS(),t||null,o)}var is=(()=>{let e=class e{static create(t,o){if(Array.isArray(t))return vA({name:""},o,t,"");{let n=t.name??"";return vA({name:n},t.parent,t.providers,n)}}};e.THROW_IF_NOT_FOUND=Og,e.NULL=new qy,e.\u0275prov=Qe({token:e,providedIn:"any",factory:()=>Ve(XP)}),e.__NG_ELEMENT_ID__=-1;let i=e;return i})();var pE;function nO(i){pE=i}function Xg(){if(pE!==void 0)return pE;if(typeof document<"u")return document;throw new yt(210,!1)}
1324var Yg=new Ct("AppId",{providedIn:"root",factory:()=>Q5}),Q5="ng",xS=new Ct("Platform Initializer"),Qt=new Ct("Platform ID",{providedIn:"platform",factory:()=>"unknown"});var tc=new Ct("AnimationModuleType"),Qg=new Ct("CSP nonce",{providedIn:"root",factory:()=>Xg().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});function Jg(i){return i.ownerDocument.defaultView}function ns(i){return i.ownerDocument}function J5(i){return i.ownerDocument.body}function rO(i){return i instanceof Function?i():i}function Ag(i){return(i??_t(is)).get(Qt)==="browser"}var e6="ngSkipHydration",t6="ngskiphydration";function oO(i){let e=i.mergedAttrs;if(e===null)return!1;for(let r=0;r<e.length;r+=2){let t=e[r];if(typeof t=="number")return!1;if(typeof t=="string"&&t.toLowerCase()===t6)return!0}return!1}function sO(i){return i.hasAttribute(e6)}function Wy(i){return(i.flags&128)===128}function i6(i){if(Wy(i))return!0;let e=i.parent;for(;e;){if(Wy(i)||oO(e))return!0;e=e.parent}return!1}var ol=function(i){return i[i.Important=1]="Important",i[i.DashCase=2]="DashCase",i}(ol||{}),n6=/^>|^->|<!--|-->|--!>|<!-$/g,r6=/(<|>)/g,o6="\u200B$1\u200B";function s6(i){return i.replace(n6,e=>e.replace(r6,o6))}var aO=new Map,a6=0;function l6(){return a6++}function c6(i){aO.set(i[db],i)}function u6(i){aO.delete(i[db])}var yA="__ngContext__";function nu(i,e){il(e)?(i[yA]=e[db],c6(e)):i[yA]=e}var d6;function wS(i,e){return d6(i,e)}function CS(i){let e=i[Er];return Hs(e)?e[Er]:e}function lO(i){return uO(i[Fg])}function cO(i){return uO(i[Da])}function uO(i){for(;i!==null&&!Hs(i);)i=i[Da];return i}function Op(i,e,r,t,o){if(t!=null){let n,d=!1;Hs(t)?n=t:il(t)&&(d=!0,t=t[gs]);let _=Ma(t);i===0&&r!==null?o==null?mO(e,r,_):Ky(e,r,_,o||null,!0):i===1&&r!==null?Ky(e,r,_,o||null,!0):i===2?vO(e,_,d):i===3&&e.destroyNode(_),n!=null&&I6(e,i,n,r,o)}}function dO(i,e){return i.createText(e)}function h6(i,e,r){i.setValue(e,r)}function hO(i,e){return i.createComment(s6(e))}function ES(i,e,r){return i.createElement(e,r)}function p6(i,e){let r=e[Vn];e_(i,e,r,2,null,null),e[gs]=null,e[vs]=null}function f6(i,e,r,t,o,n){t[gs]=o,t[vs]=e,e_(i,t,r,1,o,n)}function m6(i,e){e_(i,e,e[Vn],2,null,null)}function g6(i){let e=i[Fg];if(!e)return VC(i[Ri],i);for(;e;){let r=null;if(il(e))r=e[Fg];else{let t=e[Ro];t&&(r=t)}if(!r){for(;e&&!e[Da]&&e!==i;)il(e)&&VC(e[Ri],e),e=e[Er];e===null&&(e=i),il(e)&&VC(e[Ri],e),r=e&&e[Da]}e=r}}function _6(i,e,r,t){let o=Ro+t,n=r.length;t>0&&(r[o-1][Da]=e),t<n-Ro?(e[Da]=r[o],ZP(r,Ro+t,e)):(r.push(e),e[Da]=null),e[Er]=r;let d=e[$g];d!==null&&r!==d&&v6(d,e);let _=e[tl];_!==null&&_.insertView(i),oE(e),e[vi]|=128}function v6(i,e){let r=i[jp],o=e[Er][Er][_s];e[_s]!==o&&(i[vi]|=Vp.HasTransplantedViews),r===null?i[jp]=[e]:r.push(e)}function pO(i,e){let r=i[jp],t=r.indexOf(e),o=e[Er];r.splice(t,1)}function Zy(i,e){if(i.length<=Ro)return;let r=Ro+e,t=i[r];if(t){let o=t[$g];o!==null&&o!==i&&pO(o,t),e>0&&(i[r-1][Da]=t[Da]);let n=Gy(i,Ro+e);p6(t[Ri],t);let d=n[tl];d!==null&&d.detachView(n[Ri]),t[Er]=null,t[Da]=null,t[vi]&=-129}return t}function SS(i,e){if(!(e[vi]&256)){let r=e[Vn];r.destroyNode&&e_(i,e,r,3,null,null),g6(e)}}function VC(i,e){if(!(e[vi]&256)){e[vi]&=-129,e[vi]|=256,e[Rd]&&D2(e[Rd]),b6(i,e),y6(i,e),e[Ri].type===1&&e[Vn].destroy();let r=e[$g];if(r!==null&&Hs(e[Er])){r!==e[Er]&&pO(r,e);let t=e[tl];t!==null&&t.detachView(i)}u6(e)}}function y6(i,e){let r=i.cleanup,t=e[Lg];if(r!==null)for(let n=0;n<r.length-1;n+=2)if(typeof r[n]=="string"){let d=r[n+3];d>=0?t[d]():t[-d].unsubscribe(),n+=2}else{let d=t[r[n+1]];r[n].call(d)}t!==null&&(e[Lg]=null);let o=e[eu];if(o!==null){e[eu]=null;for(let n=0;n<o.length;n++){let d=o[n];d()}}}function b6(i,e){let r;if(i!=null&&(r=i.destroyHooks)!=null)for(let t=0;t<r.length;t+=2){let o=e[r[t]];if(!(o instanceof Nd)){let n=r[t+1];if(Array.isArray(n))for(let d=0;d<n.length;d+=2){let _=o[n[d]],C=n[d+1];Qa(4,_,C);try{C.call(_)}finally{Qa(5,_,C)}}else{Qa(4,o,n);try{n.call(o)}finally{Qa(5,o,n)}}}}}function fO(i,e,r){return x6(i,e.parent,r)}function x6(i,e,r){let t=e;for(;t!==null&&t.type&40;)e=t,t=e.parent;if(t===null)return r[gs];
vendor: 4,191 bytes, line 1324
1324{let{componentOffset:o}=t;if(o>-1){let{encapsulation:n}=i.data[t.directiveStart+o];if(n===nl.None||n===nl.Emulated)return null}return ys(t,r)}}function Ky(i,e,r,t,o){i.insertBefore(e,r,t,o)}function mO(i,e,r){i.appendChild(e,r)}function bA(i,e,r,t,o){t!==null?Ky(i,e,r,t,o):mO(i,e,r)}function w6(i,e,r,t){i.removeChild(e,r,t)}function TS(i,e){return i.parentNode(e)}function C6(i,e){return i.nextSibling(e)}function gO(i,e,r){return S6(i,e,r)}function E6(i,e,r){return i.type&40?ys(i,r):null}var S6=E6,xA;function vb(i,e,r,t){let o=fO(i,t,e),n=e[Vn],d=t.parent||e[vs],_=gO(d,t,e);if(o!=null)if(Array.isArray(r))for(let C=0;C<r.length;C++)bA(n,o,r[C],_,!1);else bA(n,o,r,_,!1);xA!==void 0&&xA(n,t,e,r,o)}function Fy(i,e){if(e!==null){let r=e.type;if(r&3)return ys(e,i);if(r&4)return fE(-1,i[e.index]);if(r&8){let t=e.child;if(t!==null)return Fy(i,t);{let o=i[e.index];return Hs(o)?fE(-1,o):Ma(o)}}else{if(r&32)return wS(e,i)()||Ma(i[e.index]);{let t=_O(i,e);if(t!==null){if(Array.isArray(t))return t[0];let o=CS(i[_s]);return Fy(o,t)}else return Fy(i,e.next)}}}return null}function _O(i,e){if(e!==null){let t=i[_s][vs],o=e.projection;return t.projection[o]}return null}function fE(i,e){let r=Ro+i+1;if(r<e.length){let t=e[r],o=t[Ri].firstChild;if(o!==null)return Fy(t,o)}return e[Ql]}function vO(i,e,r){let t=TS(i,e);t&&w6(i,t,e,r)}function yO(i){i.textContent=""}function IS(i,e,r,t,o,n,d){for(;r!=null;){let _=t[r.index],C=r.type;if(d&&e===0&&(_&&nu(Ma(_),t),r.flags|=2),(r.flags&32)!==32)if(C&8)IS(i,e,r.child,t,o,n,!1),Op(e,i,o,_,n);else if(C&32){let M=wS(r,t),j;for(;j=M();)Op(e,i,o,j,n);Op(e,i,o,_,n)}else C&16?bO(i,e,t,r,o,n):Op(e,i,o,_,n);r=d?r.projectionNext:r.next}}function e_(i,e,r,t,o,n){IS(r,t,i.firstChild,e,o,n,!1)}function T6(i,e,r){let t=e[Vn],o=fO(i,r,e),n=r.parent||e[vs],d=gO(n,r,e);bO(t,0,e,r,o,d)}function bO(i,e,r,t,o,n){let d=r[_s],C=d[vs].projection[t.projection];if(Array.isArray(C))for(let M=0;M<C.length;M++){let j=C[M];Op(e,i,o,j,n)}else{let M=C,j=d[Er];Wy(t)&&(M.flags|=128),IS(i,e,M,j,o,n,!0)}}function I6(i,e,r,t,o){let n=r[Ql],d=Ma(r);n!==d&&Op(e,i,t,n,o);for(let _=Ro;_<r.length;_++){let C=r[_];e_(C[Ri],C,i,e,t,n)}}function D6(i,e,r,t,o){if(e)o?i.addClass(r,t):i.removeClass(r,t);else{let n=t.indexOf("-")===-1?void 0:ol.DashCase;o==null?i.removeStyle(r,t,n):(typeof o=="string"&&o.endsWith("!important")&&(o=o.slice(0,-10),n|=ol.Important),i.setStyle(r,t,o,n))}}function M6(i,e,r){i.setAttribute(e,"style",r)}function xO(i,e,r){r===""?i.removeAttribute(e,"class"):i.setAttribute(e,"class",r)}function wO(i,e,r){let{mergedAttrs:t,classes:o,styles:n}=r;t!==null&&nE(i,e,t),o!==null&&xO(i,e,o),n!==null&&M6(i,e,n)}var Sy;function k6(){if(Sy===void 0&&(Sy=null,ms.trustedTypes))try{Sy=ms.trustedTypes.createPolicy("angular",{createHTML:i=>i,createScript:i=>i,createScriptURL:i=>i})}catch{}return Sy}function yb(i){return k6()?.createHTML(i)||i}var Ty;function CO(){if(Ty===void 0&&(Ty=null,ms.trustedTypes))try{Ty=ms.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:i=>i,createScript:i=>i,createScriptURL:i=>i})}catch{}return Ty}function wA(i){return CO()?.createHTML(i)||i}function CA(i){return CO()?.createScriptURL(i)||i}var Jl=class{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${ZA})`}},mE=class extends Jl{getTypeName(){return"HTML"}},gE=class extends Jl{getTypeName(){return"Style"}},_E=class extends Jl{getTypeName(){return"Script"}},vE=class extends Jl{getTypeName(){return"URL"}},yE=class extends Jl{getTypeName(){return"ResourceURL"}};function bs(i){return i instanceof Jl?i.changingThisBreaksApplicationSecurity:i}function ic(i,e){let r=A6(i);if(r!=null&&r!==e){if(r==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${r} (see ${ZA})`)}return r===e}function A6(i){return i instanceof Jl&&i.getTypeName()||null}function EO(i){return new mE(i)}function SO(i){return new gE(i)}function TO(i){return new _E(i)}function IO(i){return new vE(i)}function DO(i){return new yE(i)}function P6(i){let e=new xE(i);return O6()?new bE(e):e}var bE=class{constructor(e){this.inertDocumentHelper=e}
1324getInertBodyElement(e){e="<body><remove></remove>"+e;try{let r=new window.DOMParser().parseFromString(yb(e),"text/html").body;return r===null?this.inertDocumentHelper.getInertBodyElement(e):(r.removeChild(r.firstChild),r)}catch{return null}}},xE=class{constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){let r=this.inertDocument.createElement("template");return r.innerHTML=yb(e),r}};function O6(){try{return!!new window.DOMParser().parseFromString(yb(""),"text/html")}catch{return!1}}var R6=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function bb(i){return i=String(i),i.match(R6)?i:"unsafe:"+i}function nc(i){let e={};for(let r of i.split(","))e[r]=!0;return e}function t_(...i){let e={};for(let r of i)for(let t in r)r.hasOwnProperty(t)&&(e[t]=!0);return e}var MO=nc("area,br,col,hr,img,wbr"),kO=nc("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),AO=nc("rp,rt"),L6=t_(AO,kO),F6=t_(kO,nc("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),N6=t_(AO,nc("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),EA=t_(MO,F6,N6,L6),PO=nc("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),z6=nc("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),j6=nc("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,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-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext"),V6=t_(PO,z6,j6),B6=nc("script,style,template"),wE=class{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let r=e.firstChild,t=!0;for(;r;){if(r.nodeType===Node.ELEMENT_NODE?t=this.startElement(r):r.nodeType===Node.TEXT_NODE?this.chars(r.nodeValue):this.sanitizedSomething=!0,t&&r.firstChild){r=r.firstChild;continue}for(;r;){r.nodeType===Node.ELEMENT_NODE&&this.endElement(r);let o=this.checkClobberedElement(r,r.nextSibling);if(o){r=o;break}r=this.checkClobberedElement(r,r.parentNode)}}return this.buf.join("")}startElement(e){let r=e.nodeName.toLowerCase();if(!EA.hasOwnProperty(r))return this.sanitizedSomething=!0,!B6.hasOwnProperty(r);this.buf.push("<"),this.buf.push(r);let t=e.attributes;for(let o=0;o<t.length;o++){let n=t.item(o),d=n.name,_=d.toLowerCase();if(!V6.hasOwnProperty(_)){this.sanitizedSomething=!0;continue}let C=n.value;PO[_]&&(C=bb(C)),this.buf.push(" ",d,'="',SA(C),'"')}return this.buf.push(">"),!0}endElement(e){let r=e.nodeName.toLowerCase();EA.hasOwnProperty(r)&&!MO.hasOwnProperty(r)&&(this.buf.push("</"),this.buf.push(r),this.buf.push(">"))}chars(e){this.buf.push(SA(e))}checkClobberedElement(e,r){if(r&&(e.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return r}},U6=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,H6=/([^\#-~ |!])/g;function SA(i){return i.replace(/&/g,"&amp;").replace(U6,function(e){let r=e.charCodeAt(0),t=e.charCodeAt(1);return"&#"+((r-55296)*1024+(t-56320)+65536)+";"}).replace(H6,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}var Iy;function DS(i,e){let r=null;try{Iy=Iy||P6(i);let t=e?String(e):"";r=Iy.getInertBodyElement(t);let o=5,n=t;do{if(o===0)throw new Error("Failed to sanitize html because the input is unstable");o--,t=n,n=r.innerHTML,r=Iy.getInertBodyElement(t)}while(t!==n);let _=new wE().sanitizeChildren(TA(r)||r);
1324return yb(_)}finally{if(r){let t=TA(r)||r;for(;t.firstChild;)t.removeChild(t.firstChild)}}}function TA(i){return"content"in i&&$6(i)?i.content:null}function $6(i){return i.nodeType===Node.ELEMENT_NODE&&i.nodeName==="TEMPLATE"}var Aa=function(i){return i[i.NONE=0]="NONE",i[i.HTML=1]="HTML",i[i.STYLE=2]="STYLE",i[i.SCRIPT=3]="SCRIPT",i[i.URL=4]="URL",i[i.RESOURCE_URL=5]="RESOURCE_URL",i}(Aa||{});function OO(i){let e=kS();return e?wA(e.sanitize(Aa.HTML,i)||""):ic(i,"HTML")?wA(bs(i)):DS(Xg(),el(i))}function Ei(i){let e=kS();return e?e.sanitize(Aa.URL,i)||"":ic(i,"URL")?bs(i):bb(el(i))}function MS(i){let e=kS();if(e)return CA(e.sanitize(Aa.RESOURCE_URL,i)||"");if(ic(i,"ResourceURL"))return CA(bs(i));throw new yt(904,!1)}function G6(i,e){return e==="src"&&(i==="embed"||i==="frame"||i==="iframe"||i==="media"||i==="script")||e==="href"&&(i==="base"||i==="link")?MS:Ei}function RO(i,e,r){return G6(e,r)(i)}function kS(){let i=yi();return i&&i[Yl].sanitizer}var CE=class{};function q6(){let i=new Gd;return _t(Qt)==="browser"&&(i.store=W6(Xg(),_t(Yg))),i}var Gd=(()=>{let e=class e{constructor(){this.store={},this.onSerializeCallbacks={}}get(t,o){return this.store[t]!==void 0?this.store[t]:o}set(t,o){this.store[t]=o}remove(t){delete this.store[t]}hasKey(t){return this.store.hasOwnProperty(t)}get isEmpty(){return Object.keys(this.store).length===0}onSerialize(t,o){this.onSerializeCallbacks[t]=o}toJson(){for(let t in this.onSerializeCallbacks)if(this.onSerializeCallbacks.hasOwnProperty(t))try{this.store[t]=this.onSerializeCallbacks[t]()}catch(o){console.warn("Exception in onSerialize callback: ",o)}return JSON.stringify(this.store).replace(/</g,"\\u003C")}};e.\u0275prov=Qe({token:e,providedIn:"root",factory:q6});let i=e;return i})();function W6(i,e){let r=i.getElementById(e+"-state");if(r?.textContent)try{return JSON.parse(r.textContent)}catch(t){console.warn("Exception while restoring TransferState for app "+e,t)}return{}}var LO="h",FO="b",EE=function(i){return i.FirstChild="f",i.NextSibling="n",i}(EE||{}),Z6="e",K6="t",AS="c",NO="x",Xy="r",X6="i",Y6="n",Q6="d",J6="__nghData__",zO=J6,BC="ngh",eU="nghm",jO=(i,e,r)=>null;function tU(i,e,r=!1){let t=i.getAttribute(BC);if(t==null)return null;let[o,n]=t.split("|");if(t=r?n:o,!t)return null;let d=r?o:n?`|${n}`:"",_={};if(t!==""){let M=e.get(Gd,null,{optional:!0});M!==null&&(_=M.get(zO,[])[Number(t)])}let C={data:_,firstChild:i.firstChild??null};return r&&(C.firstChild=i,xb(C,0,i.nextSibling)),d?i.setAttribute(BC,d):i.removeAttribute(BC),C}function iU(){jO=tU}function PS(i,e,r=!1){return jO(i,e,r)}function nU(i){let e=i._lView;return e[Ri].type===2?null:(mP(e)&&(e=e[Pr]),e)}function rU(i){return i.textContent?.replace(/\s/gm,"")}function oU(i){let e=Xg(),r=e.createNodeIterator(i,NodeFilter.SHOW_COMMENT,{acceptNode(n){let d=rU(n);return d==="ngetn"||d==="ngtns"?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),t,o=[];for(;t=r.nextNode();)o.push(t);for(let n of o)n.textContent==="ngetn"?n.replaceWith(e.createTextNode("")):n.remove()}function xb(i,e,r){i.segmentHeads??={},i.segmentHeads[e]=r}function SE(i,e){return i.segmentHeads?.[e]??null}function sU(i,e){let r=i.data,t=r[Z6]?.[e]??null;return t===null&&r[AS]?.[e]&&(t=OS(i,e)),t}function VO(i,e){return i.data[AS]?.[e]??null}function OS(i,e){let r=VO(i,e)??[],t=0;for(let o of r)t+=o[Xy]*(o[NO]??1);return t}function wb(i,e){if(typeof i.disconnectedNodes>"u"){let r=i.data[Q6];i.disconnectedNodes=r?new Set(r):null}return!!i.disconnectedNodes?.has(e)}var TE=class{},Yy=class{};function aU(i){let e=Error(`No component factory found for ${Co(i)}.`);return e[lU]=i,e}var lU="ngComponent";var IE=class{resolveComponentFactory(e){throw aU(e)}},Cb=(()=>{let e=class e{};e.NULL=new IE;let i=e;return i})();function cU(){return Xp(Fo(),yi())}function Xp(i,e){return new Pi(ys(i,e))}var Pi=(()=>{let e=class e{constructor(t){this.nativeElement=t}};e.__NG_ELEMENT_ID__=cU;let i=e;return i})();function uU(i){return i instanceof Pi?i.nativeElement:i}var Vd=class{},eo=(()=>{let e=class e{constructor(){this.destroyNode=null}};e.__NG_ELEMENT_ID__=()=>dU();let i=e;return i})();function dU(){let i=yi(),e=Fo(),r=ou(e.index,i);
vendor: 8,203 bytes, line 1324
1324return(il(r)?r:i)[Vn]}var hU=(()=>{let e=class e{};e.\u0275prov=Qe({token:e,providedIn:"root",factory:()=>null});let i=e;return i})(),UC={};function BO(i){return RS(i)?Array.isArray(i)||!(i instanceof Map)&&Symbol.iterator in i:!1}function pU(i,e){if(Array.isArray(i))for(let r=0;r<i.length;r++)e(i[r]);else{let r=i[Symbol.iterator](),t;for(;!(t=r.next()).done;)e(t.value)}}function RS(i){return i!==null&&(typeof i=="function"||typeof i=="object")}var DE=class{constructor(){}supports(e){return BO(e)}create(e){return new ME(e)}},fU=(i,e)=>e,ME=class{constructor(e){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=e||fU}forEachItem(e){let r;for(r=this._itHead;r!==null;r=r._next)e(r)}forEachOperation(e){let r=this._itHead,t=this._removalsHead,o=0,n=null;for(;r||t;){let d=!t||r&&r.currentIndex<IA(t,o,n)?r:t,_=IA(d,o,n),C=d.currentIndex;if(d===t)o--,t=t._nextRemoved;else if(r=r._next,d.previousIndex==null)o++;else{n||(n=[]);let M=_-o,j=C-o;if(M!=j){for(let ie=0;ie<M;ie++){let _e=ie<n.length?n[ie]:n[ie]=0,Ee=_e+ie;j<=Ee&&Ee<M&&(n[ie]=_e+1)}let G=d.previousIndex;n[G]=j-M}}_!==C&&e(d,_,C)}}forEachPreviousItem(e){let r;for(r=this._previousItHead;r!==null;r=r._nextPrevious)e(r)}forEachAddedItem(e){let r;for(r=this._additionsHead;r!==null;r=r._nextAdded)e(r)}forEachMovedItem(e){let r;for(r=this._movesHead;r!==null;r=r._nextMoved)e(r)}forEachRemovedItem(e){let r;for(r=this._removalsHead;r!==null;r=r._nextRemoved)e(r)}forEachIdentityChange(e){let r;for(r=this._identityChangesHead;r!==null;r=r._nextIdentityChange)e(r)}diff(e){if(e==null&&(e=[]),!BO(e))throw new yt(900,!1);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let r=this._itHead,t=!1,o,n,d;if(Array.isArray(e)){this.length=e.length;for(let _=0;_<this.length;_++)n=e[_],d=this._trackByFn(_,n),r===null||!Object.is(r.trackById,d)?(r=this._mismatch(r,n,d,_),t=!0):(t&&(r=this._verifyReinsertion(r,n,d,_)),Object.is(r.item,n)||this._addIdentityChange(r,n)),r=r._next}else o=0,pU(e,_=>{d=this._trackByFn(o,_),r===null||!Object.is(r.trackById,d)?(r=this._mismatch(r,_,d,o),t=!0):(t&&(r=this._verifyReinsertion(r,_,d,o)),Object.is(r.item,_)||this._addIdentityChange(r,_)),r=r._next,o++}),this.length=o;return this._truncate(r),this.collection=e,this.isDirty}get isDirty(){return this._additionsHead!==null||this._movesHead!==null||this._removalsHead!==null||this._identityChangesHead!==null}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;e!==null;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;e!==null;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,r,t,o){let n;return e===null?n=this._itTail:(n=e._prev,this._remove(e)),e=this._unlinkedRecords===null?null:this._unlinkedRecords.get(t,null),e!==null?(Object.is(e.item,r)||this._addIdentityChange(e,r),this._reinsertAfter(e,n,o)):(e=this._linkedRecords===null?null:this._linkedRecords.get(t,o),e!==null?(Object.is(e.item,r)||this._addIdentityChange(e,r),this._moveAfter(e,n,o)):e=this._addAfter(new kE(r,t),n,o)),e}_verifyReinsertion(e,r,t,o){let n=this._unlinkedRecords===null?null:this._unlinkedRecords.get(t,null);return n!==null?e=this._reinsertAfter(n,e._prev,o):e.currentIndex!=o&&(e.currentIndex=o,this._addToMoves(e,o)),e}_truncate(e){for(;e!==null;){let r=e._next;this._addToRemovals(this._unlink(e)),e=r}this._unlinkedRecords!==null&&this._unlinkedRecords.clear(),this._additionsTail!==null&&(this._additionsTail._nextAdded=null),this._movesTail!==null&&(this._movesTail._nextMoved=null),this._itTail!==null&&(this._itTail._next=null),this._removalsTail!==null&&(this._removalsTail._nextRemoved=null),this._identityChangesTail!==null&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,r,t){this._unlinkedRecords!==null&&this._unlinkedRecords.remove(e);let o=e._prevRemoved,n=e._nextRemoved;return o===null?this._removalsHead=n:o._nextRemoved=n,n===null?this._removalsTail=o:n._prevRemoved=o,this._insertAfter(e,r,t),this._addToMoves(e,t),e}_moveAfter(e,r,t){return this._unlink(e),this._insertAfter(e,r,t),this._addToMoves(e,t),e}_addAfter(e,r,t){return this._insertAfter(e,r,t),this._additionsTail===null?this._additionsTail=this._additionsHead=e:this._additionsTail=this._additionsTail._nextAdded=e,e}_insertAfter(e,r,t){let o=r===null?this._itHead:r._next;return e._next=o,e._prev=r,o===null?this._itTail=e:o._prev=e,r===null?this._itHead=e:r._next=e,this._linkedRecords===null&&(this._linkedRecords=new Qy),this._linkedRecords.put(e),e.currentIndex=t,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){this._linkedRecords!==null&&this._linkedRecords.remove(e);let r=e._prev,t=e._next;return r===null?this._itHead=t:r._next=t,t===null?this._itTail=r:t._prev=r,e}_addToMoves(e,r){return e.previousIndex===r||(this._movesTail===null?this._movesTail=this._movesHead=e:this._movesTail=this._movesTail._nextMoved=e),e}_addToRemovals(e){return this._unlinkedRecords===null&&(this._unlinkedRecords=new Qy),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,this._removalsTail===null?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,r){return e.item=r,this._identityChangesTail===null?this._identityChangesTail=this._identityChangesHead=e:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=e,e}},kE=class{constructor(e,r){this.item=e,this.trackById=r,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}},AE=class{constructor(){this._head=null,this._tail=null}add(e){this._head===null?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,r){let t;for(t=this._head;t!==null;t=t._nextDup)if((r===null||r<=t.currentIndex)&&Object.is(t.trackById,e))return t;return null}remove(e){let r=e._prevDup,t=e._nextDup;return r===null?this._head=t:r._nextDup=t,t===null?this._tail=r:t._prevDup=r,this._head===null}},Qy=class{constructor(){this.map=new Map}put(e){let r=e.trackById,t=this.map.get(r);t||(t=new AE,this.map.set(r,t)),t.add(e)}get(e,r){let t=e,o=this.map.get(t);return o?o.get(e,r):null}remove(e){let r=e.trackById;return this.map.get(r).remove(e)&&this.map.delete(r),e}get isEmpty(){return this.map.size===0}clear(){this.map.clear()}};function IA(i,e,r){let t=i.previousIndex;if(t===null)return t;let o=0;return r&&t<r.length&&(o=r[t]),t+e+o}var PE=class{constructor(){}supports(e){return e instanceof Map||RS(e)}create(){return new OE}},OE=class{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return this._additionsHead!==null||this._changesHead!==null||this._removalsHead!==null}forEachItem(e){let r;for(r=this._mapHead;r!==null;r=r._next)e(r)}forEachPreviousItem(e){let r;for(r=this._previousMapHead;r!==null;r=r._nextPrevious)e(r)}forEachChangedItem(e){let r;for(r=this._changesHead;r!==null;r=r._nextChanged)e(r)}forEachAddedItem(e){let r;for(r=this._additionsHead;r!==null;r=r._nextAdded)e(r)}forEachRemovedItem(e){let r;for(r=this._removalsHead;r!==null;r=r._nextRemoved)e(r)}diff(e){if(!e)e=new Map;else if(!(e instanceof Map||RS(e)))throw new yt(900,!1);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let r=this._mapHead;
1324if(this._appendAfter=null,this._forEach(e,(t,o)=>{if(r&&r.key===o)this._maybeAddToChanges(r,t),this._appendAfter=r,r=r._next;else{let n=this._getOrCreateRecordForKey(o,t);r=this._insertBeforeOrAppend(r,n)}}),r){r._prev&&(r._prev._next=null),this._removalsHead=r;for(let t=r;t!==null;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,r){if(e){let t=e._prev;return r._next=e,r._prev=t,e._prev=r,t&&(t._next=r),e===this._mapHead&&(this._mapHead=r),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=r,r._prev=this._appendAfter):this._mapHead=r,this._appendAfter=r,null}_getOrCreateRecordForKey(e,r){if(this._records.has(e)){let o=this._records.get(e);this._maybeAddToChanges(o,r);let n=o._prev,d=o._next;return n&&(n._next=d),d&&(d._prev=n),o._next=null,o._prev=null,o}let t=new RE(e);return this._records.set(e,t),t.currentValue=r,this._addToAdditions(t),t}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;e!==null;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;e!=null;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,r){Object.is(r,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=r,this._addToChanges(e))}_addToAdditions(e){this._additionsHead===null?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){this._changesHead===null?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,r){e instanceof Map?e.forEach(r):Object.keys(e).forEach(t=>r(e[t],t))}},RE=class{constructor(e){this.key=e,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 DA(){return new i_([new DE])}var i_=(()=>{let e=class e{constructor(t){this.factories=t}static create(t,o){if(o!=null){let n=o.factories.slice();t=t.concat(n)}return new e(t)}static extend(t){return{provide:e,useFactory:o=>e.create(t,o||DA()),deps:[[e,new gb,new Kg]]}}find(t){let o=this.factories.find(n=>n.supports(t));if(o!=null)return o;throw new yt(901,!1)}};e.\u0275prov=Qe({token:e,providedIn:"root",factory:DA});let i=e;return i})();function MA(){return new Eb([new PE])}var Eb=(()=>{let e=class e{constructor(t){this.factories=t}static create(t,o){if(o){let n=o.factories.slice();t=t.concat(n)}return new e(t)}static extend(t){return{provide:e,useFactory:o=>e.create(t,o||MA()),deps:[[e,new gb,new Kg]]}}find(t){let o=this.factories.find(n=>n.supports(t));if(o)return o;throw new yt(901,!1)}};e.\u0275prov=Qe({token:e,providedIn:"root",factory:MA});let i=e;return i})();function Jy(i,e,r,t,o=!1){for(;r!==null;){let n=e[r.index];n!==null&&t.push(Ma(n)),Hs(n)&&mU(n,t);let d=r.type;if(d&8)Jy(i,e,r.child,t);else if(d&32){let _=wS(r,e),C;for(;C=_();)t.push(C)}else if(d&16){let _=_O(e,r);if(Array.isArray(_))t.push(..._);else{let C=CS(e[_s]);Jy(C[Ri],C,_,t,!0)}}r=o?r.projectionNext:r.next}return t}function mU(i,e){for(let r=Ro;r<i.length;r++){let t=i[r],o=t[Ri].firstChild;o!==null&&Jy(t[Ri],t,o,e)}i[Ql]!==i[gs]&&e.push(i[Ql])}var UO=[];function gU(i){return i[Rd]??_U(i)}function _U(i){let e=UO.pop()??Object.create(yU);return e.lView=i,e}function vU(i){i.lView[Rd]!==i&&(i.lView=null,UO.push(i))}var yU=en(bt({},S2),{consumerIsAlwaysLive:!0,consumerMarkedDirty:i=>{zg(i.lView)},consumerOnSignalRead(){this.lView[Rd]=this}}),bU="ngOriginalError";function HC(i){return i[bU]}var sl=class{constructor(){this._console=console}handleError(e){let r=this._findOriginalError(e);this._console.error("ERROR",e),r&&this._console.error("ORIGINAL ERROR",r)}_findOriginalError(e){let r=e&&HC(e);for(;r&&HC(r);)r=HC(r);return r||null}},HO=new Ct("",{providedIn:"root",factory:()=>_t(sl).handleError.bind(void 0)}
1324),Dy=new Ct(""),$O=!1,GO=new Ct("",{providedIn:"root",factory:()=>$O});var ho={};function P(i){qO(gr(),yi(),ec()+i,!1)}function qO(i,e,r,t){if(!t)if((e[vi]&3)===3){let n=i.preOrderCheckHooks;n!==null&&Py(e,n,r)}else{let n=i.preOrderHooks;n!==null&&Oy(e,n,0,r)}Fd(r)}function ae(i,e=Xi.Default){let r=yi();if(r===null)return Ve(i,e);let t=Fo();return $P(t,r,Po(i),e)}function WO(){let i="invalid";throw new Error(i)}function xU(i,e){let r=i.hostBindingOpCodes;if(r!==null)try{for(let t=0;t<r.length;t++){let o=r[t];if(o<0)Fd(~o);else{let n=o,d=r[++t],_=r[++t];g5(d,n);let C=e[n];_(2,C)}}}finally{Fd(-1)}}function Sb(i,e,r,t,o,n,d,_,C,M,j){let G=e.blueprint.slice();return G[gs]=o,G[vi]=t|4|128|8|64,(M!==null||i&&i[vi]&2048)&&(G[vi]|=2048),wP(G),G[Er]=G[qp]=i,G[Us]=r,G[Yl]=d||i&&i[Yl],G[Vn]=_||i&&i[Vn],G[zp]=C||i&&i[zp]||null,G[vs]=n,G[db]=l6(),G[rl]=j,G[pP]=M,G[_s]=e.type==2?i[_s]:G,G}function Yp(i,e,r,t,o){let n=i.data[e];if(n===null)n=wU(i,e,r,t,o),m5()&&(n.flags|=32);else if(n.type&64){n.type=r,n.value=t,n.attrs=o;let d=h5();n.injectorIndex=d===null?-1:d.injectorIndex}return Hd(n,!0),n}function wU(i,e,r,t,o){let n=TP(),d=dS(),_=d?n:n&&n.parent,C=i.data[e]=MU(i,_,r,e,t,o);return i.firstChild===null&&(i.firstChild=C),n!==null&&(d?n.child==null&&C.parent!==null&&(n.child=C):n.next===null&&(n.next=C,C.prev=n)),C}function ZO(i,e,r,t){if(r===0)return-1;let o=e.length;for(let n=0;n<r;n++)e.push(t),i.blueprint.push(t),i.data.push(null);return o}function KO(i,e,r,t,o){let n=ec(),d=t&2;try{Fd(-1),d&&e.length>Pr&&qO(i,e,Pr,!1),Qa(d?2:0,o),r(t,o)}finally{Fd(n),Qa(d?3:1,o)}}function LS(i,e,r){if(lS(e)){let t=ko(null);try{let o=e.directiveStart,n=e.directiveEnd;for(let d=o;d<n;d++){let _=i.data[d];_.contentQueries&&_.contentQueries(1,r[d],d)}}finally{ko(t)}}}function FS(i,e,r){SP()&&(LU(i,e,r,ys(r,e)),(r.flags&64)===64&&JO(i,e,r))}function NS(i,e,r=ys){let t=e.localNames;if(t!==null){let o=e.index+1;for(let n=0;n<t.length;n+=2){let d=t[n+1],_=d===-1?r(e,i):i[d];i[o++]=_}}}function XO(i){let e=i.tView;return e===null||e.incompleteFirstPass?i.tView=zS(1,null,i.template,i.decls,i.vars,i.directiveDefs,i.pipeDefs,i.viewQuery,i.schemas,i.consts,i.id):e}function zS(i,e,r,t,o,n,d,_,C,M,j){let G=Pr+t,ie=G+o,_e=CU(G,ie),Ee=typeof M=="function"?M():M;return _e[Ri]={type:i,blueprint:_e,template:r,queries:null,viewQuery:_,declTNode:e,data:_e.slice().fill(null,G),bindingStartIndex:G,expandoStartIndex:ie,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:typeof n=="function"?n():n,pipeRegistry:typeof d=="function"?d():d,firstChild:null,schemas:C,consts:Ee,incompleteFirstPass:!1,ssrId:j}}function CU(i,e){let r=[];for(let t=0;t<e;t++)r.push(t<i?null:ho);return r}function EU(i,e,r,t){let n=t.get(GO,$O)||r===nl.ShadowDom,d=i.selectRootElement(e,n);return SU(d),d}function SU(i){YO(i)}var YO=i=>null;function TU(i){sO(i)?yO(i):oU(i)}function IU(){YO=TU}function DU(i,e,r,t){let o=nR(e);o.push(r),i.firstCreatePass&&rR(i).push(t,o.length-1)}function MU(i,e,r,t,o,n){let d=e?e.injectorIndex:-1,_=0;return Wp()&&(_|=128),{type:r,index:t,insertBeforeIndex:null,injectorIndex:d,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:_,providerIndexes:0,value:o,attrs:n,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}function kA(i,e,r,t){for(let o in i)if(i.hasOwnProperty(o)){r=r===null?{}:r;let n=i[o];t===null?AA(r,e,o,n):t.hasOwnProperty(o)&&AA(r,e,t[o],n)}return r}function AA(i,e,r,t){i.hasOwnProperty(r)?i[r].push(e,t):i[r]=[e,t]}function kU(i,e,r){let t=e.directiveStart,o=e.directiveEnd,n=i.data,d=e.attrs,_=[],C=null,M=null;for(let j=t;j<o;
1324j++){let G=n[j],ie=r?r.get(G):null,_e=ie?ie.inputs:null,Ee=ie?ie.outputs:null;C=kA(G.inputs,j,C,_e),M=kA(G.outputs,j,M,Ee);let Ye=C!==null&&d!==null&&!oP(e)?qU(C,j,d):null;_.push(Ye)}C!==null&&(C.hasOwnProperty("class")&&(e.flags|=8),C.hasOwnProperty("style")&&(e.flags|=16)),e.initialInputs=_,e.inputs=C,e.outputs=M}function AU(i){return i==="class"?"className":i==="for"?"htmlFor":i==="formaction"?"formAction":i==="innerHtml"?"innerHTML":i==="readonly"?"readOnly":i==="tabindex"?"tabIndex":i}function n_(i,e,r,t,o,n,d,_){let C=ys(e,r),M=e.inputs,j;!_&&M!=null&&(j=M[t])?(VS(i,r,j,t,o),Gg(e)&&PU(r,e.index)):e.type&3?(t=AU(t),o=d!=null?d(o,e.value||"",t):o,n.setProperty(C,t,o)):e.type&12}function PU(i,e){let r=ou(e,i);r[vi]&16||(r[vi]|=64)}function jS(i,e,r,t){if(SP()){let o=t===null?null:{"":-1},n=NU(i,r),d,_;n===null?d=_=null:[d,_]=n,d!==null&&QO(i,e,r,d,o,_),o&&zU(r,t,o)}r.mergedAttrs=Rg(r.mergedAttrs,r.attrs)}function QO(i,e,r,t,o,n){for(let M=0;M<t.length;M++)lE($y(r,e),i,t[M].type);VU(r,i.data.length,t.length);for(let M=0;M<t.length;M++){let j=t[M];j.providersResolver&&j.providersResolver(j)}let d=!1,_=!1,C=ZO(i,e,t.length,null);for(let M=0;M<t.length;M++){let j=t[M];r.mergedAttrs=Rg(r.mergedAttrs,j.hostAttrs),BU(i,r,e,C,j),jU(C,j,o),j.contentQueries!==null&&(r.flags|=4),(j.hostBindings!==null||j.hostAttrs!==null||j.hostVars!==0)&&(r.flags|=64);let G=j.type.prototype;!d&&(G.ngOnChanges||G.ngOnInit||G.ngDoCheck)&&((i.preOrderHooks??=[]).push(r.index),d=!0),!_&&(G.ngOnChanges||G.ngDoC
1324heck)&&((i.preOrderCheckHooks??=[]).push(r.index),_=!0),C++}kU(i,r,n)}function OU(i,e,r,t,o){let n=o.hostBindings;if(n){let d=i.hostBindingOpCodes;d===null&&(d=i.hostBindingOpCodes=[]);let _=~e.index;RU(d)!=_&&d.push(_),d.push(r,t,n)}}function RU(i){let e=i.length;for(;e>0;){let r=i[--e];if(typeof r=="number"&&r<0)return r}return 0}function LU(i,e,r,t){let o=r.directiveStart,n=r.directiveEnd;Gg(r)&&UU(e,r,i.data[o+r.componentOffset]),i.firstCreatePass||$y(r,e),nu(t,e);let d=r.initialInputs;for(let _=o;_<n;_++){let C=i.data[_],M=zd(e,i,_,r);if(nu(M,e),d!==null&&GU(e,_-o,M,C,r,d),iu(C)){let j=ou(r.index,e);j[Us]=zd(e,i,_,r)}}}function JO(i,e,r){let t=r.directiveStart,o=r.directiveEnd,n=r.index,d=_5();try{Fd(n);for(let _=t;_<o;_++){let C=i.data[_],M=e[_];sE(_),(C.hostBindings!==null||C.hostVars!==0||C.hostAttrs!==null)&&FU(C,M)}}finally{Fd(-1),sE(d)}}function FU(i,e){i.hostBindings!==null&&i.hostBindings(1,e)}function NU(i,e){let r=i.directiveRegistry,t=null,o=null;if(r)for(let n=0;n<r.length;n++){let d=r[n];if(sP(e,d.selectors,!1))if(t||(t=[]),iu(d))if(d.findHostDirectiveDefs!==null){let _=[];o=o||new Map,d.findHostDirectiveDefs(d,_,o),t.unshift(..._,d);let C=_.length;LE(i,e,C)}else t.unshift(d),LE(i,e,0);else o=o||new Map,d.findHostDirectiveDefs?.(d,t,o),t.push(d)}return t===null?null:[t,o]}function LE(i,e,r){e.componentOffset=r,(i.components??=[]).push(e.index)}function zU(i,e,r){if(e){let t=i.localNames=[];for(let o=0;o<e.length;o+=2){let n=r[e[o+1]];if(n==null)throw new yt(-301,!1);t.push(e[o],n)}}}function jU(i,e,r){if(r){if(e.exportAs)for(let t=0;t<e.exportAs.length;t++)r[e.exportAs[t]]=i;iu(e)&&(r[""]=i)}}function VU(i,e,r){i.flags|=1,i.directiveStart=e,i.directiveEnd=e+r,i.providerIndexes=e}function BU(i,e,r,t,o){i.data[t]=o;let n=o.factory||(o.factory=Ld(o.type,!0)),d=new Nd(n,iu(o),ae);i.blueprint[t]=d,r[t]=d,OU(i,e,t,ZO(i,r,o.hostVars,ho),o)}function UU(i,e,r){let t=ys(e,i),o=XO(r),n=i[Yl].rendererFactory,d=16;r.signals?d=4096:r.onPush&&(d=64);let _=Tb(i,Sb(i,o,null,d,t,e,null,n.createRenderer(t,r),null,null,null));i[e.index]=_}function HU(i,e,r,t,o,n){let d=ys(i,e);$U(e[Vn],d,n,i.value,r,t,o)}function $U(i,e,r,t,o,n,d){if(n==null)i.removeAttribute(e,o,r);else{let _=d==null?el(n):d(n,t||"",o);i.setAttribute(e,o,_,r)}}function GU(i,e,r,t,o,n){let d=n[e];if(d!==null)for(let _=0;_<d.length;){let C=d[_++],M=d[_++],j=d[_++];eR(t,r,C,M,j)}}function eR(i,e,r,t,o){let n=ko(null);try{let d=i.inputTransforms;d!==null&&d.hasOwnProperty(t)&&(o=d[t].call(e,o)),i.setInput!==null?i.setInput(e,o,r,t):e[t]=o}finally{ko(n)}}function qU(i,e,r){let t=null,o=0;for(;o<r.length;){let n=r[o];if(n===0){o+=4;continue}else if(n===5){o+=2;continue}if(typeof n=="number")break;if(i.hasOwnProperty(n)){t===null&&(t=[]);let d=i[n];for(let _=0;_<d.length;_+=2)if(d[_]===e){t.push(n,d[_+1],r[o+1]);break}}o+=2}return t}function tR(i,e,r,t){return[i,!0,0,e,null,t,null,r,null,null]}function iR(i,e){let r=i.contentQueries;if(r!==null){let t=ko(null);try{for(let o=0;o<r.length;o+=2){let n=r[o],d=r[o+1];if(d!==-1){let _=i.data[d];pS(n),_.contentQueries(2,e[d],d)}}}finally{ko(t)}}}function Tb(i,e){return i[Fg]?i[pA][Da]=e:i[Fg]=e,i[pA]=e,e}function FE(i,e,r){pS(0);let t=ko(null);try{e(i,r)}finally{ko(t)}}function nR(i){return i[Lg]||(i[Lg]=[])}function rR(i){return i.cleanup||(i.cleanup=[])}function oR(i,e){let r=i[zp],t=r?r.get(sl,null):null;t&&t.handleError(e)}function VS(i,e,r,t,o){for(let n=0;n<r.length;){let d=r[n++],_=r[n++],C=e[d],M=i.data[d];eR(M,C,t,_,o)}}function BS(i,e,r){let t=bP(e,i);h6(i[Vn],t,r)}var WU=100;function ZU(i,e=!0){let r=i[Yl],t=r.rendererFactory,o=r.afterRenderEventManager,n=!1;n||(t.begin?.(),o?.begin());try{KU(i)}catch(d){throw e&&oR(i,d),d}finally{n||(t.end?.(),r.inlineEffectRunner?.flush(),o?.end())}}function KU(i){NE(i,0);let e=0;for(;CP(i);){if(e===WU)throw new yt(103,!1);e++,NE(i,1)}}function XU(i,e,r,t){let o=e[vi];if((o&256)===256)return;let n=!1;!n&&e[Yl].inlineEffectRunner?.flush(),fS(e);let d=null,_=null;!n&&YU(i)&&(_=gU(e),d=T2(_));try{wP(e),f5(i.bindingStartIndex),r!==null&&KO(i,e,r,2,t);let C=(o&3)===3;if(!n)if(C){let G=i.preOrderCheckHooks;G!==null&&Py(e,G,null)}else{let G=i.preOrderHooks;G!==null&&Oy(e,G,0,null),FC(e,0)}if(QU(e),sR(e,0),i.contentQueries!==null&&iR(i,e),!n)if(C){let G=i.contentCheckHooks;G!==null&&Py(e,G)}else{let G=i.contentHooks;G!==null&&Oy(e,G,1),FC(e,1)}xU(i,e);let M=i.components;M!==null&&lR(e,M,0);let j=i.viewQuery;if(j!==null&&FE(2,j,t),!n)if(C){let G=i.viewCheckHooks;G!==null&&Py(e,G)}else{let G=i.viewHooks;G!==null&&Oy(e,G,2),FC(e,2)}if(i.firstUpdatePass===!0&&(i.firstUpdatePass=!1),e[LC]){for(let G of e[LC])G();e[LC]=null}n||(e[vi]&=-73)}catch(C){throw zg(e),C}finally{_!==null&&(I2(_,d),vU(_)),mS()}}function YU(i){return i.type!==2}function sR(i,e){for(let r=lO(i);r!==null;r=cO(r)){r[vi]&=~Vp.HasChildViewsToRefresh;for(let t=Ro;t<r.length;t++){let o=r[t];aR(o,e)}}}function QU(i){for(let e=lO(i);e!==null;e=cO(e)){if(!(e[vi]&Vp.HasTransplantedViews))continue;let r=e[jp];for(let t=0;t<r.length;t++){let o=r[t],n=o[Er];n5(o)}}}function JU(i,e,r){let t=ou(e,i);aR(t,r)}function aR(i,e){uS(i)&&NE(i,e)}function NE(i,e){let t=i[Ri],o=i[vi],n=i[Rd],d=!!(e===0&&o&16);if(d||=!!(o&64&&e===0),d||=!!(o&1024),d||=!!(n?.dirty&&_C(n)),n&&(n.dirty=!1),i[vi]&=-9217,d)XU(t,i,t.template,i[Us]);else if(o&8192){sR(i,1);let _=t.components;_!==null&&lR(i,_,1)}}function lR(i,e,r){for(let t=0;t<e.length;t++)JU(i,e[t],r)}function US(i){for(i[Yl].changeDetectionScheduler?.notify();i;){i[vi]|=64;let e=CS(i);if(mP(i)&&!e)return i;i=e}return null}var Bd=class{get rootNodes(){let e=this._lView,r=e[Ri];return Jy(r,e,r.firstChild,[])}constructor(e,r,t=!0){this._lView=e,this._cdRefInjectingView=r,this.notifyErrorHandler=t,this._appRef=null,this._attachedToViewContainer=!1}get context(){return this._lView[Us]}set context(e){this._lView[Us]=e}get destroyed(){return(this._lView[vi]&256)===256}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[Er];if(Hs(e)){let r=e[Vy],t=r?r.indexOf(this):-1;t>-1&&(Zy(e,t),Gy(r,t))}this._attachedToViewContainer=!1}SS(this._lView[Ri],this._lView)}onDestroy(e){EP(this._lView,e)}markForCheck(){US(this._cdRefInjectingView||this._lView)}detach(){this._lView[vi]&=-129}reattach(){oE(this._lView),this._lView[vi]|=128}detectChanges(){this._lView[vi]|=1024,ZU(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new yt(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,m6(this._lView[Ri],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new yt(902,!1);this._appRef=e,oE(this._lView)}},Or=(()=>{let e=class e{};e.__NG_ELEMENT_ID__=e8;let i=e;return i})();function e8(i){return t8(Fo(),yi(),(i&16)===16)}function t8(i,e,r){if(Gg(i)&&!r){let t=ou(i.index,e);return new Bd(t,t)}else if(i.type&47){let t=e[_s];return new Bd(t,e)}return null}var cR=(()=>{let e=class e{};e.__NG_ELEMENT_ID__=i8,e.__NG_ENV_ID__=t=>t;let i=e;return i})(),zE=class extends cR{constructor(e){super(),this._lView=e}onDestroy(e){return EP(this._lView,e),()=>o5(this._lView,e)}};function i8(){return new zE(yi())}
1324var PA=new Set;function qd(i){PA.has(i)||(PA.add(i),performance?.mark?.("mark_feature_usage",{detail:{feature:i}}))}var jE=class extends Jt{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,r,t){let o=e,n=r||(()=>null),d=t;if(e&&typeof e=="object"){let C=e;o=C.next?.bind(C),n=C.error?.bind(C),d=C.complete?.bind(C)}this.__isAsync&&(n=$C(n),o&&(o=$C(o)),d&&(d=$C(d)));let _=super.subscribe({next:o,error:n,complete:d});return e instanceof pn&&e.add(_),_}};function $C(i){return e=>{setTimeout(i,void 0,e)}}var Fe=jE;function OA(...i){}function n8(){let i=typeof ms.requestAnimationFrame=="function",e=ms[i?"requestAnimationFrame":"setTimeout"],r=ms[i?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&e&&r){let t=e[Zone.__symbol__("OriginalDelegate")];t&&(e=t);let o=r[Zone.__symbol__("OriginalDelegate")];o&&(r=o)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:r}}var qt=class i{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:t=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Fe(!1),this.onMicrotaskEmpty=new Fe(!1),this.onStable=new Fe(!1),this.onError=new Fe(!1),typeof Zone>"u")throw new yt(908,!1);Zone.assertZonePatched();let o=this;o._nesting=0,o._outer=o._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(o._inner=o._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(o._inner=o._inner.fork(Zone.longStackTraceZoneSpec)),o.shouldCoalesceEventChangeDetection=!t&&r,o.shouldCoalesceRunChangeDetection=t,o.lastRequestAnimationFrameId=-1,o.nativeRequestAnimationFrame=n8().nativeRequestAnimationFrame,s8(o)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get("isAngularZone")===!0}static assertInAngularZone(){if(!i.isInAngularZone())throw new yt(909,!1)}static assertNotInAngularZone(){if(i.isInAngularZone())throw new yt(909,!1)}run(e,r,t){return this._inner.run(e,r,t)}runTask(e,r,t,o){let n=this._inner,d=n.scheduleEventTask("NgZoneEvent: "+o,e,r8,OA,OA);try{return n.runTask(d,r,t)}finally{n.cancelTask(d)}}runGuarded(e,r,t){return this._inner.runGuarded(e,r,t)}runOutsideAngular(e){return this._outer.run(e)}},r8={};function HS(i){if(i._nesting==0&&!i.hasPendingMicrotasks&&!i.isStable)try{i._nesting++,i.onMicrotaskEmpty.emit(null)}finally{if(i._nesting--,!i.hasPendingMicrotasks)try{i.runOutsideAngular(()=>i.onStable.emit(null))}finally{i.isStable=!0}}}function o8(i){i.isCheckStableRunning||i.lastRequestAnimationFrameId!==-1||(i.lastRequestAnimationFrameId=i.nativeRequestAnimationFrame.call(ms,()=>{i.fakeTopEventTask||(i.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{i.lastRequestAnimationFrameId=-1,VE(i),i.isCheckStableRunning=!0,HS(i),i.isCheckStableRunning=!1},void 0,()=>{},()=>{})),i.fakeTopEventTask.invoke()}),VE(i))}function s8(i){let e=()=>{o8(i)};i._inner=i._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(r,t,o,n,d,_)=>{if(a8(_))return r.invokeTask(o,n,d,_);try{return RA(i),r.invokeTask(o,n,d,_)}finally{(i.shouldCoalesceEventChangeDetection&&n.type==="eventTask"||i.shouldCoalesceRunChangeDetection)&&e(),LA(i)}},onInvoke:(r,t,o,n,d,_,C)=>{try{return RA(i),r.invoke(o,n,d,_,C)}finally{i.shouldCoalesceRunChangeDetection&&e(),LA(i)}},onHasTask:(r,t,o,n)=>{r.hasTask(o,n),t===o&&(n.change=="microTask"?(i._hasPendingMicrotasks=n.microTask,VE(i),HS(i)):n.change=="macroTask"&&(i.hasPendingMacrotasks=n.macroTask))},onHandleError:(r,t,o,n)=>(r.handleError(o,n),i.runOutsideAngular(()=>i.onError.emit(n)),!1)})}function VE(i){i._hasPendingMicrotasks||(i.shouldCoalesceEventChangeDetection||i.shouldCoalesceRunChangeDetection)&&i.lastRequestAnimationFrameId!==-1?i.hasPendingMicrotasks=!0:i.hasPendingMicrotasks=!1}function RA(i){i._nesting++,i.isStable&&(i.isStable=!1,i.onUnstable.emit(null))}function LA(i){i._nesting--,HS(i)}function a8(i){return!Array.isArray(i)||i.length!==1?!1:i[0].data?.__ignore_ng_zone__===!0}var Rp=function(i){return i[i.EarlyRead=0]="EarlyRead",i[i.Write=1]="Write",i[i.MixedReadWrite=2]="MixedReadWrite",i[i.Read=3]="Read",i}(Rp||{}),l8={destroy(){}};function $S(i,e){!e&&Y5($S);let r=e?.injector??_t(is);if(!Ag(r))return l8;qd("NgAfterNextRender");let t=r.get(uR),o=t.handler??=new UE,n=e?.phase??Rp.MixedReadWrite,d=()=>{o.unregister(C),_()},_=r.get(cR).onDestroy(d),C=new BE(r,n,()=>{d(),i()});return o.register(C),{destroy:d}}var BE=class{constructor(e,r,t){this.phase=r,this.callbackFn=t,this.zone=e.get(qt),this.errorHandler=e.get(sl,null,{optional:!0})}invoke(){try{this.zone.runOutsideAngular(this.callbackFn)}catch(e){this.errorHandler?.handleError(e)}}},UE=class{constructor(){this.executingCallbacks=!1,this.buckets={[Rp.EarlyRead]:new Set,[Rp.Write]:new Set,[Rp.MixedReadWrite]:new Set,[Rp.Read]:new Set},this.deferredCallbacks=new Set}validateBegin(){if(this.executingCallbacks)throw new yt(102,!1)}register(e){(this.executingCallbacks?this.deferredCallbacks:this.buckets[e.phase]).add(e)}unregister(e){this.buckets[e.phase].delete(e),this.deferredCallbacks.delete(e)}execute(){this.executingCallbacks=!0;for(let e of Object.values(this.buckets))for(let r of e)r.invoke();this.executingCallbacks=!1;for(let e of this.deferredCallbacks)this.buckets[e.phase].add(e);this.deferredCallbacks.clear()}destroy(){for(let e of Object.values(this.buckets))e.clear();this.deferredCallbacks.clear()}},uR=(()=>{let e=class e{constructor(){this.renderDepth=0,this.handler=null,this.internalCallbacks=[]}begin(){this.handler?.validateBegin(),this.renderDepth++}end(){if(this.renderDepth--,this.renderDepth===0){for(let t of this.internalCallbacks)t
1324();this.internalCallbacks.length=0,this.handler?.execute()}}ngOnDestroy(){this.handler?.destroy(),this.handler=null,this.internalCallbacks.length=0}};e.\u0275prov=Qe({token:e,providedIn:"root",factory:()=>new e});let i=e;return i})();function c8(i,e){let r=ou(e,i),t=r[Ri];u8(t,r);let o=r[gs];o!==null&&r[rl]===null&&(r[rl]=PS(o,r[zp])),GS(t,r,r[Us])}function u8(i,e){for(let r=e.length;r<i.blueprint.length;r++)e.push(i.blueprint[r])}function GS(i,e,r){fS(e);try{let t=i.viewQuery;t!==null&&FE(1,t,r);let o=i.template;o!==null&&KO(i,e,o,1,r),i.firstCreatePass&&(i.firstCreatePass=!1),i.staticContentQueries&&iR(i,e),i.staticViewQueries&&FE(2,i.viewQuery,r);let n=i.components;n!==null&&d8(e,n)}catch(t){throw i.firstCreatePass&&(i.incompleteFirstPass=!0,i.firstCreatePass=!1),t}finally{e[vi]&=-5,mS()}}function d8(i,e){for(let r=0;r<e.length;r++)c8(i,e[r])}function eb(i,e,r){let t=r?i.styles:null,o=r?i.classes:null,n=0;if(e!==null)for(let d=0;d<e.length;d++){let _=e[d];if(typeof _=="number")n=_;else if(n==1)o=JC(o,_);else if(n==2){let C=_,M=e[++d];t=JC(t,C+": "+M+";")}}r?i.styles=t:i.stylesWithoutHost=t,r?i.classes=o:i.classesWithoutHost=o}var tb=class extends Cb{constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){let r=tu(e);return new Hp(r,this.ngModule)}};function FA(i){let e=[];for(let r in i)if(i.hasOwnProperty(r)){let t=i[r];e.push({propName:t,templateName:r})}return e}function h8(i){let e=i.toLowerCase();return e==="svg"?yP:e==="math"?QB:null}var HE=class{constructor(e,r){this.injector=e,this.parentInjector=r}get(e,r,t){t=ub(t);let o=this.injector.get(e,UC,t);return o!==UC||r===UC?o:this.parentInjector.get(e,r,t)}},Hp=class extends Yy{get inputs(){let e=this.componentDef,r=e.inputTransforms,t=FA(e.inputs);if(r!==null)for(let o of t)r.hasOwnProperty(o.propName)&&(o.transform=r[o.propName]);return t}get outputs(){return FA(this.componentDef.outputs)}constructor(e,r){super(),this.componentDef=e,this.ngModule=r,this.componentType=e.type,this.selector=$B(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!r}create(e,r,t,o){o=o||this.ngModule;let n=o instanceof Lo?o:o?.injector;n&&this.componentDef.getStandaloneInjector!==null&&(n=this.componentDef.getStandaloneInjector(n)||n);let d=n?new HE(e,n):e,_=d.get(Vd,null);if(_===null)throw new yt(407,!1);let C=d.get(hU,null),M=d.get(uR,null),j=d.get(CE,null),G={rendererFactory:_,sanitizer:C,inlineEffectRunner:null,afterRenderEventManager:M,changeDetectionScheduler:j},ie=_.createRenderer(null,this.componentDef),_e=this.componentDef.selectors[0][0]||"div",Ee=t?EU(ie,t,this.componentDef.encapsulation,d):ES(ie,_e,h8(_e)),Ye=512;this.componentDef.signals?Ye|=4096:this.componentDef.onPush||(Ye|=16);let $e=null;Ee!==null&&($e=PS(Ee,d,!0));let at=zS(0,null,null,1,0,null,null,null,null,null,null),Lt=Sb(null,at,null,Ye,null,null,G,ie,d,null,$e);fS(Lt);let jt,$t;try{let tn=this.componentDef,Fi,tt=null;tn.findHostDirectiveDefs?(Fi=[],tt=new Map,tn.findHostDirectiveDefs(tn,Fi,tt),Fi.push(tn)):Fi=[tn];let Sr=p8(Lt,Ee),so=f8(Sr,Ee,tn,Fi,Lt,G,ie);$t=cS(at,Pr),Ee&&_8(ie,tn,Ee,t),r!==void 0&&v8($t,this.ngContentSelectors,r),jt=g8(so,tn,Fi,tt,Lt,[y8]),GS(at,Lt,null)}finally{mS()}return new $E(this.componentType,jt,Xp($t,Lt),Lt,$t)}},$E=class extends TE{constructor(e,r,t,o,n){super(),this.location=t,this._rootLView=o,this._tNode=n,this.previousInputValues=null,this.instance=r,this.hostView=this.changeDetectorRef=new Bd(o,void 0,!1),this.componentType=e}setInput(e,r){let t=this._tNode.inputs,o;if(t!==null&&(o=t[e])){if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),r))return;let n=this._rootLView;VS(n[Ri],n,o,e,r),this.previousInputValues.set(e,r);let d=ou(this._tNode.index,n);US(d)}}get injector(){return new Od(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function p8(i,e){let r=i[Ri],t=Pr;return i[t]=e,Yp(r,t,2,"#host",null)}function f8(i,e,r,t,o,n,d){let _=o[Ri];m8(t,i,e,d);let C=null;e!==null&&(C=PS(e,o[zp]));let M=n.rendererFactory.createRenderer(e,r),j=16;r.signals?j=4096:r.onPush&&(j=64);
1324let G=Sb(o,XO(r),null,j,o[i.index],i,n,M,null,null,C);return _.firstCreatePass&&LE(_,i,t.length-1),Tb(o,G),o[i.index]=G}function m8(i,e,r,t){for(let o of i)e.mergedAttrs=Rg(e.mergedAttrs,o.hostAttrs);e.mergedAttrs!==null&&(eb(e,e.mergedAttrs,!0),r!==null&&wO(t,r,e))}function g8(i,e,r,t,o,n){let d=Fo(),_=o[Ri],C=ys(d,o);QO(_,o,d,r,null,t);for(let j=0;j<r.length;j++){let G=d.directiveStart+j,ie=zd(o,_,G,d);nu(ie,o)}JO(_,o,d),C&&nu(C,o);let M=zd(o,_,d.directiveStart+d.componentOffset,d);if(i[Us]=o[Us]=M,n!==null)for(let j of n)j(M,e);return LS(_,d,i),M}function _8(i,e,r,t){if(t)nE(i,r,["ng-version","17.0.8"]);else{let{attrs:o,classes:n}=GB(e.selectors[0]);o&&nE(i,r,o),n&&n.length>0&&xO(i,r,n.join(" "))}}function v8(i,e,r){let t=i.projection=[];for(let o=0;o<e.length;o++){let n=r[o];t.push(n!=null?Array.from(n):null)}}function y8(){let i=Fo();mb(yi()[Ri],i)}function b8(i){return Object.getPrototypeOf(i.prototype).constructor}function Xn(i){let e=b8(i.type),r=!0,t=[i];for(;e;){let o;if(iu(i))o=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new yt(903,!1);o=e.\u0275dir}if(o){if(r){t.push(o);let d=i;d.inputs=My(i.inputs),d.inputTransforms=My(i.inputTransforms),d.declaredInputs=My(i.declaredInputs),d.outputs=My(i.outputs);let _=o.hostBindings;_&&E8(i,_);let C=o.viewQuery,M=o.contentQueries;if(C&&w8(i,C),M&&C8(i,M),Cy(i.inputs,o.inputs),Cy(i.declaredInputs,o.declaredInputs),Cy(i.outputs,o.outputs),o.inputTransforms!==null&&(d.inputTransforms===null&&(d.inputTransforms={}),Cy(d.inputTransforms,o.inputTransforms)),iu(o)&&o.data.animation){let j=i.data;j.animation=(j.animation||[]).concat(o.data.animation)}}let n=o.features;if(n)for(let d=0;d<n.length;d++){let _=n[d];_&&_.ngInherit&&_(i),_===Xn&&(r=!1)}}e=Object.getPrototypeOf(e)}x8(t)}function x8(i){let e=0,r=null;for(let t=i.length-1;t>=0;t--){let o=i[t];o.hostVars=e+=o.hostVars,o.hostAttrs=Rg(o.hostAttrs,r=Rg(r,o.hostAttrs))}}function My(i){return i===Np?{}:i===Oo?[]:i}function w8(i,e){let r=i.viewQuery;r?i.viewQuery=(t,o)=>{e(t,o),r(t,o)}:i.viewQuery=e}function C8(i,e){let r=i.contentQueries;r?i.contentQueries=(t,o,n)=>{e(t,o,n),r(t,o,n)}:i.contentQueries=e}function E8(i,e){let r=i.hostBindings;r?i.hostBindings=(t,o)=>{e(t,o),r(t,o)}:i.hostBindings=e}function $s(i){let e=i.inputConfig,r={};for(let t in e)if(e.hasOwnProperty(t)){let o=e[t];Array.isArray(o)&&o[2]&&(r[t]=o[2])}i.inputTransforms=r}function r_(i,e,r){return i[e]=r}function S8(i,e){return i[e]}function ka(i,e,r){let t=i[e];return Object.is(t,r)?!1:(i[e]=r,!0)}function Vg(i,e,r,t){let o=ka(i,e,r);return ka(i,e+1,t)||o}function dR(i,e,r,t,o){let n=Vg(i,e,r,t);return ka(i,e+2,o)||n}function T8(i,e,r,t,o,n){let d=Vg(i,e,r,t);return Vg(i,e+2,o,n)||d}function Bn(i,e,r,t){let o=yi(),n=qg();if(ka(o,n,e)){let d=gr(),_=Kp();HU(_,o,i,e,r,t)}return Bn}function qS(i,e,r,t){return ka(i,qg(),r)?e+el(r)+t:ho}function WS(i,e,r,t,o,n){let d=IP(),_=Vg(i,d,r,o);return pb(2),_?e+el(r)+t+el(o)+n:ho}function ZS(i,e,r,t,o,n,d,_){let C=IP(),M=dR(i,C,r,o,d);return pb(3),M?e+el(r)+t+el(o)+n+el(d)+_:ho}function ky(i,e){return i<<17|e<<2}function Ud(i){return i>>17&32767}function I8(i){return(i&2)==2}function D8(i,e){return i&131071|e<<17}function GE(i){return i|2}function $p(i){return(i&131068)>>2}function GC(i,e){return i&-131069|e<<2}function M8(i){return(i&1)===1}function qE(i){return i|1}function k8(i,e,r,t,o,n){let d=n?e.classBindings:e.styleBindings,_=Ud(d),C=$p(d);i[t]=r;let M=!1,j;if(Array.isArray(r)){let G=r;j=G[1],(j===null||Zg(G,j)>0)&&(M=!0)}else j=r;if(o)if(C!==0){let ie=Ud(i[_+1]);i[t+1]=ky(ie,_),ie!==0&&(i[ie+1]=GC(i[ie+1],t)),i[_+1]=D8(i[_+1],t)}else i[t+1]=ky(_,0),_!==0&&(i[_+1]=GC(i[_+1],t)),_=t;else i[t+1]=ky(C,0),_===0?_=t:i[C+1]=GC(i[C+1],t),C=t;M&&(i[t+1]=GE(i[t+1])),NA(i,j,t,!0,n),NA(i,j,t,!1,n),A8(e,j,i,t,n),d=ky(_,C),n?e.classBindings=d:e.styleBindings=d}function A8(i,e,r,t,o){let n=o?i.residualClasses:i.residualStyles;n!=null&&typeof e=="string"&&Zg(n,e)>=0&&(r[t+1]=qE(r[t+1]))}function NA(i,e,r,t,o){let n=i[r+1],d=e===null,_=t?Ud(n):$p(n),C=!1;for(;_!==0&&(C===!1||d);){let M=i[_],j=i[_+1];P8(M,e)&&(C=!0,i[_+1]=t?qE(j):GE(j)),_=t?Ud(j):$p(j)}C&&(i[r+1]=t?GE(n):qE(n))}function P8(i,e){return i===null||e==null||(Array.isArray(i)?i[1]:i)===e?!0:Array.isArray(i)&&typeof e=="string"?Zg(i,e)>=0:!1}var Hr={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0}
vendor: 4,457 bytes, line 1324
1324;function hR(i){return i.substring(Hr.key,Hr.keyEnd)}function O8(i){return i.substring(Hr.value,Hr.valueEnd)}function R8(i){return mR(i),pR(i,Gp(i,0,Hr.textEnd))}function pR(i,e){let r=Hr.textEnd;return r===e?-1:(e=Hr.keyEnd=F8(i,Hr.key=e,r),Gp(i,e,r))}function L8(i){return mR(i),fR(i,Gp(i,0,Hr.textEnd))}function fR(i,e){let r=Hr.textEnd,t=Hr.key=Gp(i,e,r);return r===t?-1:(t=Hr.keyEnd=N8(i,t,r),t=zA(i,t,r,58),t=Hr.value=Gp(i,t,r),t=Hr.valueEnd=z8(i,t,r),zA(i,t,r,59))}function mR(i){Hr.key=0,Hr.keyEnd=0,Hr.value=0,Hr.valueEnd=0,Hr.textEnd=i.length}function Gp(i,e,r){for(;e<r&&i.charCodeAt(e)<=32;)e++;return e}function F8(i,e,r){for(;e<r&&i.charCodeAt(e)>32;)e++;return e}function N8(i,e,r){let t;for(;e<r&&((t=i.charCodeAt(e))===45||t===95||(t&-33)>=65&&(t&-33)<=90||t>=48&&t<=57);)e++;return e}function zA(i,e,r,t){return e=Gp(i,e,r),e<r&&e++,e}function z8(i,e,r){let t=-1,o=-1,n=-1,d=e,_=d;for(;d<r;){let C=i.charCodeAt(d++);if(C===59)return _;C===34||C===39?_=d=jA(i,C,d,r):e===d-4&&n===85&&o===82&&t===76&&C===40?_=d=jA(i,41,d,r):C>32&&(_=d),n=o,o=t,t=C&-33}return _}function jA(i,e,r,t){let o=-1,n=r;for(;n<t;){let d=i.charCodeAt(n++);if(d==e&&o!==92)return n;d==92&&o===92?o=0:o=d}throw new Error}function N(i,e,r){let t=yi(),o=qg();if(ka(t,o,e)){let n=gr(),d=Kp();n_(n,d,t,i,e,t[Vn],r,!1)}return N}function WE(i,e,r,t,o){let n=e.inputs,d=o?"class":"style";VS(i,r,n[d],d,t)}function lu(i,e,r){return gR(i,e,r,!1),lu}function Yi(i,e){return gR(i,e,null,!0),Yi}function Gs(i){o_(yR,j8,i,!1)}function j8(i,e){for(let r=L8(e);r>=0;r=fR(e,r))yR(i,hR(e),O8(e))}function cl(i){o_(G8,Ib,i,!0)}function Ib(i,e){for(let r=R8(e);r>=0;r=pR(e,r))$d(i,hR(e),!0)}function gR(i,e,r,t){let o=yi(),n=gr(),d=pb(2);if(n.firstUpdatePass&&vR(n,i,d,t),e!==ho&&ka(o,d,e)){let _=n.data[ec()];bR(n,_,o,o[Vn],i,o[d+1]=W8(e,r),t,d)}}function o_(i,e,r,t){let o=gr(),n=pb(2);o.firstUpdatePass&&vR(o,null,n,t);let d=yi();if(r!==ho&&ka(d,n,r)){let _=o.data[ec()];if(xR(_,t)&&!_R(o,n)){let C=t?_.classesWithoutHost:_.stylesWithoutHost;C!==null&&(r=JC(C,r||"")),WE(o,_,d,r,t)}else q8(o,_,d,d[Vn],d[n+1],d[n+1]=$8(i,e,r),t,n)}}function _R(i,e){return e>=i.expandoStartIndex}function vR(i,e,r,t){let o=i.data;if(o[r+1]===null){let n=o[ec()],d=_R(i,r);xR(n,t)&&e===null&&!d&&(e=!1),e=V8(o,n,e,t),k8(o,n,e,r,d,t)}}function V8(i,e,r,t){let o=v5(i),n=t?e.residualClasses:e.residualStyles;if(o===null)(t?e.classBindings:e.styleBindings)===0&&(r=qC(null,i,e,r,t),r=Bg(r,e.attrs,t),n=null);else{let d=e.directiveStylingLast;if(d===-1||i[d]!==o)if(r=qC(o,i,e,r,t),n===null){let C=B8(i,e,t);C!==void 0&&Array.isArray(C)&&(C=qC(null,i,e,C[1],t),C=Bg(C,e.attrs,t),U8(i,e,t,C))}else n=H8(i,e,t)}return n!==void 0&&(t?e.residualClasses=n:e.residualStyles=n),r}function B8(i,e,r){let t=r?e.classBindings:e.styleBindings;if($p(t)!==0)return i[Ud(t)]}function U8(i,e,r,t){let o=r?e.classBindings:e.styleBindings;i[Ud(o)]=t}function H8(i,e,r){let t,o=e.directiveEnd;for(let n=1+e.directiveStylingLast;n<o;n++){let d=i[n].hostAttrs;t=Bg(t,d,r)}return Bg(t,e.attrs,r)}function qC(i,e,r,t,o){let n=null,d=r.directiveEnd,_=r.directiveStylingLast;for(_===-1?_=r.directiveStart:_++;_<d&&(n=e[_],t=Bg(t,n.hostAttrs,o),n!==i);)_++;return i!==null&&(r.directiveStylingLast=_),t}function Bg(i,e,r){let t=r?1:2,o=-1;if(e!==null)for(let n=0;n<e.length;n++){let d=e[n];typeof d=="number"?o=d:o===t&&(Array.isArray(i)||(i=i===void 0?[]:["",i]),$d(i,d,r?!0:e[++n]))}return i===void 0?null:i}function $8(i,e,r){if(r==null||r==="")return Oo;let t=[],o=bs(r);if(Array.isArray(o))for(let n=0;n<o.length;n++)i(t,o[n],!0);else if(typeof o=="object")for(let n in o)o.hasOwnProperty(n)&&i(t,n,o[n]);else typeof o=="string"&&e(t,o);return t}function yR(i,e,r){$d(i,e,bs(r))}function G8(i,e,r){let t=String(e);t!==""&&!t.includes(" ")&&$d(i,t,r)}function q8(i,e,r,t,o,n,d,_){o===ho&&(o=Oo);let C=0,M=0,j=0<o.length?o[0]:null,G=0<n.length?n[0]:null;for(;j!==null||G!==null;){let ie=C<o.length?o[C+1]:void 0,_e=M<n.length?n[M+1]:void 0,Ee=null,Ye;j===G?(C+=2,M+=2,ie!==_e&&(Ee=G,Ye=_e)):G===null||j!==null&&j<G?(C+=2,Ee=j):(M+=2,Ee=G,Ye=_e),Ee!==null&&bR(i,e,r,t,Ee,Ye,d,_),j=C<o.length?o[C]:null,G=M<n.length?n[M]:null}}function bR(i,e,r,t,o,n,d,_){if(!(e.type&3))return;let C=i.data,M=C[_+1],j=M8(M)?VA(C,e,r,o,$p(M),d):void 0;if(!ib(j)){ib(n)||I8(M)&&(n=VA(C,null,r,o,_,d));let G=bP(ec(),r);D6(t,d,G,o,n)}}function VA(i,e,r,t,o,n){let d=e===null,_;for(;o>0;){let C=i[o],M=Array.isArray(C),j=M?C[1]:C,G=j===null,ie=r[o+1];
1324ie===ho&&(ie=G?Oo:void 0);let _e=G?zC(ie,t):j===t?ie:void 0;if(M&&!ib(_e)&&(_e=zC(C,t)),ib(_e)&&(_=_e,d))return _;let Ee=i[o+1];o=d?Ud(Ee):$p(Ee)}if(e!==null){let C=n?e.residualClasses:e.residualStyles;C!=null&&(_=zC(C,t))}return _}function ib(i){return i!==void 0}function W8(i,e){return i==null||i===""||(typeof e=="string"?i=i+e:typeof i=="object"&&(i=Co(bs(i)))),i}function xR(i,e){return(i.flags&(e?8:16))!==0}function ki(i,e,r){let t=yi(),o=qS(t,i,e,r);o_($d,Ib,o,!0)}function Qp(i,e,r,t,o){let n=yi(),d=WS(n,i,e,r,t,o);o_($d,Ib,d,!0)}function Jp(i,e,r,t,o,n,d){let _=yi(),C=ZS(_,i,e,r,t,o,n,d);o_($d,Ib,C,!0)}function wR(i){let e=i[Ng]??[],t=i[Er][Vn];for(let o of e)Z8(o,t);i[Ng]=Oo}function Z8(i,e){let r=0,t=i.firstChild;if(t){let o=i.data[Xy];for(;r<o;){let n=t.nextSibling;vO(e,t,!1),t=n,r++}}}function CR(i){wR(i);for(let e=Ro;e<i.length;e++)nb(i[e])}function nb(i){let e=i[Ri];for(let r=Pr;r<e.bindingStartIndex;r++)if(Hs(i[r])){let t=i[r];CR(t)}else il(i[r])&&nb(i[r])}function K8(i){let e=i._views;for(let r of e){let t=nU(r);if(t!==null&&t[gs]!==null)if(il(t))nb(t);else{let o=t[gs];nb(o),CR(t)}}}var X8=new RegExp(`^(\\d+)*(${FO}|${LO})*(.*)`);function Y8(i){let e=i.match(X8),[r,t,o,n]=e,d=t?parseInt(t,10):o,_=[];for(let[C,M,j]of n.matchAll(/(f|n)(\d*)/g)){let G=parseInt(j,10)||1;_.push(M,G)}return[d,..._]}function Q8(i){return!i.prev&&i.parent?.type===8}function WC(i){return i.index-Pr}function Db(i,e,r,t){let o=null,n=WC(t),d=i.data[Y6];if(d?.[n])o=eH(d[n],r);else if(e.firstChild===t)o=i.firstChild;else{let _=t.prev===null,C=t.prev??t.parent;if(Q8(t)){let M=WC(t.parent);o=SE(i,M)}else{let M=ys(C,r);if(_)o=M.firstChild;else{let j=WC(C),G=SE(i,j);if(C.type===2&&G){let _e=OS(i,j)+1;o=Mb(_e,G)}else o=M.nextSibling}}}return o}function Mb(i,e){let r=e;for(let t=0;t<i;t++)r=r.nextSibling;return r}function J8(i,e){let r=i;for(let t=0;t<e.length;t+=2){let o=e[t],n=e[t+1];for(let d=0;d<n;d++)switch(o){case EE.FirstChild:r=r.firstChild;break;case EE.NextSibling:r=r.nextSibling;break}}return r}function eH(i,e){let[r,...t]=Y8(i),o;if(r===LO)o=e[_s][gs];else if(r===FO)o=J5(e[_s][gs]);else{let n=Number(r);o=Ma(e[n+Pr])}return J8(o,t)}function tH(i,e){let r=[];for(let t of e)for(let o=0;o<(t[NO]??1);o++){let n={data:t,firstChild:null};t[Xy]>0&&(n.firstChild=i,i=Mb(t[Xy],i)),r.push(n)}return[i,r]}var ER=(i,e)=>null;function iH(i,e){let r=i[Ng];return!e||r===null||r.length===0?null:r[0].data[X6]===e?r.shift():(wR(i),null)}function nH(){ER=iH}function ZE(i,e){return ER(i,e)}function SR(i,e,r,t){let o=e.tView,d=i[vi]&4096?4096:16,_=Sb(i,o,r,d,null,e,null,null,null,t?.injector??null,t?.dehydratedView??null),C=i[e.index];_[$g]=C;let M=i[tl];return M!==null&&(_[tl]=M.createEmbeddedView(o)),GS(o,_,r),_}function rH(i,e){let r=Ro+e;if(r<i.length)return i[r]}function KE(i,e){return!e||e.firstChild===null||Wy(i)}function TR(i,e,r,t=!0){let o=e[Ri];if(_6(o,e,i,r),t){let d=fE(r,i),_=e[Vn],C=TS(_,i[Ql]);C!==null&&f6(o,i[vs],_,e,C,d)}let n=e[rl];n!==null&&n.firstChild!==null&&(n.firstChild=null)}function oH(i,e){let r=Zy(i,e);return r!==void 0&&SS(r[Ri],r),r}var qs=(()=>{let e=class e{};e.__NG_ELEMENT_ID__=sH;let i=e;return i})();function sH(){let i=Fo();return DR(i,yi())}var aH=qs,IR=class extends aH{constructor(e,r,t){super(),this._lContainer=e,this._hostTNode=r,this._hostLView=t}get element(){return Xp(this._hostTNode,this._hostLView)}get injector(){return new Od(this._hostTNode,this._hostLView)}get parentInjector(){let e=gS(this._hostTNode,this._hostLView);if(zP(e)){let r=Uy(e,this._hostLView),t=By(e),o=r[Ri].data[t+8];return new Od(o,r)}else return new Od(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let r=BA(this._lContainer);return r!==null&&r[e]||null}get length(){return this._lContainer.length-Ro}createEmbeddedView(e,r,t){let o,n;typeof t=="number"?o=t:t!=null&&(o=t.index,n=t.injector);let d=ZE(this._lContainer,e.ssrId),_=e.createEmbeddedViewImpl(r||{},n,d);return this.insertImpl(_,o,KE(this._hostTNode,d)),_}createComponent(e,r,t,o,n){let d=e&&!F5(e),_;if(d)_=r;else{let Ee=r||{};_=Ee.index,t=Ee.injector,o=Ee.projectableNodes,n=Ee.environmentInjector||Ee.ngModuleRef}let C=d?e:new Hp(tu(e)),M=t||this.parentInjector;if(!n&&C.ngModule==null){let Ye=(d?M:this.parentInjector).get(Lo,null);Ye&&(n=Ye)}let j=tu(C.componentType??{}),G=ZE(this._lContainer,j?.id??null),ie=G?.firstChild??null,_e=C.create(M,o,ie,n);return this.insertImpl(_e.hostView,_,KE(this._hostTNode,G)),_e}insert(e,r){return this.insertImpl(e,r,!0)}insertImpl(e,r,t){let o=e._lView;if(i5(o)){let _=this.indexOf(e);if(_!==-1)this.detach(_);else{let C=o[Er],M=new IR(C,C[vs],C[Er]);M.detach(M.indexOf(e))}}let n=this._adjustIndex(r),d=this._lContainer;return TR(d,o,n,t),e.attachToViewContainerRef(),ZP(ZC(d),n,e),e}move(e,r){return this.insert(e,r)}indexOf(e){let r=BA(this._lContainer);return r!==null?r.indexOf(e):-1}remove(e){let r=this._adjustIndex(e,-1),t=Zy(this._lContainer,r);t&&(Gy(ZC(this._lContainer),r),SS(t[Ri],t))}detach(e){let r=this._adjustIndex(e,-1),t=Zy(this._lContainer,r);return t&&Gy(ZC(this._lContainer),r)!=null?new Bd(t):null}_adjustIndex(e,r=0){return e??this.length+r}};function BA(i){return i[Vy]}function ZC(i){return i[Vy]||(i[Vy]=[])}function DR(i,e){let r,t=e[i.index];return Hs(t)?r=t:(r=tR(t,e,null,i),e[i.index]=r,Tb(e,r)),MR(r,e,i,t),new IR(r,i,e)}function lH(i,e){let r=i[Vn],t=r.createComment(""),o=ys(e,i),n=TS(r,o);return Ky(r,n,t,C6(r,o),!1),t}var MR=kR,KS=(i,e,r)=>!1;function cH(i,e,r){return KS(i,e,r)}function kR(i,e,r,t){if(i[Ql])return;let o;r.type&8?o=Ma(t):o=lH(e,r),i[Ql]=o}function uH(i,e,r){if(i[Ql]&&i[Ng])return!0;let t=r[rl],o=e.index-Pr;if(!t||i6(e)||wb(t,o))return!1;let d=SE(t,o),_=t.data[AS]?.[o],[C,M]=tH(d,_);return i[Ql]=C,i[Ng]=M,!0}function dH(i,e,r,t){KS(i,r,e)||kR(i,e,r,t)}function hH(){MR=dH,KS=uH}function pH(i,e,r,t,o,n,d,_,C){let M=e.consts,j=Yp(e,i,4,d||null,Bp(M,_));jS(e,r,j,Bp(M,C)),mb(e,j);let G=j.tView=zS(2,j,t,o,n,e.directiveRegistry,e.pipeRegistry,null,e.schemas,M,null);return e.queries!==null&&(e.queries.template(e,j),G.queries=e.queries.embeddedTView(j)),j}function ce(i,e,r,t,o,n,d,_){let C=yi(),M=gr(),j=i+Pr,G=M.firstCreatePass?pH(j,M,C,e,r,t,o,n,d):M.data[j];Hd(G,!1);let ie=AR(M,C,G,i);
1324fb()&&vb(M,C,ie,G),nu(ie,C);let _e=tR(ie,C,ie,G);return C[j]=_e,Tb(C,_e),cH(_e,G,C),hb(G)&&FS(M,C,G),d!=null&&NS(C,G,_),ce}var AR=PR;function PR(i,e,r,t){return su(!0),e[Vn].createComment("")}function fH(i,e,r,t){let o=e[rl],n=!o||Wp()||wb(o,t);if(su(n),n)return PR(i,e,r,t);let d=o.data[K6]?.[t]??null;d!==null&&r.tView!==null&&r.tView.ssrId===null&&(r.tView.ssrId=d);let _=Db(o,i,e,r);xb(o,t,_);let C=OS(o,t);return Mb(C,_)}function mH(){AR=fH}function XS(i,e,r){qd("NgControlFlow");let t=yi(),o=qg(),n=gH(t,Pr+i),d=0;if(ka(t,o,e)){let _=ko(null);try{if(oH(n,d),e!==-1){let C=_H(t[Ri],Pr+e),M=ZE(n,C.tView.ssrId),j=SR(t,C,r,{dehydratedView:M});TR(n,j,d,KE(C,M))}}finally{ko(_)}}else{let _=rH(n,d);_!==void 0&&(_[Us]=r)}}function gH(i,e){return i[e]}function _H(i,e){return cS(i,e)}function vH(i,e,r,t,o,n){let d=e.consts,_=Bp(d,o),C=Yp(e,i,2,t,_);return jS(e,r,C,Bp(d,n)),C.attrs!==null&&eb(C,C.attrs,!1),C.mergedAttrs!==null&&eb(C,C.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,C),C}function S(i,e,r,t){let o=yi(),n=gr(),d=Pr+i,_=o[Vn],C=n.firstCreatePass?vH(d,n,o,e,r,t):n.data[d],M=OR(n,o,C,_,e,i);o[d]=M;let j=hb(C);return Hd(C,!0),wO(_,M,C),(C.flags&32)!==32&&fb()&&vb(n,o,M,C),s5()===0&&nu(M,o),a5(),j&&(FS(n,o,C),LS(n,C,o)),t!==null&&NS(o,C),S}function E(){let i=Fo();dS()?hS():(i=i.parent,Hd(i,!1));let e=i;c5(e)&&d5(),l5();let r=gr();return r.firstCreatePass&&(mb(r,i),lS(i)&&r.queries.elementEnd(i)),e.classesWithoutHost!=null&&E5(e)&&WE(r,e,yi(),e.classesWithoutHost,!0),e.stylesWithoutHost!=null&&S5(e)&&WE(r,e,yi(),e.stylesWithoutHost,!1),E}function Z(i,e,r,t){return S(i,e,r,t),E(),Z}var OR=(i,e,r,t,o,n)=>(su(!0),ES(t,o,LP()));function yH(i,e,r,t,o,n){let d=e[rl],_=!d||Wp()||wb(d,n);if(su(_),_)return ES(t,o,LP());let C=Db(d,i,e,r);return VO(d,n)&&xb(d,n,C.nextSibling),d&&(oO(r)||sO(C))&&Gg(r)&&(u5(r),yO(C)),C}function bH(){OR=yH}function xH(i,e,r,t,o){let n=e.consts,d=Bp(n,t),_=Yp(e,i,8,"ng-container",d);d!==null&&eb(_,d,!0);let C=Bp(n,o);return jS(e,r,_,C),e.queries!==null&&e.queries.elementStart(e,_),_}function Pa(i,e,r){let t=yi(),o=gr(),n=i+Pr,d=o.firstCreatePass?xH(n,o,t,e,r):o.data[n];Hd(d,!0);let _=RR(o,t,d,i);return t[n]=_,fb()&&vb(o,t,_,d),nu(_,t),hb(d)&&(FS(o,t,d),LS(o,d,t)),r!=null&&NS(t,d),Pa}function Oa(){let i=Fo(),e=gr();return dS()?hS():(i=i.parent,Hd(i,!1)),e.firstCreatePass&&(mb(e,i),lS(i)&&e.queries.elementEnd(i)),Oa}var RR=(i,e,r,t)=>(su(!0),hO(e[Vn],""));function wH(i,e,r,t){let o,n=e[rl],d=!n||Wp();if(su(d),d)return hO(e[Vn],"");let _=Db(n,i,e,r),C=sU(n,t);return xb(n,t,_),o=Mb(C,_),o}function CH(){RR=wH}function Ge(){return yi()}function kb(i,e,r){let t=yi(),o=qg();if(ka(t,o,e)){let n=gr(),d=Kp();n_(n,d,t,i,e,t[Vn],r,!0)}return kb}var Pd=void 0;function EH(i){let e=i,r=Math.floor(Math.abs(i)),t=i.toString().replace(/^[^.]*\.?/,"").length;return r===1&&t===0?1:5}var SH=["en",[["a","p"],["AM","PM"],Pd],[["AM","PM"],Pd,Pd],[["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"]],Pd,[["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"]],Pd,[["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}",Pd,"{1} 'at' {0}",Pd],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",EH],KC={};function xs(i){let e=TH(i),r=UA(e);if(r)return r;let t=e.split("-")[0];if(r=UA(t),r)return r;if(t==="en")return SH;throw new yt(701,!1)}function UA(i){return i in KC||(KC[i]=ms.ng&&ms.ng.common&&ms.ng.common.locales&&ms.ng.common.locales[i]),KC[i]}var wr=function(i){return i[i.LocaleId=0]="LocaleId",i[i.DayPeriodsFormat=1]="DayPeriodsFormat",i[i.DayPeriodsStandalone=2]="DayPeriodsStandalone",i[i.DaysFormat=3]="DaysFormat",i[i.DaysStandalone=4]="DaysStandalone",i[i.MonthsFormat=5]="MonthsFormat",i[i.MonthsStandalone=6]="MonthsStandalone",i[i.Eras=7]="Eras",i[i.FirstDayOfWeek=8]="FirstDayOfWeek",i[i.WeekendRange=9]="WeekendRange",i[i.DateFormat=10]="DateFormat",i[i.TimeFormat=11]="TimeFormat",i[i.DateTimeFormat=12]="DateTimeFormat",i[i.NumberSymbols=13]="NumberSymbols",i[i.NumberFormats=14]="NumberFormats",i[i.CurrencyCode=15]="CurrencyCode",i[i.CurrencySymbol=16]="CurrencySymbol",i[i.CurrencyName=17]="CurrencyName",i[i.Currencies=18]="Currencies",i[i.Directionality=19]="Directionality",i[i.PluralCase=20]="PluralCase",i[i.ExtraData=21]="ExtraData",i}(wr||{});function TH(i){return i.toLowerCase().replace(/_/g,"-")}var rb="en-US";var IH=rb;function DH(i){xB(i,"Expected localeId to be defined"),typeof i=="string"&&(IH=i.toLowerCase().replace(/_/g,"-"))}
1324function Wd(i){return!!i&&typeof i.then=="function"}function LR(i){return!!i&&typeof i.subscribe=="function"}function se(i,e,r,t){let o=yi(),n=gr(),d=Fo();return kH(n,o,o[Vn],d,i,e,t),se}function MH(i,e,r,t){let o=i.cleanup;if(o!=null)for(let n=0;n<o.length-1;n+=2){let d=o[n];if(d===r&&o[n+1]===t){let _=e[Lg],C=o[n+2];return _.length>C?_[C]:null}typeof d=="string"&&(n+=2)}return null}function kH(i,e,r,t,o,n,d){let _=hb(t),M=i.firstCreatePass&&rR(i),j=e[Us],G=nR(e),ie=!0;if(t.type&3||d){let Ye=ys(t,e),$e=d?d(Ye):Ye,at=G.length,Lt=d?$t=>d(Ma($t[t.index])):t.index,jt=null;if(!d&&_&&(jt=MH(i,e,o,t.index)),jt!==null){let $t=jt.__ngLastListenerFn__||jt;$t.__ngNextListenerFn__=n,jt.__ngLastListenerFn__=n,ie=!1}else{n=$A(t,e,j,n,!1);let $t=r.listen($e,o,n);G.push(n,$t),M&&M.push(o,Lt,at,at+1)}}else n=$A(t,e,j,n,!1);let _e=t.outputs,Ee;if(ie&&_e!==null&&(Ee=_e[o])){let Ye=Ee.length;if(Ye)for(let $e=0;$e<Ye;$e+=2){let at=Ee[$e],Lt=Ee[$e+1],tn=e[at][Lt].subscribe(n),Fi=G.length;G.push(n,tn),M&&M.push(o,t.index,Fi,-(Fi+1))}}}function HA(i,e,r,t){try{return Qa(6,e,r),r(t)!==!1}catch(o){return oR(i,o),!1}finally{Qa(7,e,r)}}function $A(i,e,r,t,o){return function n(d){if(d===Function)return t;let _=i.componentOffset>-1?ou(i.index,e):e;US(_);let C=HA(e,r,t,d),M=n.__ngNextListenerFn__;for(;M;)C=HA(e,r,M,d)&&C,M=M.__ngNextListenerFn__;return o&&C===!1&&d.preventDefault(),C}}function q(i=1){return b5(i)}function AH(i,e){let r=null,t=jB(i);for(let o=0;o<e.length;o++){let n=e[o];if(n==="*"){r=o;continue}if(t===null?sP(i,n,!0):UB(t,n))return o}return r}function Zd(i){let e=yi()[_s][vs];if(!e.projection){let r=i?i.length:1,t=e.projection=KP(r,null),o=t.slice(),n=e.child;for(;n!==null;){let d=i?AH(n,i):0;d!==null&&(o[d]?o[d].projectionNext=n:t[d]=n,o[d]=n),n=n.next}}}function Kd(i,e=0,r){let t=yi(),o=gr(),n=Yp(o,Pr+i,16,null,r||null);n.projection===null&&(n.projection=e),hS(),(!t[rl]||Wp())&&(n.flags&32)!==32&&T6(o,t,n)}function Hi(i,e,r){return fn(i,"",e,"",r),Hi}function fn(i,e,r,t,o){let n=yi(),d=qS(n,e,r,t);if(d!==ho){let _=gr(),C=Kp();n_(_,C,n,i,d,n[Vn],o,!1)}return fn}function Ws(i,e,r,t,o,n,d){let _=yi(),C=WS(_,e,r,t,o,n);if(C!==ho){let M=gr(),j=Kp();n_(M,j,_,i,C,_[Vn],d,!1)}return Ws}function s_(i,e,r,t,o,n,d,_,C){let M=yi(),j=ZS(M,e,r,t,o,n,d,_);if(j!==ho){let G=gr(),ie=Kp();n_(G,ie,M,i,j,M[Vn],C,!1)}return s_}function PH(i,e,r,t){r>=i.data.length&&(i.data[r]=null,i.blueprint[r]=null),e[r]=t}function or(i){let e=p5();return xP(e,Pr+i)}function A(i,e=""){let r=yi(),t=gr(),o=i+Pr,n=t.firstCreatePass?Yp(t,o,1,e,null):t.data[o],d=FR(t,r,n,e,i);r[o]=d,fb()&&vb(t,r,d,n),Hd(n,!1)}var FR=(i,e,r,t,o)=>(su(!0),dO(e[Vn],t));function OH(i,e,r,t,o){let n=e[rl],d=!n||Wp()||wb(n,o);return su(d),d?dO(e[Vn],t):Db(n,i,e,r)}function RH(){FR=OH}function mt(i){return We("",i,""),mt}function We(i,e,r){let t=yi(),o=qS(t,i,e,r);return o!==ho&&BS(t,ec(),o),We}function tr(i,e,r,t,o){let n=yi(),d=WS(n,i,e,r,t,o);return d!==ho&&BS(n,ec(),d),tr}function a_(i,e,r,t,o,n,d){let _=yi(),C=ZS(_,i,e,r,t,o,n,d);return C!==ho&&BS(_,ec(),C),a_}function LH(i,e,r){let t=gr();if(t.firstCreatePass){let o=iu(i);XE(r,t.data,t.blueprint,o,!0),XE(e,t.data,t.blueprint,o,!1)}}function XE(i,e,r,t,o){if(i=Po(i),Array.isArray(i))for(let n=0;n<i.length;n++)XE(i[n],e,r,t,o);else{let n=gr(),d=yi(),_=Fo(),C=Up(i)?i:Po(i.provide),M=tO(i),j=_.providerIndexes&1048575,G=_.directiveStart,ie=_.providerIndexes>>20;if(Up(i)||!i.multi){let _e=new Nd(M,o,ae),Ee=YC(C,e,o?j:j+ie,G);Ee===-1?(lE($y(_,d),n,C),XC(n,i,e.length),e.push(C),_.directiveStart++,_.directiveEnd++,o&&(_.providerIndexes+=1048576),r.push(_e),d.push(_e)):(r[Ee]=_e,d[Ee]=_e)}else{let _e=YC(C,e,j+ie,G),Ee=YC(C,e,j,j+ie),Ye=_e>=0&&r[_e],$e=Ee>=0&&r[Ee];if(o&&!$e||!o&&!Ye){lE($y(_,d),n,C);let at=zH(o?NH:FH,r.length,o,t,M);!o&&$e&&(r[Ee].providerFactory=at),XC(n,i,e.length,0),e.push(C),_.directiveStart++,_.directiveEnd++,o&&(_.providerIndexes+=1048576),r.push(at),d.push(at)}else{let at=NR(r[o?Ee:_e],M,!o&&t);XC(n,i,_e>-1?_e:Ee,at)}!o&&t&&$e&&r[Ee].componentProviders++}}}function XC(i,e,r,t){let o=Up(e),n=$5(e);if(o||n){let C=(n?Po(e.useClass):e).prototype.ngOnDestroy;if(C){let M=i.destroyHooks||(i.destroyHooks=[]);if(!o&&e.multi){let j=M.indexOf(r);j===-1?M.push(r,[t,C]):M[j+1].push(t,C)}else M.push(r,C)}}}function NR(i,e,r){return r&&i.componentProviders++,i.multi.push(e)-1}function YC(i,e,r,t){for(let o=r;o<t;o++)if(e[o]===i)return o;return-1}function FH(i,e,r,t){return YE(this.multi,[])}function NH(i,e,r,t){let o=this.multi,n;if(this.providerFactory){let d=this.providerFactory.componentProviders,_=zd(r,r[Ri],this.providerFactory.index,t);n=_.slice(0,d),YE(o,n);for(let C=d;C<_.length;C++)n.push(_[C])}else n=[],YE(o,n);return n}function YE(i,e){for(let r=0;r<i.length;r++){let t=i[r];e.push(t())}return e}function zH(i,e,r,t,o){let n=new Nd(i,r,ae);return n.multi=[],n.index=e,n.componentProviders=0,NR(n,o,t&&!r),n}function It(i,e=[]){return r=>{r.providersResolver=(t,o)=>LH(t,o?o(i):i,e)}}var ru=class{},Ug=class{};var QE=class extends ru{constructor(e,r,t){super(),this._parent=r,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new tb(this);let o=uP(e);this._bootstrapComponents=rO(o.bootstrap),this._r3Injector=iO(e,r,[{provide:ru,useValue:this},{provide:Cb,useValue:this.componentFactoryResolver},...t],Co(e),new Set(["environment"])),this._r3Injector.resolveInjectorInitializer
1324s(),this.instance=this._r3Injector.get(e)}get injector(){return this._r3Injector}destroy(){let e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(r=>r()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}},JE=class extends Ug{constructor(e){super(),this.moduleType=e}create(e){return new QE(this.moduleType,e,[])}};var ob=class extends ru{constructor(e){super(),this.componentFactoryResolver=new tb(this),this.instance=null;let r=new jg([...e.providers,{provide:ru,useValue:this},{provide:Cb,useValue:this.componentFactoryResolver}],e.parent||bS(),e.debugName,new Set(["environment"]));this.injector=r,e.runEnvironmentInitializers&&r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function Ab(i,e,r=null){return new ob({providers:i,parent:e,debugName:r,runEnvironmentInitializers:!0}).injector}var jH=(()=>{let e=class e{constructor(t){this._injector=t,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(t){if(!t.standalone)return null;if(!this.cachedInjectors.has(t)){let o=QP(!1,t.type),n=o.length>0?Ab([o],this._injector,`Standalone[${t.type.name}]`):null;this.cachedInjectors.set(t,n)}return this.cachedInjectors.get(t)}ngOnDestroy(){try{for(let t of this.cachedInjectors.values())t!==null&&t.destroy()}finally{this.cachedInjectors.clear()}}};e.\u0275prov=Qe({token:e,providedIn:"environment",factory:()=>new e(Ve(Lo))});let i=e;return i})();function gt(i){qd("NgStandalone"),i.getStandaloneInjector=e=>e.get(jH).getOrCreateStandaloneInjector(i)}function Zs(i,e,r){let t=Zp()+i,o=yi();return o[t]===ho?r_(o,t,r?e.call(r):e()):S8(o,t)}function kt(i,e,r,t){return VH(yi(),Zp(),i,e,r,t)}function mn(i,e,r,t,o){return VR(yi(),Zp(),i,e,r,t,o)}function zR(i,e,r,t,o,n){return BH(yi(),Zp(),i,e,r,t,o,n)}function jR(i,e,r,t,o,n,d){return UH(yi(),Zp(),i,e,r,t,o,n,d)}function Pb(i,e){let r=i[e];return r===ho?void 0:r}function VH(i,e,r,t,o,n){let d=e+r;return ka(i,d,o)?r_(i,d+1,n?t.call(n,o):t(o)):Pb(i,d+1)}function VR(i,e,r,t,o,n,d){let _=e+r;return Vg(i,_,o,n)?r_(i,_+2,d?t.call(d,o,n):t(o,n)):Pb(i,_+2)}function BH(i,e,r,t,o,n,d,_){let C=e+r;return dR(i,C,o,n,d)?r_(i,C+3,_?t.call(_,o,n,d):t(o,n,d)):Pb(i,C+3)}function UH(i,e,r,t,o,n,d,_,C){let M=e+r;return T8(i,M,o,n,d,_)?r_(i,M+4,C?t.call(C,o,n,d,_):t(o,n,d,_)):Pb(i,M+4)}function $r(i,e){let r=gr(),t,o=i+Pr;r.firstCreatePass?(t=HH(e,r.pipeRegistry),r.data[o]=t,t.onDestroy&&(r.destroyHooks??=[]).push(o,t.onDestroy)):t=r.data[o];let n=t.factory||(t.factory=Ld(t.type,!0)),d,_=ts(ae);try{let C=Hy(!1),M=n();return Hy(C),PH(r,yi(),o,M),M}finally{ts(_)}}function HH(i,e){if(e)for(let r=e.length-1;r>=0;r--){let t=e[r];if(i===t.name)return t}}function Gr(i,e,r,t){let o=i+Pr,n=yi(),d=xP(n,o);return $H(n,o)?VR(n,Zp(),e,d.transform,r,t,d):d.transform(r,t)}function $H(i,e){return i[Ri].data[e].pure}function GH(){return this._results[Symbol.iterator]()}var sb=class i{get changes(){return this._changes??=new Fe}constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;let r=i.prototype;r[Symbol.iterator]||(r[Symbol.iterator]=GH)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,r){return this._results.reduce(e,r)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,r){this.dirty=!1;let t=z5(e);(this._changesDetected=!N5(this._results,t,r))&&(this._results=t,this.length=t.length,this.last=t[this.length-1],this.first=t[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}},al=(()=>{let e=class e{};e.__NG_ELEMENT_ID__=ZH;let i=e;return i})(),qH=al,WH=class extends qH{constructor(e,r,t){super(),this._declarationLView=e,this._declarationTContainer=r,this.elementRef=t}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(e,r){return this.createEmbeddedViewImpl(e,r)}createEmbeddedViewImpl(e,r,t){let o=SR(this._declarationLView,this._declarationTContainer,e,{injector:r,dehydratedView:t});return new Bd(o)}};function ZH(){return Ob(Fo(),yi())}function Ob(i,e){return i.type&4?new WH(e,i,Xp(i,e)):null}var eS=class i{constructor(e){this.queryList=e,this.matches=null}clone(){return new i(this.queryList)}setDirty(){this.queryList.setDirty()}},tS=class i{constructor(e=[]){this.queries=e}createEmbeddedView(e){let r=e.queries;if(r!==null){let t=e.contentQueries!==null?e.contentQueries[0]:r.length,o=[];for(let n=0;n<t;n++){let d=r.getByIndex(n),_=this.queries[d.indexInDeclarationView];o.push(_.clone())}return new i(o)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let r=0;r<this.queries.length;r++)$R(e,r).matches!==null&&this.queries[r].setDirty()}},ab=class{constructor(e,r,t=null){this.predicate=e,this.flags=r,this.read=t}},iS=class i{constructor(e=[]){this.queries=e}elementStart(e,r){for(let t=0;t<this.queries.length;t++)this.queries[t].elementStart(e,r)}elementEnd(e){for(let r=0;r<this.queries.length;r++)this.queries[r].elementEnd(e)}embeddedTView(e){let r=null;for(let t=0;t<this.length;t++){let o=r!==null?r.length:0,n=this.getByIndex(t).embeddedTView(e,o);n&&(n.indexInDeclarationView=t,r!==null?r.push(n):r=[n])}return r!==null?new i(r):null}template(e,r){for(let t=0;t<this.queries.length;t++)this.queries[t].template(e,r)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}},nS=class i{constructor(e,r=-1){this.metadata=e,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=r}elementStart(e,r){this.isApplyingToNode(r)&&this.matchTNode(e,r)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,r){this.elementStart(e,r)}embeddedTView(e,r){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,r),new i(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&(this.metadata.flags&1)!==1){let r=this._declarationNodeIndex,t=e.parent;for(;t!==null&&t.type&8&&t.index!==r;)t=t.parent;return r===(t!==null?t.index:-1)}return this._appliesToNextNode}
1324matchTNode(e,r){let t=this.metadata.predicate;if(Array.isArray(t))for(let o=0;o<t.length;o++){let n=t[o];this.matchTNodeWithReadOption(e,r,KH(r,n)),this.matchTNodeWithReadOption(e,r,Ry(r,e,n,!1,!1))}else t===al?r.type&4&&this.matchTNodeWithReadOption(e,r,-1):this.matchTNodeWithReadOption(e,r,Ry(r,e,t,!1,!1))}matchTNodeWithReadOption(e,r,t){if(t!==null){let o=this.metadata.read;if(o!==null)if(o===Pi||o===qs||o===al&&r.type&4)this.addMatch(r.index,-2);else{let n=Ry(r,e,o,!1,!1);n!==null&&this.addMatch(r.index,n)}else this.addMatch(r.index,t)}}addMatch(e,r){this.matches===null?this.matches=[e,r]:this.matches.push(e,r)}};function KH(i,e){let r=i.localNames;if(r!==null){for(let t=0;t<r.length;t+=2)if(r[t]===e)return r[t+1]}return null}function XH(i,e){return i.type&11?Xp(i,e):i.type&4?Ob(i,e):null}function YH(i,e,r,t){return r===-1?XH(e,i):r===-2?QH(i,e,t):zd(i,i[Ri],r,e)}function QH(i,e,r){if(r===Pi)return Xp(e,i);if(r===al)return Ob(e,i);if(r===qs)return DR(e,i)}function BR(i,e,r,t){let o=e[tl].queries[t];if(o.matches===null){let n=i.data,d=r.matches,_=[];for(let C=0;C<d.length;C+=2){let M=d[C];if(M<0)_.push(null);else{let j=n[M];_.push(YH(e,j,d[C+1],r.metadata.read))}}o.matches=_}return o.matches}function rS(i,e,r,t){let o=i.queries.getByIndex(r),n=o.matches;if(n!==null){let d=BR(i,e,o,r);for(let _=0;_<n.length;_+=2){let C=n[_];if(C>0)t.push(d[_/2]);else{let M=n[_+1],j=e[-C];for(let G=Ro;G<j.length;G++){let ie=j[G];ie[$g]===ie[Er]&&rS(ie[Ri],ie,M,t)}if(j[jp]!==null){let G=j[jp];for(let ie=0;ie<G.length;ie++){let _e=G[ie];rS(_e[Ri],_e,M,t)}}}}}return t}function Xt(i){let e=yi(),r=gr(),t=DP();pS(t+1);let o=$R(r,t);if(i.dirty&&t5(e)===((o.metadata.flags&2)===2)){if(o.matches===null)i.reset([]);else{let n=o.crossesNgTemplate?rS(r,e,t,[]):BR(r,e,o,t);i.reset(n,uU),i.notifyOnChanges()}return!0}return!1}function ni(i,e,r){let t=gr();t.firstCreatePass&&(HR(t,new ab(i,e,r),-1),(e&2)===2&&(t.staticViewQueries=!0)),UR(t,yi(),e)}function cu(i,e,r,t){let o=gr();if(o.firstCreatePass){let n=Fo();HR(o,new ab(e,r,t),n.index),e$(o,i),(r&2)===2&&(o.staticContentQueries=!0)}UR(o,yi(),r)}function Yt(){return JH(yi(),DP())}function JH(i,e){return i[tl].queries[e].queryList}function UR(i,e,r){let t=new sb((r&4)===4);DU(i,e,t,t.destroy),e[tl]===null&&(e[tl]=new tS),e[tl].queries.push(new eS(t))}function HR(i,e,r){i.queries===null&&(i.queries=new iS),i.queries.track(new nS(e,r))}function e$(i,e){let r=i.contentQueries||(i.contentQueries=[]),t=r.length?r[r.length-1]:-1;e!==t&&r.push(i.queries.length-1,e)}function $R(i,e){return i.queries.getByIndex(e)}function Rb(i,e){return Ob(i,e)}var Lb=(()=>{let e=class e{log(t){console.log(t)}warn(t){console.warn(t)}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"platform"});let i=e;return i})(),oS=class{constructor(e,r){this.ngModuleFactory=e,this.componentFactories=r}},Fb=(()=>{let e=class e{compileModuleSync(t){return new JE(t)}compileModuleAsync(t){return Promise.resolve(this.compileModuleSync(t))}compileModuleAndAllComponentsSync(t){let o=this.compileModuleSync(t),n=uP(t),d=rO(n.declarations).reduce((_,C)=>{let M=tu(C);return M&&_.push(new Hp(M)),_},[]);return new oS(o,d)}compileModuleAndAllComponentsAsync(t){return Promise.resolve(this.compileModuleAndAllComponentsSync(t))}clearCache(){}clearCacheFor(t){}getModuleId(t){}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var ef=(()=>{let e=class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new Cr(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);let t=this.taskId++;return this.pendingTasks.add(t),t}remove(t){this.pendingTasks.delete(t),this.pendingTasks.size===0&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var GR=new Ct("");var Nb=new Ct("Application Initializer"),qR=(()=>{let e=class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,o)=>{this.resolve=t,this.reject=o}),this.appInits=_t(Nb,{optional:!0})??[]}
1324runInitializers(){if(this.initialized)return;let t=[];for(let n of this.appInits){let d=n();if(Wd(d))t.push(d);else if(LR(d)){let _=new Promise((C,M)=>{d.subscribe({complete:C,error:M})});t.push(_)}}let o=()=>{this.done=!0,this.resolve()};Promise.all(t).then(()=>{o()}).catch(n=>{this.reject(n)}),t.length===0&&o(),this.initialized=!0}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),Xd=new Ct("appBootstrapListener");function t$(){M2(()=>{throw new yt(600,!1)})}function i$(i){return i.isBoundToModule}function n$(i,e,r){try{let t=r();return Wd(t)?t.catch(o=>{throw e.runOutsideAngular(()=>i.handleError(o)),o}):t}catch(t){throw e.runOutsideAngular(()=>i.handleError(t)),t}}var ul=(()=>{let e=class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=_t(HO),this.componentTypes=[],this.components=[],this.isStable=_t(ef).hasPendingTasks.pipe(ei(t=>!t)),this._injector=_t(Lo)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(t,o){let n=t instanceof Yy;if(!this._injector.get(qR).done){let Ee="Cannot bootstrap as there are still asynchronous initializers running."+(!n&&cP(t)?"":" Bootstrap components in the `ngDoBootstrap` method of the root module.");throw new yt(405,!1)}let _;n?_=t:_=this._injector.get(Cb).resolveComponentFactory(t),this.componentTypes.push(_.componentType);let C=i$(_)?void 0:this._injector.get(ru),M=o||_.selector,j=_.create(is.NULL,[],M,C),G=j.location.nativeElement,ie=j.injector.get(GR,null);return ie?.registerApplication(G),j.onDestroy(()=>{this.detachView(j.hostView),QC(this.components,j),ie?.unregisterApplication(G)}),this._loadComponent(j),j}tick(){if(this._runningTick)throw new yt(101,!1);try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this.internalErrorHandler(t)}finally{this._runningTick=!1}}attachView(t){let o=t;this._views.push(o),o.attachToAppRef(this)}detachView(t){let o=t;QC(this._views,o),o.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t);let o=this._injector.get(Xd,[]);[...this._bootstrapListeners,...o].forEach(n=>n(t))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(t=>t()),this._views.slice().forEach(t=>t.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(t){return this._destroyListeners.push(t),()=>QC(this._destroyListeners,t)}destroy(){if(this._destroyed)throw new yt(406,!1);let t=this._injector;t.destroy&&!t.destroyed&&t.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function QC(i,e){let r=i.indexOf(e);r>-1&&i.splice(r,1)}var Ay;function YS(i){Ay??=new WeakMap;let e=Ay.get(i);if(e)return e;let r=i.isStable.pipe(fs(t=>t)).toPromise().then(()=>{});return Ay.set(i,r),i.onDestroy(()=>Ay?.delete(i)),r}var r$=(()=>{let e=class e{constructor(){this.zone=_t(qt),this.applicationRef=_t(ul)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function o$(i){return[{provide:qt,useFactory:i},{provide:jd,multi:!0,useFactory:()=>{let e=_t(r$,{optional:!0});return()=>e.initialize()}},{provide:jd,multi:!0,useFactory:()=>{let e=_t(c$);return()=>{e.initialize()}}},{provide:HO,useFactory:s$}]}function s$(){let i=_t(qt),e=_t(sl);return r=>i.runOutsideAngular(()=>e.handleError(r))}function a$(i){let e=o$(()=>new qt(l$(i)));return au([[],e])}function l$(i){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:i?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:i?.runCoalescing??!1}}var c$=(()=>{let e=class e{constructor(){this.subscription=new pn,this.initialized=!1,this.zone=_t(qt),this.pendingTasks=_t(ef)}initialize(){if(this.initialized)return;this.initialized=!0;let t=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(t=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{qt.assertNotInAngularZone(),queueMicrotask(()=>{t!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(t),t=null)})}
1324))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{qt.assertInAngularZone(),t??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function u$(){return typeof $localize<"u"&&$localize.locale||rb}var tf=new Ct("LocaleId",{providedIn:"root",factory:()=>_t(tf,Xi.Optional|Xi.SkipSelf)||u$()});var WR=new Ct("PlatformDestroyListeners");var Ny=null;function d$(i=[],e){return is.create({name:e,providers:[{provide:_b,useValue:"platform"},{provide:WR,useValue:new Set([()=>Ny=null])},...i]})}function h$(i=[]){if(Ny)return Ny;let e=d$(i);return Ny=e,t$(),p$(e),e}function p$(i){i.get(xS,null)?.forEach(r=>r())}function ZR(i){try{let{rootComponent:e,appProviders:r,platformProviders:t}=i,o=h$(t),n=[a$(),...r||[]],_=new ob({providers:n,parent:o,debugName:"",runEnvironmentInitializers:!1}).injector,C=_.get(qt);return C.run(()=>{_.resolveInjectorInitializers();let M=_.get(sl,null),j;C.runOutsideAngular(()=>{j=C.onError.subscribe({next:_e=>{M.handleError(_e)}})});let G=()=>_.destroy(),ie=o.get(WR);return ie.add(G),_.onDestroy(()=>{j.unsubscribe(),ie.delete(G)}),n$(M,C,()=>{let _e=_.get(qR);return _e.runInitializers(),_e.donePromise.then(()=>{let Ee=_.get(tf,rb);DH(Ee||rb);let Ye=_.get(ul);return e!==void 0&&Ye.bootstrap(e),Ye})})})}catch(e){return Promise.reject(e)}}var GA=!1;function f$(){GA||(GA=!0,iU(),bH(),RH(),CH(),mH(),hH(),nH(),IU())}function m$(i,e){return YS(i)}function KR(){return au([{provide:Dy,useFactory:()=>{let i=!0;return Ag()&&(i=!!_t(Gd,{optional:!0})?.get(zO,null)),i&&qd("NgHydration"),i}},{provide:jd,useValue:()=>{Ag()&&_t(Dy)&&(g$(),f$())},multi:!0},{provide:GO,useFactory:()=>Ag()&&_t(Dy)},{provide:Xd,useFactory:()=>
1324{if(Ag()&&_t(Dy)){let i=_t(ul),e=_t(is);return()=>{m$(i,e).then(()=>{qt.assertInAngularZone(),K8(i)})}}return()=>{}},multi:!0}])}function g$(){let i=Xg(),e;for(let r of i.body.childNodes)if(r.nodeType===Node.COMMENT_NODE&&r.textContent?.trim()===eU){e=r;break}if(!e)throw new yt(-507,!1)}function Rr(i){return typeof i=="boolean"?i:i!=null&&i!=="false"}function QS(i,e=NaN){return!isNaN(parseFloat(i))&&!isNaN(Number(i))?Number(i):e}function XR(i){let e=tu(i);if(!e)return null;let r=new Hp(e);return{get selector(){return r.selector},get type(){return r.componentType},get inputs(){return r.inputs},get outputs(){return r.outputs},get ngContentSelectors(){return r.ngContentSelectors},get isStandalone(){return e.standalone},get isSignal(){return e.signals}}}var oT=null;function dl(){return oT}function rL(i){oT||(oT=i)}var Gb=class{},$i=new Ct("DocumentToken"),cT=(()=>{let e=class e{historyGo(t){throw new Error("Not implemented")}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:()=>(()=>_t(_$))(),providedIn:"platform"});let i=e;return i})(),oL=new Ct("Location Initialized"),_$=(()=>{let e=class e extends cT{constructor(){super(),this._doc=_t($i),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return dl().getBaseHref(this._doc)}onPopState(t){let o=dl().getGlobalEventTarget(this._doc,"window");return o.addEventListener("popstate",t,!1),()=>o.removeEventListener("popstate",t)}onHashChange(t){let o=dl().getGlobalEventTarget(this._doc,"window");return o.addEventListener("hashchange",t,!1),()=>o.removeEventListener("hashchange",t)}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(t){this._location.pathname=t}pushState(t,o,n){this._history.pushState(t,o,n)}replaceState(t,o,n){this._history.replaceState(t,o,n)}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:()=>(()=>new e)(),providedIn:"platform"});let i=e;return i})();function uT(i,e){if(i.length==0)return e;if(e.length==0)return i;let r=0;return i.endsWith("/")&&r++,e.startsWith("/")&&r++,r==2?i+e.substring(1):r==1?i+e:i+"/"+e}function YR(i){let e=i.match(/#|\?|$/),r=e&&e.index||i.length,t=r-(i[r-1]==="/"?1:0);return i.slice(0,t)+i.slice(r)}function oc(i){return i&&i[0]!=="?"?"?"+i:i}var lc=(()=>{let e=class e{historyGo(t){throw new Error("Not implemented")}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:()=>(()=>_t(dT))(),providedIn:"root"});let i=e;return i})(),sL=new Ct("appBaseHref"),dT=(()=>{let e=class e extends lc{constructor(t,o){super(),this._platformLocation=t,this._removeListenerFns=[],this._baseHref=o??this._platformLocation.getBaseHrefFromDOM()??_t($i).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return uT(this._baseHref,t)}path(t=!1){let o=this._platformLocation.pathname+oc(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${o}${n}`:o}pushState(t,o,n,d){let _=this.prepareExternalUrl(n+oc(d));this._platformLocation.pushState(t,o,_)}replaceState(t,o,n,d){let _=this.prepareExternalUrl(n+oc(d));this._platformLocation.replaceState(t,o,_)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}};e.\u0275fac=function(o){return new(o||e)(Ve(cT),Ve(sL,8))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),aL=(()=>{let e=class e extends lc{constructor(t,o){super(),this._platformLocation=t,this._baseHref="",this._removeListenerFns=[],o!=null&&(this._baseHref=o)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.on
1324HashChange(t))}getBaseHref(){return this._baseHref}path(t=!1){let o=this._platformLocation.hash;return o==null&&(o="#"),o.length>0?o.substring(1):o}prepareExternalUrl(t){let o=uT(this._baseHref,t);return o.length>0?"#"+o:o}pushState(t,o,n,d){let _=this.prepareExternalUrl(n+oc(d));_.length==0&&(_=this._platformLocation.pathname),this._platformLocation.pushState(t,o,_)}replaceState(t,o,n,d){let _=this.prepareExternalUrl(n+oc(d));_.length==0&&(_=this._platformLocation.pathname),this._platformLocation.replaceState(t,o,_)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}};e.\u0275fac=function(o){return new(o||e)(Ve(cT),Ve(sL,8))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})(),hl=(()=>{let e=class e{constructor(t){this._subject=new Fe,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=t;let o=this._locationStrategy.getBaseHref();this._basePath=b$(YR(QR(o))),this._locationStrategy.onPopState(n=>{this._subject.emit({url:this.path(!0),pop:!0,state:n.state,type:n.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(t=!1){return this.normalize(this._locationStrategy.path(t))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(t,o=""){return this.path()==this.normalize(t+oc(o))}normalize(t){return e.stripTrailingSlash(y$(this._basePath,QR(t)))}prepareExternalUrl(t){return t&&t[0]!=="/"&&(t="/"+t),this._locationStrategy.prepareExternalUrl(t)}go(t,o="",n=null){this._locationStrategy.pushState(n,"",t,o),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+oc(o)),n)}replaceState(t,o="",n=null){this._locationStrategy.replaceState(n,"",t,o),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+oc(o)),n)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(t=0){this._locationStrategy.historyGo?.(t)}onUrlChange(t){return this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(o=>{this._notifyUrlChangeListeners(o.url,o.state)})),()=>{let o=this._urlChangeListeners.indexOf(t);this._urlChangeListeners.splice(o,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(t="",o){this._urlChangeListeners.forEach(n=>n(t,o))}subscribe(t,o,n){return this._subject.subscribe({next:t,error:o,complete:n})}};e.normalizeQueryParams=oc,e.joinWithSlash=uT,e.stripTrailingSlash=YR,e.\u0275fac=function(o){return new(o||e)(Ve(lc))},e.\u0275prov=Qe({token:e,factory:()=>v$(),providedIn:"root"});let i=e;return i})();function v$(){return new hl(Ve(lc))}function y$(i,e){if(!i||!e.startsWith(i))return e;let r=e.substring(i.length);return r===""||["/",";","?","#"].includes(r[0])?r:e}function QR(i){return i.replace(/\/index.html$/,"")}function b$(i){if(new RegExp("^(https?:)?//").test(i)){let[,r]=i.split(/\/\/[^\/]+/);return r}return i}var lL=function(i){return i[i.Decimal=0]="Decimal",i[i.Percent=1]="Percent",i[i.Currency=2]="Currency",i[i.Scientific=3]="Scientific",i}(lL||{});var No=function(i){return i[i.Format=0]="Format",i[i.Standalone=1]="Standalone",i}(No||{}),qn=function(i){return i[i.Narrow=0]="Narrow",i[i.Abbreviated=1]="Abbreviated",i[i.Wide=2]="Wide",i[i.Short=3]="Short",i}(qn||{}),ws=function(i){return i[i.Short=0]="Short",i[i.Medium=1]="Medium",i[i.Long=2]="Long",i[i.Full=3]="Full",i}(ws||{}),rs=function(i){return i[i.Decimal=0]="Decimal",i[i.Group=1]="Group",i[i.List=2]="List",i[i.PercentSign=3]="PercentSign",i[i.PlusSign=4]="PlusSign",i[i.MinusSign=5]="MinusSign",i[i.Exponential=6]="Exponential",i[i.SuperscriptingExponent=7]="SuperscriptingExponent",i[i.PerMille=8]="PerMille",i[i.Infinity=9]="Infinity",i[i.NaN=10]="NaN",i[i.TimeSeparator=11]="TimeSeparator",i[i.CurrencyDecimal=12]="CurrencyDecimal",i[i.CurrencyGroup=13]="CurrencyGroup",i}(rs||{});function x$(i){return xs(i)[wr.LocaleId]}function w$(i,e,r){let t=xs(i),o=[t[wr.DayPeriodsFormat],t[wr.DayPeriodsStandalone]],n=Ks(o,e);return Ks(n,r)}function C$(i,e,r){let t=xs(i),o=[t[wr.DaysFormat],t[wr.DaysStandalone]],n=Ks(o,e);return Ks(n,r)}function E$(i,e,r){let t=xs(i),o=[t[wr.MonthsFormat],t[wr.MonthsStandalone]],n=Ks(o,e);return Ks(n,r)}function S$(i,e){let t=xs(i)[wr.Eras];return Ks(t,e)}function zb(i,e){let r=xs(i);return Ks(r[wr.DateFormat],e)}function jb(i,e){let r=xs(i);return Ks(r[wr.TimeFormat],e)}function Vb(i,e){let t=xs(i)[wr.DateTimeFormat];return Ks(t,e)}function sc(i,e){let r=xs(i),t=r[wr.NumberSymbols][e];if(typeof t>"u"){if(e===rs.CurrencyDecimal)return r[wr.NumberSymbols][rs.Decimal];if(e===rs.CurrencyGroup)return r[wr.NumberSymbols][rs.Group]}return t}function T$(i,e){return xs(i)[wr.NumberFormats][e]}function cL(i){if(!i[wr.ExtraData])throw new Error(`Missing extra locale data for the locale "${i[wr.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function I$(i){let e=xs(i);return cL(e),(e[wr.ExtraData][2]||[]).map(t=>typeof t=="string"?JS(t):[JS(t[0]),JS(t[1])])}function D$(i,e,r){let t=xs(i);cL(t);let o=[t[wr.ExtraData][0],t[wr.ExtraData][1]],n=Ks(o,e)||[];return Ks(n,r)||[]}function Ks(i,e){for(let r=e;r>-1;r--)if(typeof i[r]<"u")return i[r];throw new Error("Locale data API: locale data undefined")}function JS(i){let[e,r]=i.split(":");return{hours:+e,minutes:+r}}var M$=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,l_={},k$=/((?:[^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]*)/,ac=function(i){return i[i.Short=0]="Short",i[i.ShortGMT=1]="ShortGMT",i[i.Long=2]="Long",i[i.Extended=3]="Extended",i}(ac||{}),Mn=function(i){return i[i.FullYear=0]="FullYear",i[i.Month=1]="Month",i[i.Date=2]="Date",i[i.Hours=3]="Hours",i[i.Minutes=4]="Minutes",i[i.Seconds=5]="Seconds",i[i.FractionalSeconds=6]="FractionalSeconds",i[i.Day=7]="Day",i}(Mn||{}),Dn=function(i){return i[i.DayPeriods=0]="DayPeriods",i[i.Days=1]="Days",i[i.Months=2]="Months",i[i.Eras=3]="Eras",i}(Dn||{});function A$(i,e,r,t){let o=V$(i);e=rc(r,e)||e;let d=[],_;for(;e;)if(_=k$.exec(e),_){d=d.concat(_.slice(1));let j=d.pop();if(!j)break;e=j}else{d.push(e);break}let C=o.getTimezoneOffset();t&&(C=dL(t,C),o=j$(o,t,!0));let M="";return d.forEach(j=>{let G=N$(j);M+=G?G(o,r,C):j==="''"?"'":j.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),M}function qb(i,e,r){let t=new Date(0);return t.setFullYear(i,e,r),t.setHours(0,0,0),t}function rc(i,e){let r=x$(i);if(l_[r]=l_[r]||{},l_[r][e])return l_[r][e];let t="";switch(e){case"shortDate":t=zb(i,ws.Short);break;case"mediumDate":t=zb(i,ws.Medium);break;case"longDate":t=zb(i,ws.Long);break;case"fullDate":t=zb(i,ws.Full);break;case"shortTime":t=jb(i,ws.Short);break;case"mediumTime":t=jb(i,ws.Medium);break;case"longTime":t=jb(i,ws.Long);break;case"fullTime":t=jb(i,ws.Full);break;case"short":let o=rc(i,"shortTime"),n=rc(i,"shortDate");t=Bb(Vb(i,ws.Short),[o,n]);break;case"medium":let d=rc(i,"mediumTime"),_=rc(i,"mediumDate");t=Bb(Vb(i,ws.Medium),[d,_]);break;case"long":let C=rc(i,"longTime"),M=rc(i,"longDate");t=Bb(Vb(i,ws.Long),[C,M]);break;case"full":let j=rc(i,"fullTime"),G=rc(i,"fullDate");t=Bb(Vb(i,ws.Full),[j,G]);break}return t&&(l_[r][e]=t),t}function Bb(i,e){return e&&(i=i.replace(/\{([^}]+)}/g,function(r,t){return e!=null&&t in e?e[t]:r})),i}function Ra(i,e,r="-",t,o){let n="";(i<0||o&&i<=0)&&(o?i=-i+1:(i=-i,n=r));let d=String(i);for(;d.length<e;)d="0"+d;return t&&(d=d.slice(d.length-e)),n+d}function P$(i,e){return Ra(i,3).substring(0,e)}function Lr(i,e,r=0,t=!1,o=!1){return function(n,d){let _=O$(i,n);if((r>0||_>-r)&&(_+=r),i===Mn.Hours)_===0&&r===-12&&(_=12);else if(i===Mn.FractionalSeconds)return P$(_,e);let C=sc(d,rs.MinusSign);return Ra(_,e,C,t,o)}}function O$(i,e){switch(i){case Mn.FullYear:return e.getFullYear();case Mn.Month:return e.getMonth();case Mn.Date:return e.getDate();case Mn.Hours:return e.getHours();case Mn.Minutes:return e.getMinutes();case Mn.Seconds:return e.getSeconds();case Mn.FractionalSeconds:return e.getMilliseconds();case Mn.Day:return e.getDay();default:throw new Error(`Unknown DateType value "${i}".`)}}function Yn(i,e,r=No.Format,t=!1){return function(o,n){return R$(o,n,i,e,r,t)}}function R$(i,e,r,t,o,n){switch(r){case Dn.Months:return E$(e,o,t)[i.getMonth()];case Dn.Days:return C$(e,o,t)[i.getDay()];case Dn.DayPeriods:let d=i.getHours(),_=i.getMinutes();if(n){let M=I$(e),j=D$(e,o,t),G=M.findIndex(ie=>{if(Array.isArray(ie)){let[_e,Ee]=ie,Ye=d>=_e.hours&&_>=_e.minutes,$e=d<Ee.hours||d===Ee.hours&&_<Ee.minutes;if(_e.hours<Ee.hours){if(Ye&&$e)return!0}else if(Ye||$e)return!0}else if(ie.hours===d&&ie.minutes===_)return!0;return!1});if(G!==-1)return j[G]}return w$(e,o,t)[d<12?0:1];case Dn.Eras:return S$(e,t)[i.getFullYear()<=0?0:1];default:let C=r;throw new Error(`unexpected translation type ${C}`)}}function Ub(i){return function(e,r,t){let o=-1*t,n=sc(r,rs.MinusSign),d=o>0?Math.floor(o/60):Math.ceil(o/60);switch(i){case ac.Short:return(o>=0?"+":"")+Ra(d,2,n)+Ra(Math.abs(o%60),2,n);case ac.ShortGMT:return"GMT"+(o>=0?"+":"")+Ra(d,1,n);case ac.Long:return"GMT"+(o>=0?"+":"")+Ra(d,2,n)+":"+Ra(Math.abs(o%60),2,n);case ac.Extended:return t===0?"Z":(o>=0?"+":"")+Ra(d,2,n)+":"+Ra(Math.abs(o%60),2,n);default:throw new Error(`Unknown zone width "${i}"`)}}}var L$=0,$b=4;function F$(i){let e=qb(i,L$,1).getDay();return qb(i,0,1+(e<=$b?$b:$b+7)-e)}function uL(i){return qb(i.getFullYear(),i.getMonth(),i.getDate()+($b-i.getDay()))}function eT(i,e=!1){return function(r,t){let o;if(e){let n=new Date(r.getFullYear(),r.getMonth(),1).getDay()-1,d=r.getDate();o=1+Math.floor((d+n)/7)}
vendor: 6,350 bytes, line 1324
1324else{let n=uL(r),d=F$(n.getFullYear()),_=n.getTime()-d.getTime();o=1+Math.round(_/6048e5)}return Ra(o,i,sc(t,rs.MinusSign))}}function Hb(i,e=!1){return function(r,t){let n=uL(r).getFullYear();return Ra(n,i,sc(t,rs.MinusSign),e)}}var tT={};function N$(i){if(tT[i])return tT[i];let e;switch(i){case"G":case"GG":case"GGG":e=Yn(Dn.Eras,qn.Abbreviated);break;case"GGGG":e=Yn(Dn.Eras,qn.Wide);break;case"GGGGG":e=Yn(Dn.Eras,qn.Narrow);break;case"y":e=Lr(Mn.FullYear,1,0,!1,!0);break;case"yy":e=Lr(Mn.FullYear,2,0,!0,!0);break;case"yyy":e=Lr(Mn.FullYear,3,0,!1,!0);break;case"yyyy":e=Lr(Mn.FullYear,4,0,!1,!0);break;case"Y":e=Hb(1);break;case"YY":e=Hb(2,!0);break;case"YYY":e=Hb(3);break;case"YYYY":e=Hb(4);break;case"M":case"L":e=Lr(Mn.Month,1,1);break;case"MM":case"LL":e=Lr(Mn.Month,2,1);break;case"MMM":e=Yn(Dn.Months,qn.Abbreviated);break;case"MMMM":e=Yn(Dn.Months,qn.Wide);break;case"MMMMM":e=Yn(Dn.Months,qn.Narrow);break;case"LLL":e=Yn(Dn.Months,qn.Abbreviated,No.Standalone);break;case"LLLL":e=Yn(Dn.Months,qn.Wide,No.Standalone);break;case"LLLLL":e=Yn(Dn.Months,qn.Narrow,No.Standalone);break;case"w":e=eT(1);break;case"ww":e=eT(2);break;case"W":e=eT(1,!0);break;case"d":e=Lr(Mn.Date,1);break;case"dd":e=Lr(Mn.Date,2);break;case"c":case"cc":e=Lr(Mn.Day,1);break;case"ccc":e=Yn(Dn.Days,qn.Abbreviated,No.Standalone);break;case"cccc":e=Yn(Dn.Days,qn.Wide,No.Standalone);break;case"ccccc":e=Yn(Dn.Days,qn.Narrow,No.Standalone);break;case"cccccc":e=Yn(Dn.Days,qn.Short,No.Standalone);break;case"E":case"EE":case"EEE":e=Yn(Dn.Days,qn.Abbreviated);break;case"EEEE":e=Yn(Dn.Days,qn.Wide);break;case"EEEEE":e=Yn(Dn.Days,qn.Narrow);break;case"EEEEEE":e=Yn(Dn.Days,qn.Short);break;case"a":case"aa":case"aaa":e=Yn(Dn.DayPeriods,qn.Abbreviated);break;case"aaaa":e=Yn(Dn.DayPeriods,qn.Wide);break;case"aaaaa":e=Yn(Dn.DayPeriods,qn.Narrow);break;case"b":case"bb":case"bbb":e=Yn(Dn.DayPeriods,qn.Abbreviated,No.Standalone,!0);break;case"bbbb":e=Yn(Dn.DayPeriods,qn.Wide,No.Standalone,!0);break;case"bbbbb":e=Yn(Dn.DayPeriods,qn.Narrow,No.Standalone,!0);break;case"B":case"BB":case"BBB":e=Yn(Dn.DayPeriods,qn.Abbreviated,No.Format,!0);break;case"BBBB":e=Yn(Dn.DayPeriods,qn.Wide,No.Format,!0);break;case"BBBBB":e=Yn(Dn.DayPeriods,qn.Narrow,No.Format,!0);break;case"h":e=Lr(Mn.Hours,1,-12);break;case"hh":e=Lr(Mn.Hours,2,-12);break;case"H":e=Lr(Mn.Hours,1);break;case"HH":e=Lr(Mn.Hours,2);break;case"m":e=Lr(Mn.Minutes,1);break;case"mm":e=Lr(Mn.Minutes,2);break;case"s":e=Lr(Mn.Seconds,1);break;case"ss":e=Lr(Mn.Seconds,2);break;case"S":e=Lr(Mn.FractionalSeconds,1);break;case"SS":e=Lr(Mn.FractionalSeconds,2);break;case"SSS":e=Lr(Mn.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":e=Ub(ac.Short);break;case"ZZZZZ":e=Ub(ac.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":e=Ub(ac.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":e=Ub(ac.Long);break;default:return null}return tT[i]=e,e}function dL(i,e){i=i.replace(/:/g,"");let r=Date.parse("Jan 01, 1970 00:00:00 "+i)/6e4;return isNaN(r)?e:r}function z$(i,e){return i=new Date(i.getTime()),i.setMinutes(i.getMinutes()+e),i}function j$(i,e,r){let t=r?-1:1,o=i.getTimezoneOffset(),n=dL(e,o);return z$(i,t*(n-o))}function V$(i){if(JR(i))return i;if(typeof i=="number"&&!isNaN(i))return new Date(i);if(typeof i=="string"){if(i=i.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(i)){let[o,n=1,d=1]=i.split("-").map(_=>+_);return qb(o,n-1,d)}let r=parseFloat(i);if(!isNaN(i-r))return new Date(r);let t;if(t=i.match(M$))return B$(t)}let e=new Date(i);if(!JR(e))throw new Error(`Unable to convert "${i}" into a date`);return e}function B$(i){let e=new Date(0),r=0,t=0,o=i[8]?e.setUTCFullYear:e.setFullYear,n=i[8]?e.setUTCHours:e.setHours;i[9]&&(r=Number(i[9]+i[10]),t=Number(i[9]+i[11])),o.call(e,Number(i[1]),Number(i[2])-1,Number(i[3]));let d=Number(i[4]||0)-r,_=Number(i[5]||0)-t,C=Number(i[6]||0),M=Math.floor(parseFloat("0."+(i[7]||0))*1e3);return n.call(e,d,_,C,M),e}function JR(i){return i instanceof Date&&!isNaN(i.valueOf())}var U$=/^(\d+)?\.((\d+)(-(\d+))?)?$/,eL=22,Wb=".",c_="0",H$=";",$$=",",iT="#";function G$(i,e,r,t,o,n,d=!1){let _="",C=!1;if(!isFinite(i))_=sc(r,rs.Infinity);else{let M=K$(i);d&&(M=Z$(M));let j=e.minInt,G=e.minFrac,ie=e.maxFrac;if(n){let Lt=n.match(U$);if(Lt===null)throw new Error(`${n} is not a valid digit info`);let jt=Lt[1],$t=Lt[3],tn=Lt[5];jt!=null&&(j=nT(jt)),$t!=null&&(G=nT($t)),tn!=null?ie=nT(tn):$t!=null&&G>ie&&(ie=G)}X$(M,G,ie);let _e=M.digits,Ee=M.integerLen,Ye=M.exponent,$e=[];for(C=_e.every(Lt=>!Lt);Ee<j;Ee++)_e.unshift(0);for(;Ee<0;Ee++)_e.unshift(0);Ee>0?$e=_e.splice(Ee,_e.length):($e=_e,_e=[0]);let at=[];for(_e.length>=e.lgSize&&at.unshift(_e.splice(-e.lgSize,_e.length).join(""));_e.length>e.gSize;)at.unshift(_e.splice(-e.gSize,_e.length).join(""));_e.length&&at.unshift(_e.join("")),_=at.join(sc(r,t)),$e.length&&(_+=sc(r,o)+$e.join("")),Ye&&(_+=sc(r,rs.Exponential)+"+"+Ye)}return i<0&&!C?_=e.negPre+_+e.negSuf:_=e.posPre+_+e.posSuf,_}function q$(i,e,r){let t=T$(e,lL.Decimal),o=W$(t,sc(e,rs.MinusSign));return G$(i,o,e,rs.Group,rs.Decimal,r)}function W$(i,e="-"){let r={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},t=i.split(H$),o=t[0],n=t[1],d=o.indexOf(Wb)!==-1?o.split(Wb):[o.substring(0,o.lastIndexOf(c_)+1),o.substring(o.lastIndexOf(c_)+1)],_=d[0],C=d[1]||"";r.posPre=_.substring(0,_.indexOf(iT));for(let j=0;j<C.length;j++){let G=C.charAt(j);G===c_?r.minFrac=r.maxFrac=j+1:G===iT?r.maxFrac=j+1:r.posSuf+=G}let M=_.split($$);if(r.gSize=M[1]?M[1].length:0,r.lgSize=M[2]||M[1]?(M[2]||M[1]).length:0,n){let j=o.length-r.posPre.length-r.posSuf.length,G=n.indexOf(iT);r.negPre=n.substring(0,G).replace(/'/g,""),r.negSuf=n.slice(G+j).replace(/'/g,"")}else r.negPre=e+r.posPre,r.negSuf=r.posSuf;return r}function Z$(i){if(i.digits[0]===0)return i;let e=i.digits.length-i.integerLen;return i.exponent?i.exponent+=2:(e===0?i.digits.push(0,0):e===1&&i.digits.push(0),i.integerLen+=2),i}function K$(i){let e=Math.abs(i)+"",r=0,t,o,n,d,_;for((o=e.indexOf(Wb))>-1&&(e=e.replace(Wb,"")),(n=e.search(/e/i))>0?(o<0&&(o=n),o+=+e.slice(n+1),e=e.substring(0,n)):o<0&&(o=e.length),n=0;e.charAt(n)===c_;n++);if(n===(_=e.length))t=[0],o=1;else{for(_--;e.charAt(_)===c_;)_--;for(o-=n,t=[],d=0;n<=_;n++,d++)t[d]=Number(e.charAt(n))}return o>eL&&(t=t.splice(0,eL-1),r=o-1,o=1),{digits:t,exponent:r,integerLen:o}}
1324function X$(i,e,r){if(e>r)throw new Error(`The minimum number of digits after fraction (${e}) is higher than the maximum (${r}).`);let t=i.digits,o=t.length-i.integerLen,n=Math.min(Math.max(e,o),r),d=n+i.integerLen,_=t[d];if(d>0){t.splice(Math.max(i.integerLen,d));for(let G=d;G<t.length;G++)t[G]=0}else{o=Math.max(0,o),i.integerLen=1,t.length=Math.max(1,d=n+1),t[0]=0;for(let G=1;G<d;G++)t[G]=0}if(_>=5)if(d-1<0){for(let G=0;G>d;G--)t.unshift(0),i.integerLen++;t.unshift(1),i.integerLen++}else t[d-1]++;for(;o<Math.max(0,n);o++)t.push(0);let C=n!==0,M=e+i.integerLen,j=t.reduceRight(function(G,ie,_e,Ee){return ie=ie+G,Ee[_e]=ie<10?ie:ie-10,C&&(Ee[_e]===0&&_e>=M?Ee.pop():C=!1),ie>=10?1:0},0);j&&(t.unshift(j),i.integerLen++)}function nT(i){let e=parseInt(i);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+i);return e}function Kb(i,e){e=encodeURIComponent(e);for(let r of i.split(";")){let t=r.indexOf("="),[o,n]=t==-1?[r,""]:[r.slice(0,t),r.slice(t+1)];if(o.trim()===e)return decodeURIComponent(n)}return null}var rT=/\s+/,tL=[],on=(()=>{let e=class e{constructor(t,o,n,d){this._iterableDiffers=t,this._keyValueDiffers=o,this._ngEl=n,this._renderer=d,this.initialClasses=tL,this.stateMap=new Map}set klass(t){this.initialClasses=t!=null?t.trim().split(rT):tL}set ngClass(t){this.rawClass=typeof t=="string"?t.trim().split(rT):t}ngDoCheck(){for(let o of this.initialClasses)this._updateState(o,!0);let t=this.rawClass;if(Array.isArray(t)||t instanceof Set)for(let o of t)this._updateState(o,!0);else if(t!=null)for(let o of Object.keys(t))this._updateState(o,!!t[o]);this._applyStateDiff()}_updateState(t,o){let n=this.stateMap.get(t);n!==void 0?(n.enabled!==o&&(n.changed=!0,n.enabled=o),n.touched=!0):this.stateMap.set(t,{enabled:o,changed:!0,touched:!0})}_applyStateDiff(){for(let t of this.stateMap){let o=t[0],n=t[1];n.changed?(this._toggleClass(o,n.enabled),n.changed=!1):n.touched||(n.enabled&&this._toggleClass(o,!1),this.stateMap.delete(o)),n.touched=!1}}_toggleClass(t,o){t=t.trim(),t.length>0&&t.split(rT).forEach(n=>{o?this._renderer.addClass(this._ngEl.nativeElement,n):this._renderer.removeClass(this._ngEl.nativeElement,n)})}};e.\u0275fac=function(o){return new(o||e)(ae(i_),ae(Eb),ae(Pi),ae(eo))},e.\u0275dir=bi({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"},standalone:!0});let i=e;return i})();var sT=class{constructor(e,r,t,o){this.$implicit=e,this.ngForOf=r,this.index=t,this.count=o}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},ti=(()=>{let e=class e{set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}constructor(t,o,n){this._viewContainer=t,this._template=o,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let t=this._ngForOf;if(!this._differ&&t)if(!1)try{}catch{}else this._differ=this._differs.find(t).create(this.ngForTrackBy)}if(this._differ){let t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){let o=this._viewContainer;t.forEachOperation((n,d,_)=>{if(n.previousIndex==null)o.createEmbeddedView(this._template,new sT(n.item,this._ngForOf,-1,-1),_===null?void 0:_);else if(_==null)o.remove(d===null?void 0:d);else if(d!==null){let C=o.get(d);o.move(C,_),iL(C,n)}});for(let n=0,d=o.length;n<d;n++){let C=o.get(n).context;C.index=n,C.count=d,C.ngForOf=this._ngForOf}t.forEachIdentityChange(n=>{let d=o.get(n.currentIndex);iL(d,n)})}static ngTemplateContextGuard(t,o){return!0}};e.\u0275fac=function(o){return new(o||e)(ae(qs),ae(al),ae(i_))},e.\u0275dir=bi({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0});let i=e;return i})();function iL(i,e){i.context.$implicit=e.item}var At=(()=>{let e=class e{constructor(t,o){this._viewContainer=t,this._context=new aT,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenView
1324Ref=null,this._elseViewRef=null,this._thenTemplateRef=o}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){nL("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){nL("ngIfElse",t),this._elseTemplateRef=t,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(t,o){return!0}};e.\u0275fac=function(o){return new(o||e)(ae(qs),ae(al))},e.\u0275dir=bi({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0});let i=e;return i})(),aT=class{constructor(){this.$implicit=null,this.ngIf=null}};function nL(i,e){if(!!!(!e||e.createEmbeddedView))throw new Error(`${i} must be a TemplateRef, but received '${Co(e)}'.`)}var hL=(()=>{let e=class e{constructor(t,o,n){this._ngEl=t,this._differs=o,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){let t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,o){let[n,d]=t.split("."),_=n.indexOf("-")===-1?void 0:ol.DashCase;o!=null?this._renderer.setStyle(this._ngEl.nativeElement,n,d?`${o}${d}`:o,_):this._renderer.removeStyle(this._ngEl.nativeElement,n,_)}_applyChanges(t){t.forEachRemovedItem(o=>this._setStyle(o.key,null)),t.forEachAddedItem(o=>this._setStyle(o.key,o.currentValue)),t.forEachChangedItem(o=>this._setStyle(o.key,o.currentValue))}};e.\u0275fac=function(o){return new(o||e)(ae(Pi),ae(Eb),ae(eo))},e.\u0275dir=bi({type:e,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"},standalone:!0});let i=e;return i})(),pL=(()=>{let e=class e{constructor(t){this._viewContainerRef=t,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null,this.ngTemplateOutletInjector=null}ngOnChanges(t){if(this._shouldRecreateView(t)){let o=this._viewContainerRef;if(this._viewRef&&o.remove(o.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let n=this._createContextForwardProxy();this._viewRef=o.createEmbeddedView(this.ngTemplateOutlet,n,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(t){return!!t.ngTemplateOutlet||!!t.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(t,o,n)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,o,n):!1,get:(t,o,n)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,o,n)}})}};e.\u0275fac=function(o){return new(o||e)(ae(qs))},e.\u0275dir=bi({type:e,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},standalone:!0,features:[hn]});let i=e;return i})();function fL(i,e){return new yt(2100,!1)}var Y$="mediumDate",Q$=new Ct("DATE_PIPE_DEFAULT_TIMEZONE"),J$=new Ct("DATE_PIPE_DEFAULT_OPTIONS"),Xs=(()=>{let e=class e{constructor(t,o,n){this.locale=t,this.defaultTimezone=o,this.defaultOptions=n}transform(t,o,n,d){if(t==null||t===""||t!==t)return null;try{let _=o??this.defaultOptions?.dateFormat??Y$,C=n??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return A$(t,_,d||this.locale,C)}catch(_){throw fL(e,_.message)}}};e.\u0275fac=function(o){return new(o||e)(ae(tf,16),ae(Q$,24),ae(J$,24))},e.\u0275pipe=aS({name:"date",type:e,pure:!0,standalone:!0});let i=e;return i})();var rf=(()=>{let e=class e{constructor(t){this._locale=t}transform(t,o,n){if(!eG(t))return null;n=n||this._locale;try{let d=tG(t);return q$(d,n,o)}catch(d){throw fL(e,d.message)}}};e.\u0275fac=function(o){return new(o||e)(ae(tf,16))},e.\u0275pipe=aS({name:"number",type:e,pure:!0,standalone:!0});let i=e;return i})();function eG(i){return!(i==null||i===""||i!==i)}function tG(i){if(typeof i=="string"&&!isNaN(Number(i)-parseFloat(i)))return Number(i);if(typeof i!="number")throw new Error(`${i} is not a number`);return i}var Dt=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({});let i=e;return i})(),hT="browser",iG="server";function Si(i){return i===hT}function u_(i){return i===iG}var Xb=(()=>{let e=class e{};e.\u0275prov=Qe({token:e,providedIn:"root",factory:()=>new lT(Ve($i),window)});let i=e;return i})(),lT=class{constructor(e,r){this.document=e,this.window=r,this.offset=()=>[0,0]}setOffset(e){Array.isArray(e)?this.offset=()=>e:this.offset=e}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(e){this.supportsScrolling()&&this.window.scrollTo(e[0],e[1])}scrollToAnchor(e){if(!this.supportsScrolling())return;let r=nG(this.document,e);r&&(this.scrollToElement(r),r.focus())}setHistoryScrollRestoration(e){this.supportsScrolling()&&(this.window.history.scrollRestoration=e)}scrollToElement(e){let r=e.getBoundingClientRect(),t=r.left+this.window.pageXOffset,o=r.top+this.window.pageYOffset,n=this.offset();this.window.scrollTo(t-n[0],o-n[1])}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch{return!1}}};function nG(i,e){let r=i.getElementById(e)||i.getElementsByName(e)[0];if(r)return r;if(typeof i.createTreeWalker=="function"&&i.body&&typeof i.body.attachShadow=="function"){let t=i.createTreeWalker(i.body,NodeFilter.SHOW_ELEMENT),o=t.currentNode;for(;o;){let n=o.shadowRoot;if(n){let d=n.getElementById(e)||n.querySelector(`[name="${e}"]`);if(d)return d}o=t.nextNode()}}return null}var nf=class{};var d_=class{},h_=class{},Qn=class i{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(`
1325`).forEach(r=>{let t=r.indexOf(":");if(t>0){let o=r.slice(0,t),n=o.toLowerCase(),d=r.slice(t+1).trim();this.maybeSetNormalizedName(o,n),this.headers.has(n)?this.headers.get(n).push(d):this.headers.set(n,[d])}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((r,t)=>{this.setHeaderEntries(t,r)}
vendor: 4,638 bytes, line 1325
1325)):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([r,t])=>{this.setHeaderEntries(r,t)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();let r=this.headers.get(e.toLowerCase());return r&&r.length>0?r[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,r){return this.clone({name:e,value:r,op:"a"})}set(e,r){return this.clone({name:e,value:r,op:"s"})}delete(e,r){return this.clone({name:e,value:r,op:"d"})}maybeSetNormalizedName(e,r){this.normalizedNames.has(r)||this.normalizedNames.set(r,e)}init(){this.lazyInit&&(this.lazyInit instanceof i?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(r=>{this.headers.set(r,e.headers.get(r)),this.normalizedNames.set(r,e.normalizedNames.get(r))})}clone(e){let r=new i;return r.lazyInit=this.lazyInit&&this.lazyInit instanceof i?this.lazyInit:this,r.lazyUpdate=(this.lazyUpdate||[]).concat([e]),r}applyUpdate(e){let r=e.name.toLowerCase();switch(e.op){case"a":case"s":let t=e.value;if(typeof t=="string"&&(t=[t]),t.length===0)return;this.maybeSetNormalizedName(e.name,r);let o=(e.op==="a"?this.headers.get(r):void 0)||[];o.push(...t),this.headers.set(r,o);break;case"d":let n=e.value;if(!n)this.headers.delete(r),this.normalizedNames.delete(r);else{let d=this.headers.get(r);if(!d)return;d=d.filter(_=>n.indexOf(_)===-1),d.length===0?(this.headers.delete(r),this.normalizedNames.delete(r)):this.headers.set(r,d)}break}}setHeaderEntries(e,r){let t=(Array.isArray(r)?r:[r]).map(n=>n.toString()),o=e.toLowerCase();this.headers.set(o,t),this.maybeSetNormalizedName(e,o)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(r=>e(this.normalizedNames.get(r),this.headers.get(r)))}};var mT=class{encodeKey(e){return mL(e)}encodeValue(e){return mL(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function oG(i,e){let r=new Map;return i.length>0&&i.replace(/^\?/,"").split("&").forEach(o=>{let n=o.indexOf("="),[d,_]=n==-1?[e.decodeKey(o),""]:[e.decodeKey(o.slice(0,n)),e.decodeValue(o.slice(n+1))],C=r.get(d)||[];C.push(_),r.set(d,C)}),r}var sG=/%(\d[a-f0-9])/gi,aG={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function mL(i){return encodeURIComponent(i).replace(sG,(e,r)=>aG[r]??e)}function Yb(i){return`${i}`}var os=class i{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new mT,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=oG(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(r=>{let t=e.fromObject[r],o=Array.isArray(t)?t.map(Yb):[Yb(t)];this.map.set(r,o)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();let r=this.map.get(e);return r?r[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,r){return this.clone({param:e,value:r,op:"a"})}appendAll(e){let r=[];return Object.keys(e).forEach(t=>{let o=e[t];Array.isArray(o)?o.forEach(n=>{r.push({param:t,value:n,op:"a"})}):r.push({param:t,value:o,op:"a"})}),this.clone(r)}set(e,r){return this.clone({param:e,value:r,op:"s"})}delete(e,r){return this.clone({param:e,value:r,op:"d"})}toString(){return this.init(),this.keys().map(e=>{let r=this.encoder.encodeKey(e);return this.map.get(e).map(t=>r+"="+this.encoder.encodeValue(t)).join("&")}).filter(e=>e!=="").join("&")}clone(e){let r=new i({encoder:this.encoder});return r.cloneFrom=this.cloneFrom||this,r.updates=(this.updates||[]).concat(e),r}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":let r=(e.op==="a"?this.map.get(e.param):void 0)||[];r.push(Yb(e.value)),this.map.set(e.param,r);break;case"d":if(e.value!==void 0){let t=this.map.get(e.param)||[],o=t.indexOf(Yb(e.value));o!==-1&&t.splice(o,1),t.length>0?this.map.set(e.param,t):this.map.delete(e.param)}else{this.map.delete(e.param);break}}}),this.cloneFrom=this.updates=null)}};var gT=class{constructor(){this.map=new Map}set(e,r){return this.map.set(e,r),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}
1325keys(){return this.map.keys()}};function lG(i){switch(i){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function gL(i){return typeof ArrayBuffer<"u"&&i instanceof ArrayBuffer}function _L(i){return typeof Blob<"u"&&i instanceof Blob}function vL(i){return typeof FormData<"u"&&i instanceof FormData}function cG(i){return typeof URLSearchParams<"u"&&i instanceof URLSearchParams}var Yd=class i{constructor(e,r,t,o){this.url=r,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase();let n;if(lG(this.method)||o?(this.body=t!==void 0?t:null,n=o):n=t,n&&(this.reportProgress=!!n.reportProgress,this.withCredentials=!!n.withCredentials,n.responseType&&(this.responseType=n.responseType),n.headers&&(this.headers=n.headers),n.context&&(this.context=n.context),n.params&&(this.params=n.params),this.transferCache=n.transferCache),this.headers||(this.headers=new Qn),this.context||(this.context=new gT),!this.params)this.params=new os,this.urlWithParams=r;else{let d=this.params.toString();if(d.length===0)this.urlWithParams=r;else{let _=r.indexOf("?"),C=_===-1?"?":_<r.length-1?"&":"";this.urlWithParams=r+C+d}}}serializeBody(){return this.body===null?null:gL(this.body)||_L(this.body)||vL(this.body)||cG(this.body)||typeof this.body=="string"?this.body:this.body instanceof os?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||vL(this.body)?null:_L(this.body)?this.body.type||null:gL(this.body)?null:typeof this.body=="string"?"text/plain":this.body instanceof os?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?"application/json":null}clone(e={}){let r=e.method||this.method,t=e.url||this.url,o=e.responseType||this.responseType,n=e.body!==void 0?e.body:this.body,d=e.withCredentials!==void 0?e.withCredentials:this.withCredentials,_=e.reportProgress!==void 0?e.reportProgress:this.reportProgress,C=e.headers||this.headers,M=e.params||this.params,j=e.context??this.context;return e.setHeaders!==void 0&&(C=Object.keys(e.setHeaders).reduce((G,ie)=>G.set(ie,e.setHeaders[ie]),C)),e.setParams&&(M=Object.keys(e.setParams).reduce((G,ie)=>G.set(ie,e.setParams[ie]),M)),new i(r,t,n,{params:M,headers:C,context:j,reportProgress:_,responseType:o,withCredentials:d})}},pl=function(i){return i[i.Sent=0]="Sent",i[i.UploadProgress=1]="UploadProgress",i[i.ResponseHeader=2]="ResponseHeader",i[i.DownloadProgress=3]="DownloadProgress",i[i.Response=4]="Response",i[i.User=5]="User",i}(pl||{}),p_=class{constructor(e,r=200,t="OK"){this.headers=e.headers||new Qn,this.status=e.status!==void 0?e.status:r,this.statusText=e.statusText||t,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}},Jb=class i extends p_{constructor(e={}){super(e),this.type=pl.ResponseHeader}clone(e={}){return new i({headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},cc=class i extends p_{constructor(e={}){super(e),this.type=pl.Response,this.body=e.body!==void 0?e.body:null}clone(e={}){return new i({body:e.body!==void 0?e.body:this.body,headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},uu=class extends p_{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}};function pT(i,e){return{body:e,headers:i.headers,context:i.context,observe:i.observe,params:i.params,reportProgress:i.reportProgress,responseType:i.responseType,withCredentials:i.withCredentials,transferCache:i.transferCache}}var ln=(()=>{let e=class e{constructor(t){this.handler=t}request(t,o,n={}){let d;if(t instanceof Yd)d=t;else{let M;n.headers instanceof Qn?M=n.headers:M=new Qn(n.headers);let j;n.params&&(n.params instanceof os?j=n.params:j=new os({fromObject:n.params})),d=new Yd(t,o,n.body!==void 0?n.body:null,{headers:M,context:n.context,params:j,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials,transferCache:n.transferCache})}let _=Bt(d).pipe(Xl(M=>this.handler.handle(M)));if(t instanceof Yd||n.observe==="events")return _;let C=_.pipe(dn(M=>M instanceof cc));switch(n.observe||"body"){case"body":switch(d.responseType){case"arraybuffer":return C.pipe(ei(M=>
1325{if(M.body!==null&&!(M.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return M.body}));case"blob":return C.pipe(ei(M=>{if(M.body!==null&&!(M.body instanceof Blob))throw new Error("Response is not a Blob.");return M.body}));case"text":return C.pipe(ei(M=>{if(M.body!==null&&typeof M.body!="string")throw new Error("Response is not a string.");return M.body}));case"json":default:return C.pipe(ei(M=>M.body))}case"response":return C;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,o={}){return this.request("DELETE",t,o)}get(t,o={}){return this.request("GET",t,o)}head(t,o={}){return this.request("HEAD",t,o)}jsonp(t,o){return this.request("JSONP",t,{params:new os().append(o,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,o={}){return this.request("OPTIONS",t,o)}patch(t,o,n={}){return this.request("PATCH",t,pT(n,o))}post(t,o,n={}){return this.request("POST",t,pT(n,o))}put(t,o,n={}){return this.request("PUT",t,pT(n,o))}};e.\u0275fac=function(o){return new(o||e)(Ve(d_))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})(),uG=/^\)\]\}',?\n/,dG="X-Request-URL";function yL(i){if(i.url)return i.url;let e=dG.toLocaleLowerCase();return i.headers.get(e)}var fT=(()=>{let e=class e{constructor(){this.fetchImpl=_t(_T,{optional:!0})?.fetch??fetch.bind(globalThis),this.ngZone=_t(qt)}handle(t){return new gi(o=>{let n=new AbortController;return this.doRequest(t,n.signal,o).then(vT,d=>o.error(new uu({error:d}))),()=>n.abort()})}doRequest(t,o,n){return dp(this,null,function*(){let d=this.createRequestInit(t),_;try{let Ee=this.fetchImpl(t.urlWithParams,bt({signal:o},d));hG(Ee),n.next({type:pl.Sent}),_=yield Ee}catch(Ee){n.error(new uu({error:Ee,status:Ee.status??0,statusText:Ee.statusText,url:t.urlWithParams,headers:Ee.headers}));return}let C=new Qn(_.headers),M=_.statusText,j=yL(_)??t.urlWithParams,G=_.status,ie=null;if(t.reportProgress&&n.next(new Jb({headers:C,status:G,statusText:M,url:j})),_.body){let Ee=_.headers.get("content-length"),Ye=[],$e=_.body.getReader(),at=0,Lt,jt,$t=typeof Zone<"u"&&Zone.current;yield this.ngZone.runOutsideAngular(()=>dp(this,null,function*(){for(;;){let{done:Fi,value:tt}=yield $e.read();if(Fi)break;if(Ye.push(tt),at+=tt.length,t.reportProgress){jt=t.responseType==="text"?(jt??"")+(Lt??=new TextDecoder).decode(tt,{stream:!0}):void 0;let Sr=()=>n.next({type:pl.DownloadProgress,total:Ee?+Ee:void 0,loaded:at,partialText:jt});$t?$t.run(Sr):Sr()}}}));let tn=this.concatChunks(Ye,at);try{let Fi=_.headers.get("Content-Type")??"";ie=this.parseBody(t,tn,Fi)}catch(Fi){n.error(new uu({error:Fi,headers:new Qn(_.headers),status:_.status,statusText:_.statusText,url:yL(_)??t.urlWithParams}));return}}G===0&&(G=ie?200:0),G>=200&&G<300?(n.next(new cc({body:ie,headers:C,status:G,statusText:M,url:j})),n.complete()):n.error(new uu({error:ie,headers:C,status:G,statusText:M,url:j}))})}parseBody(t,o,n){switch(t.responseType){case"json":let d=new TextDecoder().decode(o).replace(uG,"");return d===""?null:JSON.parse(d);case"text":return new TextDecoder().decode(o);case"blob":return new Blob([o],{type:n});case"arraybuffer":return o.buffer}}createRequestInit(t){let o={},n=t.withCredentials?"include":void 0;if(t.headers.forEach((d,_)=>o[d]=_.join(",")),o.Accept??="application/json, text/plain, */*",!o["Content-Type"]){let d=t.detectContentTypeHeader();d!==null&&(o["Content-Type"]=d)}return{body:t.serializeBody(),method:t.method,headers:o,credentials:n}}concatChunks(t,o){let n=new Uint8Array(o),d=0;for(let _ of t)n.set(_,d),d+=_.length;return n}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})(),_T=class{};function vT(){}function hG(i){i.then(vT,vT)}function pG(i,e){return e(i)}function fG(i,e,r){return(t,o)=>ll(r,()=>e(t,n=>i(n,o)))}var yT=new Ct(""),DL=new Ct(""),ML=new Ct("");var bL=(()=>{let e=class e extends d_{constructor(t,o){super(),this.backend=t,this.injector=o,this.chain=null,this.pendingTasks=_t(ef);let n=_t(ML,{optional:!0});this.backend=n??t}handle(t){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(yT),...this.injector.get(DL,[])]));this.chain=n.reduceRight((d,_)=>fG(d,_,this.injector),pG)}let o=this.pendingTasks.add();return this.chain(t,n=>this.backend.handle(n)).pipe(Ad(()=>this.pendingTasks.remove(o)))}};e.\u0275fac=function(o){return new(o||e)(Ve(h_),Ve(Lo))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var mG=/^\)\]\}',?\n/;function gG(i){return"responseURL"in i&&i.responseURL?i.responseURL:/^X-Request-URL:/m.test(i.getAllResponseHeaders())?i.getResponseHeader("X-Request-URL"):null}var xL=(()=>{let e=class e{constructor(t){this.xhrFactory=t}handle(t){if(t.method==="JSONP")throw new yt(-2800,!1);let o=this.xhrFactory;return(o.\u0275loadImpl?Rn(o.\u0275loadImpl()):Bt(null)).pipe(xr(()=>new gi(d=>{let _=o.build();if(_.open(t.method,t.urlWithParams),t.withCredentials&&(_.withCredentials=!0),t.headers.forEac
1325h(($e,at)=>_.setRequestHeader($e,at.join(","))),t.headers.has("Accept")||_.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){let $e=t.detectContentTypeHeader();$e!==null&&_.setRequestHeader("Content-Type",$e)}if(t.responseType){let $e=t.responseType.toLowerCase();_.responseType=$e!=="json"?$e:"text"}let C=t.serializeBody(),M=null,j=()=>{if(M!==null)return M;let $e=_.statusText||"OK",at=new Qn(_.getAllResponseHeaders()),Lt=gG(_)||t.url;return M=new Jb({headers:at,status:_.status,statusText:$e,url:Lt}),M},G=()=>{let{headers:$e,status:at,statusText:Lt,url:jt}=j(),$t=null;at!==204&&($t=typeof _.response>"u"?_.responseText:_.response),at===0&&(at=$t?200:0);let tn=at>=200&&at<300;if(t.responseType==="json"&&typeof $t=="string"){let Fi=$t;$t=$t.replace(mG,"");try{$t=$t!==""?JSON.parse($t):null}catch(tt){$t=Fi,tn&&(tn=!1,$t={error:tt,text:$t})}}tn?(d.next(new cc({body:$t,headers:$e,status:at,statusText:Lt,url:jt||void 0})),d.complete()):d.error(new uu({error:$t,headers:$e,status:at,statusText:Lt,url:jt||void 0}))},ie=$e=>{let{url:at}=j(),Lt=new uu({error:$e,status:_.status||0,statusText:_.statusText||"Unknown Error",url:at||void 0});d.error(Lt)},_e=!1,Ee=$e=>{_e||(d.next(j()),_e=!0);let at={type:pl.DownloadProgress,loaded:$e.loaded};$e.lengthComputable&&(at.total=$e.total),t.responseType==="text"&&_.responseText&&(at.partialText=_.responseText),d.next(at)},Ye=$e=>{let at={type:pl.UploadProgress,loaded:$e.loaded};$e.lengthComputable&&(at.total=$e.total),d.next(at)};return _.addEventListener("load",G),_.addEventListener("error",ie),_.addEventListener("timeout",ie),_.addEventListener("abort",ie),t.reportProgress&&(_.addEventListener("progress",Ee),C!==null&&_.upload&&_.upload.addEventListener("progress",Ye)),_.send(C),d.next({type:pl.Sent}),()=>{_.removeEventListener("error",ie),_.removeEventListener("abort",ie),_.removeEventListener("load",G),_.removeEventListener("timeout",ie),t.reportProgress&&(_.removeEventListener("progress",Ee),C!==null&&_.upload&&_.upload.removeEventListener("progress",Ye)),_.readyState!==_.DONE&&_.abort()}})))}};e.\u0275fac=function(o){return new(o||e)(Ve(nf))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})(),kL=new Ct("XSRF_ENABLED"),_G="XSRF-TOKEN",vG=new Ct("XSRF_COOKIE_NAME",{providedIn:"root",factory:()=>_G}),yG="X-XSRF-TOKEN",bG=new Ct("XSRF_HEADER_NAME",{providedIn:"root",factory:()=>yG}),ex=class{},xG=(()=>{let e=class e{constructor(t,o,n){this.doc=t,this.platform=o,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if(this.platform==="server")return null;let t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=Kb(t,this.cookieName),this.lastCookieString=t),this.lastToken}};e.\u0275fac=function(o){return new(o||e)(Ve($i),Ve(Qt),Ve(vG))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();function wG(i,e){let r=i.url.toLowerCase();if(!_t(kL)||i.method==="GET"||i.method==="HEAD"||r.startsWith("http://")||r.startsWith("https://"))return e(i);let t=_t(ex).getToken(),o=_t(bG);return t!=null&&!i.headers.has(o)&&(i=i.clone({headers:i.headers.set(o,t)})),e(i)}var bT=function(i){return i[i.Interceptors=0]="Interceptors",i[i.LegacyInterceptors=1]="LegacyInterceptors",i[i.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",i[i.NoXsrfProtection=3]="NoXsrfProtection",i[i.JsonpSupport=4]="JsonpSupport",i[i.RequestsMadeViaParent=5]="RequestsMadeViaParent",i[i.Fetch=6]="Fetch",i}(bT||{});function AL(i,e){return{\u0275kind:i,\u0275providers:e}}function PL(...i){let e=[ln,xL,bL,{provide:d_,useExisting:bL},{provide:h_,useExisting:xL},{provide:yT,useValue:wG,multi:!0},{provide:kL,useValue:!0},{provide:ex,useClass:xG}];for(let r of i)e.push(...r.\u0275providers);return au(e)}function OL(i){return AL(bT.Interceptors,i.map(e=>({provide:yT,useValue:e,multi:!0})))}function RL(){return AL(bT.Fetch,[fT,{provide:h_,useExisting:fT},{provide:ML,useExisting:fT}])}var wL="b",CL="h",EL="s",SL="st",TL="u",IL="rt",Qb=new Ct(""),CG=["GET","HEAD"];function EG(i,e){let j=_t(Qb),{isCacheActive:r}=j,t=C2(j,["isCacheActive"]),{transferCache:o,method:n}=i;
1325if(!r||n==="POST"&&!t.includePostRequests&&!o||n!=="POST"&&!CG.includes(n)||o===!1||t.filter?.(i)===!1)return e(i);let d=_t(Gd),_=TG(i),C=d.get(_,null),M=t.includeHeaders;if(typeof o=="object"&&o.includeHeaders&&(M=o.includeHeaders),C){let{[wL]:G,[IL]:ie,[CL]:_e,[EL]:Ee,[SL]:Ye,[TL]:$e}=C,at=G;switch(ie){case"arraybuffer":at=new TextEncoder().encode(G).buffer;break;case"blob":at=new Blob([G]);break}let Lt=new Qn(_e);return Bt(new cc({body:at,headers:Lt,status:Ee,statusText:Ye,url:$e}))}return e(i).pipe(Vi(G=>{G instanceof cc&&d.set(_,{[wL]:G.body,[CL]:SG(G.headers,M),[EL]:G.status,[SL]:G.statusText,[TL]:G.url||"",[IL]:i.responseType})}))}function SG(i,e){if(!e)return{};let r={};for(let t of e){let o=i.getAll(t);o!==null&&(r[t]=o)}return r}function TG(i){let{params:e,method:r,responseType:t,url:o}=i,n=e.keys().sort().map(C=>`${C}=${e.getAll(C)}`).join("&"),d=r+"."+t+"."+o+"?"+n,_=IG(d);return _}function IG(i){let e=0;for(let r of i)e=Math.imul(31,e)+r.charCodeAt(0)<<0;return e+=2147483647+1,e.toString()}function LL(i){return[{provide:Qb,useFactory:()=>(qd("NgHttpTransferCache"),bt({isCacheActive:!0},i))},{provide:DL,useValue:EG,multi:!0,deps:[Gd,Qb]},{provide:Xd,multi:!0,useFactory:()=>{let e=_t(ul),r=_t(Qb);return()=>{YS(e).then(()=>{r.isCacheActive=!1})}}}]}var CT=class extends Gb{constructor(){super(...arguments),this.supportsDOMEvents=!0}},ET=class i extends CT{static makeCurrent(){rL(new i)}onAndCancel(e,r,t){return e.addEventListener(r,t),()=>{e.removeEventListener(r,t)}}dispatchEvent(e,r){e.dispatchEvent(r)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,r){return r=r||this.getDefaultDocument(),r.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,r){return r==="window"?window:r==="document"?e:r==="body"?e.body:null}getBaseHref(e){let r=DG();return r==null?null:MG(r)}resetBaseElement(){f_=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Kb(document.cookie,e)}},f_=null;function DG(){return f_=f_||document.querySelector("base"),f_?f_.getAttribute("href"):null}function MG(i){return new URL(i,document.baseURI).pathname}var kG=(()=>{let e=class e{build(){return new XMLHttpRequest}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i}
1325)(),ST=new Ct("EventManagerPlugins"),zL=(()=>{let e=class e{constructor(t,o){this._zone=o,this._eventNameToPlugin=new Map,t.forEach(n=>{n.manager=this}),this._plugins=t.slice().reverse()}addEventListener(t,o,n){return this._findPluginFor(o).addEventListener(t,o,n)}getZone(){return this._zone}_findPluginFor(t){let o=this._eventNameToPlugin.get(t);if(o)return o;if(o=this._plugins.find(d=>d.supports(t)),!o)throw new yt(5101,!1);return this._eventNameToPlugin.set(t,o),o}};e.\u0275fac=function(o){return new(o||e)(Ve(ST),Ve(qt))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})(),tx=class{constructor(e){this._doc=e}},xT="ng-app-id",jL=(()=>{let e=class e{constructor(t,o,n,d={}){this.doc=t,this.appId=o,this.nonce=n,this.platformId=d,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=u_(d),this.resetHostNodes()}addStyles(t){for(let o of t)this.changeUsageCount(o,1)===1&&this.onStyleAdded(o)}removeStyles(t){for(let o of t)this.changeUsageCount(o,-1)<=0&&this.onStyleRemoved(o)}ngOnDestroy(){let t=this.styleNodesInDOM;t&&(t.forEach(o=>o.remove()),t.clear());for(let o of this.getAllStyles())this.onStyleRemoved(o);this.resetHostNodes()}addHost(t){this.hostNodes.add(t);for(let o of this.getAllStyles())this.addStyleToHost(t,o)}removeHost(t){this.hostNodes.delete(t)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(t){for(let o of this.hostNodes)this.addStyleToHost(o,t)}onStyleRemoved(t){let o=this.styleRef;o.get(t)?.elements?.forEach(n=>n.remove()),o.delete(t)}collectServerRenderedStyles(){let t=this.doc.head?.querySelectorAll(`style[${xT}="${this.appId}"]`);if(t?.length){let o=new Map;return t.forEach(n=>{n.textContent!=null&&o.set(n.textContent,n)}),o}return null}changeUsageCount(t,o){let n=this.styleRef;if(n.has(t)){let d=n.get(t);return d.usage+=o,d.usage}return n.set(t,{usage:o,elements:[]}),o}getStyleElement(t,o){let n=this.styleNodesInDOM,d=n?.get(o);if(d?.parentNode===t)return n.delete(o),d.removeAttribute(xT),d;{let _=this.doc.createElement("style");return this.nonce&&_.setAttribute("nonce",this.nonce),_.textContent=o,this.platformIsServer&&_.setAttribute(xT,this.appId),t.appendChild(_),_}}addStyleToHost(t,o){let n=this.getStyleElement(t,o),d=this.styleRef,_=d.get(o)?.elements;_?_.push(n):d.set(o,{elements:[n],usage:1})}resetHostNodes(){let t=this.hostNodes;t.clear(),t.add(this.doc.head)}};e.\u0275fac=function(o){return new(o||e)(Ve($i),Ve(Yg),Ve(Qg,8),Ve(Qt))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})(),wT={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/"},IT=/%COMP%/g,VL="%COMP%",AG=`_nghost-${VL}`,PG=`_ngcontent-${VL}`,OG=!0,RG=new Ct("RemoveStylesOnCompDestroy",{providedIn:"root",factory:()=>OG});function LG(i){return PG.replace(IT,i)}function FG(i){return AG.replace(IT,i)}function BL(i,e){return e.map(r=>r.replace(IT,i))}var ix=(()=>{let e=class e{constructor(t,o,n,d,_,C,M,j=null){this.eventManager=t,this.sharedStylesHost=o,this.appId=n,this.removeStylesOnCompDestroy=d,this.doc=_,this.platformId=C,this.ngZone=M,this.nonce=j,this.rendererByCompId=new Map,this.platformIsServer=u_(C),this.defaultRenderer=new m_(t,_,M,this.platformIsServer)}createRenderer(t,o){if(!t||!o)return this.defaultRenderer;this.platformIsServer&&o.encapsulation===nl.ShadowDom&&(o=en(bt({},o),{encapsulation:nl.Emulated}));let n=this.getOrCreateRenderer(t,o);return n instanceof nx?n.applyToHost(t):n instanceof g_&&n.applyStyles(),n}getOrCreateRenderer(t,o){let n=this.rendererByCompId,d=n.get(o.id);if(!d){let _=this.doc,C=this.ngZone,M=this.eventManager,j=this.sharedStylesHost,G=this.removeStylesOnCompDestroy,ie=this.platformIsServer;switch(o.encapsulation){case nl.Emulated:d=new nx(M,j,o,this.appId,G,_,C,ie);break;case nl.ShadowDom:return new TT(M,j,t,o,_,C,this.nonce,ie);default:d=new g_(M,j,o,G,_,C,ie);break}n.set(o.id,d)}return d}ngOnDestroy(){this.rendererByCompId.clear()}};e.\u0275fac=function(o){return new(o||e)(Ve(zL),Ve(jL),Ve(Yg),Ve(RG),Ve($i),Ve(Qt),Ve(qt),Ve(Qg))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})(),m_=class{constructor(e,r,t,o){this.eventManager=e,this.doc=r,this.ngZone=t,this.platformIsServer=o,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(e,r){return r?this.doc.createElementNS(wT[r]||r,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,r){(FL(e)?e.content:e).appendChild(r)}insertBefore(e,r,t){e&&(FL(e)?e.content:e).insertBefore(r,t)}removeChild(e,r){e&&e.removeChild(r)}selectRootElement(e,r){let t=typeof e=="string"?this.doc.querySelector(e):e;if(!t)throw new yt(-5104,!1);return r||(t.textContent=""),t}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,r,t,o){if(o){r=o+":"+r;let n=wT[o];n?e.setAttributeNS(n,r,t):e.setAttribute(r,t)}else e.setAttribute(r,t)}removeAttribute(e,r,t){if(t){let o=wT[t];o?e.removeAttributeNS(o,r):e.removeAttribute(`${t}:${r}`)}else e.removeAttribute(r)}addClass(e,r){e.classList.add(r)}removeClass(e,r){e.classList.remove(r)}setStyle(e,r,t,o){o&(ol.DashCase|ol.Important)?e.style.setProperty(r,t,o&ol.Important?"important":""):e.style[r]=t}removeStyle(e,r,t){t&ol.DashCase?e.style.removeProperty(r):e.style[r]=""}setProperty(e,r,t){e!=null&&(e[r]=t)}setValue(e,r){e.nodeValue=r}listen(e,r,t){if(typeof e=="string"&&(e=dl().getGlobalEventTarget(this.doc,e),!e))throw new Error(`Unsupported event target ${e} for event ${r}`);return this.eventManager.addEventListener(e,r,this.decoratePreventDefault(t))}decoratePreventDefault(e){return r=>{if(r==="__ngUnwrap__")return e;(this.platformIsServer?this.ngZone.runGuarded(()=>e(r)):e(r))===!1&&r.preventDefault()}}};function FL(i){return i.tagName==="TEMPLATE"&&i.content!==void 0}var TT=class extends m_{constructor(e,r,t,o,n,d,_,C){super(e,n,d,C),this.sharedStylesHost=r,this.hostEl=t,this.shadowRoot=t.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let M=BL(o.id,o.styles);for(let j of M){let G=document.createElement("style");_&&G.setAttribute("nonce",_),G.textContent=j,this.shadowRoot.appendChild(G)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,r){return super.appendChild(this.nodeOrShadowRoot(e),r)}insertBefore(e,r,t){return super.insertBefore(this.nodeOrShadowRoot(e),r,t)}removeChild(e,r){return super.removeChild(this.nodeOrShadowRoot(e),r)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},g_=class extends m_{constructor(e,r,t,o,n,d,_,C){super(e,n,d,_),this.sharedStylesHost=r,this.removeStylesOnCompDestroy=o,this.styles=C?BL(C,t.styles):t.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}},nx=class extends g_{constructor(e,r,t,o,n,d,_,C){let M=o+"-"+t.id;super(e,r,t,n,d,_,C,M),this.contentAttr=LG(M),this.hostAttr=FG(M)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,r){let t=super.createElement(e,r);return super.setAttribute(t,this.contentAttr,""),t}},NG=(()=>{let e=class e extends tx{constructor(t){super(t)}supports(t){return!0}addEventListener(t,o,n){return t.addEventListener(o,n,!1),()=>this.removeEventListener(t,o,n)}removeEventListener(t,o,n){return t.removeEventListener(o,n)}};e.\u0275fac=function(o){return new(o||e)(Ve($i))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})(),NL=["alt","control","meta","shift"],zG={"\b":"Backspace","	":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},jG={alt:i=>i.altKey,control:i=>i.ctrlKey,meta:i=>i.metaKey,shift:i=>i.shiftKey},VG=(()=>{let e=class e extends tx{constructor(t){super(t)}supports(t){return e.parseEventName(t)!=null}addEventListener(t,o,n){let d=e.parseEventName(o),_=e.eventCallback(d.fullKey,n,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>dl().onAndCancel(t,d.domEventName,_))}static parseEventName(t){let o=t.toLowerCase().split("."),n=o.shift();if(o.length===0||!(n==="keydown"||n==="keyup"))return null;let d=e._normalizeKey(o.pop()),_="",C=o.indexOf("code");if(C>-1&&(o.splice(C,1),_="code."),NL.forEach(j=>{let G=o.indexOf(j);G>-1&&(o.splice(G,1),_+=j+".")}),_+=d,o.length!=0||d.length===0)return null;let M={};return M.domEventName=n,M.fullKey=_,M}static matchEventFullKeyCode(t,o){let n=zG[t.key]||t.key,d="";return o.indexOf("code.")>-1&&(n=t.code,d="code."),n==null||!n?!1:(n=n.toLowerCase(),n===" "?n="space":n==="."&&(n="dot"),NL.forEach(_=>{if(_!==n){let C=jG[_];C(t)&&(d+=_+".")}}),d+=n,d===o)}static eventCallback(t,o,n){return d=>{e.matchEventFullKeyCode(d,t)&&n.runGuarded(()=>o(d))}}static _normalizeKey(t){return t==="esc"?"escape":t}};e.\u0275fac=function(o){return new(o||e)(Ve($i))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();function UL(i,e){return ZR(bt({rootComponent:i},BG(e)))}function BG(i){return{appProviders:[...qG,...i?.providers??[]],platformProviders:GG}}function UG(){ET.makeCurrent()}function HG(){return new sl}function $G(){return nO(document),document}var GG=[{provide:Qt,useValue:hT},{provide:xS,useValue:UG,multi:!0},{provide:$i,useFactory:$G,deps:[]}];var qG=[{provide:_b,useValue:"root"},{provide:sl,useFactory:HG,deps:[]},{provide:ST,useClass:NG,multi:!0,deps:[$i,qt,Qt]},{provide:ST,useClass:VG,multi:!0,deps:[$i]},ix,jL,zL,{provide:Vd,useExisting:ix},{provide:nf,useClass:kG,deps:[]},[]];function WG(){return new Qd(Ve($i))}var Qd=(()=>{let e=class e{constructor(t){this._doc=t,this._dom=dl()}addTag(t,o=!1){return t?this._getOrCreateElement(t,o):null}addTags(t,o=!1){return t?t.reduce((n,d)=>(d&&n.push(this._getOrCreateElement(d,o)),n),[]):[]}getTag(t){return t&&this._doc.querySelector(`meta[${t}]`)||null}getTags(t){if(!t)return[];let o=this._doc.querySelectorAll(`meta[${t}]`);return o?[].slice.call(o):[]}updateTag(t,o){if(!t)return null;o=o||this._parseSelector(t);let n=this.getTag(o);return n?this._setMetaElementAttributes(t,n):this._getOrCreateElement(t,!0)}removeTag(t){this.removeTagElement(this.getTag(t))}removeTagElement(t){t&&this._dom.remove(t)}_getOrCreateElement(t,o=!1){if(!o){let _=this._parseSelector(t),C=this.getTags(_).filter(M=>this._containsAttributes(t,M))[0];if(C!==void 0)return C}let n=this._dom.createElement("meta");return this._setMetaElementAttributes(t,n),this._doc.getElementsByTagName("head")[0].appendChild(n),n}_setMetaElementAttributes(t,o){return Object.keys(t).forEach(n=>o.setAttribute(this._getMetaKeyMap(n),t[n])),o}_parseSelector(t){let o=t.name?"name":"property";return`${o}="${t[o]}"`}_containsAttributes(t,o){return Object.keys(t).every(n=>o.getAttribute(this._getMetaKeyMap(n))===t[n])}_getMetaKeyMap(t){return ZG[t]||t}};e.\u0275fac=function(o){return new(o||e)(Ve($i))},e.\u0275prov=Qe({token:e,factory:function(o){let n=null;return o?n=new o:n=WG(),n},providedIn:"root"});let i=e;return i})(),ZG={httpEquiv:"http-equiv"};function KG(){return new uc(Ve($i))}var uc=(()=>{let e=class e{constructor(t){this._doc=t}getTitle(){return this._doc.title}setTitle(t){this._doc.title=t||""}};e.\u0275fac=function(o){return new(o||e)(Ve($i))},e.\u0275prov=Qe({token:e,factory:function(o){let n=null;return o?n=new o:n=KG(),n},providedIn:"root"});let i=e;return i})();var __=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:function(o){let n=null;return o?n=new(o||e):n=Ve(HL),n},providedIn:"root"});let i=e;return i})();
1325function XG(i){return new HL(i.get($i))}var HL=(()=>{let e=class e extends __{constructor(t){super(),this._doc=t}sanitize(t,o){if(o==null)return null;switch(t){case Aa.NONE:return o;case Aa.HTML:return ic(o,"HTML")?bs(o):DS(this._doc,String(o)).toString();case Aa.STYLE:return ic(o,"Style")?bs(o):o;case Aa.SCRIPT:if(ic(o,"Script"))return bs(o);throw new yt(5200,!1);case Aa.URL:return ic(o,"URL")?bs(o):bb(String(o));case Aa.RESOURCE_URL:if(ic(o,"ResourceURL"))return bs(o);throw new yt(5201,!1);default:throw new yt(5202,!1)}}bypassSecurityTrustHtml(t){return EO(t)}bypassSecurityTrustStyle(t){return SO(t)}bypassSecurityTrustScript(t){return TO(t)}bypassSecurityTrustUrl(t){return IO(t)}bypassSecurityTrustResourceUrl(t){return DO(t)}};e.\u0275fac=function(o){return new(o||e)(Ve($i))},e.\u0275prov=Qe({token:e,factory:function(o){let n=null;return o?n=new o:n=XG(Ve(is)),n},providedIn:"root"});let i=e;return i})();function $L(...i){let e=[],r=new Set,t=r.has(1);for(let{\u0275providers:o,\u0275kind:n}of i)r.add(n),o.length&&e.push(o);return au([[],KR(),r.has(0)||t?[]:LL({}),e])}var ji="primary",O_=Symbol("RouteTitle"),PT=class{constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){let r=this.params[e];return Array.isArray(r)?r[0]:r}return null}getAll(e){if(this.has(e)){let r=this.params[e];return Array.isArray(r)?r:[r]}return[]}get keys(){return Object.keys(this.params)}};function uf(i){return new PT(i)}function YG(i,e,r){let t=r.path.split("/");if(t.length>i.length||r.pathMatch==="full"&&(e.hasChildren()||t.length<i.length))return null;let o={};for(let n=0;n<t.length;n++){let d=t[n],_=i[n];if(d.startsWith(":"))o[d.substring(1)]=_;else if(d!==_.path)return null}return{consumed:i.slice(0,t.length),posParams:o}}function QG(i,e){if(i.length!==e.length)return!1;for(let r=0;r<i.length;++r)if(!fl(i[r],e[r]))return!1;return!0}function fl(i,e){let r=i?OT(i):void 0,t=e?OT(e):void 0;if(!r||!t||r.length!=t.length)return!1;let o;for(let n=0;n<r.length;n++)if(o=r[n],!JL(i[o],e[o]))return!1;return!0}function OT(i){return[...Object.keys(i),...Object.getOwnPropertySymbols(i)]}function JL(i,e){if(Array.isArray(i)&&Array.isArray(e)){if(i.length!==e.length)return!1;let r=[...i].sort(),t=[...e].sort();return r.every((o,n)=>t[n]===o)}else return i===e}function eF(i){return i.length>0?i[i.length-1]:null}function fu(i){return my(i)?i:Wd(i)?Rn(Promise.resolve(i)):Bt(i)}var JG={exact:iF,subset:nF},tF={exact:e7,subset:t7,ignored:()=>!0};function GL(i,e,r){return JG[r.paths](i.root,e.root,r.matrixParams)&&tF[r.queryParams](i.queryParams,e.queryParams)&&!(r.fragment==="exact"&&i.fragment!==e.fragment)}function e7(i,e){return fl(i,e)}function iF(i,e,r){if(!eh(i.segments,e.segments)||!sx(i.segments,e.segments,r)||i.numberOfChildren!==e.numberOfChildren)return!1;for(let t in e.children)if(!i.children[t]||!iF(i.children[t],e.children[t],r))return!1;return!0}function t7(i,e){return Object.keys(e).length<=Object.keys(i).length&&Object.keys(e).every(r=>JL(i[r],e[r]))}function nF(i,e,r){return rF(i,e,e.segments,r)}function rF(i,e,r,t){if(i.segments.length>r.length){let o=i.segments.slice(0,r.length);return!(!eh(o,r)||e.hasChildren()||!sx(o,r,t))}else if(i.segments.length===r.length){if(!eh(i.segments,r)||!sx(i.segments,r,t))return!1;for(let o in e.children)if(!i.children[o]||!nF(i.children[o],e.children[o],t))return!1;return!0}else{let o=r.slice(0,i.segments.length),n=r.slice(i.segments.length);return!eh(i.segments,o)||!sx(i.segments,o,t)||!i.children[ji]?!1:rF(i.children[ji],e,n,t)}}function sx(i,e,r){return e.every((t,o)=>tF[r](i[o].parameters,t.parameters))}var du=class{constructor(e=new An([],{}),r={},t=null){this.root=e,this.queryParams=r,this.fragment=t}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=uf(this.queryParams)),this._queryParamMap}toString(){return r7.serialize(this)}},An=class{constructor(e,r){this.segments=e,this.children=r,this.parent=null,Object.values(r).forEach(t=>t.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return ax(this)}},Jd=class{constructor(e,r){this.path=e,this.parameters=r}get parameterMap(){return this._parameterMap||(this._parameterMap=uf(this.parameters)),this._parameterMap}toString(){return sF(this)}};function i7(i,e){return eh(i,e)&&i.every((r,t)=>fl(r.parameters,e[t].parameters))}function eh(i,e){return i.length!==e.length?!1:i.every((r,t)=>r.path===e[t].path)}function n7(i,e){let r=[];
1325return Object.entries(i.children).forEach(([t,o])=>{t===ji&&(r=r.concat(e(o,t)))}),Object.entries(i.children).forEach(([t,o])=>{t!==ji&&(r=r.concat(e(o,t)))}),r}var R_=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:()=>(()=>new E_)(),providedIn:"root"});let i=e;return i})(),E_=class{parse(e){let r=new LT(e);return new du(r.parseRootSegment(),r.parseQueryParams(),r.parseFragment())}serialize(e){let r=`/${v_(e.root,!0)}`,t=a7(e.queryParams),o=typeof e.fragment=="string"?`#${o7(e.fragment)}`:"";return`${r}${t}${o}`}},r7=new E_;function ax(i){return i.segments.map(e=>sF(e)).join("/")}function v_(i,e){if(!i.hasChildren())return ax(i);if(e){let r=i.children[ji]?v_(i.children[ji],!1):"",t=[];return Object.entries(i.children).forEach(([o,n])=>{o!==ji&&t.push(`${o}:${v_(n,!1)}`)}),t.length>0?`${r}(${t.join("//")})`:r}else{let r=n7(i,(t,o)=>o===ji?[v_(i.children[ji],!1)]:[`${o}:${v_(t,!1)}`]);return Object.keys(i.children).length===1&&i.children[ji]!=null?`${ax(i)}/${r[0]}`:`${ax(i)}/(${r.join("//")})`}}function oF(i){return encodeURIComponent(i).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function rx(i){return oF(i).replace(/%3B/gi,";")}function o7(i){return encodeURI(i)}function RT(i){return oF(i).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function lx(i){return decodeURIComponent(i)}function qL(i){return lx(i.replace(/\+/g,"%20"))}function sF(i){return`${RT(i.path)}${s7(i.parameters)}`}function s7(i){return Object.keys(i).map(e=>`;${RT(e)}=${RT(i[e])}`).join("")}function a7(i){let e=Object.keys(i).map(r=>{let t=i[r];return Array.isArray(t)?t.map(o=>`${rx(r)}=${rx(o)}`).join("&"):`${rx(r)}=${rx(t)}`}).filter(r=>!!r);return e.length?`?${e.join("&")}`:""}var l7=/^[^\/()?;#]+/;function DT(i){let e=i.match(l7);return e?e[0]:""}var c7=/^[^\/()?;=#]+/;function u7(i){let e=i.match(c7);return e?e[0]:""}var d7=/^[^=?&#]+/;function h7(i){let e=i.match(d7);return e?e[0]:""}var p7=/^[^&#]+/;function f7(i){let e=i.match(p7);return e?e[0]:""}var LT=class{constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),this.remaining===""||this.peekStartsWith("?")||this.peekStartsWith("#")?new An([],{}):new An([],this.parseChildren())}parseQueryParams(){let e={};if(this.consumeOptional("?"))do this.parseQueryParam(e);while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(this.remaining==="")return{};this.consumeOptional("/");let e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let r={};this.peekStartsWith("/(")&&(this.capture("/"),r=this.parseParens(!0));let t={};return this.peekStartsWith("(")&&(t=this.parseParens(!1)),(e.length>0||Object.keys(r).length>0)&&(t[ji]=new An(e,r)),t}parseSegment(){let e=DT(this.remaining);if(e===""&&this.peekStartsWith(";"))throw new yt(4009,!1);return this.capture(e),new Jd(lx(e),this.parseMatrixParams())}parseMatrixParams(){let e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){let r=u7(this.remaining);if(!r)return;this.capture(r);let t="";if(this.consumeOptional("=")){let o=DT(this.remaining);o&&(t=o,this.capture(t))}e[lx(r)]=lx(t)}parseQueryParam(e){let r=h7(this.remaining);if(!r)return;this.capture(r);let t="";if(this.consumeOptional("=")){let d=f7(this.remaining);d&&(t=d,this.capture(t))}let o=qL(r),n=qL(t);if(e.hasOwnProperty(o)){let d=e[o];Array.isArray(d)||(d=[d],e[o]=d),d.push(n)}else e[o]=n}parseParens(e){let r={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){let t=DT(this.remaining),o=this.remaining[t.length];if(o!=="/"&&o!==")"&&o!==";")throw new yt(4010,!1);let n;t.indexOf(":")>-1?(n=t.slice(0,t.indexOf(":")),this.capture(n),this.capture(":")):e&&(n=ji);let d=this.parseChildren();r[n]=Object.keys(d).length===1?d[ji]:new An([],d),this.consumeOptional("//")}return r}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return this.peekStartsWith(e)?(this.remaining=this.remaining.substring(e.length),!0):!1}capture(e){if(!this.consumeOptional(e))throw new yt(4011,!1)}};function aF(i){return i.segments.length>0?new An([],{[ji]:i}):i}function lF(i){let e={};for(let t of Object.keys(i.children)){let o=i.children[t],n=lF(o);if(t===ji&&n.segments.length===0&&n.hasChildren())for(let[d,_]of Object.entries(n.children))e[d]=_;else(n.segments.length>0||n.hasChildren())&&(e[t]=n)}let r=new An(i.segments,e);return m7(r)}function m7(i){if(i.numberOfChildren===1&&i.children[ji]){let e=i.children[ji];return new An(i.segments.concat(e.segments),e.children)}return i}function df(i){return i instanceof du}function g7(i,e,r=null,t=null){let o=cF(i);return uF(o,e,r,t)}function cF(i){let e;function r(n){let d={};for(let C of n.children){let M=r(C);d[C.outlet]=M}let _=new An(n.url,d);return n===i&&(e=_),_}let t=r(i.root),o=aF(t);return e??o}function uF(i,e,r,t){let o=i;for(;o.parent;)o=o.parent;if(e.length===0)return MT(o,o,o,r,t);let n=_7(e);if(n.toRoot())return MT(o,o,new An([],{}),r,t);let d=v7(n,o,i),_=d.processChildren?x_(d.segmentGroup,d.index,n.commands):hF(d.segmentGroup,d.index,n.commands);return MT(o,d.segmentGroup,_,r,t)}function cx(i){return typeof i=="object"&&i!=null&&!i.outlets&&!i.segmentPath}function S_(i){return typeof i=="object"&&i!=null&&i.outlets}function MT(i,e,r,t,o){let n={};t&&Object.entries(t).forEach(([C,M])=>{n[C]=Array.isArray(M)?M.map(j=>`${j}`):`${M}`});let d;i===e?d=r:d=dF(i,e,r);let _=aF(lF(d));return new du(_,n,o)}function dF(i,e,r){let t={};
vendor: 7,496 bytes, line 1325
1325return Object.entries(i.children).forEach(([o,n])=>{n===e?t[o]=r:t[o]=dF(n,e,r)}),new An(i.segments,t)}var ux=class{constructor(e,r,t){if(this.isAbsolute=e,this.numberOfDoubleDots=r,this.commands=t,e&&t.length>0&&cx(t[0]))throw new yt(4003,!1);let o=t.find(S_);if(o&&o!==eF(t))throw new yt(4004,!1)}toRoot(){return this.isAbsolute&&this.commands.length===1&&this.commands[0]=="/"}};function _7(i){if(typeof i[0]=="string"&&i.length===1&&i[0]==="/")return new ux(!0,0,i);let e=0,r=!1,t=i.reduce((o,n,d)=>{if(typeof n=="object"&&n!=null){if(n.outlets){let _={};return Object.entries(n.outlets).forEach(([C,M])=>{_[C]=typeof M=="string"?M.split("/"):M}),[...o,{outlets:_}]}if(n.segmentPath)return[...o,n.segmentPath]}return typeof n!="string"?[...o,n]:d===0?(n.split("/").forEach((_,C)=>{C==0&&_==="."||(C==0&&_===""?r=!0:_===".."?e++:_!=""&&o.push(_))}),o):[...o,n]},[]);return new ux(r,e,t)}var lf=class{constructor(e,r,t){this.segmentGroup=e,this.processChildren=r,this.index=t}};function v7(i,e,r){if(i.isAbsolute)return new lf(e,!0,0);if(!r)return new lf(e,!1,NaN);if(r.parent===null)return new lf(r,!0,0);let t=cx(i.commands[0])?0:1,o=r.segments.length-1+t;return y7(r,o,i.numberOfDoubleDots)}function y7(i,e,r){let t=i,o=e,n=r;for(;n>o;){if(n-=o,t=t.parent,!t)throw new yt(4005,!1);o=t.segments.length}return new lf(t,!1,o-n)}function b7(i){return S_(i[0])?i[0].outlets:{[ji]:i}}function hF(i,e,r){if(i||(i=new An([],{})),i.segments.length===0&&i.hasChildren())return x_(i,e,r);let t=x7(i,e,r),o=r.slice(t.commandIndex);if(t.match&&t.pathIndex<i.segments.length){let n=new An(i.segments.slice(0,t.pathIndex),{});return n.children[ji]=new An(i.segments.slice(t.pathIndex),i.children),x_(n,0,o)}else return t.match&&o.length===0?new An(i.segments,{}):t.match&&!i.hasChildren()?FT(i,e,r):t.match?x_(i,0,o):FT(i,e,r)}function x_(i,e,r){if(r.length===0)return new An(i.segments,{});{let t=b7(r),o={};if(Object.keys(t).some(n=>n!==ji)&&i.children[ji]&&i.numberOfChildren===1&&i.children[ji].segments.length===0){let n=x_(i.children[ji],e,r);return new An(i.segments,n.children)}return Object.entries(t).forEach(([n,d])=>{typeof d=="string"&&(d=[d]),d!==null&&(o[n]=hF(i.children[n],e,d))}),Object.entries(i.children).forEach(([n,d])=>{t[n]===void 0&&(o[n]=d)}),new An(i.segments,o)}}function x7(i,e,r){let t=0,o=e,n={match:!1,pathIndex:0,commandIndex:0};for(;o<i.segments.length;){if(t>=r.length)return n;let d=i.segments[o],_=r[t];if(S_(_))break;let C=`${_}`,M=t<r.length-1?r[t+1]:null;if(o>0&&C===void 0)break;if(C&&M&&typeof M=="object"&&M.outlets===void 0){if(!ZL(C,M,d))return n;t+=2}else{if(!ZL(C,{},d))return n;t++}o++}return{match:!0,pathIndex:o,commandIndex:t}}function FT(i,e,r){let t=i.segments.slice(0,e),o=0;for(;o<r.length;){let n=r[o];if(S_(n)){let C=w7(n.outlets);return new An(t,C)}if(o===0&&cx(r[0])){let C=i.segments[e];t.push(new Jd(C.path,WL(r[0]))),o++;continue}let d=S_(n)?n.outlets[ji]:`${n}`,_=o<r.length-1?r[o+1]:null;d&&_&&cx(_)?(t.push(new Jd(d,WL(_))),o+=2):(t.push(new Jd(d,{})),o++)}return new An(t,{})}function w7(i){let e={};return Object.entries(i).forEach(([r,t])=>{typeof t=="string"&&(t=[t]),t!==null&&(e[r]=FT(new An([],{}),0,t))}),e}function WL(i){let e={};return Object.entries(i).forEach(([r,t])=>e[r]=`${t}`),e}function ZL(i,e,r){return i==r.path&&fl(e,r.parameters)}var w_="imperative",Ys=class{constructor(e,r){this.id=e,this.url=r}},hf=class extends Ys{constructor(e,r,t="imperative",o=null){super(e,r),this.type=0,this.navigationTrigger=t,this.restoredState=o}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}},zo=class extends Ys{constructor(e,r,t){super(e,r),this.urlAfterRedirects=t,this.type=1}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}},hu=class extends Ys{constructor(e,r,t,o){super(e,r),this.reason=t,this.code=o,this.type=2}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}},pu=class extends Ys{constructor(e,r,t,o){super(e,r),this.reason=t,this.code=o,this.type=16}},T_=class extends Ys{constructor(e,r,t,o){super(e,r),this.error=t,this.target=o,this.type=3}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}},pf=class extends Ys{constructor(e,r,t,o){super(e,r),this.urlAfterRedirects=t,this.state=o,this.type=4}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},NT=class extends Ys{constructor(e,r,t,o){super(e,r),this.urlAfterRedirects=t,this.state=o,this.type=7}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},zT=class extends Ys{constructor(e,r,t,o,n){super(e,r),this.urlAfterRedirects=t,this.state=o,this.shouldActivate=n,this.type=8}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}},jT=class extends Ys{constructor(e,r,t,o){super(e,r),this.urlAfterRedirects=t,this.state=o,this.type=5}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},VT=class extends Ys{constructor(e,r,t,o){super(e,r),this.urlAfterRedirects=t,this.state=o,this.type=6}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},BT=class{constructor(e){this.route=e,this.type=9}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}},UT=class{constructor(e){this.route=e,this.type=10}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}},HT=class{constructor(e){this.snapshot=e,this.type=11}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},$T=class{constructor(e){this.snapshot=e,this.type=12}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},GT=class{constructor(e){this.snapshot=e,this.type=13}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},qT=class{constructor(e){this.snapshot=e,this.type=14}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},dx=class{constructor(e,r,t){this.routerEvent=e,this.position=r,this.anchor=t,this.type=15}toString(){let e=this.position?`${this.position[0]}, ${this.position[1]}`:null;return`Scroll(anchor: '${this.anchor}', position: '${e}')`}},I_=class{},D_=class{constructor(e){this.url=e}};var WT=class{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new L_,this.attachRef=null}},L_=(()=>{let e=class e{constructor(){this.contexts=new Map}onChildOutletCreated(t,o){let n=this.getOrCreateContext(t);n.outlet=o,this.contexts.set(t,n)}onChildOutletDestroyed(t){let o=this.getContext(t);o&&(o.outlet=null,o.attachRef=null)}onOutletDeactivated(){let t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let o=this.getContext(t);return o||(o=new WT,this.contexts.set(t,o)),o}getContext(t){return this.contexts.get(t)||null}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),hx=class{constructor(e){this._root=e}get root(){return this._root.value}
1325parent(e){let r=this.pathFromRoot(e);return r.length>1?r[r.length-2]:null}children(e){let r=ZT(e,this._root);return r?r.children.map(t=>t.value):[]}firstChild(e){let r=ZT(e,this._root);return r&&r.children.length>0?r.children[0].value:null}siblings(e){let r=KT(e,this._root);return r.length<2?[]:r[r.length-2].children.map(o=>o.value).filter(o=>o!==e)}pathFromRoot(e){return KT(e,this._root).map(r=>r.value)}};function ZT(i,e){if(i===e.value)return e;for(let r of e.children){let t=ZT(i,r);if(t)return t}return null}function KT(i,e){if(i===e.value)return[e];for(let r of e.children){let t=KT(i,r);if(t.length)return t.unshift(e),t}return[]}var Cs=class{constructor(e,r){this.value=e,this.children=r}toString(){return`TreeNode(${this.value})`}};function af(i){let e={};return i&&i.children.forEach(r=>e[r.value.outlet]=r),e}var px=class extends hx{constructor(e,r){super(e),this.snapshot=r,oI(this,e)}toString(){return this.snapshot.toString()}};function pF(i,e){let r=C7(i,e),t=new Cr([new Jd("",{})]),o=new Cr({}),n=new Cr({}),d=new Cr({}),_=new Cr(""),C=new Gi(t,o,d,_,n,ji,e,r.root);return C.snapshot=r.root,new px(new Cs(C,[]),r)}function C7(i,e){let r={},t={},o={},n="",d=new M_([],r,o,n,t,ji,e,null,{});return new fx("",new Cs(d,[]))}var Gi=class{constructor(e,r,t,o,n,d,_,C){this.urlSubject=e,this.paramsSubject=r,this.queryParamsSubject=t,this.fragmentSubject=o,this.dataSubject=n,this.outlet=d,this.component=_,this._futureSnapshot=C,this.title=this.dataSubject?.pipe(ei(M=>M[O_]))??Bt(void 0),this.url=e,this.params=r,this.queryParams=t,this.fragment=o,this.data=n}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(ei(e=>uf(e)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(ei(e=>uf(e)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}};function rI(i,e,r="emptyOnly"){let t,{routeConfig:o}=i;return e!==null&&(r==="always"||o?.path===""||!e.component&&!e.routeConfig?.loadComponent)?t={params:bt(bt({},e.params),i.params),data:bt(bt({},e.data),i.data),resolve:bt(bt(bt(bt({},i.data),e.data),o?.data),i._resolvedData)}:t={params:bt({},i.params),data:bt({},i.data),resolve:bt(bt({},i.data),i._resolvedData??{})},o&&mF(o)&&(t.resolve[O_]=o.title),t}var M_=class{get title(){return this.data?.[O_]}constructor(e,r,t,o,n,d,_,C,M){this.url=e,this.params=r,this.queryParams=t,this.fragment=o,this.data=n,this.outlet=d,this.component=_,this.routeConfig=C,this._resolve=M}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=uf(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=uf(this.queryParams)),this._queryParamMap}toString(){let e=this.url.map(t=>t.toString()).join("/"),r=this.routeConfig?this.routeConfig.path:"";return`Route(url:'${e}', path:'${r}')`}},fx=class extends hx{constructor(e,r){super(r),this.url=e,oI(this,r)}toString(){return fF(this._root)}};function oI(i,e){e.value._routerState=i,e.children.forEach(r=>oI(i,r))}function fF(i){let e=i.children.length>0?` { ${i.children.map(fF).join(", ")} } `:"";return`${i.value}${e}`}function kT(i){if(i.snapshot){let e=i.snapshot,r=i._futureSnapshot;i.snapshot=r,fl(e.queryParams,r.queryParams)||i.queryParamsSubject.next(r.queryParams),e.fragment!==r.fragment&&i.fragmentSubject.next(r.fragment),fl(e.params,r.params)||i.paramsSubject.next(r.params),QG(e.url,r.url)||i.urlSubject.next(r.url),fl(e.data,r.data)||i.dataSubject.next(r.data)}else i.snapshot=i._futureSnapshot,i.dataSubject.next(i._futureSnapshot.data)}function XT(i,e){let r=fl(i.params,e.params)&&i7(i.url,e.url),t=!i.parent!=!e.parent;return r&&!t&&(!i.parent||XT(i.parent,e.parent))}function mF(i){return typeof i.title=="string"||i.title===null}var sI=(()=>{let e=class e{constructor(){this.activated=null,this._activatedRoute=null,this.name=ji,this.activateEvents=new Fe,this.deactivateEvents=new Fe,this.attachEvents=new Fe,this.detachEvents=new Fe,this.parentContexts=_t(L_),this.location=_t(qs),this.changeDetector=_t(Or),this.environmentInjector=_t(Lo),this.inputBinder=_t(vx,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(t){if(t.name){let{firstChange:o,previousValue:n}=t.name;if(o)return;this.isTrackedInParentContexts(n)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(n)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(t){return this.parentContexts.getContext(t)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;let t=this.parentContexts.getContext(this.name);t?.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new yt(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new yt(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new yt(4012,!1);this.location.detach();let t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,o){this.activated=t,this._activatedRoute=o,this.location.insert(t.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){let t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,o){if(this.isActivated)throw new yt(4013,!1);this._activatedRoute=t;let n=this.location,_=t.snapshot.component,C=this.parentContexts.getOrCreateContext(this.name).children,M=new YT(t,C,n.injector);this.activated=n.createComponent(_,{index:n.length,injector:M,environmentInjector:o??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}};e.\u0275fac=function(o){return new(o||e)},e.\u0275dir=bi({type:e,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[hn]});let i=e;return i})(),YT=class{constructor(e,r,t){this.route=e,this.childContexts=r,this.parent=t}get(e,r){return e===Gi?this.route:e===L_?this.childContexts:this.parent.get(e,r)}},vx=new Ct(""),KL=(()=>{let e=class e{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(t){this.unsubscribeFromRouteData(t),this.subscribeToRouteData(t)}unsubscribeFromRouteData(t){this.outletDataSubscriptions.get(t)?.unsubscribe(),this.outletDataSubscriptions.delete(t)}subscribeToRouteData(t){let{activatedRoute:o}=t,n=Md([o.queryParams,o.params,o.data]).pipe(xr(([d,_,C],M)=>(C=bt(bt(bt({},d),_),C),M===0?Bt(C):Promise.resolve(C)))).subscribe(d=>{if(!t.isActivated||!t.activatedComponentRef||t.activatedRoute!==o||o.component===null){this.unsubscribeFromRouteData(t);return}let _=XR(o.component);if(!_){this.unsubscribeFromRouteData(t);return}for(let{templateName:C}
1325of _.inputs)t.activatedComponentRef.setInput(C,d[C])});this.outletDataSubscriptions.set(t,n)}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();function E7(i,e,r){let t=k_(i,e._root,r?r._root:void 0);return new px(t,e)}function k_(i,e,r){if(r&&i.shouldReuseRoute(e.value,r.value.snapshot)){let t=r.value;t._futureSnapshot=e.value;let o=S7(i,e,r);return new Cs(t,o)}else{if(i.shouldAttach(e.value)){let n=i.retrieve(e.value);if(n!==null){let d=n.route;return d.value._futureSnapshot=e.value,d.children=e.children.map(_=>k_(i,_)),d}}let t=T7(e.value),o=e.children.map(n=>k_(i,n));return new Cs(t,o)}}function S7(i,e,r){return e.children.map(t=>{for(let o of r.children)if(i.shouldReuseRoute(t.value,o.value.snapshot))return k_(i,t,o);return k_(i,t)})}function T7(i){return new Gi(new Cr(i.url),new Cr(i.params),new Cr(i.queryParams),new Cr(i.fragment),new Cr(i.data),i.outlet,i.component,i)}var gF="ngNavigationCancelingError";function _F(i,e){let{redirectTo:r,navigationBehaviorOptions:t}=df(e)?{redirectTo:e,navigationBehaviorOptions:void 0}:e,o=vF(!1,0,e);return o.url=r,o.navigationBehaviorOptions=t,o}function vF(i,e,r){let t=new Error("NavigationCancelingError: "+(i||""));return t[gF]=!0,t.cancellationCode=e,r&&(t.url=r),t}function I7(i){return yF(i)&&df(i.url)}function yF(i){return i&&i[gF]}var D7=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=st({type:e,selectors:[["ng-component"]],standalone:!0,features:[gt],decls:1,vars:0,template:function(o,n){o&1&&Z(0,"router-outlet")},dependencies:[sI],encapsulation:2});let i=e;return i})();function M7(i,e){return i.providers&&!i._injector&&(i._injector=Ab(i.providers,e,`Route: ${i.path}`)),i._injector??e}function aI(i){let e=i.children&&i.children.map(aI),r=e?en(bt({},i),{children:e}):bt({},i);return!r.component&&!r.loadComponent&&(e||r.loadChildren)&&r.outlet&&r.outlet!==ji&&(r.component=D7),r}function ml(i){return i.outlet||ji}function k7(i,e){let r=i.filter(t=>ml(t)===e);return r.push(...i.filter(t=>ml(t)!==e)),r}function F_(i){if(!i)return null;if(i.routeConfig?._injector)return i.routeConfig._injector;for(let e=i.parent;e;e=e.parent){let r=e.routeConfig;if(r?._loadedInjector)return r._loadedInjector;if(r?._injector)return r._injector}return null}var A7=(i,e,r,t)=>ei(o=>(new QT(e,o.targetRouterState,o.currentRouterState,r,t).activate(i),o)),QT=class{constructor(e,r,t,o,n){this.routeReuseStrategy=e,this.futureState=r,this.currState=t,this.forwardEvent=o,this.inputBindingEnabled=n}activate(e){let r=this.futureState._root,t=this.currState?this.currState._root:null;this.deactivateChildRoutes(r,t,e),kT(this.futureState.root),this.activateChildRoutes(r,t,e)}deactivateChildRoutes(e,r,t){let o=af(r);e.children.forEach(n=>{let d=n.value.outlet;this.deactivateRoutes(n,o[d],t),delete o[d]}),Object.values(o).forEach(n=>{this.deactivateRouteAndItsChildren(n,t)})}deactivateRoutes(e,r,t){let o=e.value,n=r?r.value:null;if(o===n)if(o.component){let d=t.getContext(o.outlet);d&&this.deactivateChildRoutes(e,r,d.children)}else this.deactivateChildRoutes(e,r,t);else n&&this.deactivateRouteAndItsChildren(r,t)}deactivateRouteAndItsChildren(e,r){e.value.component&&this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,r):this.deactivateRouteAndOutlet(e,r)}detachAndStoreRouteSubtree(e,r){let t=r.getContext(e.value.outlet),o=t&&e.value.component?t.children:r,n=af(e);for(let d of Object.keys(n))this.deactivateRouteAndItsChildren(n[d],o);if(t&&t.outlet){let d=t.outlet.detach(),_=t.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:d,route:e,contexts:_})}}deactivateRouteAndOutlet(e,r){let t=r.getContext(e.value.outlet),o=t&&e.value.component?t.children:r,n=af(e);for(let d of Object.keys(n))this.deactivateRouteAndItsChildren(n[d],o);t&&(t.outlet&&(t.outlet.deactivate(),t.children.onOutletDeactivated()),t.attachRef=null,t.route=null)}activateChildRoutes(e,r,t){let o=af(r);e.children.forEach(n=>{this.activateRoutes(n,o[n.value.outlet],t),this.forwardEvent(new qT(n.value.snapshot))}),e.children.length&&this.forwardEvent(new $T(e.value.snapshot))}activateRoutes(e,r,t){let o=e.value,n=r?r.value:null;if(kT(o),o===n)if(o.component){let d=t.getOrCreateContext(o.outlet);this.activateChildRoutes(e,r,d.children)}else this.activateChildRoutes(e,r,t);else if(o.component){let d=t.getOrCreateContext(o.outlet);if(this.routeReuseStrategy.shouldAttach(o.snapshot)){let _=this.routeReuseStrategy.retrieve(o.snapshot);this.routeReuseStrategy.store(o.snapshot,null),d.children.onOutletReAttached(_.contexts),d.attachRef=_.componentRef,d.route=_.route.value,d.outlet&&d.outlet.attach(_.componentRef,_.route.value),kT(_.route.value),this.activateChildRoutes(e,null,d.children)}else{let _=F_(o.snapshot);d.attachRef=null,d.route=o,d.injector=_,d.outlet&&d.outlet.activateWith(o,d.injector),this.activateChildRoutes(e,null,d.children)}}else this.activateChildRoutes(e,null,t)}},mx=class{constructor(e){this.path=e,this.route=this.path[this.path.length-1]}},cf=class{constructor(e,r){this.component=e,this.route=r}};function P7(i,e,r){let t=i._root,o=e?e._root:null;return y_(t,o,r,[t.value])}
vendor: 4,265 bytes, line 1325
1325function O7(i){let e=i.routeConfig?i.routeConfig.canActivateChild:null;return!e||e.length===0?null:{node:i,guards:e}}function mf(i,e){let r=Symbol(),t=e.get(i,r);return t===r?typeof i=="function"&&!KA(i)?i:e.get(i):t}function y_(i,e,r,t,o={canDeactivateChecks:[],canActivateChecks:[]}){let n=af(e);return i.children.forEach(d=>{R7(d,n[d.value.outlet],r,t.concat([d.value]),o),delete n[d.value.outlet]}),Object.entries(n).forEach(([d,_])=>C_(_,r.getContext(d),o)),o}function R7(i,e,r,t,o={canDeactivateChecks:[],canActivateChecks:[]}){let n=i.value,d=e?e.value:null,_=r?r.getContext(i.value.outlet):null;if(d&&n.routeConfig===d.routeConfig){let C=L7(d,n,n.routeConfig.runGuardsAndResolvers);C?o.canActivateChecks.push(new mx(t)):(n.data=d.data,n._resolvedData=d._resolvedData),n.component?y_(i,e,_?_.children:null,t,o):y_(i,e,r,t,o),C&&_&&_.outlet&&_.outlet.isActivated&&o.canDeactivateChecks.push(new cf(_.outlet.component,d))}else d&&C_(e,_,o),o.canActivateChecks.push(new mx(t)),n.component?y_(i,null,_?_.children:null,t,o):y_(i,null,r,t,o);return o}function L7(i,e,r){if(typeof r=="function")return r(i,e);switch(r){case"pathParamsChange":return!eh(i.url,e.url);case"pathParamsOrQueryParamsChange":return!eh(i.url,e.url)||!fl(i.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!XT(i,e)||!fl(i.queryParams,e.queryParams);case"paramsChange":default:return!XT(i,e)}}function C_(i,e,r){let t=af(i),o=i.value;Object.entries(t).forEach(([n,d])=>{o.component?e?C_(d,e.children.getContext(n),r):C_(d,null,r):C_(d,e,r)}),o.component?e&&e.outlet&&e.outlet.isActivated?r.canDeactivateChecks.push(new cf(e.outlet.component,o)):r.canDeactivateChecks.push(new cf(null,o)):r.canDeactivateChecks.push(new cf(null,o))}function N_(i){return typeof i=="function"}function F7(i){return typeof i=="boolean"}function N7(i){return i&&N_(i.canLoad)}function z7(i){return i&&N_(i.canActivate)}function j7(i){return i&&N_(i.canActivateChild)}function V7(i){return i&&N_(i.canDeactivate)}function B7(i){return i&&N_(i.canMatch)}function bF(i){return i instanceof Ta||i?.name==="EmptyError"}var ox=Symbol("INITIAL_VALUE");function ff(){return xr(i=>Md(i.map(e=>e.pipe(Ur(1),Bs(ox)))).pipe(ei(e=>{for(let r of e)if(r!==!0){if(r===ox)return ox;if(r===!1||r instanceof du)return r}return!0}),dn(e=>e!==ox),Ur(1)))}function U7(i,e){return jn(r=>{let{targetSnapshot:t,currentSnapshot:o,guards:{canActivateChecks:n,canDeactivateChecks:d}}=r;return d.length===0&&n.length===0?Bt(en(bt({},r),{guardsResult:!0})):H7(d,t,o,i).pipe(jn(_=>_&&F7(_)?$7(t,n,i,e):Bt(_)),ei(_=>en(bt({},r),{guardsResult:_})))})}function H7(i,e,r,t){return Rn(i).pipe(jn(o=>K7(o.component,o.route,r,e,t)),fs(o=>o!==!0,!0))}function $7(i,e,r,t){return Rn(e).pipe(Xl(o=>Xc(q7(o.route.parent,t),G7(o.route,t),Z7(i,o.path,r),W7(i,o.route,r))),fs(o=>o!==!0,!0))}function G7(i,e){return i!==null&&e&&e(new GT(i)),Bt(!0)}function q7(i,e){return i!==null&&e&&e(new HT(i)),Bt(!0)}function W7(i,e,r){let t=e.routeConfig?e.routeConfig.canActivate:null;if(!t||t.length===0)return Bt(!0);let o=t.map(n=>vy(()=>{let d=F_(e)??r,_=mf(n,d),C=z7(_)?_.canActivate(e,i):ll(d,()=>_(e,i));return fu(C).pipe(fs())}));return Bt(o).pipe(ff())}function Z7(i,e,r){let t=e[e.length-1],n=e.slice(0,e.length-1).reverse().map(d=>O7(d)).filter(d=>d!==null).map(d=>vy(()=>{let _=d.guards.map(C=>{let M=F_(d.node)??r,j=mf(C,M),G=j7(j)?j.canActivateChild(t,i):ll(M,()=>j(t,i));return fu(G).pipe(fs())});return Bt(_).pipe(ff())}));return Bt(n).pipe(ff())}function K7(i,e,r,t,o){let n=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!n||n.length===0)return Bt(!0);let d=n.map(_=>{let C=F_(e)??o,M=mf(_,C),j=V7(M)?M.canDeactivate(i,e,r,t):ll(C,()=>M(i,e,r,t));return fu(j).pipe(fs())});return Bt(d).pipe(ff())}function X7(i,e,r,t){let o=e.canLoad;if(o===void 0||o.length===0)return Bt(!0);let n=o.map(d=>{let _=mf(d,i),C=N7(_)?_.canLoad(e,r):ll(i,()=>_(e,r));return fu(C)});return Bt(n).pipe(ff(),xF(t))}function xF(i){return SC(Vi(e=>{if(df(e))throw _F(i,e)}),ei(e=>e===!0))}function Y7(i,e,r,t){let o=e.canMatch;if(!o||o.length===0)return Bt(!0);let n=o.map(d=>{let _=mf(d,i),C=B7(_)?_.canMatch(e,r):ll(i,()=>_(e,r));return fu(C)});return Bt(n).pipe(ff(),xF(t))}var A_=class{constructor(e){this.segmentGroup=e||null}}
1325,gx=class extends Error{constructor(e){super(),this.urlTree=e}};function sf(i){return Sp(new A_(i))}function Q7(i){return Sp(new yt(4e3,!1))}function J7(i){return Sp(vF(!1,3))}var JT=class{constructor(e,r){this.urlSerializer=e,this.urlTree=r}lineralizeSegments(e,r){let t=[],o=r.root;for(;;){if(t=t.concat(o.segments),o.numberOfChildren===0)return Bt(t);if(o.numberOfChildren>1||!o.children[ji])return Q7(e.redirectTo);o=o.children[ji]}}applyRedirectCommands(e,r,t){let o=this.applyRedirectCreateUrlTree(r,this.urlSerializer.parse(r),e,t);if(r.startsWith("/"))throw new gx(o);return o}applyRedirectCreateUrlTree(e,r,t,o){let n=this.createSegmentGroup(e,r.root,t,o);return new du(n,this.createQueryParams(r.queryParams,this.urlTree.queryParams),r.fragment)}createQueryParams(e,r){let t={};return Object.entries(e).forEach(([o,n])=>{if(typeof n=="string"&&n.startsWith(":")){let _=n.substring(1);t[o]=r[_]}else t[o]=n}),t}createSegmentGroup(e,r,t,o){let n=this.createSegments(e,r.segments,t,o),d={};return Object.entries(r.children).forEach(([_,C])=>{d[_]=this.createSegmentGroup(e,C,t,o)}),new An(n,d)}createSegments(e,r,t,o){return r.map(n=>n.path.startsWith(":")?this.findPosParam(e,n,o):this.findOrReturn(n,t))}findPosParam(e,r,t){let o=t[r.path.substring(1)];if(!o)throw new yt(4001,!1);return o}findOrReturn(e,r){let t=0;for(let o of r){if(o.path===e.path)return r.splice(t),o;t++}return e}},eI={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function e9(i,e,r,t,o){let n=lI(i,e,r);return n.matched?(t=M7(e,t),Y7(t,e,r,o).pipe(ei(d=>d===!0?n:bt({},eI)))):Bt(n)}function lI(i,e,r){if(e.path==="**")return t9(r);if(e.path==="")return e.pathMatch==="full"&&(i.hasChildren()||r.length>0)?bt({},eI):{matched:!0,consumedSegments:[],remainingSegments:r,parameters:{},positionalParamSegments:{}};let o=(e.matcher||YG)(r,i,e);if(!o)return bt({},eI);let n={};Object.entries(o.posParams??{}).forEach(([_,C])=>{n[_]=C.path});let d=o.consumed.length>0?bt(bt({},n),o.consumed[o.consumed.length-1].parameters):n;return{matched:!0,consumedSegments:o.consumed,remainingSegments:r.slice(o.consumed.length),parameters:d,positionalParamSegments:o.posParams??{}}}function t9(i){return{matched:!0,parameters:i.length>0?eF(i).parameters:{},consumedSegments:i,remainingSegments:[],positionalParamSegments:{}}}function XL(i,e,r,t){return r.length>0&&r9(i,r,t)?{segmentGroup:new An(e,n9(t,new An(r,i.children))),slicedSegments:[]}:r.length===0&&o9(i,r,t)?{segmentGroup:new An(i.segments,i9(i,e,r,t,i.children)),slicedSegments:r}:{segmentGroup:new An(i.segments,i.children),slicedSegments:r}}function i9(i,e,r,t,o){let n={};for(let d of t)if(yx(i,r,d)&&!o[ml(d)]){let _=new An([],{});n[ml(d)]=_}return bt(bt({},o),n)}function n9(i,e){let r={};r[ji]=e;for(let t of i)if(t.path===""&&ml(t)!==ji){let o=new An([],{});r[ml(t)]=o}return r}function r9(i,e,r){return r.some(t=>yx(i,e,t)&&ml(t)!==ji)}function o9(i,e,r){return r.some(t=>yx(i,e,t))}function yx(i,e,r){return(i.hasChildren()||e.length>0)&&r.pathMatch==="full"?!1:r.path===""}function s9(i,e,r,t){return ml(i)!==t&&(t===ji||!yx(e,r,i))?!1:lI(e,i,r).matched}function a9(i,e,r){return e.length===0&&!i.children[r]}var tI=class{};function l9(i,e,r,t,o,n,d="emptyOnly"){return new iI(i,e,r,t,o,d,n).recognize()}var c9=31,iI=class{constructor(e,r,t,o,n,d,_){this.injector=e,this.configLoader=r,this.rootComponentType=t,this.config=o,this.urlTree=n,this.paramsInheritanceStrategy=d,this.urlSerializer=_,this.applyRedirects=new JT(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(e){return new yt(4002,`'${e.segmentGroup}'`)}recognize(){let e=XL(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(e).pipe(ei(r=>{let t=new M_([],Object.freeze({}),Object.freeze(bt({},this.urlTree.queryParams)),this.urlTree.fragment,{},ji,this.rootComponentType,null,{}),o=new Cs(t,r),n=new fx("",o),d=g7(t,[],this.urlTree.queryParams,this.urlTree.fragment);return d.queryParams=this.urlTree.queryParams,n.url=this.urlSerializer.serialize(d),this.inheritParamsAndData(n._root,null),{state:n,tree:d}}))}match(e){return this.processSegmentGroup(this.injector,this.config,e,ji).pipe(Vs(t=>{if(t instanceof gx)return this.urlTree=t.urlTree,this.match(t.urlTree.root);throw t instanceof A_?this.noMatchError(t):t}))}inheritParamsAndData(e,r){let t=e.value,o=rI(t,r,this.paramsInheritanceStrategy);t.params=Object.freeze(o.params),t.data=Object.freeze(o.data),e.children.forEac
1325h(n=>this.inheritParamsAndData(n,t))}processSegmentGroup(e,r,t,o){return t.segments.length===0&&t.hasChildren()?this.processChildren(e,r,t):this.processSegment(e,r,t,t.segments,o,!0).pipe(ei(n=>n instanceof Cs?[n]:[]))}processChildren(e,r,t){let o=[];for(let n of Object.keys(t.children))n==="primary"?o.unshift(n):o.push(n);return Rn(o).pipe(Xl(n=>{let d=t.children[n],_=k7(r,n);return this.processSegmentGroup(e,_,d,n)}),RC((n,d)=>(n.push(...d),n)),Qc(null),OC(),jn(n=>{if(n===null)return sf(t);let d=wF(n);return u9(d),Bt(d)}))}processSegment(e,r,t,o,n,d){return Rn(r).pipe(Xl(_=>this.processSegmentAgainstRoute(_._injector??e,r,_,t,o,n,d).pipe(Vs(C=>{if(C instanceof A_)return Bt(null);throw C}))),fs(_=>!!_),Vs(_=>{if(bF(_))return a9(t,o,n)?Bt(new tI):sf(t);throw _}))}processSegmentAgainstRoute(e,r,t,o,n,d,_){return s9(t,o,n,d)?t.redirectTo===void 0?this.matchSegmentAgainstRoute(e,o,t,n,d):this.allowRedirects&&_?this.expandSegmentAgainstRouteUsingRedirect(e,o,r,t,n,d):sf(o):sf(o)}expandSegmentAgainstRouteUsingRedirect(e,r,t,o,n,d){let{matched:_,consumedSegments:C,positionalParamSegments:M,remainingSegments:j}=lI(r,o,n);if(!_)return sf(r);o.redirectTo.startsWith("/")&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>c9&&(this.allowRedirects=!1));let G=this.applyRedirects.applyRedirectCommands(C,o.redirectTo,M);return this.applyRedirects.lineralizeSegments(o,G).pipe(jn(ie=>this.processSegment(e,t,r,ie.concat(j),d,!1)))}matchSegmentAgainstRoute(e,r,t,o,n){let d=e9(r,t,o,e,this.urlSerializer);return t.path==="**"&&(r.children={}),d.pipe(xr(_=>_.matched?(e=t._injector??e,this.getChildConfig(e,t,o).pipe(xr(({routes:C})=>{let M=t._loadedInjector??e,{consumedSegments:j,remainingSegments:G,parameters:ie}=_,_e=new M_(j,ie,Object.freeze(bt({},this.urlTree.queryParams)),this.urlTree.fragment,h9(t),ml(t),t.component??t._loadedComponent??null,t,p9(t)),{segmentGroup:Ee,slicedSegments:Ye}=XL(r,j,G,C);if(Ye.length===0&&Ee.hasChildren())return this.processChildren(M,C,Ee).pipe(ei(at=>at===null?null:new Cs(_e,at)));if(C.length===0&&Ye.length===0)return Bt(new Cs(_e,[]));let $e=ml(t)===n;return this.processSegment(M,C,Ee,Ye,$e?ji:n,!0).pipe(ei(at=>new Cs(_e,at instanceof Cs?[at]:[])))}))):sf(r)))}getChildConfig(e,r,t){return r.children?Bt({routes:r.children,injector:e}):r.loadChildren?r._loadedRoutes!==void 0?Bt({routes:r._loadedRoutes,injector:r._loadedInjector}):X7(e,r,t,this.urlSerializer).pipe(jn(o=>o?this.configLoader.loadChildren(e,r).pipe(Vi(n=>{r._loadedRoutes=n.routes,r._loadedInjector=n.injector})):J7(r))):Bt({routes:[],injector:e})}};function u9(i){i.sort((e,r)=>e.value.outlet===ji?-1:r.value.outlet===ji?1:e.value.outlet.localeCompare(r.value.outlet))}function d9(i){let e=i.value.routeConfig;return e&&e.path===""}function wF(i){let e=[],r=new Set;for(let t of i){if(!d9(t)){e.push(t);continue}let o=e.find(n=>t.value.routeConfig===n.value.routeConfig);o!==void 0?(o.children.push(...t.children),r.add(o)):e.push(t)}for(let t of r){let o=wF(t.children);e.push(new Cs(t.value,o))}return e.filter(t=>!r.has(t))}function h9(i){return i.data||{}}function p9(i){return i.resolve||{}}function f9(i,e,r,t,o,n){return jn(d=>l9(i,e,r,t,d.extractedUrl,o,n).pipe(ei(({state:_,tree:C})=>en(bt({},d),{targetSnapshot:_,urlAfterRedirects:C}))))}function m9(i,e){return jn(r=>{let{targetSnapshot:t,guards:{canActivateChecks:o}}=r;if(!o.length)return Bt(r);let n=new Set(o.map(C=>C.route)),d=new Set;for(let C of n)if(!d.has(C))for(let M of CF(C))d.add(M);let _=0;return Rn(d).pipe(Xl(C=>n.has(C)?g9(C,t,i,e):(C.data=rI(C,C.parent,i).resolve,Bt(void 0))),Vi(()=>_++),Mp(1),jn(C=>_===d.size?Bt(r):Qo))})}function CF(i){let e=i.children.map(r=>CF(r)).flat();return[i,...e]}function g9(i,e,r,t){let o=i.routeConfig,n=i._resolve;return o?.title!==void 0&&!mF(o)&&(n[O_]=o.title),_9(n,i,e,t).pipe(ei(d=>(i._resolvedData=d,i.data=rI(i,i.parent,r).resolve,null)))}function _9(i,e,r,t){let o=OT(i);if(o.length===0)return Bt({});let n={};return Rn(o).pipe(jn(d=>v9(i[d],e,r,t).pipe(fs(),Vi(_=>{n[d]=_}))),Mp(1),by(n),Vs(d=>bF(d)?Qo:Sp(d)))}function v9(i,e,r,t){let o=F_(e)??t,n=mf(i,o),d=n.resolve?n.resolve(e,r):ll(o,()=>n(e,r));return fu(d)}function AT(i){return xr(e=>{let r=i(e);return r?Rn(r).pipe(ei(()=>
1325e)):Bt(e)})}var EF=(()=>{let e=class e{buildTitle(t){let o,n=t.root;for(;n!==void 0;)o=this.getResolvedTitleForRoute(n)??o,n=n.children.find(d=>d.outlet===ji);return o}getResolvedTitleForRoute(t){return t.data[O_]}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:()=>(()=>_t(y9))(),providedIn:"root"});let i=e;return i})(),y9=(()=>{let e=class e extends EF{constructor(t){super(),this.title=t}updateTitle(t){let o=this.buildTitle(t);o!==void 0&&this.title.setTitle(o)}};e.\u0275fac=function(o){return new(o||e)(Ve(uc))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),z_=new Ct("",{providedIn:"root",factory:()=>({})}),P_=new Ct("ROUTES"),cI=(()=>{let e=class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=_t(Fb)}loadComponent(t){if(this.componentLoaders.get(t))return this.componentLoaders.get(t);if(t._loadedComponent)return Bt(t._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(t);let o=fu(t.loadComponent()).pipe(ei(SF),Vi(d=>{this.onLoadEndListener&&this.onLoadEndListener(t),t._loadedComponent=d}),Ad(()=>{this.componentLoaders.delete(t)})),n=new vp(o,()=>new Jt).pipe(_p());return this.componentLoaders.set(t,n),n}loadChildren(t,o){if(this.childrenLoaders.get(o))return this.childrenLoaders.get(o);if(o._loadedRoutes)return Bt({routes:o._loadedRoutes,injector:o._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(o);let d=b9(o,this.compiler,t,this.onLoadEndListener).pipe(Ad(()=>{this.childrenLoaders.delete(o)})),_=new vp(d,()=>new Jt).pipe(_p());return this.childrenLoaders.set(o,_),_}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function b9(i,e,r,t){return fu(i.loadChildren()).pipe(ei(SF),jn(o=>o instanceof Ug||Array.isArray(o)?Bt(o):Rn(e.compileModuleAsync(o))),ei(o=>{t&&t(i);let n,d,_=!1;return Array.isArray(o)?(d=o,_=!0):(n=o.create(r).injector,d=n.get(P_,[],{optional:!0,self:!0}).flat()),{routes:d.map(aI),injector:n}}))}function x9(i){return i&&typeof i=="object"&&"default"in i}function SF(i){return x9(i)?i.default:i}var uI=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:()=>(()=>_t(w9))(),providedIn:"root"});let i=e;return i})(),w9=(()=>{let e=class e{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,o){return t}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),TF=new Ct(""),IF=new Ct("");function C9(i,e,r){let t=i.get(IF),o=i.get($i);return i.get(qt).runOutsideAngular(()=>{if(!o.startViewTransition||t.skipNextTransition)return t.skipNextTransition=!1,Promise.resolve();let n,d=new Promise(M=>{n=M}),_=o.startViewTransition(()=>(n(),E9(i))),{onViewTransitionCreated:C}=t;return C&&ll(i,()=>C({transition:_,from:e,to:r})),d})}function E9(i){return new Promise(e=>{$S(e,{injector:i})})}var dI=(()=>{let e=class e{get hasRequestedNavigation(){return this.navigationId!==0}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new Jt,this.transitionAbortSubject=new Jt,this.configLoader=_t(cI),this.environmentInjector=_t(Lo),this.urlSerializer=_t(R_),this.rootContexts=_t(L_),this.location=_t(hl),this.inputBindingEnabled=_t(vx,{optional:!0})!==null,this.titleStrategy=_t(EF),this.options=_t(z_,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=_t(uI),this.createViewTransition=_t(TF,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>Bt(void 0),this.rootComponentType=null;let t=n=>this.events.next(new BT(n)),o=n=>this.events.next(new UT(n));this.configLoader.onLoadEndListener=o,this.configLoader.onLoadStartListener=t}complete(){this.transitions?.complete()}handleNavigationRequest(t){let o=++this.navigationId;this.transitions?.next(en(bt(bt({},this.transitions.value),t),{id:o}))}setupNavigations(t,o,n){return this.transitions=new Cr({id:0,currentUrlTree:o,currentRawUrl:o,extractedUrl:this.urlHandlingStrategy.extract(o),urlAfterRedirects:this.urlHandlingStrategy.extract(o),rawUrl:o,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:w_,restoredState:null,currentSnapshot:n.snapshot,targetSnapshot:null,currentRouterState:n,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(dn(d=>d.id!==0),ei(d=>en(bt({},d),{extractedUrl:this.urlHandlingStrategy.extract(d.rawUrl)})),xr(d=>{this.currentTransition=d;let _=!1,C=!1;return Bt(d).pipe(Vi(M=>{this.currentNavigation={id:M.id,initialUrl:M.rawUrl,extractedUrl:M.extractedUrl,trigger:M.source,extras:M.extras,previousNavigation:this.lastSuccessfulNavigation?en(bt({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),xr(M=>{let j=!t.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl(),G=M.extras.onSameUrlNavigation??t.onSameUrlNavigation;if(!j&&G!=="reload"){let ie="";return this.events.next(new pu(M.id,this.urlSerializer.serialize(M.rawUrl),ie,0)),M.resolve(null),Qo}if(this.urlHandlingStrategy.shouldProcessUrl(M.rawUrl))return Bt(M).pipe(xr(ie=>{let _e=this.transitions?.getValue();return this.events.next(new hf(ie.id,this.urlSerializer.serialize(ie.extractedUrl),ie.source,ie.restoredState)),_e!==this.transitions?.getValue()?Qo:Promise.resolve(ie)}),f9(this.environmentInjector,this.configLoader,this.rootComponentType,t.config,this.urlSerializer,this.paramsInheritanceStrategy),Vi(ie=>{d.targetSnapshot=ie.targetSnapshot,d.urlAfterRedirects=ie.urlAfterRedirects,this.currentNavigation=en(bt({},this.currentNavigation),{finalUrl:ie.urlAfterRedirects});let _e=new pf(ie.id,this.urlSerializer.serialize(ie.extractedUrl),this.urlSerializer.serialize(ie.urlAfterRedirects),ie.targetSnapshot);this.events.next(_e)}));if(j&&this.urlHandlingStrategy.shouldProcessUrl(M.currentRawUrl)){let{id:ie,extractedUrl:_e,source:Ee,restoredState:Ye,extras:$e}=M,at=new hf(ie,this.urlSerializer.serialize(_e),Ee,Ye);this.events.next(at);let Lt=pF(_e,this.rootComponentType).snapshot;return this.currentTransition=d=en(bt({},M),{targetSnapshot:Lt,urlAfterRedirects:_e,extras:en(bt({},$e),{skipLocationChange:!1,replaceUrl:!1})}),this.currentNavigation.finalUrl=_e,Bt(d)}else{let ie="";return this.events.next(new pu(M.id,this.urlSerializer.serialize(M.extractedUrl),ie,1)),M.resolve(null),Qo}}),Vi(M=>{let j=new NT(M.id,this.urlSerializer.serialize(M.extractedUrl),this.urlSerializer.serialize(M.urlAfterRedirects),M.targetSnapshot);this.events.next(j)}),ei(M=>(this.currentTransition=d=en(bt({},M),{guards:P7(M.targetSnapshot,M.currentSnapshot,this.rootContexts)}),d)),U7(this.environmentInjector,M=>this.events.next(M)),Vi(M=>{if(d.guardsResult=M.guardsResult,df(M.guardsResult))throw _F(this.urlSerializer,M.guardsResult);let j=new zT(M.id,this.urlSerializer.serialize(M.extractedUrl),this.urlSerializer.serialize(M.urlAfterRedirects),M.targetSnapshot,!!M.guardsResult);this.events.next(j)}),dn(M=>M.guardsResult?!0:(this.cancelNavigationTransition(M,"",3),!1)),AT(M=>{if(M.guards.canActivateChecks.length)return Bt(M).pipe(Vi(j=>{let G=new jT(j.id,this.urlSerializer.serialize(j.extractedUrl),this.urlSerializer.serialize(j.urlAfterRedirects),j.targetSnapshot);this.events.next(G)}),xr(j=>{let G=!1;return Bt(j).pipe(m9(this.paramsInheritanceStrategy,this.environmentInjector),Vi({next:()=>G=!0,complete:()=>{G||this.cancelNavigationTransition(j,"",2)}}))}),Vi(j=>{let G=new VT(j.id,this.urlSerializer.serialize(j.extractedUrl),this.urlSerializer.serialize(j.urlAfterRedirects),j.targetSnapshot);this.events.next(G)}))}),AT(M=>{let j=G=>{let ie=[];G.routeConfig?.loadComponent&&!G.routeConfig._loadedComponent&&ie.push(this.configLoader.loadComponent(G.routeConfig).pipe(Vi(_e=>{G.component=_e}),ei(()=>{})));for(let _e of G.children)ie.push(...j(_e));return ie};return Md(j(M.targetSnapshot.root)).pipe(Qc(null),Ur(1))}),AT(()=>this.afterPreactivation()),xr(()=>{let{currentSnapshot:M,targetSnapshot:j}=d,G=this.createViewTransition?.(this.environmentInjector,M.root,j.root);return G?Rn(G).pipe(ei(()=>d)):Bt(d)}),ei(M=>{let j=E7(t.routeReuseStrategy,M.targetSnapshot,M.currentRouterState);return this.currentTransition=d=en(bt({},M),{targetRouterState:j}),this.currentNavigation.targetRouterState=j,d}),Vi(()=>{this.events.next(new I_)}),A7(this.rootContexts,t.routeReuseStrategy,M=>this.events.next(M),this.inputBindingEnabled),Ur(1),Vi({next:M=>{_=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new zo(M.id,this.urlSerializer.serialize(M.extractedUrl),this.urlSerializer.serialize(M.urlAfterRedirects))),this.titleStrategy?.updateTitle(M.targetRouterState.snapshot),M.resolve(!0)},complete:()=>{_=!0}}),es(this.transitionAbortSubject.pipe(Vi(M=>{throw M}))),Ad(()=>
1325{if(!_&&!C){let M="";this.cancelNavigationTransition(d,M,1)}this.currentNavigation?.id===d.id&&(this.currentNavigation=null)}),Vs(M=>{if(C=!0,yF(M))this.events.next(new hu(d.id,this.urlSerializer.serialize(d.extractedUrl),M.message,M.cancellationCode)),I7(M)?this.events.next(new D_(M.url)):d.resolve(!1);else{this.events.next(new T_(d.id,this.urlSerializer.serialize(d.extractedUrl),M,d.targetSnapshot??void 0));try{d.resolve(t.errorHandler(M))}catch(j){d.reject(j)}}return Qo}))}))}cancelNavigationTransition(t,o,n){let d=new hu(t.id,this.urlSerializer.serialize(t.extractedUrl),o,n);this.events.next(d),t.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){return this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))).toString()!==this.currentTransition?.extractedUrl.toString()&&!this.currentTransition?.extras.skipLocationChange}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function S9(i){return i!==w_}var T9=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:()=>(()=>_t(I9))(),providedIn:"root"});let i=e;return i})(),nI=class{shouldDetach(e){return!1}store(e,r){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,r){return e.routeConfig===r.routeConfig}},I9=(()=>{let e=class e extends nI{};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),DF=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:()=>(()=>_t(D9))(),providedIn:"root"});let i=e;return i})(),D9=(()=>{let e=class e extends DF{constructor(){super(...arguments),this.location=_t(hl),this.urlSerializer=_t(R_),this.options=_t(z_,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=_t(uI),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new du,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=pF(this.currentUrlTree,null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return this.canceledNavigationResolution!=="computed"?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(t){return this.location.subscribe(o=>{o.type==="popstate"&&t(o.url,o.state)})}handleRouterEvent(t,o){if(t instanceof hf)this.stateMemento=this.createStateMemento();else if(t instanceof pu)this.rawUrlTree=o.initialUrl;else if(t instanceof pf){if(this.urlUpdateStrategy==="eager"&&!o.extras.skipLocationChange){let n=this.urlHandlingStrategy.merge(o.finalUrl,o.initialUrl);this.setBrowserUrl(n,o)}}else t instanceof I_?(this.currentUrlTree=o.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(o.finalUrl,o.initialUrl),this.routerState=o.targetRouterState,this.urlUpdateStrategy==="deferred"&&(o.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,o))):t instanceof hu&&(t.code===3||t.code===2)?this.restoreHistory(o):t instanceof T_?this.restoreHistory(o,!0):t instanceof zo&&(this.lastSuccessfulId=t.id,this.currentPageId=this.browserPageId)}setBrowserUrl(t,o){let n=this.urlSerializer.serialize(t);if(this.location.isCurrentPathEqualTo(n)||o.extras.replaceUrl){let d=this.browserPageId,_=bt(bt({},o.extras.state),this.generateNgRouterState(o.id,d));this.location.replaceState(n,"",_)}else{let d=bt(bt({},o.extras.state),this.generateNgRouterState(o.id,this.browserPageId+1));this.location.go(n,"",d)}}restoreHistory(t,o=!1){if(this.canceledNavigationResolution==="computed"){let n=this.browserPageId,d=this.currentPageId-n;d!==0?this.location.historyGo(d):this.currentUrlTree===t.finalUrl&&d===0&&(this.resetState(t),this.resetUrlToCurrentUrlTree())}else this.canceledNavigationResolution==="replace"&&(o&&this.resetState(t),this.resetUrlToCurrentUrlTree())}resetState(t){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(t,o){return this.canceledNavigationResolution==="computed"?{navigationId:t,\u0275routerPageId:o}:{navigationId:t}}};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),b_=function(i){return i[i.COMPLETE=0]="COMPLETE",i[i.FAILED=1]="FAILED",i[i.REDIRECTING=2]="REDIRECTING",i}(b_||{});function MF(i,e){i.events.pipe(dn(r=>r instanceof zo||r instanceof hu||r instanceof T_||r instanceof pu),ei(r=>r instanceof zo||r instanceof pu?b_.COMPLETE:(r instanceof hu?r.code===0||r.code===1:!1)?b_.REDIRECTING:b_.FAILED),dn(r=>
1325r!==b_.REDIRECTING),Ur(1)).subscribe(()=>{e()})}function M9(i){throw i}var k9={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},A9={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},si=(()=>{let e=class e{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.isNgZoneEnabled=!1,this.console=_t(Lb),this.stateManager=_t(DF),this.options=_t(z_,{optional:!0})||{},this.pendingTasks=_t(ef),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=_t(dI),this.urlSerializer=_t(R_),this.location=_t(hl),this.urlHandlingStrategy=_t(uI),this._events=new Jt,this.errorHandler=this.options.errorHandler||M9,this.navigated=!1,this.routeReuseStrategy=_t(T9),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=_t(P_,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!_t(vx,{optional:!0}),this.eventsSubscription=new pn,this.isNgZoneEnabled=_t(qt)instanceof qt&&qt.isInAngularZone(),this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:t=>{this.console.warn(t)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){let t=this.navigationTransitions.events.subscribe(o=>{try{let n=this.navigationTransitions.currentTransition,d=this.navigationTransitions.currentNavigation;if(n!==null&&d!==null){if(this.stateManager.handleRouterEvent(o,d),o instanceof hu&&o.code!==0&&o.code!==1)this.navigated=!0;else if(o instanceof zo)this.navigated=!0;else if(o instanceof D_){let _=this.urlHandlingStrategy.merge(o.url,n.currentRawUrl),C={skipLocationChange:n.extras.skipLocationChange,replaceUrl:this.urlUpdateStrategy==="eager"||S9(n.source)};this.scheduleNavigation(_,w_,null,C,{resolve:n.resolve,reject:n.reject,promise:n.promise})}}O9(o)&&this._events.next(o)}catch(n){this.navigationTransitions.transitionAbortSubject.next(n)}});this.eventsSubscription.add(t)}resetRootComponentType(t){this.routerState.root.component=t,this.navigationTransitions.rootComponentType=t}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),w_,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription||(this.nonRouterCurrentEntryChangeSubscription=this.stateManager.registerNonRouterCurrentEntryChangeListener((t,o)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(t,"popstate",o)},0)}))}navigateToSyncWithBrowser(t,o,n){let d={replaceUrl:!0},_=n?.navigationId?n:null;if(n){let M=bt({},n);delete M.navigationId,delete M.\u0275routerPageId,Object.keys(M).length!==0&&(d.state=M)}let C=this.parseUrl(t);this.scheduleNavigation(C,o,_,d)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(t){this.config=t.map(aI),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(t,o={}){let{relativeTo:n,queryParams:d,fragment:_,queryParamsHandling:C,preserveFragment:M}=o,j=M?this.currentUrlTree.fragment:_,G=null;switch(C){case"merge":G=bt(bt({},this.currentUrlTree.queryParams),d);break;case"preserve":G=this.currentUrlTree.queryParams;break;default:G=d||null}G!==null&&(G=this.removeEmptyProps(G));let ie;try{let _e=n?n.snapshot:this.routerState.snapshot.root;ie=cF(_e)}catch{(typeof t[0]!="string"||!t[0].startsWith("/"))&&(t=[]),ie=this.currentUrlTree.root}return uF(ie,t,G,j??null)}navigateByUrl(t,o={skipLocationChange:!1}){let n=df(t)?t:this.parseUrl(t),d=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(d,w_,null,o)}navigate(t,o={skipLocationChange:!1}){return P9(t),this.navigateByUrl(this.createUrlTree(t,o),o)}serializeUrl(t){return this.urlSerializer.serialize(t)}parseUrl(t){try{return this.urlSerializer.parse(t)}catch{return this.urlSerializer.parse("/")}}isActive(t,o){let n;if(o===!0?n=bt({},k9):o===!1?n=bt({},A9):n=o,df(t))return GL(this.currentUrlTree,t,n);let d=this.parseUrl(t);return GL(this.currentUrlTree,d,n)}removeEmptyProps(t){return Object.keys(t).reduce((o,n)=>{let d=t[n];return d!=null&&(o[n]=d),o},{})}scheduleNavigation(t,o,n,d,_){if(this.disposed)return Promise.resolve(!1);let C,M,j;_?(C=_.resolve,M=_.reject,j=_.promise):j=new Promise((ie,_e)=>{C=ie,M=_e});let G=this.pendingTasks.add();return MF(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(G))}),this.navigationTransitions.handleNavigationRequest({source:o,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:t,extras:d,resolve:C,reject:M,promise:j,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),j.catch(ie=>Promise.reject(ie))}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function P9(i){for(let e=0;e<i.length;e++)if(i[e]==null)throw new yt(4008,!1)}function O9(i){return!(i instanceof I_)&&!(i instanceof D_)}var qi=(()=>{let e=class e{constructor(t,o,n,d,_,C){this.router=t,this.route=o,this.tabIndexAttribute=n,this.renderer=d,this.el=_,this.locationStrategy=C,this.href=null,this.commands=null,this.onChanges=new Jt,this.preserveFragment=!1,this.skipLocationChange=!1,this.replaceUrl=!1;let M=_.nativeElement.tagName?.toLowerCase();this.isAnchorElement=M==="a"||M==="area",this.isAnchorElement?this.subscription=t.events.subscribe(j=>{j instanceof zo&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(t){this.tabIndexAttribute!=null||this.isAnchorElement||this.applyAttributeValue("tabindex",t)}ngOnChanges(t){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}set routerLink(t){t!=null?(this.commands=Array.isArray(t)?t:[t],this.setTabIndexIfNotOnNativeEl("0")):(this.commands=null,this.setTabIndexIfNotOnNativeEl(null))}onClick(t,o,n,d,_){if(this.urlTree===null||this.isAnchorElement&&(t!==0||o||n||d||_||typeof this.target=="string"&&this.target!="_self"))return!0;let C={skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state};return this.router.navigateByUrl(this.urlTree,C),!this.isAnchorElement}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){this.href=this.urlTree!==null&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(this.urlTree)):null;let t=this.href===null?null:RO(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",t)}applyAttributeValue(t,o){let n=this.renderer,d=this.el.nativeElement;o!==null?n.setAttribute(d,t,o):n.removeAttribute(d,t)}get urlTree(){return this.commands===null?null:this.router.createUrlTree(this.commands,{relativeTo:this.relativeTo!==void 0?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}};e.\u0275fac=function(o){return new(o||e)(ae(si),ae(Gi),Wg("tabindex"),ae(eo),ae(Pi),ae(lc))},e.\u0275dir=bi({type:e,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(o,n){o&1&&se("click",function(_){return n.onClick(_.button,_.ctrlKey,_.shiftKey,_.altKey,_.metaKey)}),o&2&&Bn("target",n.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",relativeTo:"relativeTo",preserveFragment:["preserveFragment","preserveFragment",Rr],skipLocationChange:["skipLocationChange","skipLocationChange",Rr],replaceUrl:["replaceUrl","replaceUrl",Rr],routerLink:"routerLink"},standalone:!0,features:[$s,hn]});let i=e;return i})();var _x=class{};var R9=(()=>{let e=class e{constructor(t,o,n,d,_){this.router=t,this.injector=n,this.preloadingStrategy=d,this.loader=_}setUpPreloading(){this.subscription=this.router.events.pipe(dn(t=>t instanceof zo),Xl(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,o){let n=[];for(let d of o){d.providers&&!d._injector&&(d._injector=Ab(d.providers,t,`Route: ${d.path}`));let _=d._injector??t,C=d._loadedInjector??_;(d.loadChildren&&!d._loadedRoutes&&d.canLoad===void 0||d.loadComponent&&!d._loadedComponent)&&n.push(this.preloadConfig(_,d)),(d.children||d._loadedRoutes)&&n.push(this.processRoutes(C,d.children??d._loadedRoutes))}return Rn(n).pipe(Kc())}preloadConfig(t,o){return this.preloadingStrategy.preload(o,()=>{let n;o.loadChildren&&o.canLoad===void 0?n=this.loader.loadChildren(t,o):n=Bt(null);let d=n.pipe(jn(_=>_===null?Bt(void 0):(o._loadedRoutes=_.routes,o._loadedInjector=_.injector,this.processRoutes(_.injector??t,_.routes))));if(o.loadComponent&&!o._loadedComponent){let _=this.loader.loadComponent(o);return Rn([d,_]).pipe(Kc())}else return d})}};e.\u0275fac=function(o){return new(o||e)(Ve(si),Ve(Fb),Ve(Lo),Ve(_x),Ve(cI))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),kF=new Ct(""),L9=(()=>{let e=class e{constructor(t,o,n,d,_={}
1325){this.urlSerializer=t,this.transitions=o,this.viewportScroller=n,this.zone=d,this.options=_,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},_.scrollPositionRestoration=_.scrollPositionRestoration||"disabled",_.anchorScrolling=_.anchorScrolling||"disabled"}init(){this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof hf?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof zo?(this.lastId=t.id,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.urlAfterRedirects).fragment)):t instanceof pu&&t.code===0&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof dx&&(t.position?this.options.scrollPositionRestoration==="top"?this.viewportScroller.scrollToPosition([0,0]):this.options.scrollPositionRestoration==="enabled"&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&this.options.anchorScrolling==="enabled"?this.viewportScroller.scrollToAnchor(t.anchor):this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,o){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new dx(t,this.lastSource==="popstate"?this.store[this.restoredId]:null,o))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}};e.\u0275fac=function(o){WO()},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();function AF(i,...e){return au([{provide:P_,multi:!0,useValue:i},[],{provide:Gi,useFactory:PF,deps:[si]},{provide:Xd,multi:!0,useFactory:OF},e.map(r=>r.\u0275providers)])}function PF(i){return i.routerState.root}function j_(i,e){return{\u0275kind:i,\u0275providers:e}}function OF(){let i=_t(is);return e=>{let r=i.get(ul);if(e!==r.components[0])return;let t=i.get(si),o=i.get(RF);i.get(hI)===1&&t.initialNavigation(),i.get(LF,null,Xi.Optional)?.setUpPreloading(),i.get(kF,null,Xi.Optional)?.init(),t.resetRootComponentType(r.componentTypes[0]),o.closed||(o.next(),o.complete(),o.unsubscribe())}}var RF=new Ct("",{factory:()=>new Jt}),hI=new Ct("",{providedIn:"root",factory:()=>1});function F9(){return j_(2,[{provide:hI,useValue:0},{provide:Nb,multi:!0,deps:[is],useFactory:e=>{let r=e.get(oL,Promise.resolve());return()=>r.then(()=>new Promise(t=>{let o=e.get(si),n=e.get(RF);MF(o,()=>{t(!0)}),e.get(dI).afterPreactivation=()=>(t(!0),n.closed?Bt(void 0):n),o.initialNavigation()}))}}])}function N9(){return j_(3,[{provide:Nb,multi:!0,useFactory:()=>{let e=_t(si);return()=>{e.setUpLocationChangeListener()}}},{provide:hI,useValue:2}])}var LF=new Ct("");function z9(i){return j_(0,[{provide:LF,useExisting:R9},{provide:_x,useExisting:i}])}function j9(){return j_(8,[KL,{provide:vx,useExisting:KL}])}function V9(i){let e=[{provide:TF,useValue:C9},{provide:IF,useValue:bt({skipNextTransition:!!i?.skipInitialTransition},i)}];return j_(9,e)}var YL=new Ct("ROUTER_FORROOT_GUARD"),B9=[hl,{provide:R_,useClass:E_},si,L_,{provide:Gi,useFactory:PF,deps:[si]},cI,[]],FF=(()=>{let e=class e{constructor(t){}static forRoot(t,o){return{ngModule:e,providers:[B9,[],{provide:P_,multi:!0,useValue:t},{provide:YL,useFactory:G9,deps:[[si,new Kg,new gb]]},{provide:z_,useValue:o||{}},o?.useHash?H9():$9(),U9(),o?.preloadingStrategy?z9(o.preloadingStrategy).\u0275providers:[],o?.initialNavigation?q9(o):[],o?.bindToComponentInputs?j9().\u0275providers:[],o?.enableViewTransitions?V9().\u0275providers:[],W9()]}}static forChild(t){return{ngModule:e,providers:[{provide:P_,multi:!0,useValue:t}]}}};e.\u0275fac=function(o){return new(o||e)(Ve(YL,8))},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({});let i=e;return i})();function U9(){return{provide:kF,useFactory:()=>{let i=_t(Xb),e=_t(qt),r=_t(z_),t=_t(dI),o=_t(R_);return r.scrollOffset&&i.setOffset(r.scrollOffset),new L9(o,t,i,e,r)}}}function H9(){return{provide:lc,useClass:aL}}function $9(){return{provide:lc,useClass:dT}}function G9(i){return"guarded"}function q9(i){return[i.initialNavigation==="disabled"?N9().\u0275providers:[],i.initialNavigation==="enabledBlocking"?F9().\u0275providers:[]]}var QL=new Ct("");function W9(){return[{provide:QL,useFactory:OF},{provide:Xd,multi:!0,useExisting:QL}]}var th=(()=>{let e=class e{constructor(t){this.http=t,this.countriesUrl="/countries/"}getCountries(t,o,n=null,d=null,_=!1){let C=this.countriesUrl+"?limit="+t;return C=C+(o?"&offset="+o:""),C=C+(n?"&ordering="+n:""),C=C+(d?"&search="+d:""),C=C+(_?"&non_empty="+_:""),this.http.get(C)}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var ih=(()=>{let e=class e{constructor(t){this.http=t,this.mountainRangesUrl="/mountain-ranges/"}getMountainRanges(t,o,n=null,d=null,_=null){let C=this.mountainRangesUrl+"?limit="+t;return C=C+(o?"&offset="+o:""),C=C+(n?"&country="+n:""),C=C+(d?"&search="+d:""),C=C+(_?"&ordering="+_:""),this.http.get(C)}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var Ln=(()=>{let e=class e{constructor(t){this.http=t,this.roadsUrl="/roads/",this.equipmentUrl="/equipment/",this.difficultiesUrl="/road-difficulties/",this.roadImagesUrl="/roads/images/",this.tracksUrl="/tracking/tracks/"}getRoad(t,o){return t?this.http.get(this.roadsUrl+t+"/"):this.http.get(this.roadsUrl+o+"/")}getRoads(t,o,n=null,d=[]){let _=this.roadsUrl+"?limit="+t;_=_+(o?"&offset="+o:""),_=_+(n?"&ordering="+n:"");for(let C in d)_=_+(d[C]?"&"+C+"="+d[C]:"");return this.http.get(_)}getRoadImages(t,o,n){let d=this.roadImagesUrl+"?limit="+o;return d=d+(n?"&offset="+n:""),d=d+(t?"&road="+t:""),this.http.get(d)}getEquipment(t,o,n=null){let d=this.equipmentUrl+"?limit="+t;return d=d+(o?"&offset="+o:""),d=d+(n?"&search="+n:""),this.http.get(d)}getDifficulty(t,o,n=null){let d=this.difficultiesUrl+"?limit="+t;return d=d+(o?"&offset="+o:""),d=d+(n?"&search="+n:""),this.http.get(d)}insertRoad(t){let o=this.roadsUrl+"create/";return this.http.post(o,t,this.jwt())}updateRoad(t,o){let n=this.roadsUrl+"edit/"+t+"/";return this.http.put(n,o,this.jwt())}getGPSTracks(t){let o=`${this.tracksUrl}?road=${t}`;return this.http.get(o)}jwt(){let t=localStorage.getItem("token");return t?{headers:new Qn({"Content-Type":"application/json",Authorization:"JWT "+t})}:{}}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var qF=(()=>{let e=class e{constructor(t,o){this._renderer=t,this._elementRef=o,this.onChange=n=>{},this.onTouched=()=>{}}setProperty(t,o){this._renderer.setProperty(this._elementRef.nativeElement,t,o)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}};e.\u0275fac=function(o){return new(o||e)(ae(eo),ae(Pi))},e.\u0275dir=bi({type:e});let i=e;return i})(),H_=(()=>{let e=class e extends qF{};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275dir=bi({type:e,features:[Xn]});let i=e;return i})(),Qs=new Ct("NgValueAccessor"),X9={provide:Qs,useExisting:Jr(()=>$_),multi:!0},$_=(()=>{let e=class e extends H_{writeValue(t){this.setProperty("checked",t)}};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275dir=bi({type:e,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(o,n){o&1&&se("change",function(_){return n.onChange(_.target.checked)})("blur",function(){return n.onTouched()})},features:[It([X9]),Xn]});let i=e;return i})(),Y9={provide:Qs,useExisting:Jr(()=>Fr),multi:!0};function Q9(){let i=dl()?dl().getUserAgent():"";return/android (\d+)/.test(i.toLowerCase())}var J9=new Ct("CompositionEventMode"),Fr=(()=>{let e=class e extends qF{constructor(t,o,n){super(t,o),this._compositionMode=n,this._composing=!1,this._compositionMode==null&&(this._compositionMode=!Q9())}writeValue(t){let o=t??"";this.setProperty("value",o)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}
1325_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}};e.\u0275fac=function(o){return new(o||e)(ae(eo),ae(Pi),ae(J9,8))},e.\u0275dir=bi({type:e,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(o,n){o&1&&se("input",function(_){return n._handleInput(_.target.value)})("blur",function(){return n.onTouched()})("compositionstart",function(){return n._compositionStart()})("compositionend",function(_){return n._compositionEnd(_.target.value)})},features:[It([Y9]),Xn]});let i=e;return i})();function mu(i){return i==null||(typeof i=="string"||Array.isArray(i))&&i.length===0}function WF(i){return i!=null&&typeof i.length=="number"}var Mx=new Ct("NgValidators"),ZF=new Ct("NgAsyncValidators"),eq=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Wt=class{static min(e){return tq(e)}static max(e){return iq(e)}static required(e){return nq(e)}static requiredTrue(e){return rq(e)}static email(e){return oq(e)}static minLength(e){return sq(e)}static maxLength(e){return KF(e)}static pattern(e){return aq(e)}static nullValidator(e){return wx(e)}static compose(e){return t3(e)}static composeAsync(e){return n3(e)}};function tq(i){return e=>{if(mu(e.value)||mu(i))return null;let r=parseFloat(e.value);return!isNaN(r)&&r<i?{min:{min:i,actual:e.value}}:null}}function iq(i){return e=>{if(mu(e.value)||mu(i))return null;let r=parseFloat(e.value);return!isNaN(r)&&r>i?{max:{max:i,actual:e.value}}:null}}function nq(i){return mu(i.value)?{required:!0}:null}function rq(i){return i.value===!0?null:{required:!0}}function oq(i){return mu(i.value)||eq.test(i.value)?null:{email:!0}}function sq(i){return e=>mu(e.value)||!WF(e.value)?null:e.value.length<i?{minlength:{requiredLength:i,actualLength:e.value.length}}:null}function KF(i){return e=>WF(e.value)&&e.value.length>i?{maxlength:{requiredLength:i,actualLength:e.value.length}}:null}function aq(i){if(!i)return wx;let e,r;return typeof i=="string"?(r="",i.charAt(0)!=="^"&&(r+="^"),r+=i,i.charAt(i.length-1)!=="$"&&(r+="$"),e=new RegExp(r)):(r=i.toString(),e=i),t=>{if(mu(t.value))return null;let o=t.value;return e.test(o)?null:{pattern:{requiredPattern:r,actualValue:o}}}}function wx(i){return null}function XF(i){return i!=null}function YF(i){return Wd(i)?Rn(i):i}function QF(i){let e={};return i.forEach(r=>{e=r!=null?bt(bt({},e),r):e}),Object.keys(e).length===0?null:e}function JF(i,e){return e.map(r=>r(i))}function lq(i){return!i.validate}function e3(i){return i.map(e=>lq(e)?e:r=>e.validate(r))}function t3(i){if(!i)return null;let e=i.filter(XF);return e.length==0?null:function(r){return QF(JF(r,e))}}function i3(i){return i!=null?t3(e3(i)):null}function n3(i){if(!i)return null;let e=i.filter(XF);return e.length==0?null:function(r){let t=JF(r,e).map(YF);return Dg(t).pipe(ei(QF))}}function r3(i){return i!=null?n3(e3(i)):null}function NF(i,e){return i===null?[e]:Array.isArray(i)?[...i,e]:[i,e]}function o3(i){return i._rawValidators}function s3(i){return i._rawAsyncValidators}function pI(i){return i?Array.isArray(i)?i:[i]:[]}function Cx(i,e){return Array.isArray(i)?i.includes(e):i===e}function zF(i,e){let r=pI(e);return pI(i).forEach(o=>{Cx(r,o)||r.push(o)}),r}function jF(i,e){return pI(e).filter(r=>!Cx(i,r))}var Ex=class{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(e){this._rawValidators=e||[],this._composedValidatorFn=i3(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=r3(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}
1325_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,r){return this.control?this.control.hasError(e,r):!1}getError(e,r){return this.control?this.control.getError(e,r):null}},vf=class extends Ex{get formDirective(){return null}get path(){return null}},U_=class extends Ex{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}},Sx=class{constructor(e){this._cd=e}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}},cq={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},xpe=en(bt({},cq),{"[class.ng-submitted]":"isSubmitted"}),to=(()=>{let e=class e extends Sx{constructor(t){super(t)}};e.\u0275fac=function(o){return new(o||e)(ae(U_,2))},e.\u0275dir=bi({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(o,n){o&2&&Yi("ng-untouched",n.isUntouched)("ng-touched",n.isTouched)("ng-pristine",n.isPristine)("ng-dirty",n.isDirty)("ng-valid",n.isValid)("ng-invalid",n.isInvalid)("ng-pending",n.isPending)},features:[Xn]});let i=e;return i})(),io=(()=>{let e=class e extends Sx{constructor(t){super(t)}};e.\u0275fac=function(o){return new(o||e)(ae(vf,10))},e.\u0275dir=bi({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(o,n){o&2&&Yi("ng-untouched",n.isUntouched)("ng-touched",n.isTouched)("ng-pristine",n.isPristine)("ng-dirty",n.isDirty)("ng-valid",n.isValid)("ng-invalid",n.isInvalid)("ng-pending",n.isPending)("ng-submitted",n.isSubmitted)},features:[Xn]});let i=e;return i})();var V_="VALID",bx="INVALID",_f="PENDING",B_="DISABLED";function gI(i){return(kx(i)?i.validators:i)||null}function uq(i){return Array.isArray(i)?i3(i):i||null}function _I(i,e){return(kx(e)?e.asyncValidators:i)||null}function dq(i){return Array.isArray(i)?r3(i):i||null}function kx(i){return i!=null&&!Array.isArray(i)&&typeof i=="object"}function a3(i,e,r){let t=i.controls;if(!(e?Object.keys(t):t).length)throw new yt(1e3,"");if(!t[r])throw new yt(1001,"")}function l3(i,e,r){i._forEachChild((t,o)=>{if(r[o]===void 0)throw new yt(1002,"")})}var yf=class{constructor(e,r){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._assignValidators(e),this._assignAsyncValidators(r)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===V_}get invalid(){return this.status===bx}get pending(){return this.status==_f}get disabled(){return this.status===B_}get enabled(){return this.status!==B_}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(zF(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(zF(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(jF(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(jF(e,this._rawAsyncValidators))}hasValidator(e){return Cx(this._rawValidators,e)}hasAsyncValidator(e){return Cx(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}
1325),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(r=>{r.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=_f,e.emitEvent!==!1&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){let r=this._parentMarkedDirty(e.onlySelf);this.status=B_,this.errors=null,this._forEachChild(t=>{t.disable(en(bt({},e),{onlySelf:!0}))}),this._updateValue(),e.emitEvent!==!1&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(en(bt({},e),{skipPristineCheck:r})),this._onDisabledChange.forEach(t=>t(!0))}enable(e={}){let r=this._parentMarkedDirty(e.onlySelf);this.status=V_,this._forEachChild(t=>{t.enable(en(bt({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(en(bt({},e),{skipPristineCheck:r})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===V_||this.status===_f)&&this._runAsyncValidator(e.emitEvent)),e.emitEvent!==!1&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(r=>r._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?B_:V_}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=_f,this._hasOwnPendingAsyncValidator=!0;let r=YF(this.asyncValidator(this));this._asyncValidationSubscription=r.subscribe(t=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(t,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,r={}){this.errors=e,this._updateControlsErrors(r.emitEvent!==!1)}get(e){let r=e;return r==null||(Array.isArray(r)||(r=r.split(".")),r.length===0)?null:r.reduce((t,o)=>t&&t._find(o),this)}getError(e,r){let t=r?this.get(r):this;return t&&t.errors?t.errors[e]:null}hasError(e,r){return!!this.getError(e,r)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Fe,this.statusChanges=new Fe}_calculateStatus(){return this._allControlsDisabled()?B_:this.errors?bx:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(_f)?_f:this._anyControlsHaveStatus(bx)?bx:V_}_anyControlsHaveStatus(e){return this._anyControls(r=>r.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){kx(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){let r=this._parent&&this._parent.dirty;return!e&&!!r&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=uq(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=dq(this._rawAsyncValidators)}},Tx=class extends yf{constructor(e,r,t){super(gI(r),_I(t,r)),this.controls=e,this._initOb
vendor: 5,185 bytes, line 1325
1325servables(),this._setUpdateStrategy(r),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,r){return this.controls[e]?this.controls[e]:(this.controls[e]=r,r.setParent(this),r._registerOnCollectionChange(this._onCollectionChange),r)}addControl(e,r,t={}){this.registerControl(e,r),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}removeControl(e,r={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}setControl(e,r,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],r&&this.registerControl(e,r),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,r={}){l3(this,!0,e),Object.keys(e).forEach(t=>{a3(this,!0,t),this.controls[t].setValue(e[t],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r)}patchValue(e,r={}){e!=null&&(Object.keys(e).forEach(t=>{let o=this.controls[t];o&&o.patchValue(e[t],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r))}reset(e={},r={}){this._forEachChild((t,o)=>{t.reset(e?e[o]:null,{onlySelf:!0,emitEvent:r.emitEvent})}),this._updatePristine(r),this._updateTouched(r),this.updateValueAndValidity(r)}getRawValue(){return this._reduceChildren({},(e,r,t)=>(e[t]=r.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(r,t)=>t._syncPendingControls()?!0:r);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(r=>{let t=this.controls[r];t&&e(t,r)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(let[r,t]of Object.entries(this.controls))if(this.contains(r)&&e(t))return!0;return!1}_reduceValue(){let e={};return this._reduceChildren(e,(r,t,o)=>((t.enabled||this.disabled)&&(r[o]=t.value),r))}_reduceChildren(e,r){let t=e;return this._forEachChild((o,n)=>{t=r(t,o,n)}),t}_allControlsDisabled(){for(let e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}};var fI=class extends Tx{};var vI=new Ct("CallSetDisabledState",{providedIn:"root",factory:()=>Ax}),Ax="always";function hq(i,e){return[...e.path,i]}function VF(i,e,r=Ax){yI(i,e),e.valueAccessor.writeValue(i.value),(i.disabled||r==="always")&&e.valueAccessor.setDisabledState?.(i.disabled),fq(i,e),gq(i,e),mq(i,e),pq(i,e)}function BF(i,e,r=!0){let t=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(t),e.valueAccessor.registerOnTouched(t)),Dx(i,e),i&&(e._invokeOnDestroyCallbacks(),i._registerOnCollectionChange(()=>{}))}function Ix(i,e){i.forEach(r=>{r.registerOnValidatorChange&&r.registerOnValidatorChange(e)})}function pq(i,e){if(e.valueAccessor.setDisabledState){let r=t=>{e.valueAccessor.setDisabledState(t)};i.registerOnDisabledChange(r),e._registerOnDestroy(()=>{i._unregisterOnDisabledChange(r)})}}function yI(i,e){let r=o3(i);e.validator!==null?i.setValidators(NF(r,e.validator)):typeof r=="function"&&i.setValidators([r]);let t=s3(i);e.asyncValidator!==null?i.setAsyncValidators(NF(t,e.asyncValidator)):typeof t=="function"&&i.setAsyncValidators([t]);let o=()=>i.updateValueAndValidity();Ix(e._rawValidators,o),Ix(e._rawAsyncValidators,o)}function Dx(i,e){let r=!1;if(i!==null){if(e.validator!==null){let o=o3(i);if(Array.isArray(o)&&o.length>0){let n=o.filter(d=>d!==e.validator);n.length!==o.length&&(r=!0,i.setValidators(n))}}if(e.asyncValidator!==null){let o=s3(i);if(Array.isArray(o)&&o.length>0){let n=o.filter(d=>d!==e.asyncValidator);n.length!==o.length&&(r=!0,i.setAsyncValidators(n))}}}let t=()=>{};return Ix(e._rawValidators,t),Ix(e._rawAsyncValidators,t),r}function fq(i,e){e.valueAccessor.registerOnChange(r=>{i._pendingValue=r,i._pendingChange=!0,i._pendingDirty=!0,i.updateOn==="change"&&c3(i,e)})}function mq(i,e){e.valueAccessor.registerOnTouched(()=>{i._pendingTouched=!0,i.updateOn==="blur"&&i._pendingChange&&c3(i,e),i.updateOn!=="submit"&&i.markAsTouched()})}function c3(i,e){i._pendingDirty&&i.markAsDirty(),i.setValue(i._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1}function gq(i,e){let r=(t,o)=>{e.valueAccessor.writeValue(t),o&&e.viewToModelUpdate(t)};i.registerOnChange(r),e._registerOnDestroy(()=>{i._unregisterOnChange(r)})}function _q(i,e){i==null,yI(i,e)}function vq(i,e){return Dx(i,e)}function yq(i,e){if(!i.hasOwnProperty("model"))return!1;let r=i.model;return r.isFirstChange()?!0:!Object.is(e,r.currentValue)}function bq(i){return Object.getPrototypeOf(i.constructor)===H_}function xq(i,e){i._syncPendingControls(),e.forEach(r=>{let t=r.control;t.updateOn==="submit"&&t._pendingChange&&(r.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)})}function wq(i,e){if(!e)return null;Array.isArray(e);let r,t,o;return e.forEach(n=>
1325{n.constructor===Fr?r=n:bq(n)?t=n:o=n}),o||t||r||null}function Cq(i,e){let r=i.indexOf(e);r>-1&&i.splice(r,1)}function UF(i,e){let r=i.indexOf(e);r>-1&&i.splice(r,1)}function HF(i){return typeof i=="object"&&i!==null&&Object.keys(i).length===2&&"value"in i&&"disabled"in i}var xx=class extends yf{constructor(e=null,r,t){super(gI(r),_I(t,r)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(e),this._setUpdateStrategy(r),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),kx(r)&&(r.nonNullable||r.initialValueIsDefault)&&(HF(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,r={}){this.value=this._pendingValue=e,this._onChange.length&&r.emitModelToViewChange!==!1&&this._onChange.forEach(t=>t(this.value,r.emitViewToModelChange!==!1)),this.updateValueAndValidity(r)}patchValue(e,r={}){this.setValue(e,r)}reset(e=this.defaultValue,r={}){this._applyFormState(e),this.markAsPristine(r),this.markAsUntouched(r),this.setValue(this.value,r),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){UF(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){UF(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){HF(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};var Eq=i=>i instanceof xx;var no=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275dir=bi({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]});let i=e;return i})(),Sq={provide:Qs,useExisting:Jr(()=>G_),multi:!0},G_=(()=>{let e=class e extends H_{writeValue(t){let o=t??"";this.setProperty("value",o)}registerOnChange(t){this.onChange=o=>{t(o==""?null:parseFloat(o))}}};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275dir=bi({type:e,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(o,n){o&1&&se("input",function(_){return n.onChange(_.target.value)})("blur",function(){return n.onTouched()})},features:[It([Sq]),Xn]});let i=e;return i})();var Tq=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({});let i=e;return i})();var u3=new Ct("NgModelWithFormControlWarning");var Iq={provide:vf,useExisting:Jr(()=>qr)},qr=(()=>{let e=class e extends vf{constructor(t,o,n){super(),this.callSetDisabledState=n,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Fe,this._setValidators(t),this._setAsyncValidators(o)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Dx(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){let o=this.form.get(t.path);return VF(o,t,this.callSetDisabledState),o.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),o}getControl(t){return this.form.get(t.path)}
1325removeControl(t){BF(t.control||null,t,!1),Cq(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,o){this.form.get(t.path).setValue(o)}onSubmit(t){return this.submitted=!0,xq(this.form,this.directives),this.ngSubmit.emit(t),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{let o=t.control,n=this.form.get(t.path);o!==n&&(BF(o||null,t),Eq(n)&&(VF(n,t,this.callSetDisabledState),t.control=n))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){let o=this.form.get(t.path);_q(o,t),o.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){let o=this.form.get(t.path);o&&vq(o,t)&&o.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){yI(this.form,this),this._oldForm&&Dx(this._oldForm,this)}_checkFormPresent(){this.form}};e.\u0275fac=function(o){return new(o||e)(ae(Mx,10),ae(ZF,10),ae(vI,8))},e.\u0275dir=bi({type:e,selectors:[["","formGroup",""]],hostBindings:function(o,n){o&1&&se("submit",function(_){return n.onSubmit(_)})("reset",function(){return n.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[It([Iq]),Xn,hn]});let i=e;return i})();var Dq={provide:U_,useExisting:Jr(()=>Wr)},Wr=(()=>{let e=class e extends U_{set isDisabled(t){}constructor(t,o,n,d,_){super(),this._ngModelWarningConfig=_,this._added=!1,this.name=null,this.update=new Fe,this._ngModelWarningSent=!1,this._parent=t,this._setValidators(o),this._setAsyncValidators(n),this.valueAccessor=wq(this,d)}ngOnChanges(t){this._added||this._setUpControl(),yq(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return hq(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}_setUpControl(){this._checkParentType(),this.control=this.formDirective.addControl(this),this._added=!0}};e._ngModelWarningSentOnce=!1,e.\u0275fac=function(o){return new(o||e)(ae(vf,13),ae(Mx,10),ae(ZF,10),ae(Qs,10),ae(u3,8))},e.\u0275dir=bi({type:e,selectors:[["","formControlName",""]],inputs:{name:["formControlName","name"],isDisabled:["disabled","isDisabled"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},features:[It([Dq]),Xn,hn]});let i=e;return i})(),Mq={provide:Qs,useExisting:Jr(()=>bf),multi:!0};function d3(i,e){return i==null?`${e}`:(e&&typeof e=="object"&&(e="Object"),`${i}: ${e}`.slice(0,50))}function kq(i){return i.split(":")[0]}var bf=(()=>{let e=class e extends H_{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;let o=this._getOptionId(t),n=d3(o,t);this.setProperty("value",n)}registerOnChange(t){this.onChange=o=>{this.value=this._getOptionValue(o),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(let o of this._optionMap.keys())if(this._compareWith(this._optionMap.get(o),t))return o;return null}_getOptionValue(t){let o=kq(t);return this._optionMap.has(o)?this._optionMap.get(o):t}};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275dir=bi({type:e,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(o,n){o&1&&se("change",function(_){return n.onChange(_.target.value)})("blur",function(){return n.onTouched()})},inputs:{compareWith:"compareWith"},features:[It([Mq]),Xn]});let i=e;return i})(),xf=(()=>{let e=class e{constructor(t,o,n){this._element=t,this._renderer=o,this._select=n,this._select&&(this.id=this._select._registerOption())}set ngValue(t){this._select!=null&&(this._select._optionMap.set(this.id,t),this._setElementValue(d3(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id
1325),this._select.writeValue(this._select.value))}};e.\u0275fac=function(o){return new(o||e)(ae(Pi),ae(eo),ae(bf,9))},e.\u0275dir=bi({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}});let i=e;return i})(),Aq={provide:Qs,useExisting:Jr(()=>h3),multi:!0};function $F(i,e){return i==null?`${e}`:(typeof e=="string"&&(e=`'${e}'`),e&&typeof e=="object"&&(e="Object"),`${i}: ${e}`.slice(0,50))}function Pq(i){return i.split(":")[0]}var h3=(()=>{let e=class e extends H_{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;let o;if(Array.isArray(t)){let n=t.map(d=>this._getOptionId(d));o=(d,_)=>{d._setSelected(n.indexOf(_.toString())>-1)}}else o=(n,d)=>{n._setSelected(!1)};this._optionMap.forEach(o)}registerOnChange(t){this.onChange=o=>{let n=[],d=o.selectedOptions;if(d!==void 0){let _=d;for(let C=0;C<_.length;C++){let M=_[C],j=this._getOptionValue(M.value);n.push(j)}}else{let _=o.options;for(let C=0;C<_.length;C++){let M=_[C];if(M.selected){let j=this._getOptionValue(M.value);n.push(j)}}}this.value=n,t(n)}}_registerOption(t){let o=(this._idCounter++).toString();return this._optionMap.set(o,t),o}_getOptionId(t){for(let o of this._optionMap.keys())if(this._compareWith(this._optionMap.get(o)._value,t))return o;return null}_getOptionValue(t){let o=Pq(t);return this._optionMap.has(o)?this._optionMap.get(o)._value:t}};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275dir=bi({type:e,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(o,n){o&1&&se("change",function(_){return n.onChange(_.target)})("blur",function(){return n.onTouched()})},inputs:{compareWith:"compareWith"},features:[It([Aq]),Xn]});let i=e;return i})(),wf=(()=>{let e=class e{constructor(t,o,n){this._element=t,this._renderer=o,this._select=n,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){this._select!=null&&(this._value=t,this._setElementValue($F(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue($F(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}};e.\u0275fac=function(o){return new(o||e)(ae(Pi),ae(eo),ae(h3,9))},e.\u0275dir=bi({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}});let i=e;return i})();function Oq(i){return typeof i=="number"?i:parseInt(i,10)}var Rq=(()=>{let e=class e{constructor(){this._validator=wx}ngOnChanges(t){if(this.inputName in t){let o=this.normalizeInput(t[this.inputName].currentValue);this._enabled=this.enabled(o),this._validator=this._enabled?this.createValidator(o):wx,this._onChange&&this._onChange()}}validate(t){return this._validator(t)}registerOnValidatorChange(t){this._onChange=t}enabled(t){return t!=null}};e.\u0275fac=function(o){return new(o||e)},e.\u0275dir=bi({type:e,features:[hn]});let i=e;return i})();var Lq={provide:Mx,useExisting:Jr(()=>bI),multi:!0},bI=(()=>{let e=class e extends Rq{constructor(){super(...arguments),this.inputName="maxlength",this.normalizeInput=t=>Oq(t),this.createValidator=t=>KF(t)}};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275dir=bi({type:e,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(o,n){o&2&&Bn("maxlength",n._enabled?n.maxlength:null)},inputs:{maxlength:"maxlength"},features:[It([Lq]),Xn]});let i=e;return i})();var p3=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({imports:[Tq]});let i=e;return i})(),mI=class extends yf{constructor(e,r,t){super(gI(r),_I(t,r)),this.controls=e,this._initOb
1325servables(),this._setUpdateStrategy(r),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[this._adjustIndex(e)]}push(e,r={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}insert(e,r,t={}){this.controls.splice(e,0,r),this._registerControl(r),this.updateValueAndValidity({emitEvent:t.emitEvent})}removeAt(e,r={}){let t=this._adjustIndex(e);t<0&&(t=0),this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity({emitEvent:r.emitEvent})}setControl(e,r,t={}){let o=this._adjustIndex(e);o<0&&(o=0),this.controls[o]&&this.controls[o]._registerOnCollectionChange(()=>{}),this.controls.splice(o,1),r&&(this.controls.splice(o,0,r),this._registerControl(r)),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,r={}){l3(this,!1,e),e.forEach((t,o)=>{a3(this,!1,o),this.at(o).setValue(t,{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r)}patchValue(e,r={}){e!=null&&(e.forEach((t,o)=>{this.at(o)&&this.at(o).patchValue(t,{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r))}reset(e=[],r={}){this._forEachChild((t,o)=>{t.reset(e[o],{onlySelf:!0,emitEvent:r.emitEvent})}),this._updatePristine(r),this._updateTouched(r),this.updateValueAndValidity(r)}getRawValue(){return this.controls.map(e=>e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(r=>r._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_adjustIndex(e){return e<0?e+this.length:e}_syncPendingControls(){let e=this.controls.reduce((r,t)=>t._syncPendingControls()?!0:r,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){this.controls.forEach((r,t)=>{e(r,t)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(r=>r.enabled&&e(r))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_allControlsDisabled(){for(let e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}_find(e){return this.at(e)??null}};function GF(i){return!!i&&(i.asyncValidators!==void 0||i.validators!==void 0||i.updateOn!==void 0)}var ro=(()=>{let e=class e{constructor(){this.useNonNullable=!1}get nonNullable(){let t=new e;return t.useNonNullable=!0,t}group(t,o=null){let n=this._reduceControls(t),d={};return GF(o)?d=o:o!==null&&(d.validators=o.validator,d.asyncValidators=o.asyncValidator),new Tx(n,d)}record(t,o=null){let n=this._reduceControls(t);return new fI(n,o)}control(t,o,n){let d={};return this.useNonNullable?(GF(o)?d=o:(d.validators=o,d.asyncValidators=n),new xx(t,en(bt({},d),{nonNullable:!0}))):new xx(t,o,n)}array(t,o,n){let d=t.map(_=>this._createControl(_));return new mI(d,o,n)}_reduceControls(t){let o={};return Object.keys(t).forEach(n=>{o[n]=this._createControl(t[n])}),o}_createControl(t){if(t instanceof xx)return t;if(t instanceof yf)return t;if(Array.isArray(t)){let o=t[0],n=t.length>1?t[1]:null,d=t.length>2?t[2]:null;return this.control(o,n,d)}else return this.control(t)}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var Nr=(()=>{let e=class e{static withConfig(t){return{ngModule:e,providers:[{provide:vI,useValue:t.callSetDisabledState??Ax}]}}};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({imports:[p3]});let i=e;return i})(),oo=(()=>{let e=class e{static withConfig(t){return{ngModule:e,providers:[{provide:u3,useValue:t.warnOnNgModelWithFormControl??"always"},{provide:vI,useValue:t.callSetDisabledState??Ax}]}}};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({imports:[p3]});let i=e;return i})();var Es=typeof window<"u"?window:{screen:{},navigator:{}},Cf=(Es.matchMedia||function(){return{matches:!1}}
1325).bind(Es),f3=!1,Fq={get passive(){return f3=!0}},m3=function(){};Es.addEventListener&&Es.addEventListener("p",m3,Fq);Es.removeEventListener&&Es.removeEventListener("p",m3,!1);var Px=f3,Epe="PointerEvent"in Es,xI="ontouchstart"in Es,Nq="TouchEvent"in Es,zq=xI||Nq&&Cf("(any-pointer: coarse)").matches,Spe=(Es.navigator.maxTouchPoints||0)>0||zq,g3=Es.navigator.userAgent||"",jq=Cf("(pointer: coarse)").matches&&/iPad|Macintosh/.test(g3)&&Math.min(Es.screen.width||0,Es.screen.height||0)>=768,Tpe=(Cf("(pointer: coarse)").matches||!Cf("(pointer: fine)").matches&&xI)&&!/Windows.*Firefox/.test(g3),Ipe=Cf("(any-pointer: fine)").matches||Cf("(any-hover: hover)").matches||jq||!xI;function Vq(i,e){}function Bq(i,e){i&1&&ce(0,Vq,0,0,"ng-template")}var Uq=(i,e,r)=>({tooltip:i,placement:e,content:r});function Hq(i,e){if(i&1&&(Pa(0),ce(1,Bq,1,0,null,1),Oa()),i&2){let r=q();P(1),N("ngTemplateOutlet",r.template)("ngTemplateOutletContext",zR(2,Uq,r.tooltip,r.placement,r.content))}}function $q(i,e){if(i&1&&(Pa(0),S(1,"div",2),A(2),E(),Oa()),i&2){let r=q();P(1),Bn("title",r.tooltip)("data-tooltip-placement",r.placement),P(1),We(" ",r.content," ")}}var Gq=["tooltipTemplate"],qq=["leftOuterSelectionBar"],Wq=["rightOuterSelectionBar"],Zq=["fullBar"],Kq=["selectionBar"],Xq=["minHandle"],Yq=["maxHandle"],Qq=["floorLabel"],Jq=["ceilLabel"],eW=["minHandleLabel"],tW=["maxHandleLabel"],iW=["combinedLabel"],nW=["ticksElement"];function rW(i,e){if(i&1&&Z(0,"ngx-slider-tooltip-wrapper",32),i&2){let r=q().$implicit,t=q();N("template",t.tooltipTemplate)("tooltip",r.valueTooltip)("placement",r.valueTooltipPlacement)("content",r.value)}}function oW(i,e){if(i&1&&Z(0,"span",33),i&2){let r=q().$implicit;N("innerText",r.legend)}}function sW(i,e){if(i&1&&Z(0,"span",34),i&2){let r=q().$implicit;N("innerHTML",r.legend,OO)}}var aW=i=>({"ngx-slider-selected":i});function lW(i,e){if(i&1&&(S(0,"span",27),Z(1,"ngx-slider-tooltip-wrapper",28),ce(2,rW,1,4,"ngx-slider-tooltip-wrapper",29)(3,oW,1,1,"span",30)(4,sW,1,1,"span",31),E()),i&2){let r=e.$implicit,t=q();N("ngClass",kt(8,aW,r.selected))("ngStyle",r.style),P(1),N("template",t.tooltipTemplate)("tooltip",r.tooltip)("placement",r.tooltipPlacement),P(1),N("ngIf",r.value!=null),P(1),N("ngIf",r.legend!=null&&t.allowUnsafeHtmlInSlider===!1),P(1),N("ngIf",r.legend!=null&&(t.allowUnsafeHtmlInSlider==null||t.allowUnsafeHtmlInSlider))}}var gl=function(i){return i[i.Low=0]="Low",i[i.High=1]="High",i[i.Floor=2]="Floor",i[i.Ceil=3]="Ceil",i[i.TickValue=4]="TickValue",i}(gl||{}),Sf=class{floor=0;ceil=null;step=1;minRange=null;maxRange=null;pushRange=!1;minLimit=null;maxLimit=null;translate=null;combineLabels=null;getLegend=null;getStepLegend=null;stepsArray=null;bindIndexForStepsArray=!1;draggableRange=!1;draggableRangeOnly=!1;showSelectionBar=!1;showSelectionBarEnd=!1;showSelectionBarFromValue=null;showOuterSelectionBars=!1;hidePointerLabels=!1;hideLimitLabels=!1;autoHideLimitLabels=!0;readOnly=!1;disabled=!1;showTicks=!1;showTicksValues=!1;tickStep=null;tickValueStep=null;ticksArray=null;ticksTooltip=null;ticksValuesTooltip=null;vertical=!1;getSelectionBarColor=null;getTickColor=null;getPointerColor=null;keyboardSupport=!0;scale=1;rotate=0;enforceStep=!0;enforceRange=!0;enforceStepsArray=!0;noSwitching=!1;onlyBindHandles=!1;rightToLeft=!1;reversedControls=!1;boundPointerLabels=!0;logScale=!1;customValueToPosition=null;customPositionToValue=null;precisionLimit=12;selectionBarGradient=null;ariaLabel="ngx-slider";ariaLabelledBy=null;ariaLabelHigh="ngx-slider-max";ariaLabelledByHigh=null;handleDimension=null;barDimension=null;animate=!0;animateOnMove=!1},_3=new Ct("AllowUnsafeHtmlInSlider"),Ht=function(i){return i[i.Min=0]="Min",i[i.Max=1]="Max",i}(Ht||{}),CI=class{value;highValue;pointerType},ct=class{static isNullOrUndefined(e){return e==null}static areArraysEqual(e,r){if(e.length!==r.length)return!1;for(let t=0;t<e.length;++t)if(e[t]!==r[t])return!1;return!0}static linearValueToPosition(e,r,t){let o=t-r;return(e-r)/o}static logValueToPosition(e,r,t){e=Math.log(e),r=Math.log(r),t=Math.log(t);let o=t-r;return(e-r)/o}static linearPositionToValue(e,r,t){return e*(t-r)+r}static logPositionToValue(e,r,t){r=Math.log(r),t=Math.log(t);let o=e*(t-r)+r;return Math.exp(o)}static findStepIndex(e,r){let t=r.map(n=>Math.abs(e-n.value)),o=0;for(let n=0;n<r.length;n++)t[n]!==t[o]&&t[n]<t[o]&&(o=n);return o}}
1325,_l=class{static isTouchEvent(e){return window.TouchEvent!==void 0?e instanceof TouchEvent:e.touches!==void 0}static isResizeObserverAvailable(){return window.ResizeObserver!==void 0}},_r=class{static roundToPrecisionLimit(e,r){return+e.toPrecision(r)}static isModuloWithinPrecisionLimit(e,r,t){let o=Math.pow(10,-t);return Math.abs(e%r)<=o||Math.abs(Math.abs(e%r)-r)<=o}static clampToRange(e,r,t){return Math.min(Math.max(e,r),t)}},Ox=class{eventName=null;events=null;eventsSubscription=null;teardownCallback=null},Rx=class{renderer;constructor(e){this.renderer=e}attachPassiveEventListener(e,r,t,o){if(Px!==!0)return this.attachEventListener(e,r,t,o);let n=new Ox;n.eventName=r,n.events=new Jt;let d=_=>{n.events.next(_)};return e.addEventListener(r,d,{passive:!0,capture:!1}),n.teardownCallback=()=>{e.removeEventListener(r,d,{passive:!0,capture:!1})},n.eventsSubscription=n.events.pipe(ct.isNullOrUndefined(o)?Vi(()=>{}):kp(o,void 0,{leading:!0,trailing:!0})).subscribe(_=>{t(_)}),n}detachEventListener(e){ct.isNullOrUndefined(e.eventsSubscription)||(e.eventsSubscription.unsubscribe(),e.eventsSubscription=null),ct.isNullOrUndefined(e.events)||(e.events.complete(),e.events=null),ct.isNullOrUndefined(e.teardownCallback)||(e.teardownCallback(),e.teardownCallback=null)}attachEventListener(e,r,t,o){let n=new Ox;n.eventName=r,n.events=new Jt;let d=_=>{n.events.next(_)};return n.teardownCallback=this.renderer.listen(e,r,d),n.eventsSubscription=n.events.pipe(ct.isNullOrUndefined(o)?Vi(()=>{}):kp(o,void 0,{leading:!0,trailing:!0})).subscribe(_=>{t(_)}),n}},gu=(()=>{class i{elemRef;renderer;changeDetectionRef;_position=0;get position(){return this._position}_dimension=0;get dimension(){return this._dimension}_alwaysHide=!1;get alwaysHide(){return this._alwaysHide}_vertical=!1;get vertical(){return this._vertical}_scale=1;get scale(){return this._scale}_rotate=0;get rotate(){return this._rotate}opacity=1;visibility="visible";left="";bottom="";height="";width="";transform="";eventListenerHelper;eventListeners=[];constructor(r,t,o){this.elemRef=r,this.renderer=t,this.changeDetectionRef=o,this.eventListenerHelper=new Rx(this.renderer)}setAlwaysHide(r){this._alwaysHide=r,r?this.visibility="hidden":this.visibility="visible"}hide(){this.opacity=0}show(){this.alwaysHide||(this.opacity=1)}isVisible(){return this.alwaysHide?!1:this.opacity!==0}setVertical(r){this._vertical=r,this._vertical?(this.left="",this.width=""):(this.bottom="",this.height="")}setScale(r){this._scale=r}setRotate(r){this._rotate=r,this.transform="rotate("+r+"deg)"}getRotate(){return this._rotate}setPosition(r){this._position!==r&&!this.isRefDestroyed()&&this.changeDetectionRef.markForCheck(),this._position=r,this._vertical?this.bottom=Math.round(r)+"px":this.left=Math.round(r)+"px"}calculateDimension(){let r=this.getBoundingClientRect();this.vertical?this._dimension=(r.bottom-r.top)*this.scale:this._dimension=(r.right-r.left)*this.scale}setDimension(r){this._dimension!==r&&!this.isRefDestroyed()&&this.changeDetectionRef.markForCheck(),this._dimension=r,this._vertical?this.height=Math.round(r)+"px":this.width=Math.round(r)+"px"}getBoundingClientRect(){return this.elemRef.nativeElement.getBoundingClientRect()}on(r,t,o){let n=this.eventListenerHelper.attachEventListener(this.elemRef.nativeElement,r,t,o);this.eventListeners.push(n)}onPassive(r,t,o){let n=this.eventListenerHelper.attachPassiveEventListener(this.elemRef.nativeElement,r,t,o);this.eventListeners.push(n)}off(r){let t,o;ct.isNullOrUndefined(r)?(t=[],o=this.eventListeners):(t=this.eventListeners.filter(n=>n.eventName!==r),o=this.eventListeners.filter(n=>n.eventName===r));for(let n of o)this.eventListenerHelper.detachEventListener(n);this.eventListeners=t}isRefDestroyed(){return ct.isNullOrUndefined(this.changeDetectionRef)||this.changeDetectionRef.destroyed}static \u0275fac=function(t){return new(t||i)(ae(Pi),ae(eo),ae(Or))};static \u0275dir=bi({type:i,selectors:[["","ngxSliderElement",""]],hostVars:14,hostBindings:function(t,o){t&2&&lu("opacity",o.opacity)("visibility",o.visibility)("left",o.left)("bottom",o.bottom)("height",o.height)("width",o.width)("transform",o.transform)}})}return i})(),wI=(()=>{class i extends gu{active=!1;role="";tabindex="";ariaOrientation="";ariaLabel="";ariaLabelledBy="";ariaValueNow="";ariaValueText="";ariaValueMin="";ariaValueMax="";focus(){this.elemRef.nativeElement.focus()}constructor(r,t,o){super(r,t,o)}static \u0275fac=function(t){return new(t||i)(ae(Pi),ae(eo),ae(Or))};static \u0275dir=bi({type:i,selectors:[["","ngxSliderHandle",""]],hostVars:11,hostBindings:function(t,o){t&2&&(Bn("role",o.role)("tabindex",o.tabindex)("aria-orientation",o.ariaOrientation)("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledBy)("aria-valuenow",o.ariaValueNow)("aria-valuetext",o.ariaValueText)("aria-valuemin",o.ariaValueMin)("aria-valuemax",o.ariaValueMax),Yi("ngx-slider-active",o.active))},features:[Xn]})}return i})(),Ef=(()=>{class i extends gu{allowUnsafeHtmlInSlider;_value=null;get value(){return this._value}constructor(r,t,o,n){super(r,t,o),this.allowUnsafeHtmlInSlider=n}setValue(r){let t=!1;!this.alwaysHide&&(ct.isNullOrUndefined(this.value)||this.value.length!==r.length||this.value.length>0&&this.dimension===0)&&(t=!0),this._value=r,this.allowUnsafeHtmlInSlider===!1?this.elemRef.nativeElement.innerText=r:this.elemRef.nativeElement.innerHTML=r,t&&this.calculateDimension()}static \u0275fac=function(t){return new(t||i)(ae(Pi),ae(eo),ae(Or),ae(_3,8))};static \u0275dir=bi({type:i,selectors:[["","ngxSliderLabel",""]],features:[Xn]})}return i})(),cW=(()=>{class i{template;tooltip;placement;content;static \u0275fac=function(t){return new(t||i)};static \u0275cmp=st({type:i,selectors:[["ngx-slider-tooltip-wrapper"]],inputs:{template:"template",tooltip:"tooltip",placement:"placement",content:"content"},decls:2,vars:2,consts:[[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ngx-slider-inner-tooltip"]],template:function(t,o){t&1&&ce(0,Hq,2,6,"ng-container",0)(1,$q,3,3,"ng-container",0),t&2&&(N("ngIf",o.template),P(1),N("ngIf",!o.template))},dependencies:[At,pL],styles:[".ngx-slider-inner-tooltip[_ngcontent-%COMP%]{height:100%}"]})}return i})(),EI=class{selected=!1;style={};tooltip=null;tooltipPlacement=null;value=null;valueTooltip=null;valueTooltipPlacement=null;legend=null},Lx=class{active=!1;value=0;difference=0;position=0;lowLimit=0;highLimit=0},Tf=class{value;highValue;static compare(e,r){return ct.isNullOrUndefined(e)&&ct.isNullOrUndefined(r)||ct.isNullOrUndefined(e)!==ct.isNullOrUndefined(r)?!1:e.value===r.value&&e.highValue===r.highValue}},Fx=class extends Tf{forceChange;static compare(e,r){return ct.isNullOrUndefined(e)&&ct.isNullOrUndefined(r)||ct.isNullOrUndefined(e)!==ct.isNullOrUndefined(r)?!1:e.value===r.value&&e.highValue===r.highValue&&e.forceChange===r.forceChange}};var uW={provide:Qs,useExisting:Jr(()=>q_),multi:!0},q_=(()=>{class i{renderer;elementRef;changeDetectionRef;zone;allowUnsafeHtmlInSlider;value=null;valueChange=new Fe;highValue=null;highValueChange=new Fe;options=new Sf;userChangeStart=new Fe;userChange=new Fe;userChangeEnd=new Fe;manualRefreshSubscription;set manualRefresh(r){this.unsubscribeManualRefresh(),this.manualRefreshSubscription=r.subscribe(()=>{setTimeout(()=>this.calculateViewDimensionsAndDetectChanges())})}triggerFocusSubscription;set triggerFocus(r){this.unsubscribeTriggerFocus(),this.triggerFocusSubscription=r.subscribe(t=>{this.focusPointer(t)})}get range(){return!ct.isNullOrUndefined(this.value)&&!ct.isNullOrUndefined(this.highValue)}initHasRun=!1;
1325inputModelChangeSubject=new Jt;inputModelChangeSubscription=null;outputModelChangeSubject=new Jt;outputModelChangeSubscription=null;viewLowValue=null;viewHighValue=null;viewOptions=new Sf;handleHalfDimension=0;maxHandlePosition=0;currentTrackingPointer=null;currentFocusPointer=null;firstKeyDown=!1;touchId=null;dragging=new Lx;leftOuterSelectionBarElement;rightOuterSelectionBarElement;fullBarElement;selectionBarElement;minHandleElement;maxHandleElement;floorLabelElement;ceilLabelElement;minHandleLabelElement;maxHandleLabelElement;combinedLabelElement;ticksElement;tooltipTemplate;sliderElementVerticalClass=!1;sliderElementAnimateClass=!1;sliderElementWithLegendClass=!1;sliderElementDisabledAttr=null;sliderElementAriaLabel="ngx-slider";barStyle={};minPointerStyle={};maxPointerStyle={};fullBarTransparentClass=!1;selectionBarDraggableClass=!1;ticksUnderValuesClass=!1;get showTicks(){return this.viewOptions.showTicks}intermediateTicks=!1;ticks=[];eventListenerHelper=null;onMoveEventListener=null;onEndEventListener=null;moving=!1;resizeObserver=null;onTouchedCallback=null;onChangeCallback=null;constructor(r,t,o,n,d){this.renderer=r,this.elementRef=t,this.changeDetectionRef=o,this.zone=n,this.allowUnsafeHtmlInSlider=d,this.eventListenerHelper=new Rx(this.renderer)}ngOnInit(){this.viewOptions=new Sf,Object.assign(this.viewOptions,this.options),this.updateDisabledState(),this.updateVerticalState(),this.updateAriaLabel()}ngAfterViewInit(){this.applyOptions(),this.subscribeInputModelChangeSubject(),this.subscribeOutputModelChangeSubject(),this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.range?this.viewHighValue=this.modelValueToViewValue(this.highValue):this.viewHighValue=null,this.updateVerticalState(),this.manageElementsStyle(),this.updateDisabledState(),this.calculateViewDimensions(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),this.initHandles(),this.manageEventsBindings(),this.updateAriaLabel(),this.subscribeResizeObserver(),this.initHasRun=!0,this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}ngOnChanges(r){!ct.isNullOrUndefined(r.options)&&JSON.stringify(r.options.previousValue)!==JSON.stringify(r.options.currentValue)&&this.onChangeOptions(),(!ct.isNullOrUndefined(r.value)||!ct.isNullOrUndefined(r.highValue))&&this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}ngOnDestroy(){this.unbindEvents(),this.unsubscribeResizeObserver(),this.unsubscribeInputModelChangeSubject(),this.unsubscribeOutputModelChangeSubject(),this.unsubscribeManualRefresh(),this.unsubscribeTriggerFocus()}writeValue(r){r instanceof Array?(this.value=r[0],this.highValue=r[1]):this.value=r,this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!1})}registerOnChange(r){this.onChangeCallback=r}registerOnTouched(r){this.onTouchedCallback=r}setDisabledState(r){this.viewOptions.disabled=r,this.updateDisabledState()}setAriaLabel(r){this.viewOptions.ariaLabel=r,this.updateAriaLabel()}onResize(r){this.calculateViewDimensionsAndDetectChanges()}subscribeInputModelChangeSubject(){this.inputModelChangeSubscription=this.inputModelChangeSubject.pipe(kd(Fx.compare),dn(r=>!r.forceChange&&!r.internalChange)).subscribe(r=>this.applyInputModelChange(r))}subscribeOutputModelChangeSubject(){this.outputModelChangeSubscription=this.outputModelChangeSubject.pipe(kd(Fx.compare)).subscribe(r=>this.publishOutputModelChange(r))}subscribeResizeObserver(){_l.isResizeObserverAvailable()&&(this.resizeObserver=new ResizeObserver(()=>this.calculateViewDimensionsAndDetectChanges()),this.resizeObserver.observe(this.elementRef.nativeElement))}unsubscribeResizeObserver(){_l.isResizeObserverAvailable()&&this.resizeObserver!==null&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}unsubscribeOnMove(){ct.isNullOrUndefined(this.onMoveEventListener)||(this.eventListenerHelper.detachEventListener(this.onMoveEventListener),this.onMoveEventListener=null)}unsubscribeOnEnd(){ct.isNullOrUndefined(this.onEndEventListener)||(this.eventListenerHelper.detachEventListener(this.onEndEventListener),this.onEndEventListener=null)}unsubscribeInputModelChangeSubject(){ct.isNullOrUndefined(this.inputModelChangeSubscription)||(this.inputModelChangeSubscription.unsubscribe(),this.inputModelChangeSubscription=null)}unsubscribeOutputModelChangeSubject(){ct.isNullOrUndefined(this.outputModelChangeSubscription)||(this.outputModelChangeSubscription.unsubscribe(),this.outputModelChangeSubscription=null)}unsubscribeManualRefresh(){ct.isNullOrUndefined(this.manualRefreshSubscription)||(this.manualRefreshSubscription.unsubscribe(),this.manualRefreshSubscription=null)}unsubscribeTriggerFocus(){ct.isNullOrUndefined(this.triggerFocusSubscription)||(this.triggerFocusSubscription.unsubscribe(),this.triggerFocusSubscription=null)}getPointerElement(r){return r===Ht.Min?this.minHandleElement:r===Ht.Max?this.maxHandleElement:null}getCurrentTrackingValue(){return this.currentTrackingPointer===Ht.Min?this.viewLowValue:this.currentTrackingPointer===Ht.Max?this.viewHighValue:null}modelValueToViewValue(r){return ct.isNullOrUndefined(r)?NaN:!ct.
1325isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray?ct.findStepIndex(+r,this.viewOptions.stepsArray):+r}viewValueToModelValue(r){return!ct.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray?this.getStepValue(r):r}getStepValue(r){let t=this.viewOptions.stepsArray[r];return ct.isNullOrUndefined(t)?NaN:t.value}applyViewChange(){this.value=this.viewValueToModelValue(this.viewLowValue),this.range&&(this.highValue=this.viewValueToModelValue(this.viewHighValue)),this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,userEventInitiated:!0,forceChange:!1}),this.inputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!1,internalChange:!0})}applyInputModelChange(r){let t=this.normaliseModelValues(r),o=!Tf.compare(r,t);o&&(this.value=t.value,this.highValue=t.highValue),this.viewLowValue=this.modelValueToViewValue(t.value),this.range?this.viewHighValue=this.modelValueToViewValue(t.highValue):this.viewHighValue=null,this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateAriaAttributes(),this.range&&this.updateCombinedLabel(),this.outputModelChangeSubject.next({value:t.value,highValue:t.highValue,forceChange:o,userEventInitiated:!1})}publishOutputModelChange(r){let t=()=>{this.valueChange.emit(r.value),this.range&&this.highValueChange.emit(r.highValue),ct.isNullOrUndefined(this.onChangeCallback)||(this.range?this.onChangeCallback([r.value,r.highValue]):this.onChangeCallback(r.value)),ct.isNullOrUndefined(this.onTouchedCallback)||(this.range?this.onTouchedCallback([r.value,r.highValue]):this.onTouchedCallback(r.value))};r.userEventInitiated?(t(),this.userChange.emit(this.getChangeContext())):setTimeout(()=>{t()})}normaliseModelValues(r){let t=new Tf;if(t.value=r.value,t.highValue=r.highValue,!ct.isNullOrUndefined(this.viewOptions.stepsArray)){if(this.viewOptions.enforceStepsArray){let o=ct.findStepIndex(t.value,this.viewOptions.stepsArray);if(t.value=this.viewOptions.stepsArray[o].value,this.range){let n=ct.findStepIndex(t.highValue,this.viewOptions.stepsArray);t.highValue=this.viewOptions.stepsArray[n].value}}return t}if(this.viewOptions.enforceStep&&(t.value=this.roundStep(t.value),this.range&&(t.highValue=this.roundStep(t.highValue))),this.viewOptions.enforceRange&&(t.value=_r.clampToRange(t.value,this.viewOptions.floor,this.viewOptions.ceil),this.range&&(t.highValue=_r.clampToRange(t.highValue,this.viewOptions.floor,this.viewOptions.ceil)),this.range&&r.value>r.highValue))if(this.viewOptions.noSwitching)t.value=t.highValue;else{let o=r.value;t.value=r.highValue,t.highValue=o}return t}renormaliseModelValues(){let r={value:this.value,highValue:this.highValue},t=this.normaliseModelValues(r);Tf.compare(t,r)||(this.value=t.value,this.highValue=t.highValue,this.outputModelChangeSubject.next({value:this.value,highValue:this.highValue,forceChange:!0,userEventInitiated:!1}))}onChangeOptions(){if(!this.initHasRun)return;let r=this.getOptionsInfluencingEventBindings(this.viewOptions);this.applyOptions();let t=this.getOptionsInfluencingEventBindings(this.viewOptions),o=!ct.areArraysEqual(r,t);this.renormaliseModelValues(),this.viewLowValue=this.modelValueToViewValue(this.value),this.range?this.viewHighValue=this.modelValueToViewValue(this.highValue):this.viewHighValue=null,this.resetSlider(o)}applyOptions(){if(this.viewOptions=new Sf,Object.assign(this.viewOptions,this.options),this.viewOptions.draggableRange=this.range&&this.viewOptions.draggableRange,this.viewOptions.draggableRangeOnly=this.range&&this.viewOptions.draggableRangeOnly,this.viewOptions.draggableRangeOnly&&(this.viewOptions.draggableRange=!0),this.viewOptions.showTicks=this.viewOptions.showTicks||this.viewOptions.showTicksValues||!ct.isNullOrUndefined(this.viewOptions.ticksArray),this.viewOptions.showTicks&&(!ct.isNullOrUndefined(this.viewOptions.tickStep)||!ct.isNullOrUndefined(this.viewOptions.ticksArray))&&(this.intermediateTicks=!0),this.viewOptions.showSelectionBar=this.viewOptions.showSelectionBar||this.viewOptions.showSelectionBarEnd||!ct.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue),ct.isNullOrUndefined(this.viewOptions.stepsArray)?this.applyFloorCeilOptions():this.applyStepsArrayOptions(),ct.isNullOrUndefined(this.viewOptions.combineLabels)&&(this.viewOptions.combineLabels=(r,t)=>r+" - "+t),this.viewOptions.logScale&&this.viewOptions.floor===0)throw Error("Can't use floor=0 with logarithmic scale")}
1325applyStepsArrayOptions(){this.viewOptions.floor=0,this.viewOptions.ceil=this.viewOptions.stepsArray.length-1,this.viewOptions.step=1,ct.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=r=>this.viewOptions.bindIndexForStepsArray?String(this.getStepValue(r)):String(r))}applyFloorCeilOptions(){if(ct.isNullOrUndefined(this.viewOptions.step)?this.viewOptions.step=1:(this.viewOptions.step=+this.viewOptions.step,this.viewOptions.step<=0&&(this.viewOptions.step=1)),ct.isNullOrUndefined(this.viewOptions.ceil)||ct.isNullOrUndefined(this.viewOptions.floor))throw Error("floor and ceil options must be supplied");this.viewOptions.ceil=+this.viewOptions.ceil,this.viewOptions.floor=+this.viewOptions.floor,ct.isNullOrUndefined(this.viewOptions.translate)&&(this.viewOptions.translate=r=>String(r))}resetSlider(r=!0){this.manageElementsStyle(),this.addAccessibility(),this.updateCeilLabel(),this.updateFloorLabel(),r&&(this.unbindEvents(),this.manageEventsBindings()),this.updateDisabledState(),this.updateAriaLabel(),this.calculateViewDimensions()}focusPointer(r){r!==Ht.Min&&r!==Ht.Max&&(r=Ht.Min),r===Ht.Min?this.minHandleElement.focus():this.range&&r===Ht.Max&&this.maxHandleElement.focus()}refocusPointerIfNeeded(){ct.isNullOrUndefined(this.currentFocusPointer)||(this.onPointerFocus(this.currentFocusPointer),this.getPointerElement(this.currentFocusPointer).focus())}manageElementsStyle(){this.updateScale(),this.floorLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels),this.ceilLabelElement.setAlwaysHide(this.viewOptions.showTicksValues||this.viewOptions.hideLimitLabels);let r=this.viewOptions.showTicksValues&&!this.intermediateTicks;this.minHandleLabelElement.setAlwaysHide(r||this.viewOptions.hidePointerLabels),this.maxHandleLabelElement.setAlwaysHide(r||!this.range||this.viewOptions.hidePointerLabels),this.combinedLabelElement.setAlwaysHide(r||!this.range||this.viewOptions.hidePointerLabels),this.selectionBarElement.setAlwaysHide(!this.range&&!this.viewOptions.showSelectionBar),this.leftOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.rightOuterSelectionBarElement.setAlwaysHide(!this.range||!this.viewOptions.showOuterSelectionBars),this.fullBarTransparentClass=this.range&&this.viewOptions.showOuterSelectionBars,this.selectionBarDraggableClass=this.viewOptions.draggableRange&&!this.viewOptions.onlyBindHandles,this.ticksUnderValuesClass=this.intermediateTicks&&this.options.showTicksValues,this.sliderElementVerticalClass!==this.viewOptions.vertical&&(this.updateVerticalState(),setTimeout(()=>{this.resetSlider()})),this.sliderElementAnimateClass!==this.viewOptions.animate&&setTimeout(()=>{this.sliderElementAnimateClass=this.viewOptions.animate}),this.updateRotate()}manageEventsBindings(){this.viewOptions.disabled||this.viewOptions.readOnly?this.unbindEvents():this.bindEvents()}updateDisabledState(){this.sliderElementDisabledAttr=this.viewOptions.disabled?"disabled":null}updateAriaLabel(){this.sliderElementAriaLabel=this.viewOptions.ariaLabel||"nxg-slider"}updateVerticalState(){this.sliderElementVerticalClass=this.viewOptions.vertical;for(let r of this.getAllSliderElements())ct.isNullOrUndefined(r)||r.setVertical(this.viewOptions.vertical)}updateScale(){for(let r of this.getAllSliderElements())r.setScale(this.viewOptions.scale)}updateRotate(){for(let r of this.getAllSliderElements())r.setRotate(this.viewOptions.rotate)}getAllSliderElements(){return[this.leftOuterSelectionBarElement,this.rightOuterSelectionBarElement,this.fullBarElement,this.selectionBarElement,this.minHandleElement,this.maxHandleElement,this.floorLabelElement,this.ceilLabelElement,this.minHandleLabelElement,this.maxHandleLabelElement,this.combinedLabelElement,this.ticksElement]}initHandles(){this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateSelectionBar(),this.range&&this.updateCombinedLabel(),this.updateTicksScale()}addAccessibility(){this.updateAriaAttributes(),this.minHandleElement.role="slider",this.viewOptions.keyboardSupport&&!(this.viewOptions.readOnly||this.viewOptions.disabled)?this.minHandleElement.tabindex="0":this.minHandleElement.tabindex="",this.minHandleElement.ariaOrientation=this.viewOptions.vertical||this.viewOptions.rotate!==0?"vertical":"horizontal",ct.isNullOrUndefined(this.viewOptions.ariaLabel)?ct.isNullOrUndefined(this.viewOptions.ariaLabelledBy)||(this.minHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledBy):this.minHandleElement.ariaLabel=this.viewOptions.ariaLabel,this.range&&(this.maxHandleElement.role="slider",this.viewOptions.keyboardSupport&&!(this.viewOptions.readOnly||this.viewOptions.disabled)?this.maxHandleElement.tabindex="0":this.maxHandleElement.tabindex="",this.maxHandleElement.ariaOrientation=this.viewOptions.vertical||this.viewOptions.rotate!==0?"vertical":"horizontal",ct.isNullOrUndefined(this.viewOptions.ariaLabelHigh)?ct.isNullOrUndefined(this.viewOptions.ariaLabelledByHigh)||(this.maxHandleElement.ariaLabelledBy=this.viewOptions.ariaLabelledByHigh):this.maxHandleElement.ariaLabel=this.viewOptions.ariaLabelHigh)}updateAriaAttributes(){this.minHandleElement.ariaValueNow=(+this.value).toString(),this.minHandleElement.ariaValueText=this.viewOptions.translate(+this.value,gl.Low),this.minHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.minHandleElement.ariaValueMax=this.viewOptions.ceil.toString(),this.range&&(this.maxHandleElement.ariaValueNow=(+this.highValue).toString(),this.maxHandleElement.ariaValueText=this.viewOptions.translate(+this.highValue,gl.High),this.maxHandleElement.ariaValueMin=this.viewOptions.floor.toString(),this.maxHandleElement.ariaValueMax=this.viewOptions.ceil.toString())}calculateViewDimensions(){ct.isNullOrUndefined(this.viewOptions.handleDimension)?this.minHandleElement.calculateDimension():this.minHandleElement.setDimension(this.viewOptions.handleDimension);let r=this.minHandleElement.dimension;this.handleHalfDimension=r/2,ct.isNullOrUndefined(this.viewOptions.barDimension)?this.fullBarElement.calculateDimension():this.fullBarElement.setDimension(this.viewOptions.barDimension),this.maxHandlePosition=this.fullBarElement.dimension-r,this.initHasRun&&(this.updateFloorLabel(),this.updateCeilLabel(),this.initHandles())}calculateViewDimensionsAndDetectChanges(){this.calculateViewDimensions(),this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}isRefDestroyed(){return this.changeDetectionRef.destroyed}updateTicksScale(){if(!this.viewOptions.showTicks&&this.sliderElementWithLegendClass){setTimeout(()=>{this.sliderElementWithLegendClass=!1});return}let r=ct.isNullOrUndefined(this.viewOptions.ticksArray)?this.getTicksArray():this.viewOptions.ticksArray,t=this.viewOptions.vertical?"translateY":"translateX";this.viewOptions.rightToLeft&&r.reverse();let o=ct.isNullOrUndefined(this.viewOptions.tickValueStep)?ct.isNullOrUndefined(this.viewOptions.tickStep)?this.viewOptions.step:this.viewOptions.tickStep:this.viewOptions.tickValueStep,n=!1,d=r.map(_=>{let C=this.valueToPosition(_);this.viewOptions.vertical&&(C=this.maxHandlePosition-C);let M=t+"("+Math.round(C)+"px)",j=new EI;j.selected=this.isTickSelected(_),j.style={"-webkit-transform":M,"-moz-transform":M,"-o-transform":M,"-ms-transform":M,transform:M},j.selected&&!ct.isNullOrUndefined(this.viewOptions.getSelectionBarColor)&&(j.style["background-color"]=this.getSelectionBarColor()),!j.selected&&!ct.isNullOrUndefined(this.viewOptions.getTickColor)&&(j.style["background-color"]=this.getTickColor(_)),ct.isNullOrUndefined(this.viewOptions.ticksTooltip)||(j.tooltip=this.viewOptions.ticksTooltip(_),j.tooltipPlacement=this.viewOptions.vertical?"right":"top"),this.viewOptions.showTicksValues&&!ct.isNullOrUndefined(o)&&_r.isModuloWithinPrecisionLimit(_,o,this.viewOptions.precisionLimit)&&(j.value=this.getDisplayValue(_,gl.TickValue),ct.isNullOrUndefined(this.viewOptions.ticksValuesTooltip)||(j.valueTooltip=this.viewOptions.ticksValuesTooltip(_),j.valueTooltipPlacement=this.viewOptions.vertical?"right":"top"));let G=null;if(ct.isNullOrUndefined(this.viewOptions.stepsArray))ct.isNullOrUndefined(this.viewOptions.getLegend)||(G=this.viewOptions.getLegend(_));else{let ie=this.viewOptions.stepsArray[_];ct.isNullOrUndefined(this.viewOptions.getStepLegend)?ct.isNullOrUndefined(ie)||(G=ie.legend):G=this.viewOptions.getStepLegend(ie)}return ct.isNullOrUndefined(G)||(j.legend=G,n=!0),j});if(this.sliderElementWithLegendClass!==n&&setTimeout(()=>{this.sliderElementWithLegendClass=n}),!ct.isNullOrUndefined(this.ticks)&&this.ticks.length===d.length)for(let _=0;_<d.length;++_)Object.assign(this.ticks[_],d[_]);else this.ticks=d,this.isRefDestroyed()||this.changeDetectionRef.detectChanges()}getTicksArray(){let r=ct.isNullOrUndefined(this.viewOptions.tickStep)?this.viewOptions.step:this.viewOptions.tickStep,t=[],o=1+Math.floor(_r.roundToPrecisionLimit(Math.abs(this.viewOptions.ceil-this.viewOptions.floor)/r,this.viewOptions.precisionLimit));for(let n=0;n<o;++n)t.push(_r.roundToPrecisionLimit(this.viewOptions.floor+r*n,this.viewOptions.precisionLimit));return t}isTickSelected(r){if(!this.range)if(ct.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue)){if(this.viewOptions.showSelectionBarEnd){if
1325(r>=this.viewLowValue)return!0}else if(this.viewOptions.showSelectionBar&&r<=this.viewLowValue)return!0}else{let t=this.viewOptions.showSelectionBarFromValue;if(this.viewLowValue>t&&r>=t&&r<=this.viewLowValue)return!0;if(this.viewLowValue<t&&r<=t&&r>=this.viewLowValue)return!0}return!!(this.range&&r>=this.viewLowValue&&r<=this.viewHighValue)}updateFloorLabel(){if(!this.floorLabelElement.alwaysHide){this.floorLabelElement.setValue(this.getDisplayValue(this.viewOptions.floor,gl.Floor)),this.floorLabelElement.calculateDimension();let r=this.viewOptions.rightToLeft?this.fullBarElement.dimension-this.floorLabelElement.dimension:0;this.floorLabelElement.setPosition(r)}}updateCeilLabel(){if(!this.ceilLabelElement.alwaysHide){this.ceilLabelElement.setValue(this.getDisplayValue(this.viewOptions.ceil,gl.Ceil)),this.ceilLabelElement.calculateDimension();let r=this.viewOptions.rightToLeft?0:this.fullBarElement.dimension-this.ceilLabelElement.dimension;this.ceilLabelElement.setPosition(r)}}updateHandles(r,t){r===Ht.Min?this.updateLowHandle(t):r===Ht.Max&&this.updateHighHandle(t),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCombinedLabel()}getHandleLabelPos(r,t){let o=r===Ht.Min?this.minHandleLabelElement.dimension:this.maxHandleLabelElement.dimension,n=t-o/2+this.handleHalfDimension,d=this.fullBarElement.dimension-o;return this.viewOptions.boundPointerLabels?this.viewOptions.rightToLeft&&r===Ht.Min||!this.viewOptions.rightToLeft&&r===Ht.Max?Math.min(n,d):Math.min(Math.max(n,0),d):n}updateLowHandle(r){this.minHandleElement.setPosition(r),this.minHandleLabelElement.setValue(this.getDisplayValue(this.viewLowValue,gl.Low)),this.minHandleLabelElement.setPosition(this.getHandleLabelPos(Ht.Min,r)),ct.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.minPointerStyle={backgroundColor:this.getPointerColor(Ht.Min)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateHighHandle(r){this.maxHandleElement.setPosition(r),this.maxHandleLabelElement.setValue(this.getDisplayValue(this.viewHighValue,gl.High)),this.maxHandleLabelElement.setPosition(this.getHandleLabelPos(Ht.Max,r)),ct.isNullOrUndefined(this.viewOptions.getPointerColor)||(this.maxPointerStyle={backgroundColor:this.getPointerColor(Ht.Max)}),this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}updateFloorAndCeilLabelsVisibility(){if(this.viewOptions.hidePointerLabels)return;let r=!1,t=!1,o=this.isLabelBelowFloorLabel(this.minHandleLabelElement),n=this.isLabelAboveCeilLabel(this.minHandleLabelElement),d=this.isLabelAboveCeilLabel(this.maxHandleLabelElement),_=this.isLabelBelowFloorLabel(this.combinedLabelElement),C=this.isLabelAboveCeilLabel(this.combinedLabelElement);if(o?(r=!0,this.floorLabelElement.hide()):(r=!1,this.floorLabelElement.show()),n?(t=!0,this.ceilLabelElement.hide()):(t=!1,this.ceilLabelElement.show()),this.range){let M=this.combinedLabelElement.isVisible()?C:d,j=this.combinedLabelElement.isVisible()?_:o;M?this.ceilLabelElement.hide():t||this.ceilLabelElement.show(),j?this.floorLabelElement.hide():r||this.floorLabelElement.show()}}isLabelBelowFloorLabel(r){let t=r.position,o=r.dimension,n=this.floorLabelElement.position,d=this.floorLabelElement.dimension;return this.viewOptions.rightToLeft?t+o>=n-2:t<=n+d+2}isLabelAboveCeilLabel(r){let t=r.position,o=r.dimension,n=this.ceilLabelElement.position,d=this.ceilLabelElement.dimension;return this.viewOptions.rightToLeft?t<=n+d+2:t+o>=n-2}updateSelectionBar(){let r=0,t=0,o=this.viewOptions.rightToLeft?!this.viewOptions.showSelectionBarEnd:this.viewOptions.showSelectionBarEnd,n=this.viewOptions.rightToLeft?this.maxHandleElement.position+this.handleHalfDimension:this.minHandleElement.position+this.handleHalfDimension;if(this.range)t=Math.abs(this.maxHandleElement.position-this.minHandleElement.position),r=n;else if(ct.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue))o?(t=Math.ceil(Math.abs(this.maxHandlePosition-this.minHandleElement.position)+this.handleHalfDimension),r=Math.floor(this.minHandleElement.position+this.handleHalfDimension)):(t=this.minHandleElement.position+this.handleHalfDimension,r=0);else{let d=this.viewOptions.showSelectionBarFromValue,_=this.valueToPosition(d);(this.viewOptions.rightToLeft?this.viewLowValue<=d:this.viewLowValue>d)?(t=this.minHandleElement.position-_,r=_+this.handleHalfDimension):(t=_-this.minHandleElement.position,r=this.minHandleElement.position+this.handleHalfDimension)}if(this.selectionBarElement.setDimension(t),this.selectionBarElement.setPosition(r),this.range&&this.viewOptions.showOuterSelectionBars&&(this.viewOptions.rightToLeft?(this.rightOuterSelectionBarElement.setDimension(r),this.rightOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.leftOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(r+t)),this.leftOuterSelectionBarElement.setPosition(r+t)):(this.leftOuterSelectionBarElement.setDimension(r),this.leftOuterSelectionBarElement.setPosition(0),this.fullBarElement.calculateDimension(),this.rightOuterSelectionBarElement.setDimension(this.fullBarElement.dimension-(r+t)),this.rightOuterSelectionBarElement.setPosition(r+t))),ct.isNullOrUndefined(this.viewOptions.getSelectionBarColor)){if(!ct.isNullOrUndefined(this.viewOptions.selectionBarGradient)){let d=ct.isNullOrUndefined(this.viewOptions.showSelectionBarFromValue)?0:this.valueToPosition(this.viewOptions.showSelectionBarFromValue),_=d-r>0&&!o||d-r<=0&&o,C=this.viewOptions.vertical?_?"bottom":"top":_?"left"
1325:"right";this.barStyle={backgroundImage:"linear-gradient(to "+C+", "+this.viewOptions.selectionBarGradient.from+" 0%,"+this.viewOptions.selectionBarGradient.to+" 100%)"},this.viewOptions.vertical?(this.barStyle.backgroundPosition="center "+(d+t+r+(_?-this.handleHalfDimension:0))+"px",this.barStyle.backgroundSize="100% "+(this.fullBarElement.dimension-this.handleHalfDimension)+"px"):(this.barStyle.backgroundPosition=d-r+(_?this.handleHalfDimension:0)+"px center",this.barStyle.backgroundSize=this.fullBarElement.dimension-this.handleHalfDimension+"px 100%")}}else{let d=this.getSelectionBarColor();this.barStyle={backgroundColor:d}}}getSelectionBarColor(){return this.range?this.viewOptions.getSelectionBarColor(this.value,this.highValue):this.viewOptions.getSelectionBarColor(this.value)}getPointerColor(r){return r===Ht.Max?this.viewOptions.getPointerColor(this.highValue,r):this.viewOptions.getPointerColor(this.value,r)}getTickColor(r){return this.viewOptions.getTickColor(r)}updateCombinedLabel(){let r=null;if(this.viewOptions.rightToLeft?r=this.minHandleLabelElement.position-this.minHandleLabelElement.dimension-10<=this.maxHandleLabelElement.position:r=this.minHandleLabelElement.position+this.minHandleLabelElement.dimension+10>=this.maxHandleLabelElement.position,r){let t=this.getDisplayValue(this.viewLowValue,gl.Low),o=this.getDisplayValue(this.viewHighValue,gl.High),n=this.viewOptions.rightToLeft?this.viewOptions.combineLabels(o,t):this.viewOptions.combineLabels(t,o);this.combinedLabelElement.setValue(n);let d=this.viewOptions.boundPointerLabels?Math.min(Math.max(this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2,0),this.fullBarElement.dimension-this.combinedLabelElement.dimension):this.selectionBarElement.position+this.selectionBarElement.dimension/2-this.combinedLabelElement.dimension/2;this.combinedLabelElement.setPosition(d),this.minHandleLabelElement.hide(),this.maxHandleLabelElement.hide(),this.combinedLabelElement.show()}else this.updateHighHandle(this.valueToPosition(this.viewHighValue)),this.updateLowHandle(this.valueToPosition(this.viewLowValue)),this.maxHandleLabelElement.show(),this.minHandleLabelElement.show(),this.combinedLabelElement.hide();this.viewOptions.autoHideLimitLabels&&this.updateFloorAndCeilLabelsVisibility()}getDisplayValue(r,t){return!ct.isNullOrUndefined(this.viewOptions.stepsArray)&&!this.viewOptions.bindIndexForStepsArray&&(r=this.getStepValue(r)),this.viewOptions.translate(r,t)}roundStep(r,t){let o=ct.isNullOrUndefined(t)?this.viewOptions.step:t,n=_r.roundToPrecisionLimit((r-this.viewOptions.floor)/o,this.viewOptions.precisionLimit);return n=Math.round(n)*o,_r.roundToPrecisionLimit(this.viewOptions.floor+n,this.viewOptions.precisionLimit)}valueToPosition(r){let t=ct.linearValueToPosition;ct.isNullOrUndefined(this.viewOptions.customValueToPosition)?this.viewOptions.logScale&&(t=ct.logValueToPosition):t=this.viewOptions.customValueToPosition,r=_r.clampToRange(r,this.viewOptions.floor,this.viewOptions.ceil);let o=t(r,this.viewOptions.floor,this.viewOptions.ceil);return ct.isNullOrUndefined(o)&&(o=0),this.viewOptions.rightToLeft&&(o=1-o),o*this.maxHandlePosition}positionToValue(r){let t=r/this.maxHandlePosition;this.viewOptions.rightToLeft&&(t=1-t);let o=ct.linearPositionToValue;ct.isNullOrUndefined(this.viewOptions.customPositionToValue)?this.viewOptions.logScale&&(o=ct.logPositionToValue):o=this.viewOptions.customPositionToValue;let n=o(t,this.viewOptions.floor,this.viewOptions.ceil);return ct.isNullOrUndefined(n)?0:n}getEventXY(r,t){if(r instanceof MouseEvent)return this.viewOptions.vertical||this.viewOptions.rotate!==0?r.clientY:r.clientX;let o=0,n=r.touches;if(!ct.isNullOrUndefined(t)){for(let d=0;d<n.length;d++)if(n[d].identifier===t){o=d;break}}return this.viewOptions.vertical||this.viewOptions.rotate!==0?n[o].clientY:n[o].clientX}getEventPosition(r,t){let o=this.elementRef.nativeElement.getBoundingClientRect(),n=this.viewOptions.vertical||this.viewOptions.rotate!==0?o.bottom:o.left,d=0;return this.viewOptions.vertical||this.viewOptions.rotate!==0?d=-this.getEventXY(r,t)+n:d=this.getEventXY(r,t)-n,d*this.viewOptions.scale-this.handleHalfDimension}getNearestHandle(r){if(!this.range)return Ht.Min;let t=this.getEventPosition(r),o=Math.abs(t-this.minHandleElement.position),n=Math.abs(t-this.maxHandleElement.position);return o<n?Ht.Min:o>n?Ht.Max:this.viewOptions.rightToLeft?t>this.minHandleElement.position?Ht.Min:Ht.Max:t<this.minHandleElement.position?Ht.Min:Ht.Max}bindEvents(){let r=this.viewOptions.draggableRange;this.viewOptions.onlyBindHandles||this.selectionBarElement.on("mousedown",t=>this.onBarStart(null,r,t,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.on("mousedown",t=>this.onBarStart(Ht.Min,r,t,!0,!0)),this.maxHandleElement.on("mousedown",t=>this.onBarStart(Ht.Max,r,t,!0,!0))):(this.minHandleElement.on("mousedown",t=>this.onStart(Ht.Min,t,!0,!0)),this.range&&this.maxHandleElement.on("mousedown",t=>this.onStart(Ht.Max,t,!0,!0)),this.viewOptions.onlyBindHandles||(this.fullBarElement.on("mousedown",t=>this.onStart(null,t,!0,!0,!0)),this.ticksElement.on("mousedown",t=>this.onStart(null,t,!0,!0,!0,!0)))),this.viewOptions.onlyBindHandles||this.selectionBarElement.onPassive("touchstart",t=>this.onBarStart(null,r,t,!0,!0,!0)),this.viewOptions.draggableRangeOnly?(this.minHandleElement.onPassive("touchstart",t=>this.onBarStart(Ht.Min,r,t,!0,!0)),this.maxHandleElement.onPassive("touchstart",t=>this.onBarStart(Ht.Max,r,t,!0,!0))):(this.minHandleElement.onPassive("touchstart",t=>this.onStart(Ht.Min,t,!0,!0)),this.range&&this.maxHandleElement.onPassive("touchstart",t=>this.onStart(Ht.Max,t,!0,!0)),this.viewOptions.onlyBindHandles||(this.fullBarElement.onPassive("touchstart",t=>this.onStart(null,t,!0,!0,!0)),this.ticksElement.onPassive("touchstart",t=>this.onStart(null,t,!1,!1,!0,!0)))),this.viewOptions.keyboardSupport&&(this.minHandleElement.on("focus",()=>this.onPointerFocus(Ht.Min)),this.range&&this.maxHandleElement.on("focus",()=>this.onPointerFocus(Ht.Max)))}getOptionsInfluencingEventBindings(r){return[r.disabled,r.readOnly,r.draggableRange,r.draggableRangeOnly,r.onlyBindHandles,r.keyboardSupport]}unbindEvents(){this.unsubscribeOnMove(),this.unsubscribeOnEnd();for(let r of this.getAllSliderElements())ct.isNullOrUndefined(r)||r.off()}onBarStart(r,t,o,n,d,_,C){t?this.onDragStart(r,o,n,d):this.onStart(r,o,n,d,_,C)}onStart(r,t,o,n,d,_){t.stopPropagation(),!_l.isTouchEvent(t)&&!Px&&t.preventDefault(),this.moving=!1,this.calculateViewDimensions(),ct.isNullOrUndefined(r)&&(r=this.getNearestHandle(t)),this.currentTrackingPointer=r;let C=this.getPointerElement(r);if(C.active=!0,this.viewOptions.keyboardSupport&&C.focus(),o){this.unsubscribeOnMove();let M=j=>this.dragging.active?this.onDragMove(j):this.onMove(j);_l.isTouchEvent(t)?this.onMoveEventListener=this.eventListenerHelper.attachPassiveEventListener(document,"touchmove",M):this.onMoveEventListener=this.eventListenerHelper.attachEventListener(document,"mousemove",M)}if(n){this.unsubscribeOnEnd();let M=j=>this.onEnd(j);_l.isTouchEvent(t)?this.onEndEventListener=this.eventListenerHelper.attachPassiveEventListener(document,"touchend",M):this.onEndEventListener=this.eventListenerHelper.attachEventListener(document,"mouseup",M)}this.userChangeStart.emit(this.getChangeContext()),_l.isTouchEvent(t)&&!ct.isNullOrUndefined(t.changedTouches)&&ct.isNullOrUndefined(this.touchId)&&(this.touchId=t.changedTouches[0].identifier),d&&this.onMove(t,!0),_&&this.onEnd(t)}onMove(r,t){let o=null;if(_l.isTouchEvent(r)){let M=r.changedTouches;for(let j=0;j<M.length;j++)if(M[j].identifier===this.touchId){o=M[j];break}if(ct.isNullOrUndefined(o))return}
1325this.viewOptions.animate&&!this.viewOptions.animateOnMove&&this.moving&&(this.sliderElementAnimateClass=!1),this.moving=!0;let n=ct.isNullOrUndefined(o)?this.getEventPosition(r):this.getEventPosition(r,o.identifier),d,_=this.viewOptions.rightToLeft?this.viewOptions.floor:this.viewOptions.ceil,C=this.viewOptions.rightToLeft?this.viewOptions.ceil:this.viewOptions.floor;n<=0?d=C:n>=this.maxHandlePosition?d=_:(d=this.positionToValue(n),t&&!ct.isNullOrUndefined(this.viewOptions.tickStep)?d=this.roundStep(d,this.viewOptions.tickStep):d=this.roundStep(d)),this.positionTrackingHandle(d)}onEnd(r){_l.isTouchEvent(r)&&r.changedTouches[0].identifier!==this.touchId||(this.moving=!1,this.viewOptions.animate&&(this.sliderElementAnimateClass=!0),this.touchId=null,this.viewOptions.keyboardSupport||(this.minHandleElement.active=!1,this.maxHandleElement.active=!1,this.currentTrackingPointer=null),this.dragging.active=!1,this.unsubscribeOnMove(),this.unsubscribeOnEnd(),this.userChangeEnd.emit(this.getChangeContext()))}onPointerFocus(r){let t=this.getPointerElement(r);t.on("blur",()=>this.onPointerBlur(t)),t.on("keydown",o=>this.onKeyboardEvent(o)),t.on("keyup",()=>this.onKeyUp()),t.active=!0,this.currentTrackingPointer=r,this.currentFocusPointer=r,this.firstKeyDown=!0}onKeyUp(){this.firstKeyDown=!0,this.userChangeEnd.emit(this.getChangeContext())}onPointerBlur(r){r.off("blur"),r.off("keydown"),r.off("keyup"),r.active=!1,ct.isNullOrUndefined(this.touchId)&&(this.currentTrackingPointer=null,this.currentFocusPointer=null)}getKeyActions(r){let t=this.viewOptions.ceil-this.viewOptions.floor,o=r+this.viewOptions.step,n=r-this.viewOptions.step,d=r+t/10,_=r-t/10;this.viewOptions.reversedControls&&(o=r-this.viewOptions.step,n=r+this.viewOptions.step,d=r-t/10,_=r+t/10);let C={UP:o,DOWN:n,LEFT:n,RIGHT:o,PAGEUP:d,PAGEDOWN:_,HOME:this.viewOptions.reversedControls?this.viewOptions.ceil:this.viewOptions.floor,END:this.viewOptions.reversedControls?this.viewOptions.floor:this.viewOptions.ceil};return this.viewOptions.rightToLeft&&(C.LEFT=o,C.RIGHT=n,(this.viewOptions.vertical||this.viewOptions.rotate!==0)&&(C.UP=n,C.DOWN=o)),C}onKeyboardEvent(r){let t=this.getCurrentTrackingValue(),o=ct.isNullOrUndefined(r.keyCode)?r.which:r.keyCode,n={38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"},d=this.getKeyActions(t),_=n[o],C=d[_];if(ct.isNullOrUndefined(C)||ct.isNullOrUndefined(this.currentTrackingPointer))return;r.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.userChangeStart.emit(this.getChangeContext()));let M=_r.clampToRange(C,this.viewOptions.floor,this.viewOptions.ceil),j=this.roundStep(M);if(!this.viewOptions.draggableRangeOnly)this.positionTrackingHandle(j);else{let G=this.viewHighValue-this.viewLowValue,ie,_e;this.currentTrackingPointer===Ht.Min?(ie=j,_e=j+G,_e>this.viewOptions.ceil&&(_e=this.viewOptions.ceil,ie=_e-G)):this.currentTrackingPointer===Ht.Max&&(_e=j,ie=j-G,ie<this.viewOptions.floor&&(ie=this.viewOptions.floor,_e=ie+G)),this.positionTrackingBar(ie,_e)}}onDragStart(r,t,o,n){let d=this.getEventPosition(t);this.dragging=new Lx,this.dragging.active=!0,this.dragging.value=this.positionToValue(d),this.dragging.difference=this.viewHighValue-this.viewLowValue,this.dragging.lowLimit=this.viewOptions.rightToLeft?this.minHandleElement.position-d:d-this.minHandleElement.position,this.dragging.highLimit=this.viewOptions.rightToLeft?d-this.maxHandleElement.position:this.maxHandleElement.position-d,this.onStart(r,t,o,n)}getMinValue(r,t,o){let n=this.viewOptions.rightToLeft,d=null;return t?o?d=n?this.viewOptions.floor:this.viewOptions.ceil-this.dragging.difference:d=n?this.viewOptions.ceil-this.dragging.difference:this.viewOptions.floor:d=n?this.positionToValue(r+this.dragging.lowLimit):this.positionToValue(r-this.dragging.lowLimit),this.roundStep(d)}getMaxValue(r,t,o){let n=this.viewOptions.rightToLeft,d=null;return t?o?d=n?this.viewOptions.floor+this.dragging.difference:this.viewOptions.ceil:d=n?this.viewOptions.ceil:this.viewOptions.floor+this.dragging.difference:n?d=this.positionToValue(r+this.dragging.lowLimit)+this.dragging.difference:d=this.positionToValue(r-this.dragging.lowLimit)+this.dragging.difference,this.roundStep(d)}onDragMove(r){let t=this.getEventPosition(r);
1325this.viewOptions.animate&&!this.viewOptions.animateOnMove&&this.moving&&(this.sliderElementAnimateClass=!1),this.moving=!0;let o,n,d,_;this.viewOptions.rightToLeft?(o=this.dragging.lowLimit,n=this.dragging.highLimit,d=this.maxHandleElement,_=this.minHandleElement):(o=this.dragging.highLimit,n=this.dragging.lowLimit,d=this.minHandleElement,_=this.maxHandleElement);let C=t<=n,M=t>=this.maxHandlePosition-o,j,G;if(C){if(d.position===0)return;j=this.getMinValue(t,!0,!1),G=this.getMaxValue(t,!0,!1)}else if(M){if(_.position===this.maxHandlePosition)return;G=this.getMaxValue(t,!0,!0),j=this.getMinValue(t,!0,!0)}else j=this.getMinValue(t,!1,!1),G=this.getMaxValue(t,!1,!1);this.positionTrackingBar(j,G)}positionTrackingBar(r,t){!ct.isNullOrUndefined(this.viewOptions.minLimit)&&r<this.viewOptions.minLimit&&(r=this.viewOptions.minLimit,t=_r.roundToPrecisionLimit(r+this.dragging.difference,this.viewOptions.precisionLimit)),!ct.isNullOrUndefined(this.viewOptions.maxLimit)&&t>this.viewOptions.maxLimit&&(t=this.viewOptions.maxLimit,r=_r.roundToPrecisionLimit(t-this.dragging.difference,this.viewOptions.precisionLimit)),this.viewLowValue=r,this.viewHighValue=t,this.applyViewChange(),this.updateHandles(Ht.Min,this.valueToPosition(r)),this.updateHandles(Ht.Max,this.valueToPosition(t))}positionTrackingHandle(r){r=this.applyMinMaxLimit(r),this.range&&(this.viewOptions.pushRange?r=this.applyPushRange(r):(this.viewOptions.noSwitching&&(this.currentTrackingPointer===Ht.Min&&r>this.viewHighValue?r=this.applyMinMaxRange(this.viewHighValue):this.currentTrackingPointer===Ht.Max&&r<this.viewLowValue&&(r=this.applyMinMaxRange(this.viewLowValue))),r=this.applyMinMaxRange(r),this.currentTrackingPointer===Ht.Min&&r>this.viewHighValue?(this.viewLowValue=this.viewHighValue,this.applyViewChange(),this.updateHandles(Ht.Min,this.maxHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=Ht.Max,this.minHandleElement.active=!1,this.maxHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.maxHandleElement.focus()):this.currentTrackingPointer===Ht.Max&&r<this.viewLowValue&&(this.viewHighValue=this.viewLowValue,this.applyViewChange(),this.updateHandles(Ht.Max,this.minHandleElement.position),this.updateAriaAttributes(),this.currentTrackingPointer=Ht.Min,this.maxHandleElement.active=!1,this.minHandleElement.active=!0,this.viewOptions.keyboardSupport&&this.minHandleElement.focus()))),this.getCurrentTrackingValue()!==r&&(this.currentTrackingPointer===Ht.Min?(this.viewLowValue=r,this.applyViewChange()):this.currentTrackingPointer===Ht.Max&&(this.viewHighValue=r,this.applyViewChange()),this.updateHandles(this.currentTrackingPointer,this.valueToPosition(r)),this.updateAriaAttributes())}applyMinMaxLimit(r){return!ct.isNullOrUndefined(this.viewOptions.minLimit)&&r<this.viewOptions.minLimit?this.viewOptions.minLimit:!ct.isNullOrUndefined(this.viewOptions.maxLimit)&&r>this.viewOptions.maxLimit?this.viewOptions.maxLimit:r}applyMinMaxRange(r){let t=this.currentTrackingPointer===Ht.Min?this.viewHighValue:this.viewLowValue,o=Math.abs(r-t);if(!ct.isNullOrUndefined(this.viewOptions.minRange)&&o<this.viewOptions.minRange){if(this.currentTrackingPointer===Ht.Min)return _r.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.minRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===Ht.Max)return _r.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.minRange,this.viewOptions.precisionLimit)}if(!ct.isNullOrUndefined(this.viewOptions.maxRange)&&o>this.viewOptions.maxRange){if(this.currentTrackingPointer===Ht.Min)return _r.roundToPrecisionLimit(this.viewHighValue-this.viewOptions.maxRange,this.viewOptions.precisionLimit);if(this.currentTrackingPointer===Ht.Max)return _r.roundToPrecisionLimit(this.viewLowValue+this.viewOptions.maxRange,this.viewOptions.precisionLimit)}return r}applyPushRange(r){let t=this.currentTrackingPointer===Ht.Min?this.viewHighValue-r:r-this.viewLowValue,o=ct.isNullOrUndefined(this.viewOptions.minRange)?this.viewOptions.step:this.viewOptions.minRange,n=this.viewOptions.maxRange;return t<o?(this.currentTrackingPointer===Ht.Min?(this.viewHighValue=_r.roundToPrecisionLimit(Math.min(r+o,this.viewOptions.ceil),this.viewOptions.precisionLimit),r=_r.roundToPrecisionLimit(this.viewHighValue-o,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(Ht.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===Ht.Max&&(this.viewLowValue=_r.roundToPrecisionLimit(Math.max(r-o,this.viewOptions.floor),this.viewOptions.precisionLimit),r=_r.roundToPrecisionLimit(this.viewLowValue+o,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(Ht.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()):!ct.isNullOrUndefined(n)&&t>n&&(this.currentTrackingPointer===Ht.Min?(this.viewHighValue=_r.roundToPrecisionLimit(r+n,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(Ht.Max,this.valueToPosition(this.viewHighValue))):this.currentTrackingPointer===Ht.Max&&(this.viewLowValue=_r.roundToPrecisionLimit(r-n,this.viewOptions.precisionLimit),this.applyViewChange(),this.updateHandles(Ht.Min,this.valueToPosition(this.viewLowValue))),this.updateAriaAttributes()),r}getChangeContext(){let r=new CI;return r.pointerType=this.currentTrackingPointer,r.value=+this.value,this.range&&(r.highValue=+this.highValue),r}static \u0275fac=function(t){return new(t||i)(ae(eo),ae(Pi),ae(Or),ae(qt),ae(_3,8))};static \u0275cmp=st({type:i,selectors:[["ngx-slider"]],contentQueries:function(t,o,n){if(t&1&&cu(n,Gq,5),t&2){let d;Xt(d=Yt())&&(o.tooltipTemplate=d.first)}},viewQuery:function(t,o){if(t&1&&(ni(qq,5,gu),ni(Wq,5,gu),ni(Zq,5,gu),ni(Kq,5,gu),ni(Xq,5,wI),ni(Yq,5,wI),ni(Qq,5,Ef),ni(Jq,5,Ef),ni(eW,5,Ef),ni(tW,5,Ef),ni(iW,5,Ef),ni(nW,5,gu)),t&2){let n;Xt(n=Yt())&&(o.leftOuterSelectionBarElement=n.first),Xt(n=Yt())&&(o.rightOuterSelectionBarElement=n.first),Xt(n=Yt())&&(o.fullBarElement=n.first),Xt(n=Yt())&&(o.selectionBarElement=n.first),Xt(n=Yt())&&(o.minHandleElement=n.first),Xt(n=Yt())&&(o.maxHandleElement=n.first),Xt(n=Yt())&&(o.floorLabelElement=n.first),Xt(n=Yt())&&(o.ceilL
1325abelElement=n.first),Xt(n=Yt())&&(o.minHandleLabelElement=n.first),Xt(n=Yt())&&(o.maxHandleLabelElement=n.first),Xt(n=Yt())&&(o.combinedLabelElement=n.first),Xt(n=Yt())&&(o.ticksElement=n.first)}},hostAttrs:[1,"ngx-slider"],hostVars:8,hostBindings:function(t,o){t&1&&se("resize",function(d){return o.onResize(d)},!1,Jg),t&2&&(Bn("disabled",o.sliderElementDisabledAttr)("aria-label",o.sliderElementAriaLabel),Yi("vertical",o.sliderElementVerticalClass)("animate",o.sliderElementAnimateClass)("with-legend",o.sliderElementWithLegendClass))},inputs:{value:"value",highValue:"highValue",options:"options",manualRefresh:"manualRefresh",triggerFocus:"triggerFocus"},outputs:{valueChange:"valueChange",highValueChange:"highValueChange",userChangeStart:"userChangeStart",userChange:"userChange",userChangeEnd:"userChangeEnd"},features:[It([uW]),hn],decls:29,vars:13,consts:[["ngxSliderElement","",1,"ngx-slider-span","ngx-slider-bar-wrapper","ngx-slider-left-out-selection"],["leftOuterSelectionBar",""],[1,"ngx-slider-span","ngx-slider-bar"],["ngxSliderElement","",1,"ngx-slider-span","ngx-slider-bar-wrapper","ngx-slider-right-out-selection"],["rightOuterSelectionBar",""],["ngxSliderElement","",1,"ngx-slider-span","ngx-slider-bar-wrapper","ngx-slider-full-bar"],["fullBar",""],["ngxSliderElement","",1,"ngx-slider-span","ngx-slider-bar-wrapper","ngx-slider-selection-bar"],["selectionBar",""],[1,"ngx-slider-span","ngx-slider-bar","ngx-slider-selection",3,"ngStyle"],["ngxSliderHandle","",1,"ngx-slider-span","ngx-slider-pointer","ngx-slider-pointer-min",3,"ngStyle"],["minHandle",""],["ngxSliderHandle","",1,"ngx-slider-span","ngx-slider-pointer","ngx-slider-pointer-max",3,"ngStyle"],["maxHandle",""],["ngxSliderLabel","",1,"ngx-slider-span","ngx-slider-bubble","ngx-slider-limit","ngx-slider-floor"],["floorLabel",""],["ngxSliderLabel","",1,"ngx-slider-span","ngx-slider-bubble","ngx-slider-limit","ngx-slider-ceil"],["ceilLabel",""],["ngxSliderLabel","",1,"ngx-slider-span","ngx-slider-bubble","ngx-slider-model-value"],["minHandleLabel",""],["ngxSliderLabel","",1,"ngx-slider-span","ngx-slider-bubble","ngx-slider-model-high"],["maxHandleLabel",""],["ngxSliderLabel","",1,"ngx-slider-span","ngx-slider-bubble","ngx-slider-combined"],["combinedLabel",""],["ngxSliderElement","",1,"ngx-slider-ticks",3,"hidden"],["ticksElement",""],["class","ngx-slider-tick",3,"ngClass","ngStyle",4,"ngFor","ngForOf"],[1,"ngx-slider-tick",3,"ngClass","ngStyle"],[3,"template","tooltip","placement"],["class","ngx-slider-span ngx-slider-tick-value",3,"template","tooltip","placement","content",4,"ngIf"],["class","ngx-slider-span ngx-slider-tick-legend",3,"innerText",4,"ngIf"],["class","ngx-slider-span ngx-slider-tick-legend",3,"innerHTML",4,"ngIf"],[1,"ngx-slider-span","ngx-slider-tick-value",3,"template","tooltip","placement","content"],[1,"ngx-slider-span","ngx-slider-tick-legend",3,"innerText"],[1,"ngx-slider-span","ngx-slider-tick-legend",3,"innerHTML"]],template:function(t,o){t&1&&(S(0,"span",0,1),Z(2,"span",2),E(),S(3,"span",3,4),Z(5,"span",2),E(),S(6,"span",5,6),Z(8,"span",2),E(),S(9,"span",7,8),Z(11,"span",9),E(),Z(12,"span",10,11)(14,"span",12,13)(16,"span",14,15)(18,"span",16,17)(20,"span",18,19)(22,"span",20,21)(24,"span",22,23),S(26,"span",24,25),ce(28,lW,5,10,"span",26),E()),t&2&&(P(6),Yi("ngx-slider-transparent",o.fullBarTransparentClass),P(3),Yi("ngx-slider-draggable",o.selectionBarDraggableClass),P(2),N("ngStyle",o.barStyle),P(1),N("ngStyle",o.minPointerStyle),P(2),lu("display",o.range?"inherit":"none"),N("ngStyle",o.maxPointerStyle),P(12),Yi("ngx-slider-ticks-values-under",o.ticksUnderValuesClass),N("hidden",!o.showTicks),P(2),N("ngForOf",o.ticks))},dependencies:[on,ti,At,hL,gu,wI,Ef,cW],styles:['.ngx-slider{display:inline-block;position:relative;height:4px;width:100%;margin:35px 0 15px;vertical-align:middle;-webkit-user-select:none;user-select:none;touch-action:pan-y}  .ngx-slider.with-legend{margin-bottom:40px}  .ngx-slider[disabled]{cursor:not-allowed}  .ngx-slider[disabled] .ngx-slider-pointer{cursor:not-allowed;background-color:#d8e0f3}  .ngx-slider[disabled] .ngx-slider-draggable{cursor:not-allowed}  .ngx-slider[disabled] .ngx-slider-selection{background:#8b91a2}  .ngx-slider[disabled] .ngx-slider-tick{cursor:not-allowed}  .ngx-slider[disabled] .ngx-slider-tick.ngx-slider-selected{background:#8b91a2}  .ngx-slider .ngx-slider-span{white-space:nowrap;position:absolute;display:inline-block}  .ngx-slider .ngx-slider-base{width:100%;height:100%;padding:0}
1325  .ngx-slider .ngx-slider-bar-wrapper{left:0;box-sizing:border-box;margin-top:-16px;padding-top:16px;width:100%;height:32px;z-index:1}  .ngx-slider .ngx-slider-draggable{cursor:move}  .ngx-slider .ngx-slider-bar{left:0;width:100%;height:4px;z-index:1;background:#d8e0f3;border-radius:2px}  .ngx-slider .ngx-slider-bar-wrapper.ngx-slider-transparent .ngx-slider-bar{background:transparent}  .ngx-slider .ngx-slider-bar-wrapper.ngx-slider-left-out-selection .ngx-slider-bar{background:#df002d}  .ngx-slider .ngx-slider-bar-wrapper.ngx-slider-right-out-selection .ngx-slider-bar{background:#03a688}  .ngx-slider .ngx-slider-selection{z-index:2;background:#0db9f0;border-radius:2px}  .ngx-slider .ngx-slider-pointer{cursor:pointer;width:32px;height:32px;top:-14px;background-color:#0db9f0;z-index:3;border-radius:16px}  .ngx-slider .ngx-slider-pointer:after{content:"";width:8px;height:8px;position:absolute;top:12px;left:12px;border-radius:4px;background:#fff}  .ngx-slider .ngx-slider-pointer:hover:after{background-color:#fff}  .ngx-slider .ngx-slider-pointer.ngx-slider-active{z-index:4}  .ngx-slider .ngx-slider-pointer.ngx-slider-active:after{background-color:#451aff}
1325  .ngx-slider .ngx-slider-bubble{cursor:default;bottom:16px;padding:1px 3px;color:#55637d;font-size:16px}  .ngx-slider .ngx-slider-bubble.ngx-slider-limit{color:#55637d}  .ngx-slider .ngx-slider-ticks{box-sizing:border-box;width:100%;height:0;position:absolute;left:0;top:-3px;margin:0;z-index:1;list-style:none}  .ngx-slider .ngx-slider-ticks-values-under .ngx-slider-tick-value{top:auto;bottom:-36px}  .ngx-slider .ngx-slider-tick{text-align:center;cursor:pointer;width:10px;height:10px;background:#d8e0f3;border-radius:50%;position:absolute;top:0;left:0;margin-left:11px}  .ngx-slider .ngx-slider-tick.ngx-slider-selected{background:#0db9f0}  .ngx-slider .ngx-slider-tick-value{position:absolute;top:-34px;transform:translate(-50%)}  .ngx-slider .ngx-slider-tick-legend{position:absolute;top:24px;transform:translate(-50%);max-width:50px;white-space:normal}  .ngx-slider.vertical{position:relative;width:4px;height:100%;margin:0 20px;padding:0;vertical-align:baseline;touch-action:pan-x}  .ngx-slider.vertical .ngx-slider-base{width:100%;height:100%;padding:0}  .ngx-slider.vertical .ngx-slider-bar-wrapper{top:auto;left:0;margin:0 0 0 -16px;padding:0 0 0 16px;height:100%;width:32px}  .ngx-slider.vertical .ngx-slider-bar{bottom:0;left:auto;width:4px;height:100%}  .ngx-slider.vertical .ngx-slider-pointer{left:-14px!important;top:auto;bottom:0}  .ngx-slider.vertical .ngx-slider-bubble{left:16px!important;bottom:0}  .ngx-slider.vertical .ngx-slider-ticks{height:100%;width:0;left:-3px;top:0;z-index:1}  .ngx-slider.vertical .ngx-slider-tick{vertical-align:middle;margin-left:auto;margin-top:11px}  .ngx-slider.vertical .ngx-slider-tick-value{left:24px;top:auto;transform:translateY(-28%)}  .ngx-slider.vertical .ngx-slider-tick-legend{top:auto;right:24px;transform:translateY(-28%);max-width:none;white-space:nowrap}  .ngx-slider.vertical .ngx-slider-ticks-values-under .ngx-slider-tick-value{bottom:auto;left:auto;right:24px}  .ngx-slider *{transition:none}  .ngx-slider.animate .ngx-slider-bar-wrapper{transition:all linear .3s}  .ngx-slider.animate .ngx-slider-selection{transition:background-color linear .3s}  .ngx-slider.animate .ngx-slider-pointer{transition:all linear .3s}  .ngx-slider.animate .ngx-slider-pointer:after{transition:all linear .3s}  .ngx-slider.animate .ngx-slider-bubble{transition:all linear .3s}  .ngx-slider.animate .ngx-slider-bubble.ngx-slider-limit{transition:opacity linear .3s}  .ngx-slider.animate .ngx-slider-bubble.ngx-slider-combined{transition:opacity linear .3s}  .ngx-slider.animate .ngx-slider-tick{transition:background-color linear .3s}'],changeDetection:0})}return i})(),Nx=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Ui({type:i});static \u0275inj=Bi({imports:[Dt]})}return i})();var Js=(()=>{let e=class e{constructor(t){this.http=t,this.gpsTracksUrl="/roads/sections/"}getGpsTrack(t){return this.http.get(this.gpsTracksUrl+t+"/")}getGpsTracks(t,o,n=null,d=null,_=null){let C=this.gpsTracksUrl+"?limit="+t;return C=C+(o?"&offset="+o:""),C=C+(d?"&user="+d:""),C=C+(n?"&search="+n:""),C=C+(_?"&ordering="+_:""),this.http.get(C)}getGeoJSON(t){return this.http.get(t)}getPosition(){return new Promise((t,o)=>{navigator.geolocation.getCurrentPosition(n=>{t({lng:n.coords.longitude,lat:n.coords.latitude})},n=>{o(n)})})}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var ss={production:!0,apiURL:"https://api.mountainsgeek.com",captchaKey:"6LcIoVsUAAAAAHatpr-G2fU_e0pg_kmwtFb-QJVK",googleApiKey:"AIzaSyDqfxg-jpDR9k16jLXJQ5X2ihyQ-5g1wyc",whitelist:["api.mountainsgeek.com"],googleAnalyticsID:"G-YFE1JVST5H"};var _u=(()=>{let e=class e{constructor(t){this.http=t,this.clientKey=ss.googleApiKey,this.url="https://maps.googleapis.com/maps/api/"}geocode(t){return this.http.get(this.url+"geocode/json?address="+t+"&key="+this.clientKey)}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var If=mC(zx(),1),W_=mC(zx(),1);var w3=["content"],C3=["*"],dW=["container"];var E3=new Ct("MapboxApiKey"),jx=(()=>{let e=class e{constructor(t,o){this.zone=t,this.MAPBOX_API_KEY=o,this.mapCreated=new bp,this.mapLoaded=new bp,this.markersToRemove=[],this.popupsToRemove=[],this.imageIdsToRemove=[],this.subscription=new pn,this.mapCreated$=this.mapCreated.asObservable(),this.mapLoaded$=this.mapLoaded.asObservable()}setup(t){this.zone.onStable.pipe(fs()).subscribe(()=>{this.createMap(en(bt({},t.mapOptions),{accessToken:t.accessToken||this.MAPBOX_API_KEY||""})),this.hookEvents(t.mapEvents),this.mapEvents=t.mapEvents,this.mapCreated.next(void 0),this.mapCreated.complete(),t.mapEvents.mapCreate.observed&&this.zone.run(()=>{t.mapEvents.mapCreate.emit(this.mapInstance)})})}destroyMap(){this.mapInstance&&(this.subscription.unsubscribe(),this.mapInstance.remove())}updateProjection(t){return this.zone.runOutsideAngular(()=>{this.mapInstance.setProjection(t)})}updateMinZoom(t){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMinZoom(t)})}updateMaxZoom(t){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMaxZoom(t)})}updateMinPitch(t){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMinPitch(t)})}updateMaxPitch(t){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMaxPitch(t)})}updateRenderWorldCopies(t){return this.zone.runOutsideAngular(()=>{this.mapInstance.setRenderWorldCopies(t)})}updateScrollZoom(t){return this.zone.runOutsideAngular(()=>{t?this.mapInstance.scrollZoom.enable():this.mapInstance.scrollZoom.disable()})}updateDragRotate(t){return this.zone.runOutsideAngular(()=>{t?this.mapInstance.dragRotate.enable():this.mapInstance.dragRotate.disable()})}updateTouchPitch(t){return this.zone.runOutsideAngular(()=>{t?this.mapInstance.touchPitch.enable():this.mapInstance.touchPitch.disable()})}updateTouchZoomRotate(t){return this.zone.runOutsideAngular(()=>{t?this.mapInstance.touchZoomRotate.enable():this.mapInstance.touchZoomRotate.disable()})}updateDoubleClickZoom(t){return this.zone.runOutsideAngular(()=>{t?this.mapInstance.doubleClickZoom.enable():this.mapInstance.doubleClickZoom.disable()})}updateKeyboard(t){return this.zone.runOutsideAngular(()=>{t?this.mapInstance.keyboard.enable():this.mapInstance.keyboard.disable()})}updateDragPan(t){return this.zone.runOutsideAngular(()=>{t?this.mapInstance.dragPan.enable():this.mapInstance.dragPan.disable()})}updateBoxZoom(t){return this.zone.runOutsideAngular(()=>{t?this.mapInstance.boxZoom.enable():this.mapInstance.boxZoom.disable()})}updateStyle(t){return this.zone.runOutsideAngular(()=>{this.mapInstance.setStyle(t)})}updateMaxBounds(t){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMaxBounds(t)})}changeCanvasCursor(t){let o=this.mapInstance.getCanvasContainer();o.style.cursor=t}queryRenderedFeatures(t,o){return this.mapInstance.queryRenderedFeatures(t,o)}panTo(t,o){return this.zone.runOutsideAngular(()=>{this.mapInstance.panTo(t,o)})}move(t,o,n,d,_,C){return this.zone.runOutsideAngular(()=>{this.mapInstance[t](en(bt({},o),{zoom:n??this.mapInstance.getZoom(),center:d??this.mapInstance.getCenter(),bearing:_??this.mapInstance.getBearing(),pitch:C??this.mapInstance.getPitch()}))})}addLayer(t,o,n){this.zone.runOutsideAngular(()=>
1325{Object.keys(t.layerOptions).forEach(d=>{let _=d;t.layerOptions[_]===void 0&&delete t.layerOptions[_]}),this.mapInstance.addLayer(t.layerOptions,n),o&&((t.layerEvents.layerClick.observed||t.layerEvents.click.observed)&&this.mapInstance.on("click",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerClick.emit(d),t.layerEvents.click.emit(d)})}),(t.layerEvents.layerDblClick.observed||t.layerEvents.dblClick.observed)&&this.mapInstance.on("dblclick",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerDblClick.emit(d),t.layerEvents.dblClick.emit(d)})}),(t.layerEvents.layerMouseDown.observed||t.layerEvents.mouseDown.observed)&&this.mapInstance.on("mousedown",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerMouseDown.emit(d),t.layerEvents.mouseDown.emit(d)})}),(t.layerEvents.layerMouseUp.observed||t.layerEvents.mouseUp.observed)&&this.mapInstance.on("mouseup",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerMouseUp.emit(d),t.layerEvents.mouseUp.emit(d)})}),(t.layerEvents.layerMouseEnter.observed||t.layerEvents.mouseEnter.observed)&&this.mapInstance.on("mouseenter",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerMouseEnter.emit(d),t.layerEvents.mouseEnter.emit(d)})}),(t.layerEvents.layerMouseLeave.observed||t.layerEvents.mouseLeave.observed)&&this.mapInstance.on("mouseleave",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerMouseLeave.emit(d),t.layerEvents.mouseLeave.emit(d)})}),(t.layerEvents.layerMouseMove.observed||t.layerEvents.mouseMove.observed)&&this.mapInstance.on("mousemove",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerMouseMove.emit(d),t.layerEvents.mouseMove.emit(d)})}),(t.layerEvents.layerMouseOver.observed||t.layerEvents.mouseOver.observed)&&this.mapInstance.on("mouseover",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerMouseOver.emit(d),t.layerEvents.mouseOver.emit(d)})}),(t.layerEvents.layerMouseOut.observed||t.layerEvents.mouseOut.observed)&&this.mapInstance.on("mouseout",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerMouseOut.emit(d),t.layerEvents.mouseOut.emit(d)})}),(t.layerEvents.layerContextMenu.observed||t.layerEvents.contextMenu.observed)&&this.mapInstance.on("contextmenu",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerContextMenu.emit(d),t.layerEvents.contextMenu.emit(d)})}),(t.layerEvents.layerTouchStart.observed||t.layerEvents.touchStart.observed)&&this.mapInstance.on("touchstart",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerTouchStart.emit(d),t.layerEvents.touchStart.emit(d)})}),(t.layerEvents.layerTouchEnd.observed||t.layerEvents.touchEnd.observed)&&this.mapInstance.on("touchend",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerTouchEnd.emit(d),t.layerEvents.touchEnd.emit(d)})}),(t.layerEvents.layerTouchCancel.observed||t.layerEvents.touchCancel.observed)&&this.mapInstance.on("touchcancel",t.layerOptions.id,d=>{this.zone.run(()=>{t.layerEvents.layerTouchCancel.emit(d),t.layerEvents.touchCancel.emit(d)})}))})}removeLayer(t){this.zone.runOutsideAngular(()=>{this.mapInstance.getLayer(t)!=null&&this.mapInstance.removeLayer(t)})}addMarker(t){let o={offset:t.markersOptions.offset,anchor:t.markersOptions.anchor,draggable:!!t.markersOptions.draggable,rotationAlignment:t.markersOptions.rotationAlignment,pitchAlignment:t.markersOptions.pitchAlignment,clickTolerance:t.markersOptions.clickTolerance};t.markersOptions.element.childNodes.length>0&&(o.element=t.markersOptions.element);let n=new If.Marker(o);(t.markersEvents.markerDragStart.observed||t.markersEvents.dragStart.observed)&&n.on("dragstart",_=>{if(_){let{target:C}=_;this.zone.run(()=>{t.markersEvents.markerDragStart.emit(C),t.markersEvents.dragStart.emit(C)})}}),(t.markersEvents.markerDrag.observed||t.markersEvents.drag.observed)&&n.on("drag",_=>{if(_){let{target:C}=_;this.zone.run(()=>{t.markersEvents.markerDrag.emit(C),t.markersEvents.drag.emit(C)})}}),(t.markersEvents.markerDragEnd.observed||t.markersEvents.dragEnd.observed)&&n.on("dragend",_=>{if(_){let{target:C}=_;this.zone.run(()=>{t.markersEvents.markerDragEnd.emit(C),t.markersEvents.dragEnd.emit(C)})}});let d=t.markersOptions.feature?t.markersOptions.feature.geometry.coordinates:t.markersOptions.lngLat;return n.setLngLat(d),this.zone.runOutsideAngular(()=>(n.addTo(this.mapInstance),n))}removeMarker(t){this.markersToRemove.push(t)}createPopup(t,o){return this.zone.runOutsideAngular(()=>
1325{Object.keys(t.popupOptions).forEach(d=>t.popupOptions[d]===void 0&&delete t.popupOptions[d]);let n=new If.Popup(t.popupOptions);return n.setDOMContent(o),(t.popupEvents.popupClose.observed||t.popupEvents.close.observed)&&n.on("close",()=>{this.zone.run(()=>{t.popupEvents.popupClose.emit(),t.popupEvents.close.emit()})}),(t.popupEvents.popupOpen.observed||t.popupEvents.open.observed)&&n.on("open",()=>{this.zone.run(()=>{t.popupEvents.popupOpen.emit(),t.popupEvents.open.emit()})}),n})}addPopupToMap(t,o,n=!1){return this.zone.runOutsideAngular(()=>{n&&t._listeners&&delete t._listeners.open,t.setLngLat(o),t.addTo(this.mapInstance)})}addPopupToMarker(t,o){return this.zone.runOutsideAngular(()=>{t.setPopup(o)})}removePopupFromMap(t,o=!1){o&&t._listeners&&delete t._listeners.close,this.popupsToRemove.push(t)}removePopupFromMarker(t){return this.zone.runOutsideAngular(()=>{t.setPopup(void 0)})}addControl(t,o){return this.zone.runOutsideAngular(()=>{this.mapInstance.addControl(t,o)})}removeControl(t){return this.zone.runOutsideAngular(()=>{this.mapInstance.removeControl(t)})}loadAndAddImage(t,o,n){return dp(this,null,function*(){return this.zone.runOutsideAngular(()=>new Promise((d,_)=>{this.mapInstance.loadImage(o,(C,M)=>{if(C){_(C);return}this.addImage(t,M,n),d()})}))})}addImage(t,o,n){return this.zone.runOutsideAngular(()=>{this.mapInstance.addImage(t,o,n)})}removeImage(t){this.imageIdsToRemove.push(t)}addSource(t,o){return this.zone.runOutsideAngular(()=>{Object.keys(o).forEach(n=>o[n]===void 0&&delete o[n]),this.mapInstance.addSource(t,o)})}getSource(t){return this.mapInstance.getSource(t)}removeSource(t){this.zone.runOutsideAngular(()=>{this.findLayersBySourceId(t).forEach(o=>this.mapInstance.removeLayer(o.id)),this.mapInstance.removeSource(t)})}setAllLayerPaintProperty(t,o){return this.zone.runOutsideAngular(()=>{Object.keys(o).forEach(n=>{this.mapInstance.setPaintProperty(t,n,o[n])})})}setAllLayerLayoutProperty(t,o){return this.zone.runOutsideAngular(()=>{Object.keys(o).forEach(n=>{this.mapInstance.setLayoutProperty(t,n,o[n])})})}setLayerFilter(t,o){return this.zone.runOutsideAngular(()=>{this.mapInstance.setFilter(t,o)})}setLayerBefore(t,o){return this.zone.runOutsideAngular(()=>{this.mapInstance.moveLayer(t,o)})}setLayerZoomRange(t,o,n){return this.zone.runOutsideAngular(()=>{this.mapInstance.setLayerZoomRange(t,o||0,n||20)})}fitBounds(t,o){return this.zone.runOutsideAngular(()=>{this.mapInstance.fitBounds(t,o)})}fitScreenCoordinates(t,o,n){return this.zone.runOutsideAngular(()=>{this.mapInstance.fitScreenCoordinates(t[0],t[1],o,n)})}applyChanges(){this.zone.runOutsideAngular(()=>{this.removeMarkers(),this.removePopups(),this.removeImages()})}createMap(t){qt.assertNotInAngularZone(),Object.keys(t).forEach(n=>{let d=n;t[d]===void 0&&delete t[d]}),this.mapInstance=new If.Map(t),window&&/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)&&this.mapInstance.setStyle(t.style),this.subscription.add(this.zone.onMicrotaskEmpty.subscribe(()=>this.applyChanges()))}removeMarkers(){for(let t of this.markersToRemove)t.remove();this.markersToRemove=[]}removePopups(){for(let t of this.popupsToRemove)t.remove();this.popupsToRemove=[]}removeImages(){for(let t of this.imageIdsToRemove)this.mapInstance.removeImage(t);this.imageIdsToRemove=[]}findLayersBySourceId(t){let o=this.mapInstance.getStyle().layers;return o==null?[]:o.filter(n=>"source"in n?n.source===t:!1)}hookEvents(t){this.mapInstance.on("load",o=>{this.mapLoaded.next(void 0),this.mapLoaded.complete(),this.zone.run(()=>{t.mapLoad.emit(o),t.load.emit(o.target)})}),(t.mapResize.observed||t.resize.observed)&&this.mapInstance.on("resize",o=>this.zone.run(()=>{t.mapResize.emit(o),t.resize.emit(o)})),(t.mapRemove.observed||t.remove.observed)&&this.mapInstance.on("remove",o=>this.zone.run(()=>{t.mapRemove.emit(o),t.remove.emit(o)})),(t.mapMouseDown.observed||t.mouseDown.observed)&&this.mapInstance.on("mousedown",o=>this.zone.run(()=>{t.mapMouseDown.emit(o),t.mouseDown.emit(o)})),(t.mapMouseUp.observed||t.mouseUp.observed)&&this.mapInstance.on("mouseup",o=>this.zone.run(()=>{t.mapMouseUp.emit(o),t.mouseUp.emit(o)})),(t.mapMouseMove.observed||t.mouseMove.observed)&&this.mapInstance.on("mousemove",o=>this.zone.run(()=>{t.mapMouseMove.emit(o),t.mouseMove.emit(o)})),(t.mapClick.observed||t.click.observed)&&this.mapInstance.on("click",o=>
1325this.zone.run(()=>{t.mapClick.emit(o),t.click.emit(o)})),(t.mapDblClick.observed||t.dblClick.observed)&&this.mapInstance.on("dblclick",o=>this.zone.run(()=>{t.mapDblClick.emit(o),t.dblClick.emit(o)})),(t.mapMouseOver.observed||t.mouseOver.observed)&&this.mapInstance.on("mouseover",o=>this.zone.run(()=>{t.mapMouseOver.emit(o),t.mouseOver.emit(o)})),(t.mapMouseOut.observed||t.mouseOut.observed)&&this.mapInstance.on("mouseout",o=>this.zone.run(()=>{t.mapMouseOut.emit(o),t.mouseOut.emit(o)})),(t.mapContextMenu.observed||t.contextMenu.observed)&&this.mapInstance.on("contextmenu",o=>this.zone.run(()=>{t.mapContextMenu.emit(o),t.contextMenu.emit(o)})),(t.mapTouchStart.observed||t.touchStart.observed)&&this.mapInstance.on("touchstart",o=>this.zone.run(()=>{t.mapTouchStart.emit(o),t.touchStart.emit(o)})),(t.mapTouchEnd.observed||t.touchEnd.observed)&&this.mapInstance.on("touchend",o=>this.zone.run(()=>{t.mapTouchEnd.emit(o),t.touchEnd.emit(o)})),(t.mapTouchMove.observed||t.touchMove.observed)&&this.mapInstance.on("touchmove",o=>this.zone.run(()=>{t.mapTouchMove.emit(o),t.touchMove.emit(o)})),(t.mapTouchCancel.observed||t.touchCancel.observed)&&this.mapInstance.on("touchcancel",o=>this.zone.run(()=>{t.mapTouchCancel.emit(o),t.touchCancel.emit(o)})),(t.mapWheel.observed||t.wheel.observed)&&this.mapInstance.on("wheel",o=>this.zone.run(()=>{t.mapWheel.emit(o),t.wheel.emit(o)})),t.moveStart.observed&&this.mapInstance.on("movestart",o=>this.zone.run(()=>t.moveStart.emit(o))),t.move.observed&&this.mapInstance.on("move",o=>this.zone.run(()=>t.move.emit(o))),t.moveEnd.observed&&this.mapInstance.on("moveend",o=>this.zone.run(()=>t.moveEnd.emit(o))),(t.mapDragStart.observed||t.dragStart.observed)&&this.mapInstance.on("dragstart",o=>this.zone.run(()=>{t.mapDragStart.emit(o),t.dragStart.emit(o)})),(t.mapDrag.observed||t.drag.observed)&&this.mapInstance.on("drag",o=>this.zone.run(()=>{t.mapDrag.emit(o),t.drag.emit(o)})),(t.mapDragEnd.observed||t.dragEnd.observed)&&this.mapInstance.on("dragend",o=>this.zone.run(()=>{t.mapDragEnd.emit(o),t.dragEnd.emit(o)})),t.zoomStart.observed&&this.mapInstance.on("zoomstart",o=>this.zone.run(()=>t.zoomStart.emit(o))),t.zoomEvt.observed&&this.mapInstance.on("zoom",o=>this.zone.run(()=>t.zoomEvt.emit(o))),t.zoomEnd.observed&&this.mapInstance.on("zoomend",o=>this.zone.run(()=>t.zoomEnd.emit(o))),t.rotateStart.observed&&this.mapInstance.on("rotatestart",o=>this.zone.run(()=>t.rotateStart.emit(o))),t.rotate.observed&&this.mapInstance.on("rotate",o=>this.zone.run(()=>t.rotate.emit(o))),t.rotateEnd.observed&&this.mapInstance.on("rotateend",o=>this.zone.run(()=>t.rotateEnd.emit(o))),t.pitchStart.observed&&this.mapInstance.on("pitchstart",o=>this.zone.run(()=>t.pitchStart.emit(o))),t.pitchEvt.observed&&this.mapInstance.on("pitch",o=>this.zone.run(()=>t.pitchEvt.emit(o))),t.pitchEnd.observed&&this.mapInstance.on("pitchend",o=>this.zone.run(()=>t.pitchEnd.emit(o))),t.boxZoomStart.observed&&this.mapInstance.on("boxzoomstart",o=>this.zone.run(()=>t.boxZoomStart.emit(o))),t.boxZoomEnd.observed&&this.mapInstance.on("boxzoomend",o=>this.zone.run(()=>t.boxZoomEnd.emit(o))),t.boxZoomCancel.observed&&this.mapInstance.on("boxzoomcancel",o=>this.zone.run(()=>t.boxZoomCancel.emit(o))),t.webGlContextLost.observed&&this.mapInstance.on("webglcontextlost",o=>this.zone.run(()=>t.webGlContextLost.emit(o))),t.webGlContextRestored.observed&&this.mapInstance.on("webglcontextrestored",o=>this.zone.run(()=>t.webGlContextRestored.emit(o))),t.render.observed&&this.mapInstance.on("render",o=>this.zone.run(()=>t.render.emit(o))),(t.mapError.observed||t.error.observed)&&this.mapInstance.on("error",o=>this.zone.run(()=>{t.mapError.emit(o),t.error.emit(o)})),t.data.observed&&this.mapInstance.on("data",o=>this.zone.run(()=>t.data.emit(o))),t.styleData.observed&&this.mapInstance.on("styledata",o=>this.zone.run(()=>t.styleData.emit(o))),t.sourceData.observed&&this.mapInstance.on("sourcedata",o=>this.zone.run(()=>t.sourceData.emit(o))),t.dataLoading.observed&&this.mapInstance.on("dataloading",o=>this.zone.run(()=>t.dataLoading.emit(o))),t.styleDataLoading.observed&&this.mapInstance.on("styledataloading",o=>this.zone.run(()=>t.styleDataLoading.emit(o))),t.sourceDataLoading.observed&&this.mapInstance.on("sourcedataloading",o=>this.zone.run(()=>t.sourceDataLoading.emit(o))),t.styleImageMissing.observed&&this.mapInstance.on("styleimagemissing",o=>this.zone.run(()=>t.styleImageMissing.emit(o))),t.idle.observed&&this.mapInstance.on("idle",o=>this.zone.run(()=>t.idle.emit(o)))}
1325assign(t,o,n){if(typeof o=="string"&&(o=o.split(".")),o.length>1){let d=o.shift();this.assign(t[d]=Object.prototype.toString.call(t[d])==="[object Object]"?t[d]:{},o,n)}else t[o[0]]=n}};e.\u0275fac=function(o){return new(o||e)(Ve(qt),Ve(E3,8))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var II=(i,e,r)=>{console.warn(`[ngx-mapbox-gl]: ${i}: ${e} is deprecated, please use ${r} instead.`)};var vu=(()=>{let e=class e{get mapInstance(){return this.mapService.mapInstance}constructor(t){this.mapService=t,this.movingMethod="flyTo",this.mapResize=new Fe,this.mapRemove=new Fe,this.mapMouseDown=new Fe,this.mapMouseUp=new Fe,this.mapMouseMove=new Fe,this.mapClick=new Fe,this.mapDblClick=new Fe,this.mapMouseOver=new Fe,this.mapMouseOut=new Fe,this.mapContextMenu=new Fe,this.mapTouchStart=new Fe,this.mapTouchEnd=new Fe,this.mapTouchMove=new Fe,this.mapTouchCancel=new Fe,this.mapWheel=new Fe,this.moveStart=new Fe,this.move=new Fe,this.moveEnd=new Fe,this.mapDragStart=new Fe,this.mapDrag=new Fe,this.mapDragEnd=new Fe,this.zoomStart=new Fe,this.zoomEvt=new Fe,this.zoomEnd=new Fe,this.rotateStart=new Fe,this.rotate=new Fe,this.rotateEnd=new Fe,this.pitchStart=new Fe,this.pitchEvt=new Fe,this.pitchEnd=new Fe,this.boxZoomStart=new Fe,this.boxZoomEnd=new Fe,this.boxZoomCancel=new Fe,this.webGlContextLost=new Fe,this.webGlContextRestored=new Fe,this.mapLoad=new Fe,this.mapCreate=new Fe,this.idle=new Fe,this.render=new Fe,this.mapError=ne
1325w Fe,this.data=new Fe,this.styleData=new Fe,this.sourceData=new Fe,this.dataLoading=new Fe,this.styleDataLoading=new Fe,this.sourceDataLoading=new Fe,this.styleImageMissing=new Fe,this.resize=new Fe,this.remove=new Fe,this.mouseDown=new Fe,this.mouseUp=new Fe,this.mouseMove=new Fe,this.click=new Fe,this.dblClick=new Fe,this.mouseOver=new Fe,this.mouseOut=new Fe,this.contextMenu=new Fe,this.touchStart=new Fe,this.touchEnd=new Fe,this.touchMove=new Fe,this.touchCancel=new Fe,this.wheel=new Fe,this.dragStart=new Fe,this.drag=new Fe,this.dragEnd=new Fe,this.load=new Fe,this.error=new Fe}ngAfterViewInit(){this.warnDeprecatedOutputs(),this.mapService.setup({accessToken:this.accessToken,customMapboxApiUrl:this.customMapboxApiUrl,mapOptions:{collectResourceTiming:this.collectResourceTiming,container:this.mapContainer.nativeElement,crossSourceCollisions:this.crossSourceCollisions,fadeDuration:this.fadeDuration,minZoom:this.minZoom,maxZoom:this.maxZoom,minPitch:this.minPitch,maxPitch:this.maxPitch,style:this.style,hash:this.hash,interactive:this.interactive,bearingSnap:this.bearingSnap,pitchWithRotate:this.pitchWithRotate,clickTolerance:this.clickTolerance,attributionControl:this.attributionControl,logoPosition:this.logoPosition,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat,preserveDrawingBuffer:this.preserveDrawingBuffer,refreshExpiredTiles:this.refreshExpiredTiles,maxBounds:this.maxBounds,scrollZoom:this.scrollZoom,boxZoom:this.boxZoom,dragRotate:this.dragRotate,dragPan:this.dragPan,keyboard:this.keyboard,doubleClickZoom:this.doubleClickZoom,touchPitch:this.touchPitch,touchZoomRotate:this.touchZoomRotate,trackResize:this.trackResize,center:this.center,zoom:this.zoom,bearing:this.bearing,pitch:this.pitch,renderWorldCopies:this.renderWorldCopies,maxTileCacheSize:this.maxTileCacheSize,localIdeographFontFamily:this.localIdeographFontFamily,transformRequest:this.transformRequest,bounds:this.bounds?this.bounds:this.fitBounds,fitBoundsOptions:this.fitBoundsOptions,antialias:this.antialias,locale:this.locale,cooperativeGestures:this.cooperativeGestures,projection:this.projection},mapEvents:this}),this.cursorStyle&&this.mapService.changeCanvasCursor(this.cursorStyle)}ngOnDestroy(){this.mapService.destroyMap()}ngOnChanges(t){return dp(this,null,function*(){yield kC(this.mapService.mapCreated$),t.cursorStyle&&!t.cursorStyle.isFirstChange()&&this.mapService.changeCanvasCursor(t.cursorStyle.currentValue),t.projection&&!t.projection.isFirstChange()&&this.mapService.updateProjection(t.projection.currentValue),t.minZoom&&!t.minZoom.isFirstChange()&&this.mapService.updateMinZoom(t.minZoom.currentValue),t.maxZoom&&!t.maxZoom.isFirstChange()&&this.mapService.updateMaxZoom(t.maxZoom.currentValue),t.minPitch&&!t.minPitch.isFirstChange()&&this.mapService.updateMinPitch(t.minPitch.currentValue),t.maxPitch&&!t.maxPitch.isFirstChange()&&this.mapService.updateMaxPitch(t.maxPitch.currentValue),t.renderWorldCopies&&!t.renderWorldCopies.isFirstChange()&&this.mapService.updateRenderWorldCopies(t.renderWorldCopies.currentValue),t.scrollZoom&&!t.scrollZoom.isFirstChange()&&this.mapService.updateScrollZoom(t.scrollZoom.currentValue),t.dragRotate&&!t.dragRotate.isFirstChange()&&this.mapService.updateDragRotate(t.dragRotate.currentValue),t.touchPitch&&!t.touchPitch.isFirstChange()&&this.mapService.updateTouchPitch(t.touchPitch.currentValue),t.touchZoomRotate&&!t.touchZoomRotate.isFirstChange()&&this.mapService.updateTouchZoomRotate(t.touchZoomRotate.currentValue),t.doubleClickZoom&&!t.doubleClickZoom.isFirstChange()&&this.mapService.updateDoubleClickZoom(t.doubleClickZoom.currentValue),t.keyboard&&!t.keyboard.isFirstChange()&&this.mapService.updateKeyboard(t.keyboard.currentValue),t.dragPan&&!t.dragPan.isFirstChange()&&this.mapService.updateDragPan(t.dragPan.currentValue),t.boxZoom&&!t.boxZoom.isFirstChange()&&this.mapService.updateBoxZoom(t.boxZoom.currentValue),t.style&&!t.style.isFirstChange()&&this.mapService.updateStyle(t.style.currentValue),t.maxBounds&&!t.maxBounds.isFirstChange()&&this.mapService.updateMaxBounds(t.maxBounds.currentValue),t.fitBounds&&t.fitBounds.currentValue&&!t.fitBounds.isFirstChange()&&this.mapService.fitBounds(t.fitBounds.currentValue,this.fitBoundsOptions),t.fitScreenCoordinates&&t.fitScreenCoordinates.currentValue&&((this.center||this.zoom||this.pitch||this.fitBounds)&&t.fitScreenCoordinates.isFirstChange()&&console.warn("[ngx-mapbox-gl] center / zoom / pitch / fitBounds inputs are being overridden by fitScreenCoordinates input"),this.mapService.fitScreenCoordinates(t.fitScreenCoordinates.currentValue,this.bearing?this.bearing[0]:0,this.movingOptions)),this.centerWithPanTo&&t.center&&!t.center.isFirstChange()&&!t.zoom&&!t.bearing&&!t.pitch?this.mapService.panTo(this.center,this.panToOptions):(t.center&&!t.center.isFirstChange()||t.zoom&&!t.zoom.isFirstChange()||t.bearing&&!t.bearing.isFirstChange()&&!t.fitScreenCoordinates||t.pitch&&
1325!t.pitch.isFirstChange())&&this.mapService.move(this.movingMethod,this.movingOptions,t.zoom&&this.zoom?this.zoom[0]:void 0,t.center?this.center:void 0,t.bearing&&this.bearing?this.bearing[0]:void 0,t.pitch&&this.pitch?this.pitch[0]:void 0)})}warnDeprecatedOutputs(){let t=II.bind(void 0,e.name);this.resize.observed&&t("resize","mapResize"),this.remove.observed&&t("remove","mapRemove"),this.mouseDown.observed&&t("mouseDown","mapMouseDown"),this.mouseUp.observed&&t("mouseUp","mapMouseUp"),this.mouseMove.observed&&t("mouseMove","mapMouseMove"),this.click.observed&&t("click","mapClick"),this.dblClick.observed&&t("dblClick","mapDblClick"),this.mouseOver.observed&&t("mouseOver","mapMouseOver"),this.mouseOut.observed&&t("mouseOut","mapMouseOut"),this.contextMenu.observed&&t("contextMenu","mapContextMenu"),this.touchStart.observed&&t("touchStart","mapTouchStart"),this.touchEnd.observed&&t("touchEnd","mapTouchEnd"),this.touchMove.observed&&t("touchMove","mapTouchMove"),this.touchCancel.observed&&t("touchCancel","mapTouchCancel"),this.wheel.observed&&t("wheel","mapWheel"),this.dragStart.observed&&t("dragStart","mapDragStart"),this.drag.observed&&t("drag","mapDrag"),this.dragEnd.observed&&t("dragEnd","mapDragEnd"),this.load.observed&&t("load","mapLoad"),this.error.observed&&t("error","mapError")}};e.\u0275fac=function(o){return new(o||e)(ae(jx))},e.\u0275cmp=st({type:e,selectors:[["mgl-map"]],viewQuery:function(o,n){if(o&1&&ni(dW,7),o&2){let d;Xt(d=Yt())&&(n.mapContainer=d.first)}},inputs:{accessToken:"accessToken",collectResourceTiming:"collectResourceTiming",crossSourceCollisions:"crossSourceCollisions",customMapboxApiUrl:"customMapboxApiUrl",fadeDuration:"fadeDuration",hash:"hash",refreshExpiredTiles:"refreshExpiredTiles",failIfMajorPerformanceCaveat:"failIfMajorPerformanceCaveat",bearingSnap:"bearingSnap",interactive:"interactive",pitchWithRotate:"pitchWithRotate",clickTolerance:"clickTolerance",attributionControl:"attributionControl",logoPosition:"logoPosition",maxTileCacheSize:"maxTileCacheSize",localIdeographFontFamily:"localIdeographFontFamily",preserveDrawingBuffer:"preserveDrawingBuffer",trackResize:"trackResize",transformRequest:"transformRequest",bounds:"bounds",antialias:"antialias",locale:"locale",cooperativeGestures:"cooperativeGestures",minZoom:"minZoom",maxZoom:"maxZoom",minPitch:"minPitch",maxPitch:"maxPitch",scrollZoom:"scrollZoom",dragRotate:"dragRotate",touchPitch:"touchPitch",touchZoomRotate:"touchZoomRotate",doubleClickZoom:"doubleClickZoom",keyboard:"keyboard",dragPan:"dragPan",boxZoom:"boxZoom",style:"style",center:"center",maxBounds:"maxBounds",zoom:"zoom",bearing:"bearing",pitch:"pitch",fitBoundsOptions:"fitBoundsOptions",renderWorldCopies:"renderWorldCopies",projection:"projection",movingMethod:"movingMethod",movingOptions:"movingOptions",fitBounds:"fitBounds",fitScreenCoordinates:"fitScreenCoordinates",centerWithPanTo:"centerWithPanTo",panToOptions:"panToOptions",cursorStyle:"cursorStyle"},outputs:{mapResize:"mapResize",mapRemove:"mapRemove",mapMouseDown:"mapMouseDown",mapMouseUp:"mapMouseUp",mapMouseMove:"mapMouseMove",mapClick:"mapClick",mapDblClick:"mapDblClick",mapMouseOver:"mapMouseOver",mapMouseOut:"mapMouseOut",mapContextMenu:"mapContextMenu",mapTouchStart:"mapTouchStart",mapTouchEnd:"mapTouchEnd",mapTouchMove:"mapTouchMove",mapTouchCancel:"mapTouchCancel",mapWheel:"mapWheel",moveStart:"moveStart",move:"move",moveEnd:"moveEnd",mapDragStart:"mapDragStart",mapDrag:"mapDrag",mapDragEnd:"mapDragEnd",zoomStart:"zoomStart",zoomEvt:"zoomEvt",zoomEnd:"zoomEnd",rotateStart:"rotateStart",rotate:"rotate",rotateEnd:"rotateEnd",pitchStart:"pitchStart",pitchEvt:"pitchEvt",pitchEnd:"pitchEnd",boxZoomStart:"boxZoomStart",boxZoomEnd:"boxZoomEnd",boxZoomCancel:"boxZoomCancel",webGlContextLost:"webGlContextLost",webGlContextRestored:"webGlContextRestored",mapLoad:"mapLoad",mapCreate:"mapCreate",idle:"idle",render:"render",mapError:"mapError",data:"data",styleData:"styleData",sourceData:"sourceData",dataLoading:"dataLoading",styleDataLoading:"styleDataLoading",sourceDataLoading:"sourceDataLoading",styleImageMissing:"styleImageMissing",resize:"resize",remove:"remove",mouseDown:"mouseDown",mouseUp:"mouseUp",mouseMove:"mouseMove",click:"click",dblClick:"dblClick",mouseOver:"mouseOver",mouseOut:"mouseOut",contextMenu:"contextMenu",touchStart:"touchStart",touchEnd:"touchEnd",touchMove:"touchMove",touchCancel:"touchCancel",wheel:"wheel",dragStart:"dragStart",drag:"drag",dragEnd:"dragEnd",load:"load",error:"error"},features:[It([jx]),hn],decls:2,vars:0,consts:[["container",""]],template:function(o,n){o&1&&Z(0,"div",null,0)},styles:["[_nghost-%COMP%]{display:block}div[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0});let i=e;return i})(),Df=(()=>{let e=class e{constructor(t){this.mapService=t,this.markerDragStart=new Fe,this.markerDragEnd=new Fe,this.markerDrag=new Fe,this.dragStart=new Fe,this.dragEnd=new Fe,this.drag=new Fe}ngOnInit(){if(this.warnDeprecatedOutputs(),this.feature&&this.lngLat)throw new Error("feature and lngLat input are mutually exclusive")}ngOnChanges(t){t.lngLat&&!t.lngLat.isFirstChange()&&this.markerInstance.setLngLat(this.lngLat),t.feature&&!t.feature.is
1325FirstChange()&&this.markerInstance.setLngLat(this.feature.geometry.coordinates),t.draggable&&!t.draggable.isFirstChange()&&this.markerInstance.setDraggable(!!this.draggable),t.popupShown&&!t.popupShown.isFirstChange()&&(t.popupShown.currentValue?this.markerInstance.getPopup().addTo(this.mapService.mapInstance):this.markerInstance.getPopup().remove()),t.pitchAlignment&&!t.pitchAlignment.isFirstChange()&&this.markerInstance.setPitchAlignment(t.pitchAlignment.currentValue),t.rotationAlignment&&!t.rotationAlignment.isFirstChange()&&this.markerInstance.setRotationAlignment(t.rotationAlignment.currentValue)}ngAfterViewInit(){this.mapService.mapCreated$.subscribe(()=>{this.markerInstance=this.mapService.addMarker({markersOptions:{offset:this.offset,anchor:this.anchor,pitchAlignment:this.pitchAlignment,rotationAlignment:this.rotationAlignment,draggable:!!this.draggable,element:this.content.nativeElement,feature:this.feature,lngLat:this.lngLat,clickTolerance:this.clickTolerance},markersEvents:{markerDragStart:this.markerDragStart,markerDrag:this.markerDrag,markerDragEnd:this.markerDragEnd,dragStart:this.markerDragStart,drag:this.markerDrag,dragEnd:this.markerDragEnd}})})}ngOnDestroy(){this.mapService.removeMarker(this.markerInstance),this.markerInstance=void 0}togglePopup(){this.markerInstance.togglePopup()}updateCoordinates(t){this.markerInstance.setLngLat(t)}warnDeprecatedOutputs(){let t=II.bind(void 0,e.name);this.markerDragStart.observed&&t("dragStart","markerDragStart"),this.markerDragEnd.observed&&t("dragEnd","markerDragEnd"),this.markerDrag.observed&&t("drag","markerDrag")}};e.\u0275fac=function(o){return new(o||e)(ae(jx))},e.\u0275cmp=st({type:e,selectors:[["mgl-marker"]],viewQuery:function(o,n){if(o&1&&ni(w3,7),o&2){let d;Xt(d=Yt())&&(n.content=d.first)}},inputs:{offset:"offset",anchor:"anchor",clickTolerance:"clickTolerance",feature:"feature",lngLat:"lngLat",draggable:"draggable",popupShown:"popupShown",className:"className",pitchAlignment:"pitchAlignment",rotationAlignment:"rotationAlignment"},outputs:{markerDragStart:"markerDragStart",markerDragEnd:"markerDragEnd",markerDrag:"markerDrag",dragStart:"dragStart",dragEnd:"dragEnd",drag:"drag"},features:[hn],ngContentSelectors:C3,decls:3,vars:2,consts:[["content",""]],template:function(o,n){o&1&&(Zd(),S(0,"div",null,0),Kd(2),E()),o&2&&cl(n.className)},encapsulation:2,changeDetection:0});let i=e;return i})();var Vx=(()=>{let e=class e{constructor(t){this.mapService=t,this.popupClose=new Fe,this.popupOpen=new Fe,this.close=new Fe,this.open=new Fe}ngOnInit(){if(this.warnDeprecatedOutputs(),this.lngLat&&this.marker||this.feature&&this.lngLat||this.feature&&this.marker)throw new Error("marker, lngLat, feature input are mutually exclusive")}ngOnChanges(t){if(t.lngLat&&!t.lngLat.isFirstChange()||t.feature&&!t.feature.isFirstChange()){let o=t.lngLat?this.lngLat:this.feature.geometry.coordinates;this.mapService.removePopupFromMap(this.popupInstance,!0);let n=this.createPopup();this.mapService.addPopupToMap(n,o,this.popupInstance.isOpen()),this.popupInstance=n}if(t.marker&&!t.marker.isFirstChange()){let o=t.marker.previousValue;o.markerInstance&&this.mapService.removePopupFromMarker(o.markerInstance),this.marker&&this.marker.markerInstance&&this.popupInstance&&this.mapService.addPopupToMarker(this.marker.markerInstance,this.popupInstance)}t.offset&&!t.offset.isFirstChange()&&this.popupInstance&&this.popupInstance.setOffset(this.offset)}ngAfterViewInit(){this.popupInstance=this.createPopup(),this.addPopup(this.popupInstance)}ngOnDestroy(){this.popupInstance&&(this.lngLat||this.feature?this.mapService.removePopupFromMap(this.popupInstance):this.marker&&this.marker.markerInstance&&this.mapService.removePopupFromMarker(this.marker.markerInstance)),this.popupInstance=void 0}createPopup(){return this.mapService.createPopup({popupOptions:{closeButton:this.closeButton,closeOnClick:this.closeOnClick,closeOnMove:this.closeOnMove,focusAfterOpen:this.focusAfterOpen,anchor:this.anchor,offset:this.offset,className:this.className,maxWidth:this.maxWidth},popupEvents:{open:this.open,close:this.close,popupOpen:this.popupOpen,popupClose:this.popupClose}},this.content.nativeElement)}addPopup(t){this.mapService.mapCreated$.subscribe(()=>{if(this.lngLat||this.feature)this.mapService.addPopupToMap(t,this.lngLat?this.lngLat:this.feature.geometry.coordinates);else if(this.marker&&this.marker.markerInstance)this.mapService.addPopupToMarker(this.marker.markerInstance,t);else throw new Error("mgl-popup need either lngLat/marker/feature to be set")})}warnDeprecatedOutputs(){let t=II.bind(void 0,e.name);this.close.observed&&t("close","popupClose"),this.open.observed&&t("open","popupOpen")}};
1325e.\u0275fac=function(o){return new(o||e)(ae(jx))},e.\u0275cmp=st({type:e,selectors:[["mgl-popup"]],viewQuery:function(o,n){if(o&1&&ni(w3,7),o&2){let d;Xt(d=Yt())&&(n.content=d.first)}},inputs:{closeButton:"closeButton",closeOnClick:"closeOnClick",closeOnMove:"closeOnMove",focusAfterOpen:"focusAfterOpen",anchor:"anchor",className:"className",maxWidth:"maxWidth",feature:"feature",lngLat:"lngLat",marker:"marker",offset:"offset"},outputs:{popupClose:"popupClose",popupOpen:"popupOpen",close:"close",open:"open"},features:[hn],ngContentSelectors:C3,decls:3,vars:0,consts:[["content",""]],template:function(o,n){o&1&&(Zd(),S(0,"div",null,0),Kd(2),E())},encapsulation:2,changeDetection:0});let i=e;return i})();var vl=(()=>{let e=class e{static withConfig(t){return{ngModule:e,providers:[{provide:E3,useValue:t.accessToken}]}}};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({imports:[Dt]});let i=e;return i})();function hW(i,e){i&1&&Z(0,"div",2)}var pW=(i,e)=>[i,e];function fW(i,e){if(i&1&&(S(0,"mgl-marker",12),Z(1,"div",13),E()),i&2){let r=q(3);N("lngLat",mn(1,pW,r.lng,r.lat))}}var mW=()=>[5],gW=()=>[13.764,46.245];function _W(i,e){if(i&1){let r=Ge();S(0,"mgl-map",9,10),se("load",function(o){Se(r);let n=q(2);return Te(n.loadMap(o))})("click",function(o){Se(r);let n=q(2);return Te(n.getCoordinates(o))}),ce(2,fW,2,4,"mgl-marker",11),E()}if(i&2){let r=q(2);Gs("mapbox://styles/silko/cjb1va19f6xm72spde16k92nx"),N("zoom",Zs(5,mW))("center",Zs(6,gW)),P(2),N("ngIf",r.lng&&r.lat)}}function vW(i,e){if(i&1){let r=Ge();S(0,"div")(1,"div",3)(2,"div")(3,"input",4),se("keyup",function(o){Se(r);let n=q();return Te(n.initSearch(o))}),E()(),ce(4,_W,3,7,"mgl-map",5),S(5,"div",6)(6,"button",7),se("click",function(){Se(r);let o=q();return Te(o.closeMap())}),A(7,"Prekli\u010Di"),E(),S(8,"button",8),se("click",function(){Se(r);let o=q();return Te(o.submitCoordinates())}),A(9,"Potrdi"),E()()()()}if(i&2){let r=q();ki("popup ",r.mapPopupID,""),P(4),N("ngIf",r.isBrowser)}}var Ux=(()=>{let e=class e{constructor(t,o){this.googleMapsService=o,this.lat=null,this.lng=null,this.mapVisible=!1,this.mapPopupID="",this.isBrowser=Si(t),this.onCoordinatesChange=new Fe}closeMap(){this.lng=null,this.lat=null,this.mapVisible=!1}openMap(){this.mapVisible=!0}getCoordinates(t){typeof t.lngLat<"u"&&(this.lng=t.lngLat.lng,this.lat=t.lngLat.lat)}submitCoordinates(){let t=this.lat,o=this.lng;this.onCoordinatesChange.emit({lat:t,lng:o}),this.closeMap()}loadMap(t){this.lat!=null&&this.lng!=null?(t.setCenter([this.lng,this.lat]),t.setZoom(12)):t.resize(),this.map=t}initSearch(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.findDestination(t)},450)}findDestination(t){t.target.value&&this.googleMapsService.geocode(t.target.value).subscribe(o=>{o.status==="OK"&&(this.map.setCenter([o.results[0].geometry.location.lng,o.results[0].geometry.location.lat]),this.map.setZoom(13))})}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(_u))},e.\u0275cmp=st({type:e,selectors:[["app-map-popup"]],inputs:{lat:"lat",lng:"lng",mapVisible:"mapVisible",mapPopupID:"mapPopupID"},outputs:{onCoordinatesChange:"onCoordinatesChange"},standalone:!0,features:[It([_u]),gt],decls:2,vars:2,consts:[["class","popup-outer",4,"ngIf"],[3,"class",4,"ngIf"],[1,"popup-outer"],[1,"center",2,"background","#424040"],["type","text","placeholder","Vnesi ime destinacije.",2,"padding","5px","width","calc(100% - 14px)",3,"keyup"],[3,"style","zoom","center","load","click",4,"ngIf"],[2,"height","45px"],[1,"btn","btn-sm","btn-default","margin-5","float-left",3,"click"],[1,"btn","btn-sm","btn-primary","margin-5","float-right",3,"click"],[3,"zoom","center","load","click"],["map",""],[3,"lngLat",4,"ngIf"],[3,"lngLat"],[1,"marker"]],template:function(o,n){o&1&&ce(0,hW,1,0,"div",0)(1,vW,10,4,"div",1),o&2&&(N("ngIf",n.mapVisible),P(1),N("ngIf",n.mapVisible))},dependencies:[vl,vu,Df,Dt,At]});let i=e;return i})();var yW=["mapPopup"];function bW(i,e){i&1&&(S(0,"div",7),Z(1,"img",8),E())}function xW(i,e){if(i&1){let r=Ge();S(0,"li",13),se("click",function(){Se(r);let o=q(3);return Te(o.hideDropdown())}),Z(1,"img",14),A(2),E()}if(i&2){let r=e.$implicit;N("routerLink",r.url),P(1),Hi("src",r.icon,Ei),P(1),We(" ",r.name," ")}}function wW(i,e){if(i&1&&(S(0,"div")(1,"ul"),ce(2,xW,3,3,"li",12),E()()),i&2){let r=q(2);P(2),N("ngForOf",r.links)}}function CW(i,e){if(i&1&&(S(0,"b",20),A(1),E()),i&2){let r=q().$implicit;P(1),mt(r.additional_data)}}function EW(i,e){if(i&1){let r=Ge();S(0,"li",18),se("mousedown",function(){let n=Se(r).$implicit,d=q().$implicit,_=q(2);return Te(_.selectItem(n.value,d==null?null:d.type,n.slug))}),A(1),ce(2,CW,2,1,"b",19),E()}if(i&2){let r=e.$implicit;P(1),We("",r.label," "),P(1),N("ngIf",r.additional_data)}}function SW(i,e){if(i&1){let r=Ge();S(0,"li",21),se("click",function(){Se(r);let o=q().$implicit,n=q(2);return Te(n.loadMore(o==null?null:o.type))}),S(1,"a"),A(2,"Nalo\u017Ei ve\u010D..."),E()()}}function TW(i,e){if(i&1&&(S(0,"div")(1,"div",15)(2,"b"),A(3),E()(),S(4,"ul"),ce(5,EW,3,2,"li",16)(6,SW,3,0,"li",17),E()()),i&2){let r=e.$implicit;P(3),mt(r==null?null:r.title),P(2),N("ngForOf",r==null?null:r.values),P(1),N("ngIf",!(r!=null&&r.finished))}}function IW(i,e){if(i&1&&(S(0,"div",9),ce(1,wW,3,1,"div",10)(2,TW,7,3,"div",11),E()),i&2){let r=q();P(1),N("ngIf",r.links.length>0),P(1),N("ngForOf",r.values)}}function DW(i,e){if(i&1&&(S(0,"li",26),Z(1,"img",27),A(2),E()),i&2){let r=e.$implicit;N("routerLink",r.url),P(1),Hi("src",r.icon,Ei),P(1),We(" ",r.name," ")}}function MW(i,e){if(i&1&&(S(0,"div")(1,"ul"),ce(2,DW,3,3,"li",25),E()()),i&2){let r=q(2);P(2),N("ngForOf",r.links)}}function kW(i,e){i&1&&(S(0,"div",28),A(1," Ne najdem ustrezne vsebine. "),E())}function AW(i,e){if(i&1){let r=Ge();S(0,"li",18),se("mousedown",function(){let n=Se(r).$implicit,d=q(3);return Te(d.selectItem(n.value))}),A(1),E()}if(i&2){let r=e.$implicit;P(1),We(" ",r.label," ")}}function PW(i,e){if(i&1&&(S(0,"ul"),ce(1,AW,2,1,"li",16),E()),i&2){let r=q(2);P(1),N("ngForOf",r.values)}}function OW(i,e){if(i&1){let r=Ge();S(0,"li",21),se("click",function(o){Se(r);let n=q(3);return Te(n.changeCheckbox(o.target))}),S(1,"input",31),se("change",function(o){let d=Se(r).$implicit,_=q(3);return Te(_.changeSelection(d.value,o.target))}),E(),A(2),E()}if(i&2){let r=e.$implicit,t=q(3);P(1),Hi("value",r.value),N("checked",t.selectedValues.includes(r.value)),P(1),We(" ",r.label," ")}}function RW(i,e){if(i&1&&(S(0,"ul",29),ce(1,OW,3,3,"li",30),E()),i&2){let r=q(2);P(1),N("ngForOf",r.values)}}var S3=i=>({"max-content":i});function LW(i,e){if(i&1&&(S(0,"div",22),ce(1,MW,3,1,"div",10)(2,kW,2,0,"div",23)(3,PW,2,1,"ul",10)(4,RW,2,1,"ul",24),E()),i&2){let r=q();N("ngClass",kt(5,S3,r.style=="max-content")),P(1),N("ngIf",!r.loader&&r.links.length>0),P(1),N("ngIf",(r.values==null?null:r.values.length)==0),P(1),N("ngIf",!r.multipleSelect),P(1),N("ngIf",r.multipleSelect)}
1325}function FW(i,e){i&1&&(S(0,"div",41),A(1,"Zavrnili ste dostop do va\u0161e lokacije. \u010Ce \u017Eelite uporabiti to mo\u017Enost morate najprej omogo\u010Diti dostop."),E())}function NW(i,e){if(i&1){let r=Ge();S(0,"div",36)(1,"i"),A(2,"Dolo\u010Dite koordinate to\u010Dke, od katere se ra\u010Duna oddaljenost in \u017Eeleno maksimalno oddaljenost."),E(),Z(3,"br"),S(4,"button",37),se("click",function(){Se(r);let o=q(2);return Te(o.getMyCoordinates())}),A(5," Moja lokacija "),E(),S(6,"button",38),se("click",function(){Se(r);let o=q(2);return Te(o.mapPopup.openMap())}),A(7," Izberi to\u010Dko na zemljevidu "),E(),Z(8,"br"),ce(9,FW,2,0,"div",39),S(10,"p"),A(11,"Zemljepisna \u0161irina: "),S(12,"input",40),se("change",function(o){Se(r);let n=q(2);return Te(n.changeLocationValues(o,"lat"))}),E()(),S(13,"p"),A(14,"Zemljepisna dol\u017Eina: "),S(15,"input",40),se("change",function(o){Se(r);let n=q(2);return Te(n.changeLocationValues(o,"lng"))}),E()()()}if(i&2){let r=q(2);P(9),N("ngIf",r.visibleLocationErrorMessage),P(3),N("value",r.lat),P(3),N("value",r.lng)}}function zW(i,e){if(i&1){let r=Ge();S(0,"p"),A(1," Od: "),S(2,"input",42),se("change",function(o){Se(r);let n=q(2);return Te(n.changeRangeValues(o,"low","hour"))}),E(),A(3," ur "),S(4,"input",43),se("change",function(o){Se(r);let n=q(2);return Te(n.changeRangeValues(o,"low","min"))}),E(),A(5," min "),E()}if(i&2){let r=q(2);P(2),Hi("step",r.sliderOptions.step),N("value",r.sliderLowValueHour),P(2),Hi("step",r.sliderOptions.step),N("value",r.sliderLowValueMin)("max",60)}}function jW(i,e){if(i&1){let r=Ge();S(0,"p"),A(1," Od: "),S(2,"input",42),se("change",function(o){Se(r);let n=q(2);return Te(n.changeRangeValues(o,"low"))}),E(),A(3),E()}if(i&2){let r=q(2);P(2),Hi("step",r.sliderOptions.step),N("value",r.sliderLowValue),P(1),We(" ",r.unit," ")}}function VW(i,e){if(i&1){let r=Ge();S(0,"p"),A(1," do: "),S(2,"input",42),se("change",function(o){Se(r);let n=q(2);return Te(n.changeRangeValues(o,"high","hour"))}),E(),A(3," ur "),S(4,"input",43),se("change",function(o){Se(r);let n=q(2);return Te(n.changeRangeValues(o,"high","min"))}),E(),A(5," min "),E()}if(i&2){let r=q(2);P(2),Hi("step",r.sliderOptions.step),N("value",r.sliderHighValueHour),P(2),Hi("step",r.sliderOptions.step),N("value",r.sliderHighValueMin)("max",60)}}function BW(i,e){if(i&1){let r=Ge();S(0,"p"),A(1),S(2,"input",42),se("change",function(o){Se(r);let n=q(2);return Te(n.changeRangeValues(o,"high"))}),E(),A(3),E()}if(i&2){let r=q(2);P(1),We(" ",r.highValueTitle," "),P(1),Hi("step",r.sliderOptions.step),N("value",r.sliderHighValue),P(1),We(" ",r.unit," ")}}function UW(i,e){if(i&1){let r=Ge();S(0,"ngx-slider",44),se("valueChange",function(o){Se(r);let n=q(2);return Te(n.sliderLowValue=o)})("highValueChange",function(o){Se(r);let n=q(2);return Te(n.sliderHighValue=o)})("userChangeEnd",function(o){Se(r);let n=q(2);return Te(n.changeRangeValues(o))}),E()}if(i&2){let r=q(2);N("value",r.sliderLowValue)("highValue",r.sliderHighValue)("options",r.sliderOptions)}}function HW(i,e){if(i&1){let r=Ge();S(0,"ngx-slider",45),se("valueChange",function(o){Se(r);let n=q(2);return Te(n.sliderHighValue=o)})("userChangeEnd",function(o){Se(r);let n=q(2);return Te(n.changeRangeValues(o))}),E()}if(i&2){let r=q(2);N("value",r.sliderHighValue)("options",r.sliderOptions)}}function $W(i,e){if(i&1&&(S(0,"div",32),ce(1,NW,16,3,"div",33)(2,zW,6,5,"p",10)(3,jW,4,3,"p",10)(4,VW,6,5,"p",10)(5,BW,4,4,"p",10)(6,UW,1,3,"ngx-slider",34)(7,HW,1,2,"ngx-slider",35),E()),i&2){let r=q();P(1),N("ngIf",r.type=="distance"),P(1),N("ngIf",r.contentType=="hiking_time"),P(1),N("ngIf",r.contentType!="hiking_time"&&r.sliderType=="range"),P(1),N("ngIf",r.contentType=="hiking_time"),P(1),N("ngIf",r.contentType!="hiking_time"),P(1),N("ngIf",r.sliderType=="range"&&r.isBrowser),P(1),N("ngIf",r.sliderType=="value"&&r.isBrowser)}}function GW(i,e){if(i&1){let r=Ge();S(0,"button",46),se("click",function(){Se(r);let o=q();return Te(o.clearSelection())}),A(1," Po\u010Disti "),E()}}function qW(i,e){if(i&1){let r=Ge();S(0,"app-map-popup",47,48),se("onCoordinatesChange",function(o){Se(r);let n=q();return Te(n.submitCoordinates(o))}),E()}if(i&2){let r=q();N("lat",r.lat)("lng",r.lng)("mapVisible",!1)("mapPopupID","map-popup-filter-"+r.filterID)}}var yu=(()=>{let e=class e{constructor(t,o,n,d){this.platformId=t,this.router=o,this.gpsService=n,this.injector=d,this.values=null,this.links=[],this.categories=!0,this.dropdown_id="",this.additionalClasses="",this.contentType="",this.multipleSelect=!1,this.selectedValues=[],this.clearButton=!1,this.type="list",this.sliderLowValue=0,this.sliderHighValue=9e3,this.sliderFloor=0,this.sliderCeil=9e3,this.sliderStep=1,this.sliderType="range",this.style=null,this.unit="m",this.sliderOptions={floor:this.sliderFloor,ceil:this.sliderCeil,step:this.sliderStep,showSelectionBar:!0},this.lat=null,this.lng=null,this.filterID=null,this.highValueTitle="do:",this.params=null,this.visibleLocationErrorMessage=!1,this.sliderLowValueHour=null,this.sliderLowValueMin=null,this.sliderHighValueHour=null,this.sliderHighValueMin=null,this.loader=!1,this.mapPopup=null,this.onLoadMore=new Fe,this.onSelect=new Fe,this.onDeselect=new Fe,this.clear=new Fe,this.changeRange=new Fe,this.changeLocation=new Fe,this.isBrowser=Si(this.platformId)}hideDropdown(){this.links=[]}selectItem(t,o=null,n=null){this.onSelect.emit({value:t,type:o,slug:n})}loadMore(t=null){this.onLoadMore.emit(t)}changeSelection(t,o){o.checked?this.onSelect.emit(t):this.onDeselect.emit(t)}changeCheckbox(t){t.children[0]&&t.children[0].click()}clearSelection(){this.clear.emit()}changeRangeValues(t,o=null,n=null){o==="low"?n==="hour"?(this.sliderLowValueHour=parseInt(t.target.value,10),this.sliderLowValue=this.sliderLowValueHour*60+this.sliderLowValueMin):n==="min"?(this.sliderLowValueMin=parseInt(t.target.value,10),this.sliderLowValue=this.sliderLowValueHour*60+this.sliderLowValueMin):this.sliderLowValue=parseInt(t.target.value,10):o==="high"?n==="hour"?(this.sliderHighValueHour=parseInt(t.target.value,10),this.sliderHighValue=this.sliderHighValueHour*60+this.sliderHighValueMin):n==="min"?(this.sliderHighValueMin=parseInt(t.target.value,10),this.sliderHighValue=this.sliderHighValueHour*60+this.sliderHighValueMin):this.sliderHighValue=parseInt(t.target.value,10):this.contentType==="hiking_time"&&(this.sliderLowValueHour=Math.floor(this.sliderLowValue/60),this.sliderLowValueMin=this.sliderLowValue-this.sliderLowValueHour*60,this.sliderHighValueHour=Math.floor(this.sliderHighValue/60),this.sliderHighValueMin=this.sliderHighValue-this.sliderHighValueHour*60);let d=this.sliderLowValue,_=this.sliderHighValue;this.changeRange.emit({lowValue:d,highValue:_})}changeLocationValues(t,o){if(o==="lat"?this.lat=t.target.value:this.lng=t.target.value,this.lat!==null&&this.lng!==null){let n=this.lat,d=this.lng;this.changeLocation.emit({lat:n,lng:d})}}ngOnInit(){let t=this;switch(this.loader=!0,this.contentType){case"country":this.listService=this.injector.get(th),this.listService.getCountries(50,0,"title",null,!0).subscribe(n=>{t.values=n.results;for(let d in t.values)t.values[d].label=t.values[d].title,t.values[d].value=t.values[d].id;this.loader=!1});break;case"mountain_range":this.listService=this.injector.get(ih);let o=this.params.country?this.params.country:null;this.listService.getMountainRanges(50,0,o).subscribe(n=>{t.values=n.results;for(let d in this.values)t.values[d].label=t.values[d].title,t.values[d].value=t.values[d].id;this.loader=!1});break;case"difficulty":this.listService=this.injector.get(Ln),this.listService.getDifficulty(50).subscribe(n=>{t.values=n.results;for(let d in this.values)t.values[d].label=t.values[d].title,t.values[d].value=t.values[d].id;this.loader=!1});break;case"type":this.values=[{value:"1",label:"Vrh"},{value:"2",label:"Ko\u010Da"},{value:"3",label:"Naselje"},{value:"4",label:"Prelaz"},{value:"5",label:"Jezero"},{value:"7",label:"Planina"},{value:"8",label:"Bivak"},{value:"9",label:"Slap"},{value:"6",label:"Drugo"}],this.loader=!1;break;case"hiking_time":this.sliderLowValueHour=Math.floor(this.sliderLowValue/60),this.sliderLowValueMin=this.sliderLowValue-this.sliderLowValueHour*60,this.sliderHighValueHour=Math.floor(this.sliderHighValue/60),this.sliderHighValueMin=this.sliderHighValue-this.sliderHighValueHour*60,this.loader=!1;break;default:this.loader=!1;break}}submitCoordinates(t){this.visibleLocationErrorMessage=!1,this.lat=t.lat,this.lng=t.lng;let o=t.lat,n=t.lng;this.changeLocation.emit({lat:o,lng:n})}getMyCoordinates(){this.gpsService.getPosition().then(t=>{this.visibleLocationErrorMessage=!1,this.lat=t.lat,this.lng=t.lng;let o=t.lat,n=t.lng;this.changeLocation.emit({lat:o,lng:n})},t=>{this.visibleLocationErrorMessage=!0})}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(si),ae(Js),ae(is))},e.\u0275cmp=st({type:e,selectors:[["app-dropdown"]],viewQuery:function(o,n){if(o&1&&ni(yW,5),o&2){let d;Xt(d=Yt())&&(n.mapPopup=d.first)}},inputs:{values:"values",links:"links",categories:"categories",dropdown_id:"dropdown_id",additionalClasses:"additionalClasses",contentType:"contentType",multipleSelect:"multipleSelect",selectedValues:"selectedValues",clearButton:"clearButton",type:"type",sliderLowValue:"sliderLowValue",sliderHighValue:"sliderHighValue",sliderFloor:"sliderFloor",sliderCeil:"sliderCeil",sliderStep:"sliderStep",sliderType:"sliderType",style:"style",unit:"unit",sliderOptions:"sliderOptions",lat:"lat",lng:"lng",filterID:"filterID",highValueTitle:"highValueTitle",params:"params"},outputs:{onSelect:"onSelect",onDeselect:"onDeselect",clear:"clear",changeRange:"changeRange",changeLocation:"changeLocation",onLoadMore:"onLoadMore"},standalone:!0,features:[It([Js,th,ih,Ln]),gt],decls:7,vars:13,consts:[[3,"ngClass"],["class","loader center-text margin-5",4,"ngIf"],["class","dropdown-inner",4,"ngIf"],["class","dropdown-inner",3,"ngClass",4,"ngIf"],["class","range-dropdown",4,"ngIf"],["class","margin-5 btn btn-xs btn-default",3,"click",4,"ngIf"],[3,"lat","lng","mapVisible","mapPopupID","onCoordinatesChange",4,"ngIf"],[1,"loader","center-text","margin-5"],["src","/assets/images/small_loader.gif"],[1,"dropdown-inner"],[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"routerLink","click",4,"ngFor","ngForOf"],[3,"routerLink","click"],["width","15px","alt","Search icon",3,"src"],[1,"dropdown-category-header"],[3,"mousedown",4,"ngFor","ngForOf"],[3,"click",4,"ngIf"],[3,"mousedown"],["class","special-name",4,"ngIf"],[1,"special-name"],[3,"click"],[1,"dropdown-inner",3,"ngClass"],["class","loader center-text",4,"ngIf"],["style","text-align: left;",4,"ngIf"],["class","dropdown-link",3,"routerLink",4,"ngFor","ngForOf"],[1,"dropdown-link",3,"routerLink"],["width","15px","alt","Add icon",3,"src"],[1,"loader","center-text"],[2,"text-align","left"],[3,"click",4,"ngFor","ngForOf"],["type","checkbox",3,"value","checked","change"],[1,"range-dropdown"],["class","left-text",4,"ngIf"],[3,"value","highValue","options","valueChange","highValueChange","userChangeEnd",4,"ngIf"],[3,"value","o
1325ptions","valueChange","userChangeEnd",4,"ngIf"],[1,"left-text"],["type","button",1,"btn","btn-default","btn-xs","margin-5-top","margin-5-bottom",3,"click"],["type","button",1,"btn","btn-default","btn-xs","margin-5-left","margin-5-top","margin-5-bottom",3,"click"],["class","error-message margin-5-bottom",4,"ngIf"],["type","number","step","any",1,"width-70",3,"value","change"],[1,"error-message","margin-5-bottom"],["type","number",1,"width-60",3,"step","value","change"],["type","number",1,"width-60",3,"step","value","max","change"],[3,"value","highValue","options","valueChange","highValueChange","userChangeEnd"],[3,"value","options","valueChange","userChangeEnd"],[1,"margin-5","btn","btn-xs","btn-default",3,"click"],[3,"lat","lng","mapVisible","mapPopupID","onCoordinatesChange"],["mapPopup",""]],template:function(o,n){o&1&&(S(0,"div",0),ce(1,bW,2,0,"div",1)(2,IW,3,2,"div",2)(3,LW,5,7,"div",3)(4,$W,8,7,"div",4)(5,GW,2,0,"button",5)(6,qW,2,4,"app-map-popup",6),E()),o&2&&(Qp("dropdown ",n.dropdown_id," ",n.additionalClasses,""),N("ngClass",kt(11,S3,n.style=="max-content")),P(1),N("ngIf",n.loader),P(1),N("ngIf",!n.loader&&n.categories&&n.type=="list"),P(1),N("ngIf",!n.loader&&!n.categories&&n.type=="list"),P(1),N("ngIf",!n.loader&&(n.type=="range"||n.type=="distance")),P(1),N("ngIf",n.clearButton),P(1),N("ngIf",n.filterID))},dependencies:[Dt,on,ti,At,FF,qi,Nx,q_,Ux],styles:[".range-dropdown[_ngcontent-%COMP%]{width:500px}.dropdown[_ngcontent-%COMP%]{z-index:99;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:10px;box-shadow:var(--shadow-md);max-height:250px;overflow-y:scroll;width:calc(100% - 20px);position:absolute}.max-content[_ngcontent-%COMP%]{width:max-content}.dropdown.filter-home[_ngcontent-%COMP%]{position:relative;width:calc(100% - 22px);margin:2px;border-radius:var(--radius-md);box-shadow:none}.dropdown.filter-home[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]{max-height:120px;overflow:scroll}.dropdown-inner[_ngcontent-%COMP%]{width:100%}.dropdown-full-width[_ngcontent-%COMP%]{width:calc(100% - 14px)}.dropdown-main-search[_ngcontent-%COMP%]{margin-left:25px;width:calc(100% - 43px)}.dropdown[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{padding:6px;cursor:pointer;list-style-type:none;border-radius:var(--radius-sm);transition:background var(--transition-fast)}.dropdown[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:hover{background:var(--color-accent-soft)}.dropdown-category-header[_ngcontent-%COMP%]{padding:4px 6px;font-size:var(--font-size-sm);background:var(--color-surface-alt);border-radius:var(--radius-sm)}@media screen and (max-width: 1000px){.range-dropdown[_ngcontent-%COMP%]{width:100%}.dropdown[_ngcontent-%COMP%]{width:calc(100% - 22px)}.dropdown-inner[_ngcontent-%COMP%]{width:auto}}"]});let i=e;return i})();var WW=(i,e)=>({ceil:i,floor:e,step:1});function ZW(i,e){if(i&1){let r=Ge();S(0,"app-dropdown",2),se("clear",function(){Se(r);let o=q();return Te(o.clearSelection())})("onSelect",function(o){Se(r);let n=q();return Te(n.selectValue(o))})("onDeselect",function(o){Se(r);let n=q();return Te(n.deselectValue(o))})("changeRange",function(o){Se(r);let n=q();return Te(n.changeRangeValues(o))})("changeLocation",function(o){Se(r);let n=q();return Te(n.changeLocationValues(o))}),E()}if(i&2){let r=q();Gs("max-content"),N("categories",!1)("type",r.filterType)("contentType",r.contentType)("multipleSelect",r.multipleSelect)("selectedValues",r.selectedValues)("sliderType",r.sliderType)("sliderLowValue",r.lowValue!=null?r.lowValue:r.sliderFloor)("sliderHighValue",r.highValue!=null?r.highValue:r.sliderCeil)("highValueTitle",r.highValueTitle!=null?r.highValueTitle:"do:")("lat",r.lat)("lng",r.lng)("sliderOptions",mn(20,WW,r.sliderCeil,r.sliderFloor))("dropdown_id","dropdown-filter-"+r.filterID)("filterID",r.filterID)("clearButton",!0)("unit",r.unit)("additionalClasses","non-absolute-dropdown-mobile "+r.additionalClasses)("params",r.params)}}var KW=i=>({active:i}),Hx=(()=>{let e=class e{constructor(t){this.platformId=t,this.multipleSelect=!1,this.contentType="",this.filterType="",this.filterName="",this.filterID="",this.sliderFloor=0,this.sliderCeil=9e3,this.sliderType="range",this.additionalClasses="",this.unit="m",this.highValueTitle="",this.params=null,this.selectedValue=null,this.selectedValues=[],this.lowValue=null,this.highValue=null,this.lat=null,this.lng=null,this.selectionVisible=!1,this.changeSelectionVisible=!1,this.values=[],this.isBrowser=!1,this.onSelect=new Fe,this.onRangeChange=new Fe,this.onLocationChange=new Fe,this.isBrowser=Si(this.platformId)}onDocClickHandler(t){if(this.selectionVisible&&this.isBrowser){let o=document.getElementsByClassName("map-popup-filter-"+this.filterID),n=document.getElementsByClassName("dropdown-filter-"+this.filterID),d=document.getElementsByClassName("filter-"+this.filterID);for(let _ in n)isNaN(parseInt(_,10))||(t.type==="mousedown"&&(!n[_]||!n[_].contains(t.target))&&(!d[_]||!d[_].contains(t.target))&&(!o[_]||!o[_].contains(t.target))?this.changeSelectionVisible=!0:t.type==="mouseup"&&this.changeSelectionVisible===!0&&(this.selectionVisible=!1,this.changeSelectionVisible=!1))}}changeRangeValues(t){let o=t.lowValue,n=t.highValue;this.lowValue=o,this.highValue=n,this.onRangeChange.emit({lowValue:o,highValue:n})}changeLocationValues(t){let o=t.lat,n=t.lng;this.lat=o,this.lng=n,this.onLocationChange.emit({lat:o,lng:n})}selectValue(t){this.multipleSelect&&this.selectedValues.indexOf(t)===-1?(this.selectedValues.push(t),this.onSelect.emit(this.selectedValues.join("|"))):this.multipleSelect||(this.selectedValue=t,this.onSelect.emit(this.selectedValue))}deselectValue(t){if(this.multipleSelect&&this.selectedValues.indexOf(t)!==-1){let o=this.selectedValues.indexOf(t);this.selectedValues.splice(o,1),this.onSelect.emit(this.selectedValues.join("|"))}else this.multipleSelect||(this.selectedValue=null,this.onSelect.emit(this.selectedValue))}toggleSelection(){this.selectionVisible=!this.selectionVisible}clearSelection(){this.selectedValue=null,this.selectedValues=[];let t=this.lowValue=null,o=this.highValue=null,n=this.lat=null,d=this.lng=null;this.onSelect.emit(this.selectedValues),this.onRangeChange.emit({lowVal:t,highVal:o}),this.onLocationChange.emit({lat:n,lng:d})}};e.\u0275fac=function(o){return new(o||e)(ae(Qt))},e.\u0275cmp=st({type:e,selectors:[["app-filter"]],hostBindings:function(o,n){o&1&&se("mousedown",function(_){return n.onDocClickHandler(_)},!1,ns)("mouseup",function(_){return n.onDocClickHandler(_)},!1,ns)},inputs:{multipleSelect:"multipleSelect",contentType:"contentType",filterType:"filterType",filterName:"filterName",filterID:"filterID",sliderFloor:"sliderFloor",sliderCeil:"sliderCeil",sliderType:"sliderType",additionalClasses:"additionalClasses",unit:"unit",highValueTitle:"highValueTitle",params:"params"},outputs:{onSelect:"onSelect",onRangeChange:"onRangeChange",onLocationChange:"onLocationChange"},standalone:!0,features:[gt],decls:4,vars:13,consts:[[3,"ngClass","click"],[3,"categories","type","contentType","multipleSelect","selectedValues","sliderType","sliderLowValue","sliderHighValue","highValueTitle","lat","lng","sliderOptions","dropdown_id","filterID","clearButton","style","unit","additionalClasses","params","clear","onSelect","onDeselect","changeRange","changeLocation",4,"ngIf"],[3,"categories","type","contentType","multipleSelect","selectedValues","sliderType","sliderLowValue","sliderHighValue","highValueTitle","lat","lng","sliderOptions","dropdown_id","filterID","clearButton","unit","additionalClasses","params","clear","onSelect","onDeselect","changeRange","changeLocation"]],template:function(o,n){o&1&&(S(0,"div")(1,"div",0),se("click",function(){return n.toggleSelection()}),A(2),E(),ce(3,ZW,1,23,"app-dropdown",1),E()),o&2&&(ki("filter-outer ",n.additionalClasses,""),P(1),Qp("filter filter-",n.filterID," ",n.additionalClasses,""),N("ngClass",kt(11,KW,n.selectionVisible||n.selectedValues.length>0||n.lowValue!=null||n.highValue!=null||n.lat!=null||n.lng!=null)),P(1),tr(" ",n.filterName," ",n.selectedValues.length>0?" - "+n.selectedValues.length:""," "),P(1),N("ngIf",n.selectionVisible))},dependencies:[Dt,on,At,yu],styles:[".filter-outer[_ngcontent-%COMP%]{z-index:99;float:left}.filter-outer.filter-home[_ngcontent-%COMP%]{float:none}.filter[_ngcontent-%COMP%]{cursor:pointer;width:fit-content;border-radius:var(--radius-pill);background:var(--color-surface-alt);border:1px solid var(--color-border);padding:6px 16px;margin:2px;text-transform:uppercase;font-size:var(--font-size-sm);transition:background var(--transition-fast),border-color var(--transition-fast),box-shadow var(--transition-fast)}.filter.filter-home[_ngcontent-%COMP%]{background:rgba(255,255,255,.14);border-color:#ffffff4d;color:#fff;width:calc(100% - 32px);border-radius:var(--radius-pill)}.filter[_ngcontent-%COMP%]:hover{background:var(--color-surface);box-shadow:var(--shadow-sm)}.filter.filter-home[_ngcontent-%COMP%]:hover{background:rgba(255,255,255,.24);color:#fff}.filter.active[_ngcontent-%COMP%]{background:var(--color-accent)!important;border-color:var(--color-accent);color:#fff}
1325.filter-selection[_ngcontent-%COMP%]{width:200px;height:300px;background:var(--color-surface);z-index:99999;position:absolute;margin-top:31px;border:1px solid var(--color-border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md)}@media screen and (max-width: 1000px){.filter[_ngcontent-%COMP%]{cursor:pointer;border-radius:var(--radius-pill);background:var(--color-surface-alt);border:1px solid var(--color-border);padding:6px 16px;margin:2px;text-transform:uppercase;width:calc(100% - 34px)}.filter-outer[_ngcontent-%COMP%]{position:relative;float:none;z-index:auto}}"]});let i=e;return i})();var nh=new Ct("JWT_OPTIONS"),yl=(()=>{class i{constructor(r=null){this.tokenGetter=r&&r.tokenGetter||function(){}}urlBase64Decode(r){let t=r.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(r){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(r=String(r).replace(/=+$/,""),r.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let n=0,d,_,C=0;_=r.charAt(C++);~_&&(d=n%4?d*64+_:_,n++%4)?o+=String.fromCharCode(255&d>>(-2*n&6)):0)_=t.indexOf(_);return o}b64DecodeUnicode(r){return decodeURIComponent(Array.prototype.map.call(this.b64decode(r),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(r=this.tokenGetter()){return r instanceof Promise?r.then(t=>this._decodeToken(t)):this._decodeToken(r)}_decodeToken(r){if(!r||r==="")return null;let t=r.split(".");if(t.length!==3)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.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(r=this.tokenGetter()){return r instanceof Promise?r.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(r)}_getTokenExpirationDate(r){let t;if(t=this.decodeToken(r),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(r=this.tokenGetter(),t){return r instanceof Promise?r.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(r,t)}_isTokenExpired(r,t){if(!r||r==="")return!0;let o=this.getTokenExpirationDate(r);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(r,t){return typeof r=="function"?r(t):r}}return i.\u0275fac=function(r){return new(r||i)(Ve(nh))},i.\u0275prov=Qe({token:i,factory:i.\u0275fac}),i})();var Ti=(()=>{let e=class e{constructor(t,o,n){this.http=t,this.jwtHelper=o,this.usersUrl="/users/",this.isBrowser=Si(n)}register(t){return this.http.post(this.usersUrl+"register/",t)}activate(t,o){return this.http.put(this.usersUrl+"activate/"+t+"/",o)}login(t,o,n){return this.http.post(this.usersUrl+"login/",JSON.stringify({email_or_username:t,password:o,captcha:n}))}logout(){this.isBrowser&&(localStorage.removeItem("username"),localStorage.removeItem("userID"),localStorage.removeItem("email"),localStorage.removeItem("token"),localStorage.removeItem("refresh_token"),localStorage.removeItem("email_confirmed"),localStorage.removeItem("ads_enabled"),localStorage.removeItem("stories_enabled"))}get_user(t){return this.http.get(this.usersUrl+t+"/")}update_user(t,o){return this.http.put(this.usersUrl+"edit/"+t+"/",o)}update_password(t,o){return this.http.put(this.usersUrl+"change_password/"+t+"/",o)}upload_picture(t,o){return this.http.patch(this.usersUrl+"upload_image/"+t+"/",o)}password_recovery_request(t){let o={username:t,email:t};return this.http.put(this.usersUrl+"password_recovery/",JSON.stringify(o))}password_recovery(t,o){return this.http.put(this.usersUrl+"password_recovery/"+t+"/",JSON.stringify(o))}is_authenticated(){if(!this.isBrowser)return!1;let t=localStorage.getItem("token");return!this.jwtHelper.isTokenExpired(t)}};e.\u0275fac=function(o){return new(o||e)(Ve(ln),Ve(yl),Ve(Qt))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function YW(i,e,r,t){let o=window&&!!window.document&&window.document.documentElement,n=o&&e?window:r;if(i&&(n=i&&o&&typeof i=="string"?QW(i,r.nativeElement,t):i,!n))throw new Error("ngx-infinite-scroll {resolveContainerElement()}: selector for");return n}function QW(i,e,r){return(r?window.document:e).querySelector(i)}function DI(i){return i&&!i.firstChange}function JW(){return typeof window<"u"}var eZ={clientHeight:"clientHeight",offsetHeight:"offsetHeight",scrollHeight:"scrollHeight",pageYOffset:"pageYOffset",offsetTop:"offsetTop",scrollTop:"scrollTop",top:"top"},tZ={clientHeight:"clientWidth",offsetHeight:"offsetWidth",scrollHeight:"scrollWidth",pageYOffset:"pageXOffset",offsetTop:"offsetLeft",scrollTop:"scrollLeft",top:"left"},MI=class{constructor(e=!0){this.vertical=e,this.propsMap=e?eZ:tZ}clientHeightKey(){return this.propsMap.clientHeight}offsetHeightKey(){return this.propsMap.offsetHeight}scrollHeightKey(){return this.propsMap.scrollHeight}pageYOffsetKey(){return this.propsMap.pageYOffset}offsetTopKey(){return this.propsMap.offsetTop}scrollTopKey(){return this.propsMap.scrollTop}topKey(){return this.propsMap.top}};function iZ(i,e,r){return!!(i&&e||!r&&e)}function nZ({windowElement:i,axis:e}){return rZ({axis:e,isWindow:oZ(i)},i)}function rZ(i,e){let r=i.isWindow||e&&!e.nativeElement?e:e.nativeElement;return en(bt({},i),{container:r})}function oZ(i){return["Window","global"].some(r=>Object.prototype.toString.call(i).includes(r))}function PI(i,e){return i?e.document.documentElement:null}function T3(i,e){let r=lZ(e);return e.isWindow?sZ(r,i,e):aZ(r,i,e)}function sZ(i,e,r){let{axis:t,container:o,isWindow:n}=r,{offsetHeightKey:d,clientHeightKey:_}
1325=I3(t),C=i+M3(PI(n,o),t,n),M=D3(e.nativeElement,n,d,_),j=cZ(e.nativeElement,t,n)+M;return{height:i,scrolled:C,totalToScroll:j,isWindow:n}}function aZ(i,e,r){let{axis:t,container:o}=r,n=o[t.scrollTopKey()],d=o[t.scrollHeightKey()];return{height:i,scrolled:n,totalToScroll:d,isWindow:!1}}function I3(i){return{offsetHeightKey:i.offsetHeightKey(),clientHeightKey:i.clientHeightKey()}}function lZ({container:i,isWindow:e,axis:r}){let{offsetHeightKey:t,clientHeightKey:o}=I3(r);return D3(i,e,t,o)}function D3(i,e,r,t){if(isNaN(i[r])){let o=PI(e,i);return o?o[t]:0}else return i[r]}function cZ(i,e,r){let t=e.topKey();if(i.getBoundingClientRect)return i.getBoundingClientRect()[t]+M3(i,e,r)}function M3(i,e,r){let t=e.pageYOffsetKey(),o=e.scrollTopKey(),n=e.offsetTopKey();return isNaN(window.pageYOffset)?PI(r,i)[o]:i.ownerDocument?i.ownerDocument.defaultView[t]:i[n]}function uZ(i,e={down:0,up:0},r){let t,o;if(i.totalToScroll<=0)return!1;let n=i.isWindow?i.scrolled:i.height+i.scrolled;if(r)t=(i.totalToScroll-n)/i.totalToScroll,o=(e?.down?e.down:0)/10;else{let _=i.scrolled+(i.totalToScroll-n);t=i.scrolled/_,o=(e?.up?e.up:0)/10}return t<=o}function dZ(i,e){return i<e.scrolled}function hZ(i,e,r){let t=dZ(i,e);return{fire:uZ(e,r,t),scrollDown:t}}var kI=class{constructor(e){this.lastScrollPosition=0,this.lastTotalToScroll=0,this.totalToScroll=0,this.triggered={down:0,up:0},Object.assign(this,e)}updateScrollPosition(e){return this.lastScrollPosition=e}updateTotalToScroll(e){this.lastTotalToScroll!==e&&(this.lastTotalToScroll=this.totalToScroll,this.totalToScroll=e)}updateScroll(e,r){this.updateScrollPosition(e),this.updateTotalToScroll(r)}updateTriggeredFlag(e,r){r?this.triggered.down=e:this.triggered.up=e}isTriggeredScroll(e,r){return r?this.triggered.down===e:this.triggered.up===e}};function pZ(i){let{scrollContainer:e,scrollWindow:r,element:t,fromRoot:o}=i,n=nZ({axis:new MI(!i.horizontal),windowElement:YW(e,r,t,o)}),d=new kI({totalToScroll:T3(t,n).totalToScroll}),_={container:n.container,throttle:i.throttle},C={up:i.upDistance,down:i.downDistance};return fZ(_).pipe(jn(()=>Bt(T3(t,n))),ei(M=>mZ(d.lastScrollPosition,M,C)),Vi(({stats:M})=>d.updateScroll(M.scrolled,M.totalToScroll)),dn(({fire:M,scrollDown:j,stats:{totalToScroll:G}})=>iZ(i.alwaysCallback,M,d.isTriggeredScroll(G,j))),Vi(({scrollDown:M,stats:{totalToScroll:j}})=>{d.updateTriggeredFlag(j,M)}),ei(gZ))}function fZ(i){let e=Yc(i.container,"scroll");return i.throttle&&(e=e.pipe(kp(i.throttle,void 0,{leading:!0,trailing:!0}))),e}function mZ(i,e,r){let{scrollDown:t,fire:o}=hZ(i,e,r);return{scrollDown:t,fire:o,stats:e}}var AI={DOWN:"[NGX_ISE] DOWN",UP:"[NGX_ISE] UP"};function gZ(i){let{scrollDown:e,stats:{scrolled:r}}=i;return{type:e?AI.DOWN:AI.UP,payload:{currentScrollPosition:r}}}var Mf=(()=>{let e=class e{constructor(t,o){this.element=t,this.zone=o,this.scrolled=new Fe,this.scrolledUp=new Fe,this.infiniteScrollDistance=2,this.infiniteScrollUpDistance=1.5,this.infiniteScrollThrottle=150,this.infiniteScrollDisabled=!1,this.infiniteScrollContainer=null,this.scrollWindow=!0,this.immediateCheck=!1,this.horizontal=!1,this.alwaysCallback=!1,this.fromRoot=!1}ngAfterViewInit(){this.infiniteScrollDisabled||this.setup()}ngOnChanges({infiniteScrollContainer:t,infiniteScrollDisabled:o,infiniteScrollDistance:n}){let d=DI(t),_=DI(o),C=DI(n),M=!_&&!this.infiniteScrollDisabled||_&&!o.currentValue||C;(d||_||C)&&(this.destroyScroller(),M&&this.setup())}setup(){JW()&&this.zone.runOutsideAngular(()=>{this.disposeScroller=pZ({fromRoot:this.fromRoot,alwaysCallback:this.alwaysCallback,disable:this.infiniteScrollDisabled,downDistance:this.infiniteScrollDistance,element:this.element,horizontal:this.horizontal,scrollC
1325ontainer:this.infiniteScrollContainer,scrollWindow:this.scrollWindow,throttle:this.infiniteScrollThrottle,upDistance:this.infiniteScrollUpDistance}).subscribe(t=>this.handleOnScroll(t))})}handleOnScroll({type:t,payload:o}){let n=t===AI.DOWN?this.scrolled:this.scrolledUp;_Z(n)&&this.zone.run(()=>n.emit(o))}ngOnDestroy(){this.destroyScroller()}destroyScroller(){this.disposeScroller&&this.disposeScroller.unsubscribe()}};e.\u0275fac=function(o){return new(o||e)(ae(Pi),ae(qt))},e.\u0275dir=bi({type:e,selectors:[["","infiniteScroll",""],["","infinite-scroll",""],["","data-infinite-scroll",""]],inputs:{infiniteScrollDistance:"infiniteScrollDistance",infiniteScrollUpDistance:"infiniteScrollUpDistance",infiniteScrollThrottle:"infiniteScrollThrottle",infiniteScrollDisabled:"infiniteScrollDisabled",infiniteScrollContainer:"infiniteScrollContainer",scrollWindow:"scrollWindow",immediateCheck:"immediateCheck",horizontal:"horizontal",alwaysCallback:"alwaysCallback",fromRoot:"fromRoot"},outputs:{scrolled:"scrolled",scrolledUp:"scrolledUp"},features:[hn]});let i=e;return i})();function _Z(i){return i.observed??i.observers.length>0}var kf=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({});let i=e;return i})();function vZ(i,e){i&1&&(S(0,"div",14),A(1,"Poti"),E())}function yZ(i,e){if(i&1){let r=Ge();S(0,"div",15)(1,"input",16),se("keyup",function(o){Se(r);let n=q(2);return Te(n.search(o.target))}),E()()}}function bZ(i,e){if(i&1){let r=Ge();S(0,"div",7),ce(1,vZ,2,0,"div",8),S(2,"div",9),ce(3,yZ,2,0,"div",10),S(4,"button",11),se("click",function(){Se(r);let o=q();return Te(o.changeOrdering())}),A(5),E(),S(6,"button",12),se("click",function(){Se(r);let o=q();return Te(o.changeOrder())}),S(7,"span",13),A(8,"\u25BE"),E()()()()}if(i&2){let r=q();P(1),N("ngIf",r.showTitle),P(2),N("ngIf",r.showSearchInput),P(2),mt(r.orderOptions[r.ordering]),P(1),Bn("aria-label",r.order===""?"Nara\u0161\u010Dajo\u010De":"Padajo\u010De"),P(1),Yi("asc",r.order==="")}}function xZ(i,e){if(i&1&&(S(0,"div"),A(1,"Za izbrane kriterije \u0161e ni vne\u0161enih poti."),E()),i&2){let r=q();ki("list-empty ",r.loader?"hidden":"","")}}function wZ(i,e){if(i&1&&(S(0,"div",28),A(1),E()),i&2){let r=q().$implicit;P(1),mt(r.name)}}function CZ(i,e){i&1&&(S(0,"div",29)(1,"span",30)(2,"p"),A(3,"!"),E()(),A(4," POT ZAPRTA "),E())}function EZ(i,e){if(i&1){let r=Ge();S(0,"div",31)(1,"div",32),se("click",function(){Se(r);let o=q().$implicit,n=q();return Te(n.openRoad(o.slug))}),A(2,"Odpri"),E(),S(3,"div",33),se("click",function(){Se(r);let o=q(2);return Te(o.actionSelect("show-on-map"))}),A(4,"Poka\u017Ei na zemljevidu"),E()()}}function SZ(i,e){if(i&1){let r=Ge();S(0,"div")(1,"div",17),se("click",function(){let n=Se(r).$implicit,d=q();return Te(d.selectableRows?d.selectRoad(n.id):null)}),S(2,"div",18),Z(3,"img",19),E(),S(4,"div",20)(5,"div",21),A(6),E(),ce(7,wZ,2,1,"div",22),S(8,"div",23)(9,"span",24),A(10),E(),S(11,"span",25),Z(12,"span"),A(13),E()(),ce(14,CZ,5,0,"div",26),E()(),ce(15,EZ,5,0,"div",27),E()}if(i&2){let r=e.$implicit,t=q();P(1),ki("road-row ",t.selectableRows&&r.id===t.selectedRoad?"active":"",""),N("routerLink",t.selectableRows?null:"/poti/"+r.slug),Bn("data-road-id",r.id),P(2),s_("alt","",r.starting_point.title," - ",r.end_point.title," ",r.name," glavna slika"),Hi("src",r!=null&&r.image?r==null?null:r.image.file:"/assets/images/default-no-image.png",Ei),P(3),tr("",r.starting_point.title," - ",r.end_point.title,""),P(1),N("ngIf",r.name),P(3),mt(r.hiking_time_formated),P(2),ki("dot dot-",r.difficulty.color,""),P(1),We("",r.difficulty.title," "),P(1),N("ngIf",r==null?null:r.closed),P(1),N("ngIf",t.selectableRows&&r.id===t.selectedRoad)}}function TZ(i,e){if(i&1){let r=Ge();S(0,"div")(1,"a",34),se("click",function(){Se(r);let o=q();return Te(o.loadMore())}),A(2,"Nalo\u017Ei ve\u010D..."),E()()}}var bu=(()=>{let e=class e{constructor(t,o,n,d,_,C,M){this.platformId=t,this.roadService=o,this.userService=n,this.router=d,this.route=_,this.lc=C,this.elRef=M,this.subList=null,this.loader=!1,this.contentHidden=!1,this.limit=10,this.offset=null,this.finished=!1,this.roads=[],this.small=!1,this.order="-",this.ordering="hiking_time",this.orderOpt=["hiking_time","distance"],this.orderOptions={hiking_time:"\u010Cas hoje",distance:"Oddaljenost"},this.searchString=null,this._timeout=null,this.selectedCountry=null,this.selectedMountainRange=null,this.selectedType=null,this.selectedDifficulty=null,this.selectedDestination=null,this.minEndPointHeight=null,this.maxEndPointHeight=null,this.minStartingPointHeight=null,this.maxStartingPointHeight=null,this.minHikingTime=null,this.maxHikingTime=null,this.searchLat=null,this.searchLng=null,this.distance=null,this.header=!0,this.showTitle=!0,this.user=null,this.autoHeight=!1,this.showSearchInput=!0,this.fields=null,this.loadMoreVisible=!1,this.selectableRows=!1,this.selectedRoad=null,this.onRoadSelect=new Fe,this.onActionSelect=new Fe,this.autoFillLimit=100,this.listBodyResizeObserver=null,this.onOrderingChange=new Fe,this.isBrowser=Si(this.platformId)}ngOnChanges(t){this.loader=!0,this.offset=0,this.contentHidden=!0,this.finished=!1,this.getRoads(!1)}onScroll(){this.getRoads()}changeOrdering(){let t=this.orderOpt.indexOf(this.ordering);t++,t>=this.orderOpt.length&&(t=0),this.ordering=this.orderOpt[t],this.onOrderingChange.emit(this.order+this.ordering),this.getRoads(!1)}changeOrder(){this.order==="-"?this.order="":this.order="-",this.onOrderingChange.emit(this.order+this.ordering),this.getRoads(!1)}search(t){let o=t.value;this.isBrowser?(this._timeout&&window.clearTimeout(this._timeout),this._timeout=window.setTimeout(()=>{this._timeout=null,this.lc.run(()=>{this.searchString=o,this.getRoads(!1)})},300)):this.getRoads(!1)}loadMore(){this.getRoads(!0)}getRoads(t=!0){if(t){if(this.finished)return;this.loader=!0}else this.finished=!1,this.offset=null,this.roads=[],this.loader=!0;let o={search:this.searchString,country:this.selectedCountry,mou
1325ntain_range:this.selectedMountainRange,type:this.selectedType,destination:this.selectedDestination,difficulty:this.selectedDifficulty,min_end_point_height:this.minEndPointHeight,max_end_point_height:this.maxEndPointHeight,min_starting_point_height:this.minStartingPointHeight,max_starting_point_height:this.maxStartingPointHeight,min_hiking_time:this.minHikingTime,max_hiking_time:this.maxHikingTime,user:this.user,small:this.small,fields:this.fields,lat:this.searchLat,lng:this.searchLng,radius:this.distance};this.subList!==null&&this.subList.unsubscribe(),this.subList=this.roadService.getRoads(this.limit,this.offset,this.order+this.ordering,o).subscribe(n=>{this.lc.run(()=>{if(n.next==null?this.finished=!0:this.offset=n.next_offset,t){let d=new Set(this.roads.map(_=>_.id));this.roads=this.roads.concat(n.results.filter(_=>!d.has(_.id)))}else this.roads=n.results;this.loader=!1,this.contentHidden===!0&&(this.contentHidden=!1),this.fillContainerIfNeeded()})},n=>{this.lc.run(()=>{this.loader=!1,n.status===401&&(this.userService.logout(),this.router.navigate(["/login"]))})})}fillContainerIfNeeded(){!this.isBrowser||this.finished||this.roads.length>=this.autoFillLimit||setTimeout(()=>{let t=this.elRef.nativeElement.querySelector(".list-body");t&&t.clientHeight>0&&t.scrollHeight<=t.clientHeight&&this.getRoads(!0)})}observeListBody(){if(!this.isBrowser||typeof ResizeObserver>"u"||this.listBodyResizeObserver)return;let t=this.elRef.nativeElement.querySelector(".list-body");t&&(this.listBodyResizeObserver=new ResizeObserver(()=>this.fillContainerIfNeeded()),this.listBodyResizeObserver.observe(t))}ngOnDestroy(){this.listBodyResizeObserver?.disconnect()}selectRoad(t){this.selectedRoad=this.selectedRoad===t?null:t,this.onRoadSelect.emit(this.selectedRoad)}openRoad(t){this.router.navigate(["./poti/"+t])}actionSelect(t){this.onActionSelect.emit(t)}selectAndScrollTo(t){this.lc.run(()=>{this.selectedRoad=t,setTimeout(()=>{this.selectedRoad===t&&(this.scrollToRow(t)||this.roads.some(o=>o.id===t)||this.roadService.getRoad(t,null).subscribe(o=>{this.selectedRoad===t&&(this.roads.some(n=>n.id===t)||(o.image=o.main_image,this.roads=[o,...this.roads]),setTimeout(()=>this.scrollToRow(t)))}))})})}scrollToRow(t){let o=this.elRef.nativeElement.querySelector(`[data-road-id="${t}"]`);return o?(o.scrollIntoView({behavior:"smooth",block:"center"}),!0):!1}ngOnInit(){this.sub=this.route.params.subscribe(t=>{let o=+t.id;o&&(this.selectedDestination=o,this.getRoads(!1))})}ngAfterViewInit(){this.observeListBody()}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(Ln),ae(Ti),ae(si),ae(Gi),ae(qt),ae(Pi))},e.\u0275cmp=st({type:e,selectors:[["app-road-list"]],inputs:{limit:"limit",order:"order",ordering:"ordering",selectedCountry:"selectedCountry",selectedMountainRange:"selectedMountainRange",selectedType:"selectedType",selectedDifficulty:"selectedDifficulty",selectedDestination:"selectedDestination",minEndPointHeight:"minEndPointHeight",maxEndPointHeight:"maxEndPointHeight",minStartingPointHeight:"minStartingPointHeight",maxStartingPointHeight:"maxStartingPointHeight",minHikingTime:"minHikingTime",maxHikingTime:"maxHikingTime",searchLat:"searchLat",searchLng:"searchLng",distance:"distance",header:"header",showTitle:"showTitle",user:"user",autoHeight:"autoHeight",showSearchInput:"showSearchInput",fields:"fields",loadMoreVisible:"loadMoreVisible",selectableRows:"selectableRows"},outputs:{onOrderingChange:"onOrderingChange",onRoadSelect:"onRoadSelect",onActionSelect:"onActionSelect"},standalone:!0,features:[It([Ln,Ti]),hn,gt],decls:8,vars:12,consts:[[1,"list-shell"],["class","list-toolbar",4,"ngIf"],["infiniteScroll","",1,"list-body",3,"infiniteScrollDistance","infiniteScrollThrottle","scrollWindow","scrolled"],[3,"class",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["src","/assets/images/small_loader.gif"],[1,"list-toolbar"],["class","list-title",4,"ngIf"],[1,"list-controls"],["class","list-search-wrap",4,"ngIf"],["type","button",1,"list-ordering",3,"click"],["type","button",1,"list-ordering-dir",3,"click"],[1,"list-ordering-arrow"],[1,"list-title"],[1,"list-search-wrap"],["type","text","id","search-roads","placeholder","I\u0161\u010Di poti \u2026",1,"list-search-input",3,"keyup"],[3,"routerLink","click"],[1,"road-row-thumb"],[3,"alt","src"],[1,"road-row-body"],[1,"road-row-title"],["class","road-row-name",4,"ngIf"],[1,"road-row-meta"],[1,"road-row-time"],[1,"road-row-difficulty"],["class","road-row-danger",4,"ngIf"],["class","list-item-menu",4,"ngIf"],[1,"road-row-name"],[1,"road-row-danger"],[1,"danger-triangle"],[1,"list-item-menu"],[1,"pointer",3,"click"],[1,"pointer","hidden","hidden-desktop",3,"click"],[3,"click"]],template:function(o,n){o&1&&(S(0,"div",0),ce(1,bZ,9,6,"div",1),S(2,"div",2),se("scrolled",function(){return n.onScroll()}),ce(3,xZ,2,3,"div",3)(4,SZ,16,19,"div",4)(5,TZ,3,0,"div",5),S(6,"div"),Z(7,"img",6),E()()()),o&2&&(Yi("autoheight",n.autoHeight),P(1),N("ngIf",n.header),P(1),N("infiniteScrollDistance",2)("infiniteScrollThrottle",1e3)("scrollWindow",!1),P(1),N("ngIf",(n.roads==null?null:n.roads.length)==0),P(1),N("ngForOf",n.roads),P(1),N("ngIf",!n.finished&&!n.loader&&n.loadMoreVisible),P(1),ki("",n.loader&&!n.finished?""
1325:"hidden"," loader center-text margin-5"))},dependencies:[kf,Mf,qi,Dt,ti,At],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0}.list-shell[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0}.list-shell.autoheight[_ngcontent-%COMP%]{display:block;height:auto}.list-shell.autoheight[_ngcontent-%COMP%]   .list-body[_ngcontent-%COMP%]{flex:none;overflow:visible}.list-toolbar[_ngcontent-%COMP%]{flex:none;display:flex;align-items:center;gap:10px;background:var(--color-dark);padding:8px 10px}.list-title[_ngcontent-%COMP%]{flex:none;color:#c9c7c6;font-size:var(--font-size-sm);font-weight:600;letter-spacing:.2px}.list-controls[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:6px}.list-search-wrap[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.list-search-input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;height:30px;padding:0 10px;border:1px solid transparent;border-radius:var(--radius-pill);font-size:var(--font-size-sm);background:rgba(255,255,255,.12);color:#fff;transition:background var(--transition-fast),border-color var(--transition-fast)}.list-search-input[_ngcontent-%COMP%]::placeholder{color:#fff9}.list-search-input[_ngcontent-%COMP%]:focus{outline:none;background:rgba(255,255,255,.18);border-color:var(--color-accent)}.list-ordering[_ngcontent-%COMP%], .list-ordering-dir[_ngcontent-%COMP%]{flex:none;height:30px;border:0;border-radius:var(--radius-pill);background:rgba(255,255,255,.12);color:#e8e7e6;font-size:var(--font-size-xs);cursor:pointer;transition:background var(--transition-fast);white-space:nowrap}.list-ordering[_ngcontent-%COMP%]{padding:0 12px}.list-ordering-dir[_ngcontent-%COMP%]{width:28px;padding:0;display:flex;align-items:center;justify-content:center}.list-ordering[_ngcontent-%COMP%]:hover, .list-ordering-dir[_ngcontent-%COMP%]:hover{background:rgba(255,255,255,.22)}.list-ordering-arrow[_ngcontent-%COMP%]{display:inline-block;transition:transform var(--transition-fast)}.list-ordering-arrow.asc[_ngcontent-%COMP%]{transform:rotate(180deg)}.list-body[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:4px 6px}.list-empty[_ngcontent-%COMP%]{padding:20px 12px;text-align:center;color:var(--color-text-muted);font-size:var(--font-size-sm)}.road-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:7px 8px;border-radius:var(--radius-sm);cursor:pointer;transition:background var(--transition-fast)}.road-row[_ngcontent-%COMP%]:hover{background:var(--color-surface-alt)}.road-row.active[_ngcontent-%COMP%]{background:var(--color-accent-soft)}.road-row-thumb[_ngcontent-%COMP%]{flex:none;width:44px;height:44px;border-radius:var(--radius-sm);overflow:hidden;border:1px solid var(--color-border)}.road-row-thumb[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;display:block}.road-row-body[_ngcontent-%COMP%]{flex:1;min-width:0}.road-row-title[_ngcontent-%COMP%]{font-size:var(--font-size-sm);font-weight:600;color:var(--color-text);line-height:1.25}.road-row-name[_ngcontent-%COMP%]{font-size:var(--font-size-xs);color:var(--color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.road-row-meta[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-top:2px;font-size:var(--font-size-xs);color:var(--color-text-muted)}.road-row-difficulty[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.road-row-difficulty[_ngcontent-%COMP%]   .dot[_ngcontent-%COMP%]{float:none;margin:0}.road-row-danger[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-top:3px;font-size:var(--font-size-xs);font-weight:600;color:var(--color-accent)}.road-row-danger[_ngcontent-%COMP%]   .danger-triangle[_ngcontent-%COMP%]{position:static}"]});let i=e;return i})();function IZ(i,e){if(i&1&&(S(0,"div"),A(1," Za to destinacijo \u0161e ni vne\u0161enih poti. Ali pogosto obiskuje\u0161 to destinacijo in dobro pozna\u0161 poti, ki vodijo iz/do nje? "),Z(2,"br")(3,"br"),S(4,"span",7),A(5,"Bodi prvi in dodaj novo pot "),S(6,"a",8),A(7,"tukaj"),E()(),A(8,`.
1326`),E()),i&2){let r=q();ki("",r.loader?"hidden":""," margin-5 text-13 margin-10-top")}}function DZ(i,e){if(i&1&&(S(0,"div",9),A(1),E()),i&2){let r=q();P(1),We(" ",r.title," ")}}function MZ(i,e){if(i&1&&(S(0,"b",22),A(1),E()),i&2){let r=q().$implicit;P(1),We(" ",r.name," ")}}function kZ(i,e){i&1&&(S(0,"div",23)(1,"div",24)(2,"p"),A(3,"!"),E()(),A(4," POT ZAPRTA "),E())}var AZ=i=>({clearfix:i});function PZ(i,e){if(i&1&&(S(0,"div",10)(1,"div",11)(2,"div",12)(3,"div",13)(4,"a",14),Z(5,"img",15),E()()()(),S(6,"div",16)(7,"a",14)(8,"h4",17),A(9),Z(10,"br"),ce(11,MZ,2,1,"b",18),E()(),S(12,"div")(13,"div",19),A(14),E(),Z(15,"div",4),E(),S(16,"div",20),Z(17,"div"),A(18),E(),ce(19,kZ,5,0,"div",21),E()()),i&2){let r=e.$implicit,t=e.index,o=q();ki("grid-item-border grid-item-outer grid-item-outer-",o.cols,""),N("ngClass",kt(19,AZ,t%o.cols==0)),P(4),fn("routerLink","/poti/",r==null?null:r.slug,""),P(1),Ws("alt","",r.starting_point.title," - ",r.end_point.title," - glavna slika"),Hi("src",r!=null&&r.image?r==null?null:r.
1326image.file:"/assets/images/default-no-image.png",Ei),P(2),Ws("routerLink","/roads/",r==null?null:r.id,"/",r==null?null:r.slug,""),P(2),tr(" ",r.starting_point.title," - ",r.end_point.title," "),P(2),N("ngIf",r.name),P(3),mt(r.hiking_time_formated),P(3),ki("dot dot-",r.difficulty.color,""),P(1),We(" ",r.difficulty.title," "),P(1),N("ngIf",r==null?null:r.closed)}}function OZ(i,e){if(i&1){let r=Ge();S(0,"div",25)(1,"a",26),se("click",function(){Se(r);let o=q();return Te(o.loadMore())}),A(2,"Nalo\u017Ei ve\u010D..."),E()()}}var $x=(()=>{let e=class e extends bu{constructor(){super(...arguments),this.title=null,this.cols=4,this.oddEven="odd",this.small=!1}};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275cmp=st({type:e,selectors:[["app-road-grid-list"]],inputs:{title:"title",cols:"cols",oddEven:"oddEven"},standalone:!0,features:[It([Ln,Ti]),Xn,gt],decls:9,vars:10,consts:[[3,"class",4,"ngIf"],["class","section-title",4,"ngIf"],[1,"grid-row"],[3,"ngClass","class",4,"ngFor","ngForOf"],[1,"clearfix"],["style","margin-left: 13px;",4,"ngIf"],["alt","Nalagam...","src","/assets/images/small_loader.gif"],[1,"bold","text-13"],["routerLink","/roads/add",1,"text-13"],[1,"section-title"],[3,"ngClass"],[1,"grid-item-image"],[1,"square"],[1,"square-content"],[3,"routerLink"],[3,"alt","src"],[1,"grid-item-short-content"],[1,"grid-title"],["class","special-name",4,"ngIf"],[1,"mountain-height","float-left"],[2,"font-style","italic"],["class","danger",4,"ngIf"],[1,"special-name"],[1,"danger"],[1,"danger-triangle"],[2,"margin-left","13px"],[3,"click"]],template:function(o,n){o&1&&(ce(0,IZ,9,3,"div",0),S(1,"div"),ce(2,DZ,2,1,"div",1),S(3,"div",2),ce(4,PZ,20,21,"div",3),Z(5,"div",4),E(),ce(6,OZ,3,0,"div",5),S(7,"div"),Z(8,"img",6),E()()),o&2&&(N("ngIf",(n.roads==null?null:n.roads.length)==0),P(1),ki("grid-row-",n.oddEven,""),P(1),N("ngIf",n.title),P(2),N("ngForOf",n.roads),P(2),N("ngIf",!n.finished&&!n.loader&&n.loadMoreVisible),P(1),ki("",n.loader&&!n.finished?"":"hidden"," loader center-text margin-5"))},dependencies:[Dt,on,ti,At,qi]});let i=e;return i})();var ea=(()=>{let e=class e{constructor(t){this.http=t,this.apiUrl="/destinations"}getList(t){let o=new os;return t&&Object.keys(t).forEach(n=>{o=o.set(n,t[n])}),this.http.get(this.apiUrl+"/checkin_list/",{params:o})}getPersonalStats(t,o=!1){let n=new os().set("include_manual_entries",o?"true":"false");return this.http.get(this.apiUrl+"/personal_checkin_stats/"+t+"/",{params:n})}getLeaderboard(t){let o=new os;return t&&Object.keys(t).forEach(n=>{o=o.set(n,t[n])}),this.http.get(this.apiUrl+"/checkin_leaderboard/",{params:o})}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var RZ="https://apps.apple.com/si/app/mountains-geek/id6802351068",LZ="https://play.google.com/store/apps/details?id=si.aidi.mountains_geek",Z_="app_promo_seen_v2";function K_(){if(typeof navigator>"u")return"android";let i=navigator.userAgent||"";return/iPad|iPhone|iPod/.test(i)||i.includes("Macintosh")&&typeof navigator.maxTouchPoints=="number"&&navigator.maxTouchPoints>1?"ios":"android"}function LI(){if(typeof navigator>"u")return!1;let i=navigator.userAgent||"";return/iPad|iPhone|iPod|Android/i.test(i)||i.includes("Macintosh")&&typeof navigator.maxTouchPoints=="number"&&navigator.maxTouchPoints>1}function FZ(i){return i==="ios"?RZ:LZ}function xu(i,e={}){typeof window<"u"&&typeof window.gtag=="function"&&window.gtag("event",i,e)}function Ss(i,e){if(typeof window>"u")return;let r=e??K_();xu("app_store_click",{link_location:i,app_store:r}),window.open(FZ(r),"_blank")}function NZ(i,e){if(i&1){let r=Ge();S(0,"button",7),se("click",function(){Se(r);let o=q();return Te(o.goToGooglePlay())}),A(1,"Vpi\u0161i se"),E()}}function zZ(i,e){if(i&1){let r=Ge();S(0,"div",8)(1,"button",9),se("click",function(){Se(r);let o=q();return Te(o.prevPage())}),A(2,"\u2039"),E(),S(3,"span",10),A(4),E(),S(5,"button",11),se("click",function(){Se(r);let o=q();return Te(o.nextPage())}),A(6,"\u203A"),E()()}if(i&2){let r=q();P(1),N("disabled",r.currentPage===1),P(3),tr("",r.currentPage," / ",r.totalPages,""),P(1),N("disabled",r.currentPage===r.totalPages)}}function jZ(i,e){i&1&&(S(0,"span",16),A(1,"Destinacija"),E())}function VZ(i,e){if(i&1&&(S(0,"div",12)(1,"span",13),A(2,"Uporabnik"),E(),ce(3,jZ,2,0,"span",14),S(4,"span",15),A(5,"\u010Cas vpisa"),E()()),i&2){let r=q();P(3),N("ngIf",r.selectedDestination==null)}}function BZ(i,e){if(i&1&&(S(0,"a",21),A(1),E()),i&2){let r=q().$implicit;fn("routerLink","/destinacije/",r.destination.slug,"/"),P(1),mt(r.destination.title)}}function UZ(i,e){if(i&1&&(S(0,"div",19)(1,"span",13),A(2),E(),ce(3,BZ,2,2,"a",20),S(4,"span",15),A(5),$r(6,"date"),E()()),i&2){let r=e.$implicit,t=q(2);P(2),mt(r.user.username),P(1),N("ngIf",t.selectedDestination==null),P(2),mt(Gr(6,3,r.time,"dd.MM.yyyy, HH:mm"))}}function HZ(i,e){if(i&1&&(S(0,"div",17),ce(1,UZ,7,6,"div",18),E()),i&2){let r=q();P(1),N("ngForOf",r.checkins)}}function $Z(i,e){i&1&&(S(0,"p",22),A(1,"Ni vpisov."),E())}var Gx=(()=>{let e=class e{constructor(t){this.checkinService=t,this.checkins=[],this.currentPage=1,this.totalPages=1,this.limit=20,this.selectedDestination=null,this.showCta=!0}ngOnInit(){this.loadCheckins()}loadCheckins(){let t=(this.currentPage-1)*this.limit,o={limit:this.limit,offset:t,ordering:"-time"};this.selectedDestination&&(o.destination=this.selectedDestination),this.checkinService.getList(o).subscribe(n=>{this.checkins=n.results,this.totalPages=Math.ceil(n.count/this.limit)},n=>{console.error("Error fetching check-ins:",n)})}prevPage(){this.currentPage>1&&(this.currentPage--,this.loadCheckins())}nextPage(){this.currentPage<this.totalPages&&(this.currentPage++,this.loadCheckins())}goToPage(t){this.currentPage=t,this.loadCheckins()}getPages(){let t=[],o=Math.max(1,this.currentPage-3),n=Math.min(this.totalPages,this.currentPage+3);for(let d=o;d<=n;d++)t.push(d);return t}goToGooglePlay(){Ss("checkin_empty_state_cta")}};e.\u0275fac=function(o){return new(o||e)(ae(ea))},e.\u0275cmp=st({type:e,selectors:[["app-checkin-list"]],inputs:{limit:"limit",selectedDestination:"selectedDestination",showCta:"showCta"},standalone:!0,features:[It([ea,Xs]),gt],decls:7,vars:5,consts:[[1,"checkin-shell"],[1,"checkin-toolbar"],["type","button","class","btn btn-primary btn-pill",3,"click",4,"ngIf"],["class","checkin-pagination",4,"ngIf"],["class","checkin-header-row",4,"ngIf"],["class","checkin-list",4,"ngIf"],["class","checkin-empty",4,"ngIf"],["type","button",1,"btn","btn-primary","btn-pill",3,"click"],[1,"checkin-pagination"],["type","button","aria-label","Prej\u0161nja stran",3,"disabled","click"],[1,"checkin-pagination-current"],["type","button","aria-label","Naslednja stran",3,"disabled","click"],[1,"checkin-header-row"],[1,"checkin-col-user"],["class","checkin-col-destination",4,"ngIf"],[1,"checkin-col-time"],[1,"checkin-col-destination"],[1,"checkin-list"],["class","checkin-row",4,"ngFor","ngForOf"],[1,"checkin-row"],["class","checkin-col-destination",3,"routerLink",4,"ngIf"],[1,"checkin-col-destination",3,"routerLink"],[1,"checkin-empty"]],template:function(o,n){o&1&&(S(0,"div",0)(1,"div",1),ce(2,NZ,2,0,"button",2)(3,zZ,7,4,"div",3),E(),ce(4,VZ,6,1,"div",4)(5,HZ,2,1,"div",5)(6,$Z,2,0,"p",6),E()),o&2&&(P(2),N("ngIf",n.showCta),P(1),N("ngIf",n.totalPages>1),P(1),N("ngIf",n.checkins.length),P(1),N("ngIf",n.checkins.length),P(1),N("ngIf",!n.checkins.length))},dependencies:[Dt,ti,At,Xs,qi],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:0}.checkin-shell[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;min-height:0;border:1px solid var(--color-border);border-radius:var(--radius-sm);overflow:hidden}.checkin-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;background:var(--color-surface-alt);border-bottom:1px solid var(--color-border)}.checkin-toolbar[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{flex:none;white-space:nowrap;margin:0}.checkin-pagination[_ngcontent-%COMP%]{flex:none;display:flex;align-items:center;gap:8px}.checkin-pagination[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{width:28px;height:28px;flex:none;border:1px solid var(--color-border);background:var(--color-surface);border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:var(--font-size-sm);
1326transition:background var(--transition-fast),color var(--transition-fast),border-color var(--transition-fast)}.checkin-pagination[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent);color:#fff;border-color:var(--color-accent)}.checkin-pagination[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:default}.checkin-pagination-current[_ngcontent-%COMP%]{font-size:var(--font-size-xs);color:var(--color-text-muted);white-space:nowrap}.checkin-header-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr auto;gap:10px;padding:8px 12px;font-size:var(--font-size-xs);font-weight:600;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:.3px;border-bottom:1px solid var(--color-border)}.checkin-list[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto}.checkin-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr auto;gap:10px;align-items:center;padding:10px 12px;font-size:var(--font-size-sm);border-bottom:1px solid var(--color-border);transition:background var(--transition-fast)}.checkin-row[_ngcontent-%COMP%]:last-child{border-bottom:none}.checkin-row[_ngcontent-%COMP%]:nth-child(2n){background:var(--color-surface-alt)}.checkin-row[_ngcontent-%COMP%]:hover{background:var(--color-accent-soft)}.checkin-col-user[_ngcontent-%COMP%]{font-weight:600;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.checkin-col-destination[_ngcontent-%COMP%]{color:var(--color-accent);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.checkin-col-destination[_ngcontent-%COMP%]:hover{text-decoration:underline}.checkin-col-time[_ngcontent-%COMP%]{color:var(--color-text-muted);font-size:var(--font-size-xs);text-align:right;white-space:nowrap}.checkin-empty[_ngcontent-%COMP%]{padding:20px 12px;text-align:center;color:var(--color-text-muted);font-size:var(--font-size-sm)}@media screen and (max-width: 600px){.checkin-header-row[_ngcontent-%COMP%]{display:none}.checkin-row[_ngcontent-%COMP%]{grid-template-columns:1fr auto;grid-template-areas:"user time" "dest dest";row-gap:3px}.checkin-col-user[_ngcontent-%COMP%]{grid-area:user}.checkin-col-time[_ngcontent-%COMP%]{grid-area:time}.checkin-col-destination[_ngcontent-%COMP%]{grid-area:dest;font-size:var(--font-size-xs);white-space:normal}}']});let i=e;return i})();var wu=(()=>{let e=class e{constructor(t){this.http=t,this.apiUrl="/stories/"}getStories(t){let o=new os;return t&&Object.keys(t).forEach(n=>{o=o.set(n,t[n])}),this.http.get(this.apiUrl,{params:o})}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var sn=(()=>{let e=class e{constructor(t){this.http=t,this.destinationsUrl="/destinations/",this.destinationImagesUrl="/destinations/images/"}getDestination(t,o){return t!=null?this.http.get(this.destinationsUrl+t+"/?uid_string=true"):this.http.get(this.destinationsUrl+o+"/?uid_string=true")}getDestinations(t,o,n=null,d=null,_=null,C=null,M=null,j=null,G=null,ie=null,_e=!0,Ee=null,Ye=null){let $e=this.destinationsUrl+"?limit="+t;$e=$e+(o?"&offset="+o:""),$e=$e+(n?"&country="+n:""),$e=$e+(d?"&mountain_range="+d:""),$e=$e+(_?"&min_height="+_:""),$e=$e+(C?"&max_height="+C:""),$e=$e+(M?"&type="+M:""),$e=$e+(G?"&user="+G:""),$e=$e+(j?"&search="+j:""),$e=$e+(ie?"&ordering="+ie:""),$e=$e+(_e?"&small="+_e:""),$e=$e+(Ee?"&fields="+Ee:"");for(let at in Ye)$e=$e+(Ye[at]?"&"+at+"="+Ye[at]:"");return this.http.get($e)}getDestinationImages(t,o,n){let d=this.destinationImagesUrl+"?limit="+o;return d=d+(n?"&offset="+n:""),d=d+(t?"&destination="+t:""),this.http.get(d)}insertDestination(t){let o=this.destinationsUrl+"create/";return this.http.post(o,t)}updateDestination(t,o){let n=this.destinationsUrl+"edit/"+t+"/";return this.http.put(n,o)}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var GZ=["videoPlayer"];function qZ(i,e){if(i&1&&(S(0,"span",17),A(1),E()),i&2){let r=q().$implicit;P(1),mt(r.user.username)}}function WZ(i,e){if(i&1&&(S(0,"span",18),A(1),E()),i&2){let r=q().$implicit;P(1),We("",r.distance," stran")}}function ZZ(i,e){if(i&1){let r=Ge();S(0,"div",9),se("click",function(){let n=Se(r).index,d=q(2);return Te(d.viewStory(n))}),S(1,"div",10),Z(2,"img",11),S(3,"div",12)(4,"div",13),ce(5,qZ,2,1,"span",14),S(6,"span",15),A(7),E(),ce(8,WZ,2,1,"span",16),E()()()()}if(i&2){let r=e.$implicit,t=q(2),o;P(2),N("src",(o=r.file.thumbnails.story)!==null&&o!==void 0?o:r.file.file,Ei),P(3),N("ngIf",r.user),P(2),mt(t.formatTime(r.time)),P(1),N("ngIf",r.distance)}}function KZ(i,e){if(i&1){let r=Ge();
1326S(0,"div",2)(1,"div",3),se("click",function(){Se(r);let o=q();return Te(o.goToGooglePlay())}),S(2,"div",4)(3,"div",5),Z(4,"span",6),S(5,"span",7),A(6,"Dodaj razmere"),E()()()(),ce(7,ZZ,9,4,"div",8),E()}if(i&2){let r=q();P(7),N("ngForOf",r.stories)}}function XZ(i,e){if(i&1&&(S(0,"div",33),Z(1,"img",34),E()),i&2){let r=q(2),t;P(1),N("src",(t=r.stories[r.selectedStory].user.picture)!==null&&t!==void 0?t:"/assets/images/ic_launcher.png",Ei)}}function YZ(i,e){if(i&1&&(S(0,"div",35),A(1),E()),i&2){let r=q(2);P(1),mt(r.stories[r.selectedStory].user.username)}}function QZ(i,e){if(i&1&&(Pa(0),Z(1,"img",36),Oa()),i&2){let r=q(2);P(1),N("src",r.stories[r.selectedStory].file.file,Ei)}}function JZ(i,e){if(i&1&&(S(0,"video",37,38),Z(2,"source",39),A(3," Va\u0161 brskalnik ne podpira videa. "),E()),i&2){let r=q(2);P(2),N("src",r.stories[r.selectedStory].file.file,Ei)}}function eK(i,e){i&1&&(S(0,"div",44),A(1,"Nalaganje \u2026"),E())}function tK(i,e){if(i&1&&(S(0,"span",50),A(1),E()),i&2){let r=q().$implicit;P(1),We(" \xB7 ",r.distance,"")}}function iK(i,e){if(i&1){let r=Ge();S(0,"div",48),se("click",function(){let n=Se(r).$implicit,d=q(4);return Te(d.openNearbyDestination(n.slug))}),A(1),ce(2,tK,2,1,"span",49),E()}if(i&2){let r=e.$implicit;P(1),We(" ",r.title,""),P(1),N("ngIf",r.distance)}}function nK(i,e){i&1&&(S(0,"div",51),A(1,"Ni bli\u017Enjih destinacij."),E())}function rK(i,e){if(i&1&&(S(0,"div",45),ce(1,iK,3,2,"div",46)(2,nK,2,0,"div",47),E()),i&2){let r=q(3);P(1),N("ngForOf",r.nearbyDestinations),P(1),N("ngIf",r.nearbyDestinations.length===0)}}function oK(i,e){if(i&1&&(S(0,"div",40),se("click",function(t){return t.stopPropagation()}),S(1,"div",41),A(2,"Bli\u017Enje destinacije"),E(),ce(3,eK,2,0,"div",42)(4,rK,3,2,"div",43),E()),i&2){let r=q(2);P(3),N("ngIf",r.nearbyLoading),P(1),N("ngIf",!r.nearbyLoading)}}var A3=i=>({hidden:i});function sK(i,e){if(i&1){let r=Ge();S(0,"div",19),se("click",function(){Se(r);let o=q();return Te(o.closeStory())}),S(1,"div",20),se("click",function(){Se(r);let o=q();return Te(o.closeStory())}),A(2,"\u2715"),E(),S(3,"div",21)(4,"div",22),ce(5,XZ,2,1,"div",23),S(6,"div",24),ce(7,YZ,2,1,"div",25),S(8,"div",26),A(9),E()()()(),S(10,"div",27),se("click",function(o){Se(r);let n=q();return Te(n.previousStory(o))}),A(11,"\u25C0"),E(),S(12,"div",28),se("click",function(o){Se(r);let n=q();return Te(n.nextStory(o))}),A(13,"\u25B6"),E(),S(14,"div",29),se("click",function(o){return o.stopPropagation()}),ce(15,QZ,2,1,"ng-container",30)(16,JZ,4,1,"ng-template",null,31,Rb),E(),ce(18,oK,5,2,"div",32),E()}if(i&2){let r=or(17),t=q();P(5),N("ngIf",t.stories[t.selectedStory].user!=null),P(2),N("ngIf",t.stories[t.selectedStory].user!=null),P(2),mt(t.formatTime(t.stories[t.selectedStory].time)),P(1),N("ngClass",kt(8,A3,!t.showLeftArrow())),P(2),N("ngClass",kt(10,A3,!t.showRightArrow())),P(3),N("ngIf",!t.stories[t.selectedStory].file.file.includes(".mp4"))("ngIfElse",r),P(3),N("ngIf",t.stories[t.selectedStory].latitude!=null&&t.stories[t.selectedStory].longitude!=null)}}var Af=(()=>{let e=class e{constructor(t,o,n){this.storyService=t,this.destinationService=o,this.router=n,this.stories=[],this.selectedStory=null,this.nearbyDestinations=[],this.nearbyLoading=!1,this.limit=14,this.recent=!0,this.radius=15,this.lng=null,this.lat=null,this.maxDaysSinceCreation=null,this.gridHidden=!1,this.onStoryOpen=new Fe,this.storiesLoaded=new Fe}ngOnInit(){let t={limit:this.limit,recent:this.recent};this.lng!=null&&this.lat!=null&&(t.lat=this.lat,t.lng=this.lng,t.radius=this.radius,this.maxDaysSinceCreation!=null&&(t.max_days_since_creation=this.maxDaysSinceCreation)),this.loadStories(t)}loadStories(t){this.storyService.getStories(t).subscribe(o=>{this.stories=o.results.map(n=>(this.lat!=null&&this.lng!=null&&n.latitude!=null&&n.longitude!=null&&(n.distance=this.calculateDistance(this.lat,this.lng,n.latitude,n.longitude)),n)),this.storiesLoaded.emit(this.stories)},o=>{console.error("Error fetching stories:",o)})}viewStory(t){this.selectedStory=t,this.loadNearbyDestinations(),this.emitStoryOpen()}openStory(t){let o=this.stories.findIndex(n=>n.id===t.id);o===-1&&(this.stories=[t,...this.stories],o=0),this.viewStory(o)}closeStory(){this.selectedStory=null,this.nearbyDestinations=[],this.onStoryOpen.emit(null)}nextStory(t){t.stopPropagation(),this.selectedStory!==null&&this.selectedStory<this.stories.length-1&&(this.selectedStory++,this.resetVideoPlayer(),this.loadNearbyDestinations(),this.emitStoryOpen())}previousStory(t){t.stopPropagation(),this.selectedStory!==null&&this.selectedStory>0&&(this.selectedStory--,this.resetVideoPlayer(),this.loadNearbyDestinations(),this.emitStoryOpen())}emitStoryOpen(){let t=this.stories[this.selectedStory];t?.latitude!=null&&t?.longitude!=null?this.onStoryOpen.emit({lat:t.latitude,lng:t.longitude}):this.onStoryOpen.emit(null)}loadNearbyDestinations(){this.nearbyDestinations=[];let t=this.stories[this.selectedStory];t?.latitude==null||t?.longitude==null||(this.nearbyLoading=!0,this.destinationService.getDestinations(5,null,null,null,null,null,null,null,null,"distance",!0,"id,slug,title,height,width,length",{lat:t.latitude,lng:t.longitude,radiu
1326s:20}).subscribe({next:o=>{this.nearbyDestinations=(o.results||[]).map(n=>en(bt({},n),{distance:this.calculateDistance(t.latitude,t.longitude,n.width,n.length)})),this.nearbyLoading=!1},error:()=>{this.nearbyLoading=!1}}))}openNearbyDestination(t){this.closeStory(),this.router.navigate(["/destinacije/"+t])}showLeftArrow(){return this.selectedStory!==null&&this.selectedStory>0}showRightArrow(){return this.selectedStory!==null&&this.selectedStory<this.stories.length-1}goToGooglePlay(){Ss("story_add_tile_cta")}formatTime(t){let o=new Date,n=new Date(t),d=o.getTime()-n.getTime(),_=60*1e3,C=60*_,M=24*C,j=30*M,G=365*M;if(d>=G){let _e=Math.floor(d/G);return`${_e} ${_e!==1?_e!==2?_e>4?"let":"leta":"leti":"leto"} nazaj`}if(d>=j){let _e=Math.floor(d/j);return`${_e} ${_e!==1?_e!==2?_e>4?"mesecev":"mesece":"meseca":"mesec"} nazaj`}if(d>=M){let _e=Math.floor(d/M);return`${_e} ${_e!==1?"dni":"dan"} nazaj`}if(d>=C){let _e=Math.floor(d/C),Ee=Math.floor(d%C/_);return`${_e}h ${Ee} min nazaj`}return`${Math.floor(d/_)} min nazaj`}resetVideoPlayer(){if(this.videoPlayer){let t=this.videoPlayer.nativeElement;t.load(),t.play()}}calculateDistance(t,o,n,d){let C=this.degToRad(n-t),M=this.degToRad(d-o),j=Math.sin(C/2)*Math.sin(C/2)+Math.cos(this.degToRad(t))*Math.cos(this.degToRad(n))*Math.sin(M/2)*Math.sin(M/2),ie=6371*(2*Math.atan2(Math.sqrt(j),Math.sqrt(1-j)));return ie<1?`${(ie*1e3).toFixed(2)} m`:`${ie.toFixed(2)} km`}degToRad(t){return t*(Math.PI/180)}};e.\u0275fac=function(o){return new(o||e)(ae(wu),ae(sn),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-story-list"]],viewQuery:function(o,n){if(o&1&&ni(GZ,5),o&2){let d;Xt(d=Yt())&&(n.videoPlayer=d.first)}},inputs:{limit:"limit",recent:"recent",radius:"radius",lng:"lng",lat:"lat",maxDaysSinceCreation:"maxDaysSinceCreation",gridHidden:"gridHidden"},outputs:{onStoryOpen:"onStoryOpen",storiesLoaded:"storiesLoaded"},standalone:!0,features:[It([wu,sn]),gt],decls:2,vars:2,consts:[["class","story-grid",4,"ngIf"],["class","full-screen-story",3,"click",4,"ngIf"],[1,"story-grid"],[1,"story-item","add-story",3,"click"],[1,"story-square","add-story-square"],[1,"add-story-button"],["aria-hidden","true",1,"add-story-icon"],[1,"add-story-label"],["class","story-item",3,"click",4,"ngFor","ngForOf"],[1,"story-item",3,"click"],[1,"story-square"],["alt","Story Thumbnail",1,"story-thumbnail",3,"src"],[1,"story-hover-overlay"],[1,"story-hover-info"],["class","story-hover-user",4,"ngIf"],[1,"story-hover-time"],["class","story-hover-distance",4,"ngIf"],[1,"story-hover-user"],[1,"story-hover-distance"],[1,"full-screen-story",3,"click"],[1,"close-button",3,"click"],[1,"story-header"],[1,"user-info"],["class","user-image-wrapper",4,"ngIf"],[1,"user-details"],["class","username",4,"ngIf"],[1,"story-time"],[1,"story-navigation","left-arrow",3,"ngClass","click"],[1,"story-navigation","right-arrow",3,"ngClass","click"],[1,"story-content",3,"click"],[4,"ngIf","ngIfElse"],["videoTemplate",""],["class","story-nearby-panel",3,"click",4,"ngIf"],[1,"user-image-wrapper"],["alt","User Image",1,"user-image",3,"src"],[1,"username"],["alt","Story Image",3,"src"],["autoplay",""],["videoPlayer",""],["type","video/mp4",3,"src"],[1,"story-nearby-panel",3,"click"],[1,"story-nearby-title"],["class","story-nearby-loading",4,"ngIf"],["class","story-nearby-list",4,"ngIf"],[1,"story-nearby-loading"],[1,"story-nearby-list"],["class","story-nearby-chip",3,"click",4,"ngFor","ngForOf"],["class","story-nearby-empty",4,"ngIf"],[1,"story-nearby-chip",3,"click"],["class","story-nearby-distance",4,"ngIf"],[1,"story-nearby-distance"],[1,"story-nearby-empty"]],template:function(o,n){o&1&&ce(0,KZ,8,1,"div",0)(1,sK,19,12,"div",1),o&2&&(N("ngIf",!n.gridHidden),P(1),N("ngIf",n.selectedStory!==null))},dependencies:[Dt,on,ti,At],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:0}.story-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));align-content:start;gap:10px;padding:10px;flex:1;min-height:220px;max-height:850px;overflow-y:auto;box-sizing:border-box}@media (max-width: 768px){.story-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:8px;padding:8px;max-height:640px}}.story-item[_ngcontent-%COMP%]{cursor:pointer}.story-square[_ngcontent-%COMP%]{position:relative;width:100%;border-radius:var(--radius-sm);overflow:hidden;box-shadow:var(--shadow-sm);
1326transition:box-shadow var(--transition-base)}.story-square[_ngcontent-%COMP%]:before{content:"";display:block;padding-top:100%}.story-item[_ngcontent-%COMP%]:hover   .story-square[_ngcontent-%COMP%]{box-shadow:var(--shadow-md)}.add-story-square[_ngcontent-%COMP%]{background-color:var(--color-surface-alt);border:2px dashed var(--color-border);transition:background var(--transition-fast),border-color var(--transition-fast)}.add-story[_ngcontent-%COMP%]:hover   .add-story-square[_ngcontent-%COMP%]{background-color:var(--color-accent-soft);border-color:var(--color-accent)}.add-story-button[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;padding:12px;box-sizing:border-box;cursor:pointer}.add-story-icon[_ngcontent-%COMP%]{width:34px;height:34px;border-radius:50%;background:var(--color-accent);position:relative;transition:background var(--transition-fast),transform var(--transition-fast)}.add-story-icon[_ngcontent-%COMP%]:before, .add-story-icon[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:50%;background:#fff;transform:translate(-50%,-50%)}.add-story-icon[_ngcontent-%COMP%]:before{width:14px;height:2px}.add-story-icon[_ngcontent-%COMP%]:after{width:2px;height:14px}.add-story[_ngcontent-%COMP%]:hover   .add-story-icon[_ngcontent-%COMP%]{background:var(--color-accent-hover);transform:scale(1.08)}.add-story-label[_ngcontent-%COMP%]{color:var(--color-text);font-size:var(--font-size-sm);font-weight:600}.story-thumbnail[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;display:block;object-fit:cover;transition:transform var(--transition-base)}.story-item[_ngcontent-%COMP%]:hover   .story-thumbnail[_ngcontent-%COMP%]{transform:scale(1.06)}.story-hover-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:flex-end;padding:8px;box-sizing:border-box;background:linear-gradient(to top,rgba(20,19,18,.85),rgba(20,19,18,0) 65%);opacity:0;transition:opacity var(--transition-fast);pointer-events:none}.story-item[_ngcontent-%COMP%]:hover   .story-hover-overlay[_ngcontent-%COMP%]{opacity:1}.story-hover-info[_ngcontent-%COMP%]{display:flex;flex-direction:column;color:#fff;font-size:var(--font-size-xs);line-height:1.4}.story-hover-user[_ngcontent-%COMP%]{font-weight:700}.story-hover-time[_ngcontent-%COMP%], .story-hover-distance[_ngcontent-%COMP%]{opacity:.85}.full-screen-story[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000c;display:flex;align-items:center;justify-content:center;padding:0;box-sizing:border-box;z-index:999999;overflow:hidden;flex-direction:column}.story-header[_ngcontent-%COMP%]{position:absolute;top:10px;left:10px;display:flex;align-items:center}.user-info[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:#00000080;border-radius:8px;padding:5px}.user-image-wrapper[_ngcontent-%COMP%]{border-radius:50%;overflow:hidden;width:40px;height:40px;background:#424040}.user-image[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.user-details[_ngcontent-%COMP%]{margin-left:10px;color:#fff}.username[_ngcontent-%COMP%]{font-weight:700}.story-time[_ngcontent-%COMP%]{font-size:12px}.story-content[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.story-content[_ngcontent-%COMP%]   img[_ngcontent-%COMP%], .story-content[_ngcontent-%COMP%]   video[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain}.close-button[_ngcontent-%COMP%], .story-navigation[_ngcontent-%COMP%]{position:absolute;color:#fff;font-size:2em;cursor:pointer;z-index:1000;background-color:#0009;border-radius:50%;padding:5px;box-shadow:0 1px 2px #0003}.close-button[_ngcontent-%COMP%]{top:12px;width:32px;right:20px;text-align:center}.story-navigation.left-arrow[_ngcontent-%COMP%]{left:20px;width:32px;top:50%;text-align:center;transform:translateY(-50%);background-color:#00000042}.story-navigation.right-arrow[_ngcontent-%COMP%]{right:20px;width:32px;top:50%;text-align:center;transform:translateY(-50%);background-color:#00000042}.story-nearby-panel[_ngcontent-%COMP%]{position:absolute;
1326left:0;right:0;bottom:0;max-width:480px;margin:0 auto;padding:10px 16px 16px;background:linear-gradient(to top,rgba(0,0,0,.85),rgba(0,0,0,0));box-sizing:border-box}.story-nearby-title[_ngcontent-%COMP%]{color:#fff;font-size:var(--font-size-xs);font-weight:700;text-transform:uppercase;letter-spacing:.5px;opacity:.85;margin-bottom:8px}.story-nearby-loading[_ngcontent-%COMP%], .story-nearby-empty[_ngcontent-%COMP%]{color:#ffffffb3;font-size:var(--font-size-sm)}.story-nearby-list[_ngcontent-%COMP%]{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px}.story-nearby-chip[_ngcontent-%COMP%]{flex:none;cursor:pointer;background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.25);border-radius:var(--radius-pill);padding:7px 14px;font-size:var(--font-size-sm);white-space:nowrap;transition:background var(--transition-fast),border-color var(--transition-fast)}.story-nearby-chip[_ngcontent-%COMP%]:hover{background:var(--color-accent);border-color:var(--color-accent)}.story-nearby-distance[_ngcontent-%COMP%]{opacity:.8}']});let i=e;return i})();function aK(i,e){if(i&1){let r=Ge();S(0,"button",7),se("click",function(){Se(r);let o=q();return Te(o.goToGooglePlay())}),A(1,"Vpi\u0161i se"),E()}}function lK(i,e){if(i&1){let r=Ge();S(0,"div",8)(1,"button",9),se("click",function(){Se(r);let o=q();return Te(o.prevPage())}),A(2,"\u2039"),E(),S(3,"span",10),A(4),E(),S(5,"button",11),se("click",function(){Se(r);let o=q();return Te(o.nextPage())}),A(6,"\u203A"),E()()}if(i&2){let r=q();P(1),N("disabled",r.currentPage===1),P(3),tr("",r.currentPage," / ",r.totalPages,""),P(1),N("disabled",r.currentPage===r.totalPages)}}function cK(i,e){i&1&&(S(0,"div",12)(1,"span",13),A(2,"#"),E(),S(3,"span",14),A(4,"Destinacija"),E(),S(5,"span",15),A(6,"\u0160t. vpisov"),E()())}function uK(i,e){if(i&1&&(S(0,"a",18)(1,"span",13),A(2),E(),S(3,"span",14),A(4),E(),S(5,"span",15),A(6),E()()),i&2){let r=e.$implicit,t=e.index,o=q(2);fn("routerLink","/destinacije/",r.destination__id,""),P(2),mt((o.currentPage-1)*o.limit+t+1),P(2),mt(r.destination__title),P(2),mt(r.checkins)}}function dK(i,e){if(i&1&&(S(0,"div",16),ce(1,uK,7,4,"a",17),E()),i&2){let r=q();P(1),N("ngForOf",r.items)}}function hK(i,e){i&1&&(S(0,"p",19),A(1,"Ni podatkov."),E())}var P3=(()=>{let e=class e{constructor(t){this.checkinService=t,this.items=[],this.currentPage=1,this.totalPages=1,this.limit=20,this.showCta=!0}goToGooglePlay(){Ss("checkin_empty_state_cta")}ngOnInit(){this.load()}load(){let t=(this.currentPage-1)*this.limit;this.checkinService.getLeaderboard({dest_board:!0,limit:this.limit,offset:t}).subscribe(o=>{this.items=o.results??[],this.totalPages=Math.ceil((o.count??0)/this.limit)||1},o=>{console.error("Error fetching most visited destinations:",o)})}prevPage(){this.currentPage>1&&(this.currentPage--,this.load())}nextPage(){this.currentPage<this.totalPages&&(this.currentPage++,this.load())}};e.\u0275fac=function(o){return new(o||e)(ae(ea))},e.\u0275cmp=st({type:e,selectors:[["app-most-visited-list"]],inputs:{limit:"limit",showCta:"showCta"},standalone:!0,features:[It([ea]),gt],decls:7,vars:5,consts:[[1,"mv-shell"],[1,"mv-toolbar"],["type","button","class","btn btn-primary btn-pill",3,"click",4,"ngIf"],["class","mv-pagination",4,"ngIf"],["class","mv-header-row",4,"ngIf"],["class","mv-list",4,"ngIf"],["class","mv-empty",4,"ngIf"],["type","button",1,"btn","btn-primary","btn-pill",3,"click"],[1,"mv-pagination"],["type","button","aria-label","Prej\u0161nja stran",3,"disabled","click"],[1,"mv-pagination-current"],["type","button","aria-label","Naslednja stran",3,"disabled","click"],[1,"mv-header-row"],[1,"mv-col-rank"],[1,"mv-col-destination"],[1,"mv-col-count"],[1,"mv-list"],["class","mv-row",3,"routerLink",4,"ngFor","ngForOf"],[1,"mv-row",3,"routerLink"],[1,"mv-empty"]],template:function(o,n){o&1&&(S(0,"div",0)(1,"div",1),ce(2,aK,2,0,"button",2)(3,lK,7,4,"div",3),E(),ce(4,cK,7,0,"div",4)(5,dK,2,1,"div",5)(6,hK,2,0,"p",6),E()),o&2&&(P(2),N("ngIf",n.showCta),P(1),N("ngIf",n.totalPages>1),P(1),N("ngIf",n.items.length),P(1),N("ngIf",n.items.length),P(1),N("ngIf",!n.items.length))},dependencies:[Dt,ti,At,qi],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:0}.mv-shell[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;min-height:0;border:1px solid var(--color-border);border-radius:var(--radius-sm);overflow:hidden}.mv-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;background:var(--color-surface-alt);border-bottom:1px solid var(--color-border)}.mv-toolbar[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{flex:none;white-space:nowrap;margin:0}.mv-pagination[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.mv-pagination[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{width:28px;height:28px;flex:none;border:1px solid var(--color-border);background:var(--color-surface);border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:var(--font-size-sm);
1326transition:background var(--transition-fast),color var(--transition-fast),border-color var(--transition-fast)}.mv-pagination[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent);color:#fff;border-color:var(--color-accent)}.mv-pagination[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:default}.mv-pagination-current[_ngcontent-%COMP%]{font-size:var(--font-size-xs);color:var(--color-text-muted);white-space:nowrap}.mv-header-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:32px 1fr auto;gap:10px;padding:8px 12px;font-size:var(--font-size-xs);font-weight:600;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:.3px;border-bottom:1px solid var(--color-border)}.mv-list[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto}.mv-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:32px 1fr auto;gap:10px;align-items:center;padding:10px 12px;font-size:var(--font-size-sm);border-bottom:1px solid var(--color-border);color:inherit;text-decoration:none;transition:background var(--transition-fast)}.mv-row[_ngcontent-%COMP%]:last-child{border-bottom:none}.mv-row[_ngcontent-%COMP%]:nth-child(2n){background:var(--color-surface-alt)}.mv-row[_ngcontent-%COMP%]:hover{background:var(--color-accent-soft)}.mv-col-rank[_ngcontent-%COMP%]{font-weight:700;color:var(--color-accent);text-align:center}.mv-col-destination[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}.mv-col-count[_ngcontent-%COMP%]{color:var(--color-text-muted);font-size:var(--font-size-xs);white-space:nowrap}.mv-empty[_ngcontent-%COMP%]{padding:20px 12px;text-align:center;color:var(--color-text-muted);font-size:var(--font-size-sm)}"]});let i=e;return i})();function pK(i,e){if(i&1){let r=Ge();S(0,"div",1)(1,"a",2),se("click",function(){let n=Se(r).ngIf,d=q();return Te(d.onBannerClick(n.campaign))}),S(2,"div",3),Z(3,"img",4),E(),S(4,"div",5),Z(5,"img",6),E()()()}if(i&2){let r=e.ngIf;P(1),N("href",r.link,Ei),P(2),N("src",r.imageUrl+"-1190x400"+r.suffix,Ei),P(2),N("src",r.imageUrl+"-1190x200"+r.suffix,Ei)}}var Cu=(()=>{let e=class e{constructor(t){this.platformId=t,this.medium="default_medium",this.banners=[{imageUrl:"assets/images/elektroliti",campaign:"performance-electrolytes",suffix:".jpg",link:"https://shop.mountainsgeek.com/izdelek/elektroliti-noordcode/"},{imageUrl:"assets/images/completecollagen",campaign:"complete-collagen",suffix:".jpg",link:"https://shop.mountainsgeek.com/izdelek/kolagen-noordcode/"},{imageUrl:"assets/images/purecollagen",campaign:"nov-izdelek-pure-collagen",suffix:".jpg",link:"https://shop.mountainsgeek.com/izdelek/pure-collagen-noordcode/"},{imageUrl:"assets/images/dailyelectrolytes",campaign:"nov-izdelek-daily-electrolytes",suffix:".jpg",link:"https://shop.mountainsgeek.com/izdelek/daily-electrolytes-berries-noordcode/"}],this.selectedBanner=null}ngOnInit(){Si(this.platformId)&&this.selectRandomBanner()}selectRandomBanner(){let t=Math.floor(Math.random()*this.banners.length),o=this.banners[t],n=o.link??"https://shop.mountainsgeek.com/";this.selectedBanner=en(bt({},o),{link:`${n}?utm_source=webpage&utm_medium=${this.medium}&utm_campaign=${o.campaign}`}),xu("banner_shown",{campaign:o.campaign,link_location:this.medium})}onBannerClick(t){xu("banner_click",{campaign:t,link_location:this.medium})}};e.\u0275fac=function(o){return new(o||e)(ae(Qt))},e.\u0275cmp=st({type:e,selectors:[["app-random-banner"]],inputs:{medium:"medium"},standalone:!0,features:[gt],decls:1,vars:1,consts:[["class","banner",4,"ngIf"],[1,"banner"],["target","_blank","rel","noopener noreferrer",3,"href","click"],[1,"hidden-desktop","hidden"],["alt","Shop Banner mobile",3,"src"],[1,"hidden-mobile"],["alt","Shop Banner desktop",3,"src"]],template:function(o,n){o&1&&ce(0,pK,6,3,"div",0),o&2&&N("ngIf",n.selectedBanner)},dependencies:[Dt,At],styles:[".banner[_ngcontent-%COMP%]{text-align:center;margin:20px}.banner[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{border-radius:8px;box-shadow:0 4px 6px #0000001a;cursor:pointer}@media (min-width: 769px){.banner[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:100%;max-height:200px;height:auto;width:auto}}@media (max-width: 768px){.banner[_ngcontent-%COMP%]{margin:0}.banner[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%;height:auto}}"]});let i=e;return i})();var fK=["countryFilter"],mK=["hikingTimeFilter"],gK=["mountainRangeFilter"],_K=["destinationTypeFilter"],vK=["difficultyFilter"];function yK(i,e){i&1&&Z(0,"app-most-visited-list",45),i&2&&N("limit",20)}function bK(i,e){i&1&&Z(0,"app-checkin-list",45),i&2&&N("limit",20)}var xK=i=>
1326({country:i}),qx=i=>({active:i}),O3=(()=>{let e=class e{constructor(t){this.router=t,this.newRoadsTab=!0,this.bestRoadsTab=!1,this.homeCheckinsTab="popular",this.lastStories=!0,this.roadsOrdering="id",this.filters={country:null,mountain_range:null,hiking_time:null,type:null,difficulty:null},this.countryFilter=null,this.hikingTimeFilter=null,this.mountainRangeFilter=null,this.destinationTypeFilter=null,this.difficultyFilter=null}scroll_to_section(t){t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})}changeTab(t){t==="new-roads"?(this.newRoadsTab=!0,this.bestRoadsTab=!1,this.roadsOrdering="id"):t==="best-roads"&&(this.newRoadsTab=!1,this.bestRoadsTab=!0,this.roadsOrdering="rating")}downloadApp(t){Ss("home_banner",t)}changeCheckinsTab(t){this.homeCheckinsTab=t}updateFilters(t,o){this.filters[o]=t}clearAllFilters(){this.countryFilter.clearSelection(),this.mountainRangeFilter.clearSelection(),this.hikingTimeFilter.clearSelection(),this.destinationTypeFilter.clearSelection(),this.difficultyFilter.clearSelection(),this.filters={country:null,mountain_range:null,hiking_time:null,type:null,difficulty:null}}redirectToSearch(){let t={};for(let o in this.filters)this.filters[o]!=null&&this.filters[o]!=null&&(o==="hiking_time"?(t[o+"__lowValue"]=this.filters[o].lowValue,t[o+"__highValue"]=this.filters[o].highValue):o==="distance_location"?(t.lat=this.filters[o].lat,t.lng=this.filters[o].lng):o==="distance_range"?t.distance=this.filters[o].highValue:t[o]=this.filters[o]);this.router.navigate(["/search"],{queryParams:t})}};e.\u0275fac=function(o){return new(o||e)(ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-home"]],viewQuery:function(o,n){if(o&1&&(ni(fK,5),ni(mK,5),ni(gK,5),ni(_K,5),ni(vK,5)),o&2){let d;Xt(d=Yt())&&(n.countryFilter=d.first),Xt(d=Yt())&&(n.hikingTimeFilter=d.first),Xt(d=Yt())&&(n.mountainRangeFilter=d.first),Xt(d=Yt())&&(n.destinationTypeFilter=d.first),Xt(d=Yt())&&(n.difficultyFilter=d.first)}},standalone:!0,features:[gt],decls:106,vars:64,consts:[[1,"home-hero"],[1,"home-hero-overlay"],[1,"home-hero-content"],[1,"home-hero-title"],[1,"home-hero-subtitle"],[1,"home-hero-lead"],[3,"filterName","filterID","filterType","contentType","additionalClasses","multipleSelect","onSelect"],["countryFilter",""],[3,"filterName","filterID","filterType","contentType","additionalClasses","multipleSelect","params","onSelect"],["mountainRangeFilter",""],[3,"filterName","filterID","filterType","contentType","additionalClasses","sliderCeil","sliderType","highValueTitle","unit","onRangeChange","onLocationChange"],["distanceFilter",""],[3,"filterName","filterID","filterType","contentType","multipleSelect","additionalClasses","sliderCeil","onRangeChange"],["hikingTimeFilter",""],["destinationTypeFilter",""],["difficultyFilter",""],[1,"clearfix"],[1,"home-hero-actions"],["type","button",1,"btn","btn-default","btn-pill",3,"click"],["type","button","id","submit-filters",1,"btn","btn-primary","btn-pill",3,"click"],[1,"arrow","down","home-hero-scroll-cue",3,"click"],[1,"middle","margin-20-top",2,"position","relative"],["medium","homepage_banner"],[2,"position","absolute","top","-50px"],["texts",""],[1,"grid-item-outer","grid-item-outer-3","home-feature-card"],[1,"home-feature-icon"],["alt","Na\u0161a vizija","src","/assets/images/lightbulb.jpg","width","130px;"],[1,"align-center","margin-25-bottom"],["routerLink","/our_vision"],[1,"btn","btn-extra","btn-xl"],[1,"align-center","home-feature-text"],[1,"text-16"],["alt","Kam v hribe?","src","/assets/images/hiker.jpg","width","130px;"],["routerLink","/search"],["alt","Pridru\u017Ei se nam","src","/assets/images/comunity_logo.jpg","width","130px;"],["routerLink","/register"],[1,"home-app-promo"],[1,"align-center","home-app-promo-text"],["alt","Prenesi na Google Play","src","/assets/images/google-play-button.png",1,"home-app-badge",3,"click"],["alt","Prenesi v App Store","src","/assets/images/app-store-badge.svg",1,"home-app-badge",3,"click"],[1,"home-lists-row"],[1,"width-50-percent","mobile-100-percent-width","margin-5-bottom","home-lists-col"],[1,"col-header","tabs"],[1,"tab",3,"ngClass"],[1,"home-lists-fill",3,"limit"],[1,"tab",3,"ngClass","click"],["class","home-lists-fill",3,"limit",4,"ngIf"],[2,"position","relative","margin-bottom","20px"],["roads",""],[3,"loadMoreVisible","cols","limit","oddEven","order","ordering"]],template:function(o,n){if(o&1){let d=Ge();S(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),A(4,"KAM V HRIBE?"),E(),S(5,"p",4),A(6,"ISKALNIK IZLETOV"),E(),S(7,"p",5),A(8,'Izberite \u017Eelene filtre in kliknite gumb "Najdi izlet".'),E(),S(9,"app-filter",6,7),se("onSelect",function(C){return n.updateFilters(C,"country")}),E(),S(11,"app-filter",8,9),se("onSelect",function(C){return n.updateFilters(C,"mountain_range")}),E(),S(13,"app-filter",10,11),se("onRangeChange",function(C){return n.updateFilters(C,"distance_range")})("onLocationChange",function(C){return n.updateFilters(C,"distance_location")}),E(),S(15,"app-filter",12,13),se("onRangeChange",function(C){return n.updateFilters(C,"hiking_time")}
1326),E(),S(17,"app-filter",6,14),se("onSelect",function(C){return n.updateFilters(C,"type")}),E(),S(19,"app-filter",6,15),se("onSelect",function(C){return n.updateFilters(C,"difficulty")}),E(),Z(21,"div",16),S(22,"div",17)(23,"button",18),se("click",function(){return n.clearAllFilters()}),A(24,"Po\u010Disti"),E(),S(25,"button",19),se("click",function(){return n.redirectToSearch()}),A(26,"Najdi izlet"),E()()()(),S(27,"i",20),se("click",function(){Se(d);let C=or(31);return Te(n.scroll_to_section(C))}),E()(),S(28,"div",21),Z(29,"app-random-banner",22)(30,"div",23,24),S(32,"div",25)(33,"div",26),Z(34,"img",27),E(),S(35,"p",28)(36,"a",29)(37,"button",30),A(38," NA\u0160A VIZIJA "),E()()(),S(39,"p",31),A(40,"Si ne zna\u0161 ve\u010D predstavljati \u017Eivljenja brez osupljivih razgledov z vedno novega vrha? So "),S(41,"span",32),A(42,"hribi"),E(),A(43," tudi tvoj najljub\u0161i kraj za sprostitev? Ob son\u010Dni napovedi najprej pomisli\u0161 na gore? Si tudi ti mnenja, da vse ure hoje v hrib niso le brezvezno mu\u010Denje samega sebe, pa\u010D pa obogatitev samega sebe, ki je na vrhu vsake gore popla\u010Dano z zmagoslavnim ob\u010Dutkom "),S(44,"span",32),A(45,"uspeha in sre\u010De"),E(),A(46,"? So te hribi dobesedno zasvojili in se jim ne more\u0161 upreti?"),E()(),S(47,"div",25)(48,"div",26),Z(49,"img",33),E(),S(50,"p",28)(51,"a",34)(52,"button",30),A(53," KAM V HRIBE? "),E()()(),S(54,"p",31),A(55,"Potem si na pravem mestu. Dobrodo\u0161el v gorski knji\u017Enici Mountains Geek. Skupnosti, ki jo sestavljamo sami zasvojenci s hribi! Tudi nam so gore zavzele del srca in na\u0161e glavno vpra\u0161anje ob vsakem prostem dnevu je: "),S(56,"span",32),A(57,"\xBBKam na izlet?\xAB"),E(),A(58," Prehoditi \u017Eelimo vsako pot in osvojiti vsak vrh. In nimamo se namena sploh kdaj ustaviti."),E()(),S(59,"div",25)(60,"div",26),Z(61,"img",35),E(),S(62,"p",28)(63,"a",36)(64,"button",30),A(65," PRIDRU\u017DI SE NAM "),E()()(),S(66,"p",31),A(67," V gorski knji\u017Enici Mountains Geek lahko najde\u0161 \u0161tevilne"),S(68,"span",32),A(69,"ideje kam v hribe"),E(),A(70,". Posebna vrednost knji\u017Enice je iskalnik, ki omogo\u010Da napredno iskanje izletov. Tako si lahko izbere\u0161 pohod po svojih \u017Eeljah in poskrbi\u0161, da bodo gore tudi tebi ostale v prijetnem spominu. Kar pa je pri knji\u017Enici Mountains Geek najbolj\u0161e, je to, da se nam lahko pridru\u017Ei prav vsak. \u017Delimo si povezati \u010Dim ve\u010D pohodnikov in tako ustvariti najve\u010Djo "),S(71,"span",32),A(72,"gorsko skupnost"),E(),A(73,". Zato te vabimo, da se nam pridru\u017Ei\u0161 in nam to idejo pomaga\u0161 uresni\u010Diti."),E()(),Z(74,"div",16),S(75,"div",37)(76,"p",38),A(77,"Mountains Geek je na voljo tudi kot brezpla\u010Dna aplikacija za Android in iOS."),E(),S(78,"img",39),se("click",function(){return n.downloadApp("android")}),E(),S(79,"img",40),se("click",function(){return n.downloadApp("ios")}),E()()(),S(80,"div",41)(81,"div",42)(82,"div",43)(83,"div",44),A(84," Zadnje razmere v zgodbah "),E(),Z(85,"div",16),E(),Z(86,"app-story-list",45),E(),S(87,"div",42)(88,"div",43)(89,"div",46),se("click",function(){return n.changeCheckinsTab("popular")}),A(90," Najbolj obiskano "),E(),S(91,"div",46),se("click",function(){return n.changeCheckinsTab("recent")}),A(92," Zadnji vpisi "),E(),Z(93,"div",16),E(),ce(94,yK,1,1,"app-most-visited-list",47)(95,bK,1,1,"app-checkin-list",47),E()(),Z(96,"div",16),S(97,"div",43)(98,"div",46),se("click",function(){return n.changeTab("new-roads")}),A(99," Nove poti "),E(),Z(100,"div",16),E(),S(101,"div",48),Z(102,"div",23,49)(104,"app-road-grid-list",50),E(),Z(105,"div",16)}o&2&&(P(9),N("filterName","dr\u017Eava")("filterID","country")("filterType","list")("contentType","country")("additionalClasses","filter-home")("multipleSelect",!0),P(2),N("filterName","gorovje")("filterID","mountain_range")("filterType","list")("contentType","mountain_range")("additionalClasses","filter-home")("multipleSelect",!0)("params",kt(54,xK,n.filters.country)),P(2),N("filterName","oddaljenost")("filterID","distance")("filterType","distance")("contentType","distance")("additionalClasses","filter-home")("sliderCeil",1e3)("sliderType","value")("highValueTitle","Oddaljenost:")("unit","km"),P(2),N("filterName","\u010Das hoje")("filterID","hiking_time")("filterType","range")("contentType","hiking_time")("multipleSelect",!0)("additionalClasses","filter-home")("sliderCeil",1440),P(2),N("filterName","vrsta cilja")("filterID","type")("filterType","list")("contentType","type")("additionalClasses","filter-home")("multipleSelect",!0),P(2),N("filterName","zahtevnost")("filterID","difficulty")("filterType","list")("contentType","difficulty")("additionalClasses","filter-home")("multipleSelect",!0),P(64),N("ngClass",kt(56,qx,n.lastStories)),P(3),N("limit",30),P(3),N("ngClass",kt(58,qx,n.homeCheckinsTab==="popular")),P(2),N("ngClass",kt(60,qx,n.homeCheckinsTab==="recent")),P(3),N("ngIf",n.homeCheckinsTab==="popular"),P(1),N("ngIf",n.homeCheckinsTab==="recent"),P(3),N("ngClass",kt(62,qx,n.newRoadsTab)),P(6),N("loadM
1326oreVisible",!0)("cols",5)("limit",5)("oddEven","odd")("order","-")("ordering",n.roadsOrdering))},dependencies:[Dt,on,At,Hx,qi,$x,Gx,Af,P3,Cu],styles:[".home-hero[_ngcontent-%COMP%]{position:relative;width:100%;height:calc(100vh - 50px);background:url(/assets/images/background_test1.jpg);background-repeat:no-repeat;background-size:cover;background-position-y:center}.home-hero-overlay[_ngcontent-%COMP%]{background:linear-gradient(to bottom,rgba(33,31,30,.85),rgba(0,0,0,.28));height:100%;display:flex;align-items:center;justify-content:center}.home-hero-content[_ngcontent-%COMP%]{text-align:center;margin:20px;max-width:640px}.home-hero-title[_ngcontent-%COMP%]{color:#fff;font-size:var(--font-size-2xl);font-weight:700;letter-spacing:.5px}.home-hero-subtitle[_ngcontent-%COMP%]{text-align:center;color:var(--color-accent);font-size:var(--font-size-sm);font-weight:700;letter-spacing:1.5px;margin-top:4px}.home-hero-lead[_ngcontent-%COMP%]{color:#fff;text-align:center;font-size:var(--font-size-base);margin-top:var(--space-3)}.home-hero-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;gap:var(--space-3);margin-top:var(--space-5)}.home-hero-scroll-cue[_ngcontent-%COMP%]{position:absolute;bottom:20px;left:calc(50% - 13px);cursor:pointer;animation:_ngcontent-%COMP%_home-hero-bounce 1.8s ease-in-out infinite}@keyframes _ngcontent-%COMP%_home-hero-bounce{0%,to{transform:translateY(0) rotate(45deg)}50%{transform:translateY(6px) rotate(45deg)}}.home-feature-card[_ngcontent-%COMP%]{background:var(--color-surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:var(--space-5) var(--space-4);box-sizing:border-box;transition:box-shadow var(--transition-base),transform var(--transition-base)}.home-feature-card[_ngcontent-%COMP%]:hover{box-shadow:var(--shadow-md);transform:translateY(-4px)}.home-feature-icon[_ngcontent-%COMP%]{text-align:center;margin-bottom:var(--space-2)}.home-feature-icon[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{border-radius:var(--radius-pill)}.home-feature-text[_ngcontent-%COMP%]{line-height:1.55;color:var(--color-text-muted);font-size:var(--font-size-base)}.home-app-promo[_ngcontent-%COMP%]{text-align:center;margin-top:var(--space-7)}.home-app-promo-text[_ngcontent-%COMP%]{margin-bottom:var(--space-3);color:var(--color-text)}.home-app-badge[_ngcontent-%COMP%]{height:50px;margin:5px;cursor:pointer;transition:transform var(--transition-fast)}.home-app-badge[_ngcontent-%COMP%]:hover{transform:scale(1.08)}@media screen and (max-width: 1000px){.home-hero-title[_ngcontent-%COMP%]{font-size:var(--font-size-xl)}}.home-lists-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:stretch}.home-lists-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.home-lists-fill[_ngcontent-%COMP%]{flex:1;min-height:0}"]});let i=e;return i})();var R3=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=st({type:e,selectors:[["app-our-vision"]],standalone:!0,features:[gt],decls:29,vars:0,consts:[[1,"margin-10-bottom","middle"],[1,"img-header",2,"background","url(/assets/images/muzec.jpg)"],[1,"img-header-title","middle"],[1,"img-header-holder"]],template:function(o,n){o&1&&(S(0,"div",0)(1,"div",1)(2,"h1",2),A(3,"NA\u0160A VIZIJA"),E()(),Z(4,"div",3)(5,"br"),S(6,"p"),A(7,'Gore so ena od mnogih zabavnih in veli\u010Dastnih do\u017Eivetji, ki nam jih ponuja na\u0161a Zemlja. Pot do samega vrha sicer ni preprosta, vendar je vredna u\u017Eitkov, ki jih do\u017Eivimo, ko dose\u017Eemo cilj. Vsak si v \u017Eivljenju \u017Eeli sre\u010De in lahko bi rekli, da nas na vrhu vedno \u010Daka kan\u010Dek le-te. Tako tudi na\u0161 slogan pravi: "Find your own way to the top of happiness." ("Najdi svojo pot do vrha sre\u010De.")'),E(),Z(8,"br"),S(9,"h3"),A(10,"Kdo smo?"),E(),S(11,"p"),A(12,"Programerji, in\u017Eenirji, pohodniki, ljubitelji narave in predvsem pohodni\u0161tva. Mountains Geek nas je zdru\u017Eil v \u017Eelji, da bi ustvarili platformo, ki bi zdru\u017Eila vse pohodnike, vrhove in poti sveta na enem mestu. Verjamemo, da je za vsak dose\u017Eek najpomembnej\u0161a vztrajnost, zato se tega na\u010Dela dr\u017Eimo tudi pri doseganju tega cilja."),E(),Z(13,"br"),S(14,"h3"),A(15,"Kaj \u017Eelimo dose\u010Di?"),E(),S(16,"p"),A(17,"Kot programerji in in\u017Eenirji imamo radi tehnologijo ter verjamemo, da lahko le-ta stori veliko dobrega tudi v svetu pohodni\u0161tva. Obstaja veliko razli\u010Dnih aplikacij in platform, ki \u017Ee danes veliko pripomorejo k la\u017Ejemu in bolj varnemu pohodni\u0161tvu, vendar verjamemo, da lahko le-to naredimo \u0161e la\u017Eje, varnej\u0161e in zabavnej\u0161e. Radi bi ustvarili najve\u010Djo elektronsko interaktivno knji\u01
13267Enico gora in s tem zdru\u017Eili vse kar pohodnik potrebuje na enem mestu in povezali:"),E(),S(18,"ul")(19,"li"),A(20,"vse poznavalce tiso\u010Derih poti, ki bi z drugimi delili svoje osvojene vrhove,"),E(),S(21,"li"),A(22,"vse, ki bi se radi nekam povzpeli, pa ne vedo kam,"),E(),S(23,"li"),A(24,"vse, ki radi opisujejo ali fotografirajo svoje dogodiv\u0161\u010Dine v gorah,"),E(),S(25,"li"),A(26,"vse, ki i\u0161\u010Dejo kakr\u0161nekoli informacije o hribih,"),E(),S(27,"li"),A(28,"in nenazadnje vse, ki \u0161e niso izkusili gorskega oddiha in bi jih lahko z vsemi na\u0161imi do\u017Eivetji prepri\u010Dali v to."),E()()())}});let i=e;return i})();var xl=(()=>{let e=class e{constructor(t,o){this.document=t,this.platformId=o,this.documentIsAccessible=Si(this.platformId)}static getCookieRegExp(t){let o=t.replace(/([\[\]{}()|=;+?,.*^$])/gi,"\\$1");return new RegExp("(?:^"+o+"|;\\s*"+o+")=(.*?)(?:;|$)","g")}static safeDecodeURIComponent(t){try{return decodeURIComponent(t)}catch{return t}}check(t){return this.documentIsAccessible?(t=encodeURIComponent(t),e.getCookieRegExp(t).test(this.document.cookie)):!1}get(t){if(this.documentIsAccessible&&this.check(t)){t=encodeURIComponent(t);let n=e.getCookieRegExp(t).exec(this.document.cookie);return n[1]?e.safeDecodeURIComponent(n[1]):""}else return""}getAll(){if(!this.documentIsAccessible)return{};let t={},o=this.document;return o.cookie&&o.cookie!==""&&o.cookie.split(";").forEach(n=>{let[d,_]=n.split("=");t[e.safeDecodeURIComponent(d.replace(/^ /,""))]=e.safeDecodeURIComponent(_)}),t}set(t,o,n,d,_,C,M){if(!this.documentIsAccessible)return;if(typeof n=="number"||n instanceof Date||d||_||C||M){let ie={expires:n,path:d,domain:_,secure:C,sameSite:M||"Lax"};this.set(t,o,ie);return}let j=encodeURIComponent(t)+"="+encodeURIComponent(o)+";",G=n||{};if(G.expires)if(typeof G.expires=="number"){let ie=new Date(new Date().getTime()+G.expires*1e3*60*60*24);j+="expires="+ie.toUTCString()+";"}else j+="expires="+G.expires.toUTCString()+";";G.path&&(j+="path="+G.path+";"),G.domain&&(j+="domain="+G.domain+";"),G.secure===!1&&G.sameSite==="None"&&(G.secure=!0,console.warn(`[ngx-cookie-service] Cookie ${t} was forced with secure flag because sameSite=None.More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`)),G.secure&&(j+="secure;"),G.sameSite||(G.sameSite="Lax"),j+="sameSite="+G.sameSite+";",this.document.cookie=j}delete(t,o,n,d,_="Lax"){if(!this.documentIsAccessible)return;let C=new Date("Thu, 01 Jan 1970 00:00:01 GMT");this.set(t,"",{expires:C,path:o,domain:n,secure:d,sameSite:_})}deleteAll(t,o,n,d="Lax"){if(!this.documentIsAccessible)return;let _=this.getAll();for(let C in _)_.hasOwnProperty(C)&&this.delete(C,t,o,n,d)}};e.\u0275fac=function(o){return new(o||e)(Ve($i),Ve(Qt))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var L3=(()=>{let e=class e{constructor(t){this.cookieService=t}deleteAllCookies(){this.cookieService.deleteAll(),confirm("Ali ste prepri\u010Dani da \u017Eelite zapustiti spletno trgovino Mountains Geek?")&&(location.href="https://www.google.com/")}};e.\u0275fac=function(o){return new(o||e)(ae(xl))},e.\u0275cmp=st({type:e,selectors:[["app-cookies"]],standalone:!0,features:[gt],decls:130,vars:0,consts:[[1,"margin-10-top","margin-10-bottom","middle"],["href","mailto: [email protected]"],[1,"content-table",2,"width","100%"],[1,"btn","btn-default","btn-sm","float-right","margin-10-top","margin-10-bottom",3,"click"]],template:function(o,n){o&1&&(S(0,"div",0)(1,"h1"),A(2,"VARSTVO OSEBNIH PODATKOV IN PI\u0160KTOKI"),E(),Z(3,"br"),S(4,"h3"),A(5,"POLITIKA VAROVANJA OSEBNIH PODATKOV:"),E(),Z(6,"br"),S(7,"p"),A(8,"Kot kupec oz. uporabnik imate vse pravice, ki so navedene v Zakonu o varstvu potro\u0161nikov, v skladu z ZVOP-1."),E(),S(9,"p"),A(10,"Ponudnik si ob registraciji in/ali oddaji naro\u010Dila shrani naslednje podatke kupca oz. uporabnika: Ime in priimek, naslov za ra\u010Dun in naslov za dostavo, rojstni datum, spol, elektronski naslov ter uporabni\u0161ko ime in geslo (slednje \u0161tiri le v primeru, da se kupec oz. uporabnik registrira)."),E(),S(11,"p"),A(12,"Ponudnik zagotavlja varstvo osebnih podatkov kupca oz. uporabnika spletne strani. Teh podatkov ne bo zlorabil, niti jih posredoval tretji osebi (z izjemo v kolikor to zahteva uradni zakon), ampak jih bo uporabil le za namen obdelave naro\u010Dila in analiti\u010Dno obdelavo za izbo\u0161lanje ponudbe in storitev. V kolikor mu bo uporabnik izrecno dovolil bo podatke uporabil \u0161e za naslednje namene:"),E(),S(13,"ul")(14,"li"),A(15,"po\u0161iljanje e-obvestil z raznimi novicami, ki se navezujejo na Mountains Geek ponudbo in storitve,"),E(),S(16,"li"),A(17,"spletno ogla\u0161evanje."),E()(),Z(18,"br"),S(19,"p"),A(20,"Kupec oz. uporabnik lahko kadarkoli preko elektronskega naslova "),S(21,"a",1),A(22,"[email protected]"),E(),A(23," zahteva spremembo hranjenih podatkov. To bo ponudnik storil najkasneje v osmih dneh po prejemu zahtevka."),E(),S(24,"p"),A(25,"Kadarkoli lahko kupec oz. uporabnik zahteva izbris njegovih podatkov iz vseh podatkovnih baz ponudnika, tako da ponudnika o tem obvesti na elektronski naslov [email protected]. V tem primeru bo kupec oz. uporabnik iz podatkovnih baz odstranjen v osmih dneh po prejemu zahtevka, razen v primerih ko evropska zakonodaja zahteva hrambo podatkov."),E(),S(26,"p"),A(27,"Na podlagi zahteve kupca oz. uporabnika, bo ponudnik nemudoma obvestil kupca \u2013 pisno in v skladu s primerno zakonodajo \u2013 kateri oseb
1326ni podatki, \u010De sploh kateri, so bili zbrani med obiskom spletne strani shop.mountainsgeek.com. Kadarkoli lahko kupec oz. uporabnik zahteva tudi, da se ga obvesti o: identiteti dejavnosti, kontaktnih podatkih, bistvenih zna\u010Dilnostih blaga, dostopnosti blaga, pogojih dostave blaga, cenah, na\u010Dinu pla\u010Dila in dostavi, \u010Dasovni veljavnosti ponudbe, roku v katerem je mo\u017Eno odstopiti od pogodbe, pojasnilu postopka ob prito\u017Ebi."),E(),S(28,"p"),A(29,"Kadarkoli kupec oz. uporabnik dostopi na spletno stran shop.mountainsgeek.com se bele\u017Eijo neosebni splo\u0161ni podatki o statistiki spletne strani v namene pridobivanja statisti\u010Dnih informacij privla\u010Dnosti in uporabnosti spletne strani ter kot pokazatelj mo\u017Enosti izbolj\u0161av. Ti podatki so neosebni, niso predmet nadaljnih obravnav in niso posredovani tretji osebi."),E(),S(30,"h3"),A(31,"MLADOLETNE OSEBE:"),E(),Z(32,"br"),S(33,"p"),A(34,"Mladoletne osebe naj ne bi posredovale kakr\u0161nihkoli osebnih podatkov na spletnih mestih mountainsgeek.com. Ker teh podatkov ne moremo preverjati, ponudnik priporo\u010Da star\u0161em, da opomnijo mladoletnike o varni uporabi spleta in jih opozorijo, da ni priporo\u010Deno kakr\u0161nokoli posredovanje osebnih podatkov na spletu."),E(),S(35,"h3"),A(36,"PRAVICA DO KONTAKTA:"),E(),Z(37,"br"),S(38,"p"),A(39,"Vsak obiskovalec spletne strani shop.mountainsgeek.com ima v vsakem trenutku omogo\u010Deno mo\u017Enost, da ponudnika kontaktira na elektronski naslov "),S(40,"a",1),A(41,"[email protected]"),E(),A(42,"."),E(),S(43,"h3"),A(44,"OBJAVA MOREBITNIH SPREMEMB:"),E(),Z(45,"br"),S(46,"p"),A(47,"Morebitne spremembe politike varovanja osebnih podatkov bodo javno objavljene in vidne na spletni strani shop.mountainsgeek.com."),E(),S(48,"h3"),A(49,"PRITO\u017DBE IN SPORI:"),E(),Z(50,"br"),S(51,"p"),A(52,"V primeru te\u017Eav lahko kupec oz. uporabnik kontaktira ponudnika na elektronski naslov "),S(53,"a",1),A(54,"[email protected]"),E(),A(55,". Prito\u017Eba je zaupna, med kupcem oz. uporabnikom in ponudnikom. Po prejemu prito\u017Ebe, bo kupec prejel obvestilo o prejetju in o tem koliko \u010Dasa jo bo ponudnik obravnaval. Ponudnik si prizadeva za sporazumno re\u0161evanje sporov. Med re\u0161evanjem spora lahko ponudnik kadarkoli kontaktira kupca. V nasprotnem primeru spore re\u0161uje pristojno sodi\u0161\u010De."),E(),S(56,"h3"),A(57,"PI\u0160KOTKI:"),E(),Z(58,"br"),S(59,"p"),A(60,"Kaj so pi\u0161kotki? So kratke besedilne datoteke, ki jih ve\u010Dina spletnih mest shrani v naprave uporabnikov, s katerimi dostopajo do interneta, zato da bi prepoznali te naprave."),E(),S(61,"p"),A(62,"Ponudnik zbira tudi neosebne podatke o uporabi spletne strani (predvsem: koliko obiskovalcev dnevno obi\u0161\u010De stran in koliko \u010Dasa obiskovalci ostanejo na posamezni podstrani), t.i. \u201Cpi\u0161kotki\u201D. Kupec oz. uporabnik dovoljuje zbiranje podatkov o uporabi spletne strani s klikom na \u201CV redu\u201D, ki se mu na spletni strani prika\u017Ee ob obvestilu o pi\u0161kotkih."),E(),S(63,"p"),A(64,"Shranjevanje pi\u0161kotkov je pod nadzorom kupca oz.uporabnika, kateri lahko shranjevanje pi\u0161kotkov onemogo\u010Di. V kolikor se uporabnik odlo\u010Di za slednje, ne more uporabljati spletnih mest mountainsgeek.com, ker so ti za samo delovanje spletnih mest, klju\u010Dnega pomena."),E(),S(65,"p"),A(66,"Ponudnik zbira tudi IP naslove iz katerih uporabnik dostopa do spletnega mesta, za potrebe zagotavljanja varnosti. Ob za\u010Detku obiska spletne strani je kupcu oz. uporabniku dodeljen sejni pi\u0161kotek za identifikacijo in spremljanje nakupovalne ko\u0161arice. Ponudnik lahko na ra\u010Dunalnik kupca oz. uporabnika shrani tudi druge pi\u0161kotke (npr. identifikacijska \u0161t. uporabnika v \u0161ifrirani obliki, analiza obiskov spletnega mesta)."),E(),S(67,"p"),A(68,"Trajni pi\u0161kotki (vsi zbrani podatki, ki jih ponudnik shrani od kupca oz. uporabnika) so shranjeni na ra\u010Dunalniku kupca oz. uporabika."),E(),S(69,"p"),A(70,"Seznam pi\u0161kotkov, ki jih uporabljamo:"),E(),S(71,"table",2)(72,"tr")(73,"th"),A(74,"Ime pi\u0161kotka"),E(),S(75,"th"),A(76,"Namen"),E(),S(77,"th"),A(78,"\u010Cas pi\u0161kotka"),E()(),S(79,"tr")(80,"td"),A(81,"sessionid"),E(),S(82,"td"),A(83,"Osnovno delovanje spletne strani"),E(),S(84,"td"),A(85,"do 14 dni oz. do konca seje"),E()(),S(86,"tr")(87,"td"),A(88,"csrftoken"),E(),S(89,"td"),A(90,"Za prepre\u010Devanje CSRF (Cross-Site Requst Foregery) napadov."),E(),S(91,"td"),A(92,"do 6 dni"),E()(),S(93,"tr")(94,"td"),A(95,"_ga"),E(),S(96,"td"),A(97,"Parameter za vodenje statistike interakcij z na\u0161o spletno stranjo."),E(),S(98,"td"),A(99,"do 2 let"),E()(),S(100,"tr")(101,"td"),A(102,"_gid"),E(),S(103,"td"),A(104,"Parameter za vodenje statistike interakcij z na\u0161o spletno stranjo."),E(),S(105,"td"),A(106,"do 2 let"),E()(),S(107,"tr")(108,"td"),A(109,"_gat_gtag_UA_XXXX"),E(),S(110,"td"),A(111,"Parameter za vodenje statistike interakcij z na\u0161o spletno stranjo."),E(),S(112,"td"),A(113,"do 2 let"),E()(),S(114,"tr")(115,"td"),A(116,"fr"),E(),S(117,"td"),A(118,"Za Facebook ogla\u0161evanje."),E(),S(119,"td"),A(120,"do 3 mesece"),E()(),S(121,"tr")(122,"td"),A(123,"cookies_accepted"),E(),S(124,"td"),A(125,"Spletno mesto s pomo\u010Djo tega pi\u0161kotka zazna, da ste sprejeli politiko pi\u0161kotkov. Ustvari se ko potrdite pi\u0161kotke."),E(),S(126,"td"),A(127,"do 10 let"),E()()(),S(128,"button",3),se("
1326click",function(){return n.deleteAllCookies()}),A(129," Zapusti stran in odstrani pi\u0161kotke "),E()())}});let i=e;return i})();var F3=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=st({type:e,selectors:[["app-terms-of-use"]],standalone:!0,features:[gt],decls:149,vars:0,consts:[[1,"margin-10-top","margin-10-bottom","middle"],["href","mailto: [email protected]"],["routerLink","/cookies"],[1,"texts-title"]],template:function(o,n){o&1&&(S(0,"div",0)(1,"h1"),A(2,"POGOJI UPORABE"),E(),Z(3,"br"),S(4,"p"),A(5,"Splo\u0161ni pogoji spletne strani in spletne trgovine (v nadaljevanju: spletnega portala) Mountains Geek so sestavljeni v skladu z:"),E(),S(6,"ul")(7,"li"),A(8,"Zakonom o varstvu osebnih podatkov (ZVOP-1),"),E(),S(9,"li"),A(10,"Zakonom o varstvu potro\u0161nikov (ZVPot)."),E()(),Z(11,"br"),S(12,"p"),A(13,"V splo\u0161nih pogojih poslovanja so dolo\u010Deni:"),E(),S(14,"ul")(15,"li"),A(16,"delovanje spletnega portala Mountains Geek,"),E(),S(17,"li"),A(18,"pravice in obveznosti uporabnika,"),E(),S(19,"li"),A(20,"pravice in obveznosti spletnega portala,"),E(),S(21,"li"),A(22,"poslovni odnos med spletnim portalom in uporabnikom."),E()(),Z(23,"br"),S(24,"p"),A(25,"Pogoji poslovanja spletnega portala Mountains Geek so javno objavljeni, na njih pa je uporabnik spletnega portala tudi opozorjen. V primeru oddaje naro\u010Dila v spletni trgovini kupec oz. uporabnik potrdi, da je seznanjen z njimi ter se z njimi tudi strinja."),E(),Z(26,"br"),S(27,"h3"),A(28,"PODATKI O UPRAVLJALCU SPLETNEGA PORTALA:"),E(),Z(29,"br"),A(30," AIDI Podjetje za trgovino, zastopanje in storitve d.o.o"),Z(31,"br"),A(32," Zatolmin 64d"),Z(33,"br"),A(34," 5220 Tolmin"),Z(35,"br")(36,"br"),S(37,"b"),A(38,"Dav\u010Dna \u0161t.:"),E(),A(39," SI35836776"),Z(40,"br"),S(41,"b"),A(42,"Zavezanec za DDV:"),E(),A(43," Da"),Z(44,"br"),S(45,"b"),A(46,"Mati\u010Dna \u0161t.:"),E(),A(47," 5743630000"),Z(48,"br")(49,"br"),S(50,"b"),A(51,"Elektronski naslov:"),E(),S(52,"a",1),A(53,"[email protected]"),E(),Z(54,"br")(55,"br"),S(56,"h3"),A(57,"SPLO\u0160NI POGOJI POSLOVANJA:"),E(),Z(58,"br"),S(59,"p"),A(60,"Spletni portal Mountains Geek upravlja AIDI Podjetje za trgovino, zastopanje in storitve d.o.o (v nadaljevanju: ponudnik). Ponudnik jam\u010Di, da so tako vse aktivnosti, ki so omogo\u010Dene na spletni strani, kot tudi nakup v spletni trgovini, varni."),E(),S(61,"h3"),A(62,"VARSTVO OSEBNIH PODATKOV:"),E(),Z(63,"br"),S(64,"p"),A(65,"Kot kupec oz. uporabnik imate vse pravice, ki so navedene v Zakonu o varstvu potro\u0161nikov, v skladu z ZVOP-1. Ve\u010D na to temo si lahko preberete na strani "),S(66,"a",2),A(67,"Zasebnost in pi\u0161kotki"),E(),A(68,"."),E(),Z(69,"br"),S(70,"h2",3),A(71,"POGOJI UPORABE SPLETNE TRGOVINE"),E(),Z(72,"br"),S(73,"h3"),A(74,"ODDAJA NARO\u010CILA:"),E(),Z(75,"br"),S(76,"p"),A(77,"Ko kupec oz. uporabik izbere blago ter odda naro\u010Dilo, prejme na elektronski naslov (vpisan ob oddaji naro\u010Dila ali registraciji v sistem) potrditveno elektronsko sporo\u010Dilo o statusu naro\u010Dila. Od tistega trenutka dalje je kupoprodajna pogodba med ponudnikom in kupcem sklenjena, s tem pa so fiksni tudi vsi pogoji, podatki in cene."),E(),S(78,"p"),A(79,"Nakup oz. oddaja naro\u010Dila za pravne osebe preko spletne strani ni mogo\u010Da. V primeru, da bi pravna oseba \u017Eelela naro\u010Diti blago, naj preko elektronske po\u0161te kontaktira ponudnika."),E(),S(80,"h3"),A(81,"PLA\u010CILO BLAGA:"),E(),Z(82,"br"),S(83,"p"),A(84,"Pla\u010Dilo blaga je mogo\u010De le po predra\u010Dunu, z nakazilom na transakcijski ra\u010Dun ponudnika. Ponudnik bo naro\u010Deno blago poslal v nadaljnjo obdelavo po prejemu pla\u010Dila, o \u010Demer bo kupec tudi obve\u0161\u010Den po elektronski po\u0161ti."),E(),S(85,"p"),A(86,"Podatki za nakazilo:"),E(),A(87," AIDI d.o.o., Zatolmin 64d, 5220 Tolmin"),Z(88,"br"),S(89,"b"),A(90,"TRR:"),E(),A(91," SI56 3300 0000 2475 625, Addiko Bank d.d."),Z(92,"br"),S(93,"b"),A(94,"SWIFT:"),E(),A(95," HAABSI22"),Z(96,"br"),S(97,"b"),A(98,"Sklic:"),E(),A(99," navedite sklic, ki ga najdete na predra\u010Dunu (pod tabelo artiklov)."),Z(100,"br")(101,"br"),S(102,"h3"),A(103,"CENE:"),E(),Z(104,"br"),S(105,"p"),A(106,"Vse cene so izra\u01
13267Eene v evrih. Veljajo cene, ki so dolo\u010Dene na dan naro\u010Dila. V vse cene je vklju\u010Den 22 % DDV. V ceno blaga niso vklju\u010Deni stro\u0161ki po\u0161tnine. Le-ti se zara\u010Dunajo dodatno in zna\u0161ajo 3 \u20AC."),E(),S(107,"h3"),A(108,"RA\u010CUN:"),E(),Z(109,"br"),S(110,"p"),A(111,"Kupec ob dostavi blaga prejme originalen ra\u010Dun, kateri se \u0161teje kot veljaven."),E(),S(112,"h3"),A(113,"POSTOPEK OBVE\u0160\u010CANJA O NAKUPU:"),E(),Z(114,"br"),S(115,"p"),A(116,"Ko bo kupec oz. uporabnik na spletnih mestih mountainsgeek.com oddal naro\u010Dilo, mu bo ponudnik na elektronski naslov poslal potrditev naro\u010Dila s predra\u010Dunom, ki ga mora kupec pla\u010Dati, \u010De \u017Eeli, da gre njegovo naro\u010Dilo v nadaljnjo obdelavo."),E(),S(117,"p"),A(118,"Po pla\u010Dilu predra\u010Duna bo ponudnik kupcu na elektronski naslov poslal potrdilo o prejemu pla\u010Dila in oddaji naro\u010Dila v nadaljnjo obdelavo."),E(),S(119,"p"),A(120,"Ko bo ponudnik naro\u010Deno blago poslal, bo kupcu na elektronski naslov poslal obvestilo o oddani po\u0161iljki, skupaj s sledilno \u0161tevilko."),E(),S(121,"h3"),A(122,"DOSTAVA BLAGA:"),E(),Z(123,"br"),S(124,"p"),A(125,"Ponudnik za dostavo blaga uporablja Po\u0161to Slovenije."),E(),S(126,"p"),A(127,"Ponudnik bo naredil vse, da bo blago odposlano najkasneje v dveh delovnih dneh po prejemu pla\u010Dila na TRR. V primeru zamude bo ponudnik kupca o tem obvestil."),E(),S(128,"h3"),A(129,"GARANCIJA:"),E(),Z(130,"br"),S(131,"p"),A(132,"Blago nima garancije."),E(),Z(133,"br"),S(134,"h2",3),A(135,"POGOJI UPORABE SPLETNIH STRANI"),E(),Z(136,"br"),S(137,"p"),A(138,"Vsa vsebina na spletnih straneh Mountainsgeek.com je avtorsko za\u0161\u010Ditena in jo je prepovedano uporabljati brez dovoljenja avtorja."),E(),S(139,"p"),A(140,"Namen spletnih strani je podati \u010Dim ve\u010D podatkov, povezanih s hribi in pohodni\u0161tvom, na enem mestu. Vsebino lahko dodajajo vsi registrirani uporabniki. Objavljena vsebina je po odobritvi administratorja dostopna vsem obiskovalcem."),E(),S(141,"p"),A(142,"Vsak posamezni uporabnik z vpisom kateregakoli podatka na spletno stran, jam\u010Di, da so vse vsebine njegova last ter jih ni kopiral ali vzel od tretje osebe. Zato ekipa Mountains Geek ne bo preverjala lastni\u0161tva podatkov, saj za objavljeno tujo vsebino odgovarja uporabnik, kateri je vsebino objavil, sam. Prav tako uporabnik odgovarja za vne\u0161eno vsebino sam. Nobena informacija, podana na spletnih mestih, ni strokovno preverjena, pa\u010D pa je le informativne narave, zato ponudnik ne odgovarja za kakr\u0161nokoli po\u0161kodbo ali nesre\u010Do, nastalo zaradi podanih informacij."),E(),S(143,"p"),A(144,"Vsako objavo bo ekipa Mountains Geek preverila ali je ustrezna ter v primeru ugotovitve neustreznosti ustrezno ukrepala. In sicer, uporabnika bo ekipa obvestila o napaki ter mu omogo\u010Dila, da jo odpravi. V primeru, da uporabnik napako odpravi, mu bo ekipa objavljeno vsebino odobrila in le-ta se bo pojavila na spletni strani. V primeru, da uporabnik napake ne odpravi, vsebina ne bo odobrena in posledi\u010Dno ne bo prikazana na spletni strani. Ponudnik si tudi pridr\u017Euje pravico, da katerokoli objavo iz spletnih mest izbri\u0161e in/ali kateremukoli uporabniku onemogo\u010Di objavljanje vsebin. \u010Ce \u017Eeli uporabnik svojo vsebino izbrisati iz spletnih mest, mora za to kontaktirati ponudnika, le-ta pa bo vsebino izbrisal po lastni presoji."),E(),S(145,"p"),A(146,"Za kakr\u0161nakoli dodatna pojasnila in navodila v povezavi s spletno stranjo, je ekipa Mountains Geek na voljo na elektronskem naslovu [email protected]"),E(),S(147,"p"),A(148,"Pogoji veljajo od 1.5.2019"),E()())}});let i=e;return i})();var wK=new Ct("recaptcha-language"),CK=new Ct("recaptcha-base-url"),EK=new Ct("recaptcha-nonce-tag"),SK=new Ct("recaptcha-settings"),TK=new Ct("recaptcha-v3-site-key"),IK=new Ct("recaptcha-loader-options");function DK(i,e,r,{url:t,lang:o,nonce:n}={}){window.ng2recaptchaloaded=()=>{r(grecaptcha)};let d=document.createElement("script");d.innerHTML="";let{url:_,nonce:C}=e(new URL(t||"https://www.google.com/recaptcha/api.js"));_.searchParams.set("render",i==="explicit"?i:i.key),_.searchParams.set("onload","ng2recaptchaloaded"),_.searchParams.set("trustedtypes","true"),o&&_.searchParams.set("hl",o),d.src=_.href;let M=C||n;M&&d.setAttribute("nonce",M),d.async=!0,d.defer=!0,document.head.appendChild(d)}function MK({v3SiteKey:i,onBeforeLoad:e,onLoaded:r}){let t=i?{key:i}:"explicit";N3.loadScript(t,e,r)}var N3={loadScript:DK,newLoadScript:MK};function kK(i){return i.asObservable().pipe(dn(e=>e!==null))}var z3=(()=>{let e=class e{constructor(t,o,n,d,_,C){this.platformId=t,this.language=o,this.baseUrl=n,this.nonce=d,this.v3SiteKey=_,this.options=C;let M=this.init();this.ready=M?kK(M):Bt()}init(){if(e.ready)return e.ready;if(!Si(this.platformId))return;let t=new Cr(null);return e.ready=t,N3.newLoadScript({v3SiteKey:this.v3SiteKey,onBeforeLoad:o=>
1326{if(this.options?.onBeforeLoad)return this.options.onBeforeLoad(o);let n=new URL(this.baseUrl??o);return this.language&&n.searchParams.set("hl",this.language),{url:n,nonce:this.nonce}},onLoaded:o=>{let n=o;this.options?.onLoaded&&(n=this.options.onLoaded(o)),t.next(n)}}),t}};e.ready=null,e.\u0275fac=function(o){return new(o||e)(Ve(Qt),Ve(wK,8),Ve(CK,8),Ve(EK,8),Ve(TK,8),Ve(IK,8))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})(),AK=0,rh=(()=>{let e=class e{constructor(t,o,n,d){this.elementRef=t,this.loader=o,this.zone=n,this.id=`ngrecaptcha-${AK++}`,this.errorMode="default",this.resolved=new Fe,this.error=new Fe,this.errored=new Fe,d&&(this.siteKey=d.siteKey,this.theme=d.theme,this.type=d.type,this.size=d.size,this.badge=d.badge)}ngAfterViewInit(){this.subscription=this.loader.ready.subscribe(t=>{t!=null&&t.render instanceof Function&&(this.grecaptcha=t,this.renderRecaptcha())})}ngOnDestroy(){this.grecaptchaReset(),this.subscription&&this.subscription.unsubscribe()}execute(){this.size==="invisible"&&(this.widget!=null?this.grecaptcha.execute(this.widget):this.executeRequested=!0)}reset(){this.widget!=null&&(this.grecaptcha.getResponse(this.widget)&&this.resolved.emit(null),this.grecaptchaReset())}get __unsafe_widgetValue(){return this.widget!=null?this.grecaptcha.getResponse(this.widget):null}expired(){this.resolved.emit(null)}onError(t){this.error.emit(t),this.errored.emit(t)}captchaResponseCallback(t){this.resolved.emit(t)}grecaptchaReset(){this.widget!=null&&this.zone.runOutsideAngular(()=>this.grecaptcha.reset(this.widget))}renderRecaptcha(){let t={badge:this.badge,callback:o=>{this.zone.run(()=>this.captchaResponseCallback(o))},"expired-callback":()=>{this.zone.run(()=>this.expired())},sitekey:this.siteKey,size:this.size,tabindex:this.tabIndex,theme:this.theme,type:this.type};this.errorMode==="handled"&&(t["error-callback"]=(...o)=>{this.zone.run(()=>this.onError(o))}),this.widget=this.grecaptcha.render(this.elementRef.nativeElement,t),this.executeRequested===!0&&(this.executeRequested=!1,this.execute())}};e.\u0275fac=function(o){return new(o||e)(ae(Pi),ae(z3),ae(qt),ae(SK,8))},e.\u0275cmp=st({type:e,selectors:[["re-captcha"]],hostVars:1,hostBindings:function(o,n){o&2&&Bn("id",n.id)},inputs:{id:"id",siteKey:"siteKey",theme:"theme",type:"type",size:"size",tabIndex:"tabIndex",badge:"badge",errorMode:"errorMode"},outputs:{resolved:"resolved",error:"error",errored:"errored"},exportAs:["reCaptcha"],decls:0,vars:0,template:function(o,n){},encapsulation:2});let i=e;return i})(),j3=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({});let i=e;return i})(),Pf=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({providers:[z3],imports:[j3]});let i=e;return i})();var Of=(()=>{let e=class e{constructor(t){this.host=t,this.requiresControllerReset=!1}writeValue(t){t?this.host.__unsafe_widgetValue!==t&&!this.host.__unsafe_widgetValue&&(this.requiresControllerReset=!0):this.host.reset()}registerOnChange(t){this.onChange=t,this.requiresControllerReset&&(this.requiresControllerReset=!1,this.onChange(null))}registerOnTouched(t){this.onTouched=t}onResolve(t){this.onChange&&this.onChange(t),this.onTouched&&this.onTouched()}};e.\u0275fac=function(o){return new(o||e)(ae(rh))},e.\u0275dir=bi({type:e,selectors:[["re-captcha","formControlName",""],["re-captcha","formControl",""],["re-captcha","ngModel",""]],hostBindings:function(o,n){o&1&&se("resolved",function(_){return n.onResolve(_)})},features:[It([{multi:!0,provide:Qs,useExisting:Jr(()=>e)}])]});let i=e;return i})(),Rf=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({imports:[Nr,j3]});let i=e;return i})();var Lf=(()=>{let e=class e{constructor(t){this.http=t,this.errorMessages=null,this.successMessages=null,this.errorUpdated=new Fe,this.successUpdated=new Fe,this.headers=new Qn({"Content-Type":"application/json"})}getErrorMessage(){return this.errorMessages}setErrorMessage(t){this.errorMessages=t,this.errorUpdated.emit(this.errorMessages)}
1326setSuccessMessage(t){this.successMessages=t,this.successUpdated.emit(this.successMessages)}sendContactEmail(t){return this.http.post("/emailing/contact/",t,{headers:this.headers})}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();function PK(i,e){i&1&&(S(0,"div",23),A(1," Va\u0161e sporo\u010Dilo je uspe\u0161no poslano. "),E())}function OK(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function RK(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=q(3);P(1),mt(r.errorMessages==null?null:r.errorMessages.detail)}}function LK(i,e){if(i&1&&(S(0,"div",24),A(1," Error messages: "),S(2,"ul"),ce(3,OK,2,1,"li",25)(4,RK,2,1,"li",26),E()()),i&2){let r=q(2);P(3),N("ngForOf",r.errorMessages==null?null:r.errorMessages.non_field_errors),P(1),N("ngIf",r.errorMessages==null?null:r.errorMessages.detail)}}function FK(i,e){if(i&1&&(S(0,"div",24),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages==null?null:r.errorMessages.first_name[0]," ")}}function NK(i,e){if(i&1&&(S(0,"div",24),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages==null?null:r.errorMessages.last_name[0]," ")}}function zK(i,e){if(i&1&&(S(0,"div",24),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages==null?null:r.errorMessages.email[0]," ")}}function jK(i,e){if(i&1&&(S(0,"div",24),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages==null?null:r.errorMessages.subject[0]," ")}}function VK(i,e){if(i&1&&(S(0,"div",24),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages==null?null:r.errorMessages.message[0]," ")}}function BK(i,e){if(i&1){let r=Ge();S(0,"re-captcha",27),se("resolved",function(o){Se(r);let n=q(2);return Te(n.resolved(o))}),E()}if(i&2){let r=q(2);Hi("siteKey",r.siteKey)}}function UK(i,e){if(i&1&&(S(0,"div",24),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages==null?null:r.errorMessages.recaptcha," ")}}function HK(i,e){if(i&1){let r=Ge();S(0,"div",2)(1,"div",3)(2,"form",4),se("ngSubmit",function(){Se(r);let o=q();return Te(o.onSubmit(o.contactForm.value))}),S(3,"h2"),A(4,"Kontaktirajte nas"),E(),Z(5,"br"),S(6,"p"),A(7," V kolikor imate kakr\u0161nakoli vpra\u0161anja lahko stopite z nami v stik s pomo\u010Djo spodnjega obrazca, ali pa nas kontaktirate na email "),S(8,"a",5),A(9,"[email protected]"),E(),A(10,". "),E(),Z(11,"br"),ce(12,PK,2,0,"div",6)(13,LK,5,2,"div",7),S(14,"div",8)(15,"label",9),A(16,"Ime"),E(),Z(17,"input",10),ce(18,FK,2,1,"div",7),E(),S(19,"div",8)(20,"label",11),A(21,"Priimek"),E(),Z(22,"input",12),ce(23,NK,2,1,"div",7),E(),S(24,"div",8)(25,"label",13),A(26,"E-naslov"),E(),Z(27,"input",14),ce(28,zK,2,1,"div",7),E(),S(29,"div",8)(30,"label",15),A(31,"Zadeva"),E(),Z(32,"input",16),ce(33,jK,2,1,"div",7),E(),S(34,"div",8)(35,"label",17),A(36,"Sporo\u010Dilo"),E(),Z(37,"textarea",18),ce(38,VK,2,1,"div",7),E(),ce(39,BK,1,1,"re-captcha",19)(40,UK,2,1,"div",7),Z(41,"br"),S(42,"a",20)(43,"button",21),A(44," Prekli\u010Di "),E()(),S(45,"button",22),A(46,"Po\u0161lji"),E()()()()}if(i&2){let r=q();P(2),N("formGroup",r.contactForm),P(10),N("ngIf",r.success),P(1),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&((r.errorMessages==null?null:r.errorMessages.non_field_errors)!==void 0||(r.errorMessages==null?null:r.errorMessages.detail)!==void 0)),P(5),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.first_name)!==void 0),P(5),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.last_name)!==void 0),P(5),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.email)!==void 0),P(5),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.subject)!==void 0),P(5),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.message)!==void 0),P(1),N("ngIf",r.windowDefined),P(1),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.recaptcha)!==void 0)}}var B3=(()=>{let e=class e{constructor(t,o){this.messageService=t,this.formBuilder=o,this.loader=!1,this.contactForm=null,this.success=null,this.captchaResponse=null,this.windowDefined=!1,this.siteKey=ss.captchaKey}onSubmit(t){this.captchaResponse!=null?(this.loader=!0,t.captcha=this.captchaResponse,this.messageService.sendContactEmail(t).subscribe(o=>{this.contactForm.reset(),this.success=!0,this.errorMessages=null,this.loader=!1},o=>{this.errorMessages=o.error,this.loader=!1})):this.errorMessages={recaptcha:"Prosimo, potrdite da niste robot!"}}ngOnInit(){typeof window<"u"&&(this.windowDefined=!0),this.success=!1,this.contactForm=this.formBuilder.group({first_name:["",Wt.required],last_name:["",Wt.required],email:["",Wt.required],subject:["",Wt.required],message:["",Wt.required],recaptcha:["",Wt.required]})}resolved(t){this.captchaResponse=t}};e.\u0275fac=function(o){return new(o||e)(ae(Lf),ae(ro))},e.\u0275cmp=st({type:e,selectors:[["app-contact-form"]],standalone:!0,features:[gt],decls:3,vars:4,consts:[["src","/assets/images/loader.gif"],["class","center-box",4,"ngIf"],[1,"center-box"],[1,"center-box-inner"],[3,"formGroup","ngSubmit"],["href","mailto: [email protected]"],["class","success-message margin-10-bottom",4,"ngIf"],["class","error-message",4,"ngIf"],[1,"form-field"],["for","first_name"],["type","text","id","first_name","name","first_name","formControlName","first_name",1,"form-control"],["for","last_name"],["type","text","id","last_name","name","last_name","formControlName","last_name",1,"form-control"],["for","email"],["type","email","id","email","name","email","formControlName","email",1,"form-control"],["for","subject"],["type","text","id","subject","name","subject","formControlName","subject",1,"form-control"],["for","message"],["id","message","name","message","formControlName","message","rows","10",1,"form-control"],["formControlName","recaptcha",3,"siteKey","resolved",4,"ngIf"],["routerLink","/",2,"text-decoration","none"],["type","button",1,"btn","btn-sm","btn-default"],["type","submit",1,"btn","btn-sm","btn-primary","float-right"],[1,"success-message","margin-10-bottom"],[1,"error-message"],[4,"ngFor","ngForOf"],[4,"ngIf"],["formControlName","recaptcha",3,"siteKey","resolved"]],template:function(o,n){o&1&&(S(0,"div"),Z(1,"img",0),E(),ce(2,HK,47,10,"div",1)),o&2&&(ki("",n.loader?"":"hidden"," loader center-text margin-5"),P(2),N("ngIf",!n.loader))},dependencies:[Nr,no,Fr,to,io,oo,qr,Wr,Pf,rh,Rf,Of,Dt,ti,At,qi]});let i=e;return i})();var $K=["recaptcha"];function GK(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function qK(i,e){if(i&1&&(S(0,"div",12),A(1," Error messages: "),S(2,"ul"),ce(3,GK,2,1,"li",13),E()()),i&2){let r=q();P(3),N("ngForOf",r.errorMessages.non_field_errors)}}function WK(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function ZK(i,e){if(i&1&&(S(0,"div",12),A(1," Uporabni\u0161ko ime / E-mail: "),S(2,"ul"),ce(3,WK,2,1,"li",13),E()()),i&2){let r=q();P(3),N("ngForOf",r.errorMessages==null?null:r.errorMessages.email_or_username)}}function KK(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function XK(i,e){if(i&1&&(S(0,"div",12),A(1," Geslo: "),S(2,"ul"),ce(3,KK,2,1,"li",13),E()()),i&2){let r=q();P(3),N("ngForOf",r.errorMessages.password)}}function YK(i,e){if(i&1){let r=Ge();S(0,"re-captcha",14,15),se("resolved",function(o){Se(r);let n=q();return Te(n.resolved(o))}),E()}if(i&2){let r=q();Hi("siteKey",r.siteKey)}}function QK(i,e){if(i&1&&(S(0,"div",12),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages.recaptcha," ")}}var NI=(()=>{let e=class e{constructor(t,o,n,d){this._userService=t,this._formBuilder=o,this._router=n,this.route=d,this.loginForm=null,this.jwtHelper=new yl,this.captchaResponse=null,this.windowDefined=!1,this.redirectUrl=null,this.siteKey=ss.captchaKey}onSubmit(t){this.captchaResponse!=null?this._userService.login(t.username_or_email,t.password,this.captchaResponse).subscribe(o=>{let n=o;if(n&&n.access){let d=this.jwtHelper.decodeToken(n.access),_=d.user_id,C=d.email,M=d.username,j=d.email_confirmed,G=d.ads_enabled,ie=d.stories_enabled;localStorage.setItem("username",M),localStorage.setItem("userID",_),localStorage.setItem("email",C),localStorage.setItem("token",n.access),localStorage.setItem("refresh_token",n.refresh),localStorage.setItem("email_confirmed",j),localStorage.setItem("ads_enabled",G),localStorage.setItem("stories_enabled",ie)}this.redirectUrl?this._router.navigate([this.redirectUrl]):this._router.navigate(["/"])},o=>{this.errorMessages=o.error,this.recaptcha.reset()}):this.errorMessages={recaptcha:"Prosimo, potrdite da niste robot!"}}ngOnInit(){typeof window<"u"&&(this.windowDefined=!0),this.route.params.subscribe(t=>{this.redirectUrl=t.redirect_url}),this.loginForm=this._formBuilder.group({username_or_email:["",Wt.required],password:["",Wt.required],recaptcha:["",Wt.required]})}resolved(t){this.captchaResponse=t}};e.\u0275fac=function(o){return new(o||e)(ae(Ti),ae(ro),ae(si),ae(Gi))},e.\u0275cmp=st({type:e,selectors:[["app-login"]],viewQuery:function(o,n){if(o&1&&ni($K,5),o&2){let d;Xt(d=Yt())&&(n.recaptcha=d.first)}},standalone:!0,features:[It([Ti]),gt],decls:25,vars:6,consts:[[1,"auth-shell"],[1,"auth-card"],[3,"formGroup","ngSubmit"],["class","error-message",4,"ngIf"],[1,"form-field"],["formControlName","username_or_email","type","text","name","username_or_email","value","","placeholder","Vnesite va\u0161 e-mail oz. uporabni\u0161ko ime.",1,"form-control"],["formControlName","password","type","password","name","password","value","","placeholder","Vnesite va\u0161e geslo.",1,"form-control"],["formControlName","recaptcha",3,"siteKey","resolved",4,"ngIf"],[1,"btn","btn-primary","btn-pill","auth-submit"],[1,"auth-links"],["routerLink","/register"],["routerLink","/password_recovery"],[1,"error-message"],[4,"ngFor","ngForOf"],["formControlName","recaptcha",3,"siteKey","resolved"],["recaptcha",""]],template:function(o,n){o&1&&(S(0,"div",0)(1,"div",1)(2,"form",2),se("ngSubmit",function(){return n.onSubmit(n.loginForm.value)}),S(3,"h2"),A(4,"Vpis"),E(),ce(5,qK,4,1,"div",3),S(6,"div",4)(7,"label"),A(8,"Uporabni\u0161ko ime / E-mail"),E(),Z(9,"input",5),ce(10,ZK,4,1,"div",3),E(),S(11,"div",4)(12,"label"),A(13,"Geslo"),E(),Z(14,"input",6),ce(15,XK,4,1,"div",3),E(),ce(16,YK,2,1,"re-captcha",7)(17,QK,2,1,"div",3),S(18,"button",8),A(19,"Potrdi"),E(),S(20,"div",9)(21,"a",10),A(22,"Registracija \xBB"),E(),S(23,"a",11),A(24,"Pozabljeno geslo?"),E()()()()()),o&2&&(P(2),N("formGroup",n.loginForm),P(3),N("ngIf",n.errorMessages!==void 0&&n.errorMessages.non_field_errors!==void 0),P(5),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.email_or_username)!==void 0||n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.email_or_username)!==void 0),P(5),N("ngIf",n.errorMessages!==void 0&&n.errorMessages.password!==void 0),P(1),N("ngIf",n.windowDefined),P(1),N("ngIf",n.errorMessages!==void 0&&n.errorMessages.recaptcha!==void 0))},dependencies:[Nr,no,Fr,to,io,oo,qr,Wr,Dt,ti,At,Pf,rh,Rf,Of,qi]});let i=e;return i})();function JK(i,e){i&1&&(S(0,"div"),Z(1,"img",2),E())}function eX(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function tX(i,e){if(i&1&&(S(0,"div",25),A(1," Error messages: "),S(2,"ul"),ce(3,eX,2,1,"li",26),E()()),i&2){let r=q(2);P(3),N("ngForOf",r.errorMessages.non_field_errors)}}function iX(i,e){if(i&1&&(S(0,"div",25),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.username[0]," ")}}function nX(i,e){if(i&1&&(S(0,"div",25),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.email[0]," ")}}function rX(i,e){if(i&1&&(S(0,"div",25),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.email2[0]," ")}}function oX(i,e){if(i&1&&(S(0,"div",25),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.password[0]," ")}}function sX(i,e){if(i&1&&(S(0,"div",25),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.password2[0]," ")}}function aX(i,e){if(i&1&&(S(0,"div",25),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.accepted_terms_of_use[0]," ")}}function lX(i,e){if(i&1){let r=Ge();S(0,"re-captcha",27,28),se("resolved",function(o){Se(r);let n=q(2);return Te(n.resolved(o))}),E()}if(i&2){let r=q(2);Hi("siteKey",r.siteKey)}}function cX(i,e){if(i&1&&(S(0,"div",25),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages==null?null:r.errorMessages.recaptcha," ")}}function uX(i,e){if(i&1){let r=Ge();S(0,"div",3)(1,"div",4)(2,"form",5),se("ngSubmit",function(){Se(r);let o=q();return Te(o.onSubmit(o.registerForm.value))}),S(3,"h2"),A(4,"Registracija"),E(),ce(5,tX,4,1,"div",6),S(6,"div",7)(7,"label"),A(8,"Uporabni\u0161ko ime"),E(),Z(9,"input",8),ce(10,iX,2,1,"div",6),E(),S(11,"div",9)(12,"div",7)(13,"label"),A(14,"E-mail"),E(),Z(15,"input",10),ce(16,nX,2,1,"div",6),E(),S(17,"div",7)(18,"label"),A(19,"Potrdi e-mail"),E(),Z(20,"input",11),ce(21,rX,2,1,"div",6),E()(),S(22,"div",9)(23,"div",7)(24,"label"),A(25,"Geslo"),E(),Z(26,"input",12),ce(27,oX,2,1,"div",6),E(),S(28,"div",7)(29,"label"),A(30,"Potrdi geslo"),E(),Z(31,"input",13),ce(32,sX,2,1,"div",6),E()(),S(33,"div",14)(34,"label",15),Z(35,"input",16),A(36," prebral sem in sprejemam "),S(37,"a",17),A(38,"pogoje poslovanja"),E(),A(39,". "),E(),ce(40,aX,2,1,"div",6),S(41,"p",18),A(42,"Dovoljujem uporabo osebnih podatkov za:"),E(),S(43,"label",15),Z(44,"input",19),A(45," po\u0161iljanje e-obvestil z raznimi novicami, ki se navezujejo na Mountains Geek ponudbo in storitve "),E(),S(46,"label",15),Z(47,"input",20),A(48," spletno ogla\u0161evanje "),E()(),ce(49,lX,2,1,"re-captcha",21)(50,cX,2,1,"div",6),S(51,"button",22),A(52,"Potrdi"),E(),S(53,"div",23)(54,"a",24),A(55,"Vpis \xBB"),E()()()()()}if(i&2){let r=q();P(2),N("formGroup",r.registerForm),P(3),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.non_field_errors!==void 0),P(5),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.username!==void 0),P(6),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.email!==void 0),P(5),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.email2!==void 0),P(6),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.password!==void 0),P(5),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.password2!==void 0),P(8),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.accepted_terms_of_use!==void 0),P(9),N("ngIf",r.isBrowser),P(1),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.recaptcha)!==void 0)}}var U3=(()=>{let e=class e{constructor(t,o,n,d){this.platformId=t,this._userService=o,this._formBuilder=n,this._router=d,this.registerForm=null,this.jwtHelper=new yl,this.loader=!1,this.captchaResponse=null,this.isBrowser=!1,this.siteKey=ss.captchaKey}onSubmit(t){if(this.captchaResponse!=null){let o=this._router;this.loader=!0,t.captcha=this.captchaResponse,this._userService.register(t).subscribe(n=>{let d=n;if(d&&d.token){let _=this.jwtHelper.decodeToken(d.token),C=_.user_id,M=_.email,j=_.username;localStorage.setItem("username",j),localStorage.setItem("userID",C),localStorage.setItem("email",M),localStorage.setItem("token",d.token)}o.navigate(["/profile"])},n=>{this.loader=!1,this.errorMessages=n.error})}else this.errorMessages={recaptcha:"Prosimo, potrdite da niste robot!"}}ngOnInit(){this.isBrowser=Si(this.platformId),this.registerForm=this._formBuilder.group({username:["",Wt.required],email:["",Wt.required],email2:["",Wt.required],password:["",Wt.required],password2:["",Wt.required],accepted_terms_of_use:[!1,Wt.required],allow_notifications:[!1,Wt.required],allow_online_advertising:[!1,Wt.required],recaptcha:["",Wt.required]})}resolved(t){this.captchaResponse=t}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(Ti),ae(ro),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-register"]],standalone:!0,features:[It([Ti]),gt],decls:2,vars:2,consts:[[4,"ngIf"],["class","auth-shell",4,"ngIf"],["src","/assets/images/loader.gif",1,"mobile-100-percent-width"],[1,"auth-shell"],[1,"auth-card","auth-card-wide"],[3,"formGroup","ngSubmit"],["class","error-message",4,"ngIf"],[1,"form-field"],["formControlName","username","type","text","name","username","value","",1,"form-control"],[1,"form-row"],["formControlName","email","type","text","name","email","value","",1,"form-control"],["formControlName","email2","type","text","name","email2"
1326,"value","",1,"form-control"],["formControlName","password","type","password","name","password","value","",1,"form-control"],["formControlName","password2","type","password","name","password2","value","",1,"form-control"],[1,"auth-checkbox-group"],[1,"auth-checkbox"],["type","checkbox","formControlName","accepted_terms_of_use","name","accepted_terms_of_use","value","True"],["routerLink","/terms_of_use"],[1,"auth-checkbox-group-title"],["type","checkbox","formControlName","allow_notifications","name","allow_notifications","value","True"],["type","checkbox","formControlName","allow_online_advertising","name","allow_online_advertising","value","True"],["formControlName","recaptcha",3,"siteKey","resolved",4,"ngIf"],[1,"btn","btn-primary","btn-pill","auth-submit"],[1,"auth-links"],["routerLink","/login"],[1,"error-message"],[4,"ngFor","ngForOf"],["formControlName","recaptcha",3,"siteKey","resolved"],["recaptcha",""]],template:function(o,n){o&1&&ce(0,JK,2,0,"div",0)(1,uX,56,10,"div",1),o&2&&(N("ngIf",n.loader),P(1),N("ngIf",!n.loader))},dependencies:[Dt,ti,At,Nr,no,Fr,$_,to,io,oo,qr,Wr,Pf,rh,Rf,Of,qi]});let i=e;return i})();function dX(i,e){i&1&&(S(0,"div",13),A(1," Na va\u0161 e-naslov smo vam poslali sporo\u010Dilo s povezavo za obnovitev gesla. "),E())}function hX(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function pX(i,e){if(i&1&&(S(0,"div",14),A(1," Error messages: "),S(2,"ul"),ce(3,hX,2,1,"li",15),E()()),i&2){let r=q(2);P(3),N("ngForOf",r.errorMessages==null?null:r.errorMessages.non_field_errors)}}function fX(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function mX(i,e){if(i&1&&(S(0,"div",16),A(1," Uporabni\u0161ko ime / E-mail: "),S(2,"ul"),ce(3,fX,2,1,"li",15),E()()),i&2){let r=q(2);P(3),N("ngForOf",r.errorMessages==null?null:r.errorMessages.email)}}function gX(i,e){if(i&1){let r=Ge();S(0,"div",2)(1,"div",3)(2,"form",4),se("ngSubmit",function(){Se(r);let o=q();return Te(o.onSubmitReq(o.passwordRecoveryForm.value))}),S(3,"h2"),A(4,"Obnova prijavnih podatkov"),E(),ce(5,dX,2,0,"div",5)(6,pX,4,1,"div",6),S(7,"p"),A(8," Vnesite uporabni\u0161ko ime ali e-naslov in na va\u0161 e-naslov vam bomo poslali sporo\u010Dilo s povezavo za obnovitev gesla. "),E(),S(9,"div",7)(10,"label"),A(11,"Uporabni\u0161ko ime / E-mail"),E(),Z(12,"input",8),ce(13,mX,4,1,"div",9),E(),S(14,"button",10),A(15,"Potrdi"),E(),S(16,"div",11)(17,"a",12),A(18,"Vpis \xBB"),E()()()()()}if(i&2){let r=q();P(2),N("formGroup",r.passwordRecoveryForm),P(3),N("ngIf",r.success),P(1),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.non_field_errors)!==void 0),P(7),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.username)!==void 0||r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.email)!==void 0)}}function _X(i,e){i&1&&(S(0,"div",13),A(1," Va\u0161e geslo je uspe\u0161no posodobljeno. "),E())}function vX(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function yX(i,e){if(i&1&&(S(0,"div",14),A(1," Error messages: "),S(2,"ul"),ce(3,vX,2,1,"li",15),E()()),i&2){let r=q(2);P(3),N("ngForOf",r.errorMessages==null?null:r.errorMessages.non_field_errors)}}function bX(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function xX(i,e){if(i&1&&(S(0,"div",14),A(1," Error messages: "),S(2,"ul"),ce(3,bX,2,1,"li",15),E()()),i&2){let r=q(2);P(3),N("ngForOf",r.errorMessages==null?null:r.errorMessages.password_recovery_key)}}function wX(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function CX(i,e){if(i&1&&(S(0,"div",16),A(1," Geslo: "),S(2,"ul"),ce(3,wX,2,1,"li",15),E()()),i&2){let r=q(2);P(3),N("ngForOf",r.errorMessages==null?null:r.errorMessages.password)}}function EX(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function SX(i,e){if(i&1&&(S(0,"div",16),A(1," Geslo: "),S(2,"ul"),ce(3,EX,2,1,"li",15),E()()),i&2){let r=q(2);P(3),N("ngForOf",r.errorMessages==null?null:r.errorMessages.password_submit)}}function TX(i,e){if(i&1){let r=Ge();S(0,"div",2)(1,"div",3)(2,"form",4),se("ngSubmit",function(){Se(r);let o=q();return Te(o.onSubmitFin(o.passwordRecoveryFormFin.value))}),S(3,"h2"),A(4,"Obnova prijavnih podatkov"),E(),ce(5,_X,2,0,"div",5)(6,yX,4,1,"div",6)(7,xX,4,1,"div",6),S(8,"div",7)(9,"label",17),A(10,"Geslo"),E(),Z(11,"input",18),ce(12,CX,4,1,"div",9),E(),S(13,"div",7)(14,"label",19),A(15,"Ponovi geslo"),E(),Z(16,"input",20),ce(17,SX,4,1,"div",9),E(),S(18,"button",21),A(19,"Potrdi"),E()()()()}if(i&2){let r=q();P(2),N("formGroup",r.passwordRecoveryFormFin),P(3),N("ngIf",r.success),P(1),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.non_field_errors)!==void 0),P(1),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.password_recovery_key)!==void 0),P(5),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.password)!==void 0),P(5),N("ngIf",r.errorMessages!==null&&r.errorMessages!==void 0&&(r.errorMessages==null?null:r.errorMessages.password_submit)!==void 0)}}var zI=(()=>{let e=class e{constructor(t,o,n){this.formBuilder=t,this.userService=o,this.route=n,this.passwordRecoveryForm=null,this.passwordRecoveryFormFin=null,this.success=!1,this.loader=!1,this.id=null,this.recoveryKey=null}onSubmitReq(t){this.loader=!0,this.userService.password_recovery_request(t.username_or_email).subscribe(o=>{this.errorMessages=null,this.success=!0,this.loader=!1},o=>{this.success=!1,this.errorMessages=o.error,this.loader=!1})}onSubmitFin(t){this.loader=!0,t.password_recovery_key=this.recoveryKey,this.userService.password_recovery(this.id,t).subscribe(o=>{this.errorMessages=null,this.success=!0,this.loader=!1},o=>{this.success=!1,this.errorMessages=o.error,this.loader=!1})}ngOnInit(){this.success=!1,this.errorMessages=null,this.id=null,this.recoveryKey=null,this.passwordRecoveryForm=this.formBuilder.group({username_or_email:["",Wt.required]}),this.sub=this.route.params.subscribe(t=>{this.id=+t.id,this.recoveryKey=t.recovery_key,this.passwordRecoveryFormFin=this.formBuilder.group({password:["",Wt.required],password_submit:["",Wt.required]})})}};e.\u0275fac=function(o){return new(o||e)(ae(ro),ae(Ti),ae(Gi))},e.\u0275cmp=st({type:e,selectors:[["app-password-recovery"]],standalone:!0,features:[It([Ti]),gt],decls:4,vars:5,consts:[["src","/assets/images/loader.gif",1,"mobile-100-percent-width"],["class","auth-shell",4,"ngIf"],[1,"auth-shell"],[1,"auth-card"],[3,"formGroup","ngSubmit"],["class","success-message margin-10-bottom",4,"ngIf"],["class","error-message margin-10-bottom",4,"ngIf"],[1,"form-field"],["formControlName","username_or_email","type","text","name","username_or_email","value","","placeholder","Vnesite va\u0161 e-mail oz. uporabni\u0161ko ime.",1,"form-control"],["class","error-message",4,"ngIf"],["type","submit",1,"btn","btn-primary","btn-pill","auth-submit"],[1,"auth-links"],["routerLink","/login"],[1,"success-message","margin-10-bottom"],[1,"error-message","margin-10-bottom"],[4,"ngFor","ngForOf"],[1,"error-message"],["for","password"],["formControlName","password","type","password","id","password","name","password","value","","placeholder","Vnesite geslo.",1,"form-control"],["for","password_submit"],["formControlName","password_submit","type","password","id","password_submit","name","password","value","","placeholder","Ponovno vnesite geslo.",1,"form-control"],[1,"btn","btn-primary","btn-pill","auth-submit"]],template:function(o,n){o&1&&(S(0,"div"),Z(1,"img",0),E(),ce(2,gX,19,4,"div",1)(3,TX,20,6,"div",1)),o&2&&(ki("",n.loader?"":"hidden"," loader center-text margin-5"),P(2),N("ngIf",!n.loader&&!n.id),P(1),N("ngIf",!n.loader&&n.recoveryKey))},dependencies:[Nr,no,Fr,to,io,oo,qr,Wr,Dt,ti,At]});let i=e;return i})();var BN=mC(zx());function IX(i,e){i&1&&(S(0,"div",14),A(1,"Destinacije"),E())}function DX(i,e){if(i&1){let r=Ge();S(0,"div",15)(1,"input",16),se("keyup",function(o){Se(r);let n=q(2);return Te(n.search(o.target))}),E()()}}function MX(i,e){if(i&1){let r=Ge();S(0,"div",7),ce(1,IX,2,0,"div",8),S(2,"div",9),ce(3,DX,2,0,"div",10),S(4,"button",11),se("click",function(){Se(r);let o=q();return Te(o.changeOrdering())}
1326),A(5),E(),S(6,"button",12),se("click",function(){Se(r);let o=q();return Te(o.changeOrder())}),S(7,"span",13),A(8,"\u25BE"),E()()()()}if(i&2){let r=q();P(1),N("ngIf",r.showTitle),P(2),N("ngIf",r.showSearchInput),P(2),mt(r.orderOptions[r.ordering]),P(1),Bn("aria-label",r.order===""?"Nara\u0161\u010Dajo\u010De":"Padajo\u010De"),P(1),Yi("asc",r.order==="")}}function kX(i,e){if(i&1&&(S(0,"div"),A(1,"Za izbrane kriterije \u0161e ni vne\u0161enih destinacij."),E()),i&2){let r=q();ki("list-empty ",r.loader?"hidden":"","")}}function AX(i,e){if(i&1){let r=Ge();S(0,"div",21)(1,"div",22),se("click",function(){Se(r);let o=q().$implicit,n=q();return Te(n.destinationDetails(o.slug))}),A(2,"Odpri"),E(),S(3,"div",23),se("click",function(){Se(r);let o=q(2);return Te(o.actionSelect("show-connected-roads"))}),A(4,"Poka\u017Ei povezane poti"),E(),S(5,"div",23),se("click",function(){Se(r);let o=q(2);return Te(o.actionSelect("show-on-map"))}),A(6,"Poka\u017Ei na zemljevidu"),E()()}}function PX(i,e){if(i&1){let r=Ge();S(0,"div")(1,"div",17),se("dblclick",function(){let n=Se(r).$implicit,d=q();return Te(d.destinationDetails(n.slug))})("click",function(){let n=Se(r).$implicit,d=q();return Te(d.selectAction(n.id,n.slug))}),S(2,"div",18),A(3),E(),S(4,"div",19),A(5),E()(),ce(6,AX,7,0,"div",20),E()}if(i&2){let r=e.$implicit,t=q();P(1),Qp("",t.contentHidden?"hidden":""," destination-row ",r.id==t.selectedDestination?"active":"",""),Bn("data-destination-id",r.id),P(2),mt(r.title),P(2),We("",r.height," m"),P(1),N("ngIf",r.id==t.selectedDestination)}}function OX(i,e){if(i&1){let r=Ge();S(0,"div")(1,"a",24),se("click",function(){Se(r);let o=q();return Te(o.loadMore())}),A(2,"Nalo\u017Ei ve\u010D..."),E()()}}var Ff=(()=>{let e=class e{constructor(t,o,n,d,_,C,M,j){this.destinationService=t,this.userService=o,this.router=n,this.route=d,this.gpsService=_,this.lc=C,this.elRef=M,this.sub=null,this.loader=!1,this.contentHidden=!1,this.limit=40,this.offset=null,this.finished=!1,this.destinations=[],this.selectedDestination=null,this.order="-",this.ordering="height",this.orderOpt=["title","height","distance"],this.orderOptions={title:"ABC",height:"Vi\u0161ina",distance:"Oddaljenost"},this.searchString=null,this._timeout=null,this.selectedCountry=null,this.selectedMountainRange=null,this.selectedType=null,this.minHeight=null,this.maxHeight=null,this.searchLat=null,this.searchLng=null,this.distance=null,this.header=!0,this.showTitle=!0,this.openOnDbClick=!0,this.user=null,this.autoHeight=!1,this.showSearchInput=!0,this.fields=null,this.loadMoreVisible=!1,this.onDestinationSelect=new Fe,this.onActionSelect=new Fe,this.autoFillLimit=100,this.listBodyResizeObserver=null,this.onOrderingChange=new Fe,this.isBrowser=Si(j)}ngOnChanges(t){this.loader=!0,this.offset=0,this.contentHidden=!0,this.finished=!1,this.getDestinations(!1)}onScroll(){this.getDestinations()}changeOrdering(){let t=this.orderOpt.indexOf(this.ordering);t++,t>=this.orderOpt.length&&(t=0),this.ordering=this.orderOpt[t],this.onOrderingChange.emit(this.order+this.ordering),this.getDestinations(!1)}changeOrder(){this.order==="-"?this.order="":this.order="-",this.onOrderingChange.emit(this.order+this.ordering),this.getDestinations(!1)}search(t){let o=t.value;this._timeout&&window.clearTimeout(this._timeout),this._timeout=window.setTimeout(()=>{this._timeout=null,this.lc.run(()=>{this.searchString=o,this.getDestinations(!1)})},300)}loadMore(){this.getDestinations(!0)}getDestinations(t=!0){let o=this;this.ordering==="distance"&&(this.searchLat==null||this.searchLng==null)?this.gpsService.getPosition().then(n=>{this.searchDestinations(t,{lat:n.lat,lng:n.lng})},n=>{o.ordering="title",o.searchDestinations(t)}):this.searchDestinations(t,{lat:this.searchLat,lng:this.searchLng,radius:this.distance})}searchDestinations(t=!0,o={}){if(t){if(this.finished)return;this.loader=!0}else this.finished=!1,this.offset=null,this.destinations=[],this.loader=!0;this.sub!==null&&this.sub.unsubscribe(),this.sub=this.destinationService.getDestinations(this.limit,this.offset,this.selectedCountry,this.selectedMountainRange,this.minHeight,this.maxHeight,this.selectedType,this.searchString,this.user,this.order+this.ordering,!0,this.fields,o).subscribe(n=>{this.lc.run(()=>
1326{if(n.next==null?this.finished=!0:this.offset=n.next_offset,t){let d=new Set(this.destinations.map(_=>_.id));this.destinations=this.destinations.concat(n.results.filter(_=>!d.has(_.id)))}else this.destinations=n.results;this.loader=!1,this.contentHidden=!1,this.fillContainerIfNeeded()})},n=>{this.lc.run(()=>{this.loader=!1,n.status===401&&(this.userService.logout(),this.router.navigate(["/login"]))})})}fillContainerIfNeeded(){!this.isBrowser||this.finished||this.destinations.length>=this.autoFillLimit||setTimeout(()=>{let t=this.elRef.nativeElement.querySelector(".list-body");t&&t.clientHeight>0&&t.scrollHeight<=t.clientHeight&&this.getDestinations(!0)})}observeListBody(){if(!this.isBrowser||typeof ResizeObserver>"u"||this.listBodyResizeObserver)return;let t=this.elRef.nativeElement.querySelector(".list-body");t&&(this.listBodyResizeObserver=new ResizeObserver(()=>this.fillContainerIfNeeded()),this.listBodyResizeObserver.observe(t))}ngAfterViewInit(){this.observeListBody()}ngOnDestroy(){this.listBodyResizeObserver?.disconnect()}selectAction(t,o=null){this.openOnDbClick?this.destinationSelect(t):this.destinationDetails(o)}destinationDetails(t){this.router.navigate(["./destinacije/"+t])}actionSelect(t){this.onActionSelect.emit(t)}destinationSelect(t){this.selectedDestination===t?this.selectedDestination=null:this.selectedDestination=t,this.onDestinationSelect.emit(this.selectedDestination)}selectAndScrollTo(t){this.lc.run(()=>{this.selectedDestination=t,setTimeout(()=>{this.selectedDestination===t&&(this.scrollToRow(t)||this.destinations.some(o=>o.id===t)||this.destinationService.getDestination(t,null).subscribe(o=>{this.selectedDestination===t&&(this.destinations.some(n=>n.id===t)||(this.destinations=[o,...this.destinations]),setTimeout(()=>this.scrollToRow(t)))}))})})}scrollToRow(t){let o=this.elRef.nativeElement.querySelector(`[data-destination-id="${t}"]`);return o?(o.scrollIntoView({behavior:"smooth",block:"center"}),!0):!1}};e.\u0275fac=function(o){return new(o||e)(ae(sn),ae(Ti),ae(si),ae(Gi),ae(Js),ae(qt),ae(Pi),ae(Qt))},e.\u0275cmp=st({type:e,selectors:[["app-destination-list"]],inputs:{order:"order",ordering:"ordering",selectedCountry:"selectedCountry",selectedMountainRange:"selectedMountainRange",selectedType:"selectedType",minHeight:"minHeight",maxHeight:"maxHeight",searchLat:"searchLat",searchLng:"searchLng",distance:"distance",header:"header",showTitle:"showTitle",openOnDbClick:"openOnDbClick",user:"user",autoHeight:"autoHeight",showSearchInput:"showSearchInput",fields:"fields",loadMoreVisible:"loadMoreVisible"},outputs:{onDestinationSelect:"onDestinationSelect",onActionSelect:"onActionSelect",onOrderingChange:"onOrderingChange"},standalone:!0,features:[It([sn,Js]),hn,gt],decls:8,vars:12,consts:[[1,"list-shell"],["class","list-toolbar",4,"ngIf"],["infiniteScroll","",1,"list-body",3,"infiniteScrollDistance","infiniteScrollThrottle","scrollWindow","scrolled"],[3,"class",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["src","/assets/images/small_loader.gif"],[1,"list-toolbar"],["class","list-title",4,"ngIf"],[1,"list-controls"],["class","list-search-wrap",4,"ngIf"],["type","button",1,"list-ordering",3,"click"],["type","button",1,"list-ordering-dir",3,"click"],[1,"list-ordering-arrow"],[1,"list-title"],[1,"list-search-wrap"],["type","text","id","search-destinations","placeholder","I\u0161\u010Di destinacije \u2026",1,"list-search-input",3,"keyup"],[3,"dblclick","click"],[1,"destination-row-title"],[1,"destination-row-height"],["class","list-item-menu",4,"ngIf"],[1,"list-item-menu"],[1,"pointer",3,"click"],[1,"pointer","hidden","hidden-desktop",3,"click"],[3,"click"]],template:function(o,n){o&1&&(S(0,"div",0),ce(1,MX,9,6,"div",1),S(2,"div",2),se("scrolled",function(){return n.onScroll()}),ce(3,kX,2,3,"div",3)(4,PX,7,8,"div",4)(5,OX,3,0,"div",5),S(6,"div"),Z(7,"img",6),E()()()),o&2&&(Yi("autoheight",n.autoHeight),P(1),N("ngIf",n.header),P(1),N("infiniteScrollDistance",2)("infiniteScrollThrottle",1e3)("scrollWindow",!1),P(1),N("ngIf",(n.destinations==null?null:n.destinations.length)==0),P(1),N("ngForOf",n.destinations),P(1),N("ngIf",!n.finished&&!n.loader&&n.loadMoreVisible),P(1),ki("",n.loader&&!n.finished?""
1326:"hidden"," loader center-text margin-5"))},dependencies:[kf,Mf,Dt,ti,At],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0}.list-shell[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0}.list-shell.autoheight[_ngcontent-%COMP%]{display:block;height:auto}.list-shell.autoheight[_ngcontent-%COMP%]   .list-body[_ngcontent-%COMP%]{flex:none;overflow:visible}.list-toolbar[_ngcontent-%COMP%]{flex:none;display:flex;align-items:center;gap:10px;background:var(--color-dark);padding:8px 10px}.list-title[_ngcontent-%COMP%]{flex:none;color:#c9c7c6;font-size:var(--font-size-sm);font-weight:600;letter-spacing:.2px}.list-controls[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:6px}.list-search-wrap[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.list-search-input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;height:30px;padding:0 10px;border:1px solid transparent;border-radius:var(--radius-pill);font-size:var(--font-size-sm);background:rgba(255,255,255,.12);color:#fff;transition:background var(--transition-fast),border-color var(--transition-fast)}.list-search-input[_ngcontent-%COMP%]::placeholder{color:#fff9}.list-search-input[_ngcontent-%COMP%]:focus{outline:none;background:rgba(255,255,255,.18);border-color:var(--color-accent)}.list-ordering[_ngcontent-%COMP%], .list-ordering-dir[_ngcontent-%COMP%]{flex:none;height:30px;border:0;border-radius:var(--radius-pill);background:rgba(255,255,255,.12);color:#e8e7e6;font-size:var(--font-size-xs);cursor:pointer;transition:background var(--transition-fast);white-space:nowrap}.list-ordering[_ngcontent-%COMP%]{padding:0 12px}.list-ordering-dir[_ngcontent-%COMP%]{width:28px;padding:0;display:flex;align-items:center;justify-content:center}.list-ordering[_ngcontent-%COMP%]:hover, .list-ordering-dir[_ngcontent-%COMP%]:hover{background:rgba(255,255,255,.22)}.list-ordering-arrow[_ngcontent-%COMP%]{display:inline-block;transition:transform var(--transition-fast)}.list-ordering-arrow.asc[_ngcontent-%COMP%]{transform:rotate(180deg)}.list-body[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:4px 6px}.list-empty[_ngcontent-%COMP%]{padding:20px 12px;text-align:center;color:var(--color-text-muted);font-size:var(--font-size-sm)}.destination-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border-radius:var(--radius-sm);cursor:pointer;transition:background var(--transition-fast)}.destination-row[_ngcontent-%COMP%]:hover{background:var(--color-surface-alt)}.destination-row.active[_ngcontent-%COMP%]{background:var(--color-accent-soft)}.destination-row-title[_ngcontent-%COMP%]{font-size:var(--font-size-sm);font-weight:600;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.destination-row-height[_ngcontent-%COMP%]{flex:none;font-size:var(--font-size-xs);color:var(--color-text-muted)}"]});let i=e;return i})();var wl="*";function H3(i,e=null){return{type:2,steps:i,options:e}}function jI(i){return{type:6,styles:i,offset:null}}var Eu=class{constructor(e=0,r=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._originalOnDoneFns=[],this._originalOnStartFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+r}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){let r=e=="start"?this._onStartFns:this._onDoneFns;r.forEach(t=>t()),r.length=0}},X_=class{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let r=0,t=0,o=0,n=this.players.length;n==0?queueMicrotask(()=>
vendor: 5,891 bytes, line 1326
1326this._onFinish()):this.players.forEach(d=>{d.onDone(()=>{++r==n&&this._onFinish()}),d.onDestroy(()=>{++t==n&&this._onDestroy()}),d.onStart(()=>{++o==n&&this._onStart()})}),this.totalTime=this.players.reduce((d,_)=>Math.max(d,_.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){let r=e*this.totalTime;this.players.forEach(t=>{let o=t.totalTime?Math.min(1,r/t.totalTime):1;t.setPosition(o)})}getPosition(){let e=this.players.reduce((r,t)=>r===null||t.totalTime>r.totalTime?t:r,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let r=e=="start"?this._onStartFns:this._onDoneFns;r.forEach(t=>t()),r.length=0}},Zx="!";function $3(i){return new yt(3e3,!1)}function RX(){return new yt(3100,!1)}function LX(){return new yt(3101,!1)}function FX(i){return new yt(3001,!1)}function NX(i){return new yt(3003,!1)}function zX(i){return new yt(3004,!1)}function jX(i,e){return new yt(3005,!1)}function VX(){return new yt(3006,!1)}function BX(){return new yt(3007,!1)}function UX(i,e){return new yt(3008,!1)}function HX(i){return new yt(3002,!1)}function $X(i,e,r,t,o){return new yt(3010,!1)}function GX(){return new yt(3011,!1)}function qX(){return new yt(3012,!1)}function WX(){return new yt(3200,!1)}function ZX(){return new yt(3202,!1)}function KX(){return new yt(3013,!1)}function XX(i){return new yt(3014,!1)}function YX(i){return new yt(3015,!1)}function QX(i){return new yt(3016,!1)}function JX(i,e){return new yt(3404,!1)}function eY(i){return new yt(3502,!1)}function tY(i){return new yt(3503,!1)}function iY(){return new yt(3300,!1)}function nY(i){return new yt(3504,!1)}function rY(i){return new yt(3301,!1)}function oY(i,e){return new yt(3302,!1)}function sY(i){return new yt(3303,!1)}function aY(i,e){return new yt(3400,!1)}function lY(i){return new yt(3401,!1)}function cY(i){return new yt(3402,!1)}function uY(i,e){return new yt(3505,!1)}function Su(i){switch(i.length){case 0:return new Eu;case 1:return i[0];default:return new X_(i)}}function rN(i,e,r=new Map,t=new Map){let o=[],n=[],d=-1,_=null;if(e.forEach(C=>{let M=C.get("offset"),j=M==d,G=j&&_||new Map;C.forEach((ie,_e)=>{let Ee=_e,Ye=ie;if(_e!=="offset")switch(Ee=i.normalizePropertyName(Ee,o),Ye){case Zx:Ye=r.get(_e);break;case wl:Ye=t.get(_e);break;default:Ye=i.normalizeStyleValue(_e,Ee,Ye,o);break}G.set(Ee,Ye)}),j||n.push(G),_=G,d=M}),o.length)throw eY(o);return n}function aD(i,e,r,t){switch(e){case"start":i.onStart(()=>t(r&&VI(r,"start",i)));break;case"done":i.onDone(()=>t(r&&VI(r,"done",i)));break;case"destroy":i.onDestroy(()=>t(r&&VI(r,"destroy",i)));break}}function VI(i,e,r){let t=r.totalTime,o=!!r.disabled,n=lD(i.element,i.triggerName,i.fromState,i.toState,e||i.phaseName,t??i.totalTime,o),d=i._data;return d!=null&&(n._data=d),n}function lD(i,e,r,t,o="",n=0,d){return{element:i,triggerName:e,fromState:r,toState:t,phaseName:o,totalTime:n,disabled:!!d}}function Is(i,e,r){let t=i.get(e);return t||i.set(e,t=r),t}function G3(i){let e=i.indexOf(":"),r=i.substring(1,e),t=i.slice(e+1);return[r,t]}var dY=(()=>typeof document>"u"?null:document.documentElement)();function cD(i){let e=i.parentNode||i.host||null;return e===dY?null:e}function hY(i){return i.substring(1,6)=="ebkit"}var oh=null,q3=!1;function pY(i){oh||(oh=fY()||{},q3=oh.style?"WebkitAppearance"in oh.style:!1);let e=!0;return oh.style&&!hY(i)&&(e=i in oh.style,!e&&q3&&(e="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in oh.style)),e}function fY(){return typeof document<"u"?document.body:null}function oN(i,e){for(;e;){if(e===i)return!0;e=cD(e)}return!1}function sN(i,e,r){if(r)return Array.from(i.querySelectorAll(e));let t=i.querySelector(e);return t?[t]:[]}var uD=(()=>{let e=class e{validateStyleProperty(t){return pY(t)}matchesElement(t,o){return!1}containsElement(t,o){return oN(t,o)}getParentElement(t){return cD(t)}query(t,o,n){return sN(t,o,n)}computeStyle(t,o,n){return n||""}animate(t,o,n,d,_,C=[],M){return new Eu(n,d)}};e.\u0275fac=function(o){return new(o||e)},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})(),n0=(()=>{let e=class e{};e.NOOP=new uD;let i=e;return i})(),lh=class{};var mY=1e3,aN="{{",gY="}}",lN="ng-enter",qI="ng-leave",Kx="ng-trigger",e1=".ng-trigger",W3="ng-animating",WI=".ng-animating";function pc(i){if(typeof i=="number")return i;let e=i.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:ZI(parseFloat(e[1]),e[2])}function ZI(i,e){switch(e){case"s":return i*mY;default:return i}}function t1(i,e,r){return i.hasOwnProperty("duration")?i:_Y(i,e,r)}function _Y(i,e,r){let t=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,o,n=0,d="";if(typeof i=="string"){let _=i.match(t);if(_===null)return e.push($3(i)),{duration:0,delay:0,easing:""};o=ZI(parseFloat(_[1]),_[2]);let C=_[3];C!=null&&(n=ZI(parseFloat(C),_[4]));let M=_[5];M&&(d=M)}else o=i;if(!r){let _=!1,C=e.length;o<0&&(e.push(RX()),_=!0),n<0&&(e.push(LX()),_=!0),_&&e.splice(C,0,$3(i))}return{duration:o,delay:n,easing:d}}function r0(i,e={}
1326){return Object.keys(i).forEach(r=>{e[r]=i[r]}),e}function cN(i){let e=new Map;return Object.keys(i).forEach(r=>{let t=i[r];e.set(r,t)}),e}function vY(i){return i.length?i[0]instanceof Map?i:i.map(e=>cN(e)):[]}function zf(i,e=new Map,r){if(r)for(let[t,o]of r)e.set(t,o);for(let[t,o]of i)e.set(t,o);return e}function Cl(i,e,r){e.forEach((t,o)=>{let n=dD(o);r&&!r.has(o)&&r.set(o,i.style[n]),i.style[n]=t})}function ah(i,e){e.forEach((r,t)=>{let o=dD(t);i.style[o]=""})}function Y_(i){return Array.isArray(i)?i.length==1?i[0]:H3(i):i}function yY(i,e,r){let t=e.params||{},o=uN(i);o.length&&o.forEach(n=>{t.hasOwnProperty(n)||r.push(FX(n))})}var KI=new RegExp(`${aN}\\s*(.+?)\\s*${gY}`,"g");function uN(i){let e=[];if(typeof i=="string"){let r;for(;r=KI.exec(i);)e.push(r[1]);KI.lastIndex=0}return e}function J_(i,e,r){let t=i.toString(),o=t.replace(KI,(n,d)=>{let _=e[d];return _==null&&(r.push(NX(d)),_=""),_.toString()});return o==t?i:o}function i1(i){let e=[],r=i.next();for(;!r.done;)e.push(r.value),r=i.next();return e}var bY=/-+([a-z0-9])/g;function dD(i){return i.replace(bY,(...e)=>e[1].toUpperCase())}function xY(i,e){return i===0||e===0}function wY(i,e,r){if(r.size&&e.length){let t=e[0],o=[];if(r.forEach((n,d)=>{t.has(d)||o.push(d),t.set(d,n)}),o.length)for(let n=1;n<e.length;n++){let d=e[n];o.forEach(_=>d.set(_,dN(i,_)))}}return e}function Ts(i,e,r){switch(e.type){case 7:return i.visitTrigger(e,r);case 0:return i.visitState(e,r);case 1:return i.visitTransition(e,r);case 2:return i.visitSequence(e,r);case 3:return i.visitGroup(e,r);case 4:return i.visitAnimate(e,r);case 5:return i.visitKeyframes(e,r);case 6:return i.visitStyle(e,r);case 8:return i.visitReference(e,r);case 9:return i.visitAnimateChild(e,r);case 10:return i.visitAnimateRef(e,r);case 11:return i.visitQuery(e,r);case 12:return i.visitStagger(e,r);default:throw zX(e.type)}}function dN(i,e){return window.getComputedStyle(i)[e]}var CY=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),n1=class extends lh{normalizePropertyName(e,r){return dD(e)}normalizeStyleValue(e,r,t,o){let n="",d=t.toString().trim();if(CY.has(r)&&t!==0&&t!=="0")if(typeof t=="number")n="px";else{let _=t.match(/^[+-]?[\d\.]+([a-z]*)$/);_&&_[1].length==0&&o.push(jX(e,t))}return d+n}};var r1="*";function EY(i,e){let r=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(t=>SY(t,r,e)):r.push(i),r}function SY(i,e,r){if(i[0]==":"){let C=TY(i,r);if(typeof C=="function"){e.push(C);return}i=C}let t=i.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(t==null||t.length<4)return r.push(YX(i)),e;let o=t[1],n=t[2],d=t[3];e.push(Z3(o,d));let _=o==r1&&d==r1;n[0]=="<"&&!_&&e.push(Z3(d,o))}function TY(i,e){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(r,t)=>parseFloat(t)>parseFloat(r);case":decrement":return(r,t)=>parseFloat(t)<parseFloat(r);default:return e.push(QX(i)),"* => *"}}var Xx=new Set(["true","1"]),Yx=new Set(["false","0"]);function Z3(i,e){let r=Xx.has(i)||Yx.has(i),t=Xx.has(e)||Yx.has(e);return(o,n)=>{let d=i==r1||i==o,_=e==r1||e==n;return!d&&r&&typeof o=="boolean"&&(d=o?Xx.has(i):Yx.has(i)),!_&&t&&typeof n=="boolean"&&(_=n?Xx.has(e):Yx.has(e)),d&&_}}var hN=":self",IY=new RegExp(`s*${hN}s*,?`,"g");function pN(i,e,r,t){return new XI(i).build(e,r,t)}var K3="",XI=class{constructor(e){this._driver=e}build(e,r,t){let o=new YI(r);return this._resetContextStyleTimingState(o),Ts(this,Y_(e),o)}_resetContextStyleTimingState(e){e.currentQuerySelector=K3,e.collectedStyles=new Map,e.collectedStyles.set(K3,new Map),e.currentTime=0}visitTrigger(e,r){let t=r.queryCount=0,o=r.depCount=0,n=[],d=[];return e.name.charAt(0)=="@"&&r.errors.push(VX()),e.definitions.forEach(_=>{if(this._resetContextStyleTimingState(r),_.type==0){let C=_,M=C.name;
1326M.toString().split(/\s*,\s*/).forEach(j=>{C.name=j,n.push(this.visitState(C,r))}),C.name=M}else if(_.type==1){let C=this.visitTransition(_,r);t+=C.queryCount,o+=C.depCount,d.push(C)}else r.errors.push(BX())}),{type:7,name:e.name,states:n,transitions:d,queryCount:t,depCount:o,options:null}}visitState(e,r){let t=this.visitStyle(e.styles,r),o=e.options&&e.options.params||null;if(t.containsDynamicStyles){let n=new Set,d=o||{};if(t.styles.forEach(_=>{_ instanceof Map&&_.forEach(C=>{uN(C).forEach(M=>{d.hasOwnProperty(M)||n.add(M)})})}),n.size){let _=i1(n.values());r.errors.push(UX(e.name,_))}}return{type:0,name:e.name,style:t,options:o?{params:o}:null}}visitTransition(e,r){r.queryCount=0,r.depCount=0;let t=Ts(this,Y_(e.animation),r);return{type:1,matchers:EY(e.expr,r.errors),animation:t,queryCount:r.queryCount,depCount:r.depCount,options:sh(e.options)}}visitSequence(e,r){return{type:2,steps:e.steps.map(t=>Ts(this,t,r)),options:sh(e.options)}}visitGroup(e,r){let t=r.currentTime,o=0,n=e.steps.map(d=>{r.currentTime=t;let _=Ts(this,d,r);return o=Math.max(o,r.currentTime),_});return r.currentTime=o,{type:3,steps:n,options:sh(e.options)}}visitAnimate(e,r){let t=AY(e.timings,r.errors);r.currentAnimateTimings=t;let o,n=e.styles?e.styles:jI({});if(n.type==5)o=this.visitKeyframes(n,r);else{let d=e.styles,_=!1;if(!d){_=!0;let M={};t.easing&&(M.easing=t.easing),d=jI(M)}r.currentTime+=t.duration+t.delay;let C=this.visitStyle(d,r);C.isEmptyStep=_,o=C}return r.currentAnimateTimings=null,{type:4,timings:t,style:o,options:null}}visitStyle(e,r){let t=this._makeStyleAst(e,r);return this._validateStyleAst(t,r),t}_makeStyleAst(e,r){let t=[],o=Array.isArray(e.styles)?e.styles:[e.styles];for(let _ of o)typeof _=="string"?_===wl?t.push(_):r.errors.push(HX(_)):t.push(cN(_));let n=!1,d=null;return t.forEach(_=>{if(_ instanceof Map&&(_.has("easing")&&(d=_.get("easing"),_.delete("easing")),!n)){for(let C of _.values())if(C.toString().indexOf(aN)>=0){n=!0;break}}}),{type:6,styles:t,easing:d,offset:e.offset,containsDynamicStyles:n,options:null}}_validateStyleAst(e,r){let t=r.currentAnimateTimings,o=r.currentTime,n=r.currentTime;t&&n>0&&(n-=t.duration+t.delay),e.styles.forEach(d=>{typeof d!="string"&&d.forEach((_,C)=>{let M=r.collectedStyles.get(r.currentQuerySelector),j=M.get(C),G=!0;j&&(n!=o&&n>=j.startTime&&o<=j.endTime&&(r.errors.push($X(C,j.startTime,j.endTime,n,o)),G=!1),n=j.startTime),G&&M.set(C,{startTime:n,endTime:o}),r.options&&yY(_,r.options,r.errors)})})}visitKeyframes(e,r){let t={type:5,styles:[],options:null};if(!r.currentAnimateTimings)return r.errors.push(GX()),t;let o=1,n=0,d=[],_=!1,C=!1,M=0,j=e.steps.map(at=>{let Lt=this._makeStyleAst(at,r),jt=Lt.offset!=null?Lt.offset:kY(Lt.styles),$t=0;return jt!=null&&(n++,$t=Lt.offset=jt),C=C||$t<0||$t>1,_=_||$t<M,M=$t,d.push($t),Lt});C&&r.errors.push(qX()),_&&r.errors.push(WX());let G=e.steps.length,ie=0;n>0&&n<G?r.errors.push(ZX()):n==0&&(ie=o/(G-1));let _e=G-1,Ee=r.currentTime,Ye=r.currentAnimateTimings,$e=Ye.duration;return j.forEach((at,Lt)=>{let jt=ie>0?Lt==_e?1:ie*Lt:d[Lt],$t=jt*$e;r.currentTime=Ee+Ye.delay+$t,Ye.duration=$t,this._validateStyleAst(at,r),at.offset=jt,t.styles.push(at)}),t}visitReference(e,r){return{type:8,animation:Ts(this,Y_(e.animation),r),options:sh(e.options)}}visitAnimateChild(e,r){return r.depCount++,{type:9,options:sh(e.options)}}visitAnimateRef(e,r){return{type:10,animation:this.visitReference(e.animation,r),options:sh(e.options)}}visitQuery(e,r){let t=r.currentQuerySelector,o=e.options||{};r.queryCount++,r.currentQuery=e;let[n,d]=DY(e.selector);r.currentQuerySelector=t.length?t+" "+n:n,Is(r.collectedStyles,r.currentQuerySelector,new Map);let _=Ts(this,Y_(e.animation),r);return r.currentQuery=null,r.currentQuerySelector=t,{type:11,selector:n,limit:o.limit||0,optional:!!o.optional,includeSelf:d,animation:_,originalSelector:e.selector,options:sh(e.options)}}visitStagger(e,r){r.currentQuery||r.errors.push(KX());let t=e.timings==="full"?{duration:0,delay:0,easing:"full"}:t1(e.timings,r.errors,!0);return{type:12,animation:Ts(this,Y_(e.animation),r),timings:t,options:null}}};function DY(i){let e=!!i.split(/\s*,\s*/).find(r=>r==hN);return e&&(i=i.replace(IY,"")),i=i.replace(/@\*/g,e1).replace(/@\w+/g,r=>e1+"-"+r.slice(1)).replace(/:animating/g,WI),[i,e]}function MY(i){return i?r0(i):null}var YI=class{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}};function kY(i){if(typeof i=="string")return null;let e=null;if(Array.isArray(i))i.forEach(r=>{if(r instanceof Map&&r.has("offset")){let t=r;e=parseFloat(t.get("offset")),t.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let r=i;e=parseFloat(r.get("offset")),r.delete("offset")}return e}function AY(i,e){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let n=t1(i,e).duration;return BI(n,0,"")}let r=i;if(r.split(/\s+/).some(n=>n.charAt(0)=="{"&&n.charAt(1)=="{")){let n=BI(0,0,"");return n.dynamic=!0,n.strValue=r,n}let o=t1(r,e);return BI(o.duration,o.delay,o.easing)}function sh(i){return i?(i=r0(i),i.params&&(i.params=MY(i.params))):i={},i}function BI(i,e,r){return{duration:i,delay:e,easing:r}}function hD(i,e,r,t,o,n,d=null,_=!1){return{type:1,element:i,keyframes:e,preStyleProps:r,postStyleProps:t,duration:o,delay:n,totalTime:o+n,easing:d,subTimeline:_}}var e0=class{constructor(){this._map=new Map}get(e){return this._map.get(e)||[]}append(e,r){let t=this._map.get(e);t||this._map.set(e,t=[]),t.push(...r)}has(e){return this._map.has(e)}clear(){this._map.clear()}},PY=1,OY=":enter",RY=new RegExp(OY,"g"),LY=":leave",FY=new RegExp(LY,"g");function fN(i,e,r,t,o,n=new Map,d=new Map,_,C,M=[]){return new QI().buildKeyframes(i,e,r,t,o,n,d,_,C,M)}var QI=class{buildKeyframes(e,r,t,o,n,d,_,C,M,j=[]){M=M||new e0;let G=new JI(e,r,M,o,n,j,[]);G.options=C;let ie=C.delay?pc(C.delay):0;G.currentTimeline.delayNextStep(ie),G.currentTimeline.setStyles([d],null,G.errors,C),Ts(this,t,G);let _e=G.timelines.filter(Ee=>Ee.containsAnimation());if(_e.length&&_.size){let Ee;for(let Ye=_e.length-1;Ye>=0;Ye--){let $e=_e[Ye];if($e.element===r){Ee=$e;break}}Ee&&!Ee.allowOnlyTimelineStyles()&&Ee.setStyles([_],null,G.errors,C)}return _e.length?_e.map(Ee=>Ee.buildKeyframes()):[hD(r,[],[],[],0,ie,"",!1)]}visitTrigger(e,r){}visitState(e,r){}visitTransition(e,r){}
vendor: 9,393 bytes, line 1326
1326visitAnimateChild(e,r){let t=r.subInstructions.get(r.element);if(t){let o=r.createSubContext(e.options),n=r.currentTimeline.currentTime,d=this._visitSubInstructions(t,o,o.options);n!=d&&r.transformIntoNewTimeline(d)}r.previousNode=e}visitAnimateRef(e,r){let t=r.createSubContext(e.options);t.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],r,t),this.visitReference(e.animation,t),r.transformIntoNewTimeline(t.currentTimeline.currentTime),r.previousNode=e}_applyAnimationRefDelays(e,r,t){for(let o of e){let n=o?.delay;if(n){let d=typeof n=="number"?n:pc(J_(n,o?.params??{},r.errors));t.delayNextStep(d)}}}_visitSubInstructions(e,r,t){let n=r.currentTimeline.currentTime,d=t.duration!=null?pc(t.duration):null,_=t.delay!=null?pc(t.delay):null;return d!==0&&e.forEach(C=>{let M=r.appendInstructionToTimeline(C,d,_);n=Math.max(n,M.duration+M.delay)}),n}visitReference(e,r){r.updateOptions(e.options,!0),Ts(this,e.animation,r),r.previousNode=e}visitSequence(e,r){let t=r.subContextCount,o=r,n=e.options;if(n&&(n.params||n.delay)&&(o=r.createSubContext(n),o.transformIntoNewTimeline(),n.delay!=null)){o.previousNode.type==6&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=o1);let d=pc(n.delay);o.delayNextStep(d)}e.steps.length&&(e.steps.forEach(d=>Ts(this,d,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>t&&o.transformIntoNewTimeline()),r.previousNode=e}visitGroup(e,r){let t=[],o=r.currentTimeline.currentTime,n=e.options&&e.options.delay?pc(e.options.delay):0;e.steps.forEach(d=>{let _=r.createSubContext(e.options);n&&_.delayNextStep(n),Ts(this,d,_),o=Math.max(o,_.currentTimeline.currentTime),t.push(_.currentTimeline)}),t.forEach(d=>r.currentTimeline.mergeTimelineCollectedStyles(d)),r.transformIntoNewTimeline(o),r.previousNode=e}_visitTiming(e,r){if(e.dynamic){let t=e.strValue,o=r.params?J_(t,r.params,r.errors):t;return t1(o,r.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,r){let t=r.currentAnimateTimings=this._visitTiming(e.timings,r),o=r.currentTimeline;t.delay&&(r.incrementTime(t.delay),o.snapshotCurrentStyles());let n=e.style;n.type==5?this.visitKeyframes(n,r):(r.incrementTime(t.duration),this.visitStyle(n,r),o.applyStylesToKeyframe()),r.currentAnimateTimings=null,r.previousNode=e}visitStyle(e,r){let t=r.currentTimeline,o=r.currentAnimateTimings;!o&&t.hasCurrentStyleProperties()&&t.forwardFrame();let n=o&&o.easing||e.easing;e.isEmptyStep?t.applyEmptyStep(n):t.setStyles(e.styles,n,r.errors,r.options),r.previousNode=e}visitKeyframes(e,r){let t=r.currentAnimateTimings,o=r.currentTimeline.duration,n=t.duration,_=r.createSubContext().currentTimeline;_.easing=t.easing,e.styles.forEach(C=>{let M=C.offset||0;_.forwardTime(M*n),_.setStyles(C.styles,C.easing,r.errors,r.options),_.applyStylesToKeyframe()}),r.currentTimeline.mergeTimelineCollectedStyles(_),r.transformIntoNewTimeline(o+n),r.previousNode=e}visitQuery(e,r){let t=r.currentTimeline.currentTime,o=e.options||{},n=o.delay?pc(o.delay):0;n&&(r.previousNode.type===6||t==0&&r.currentTimeline.hasCurrentStyleProperties())&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=o1);let d=t,_=r.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!o.optional,r.errors);r.currentQueryTotal=_.length;let C=null;_.forEach((M,j)=>{r.currentQueryIndex=j;let G=r.createSubContext(e.options,M);n&&G.delayNextStep(n),M===r.element&&(C=G.currentTimeline),Ts(this,e.animation,G),G.currentTimeline.applyStylesToKeyframe();let ie=G.currentTimeline.currentTime;d=Math.max(d,ie)}),r.currentQueryIndex=0,r.currentQueryTotal=0,r.transformIntoNewTimeline(d),C&&(r.currentTimeline.mergeTimelineCollectedStyles(C),r.currentTimeline.snapshotCurrentStyles()),r.previousNode=e}visitStagger(e,r){let t=r.parentContext,o=r.currentTimeline,n=e.timings,d=Math.abs(n.duration),_=d*(r.currentQueryTotal-1),C=d*r.currentQueryIndex;switch(n.duration<0?"reverse":n.easing){case"reverse":C=_-C;break;case"full":C=t.currentStaggerTime;break}let j=r.currentTimeline;C&&j.delayNextStep(C);let G=j.currentTime;Ts(this,e.animation,r),r.previousNode=e,t.currentStaggerTime=o.currentTime-G+(o.startTime-t.currentTimeline.startTime)}},o1={},JI=class i{constructor(e,r,t,o,n,d,_,C){this._driver=e,this.element=r,this.subInstructions=t,this._enterClassName=o,this._leaveClassName=n,this.errors=d,this.timelines=_,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=o1,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=C||new s1(this._driver,r,0),_.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,r){if(!e)return;let t=e,o=this.options;t.duration!=null&&(o.duration=pc(t.duration)),t.delay!=null&&(o.delay=pc(t.delay));let n=t.params;if(n){let d=o.params;d||(d=this.options.params={}),Object.keys(n).forEach(_=>{(!r||!d.hasOwnProperty(_))&&(d[_]=J_(n[_],d,this.errors))})}}_copyOptions(){let e={};if(this.options){let r=this.options.params;if(r){let t=e.params={};Object.keys(r).forEach(o=>{t[o]=r[o]})}}return e}createSubContext(e=null,r,t){let o=r||this.element,n=new i(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,t||0));return n.previousNode=this.previousNode,n.currentAnimateTimings=this.currentAnimateTimings,n.options=this._copyOptions(),n.updateOptions(e),n.currentQueryIndex=this.currentQueryIndex,n.currentQueryTotal=this.currentQueryTotal,n.parentContext=this,this.subContextCount++,n}transformIntoNewTimeline(e){return this.previousNode=o1,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,r,t){let o={duration:r??e.duration,delay:this.currentTimeline.currentTime+(t??0)+e.delay,easing:""},n=new eD(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,o,e.stretchStartingKeyframe);return this.timelines.push(n),o}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,r,t,o,n,d){let _=[];if(o&&_.push(this.element),e.length>0){e=e.replace(RY,"."+this._enterClassName),e=e.replace(FY,"."+this._leaveClassName);let C=t!=1,M=this._driver.query(this.element,e,C);t!==0&&(M=t<0?M.slice(M.length+t,M.length):M.slice(0,t)),_.push(...M)}return!n&&_.length==0&&d.push(XX(r)),_}},s1=class i{constructor(e,r,t,o){this._driver=e,this.element=r,this.startTime=t,this._elementTimelineStylesLookup=o,this.duration=0,this.easing=null,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(r),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(r,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let r=this._keyframes.size===1&&this._pendingStyles.size;this.duration||r?(this.forwardTime(this.currentTime+e),r&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,r){return this.applyStylesToKeyframe(),new i(this._driver,e,r||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=PY,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,r){this._localTimelineStyles.set(e,r),this._globalTimelineStyles.set(e,r),this._styleSummary.set(e,{time:this.currentTime,value:r})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[r,t]of this._globalTimelineStyles)this._backFill.set(r,t||wl),this._currentKeyframe.set(r,wl);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,r,t,o){r&&this._previousKeyframe.set("easing",r);let n=o&&o.params||{},d=NY(e,this._globalTimelineStyles);for(let[_,C]of d){let M=J_(C,n,t);this._pendingStyles.set(_,M),this._localTimelineStyles.has(_)||this._backFill.set(_,this._globalTimelineStyles.get(_)??wl),this._updateStyle(_,M)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,r)=>{this._currentKeyframe.set(r,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,r)=>{this._currentKeyframe.has(r)||this._currentKeyframe.set(r,e)}))}snapshotCurrentStyles(){for(let[e,r]of this._localTimelineStyles)this._pendingStyles.set(e,r),this._updateStyle(e,r)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let r in this._currentKeyframe)e.push(r);return e}
1326mergeTimelineCollectedStyles(e){e._styleSummary.forEach((r,t)=>{let o=this._styleSummary.get(t);(!o||r.time>o.time)&&this._updateStyle(t,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,r=new Set,t=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((_,C)=>{let M=zf(_,new Map,this._backFill);M.forEach((j,G)=>{j===Zx?e.add(G):j===wl&&r.add(G)}),t||M.set("offset",C/this.duration),o.push(M)});let n=e.size?i1(e.values()):[],d=r.size?i1(r.values()):[];if(t){let _=o[0],C=new Map(_);_.set("offset",0),C.set("offset",1),o=[_,C]}return hD(this.element,o,n,d,this.duration,this.startTime,this.easing,!1)}},eD=class extends s1{constructor(e,r,t,o,n,d,_=!1){super(e,r,d.delay),this.keyframes=t,this.preStyleProps=o,this.postStyleProps=n,this._stretchStartingKeyframe=_,this.timings={duration:d.duration,delay:d.delay,easing:d.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:r,duration:t,easing:o}=this.timings;if(this._stretchStartingKeyframe&&r){let n=[],d=t+r,_=r/d,C=zf(e[0]);C.set("offset",0),n.push(C);let M=zf(e[0]);M.set("offset",X3(_)),n.push(M);let j=e.length-1;for(let G=1;G<=j;G++){let ie=zf(e[G]),_e=ie.get("offset"),Ee=r+_e*t;ie.set("offset",X3(Ee/d)),n.push(ie)}t=d,r=0,o="",e=n}return hD(this.element,e,this.preStyleProps,this.postStyleProps,t,r,o,!0)}};function X3(i,e=3){let r=Math.pow(10,e-1);return Math.round(i*r)/r}function NY(i,e){let r=new Map,t;return i.forEach(o=>{if(o==="*"){t=t||e.keys();for(let n of t)r.set(n,wl)}else zf(o,r)}),r}function Y3(i,e,r,t,o,n,d,_,C,M,j,G,ie){return{type:0,element:i,triggerName:e,isRemovalTransition:o,fromState:r,fromStyles:n,toState:t,toStyles:d,timelines:_,queriedElements:C,preStyleProps:M,postStyleProps:j,totalTime:G,errors:ie}}var UI={},a1=class{constructor(e,r,t){this._triggerName=e,this.ast=r,this._stateStyles=t}match(e,r,t,o){return zY(this.ast.matchers,e,r,t,o)}buildStyles(e,r,t){let o=this._stateStyles.get("*");return e!==void 0&&(o=this._stateStyles.get(e?.toString())||o),o?o.buildStyles(r,t):new Map}build(e,r,t,o,n,d,_,C,M,j){let G=[],ie=this.ast.options&&this.ast.options.params||UI,_e=_&&_.params||UI,Ee=this.buildStyles(t,_e,G),Ye=C&&C.params||UI,$e=this.buildStyles(o,Ye,G),at=new Set,Lt=new Map,jt=new Map,$t=o==="void",tn={params:jY(Ye,ie),delay:this.ast.options?.delay},Fi=j?[]:fN(e,r,this.ast.animation,n,d,Ee,$e,tn,M,G),tt=0;if(Fi.forEach(so=>{tt=Math.max(so.duration+so.delay,tt)}),G.length)return Y3(r,this._triggerName,t,o,$t,Ee,$e,[],[],Lt,jt,tt,G);Fi.forEach(so=>{let ai=so.element,sr=Is(Lt,ai,new Set);so.preStyleProps.forEach(jo=>sr.add(jo));let na=Is(jt,ai,new Set);so.postStyleProps.forEach(jo=>na.add(jo)),ai!==r&&at.add(ai)});let Sr=i1(at.values());return Y3(r,this._triggerName,t,o,$t,Ee,$e,Fi,Sr,Lt,jt,tt)}};function zY(i,e,r,t,o){return i.some(n=>n(e,r,t,o))}function jY(i,e){let r=r0(e);for(let t in i)i.hasOwnProperty(t)&&i[t]!=null&&(r[t]=i[t]);return r}var tD=class{constructor(e,r,t){this.styles=e,this.defaultParams=r,this.normalizer=t}buildStyles(e,r){let t=new Map,o=r0(this.defaultParams);return Object.keys(e).forEach(n=>{let d=e[n];d!==null&&(o[n]=d)}),this.styles.styles.forEach(n=>
1326{typeof n!="string"&&n.forEach((d,_)=>{d&&(d=J_(d,o,r));let C=this.normalizer.normalizePropertyName(_,r);d=this.normalizer.normalizeStyleValue(_,C,d,r),t.set(_,d)})}),t}};function VY(i,e,r){return new iD(i,e,r)}var iD=class{constructor(e,r,t){this.name=e,this.ast=r,this._normalizer=t,this.transitionFactories=[],this.states=new Map,r.states.forEach(o=>{let n=o.options&&o.options.params||{};this.states.set(o.name,new tD(o.style,n,t))}),Q3(this.states,"true","1"),Q3(this.states,"false","0"),r.transitions.forEach(o=>{this.transitionFactories.push(new a1(e,o,this.states))}),this.fallbackTransition=BY(e,this.states,this._normalizer)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,r,t,o){return this.transitionFactories.find(d=>d.match(e,r,t,o))||null}matchStyles(e,r,t){return this.fallbackTransition.buildStyles(e,r,t)}};function BY(i,e,r){let n={type:1,animation:{type:2,steps:[],options:null},matchers:[(d,_)=>!0],options:null,queryCount:0,depCount:0};return new a1(i,n,e)}function Q3(i,e,r){i.has(e)?i.has(r)||i.set(r,i.get(e)):i.has(r)&&i.set(e,i.get(r))}var UY=new e0,nD=class{constructor(e,r,t){this.bodyNode=e,this._driver=r,this._normalizer=t,this._animations=new Map,this._playersById=new Map,this.players=[]}register(e,r){let t=[],o=[],n=pN(this._driver,r,t,o);if(t.length)throw tY(t);o.length&&void 0,this._animations.set(e,n)}_buildPlayer(e,r,t){let o=e.element,n=rN(this._normalizer,e.keyframes,r,t);return this._driver.animate(o,n,e.duration,e.delay,e.easing,[],!0)}create(e,r,t={}){let o=[],n=this._animations.get(e),d,_=new Map;if(n?(d=fN(this._driver,r,n,lN,qI,new Map,new Map,t,UY,o),d.forEach(j=>{let G=Is(_,j.element,new Map);j.postStyleProps.forEach(ie=>G.set(ie,null))})):(o.push(iY()),d=[]),o.length)throw nY(o);_.forEach((j,G)=>{j.forEach((ie,_e)=>{j.set(_e,this._driver.computeStyle(G,_e,wl))})});let C=d.map(j=>{let G=_.get(j.element);return this._buildPlayer(j,new Map,G)}),M=Su(C);return this._playersById.set(e,M),M.onDestroy(()=>this.destroy(e)),this.players.push(M),M}destroy(e){let r=this._getPlayer(e);r.destroy(),this._playersById.delete(e);let t=this.players.indexOf(r);t>=0&&this.players.splice(t,1)}_getPlayer(e){let r=this._playersById.get(e);if(!r)throw rY(e);return r}listen(e,r,t,o){let n=lD(r,"","","");return aD(this._getPlayer(e),t,n,o),()=>{}}command(e,r,t,o){if(t=="register"){this.register(e,o[0]);return}if(t=="create"){let d=o[0]||{};this.create(e,r,d);return}let n=this._getPlayer(e);switch(t){case"play":n.play();break;case"pause":n.pause();break;case"reset":n.reset();break;case"restart":n.restart();break;case"finish":n.finish();break;case"init":n.init();break;case"setPosition":n.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(e);break}}},J3="ng-animate-queued",HY=".ng-animate-queued",HI="ng-animate-disabled",$Y=".ng-animate-disabled",GY="ng-star-inserted",qY=".ng-star-inserted",WY=[],mN={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},ZY={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},La="__ng_removed",t0=class{get params(){return this.options.params}constructor(e,r=""){this.namespaceId=r;let t=e&&e.hasOwnProperty("value"),o=t?e.value:e;if(this.value=XY(o),t){let n=r0(e);delete n.value,this.options=n}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let r=e.params;if(r){let t=this.options.params;Object.keys(r).forEach(o=>{t[o]==null&&(t[o]=r[o])})}}},Q_="void",$I=new t0(Q_),rD=class{constructor(e,r,t){this.id=e,this.hostElement=r,this._engine=t,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"
vendor: 21,854 bytes, line 1326
1326+e,ta(r,this._hostClassName)}listen(e,r,t,o){if(!this._triggers.has(r))throw oY(t,r);if(t==null||t.length==0)throw sY(r);if(!YY(t))throw aY(t,r);let n=Is(this._elementListeners,e,[]),d={name:r,phase:t,callback:o};n.push(d);let _=Is(this._engine.statesByElement,e,new Map);return _.has(r)||(ta(e,Kx),ta(e,Kx+"-"+r),_.set(r,$I)),()=>{this._engine.afterFlush(()=>{let C=n.indexOf(d);C>=0&&n.splice(C,1),this._triggers.has(r)||_.delete(r)})}}register(e,r){return this._triggers.has(e)?!1:(this._triggers.set(e,r),!0)}_getTrigger(e){let r=this._triggers.get(e);if(!r)throw lY(e);return r}trigger(e,r,t,o=!0){let n=this._getTrigger(r),d=new i0(this.id,r,e),_=this._engine.statesByElement.get(e);_||(ta(e,Kx),ta(e,Kx+"-"+r),this._engine.statesByElement.set(e,_=new Map));let C=_.get(r),M=new t0(t,this.id);if(!(t&&t.hasOwnProperty("value"))&&C&&M.absorbOptions(C.options),_.set(r,M),C||(C=$I),!(M.value===Q_)&&C.value===M.value){if(!eQ(C.params,M.params)){let Ye=[],$e=n.matchStyles(C.value,C.params,Ye),at=n.matchStyles(M.value,M.params,Ye);Ye.length?this._engine.reportError(Ye):this._engine.afterFlush(()=>{ah(e,$e),Cl(e,at)})}return}let ie=Is(this._engine.playersByElement,e,[]);ie.forEach(Ye=>{Ye.namespaceId==this.id&&Ye.triggerName==r&&Ye.queued&&Ye.destroy()});let _e=n.matchTransition(C.value,M.value,e,M.params),Ee=!1;if(!_e){if(!o)return;_e=n.fallbackTransition,Ee=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:r,transition:_e,fromState:C,toState:M,player:d,isFallbackTransition:Ee}),Ee||(ta(e,J3),d.onStart(()=>{Nf(e,J3)})),d.onDone(()=>{let Ye=this.players.indexOf(d);Ye>=0&&this.players.splice(Ye,1);let $e=this._engine.playersByElement.get(e);if($e){let at=$e.indexOf(d);at>=0&&$e.splice(at,1)}}),this.players.push(d),ie.push(d),d}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(r=>r.delete(e)),this._elementListeners.forEach((r,t)=>{this._elementListeners.set(t,r.filter(o=>o.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let r=this._engine.playersByElement.get(e);r&&(r.forEach(t=>t.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,r){let t=this._engine.driver.query(e,e1,!0);t.forEach(o=>{if(o[La])return;let n=this._engine.fetchNamespacesByElement(o);n.size?n.forEach(d=>d.triggerLeaveAnimation(o,r,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>t.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(e,r,t,o){let n=this._engine.statesByElement.get(e),d=new Map;if(n){let _=[];if(n.forEach((C,M)=>{if(d.set(M,C.value),this._triggers.has(M)){let j=this.trigger(e,M,Q_,o);j&&_.push(j)}}),_.length)return this._engine.markElementAsRemoved(this.id,e,!0,r,d),t&&Su(_).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let r=this._elementListeners.get(e),t=this._engine.statesByElement.get(e);if(r&&t){let o=new Set;r.forEach(n=>{let d=n.name;if(o.has(d))return;o.add(d);let C=this._triggers.get(d).fallbackTransition,M=t.get(d)||$I,j=new t0(Q_),G=new i0(this.id,d,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:d,transition:C,fromState:M,toState:j,player:G,isFallbackTransition:!0})})}}removeNode(e,r){let t=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,r),this.triggerLeaveAnimation(e,r,!0))return;let o=!1;if(t.totalAnimations){let n=t.players.length?t.playersByQueriedElement.get(e):[];if(n&&n.length)o=!0;else{let d=e;for(;d=d.parentNode;)if(t.statesByElement.get(d)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(e),o)t.markElementAsRemoved(this.id,e,!1,r);else{let n=e[La];(!n||n===mN)&&(t.afterFlush(()=>this.clearElementCache(e)),t.destroyInnerAnimations(e),t._onRemovalComplete(e,r))}}insertNode(e,r){ta(e,this._hostClassName)}drainQueuedTransitions(e){let r=[];return this._queue.forEach(t=>{let o=t.player;if(o.destroyed)return;let n=t.element,d=this._elementListeners.get(n);d&&d.forEach(_=>{if(_.name==t.triggerName){let C=lD(n,t.triggerName,t.fromState.value,t.toState.value);C._data=e,aD(t.player,_.phase,C,_.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):r.push(t)}),this._queue=[],r.sort((t,o)=>{let n=t.transition.ast.depCount,d=o.transition.ast.depCount;return n==0||d==0?n-d:this._engine.driver.containsElement(t.element,o.element)?1:-1})}destroy(e){this.players.forEach(r=>r.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},oD=class{_onRemovalComplete(e,r){this.onRemovalComplete(e,r)}constructor(e,r,t){this.bodyNode=e,this.driver=r,this._normalizer=t,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(o,n)=>{}}get queuedPlayers(){let e=[];return this._namespaceList.forEach(r=>{r.players.forEach(t=>{t.queued&&e.push(t)})}),e}createNamespace(e,r){let t=new rD(e,r,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,r)?this._balanceNamespaceList(t,r):(this.newHostElements.set(r,t),this.collectEnterElement(r)),this._namespaceLookup[e]=t}_balanceNamespaceList(e,r){let t=this._namespaceList,o=this.namespacesByHostElement;if(t.length-1>=0){let d=!1,_=this.driver.getParentElement(r);for(;_;){let C=o.get(_);if(C){let M=t.indexOf(C);t.splice(M+1,0,e),d=!0;break}_=this.driver.getParentElement(_)}d||t.unshift(e)}else t.push(e);return o.set(r,e),e}register(e,r){let t=this._namespaceLookup[e];return t||(t=this.createNamespace(e,r)),t}registerTrigger(e,r,t){let o=this._namespaceLookup[e];o&&o.register(r,t)&&this.totalAnimations++}destroy(e,r){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let t=this._fetchNamespace(e);this.namespacesByHostElement.delete(t.hostElement);let o=this._namespaceList.indexOf(t);o>=0&&this._namespaceList.splice(o,1),t.destroy(r),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let r=new Set,t=this.statesByElement.get(e);if(t){for(let o of t.values())if(o.namespaceId){let n=this._fetchNamespace(o.namespaceId);n&&r.add(n)}}return r}trigger(e,r,t,o){if(Qx(r)){let n=this._fetchNamespace(e);if(n)return n.trigger(r,t,o),!0}return!1}insertNode(e,r,t,o){if(!Qx(r))return;let n=r[La];if(n&&n.setForRemoval){n.setForRemoval=!1,n.setForMove=!0;let d=this.collectedLeaveElements.indexOf(r);d>=0&&this.collectedLeaveElements.splice(d,1)}if(e){let d=this._fetchNamespace(e);d&&d.insertNode(r,t)}o&&this.collectEnterElement(r)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,r){r?this.disabledNodes.has(e)||(this.disabledNodes.add(e),ta(e,HI)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Nf(e,HI))}removeNode(e,r,t){if(Qx(r)){let o=e?this._fetchNamespace(e):null;o?o.removeNode(r,t):this.markElementAsRemoved(e,r,!1,t);let n=this.namespacesByHostElement.get(r);n&&n.id!==e&&n.removeNode(r,t)}else this._onRemovalComplete(r,t)}markElementAsRemoved(e,r,t,o,n){this.collectedLeaveElements.push(r),r[La]={namespaceId:e,setForRemoval:o,hasAnimation:t,removedBeforeQueried:!1,previousTriggersValues:n}}listen(e,r,t,o,n){return Qx(r)?this._fetchNamespace(e).listen(r,t,o,n):()=>{}}_buildInstruction(e,r,t,o,n){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,t,o,e.fromState.options,e.toState.options,r,n)}destroyInnerAnimations(e){let r=this.driver.query(e,e1,!0);r.forEach(t=>this.destroyActiveAnimationsForElement(t)),this.playersByQueriedElement.size!=0&&(r=this.driver.query(e,WI,!0),r.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(e){let r=this.playersByElement.get(e);r&&r.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(e){let r=this.playersByQueriedElement.get(e);r&&r.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Su(this.players).onDone(()=>e());e()})}processLeaveNode(e){let r=e[La];if(r&&r.setForRemoval){if(e[La]=mN,r.namespaceId){this.destroyInnerAnimations(e);let t=this._fetchNamespace(r.namespaceId);t&&t.clearElementCache(e)}this._onRemovalComplete(e,r.setForRemoval)}e.classList?.contains(HI)&&this.markElementAsDisabled(e,!1),this.driver.query(e,$Y,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(e=-1){let r=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,o)=>this._balanceNamespaceList(t,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let t=0;t<this.collectedEnterElements.length;t++){let o=this.collectedEnterElements[t];ta(o,GY)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let t=[];try{r=this._flushAnimations(t,e)}finally{for(let o=0;o<t.length;o++)t[o]()}}else for(let t=0;t<this.collectedLeaveElements.length;t++){let o=this.collectedLeaveElements[t];this.processLeaveNode(o)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(t=>t()),this._flushFns=[],this._whenQuietFns.length){let t=this._whenQuietFns;this._whenQuietFns=[],r.length?Su(r).onDone(()=>{t.forEach(o=>o())}):t.forEach(o=>o())}}reportError(e){throw cY(e)}_flushAnimations(e,r){let t=new e0,o=[],n=new Map,d=[],_=new Map,C=new Map,M=new Map,j=new Set;this.disabledNodes.forEach(pt=>{j.add(pt);let Zt=this.driver.query(pt,HY,!0);for(let Ft=0;Ft<Zt.length;Ft++)j.add(Zt[Ft])});let G=this.bodyNode,ie=Array.from(this.statesByElement.keys()),_e=iN(ie,this.collectedEnterElements),Ee=new Map,Ye=0;_e.forEach((pt,Zt)=>{let Ft=lN+Ye++;Ee.set(Zt,Ft),pt.forEach(ri=>ta(ri,Ft))});let $e=[],at=new Set,Lt=new Set;for(let pt=0;pt<this.collectedLeaveElements.length;pt++){let Zt=this.collectedLeaveElements[pt],Ft=Zt[La];Ft&&Ft.setForRemoval&&($e.push(Zt),at.add(Zt),Ft.hasAnimation?this.driver.query(Zt,qY,!0).forEach(ri=>at.add(ri)):Lt.add(Zt))}let jt=new Map,$t=iN(ie,Array.from(at));$t.forEach((pt,Zt)=>{let Ft=qI+Ye++;jt.set(Zt,Ft),pt.forEach(ri=>ta(ri,Ft))}),e.push(()=>{_e.forEach((pt,Zt)=>{let Ft=Ee.get(Zt);pt.forEach(ri=>Nf(ri,Ft))}),$t.forEach((pt,Zt)=>{let Ft=jt.get(Zt);pt.forEach(ri=>Nf(ri,Ft))}),$e.forEach(pt=>{this.processLeaveNode(pt)})});let tn=[],Fi=[];for(let pt=this._namespaceList.length-1;pt>=0;pt--)this._namespaceList[pt].drainQueuedTransitions(r).forEach(Ft=>{let ri=Ft.player,Pn=Ft.element;if(tn.push(ri),this.collectedEnterElements.length){let Zn=Pn[La];if(Zn&&Zn.setForMove){if(Zn.previousTriggersValues&&Zn.previousTriggersValues.has(Ft.triggerName)){let fo=Zn.previousTriggersValues.get(Ft.triggerName),ii=this.statesByElement.get(Ft.element);if(ii&&ii.has(Ft.triggerName)){let as=ii.get(Ft.triggerName);as.value=fo,ii.set(Ft.triggerName,as)}}ri.destroy();return}}let cn=!G||!this.driver.containsElement(G,Pn),ir=jt.get(Pn),ao=Ee.get(Pn),un=this._buildInstruction(Ft,t,ao,ir,cn);if(un.errors&&un.errors.length){Fi.push(un);return}if(cn){ri.onStart(()=>ah(Pn,un.fromStyles)),ri.onDestroy(()=>Cl(Pn,un.toStyles)),o.push(ri);return}if(Ft.isFallbackTransition){ri.onStart(()=>ah(Pn,un.fromStyles)),ri.onDestroy(()=>Cl(Pn,un.toStyles)),o.push(ri);return}let Vo=[];un.timelines.forEach(Zn=>{Zn.stretchStartingKeyframe=!0,this.disabledNodes.has(Zn.element)||Vo.push(Zn)}),un.timelines=Vo,t.append(Pn,un.timelines);let fc={instruction:un,player:ri,element:Pn};d.push(fc),un.queriedElements.forEach(Zn=>Is(_,Zn,[]).push(ri)),un.preStyleProps.forEach((Zn,fo)=>{if(Zn.size){let ii=C.get(fo);ii||C.set(fo,ii=new Set),Zn.forEach((as,zr)=>ii.add(zr))}}),un.postStyleProps.forEach((Zn,fo)=>{let ii=M.get(fo);ii||M.set(fo,ii=new Set),Zn.forEach((as,zr)=>ii.add(zr))})});if(Fi.length){let pt=[];Fi.forEach(Zt=>{pt.push(uY(Zt.triggerName,Zt.errors))}),tn.forEach(Zt=>Zt.destroy()),this.reportError(pt)}let tt=new Map,Sr=new Map;d.forEach(pt=>{let Zt=pt.element;t.has(Zt)&&(Sr.set(Zt,Zt),this._beforeAnimationBuild(pt.player.namespaceId,pt.instruction,tt))}),o.forEach(pt=>{let Zt=pt.element;this._getPreviousPlayers(Zt,!1,pt.namespaceId,pt.triggerName,null).forEach(ri=>{Is(tt,Zt,[]).push(ri),ri.destroy()})});let so=$e.filter(pt=>nN(pt,C,M)),ai=new Map;tN(ai,this.driver,Lt,M,wl).forEach(pt=>{nN(pt,C,M)&&so.push(pt)});let na=new Map;_e.forEach((pt,Zt)=>{tN(na,this.driver,new Set(pt),C,Zx)}),so.forEach(pt=>{let Zt=ai.get(pt),Ft=na.get(pt);ai.set(pt,new Map([...Zt?.entries()??[],...Ft?.entries()??[]]))});let jo=[],Fa=[],Tl={};d.forEach(pt=>{let{element:Zt,player:Ft,instruction:ri}=pt;if(t.has(Zt)){if(j.has(Zt)){Ft.onDestroy(()=>Cl(Zt,ri.toStyles)),Ft.disabled=!0,Ft.overrideTotalTime(ri.totalTime),o.push(Ft);return}let Pn=Tl;if(Sr.size>1){let ir=Zt,ao=[];for(;ir=ir.parentNode;){let un=Sr.get(ir);if(un){Pn=un;break}ao.push(ir)}ao.forEach(un=>Sr.set(un,Pn))}let cn=this._buildAnimation(Ft.namespaceId,ri,tt,n,na,ai);if(Ft.setRealPlayer(cn),Pn===Tl)jo.push(Ft);else{let ir=this.playersByElement.get(Pn);ir&&ir.length&&(Ft.parentPlayer=Su(ir)),o.push(Ft)}}else ah(Zt,ri.fromStyles),Ft.onDestroy(()=>Cl(Zt,ri.toStyles)),Fa.push(Ft),j.has(Zt)&&o.push(Ft)}),Fa.forEach(pt=>{let Zt=n.get(pt.element);if(Zt&&Zt.length){let Ft=Su(Zt);pt.setRealPlayer(Ft)}}),o.forEach(pt=>{pt.parentPlayer?pt.syncPlayerEvents(pt.parentPlayer):pt.destroy()});for(let pt=0;pt<$e.length;pt++){let Zt=$e[pt],Ft=Zt[La];if(Nf(Zt,qI),Ft&&Ft.hasAnimation)continue;let ri=[];if(_.size){let cn=_.get(Zt);cn&&cn.length&&ri.push(...cn);let ir=this.driver.query(Zt,WI,!0);for(let ao=0;ao<ir.length;ao++){let un=_.get(ir[ao]);un&&un.length&&ri.push(...un)}}let Pn=ri.filter(cn=>!cn.destroyed);Pn.length?QY(this,Zt,Pn):this.processLeaveNode(Zt)}return $e.length=0,jo.forEach(pt=>{this.players.push(pt),pt.onDone(()=>{pt.destroy();let Zt=this.players.indexOf(pt);this.players.splice(Zt,1)}),pt.play()}),jo}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,r,t,o,n){let d=[];if(r){let _=this.playersByQueriedElement.get(e);_&&(d=_)}else{let _=this.playersByElement.get(e);if(_){let C=!n||n==Q_;_.forEach(M=>{M.queued||!C&&M.triggerName!=o||d.push(M)})}}return(t||o)&&(d=d.filter(_=>!(t&&t!=_.namespaceId||o&&o!=_.triggerName))),d}_beforeAnimationBuild(e,r,t){let o=r.triggerName,n=r.element,d=r.isRemovalTransition?void 0:e,_=r.isRemovalTransition?void 0:o;for(let C of r.timelines){let M=C.element,j=M!==n,G=Is(t,M,[]);this._getPreviousPlayers(M,j,d,_,r.toState).forEach(_e=>{let Ee=_e.getRealPlayer();Ee.beforeDestroy&&Ee.beforeDestroy(),_e.destroy(),G.push(_e)})}ah(n,r.fromStyles)}_buildAnimation(e,r,t,o,n,d){let _=r.triggerName,C=r.element,M=[],j=new Set,G=new Set,ie=r.timelines.map(Ee=>{let Ye=Ee.element;j.add(Ye);let $e=Ye[La];if($e&&$e.removedBeforeQueried)return new Eu(Ee.duration,Ee.delay);let at=Ye!==C,Lt=JY((t.get(Ye)||WY).map(tt=>tt.getRealPlayer())).filter(tt=>{let Sr=tt;return Sr.element?Sr.element===Ye:!1}),jt=n.get(Ye),$t=d.get(Ye),tn=rN(this._normalizer,Ee.keyframes,jt,$t),Fi=this._buildPlayer(Ee,tn,Lt);if(Ee.subTimeline&&o&&G.add(Ye),at){let tt=new i0(e,_,Ye);tt.setRealPlayer(Fi),M.push(tt)}return Fi});M.forEach(Ee=>{Is(this.playersByQueriedElement,Ee.element,[]).push(Ee),Ee.onDone(()=>KY(this.playersByQueriedElement,Ee.element,Ee))}),j.forEach(Ee=>ta(Ee,W3));let _e=Su(ie);return _e.onDestroy(()=>{j.forEach(Ee=>Nf(Ee,W3)),Cl(C,r.toStyles)}),G.forEach(Ee=>{Is(o,Ee,[]).push(_e)}),_e}_buildPlayer(e,r,t){return r.length>0?this.driver.animate(e.element,r,e.duration,e.delay,e.easing,t):new Eu(e.duration,e.delay)}},i0=class{constructor(e,r,t){this.namespaceId=e,this.triggerName=r,this.element=t,this._player=new Eu,this._containsRealPlayer=!1,this._queuedCallbacks=new Map,this.destroyed=!1,this.parentPlayer=null,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((r,t)=>{r.forEach(o=>aD(e,t,void 0,o))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){let r=this._player;r.triggerCallback&&e.onStart(()=>r.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,r){Is(this._queuedCallbacks,e,[]).push(r)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){let r=this._player;r.triggerCallback&&r.triggerCallback(e)}};function KY(i,e,r){let t=i.get(e);if(t){if(t.length){let o=t.indexOf(r);t.splice(o,1)}t.length==0&&i.delete(e)}return t}function XY(i){return i??null}function Qx(i){return i&&i.nodeType===1}function YY(i){return i=="start"||i=="done"}function eN(i,e){let r=i.style.display;return i.style.display=e??"none",r}function tN(i,e,r,t,o){let n=[];r.forEach(C=>n.push(eN(C)));let d=[];t.forEach((C,M)=>{let j=new Map;C.forEach(G=>{let ie=e.computeStyle(M,G,o);j.set(G,ie),(!ie||ie.length==0)&&(M[La]=ZY,d.push(M))}),i.set(M,j)});let _=0;return r.forEach(C=>eN(C,n[_++])),d}function iN(i,e){let r=new Map;if(i.forEach(_=>r.set(_,[])),e.length==0)return r;let t=1,o=new Set(e),n=new Map;function d(_){if(!_)return t;let C=n.get(_);if(C)return C;let M=_.parentNode;return r.has(M)?C=M:o.has(M)?C=t:C=d(M),n.set(_,C),C}return e.forEach(_=>{let C=d(_);C!==t&&r.get(C).push(_)}),r}function ta(i,e){i.classList?.add(e)}function Nf(i,e){i.classList?.remove(e)}function QY(i,e,r){Su(r).onDone(()=>i.processLeaveNode(e))}function JY(i){let e=[];return gN(i,e),e}function gN(i,e){for(let r=0;r<i.length;r++){let t=i[r];t instanceof X_?gN(t.players,e):e.push(t)}}function eQ(i,e){let r=Object.keys(i),t=Object.keys(e);if(r.length!=t.length)return!1;for(let o=0;o<r.length;o++){let n=r[o];if(!e.hasOwnProperty(n)||i[n]!==e[n])return!1}return!0}function nN(i,e,r){let t=r.get(i);if(!t)return!1;let o=e.get(i);return o?t.forEach(n=>o.add(n)):e.set(i,t),r.delete(i),!0}var jf=class{constructor(e,r,t){this._driver=r,this._normalizer=t,this._triggerCache={},this.onRemovalComplete=(o,n)=>{},this._transitionEngine=new oD(e.body,r,t),this._timelineEngine=new nD(e.body,r,t),this._transitionEngine.onRemovalComplete=(o,n)=>this.onRemovalComplete(o,n)}registerTrigger(e,r,t,o,n){let d=e+"-"+o,_=this._triggerCache[d];if(!_){let C=[],M=[],j=pN(this._driver,n,C,M);if(C.length)throw JX(o,C);M.length&&void 0,_=VY(o,j,this._normalizer),this._triggerCache[d]=_}this._transitionEngine.registerTrigger(r,o,_)}register(e,r){this._transitionEngine.register(e,r)}destroy(e,r){this._transitionEngine.destroy(e,r)}onInsert(e,r,t,o){this._transitionEngine.insertNode(e,r,t,o)}onRemove(e,r,t){this._transitionEngine.removeNode(e,r,t)}disableAnimations(e,r){this._transitionEngine.markElementAsDisabled(e,r)}process(e,r,t,o){if(t.charAt(0)=="@"){let[n,d]=G3(t),_=o;this._timelineEngine.command(n,r,d,_)}else this._transitionEngine.trigger(e,r,t,o)}listen(e,r,t,o,n){if(t.charAt(0)=="@"){let[d,_]=G3(t);return this._timelineEngine.listen(d,r,_,n)}return this._transitionEngine.listen(e,r,t,o,n)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}};function tQ(i,e){let r=null,t=null;return Array.isArray(e)&&e.length?(r=GI(e[0]),e.length>1&&(t=GI(e[e.length-1]))):e instanceof Map&&(r=GI(e)),r||t?new iQ(i,r,t):null}var iQ=(()=>{let e=class e{constructor(t,o,n){this._element=t,this._startStyles=o,this._endStyles=n,this._state=0;let d=e.initialStylesByElement.get(t);d||e.initialStylesByElement.set(t,d=new Map),this._initialStyles=d}start(){this._state<1&&(this._startStyles&&Cl(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Cl(this._element,this._initialStyles),this._endStyles&&(Cl(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(e.initialStylesByElement.delete(this._element),this._startStyles&&(ah(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(ah(this._element,this._endStyles),this._endStyles=null),Cl(this._element,this._initialStyles),this._state=3)}};e.initialStylesByElement=new WeakMap;let i=e;return i})();function GI(i){let e=null;return i.forEach((r,t)=>{nQ(t)&&(e=e||new Map,e.set(t,r))}),e}function nQ(i){return i==="display"||i==="position"}var l1=class{constructor(e,r,t,o){this.element=e,this.keyframes=r,this.options=t,this._specialStyles=o,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this._originalOnDoneFns=[],this._originalOnStartFns=[],this.time=0,this.parentPlayer=null,this.currentSnapshot=new Map,this._duration=t.duration,this._delay=t.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e
1326=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let r=()=>this._onFinish();this.domPlayer.addEventListener("finish",r),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",r)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let r=[];return e.forEach(t=>{r.push(Object.fromEntries(t))}),r}_triggerWebAnimation(e,r,t){return e.animate(this._convertKeyframesToObject(r),t)}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((t,o)=>{o!=="offset"&&e.set(o,this._finished?t:dN(this.element,o))}),this.currentSnapshot=e}triggerCallback(e){let r=e==="start"?this._onStartFns:this._onDoneFns;r.forEach(t=>t()),r.length=0}},c1=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}matchesElement(e,r){return!1}containsElement(e,r){return oN(e,r)}getParentElement(e){return cD(e)}query(e,r,t){return sN(e,r,t)}computeStyle(e,r,t){return window.getComputedStyle(e)[r]}animate(e,r,t,o,n,d=[]){let _=o==0?"both":"forwards",C={duration:t,delay:o,fill:_};n&&(C.easing=n);let M=new Map,j=d.filter(_e=>_e instanceof l1);xY(t,o)&&j.forEach(_e=>{_e.currentSnapshot.forEach((Ee,Ye)=>M.set(Ye,Ee))});let G=vY(r).map(_e=>zf(_e));G=wY(e,G,M);let ie=tQ(e,G);return new l1(e,G,C,ie)}};var Jx="@",_N="@.disabled",u1=class{constructor(e,r,t,o){this.namespaceId=e,this.delegate=r,this.engine=t,this._onDestroy=o,this.\u0275type=0}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,r){return this.delegate.createElement(e,r)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,r){this.delegate.appendChild(e,r),this.engine.onInsert(this.namespaceId,r,e,!1)}insertBefore(e,r,t,o=!0){this.delegate.insertBefore(e,r,t),this.engine.onInsert(this.namespaceId,r,e,o)}removeChild(e,r,t){this.engine.onRemove(this.namespaceId,r,this.delegate)}selectRootElement(e,r){return this.delegate.selectRootElement(e,r)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,r,t,o){this.delegate.setAttribute(e,r,t,o)}removeAttribute(e,r,t){this.delegate.removeAttribute(e,r,t)}addClass(e,r){this.delegate.addClass(e,r)}removeClass(e,r){this.delegate.removeClass(e,r)}setStyle(e,r,t,o){this.delegate.setStyle(e,r,t,o)}removeStyle(e,r,t){this.delegate.removeStyle(e,r,t)}setProperty(e,r,t){r.charAt(0)==Jx&&r==_N?this.disableAnimations(e,!!t):this.delegate.setProperty(e,r,t)}setValue(e,r){this.delegate.setValue(e,r)}listen(e,r,t){return this.delegate.listen(e,r,t)}disableAnimations(e,r){this.engine.disableAnimations(e,r)}},sD=class extends u1{constructor(e,r,t,o,n){super(r,t,o,n),this.factory=e,this.namespaceId=r}setProperty(e,r,t){r.charAt(0)==Jx?r.charAt(1)=="."&&r==_N?(t=t===void 0?!0:!!t,this.disableAnimations(e,t)):this.engine.process(this.namespaceId,e,r.slice(1),t):this.delegate.setProperty(e,r,t)}listen(e,r,t){if(r.charAt(0)==Jx){let o=rQ(e),n=r.slice(1),d="";return n.charAt(0)!=Jx&&([n,d]=oQ(n)),this.engine.listen(this.namespaceId,o,n,d,_=>{let C=_._data||-1;this.factory.scheduleListenerCallback(C,t,_)})}return this.delegate.listen(e,r,t)}};function rQ(i){switch(i){case"body":return document.body;case"document":return document;case"window":return window;default:return i}}function oQ(i){let e=i.indexOf("."),r=i.substring(0,e),t=i.slice(e+1);return[r,t]}var d1=class{constructor(e,r,t){this.delegate=e,this.engine=r,this._zone=t,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,r.onRemovalComplete=(o,n)=>{let d=n?.parentNode(o);d&&n.removeChild(d,o)}}createRenderer(e,r){let t="",o=this.delegate.createRenderer(e,r);if(!e||!r?.data?.animation){let M=this._rendererCache,j=M.get(o);if(!j){let G=()=>M.delete(o);j=new u1(t,o,this.engine,G),M.set(o,j)}return j}let n=r.id,d=r.id+"-"+this._currentId;this._currentId++,this.engine.register(d,e);let _=M=>{Array.isArray(M)?M.forEach(_):this.engine.registerTrigger(n,d,e,M.name,M)};return r.data.animation.forEach(_),new sD(this,d,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,r,t){if(e>=0&&e<this._microtaskId){this._zone.run(()=>r(t));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(n=>{let[d,_]=n;d(_)}),this._animationCallbacksBuffer=[]})}),o.push([r,t])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}};var aQ=(()=>{let e=class e extends jf{constructor(t,o,n,d){super(t,o,n)}ngOnDestroy(){this.flush()}};e.\u0275fac=function(o){return new(o||e)(Ve($i),Ve(n0),Ve(lh),Ve(ul))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();function lQ(){return new n1}function cQ(i,e,r){return new d1(i,e,r)}var vN=[{provide:lh,useFactory:lQ},{provide:jf,useClass:aQ},{provide:Vd,useFactory:cQ,deps:[ix,jf,qt]}],R0e=[{provide:n0,useFactory:()=>new c1},{provide:tc,useValue:"BrowserAnimations"},...vN],uQ=[{provide:n0,useClass:uD},{provide:tc,useValue:"NoopAnimations"},...vN];function yN(){return[...uQ]}var fD;try{fD=typeof Intl<"u"&&Intl.v8BreakIterator}catch{fD=!1}var ia=(()=>{let e=class e{constructor(t){this._platformId=t,this.isBrowser=this._platformId?Si(this._platformId):typeof document=="object"&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(m
1326sie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!!(window.chrome||fD)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}};e.\u0275fac=function(o){return new(o||e)(Ve(Qt))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var o0;function dQ(){if(o0==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>o0=!0}))}finally{o0=o0||!1}return o0}function El(i){return dQ()?i:!!i.capture}var pD;function hQ(){if(pD==null){let i=typeof document<"u"?document.head:null;pD=!!(i&&(i.createShadowRoot||i.attachShadow))}return pD}function s0(i){if(hQ()){let e=i.getRootNode?i.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}function Ds(i){return i.composedPath?i.composedPath()[0]:i.target}function bN(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}function a0(i,e=0){return pQ(i)?Number(i):e}function pQ(i){return!isNaN(parseFloat(i))&&!isNaN(Number(i))}function l0(i){return Array.isArray(i)?i:[i]}function vr(i){return i instanceof Pi?i.nativeElement:i}var xN=new Set,ch,fQ=(()=>{let e=class e{constructor(t,o){this._platform=t,this._nonce=o,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):gQ}matchMedia(t){return(this._platform.WEBKIT||this._platform.BLINK)&&mQ(t,this._nonce),this._matchMedia(t)}};e.\u0275fac=function(o){return new(o||e)(Ve(ia),Ve(Qg,8))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function mQ(i,e){if(!xN.has(i))try{ch||(ch=document.createElement("style"),e&&(ch.nonce=e),ch.setAttribute("type","text/css"),document.head.appendChild(ch)),ch.sheet&&(ch.sheet.insertRule(`@media ${i} {body{ }}`,0),xN.add(i))}catch(r){console.error(r)}}function gQ(i){return{matches:i==="all"||i==="",media:i,addListener:()=>{},removeListener:()=>{}}}var CN=(()=>{let e=class e{constructor(t,o){this._mediaMatcher=t,this._zone=o,this._queries=new Map,this._destroySubject=new Jt}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return wN(l0(t)).some(n=>this._registerQuery(n).mql.matches)}observe(t){let n=wN(l0(t)).map(_=>this._registerQuery(_).observable),d=Md(n);return d=Xc(d.pipe(Ur(1)),d.pipe(kg(1),Mg(0))),d.pipe(ei(_=>{let C={matches:!1,breakpoints:{}};return _.forEach(({matches:M,query:j})=>{C.matches=C.matches||M,C.breakpoints[j]=M}),C}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);let o=this._mediaMatcher.matchMedia(t),d={observable:new gi(_=>{let C=M=>this._zone.run(()=>_.next(M));return o.addListener(C),()=>{o.removeListener(C)}}).pipe(Bs(o),ei(({matches:_})=>({query:t,matches:_})),es(this._destroySubject)),mql:o};return this._queries.set(t,d),d}};e.\u0275fac=function(o){return new(o||e)(Ve(fQ),Ve(qt))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();function wN(i){return i.map(e=>e.split(",")).reduce((e,r)=>e.concat(r)).map(e=>e.trim())}function c0(i){return i.buttons===0||i.detail===0}function u0(i){let e=i.touches&&i.touches[0]||i.changedTouches&&i.changedTouches[0];return!!e&&e.identifier===-1&&(e.radiusX==null||e.radiusX===1)&&(e.radiusY==null||e.radiusY===1)}var _Q=new Ct("cdk-input-modality-detector-options"),vQ={ignoreKeys:[18,17,224,91,16]},TN=650,Vf=El({passive:!0,capture:!0}),yQ=(()=>{let e=class e{get mostRecentModality(){return this._modality.value}constructor(t,o,n,d){this._platform=t,this._mostRecentTarget=null,this._modality=new Cr(null),this._lastTouchMs=0,this._onKeydown=_=>{this._options?.ignoreKeys?.some(C=>
1326C===_.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=Ds(_))},this._onMousedown=_=>{Date.now()-this._lastTouchMs<TN||(this._modality.next(c0(_)?"keyboard":"mouse"),this._mostRecentTarget=Ds(_))},this._onTouchstart=_=>{if(u0(_)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Ds(_)},this._options=bt(bt({},vQ),d),this.modalityDetected=this._modality.pipe(kg(1)),this.modalityChanged=this.modalityDetected.pipe(kd()),t.isBrowser&&o.runOutsideAngular(()=>{n.addEventListener("keydown",this._onKeydown,Vf),n.addEventListener("mousedown",this._onMousedown,Vf),n.addEventListener("touchstart",this._onTouchstart,Vf)})}ngOnDestroy(){this._modality.complete(),this._platform.isBrowser&&(document.removeEventListener("keydown",this._onKeydown,Vf),document.removeEventListener("mousedown",this._onMousedown,Vf),document.removeEventListener("touchstart",this._onTouchstart,Vf))}};e.\u0275fac=function(o){return new(o||e)(Ve(ia),Ve(qt),Ve($i),Ve(_Q,8))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var bQ=new Ct("cdk-focus-monitor-default-options"),p1=El({passive:!0,capture:!0}),IN=(()=>{let e=class e{constructor(t,o,n,d,_){this._ngZone=t,this._platform=o,this._inputModalityDetector=n,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=window.setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new Jt,this._rootNodeFocusAndBlurListener=C=>{let M=Ds(C);for(let j=M;j;j=j.parentElement)C.type==="focus"?this._onFocus(C,j):this._onBlur(C,j)},this._document=d,this._detectionMode=_?.detectionMode||0}monitor(t,o=!1){let n=vr(t);if(!this._platform.isBrowser||n.nodeType!==1)return Bt();let d=s0(n)||this._getDocument(),_=this._elementInfo.get(n);if(_)return o&&(_.checkChildren=!0),_.subject;let C={checkChildren:o,subject:new Jt,rootNode:d};return this._elementInfo.set(n,C),this._registerGlobalListeners(C),C.subject}stopMonitoring(t){let o=vr(t),n=this._elementInfo.get(o);n&&(n.subject.complete(),this._setClasses(o),this._elementInfo.delete(o),this._removeGlobalListeners(n))}focusVia(t,o,n){let d=vr(t),_=this._getDocument().activeElement;d===_?this._getClosestElementsInfo(d).forEach(([C,M])=>this._originChanged(C,o,M)):(this._setOrigin(o),typeof d.focus=="function"&&d.focus(n))}ngOnDestroy(){this._elementInfo.forEach((t,o)=>this.stopMonitoring(o))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:t&&this._isLastInteractionFromInputLabel(t)?"mouse":"program"}_shouldBeAttributedToTouch(t){return this._detectionMode===1||!!t?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(t,o){t.classList.toggle("cdk-focused",!!o),t.classList.toggle("cdk-touch-focused",o==="touch"),t.classList.toggle("cdk-keyboard-focused",o==="keyboard"),t.classList.toggle("cdk-mouse-focused",o==="mouse"),t.classList.toggle("cdk-program-focused",o==="program")}_setOrigin(t,o=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=t,this._originFromTouchInteraction=t==="touch"&&o,this._detectionMode===0){clearTimeout(this._originTimeoutId);let n=this._originFromTouchInteraction?TN:1;this._originTimeoutId=setTimeout(()=>this._origin=null,n)}})}_onFocus(t,o){let n=this._elementInfo.get(o),d=Ds(t);!n||!n.checkChildren&&o!==d||this._originChanged(o,this._getFocusOrigin(d),n)}_onBlur(t,o){let n=this._elementInfo.get(o);!n||n.checkChildren&&t.relatedTarget instanceof Node&&o.contains(t.relatedTarget)||(this._setClasses(o),this._emitOrigin(n,null))}_emitOrigin(t,o){t.subject.observers.length&&this._ngZone.run(()=>t.subject.next(o))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;let o=t.rootNode,n=this._rootNodeFocusListenerCount.get(o)||0;n||this._ngZone.runOutsideAngular(()=>{o.addEventListener("focus",this._rootNodeFocusAndBlurListener,p1),o.addEventListener("blur",this._rootNodeFocusAndBlurListener,p1)}),this._rootNodeFocusListenerCount.set(o,n+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(es(this._stopInputModalityDetector)).subscribe(d=>{this._setOrigin(d,!0)}))}_removeGlobalListeners(t){let o=t.rootNode;if(this._rootNodeFocusListenerCount.has(o)){let n=this._rootNodeFocusListenerCount.get(o);n>1?this._rootNodeFocusListenerCount.set(o,n-1):(o.removeEventListener("focus",this._rootNodeFocusAndBlurListener,p1),o.removeEventListener("blur",this._rootNodeFocusAndBlurListener,p1),this._rootNodeFocusListenerCount.delete(o))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,o,n){this._setClasses(t,o),this._emitOrigin(n,o),this._lastFocusOrigin=o}_getClosestElementsInfo(t){let o=[];return this._elementInfo.forEach((n,d)=>{(d===t||n.checkChildren&&d.contains(t))&&o.push([d,n])}),o}_isLastInteractionFromInputLabel(t){let{_mostRecentTarget:o,mostRecentModality:n}=this._inputModalityDetector;if(n!=="mouse"||!o||o===t||t.nodeName!=="INPUT"&&t.nodeName!=="TEXTAREA"||t.disabled)return!1;let d=t.labels;if(d){for(let _=0;_<d.length;_++)if(d[_].contains(o))return!0}return!1}};e.\u0275fac=function(o){return new(o||e)(Ve(qt),Ve(ia),Ve(yQ),Ve($i,8),Ve(bQ,8))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var EN="cdk-high-contrast-black-on-white",SN="cdk-high-contrast-white-on-black",mD="cdk-high-contrast-active",DN=(()=>{let e=class e{constructor(t,o){this._platform=t,this._document=o,this._breakpointSubscription=_t(CN).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasse
1326s())})}getHighContrastMode(){if(!this._platform.isBrowser)return 0;let t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);let o=this._document.defaultView||window,n=o&&o.getComputedStyle?o.getComputedStyle(t):null,d=(n&&n.backgroundColor||"").replace(/ /g,"");switch(t.remove(),d){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return 2;case"rgb(255,255,255)":case"rgb(255,250,239)":return 1}return 0}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){let t=this._document.body.classList;t.remove(mD,EN,SN),this._hasCheckedHighContrastMode=!0;let o=this.getHighContrastMode();o===1?t.add(mD,EN):o===2&&t.add(mD,SN)}}};e.\u0275fac=function(o){return new(o||e)(Ve(ia),Ve($i))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var xQ=new Ct("cdk-dir-doc",{providedIn:"root",factory:wQ});function wQ(){return _t($i)}var CQ=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function EQ(i){let e=i?.toLowerCase()||"";return e==="auto"&&typeof navigator<"u"&&navigator?.language?CQ.test(navigator.language)?"rtl":"ltr":e==="rtl"?"rtl":"ltr"}var gD=(()=>{let e=class e{constructor(t){if(this.value="ltr",this.change=new Fe,t){let o=t.body?t.body.dir:null,n=t.documentElement?t.documentElement.dir:null;this.value=EQ(o||n||"ltr")}}ngOnDestroy(){this.change.complete()}};e.\u0275fac=function(o){return new(o||e)(Ve(xQ,8))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var _D=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({});let i=e;return i})();function TQ(){return!0}var IQ=new Ct("mat-sanity-checks",{providedIn:"root",factory:TQ}),h0=(()=>{let e=class e{constructor(t,o,n){this._sanityChecks=o,this._document=n,this._hasDoneGlobalChecks=!1,t._applyBodyHighContrastModeCssClasses(),this._hasDoneGlobalChecks||(this._hasDoneGlobalChecks=!0)}_checkIsEnabled(t){return bN()?!1:typeof this._sanityChecks=="boolean"?this._sanityChecks:!!this._sanityChecks[t]}};e.\u0275fac=function(o){return new(o||e)(Ve(DN),Ve(IQ,8),Ve($i))},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({imports:[_D,_D]});let i=e;return i})();var vD=class{constructor(e,r,t,o=!1){this._renderer=e,this.element=r,this.config=t,this._animationForciblyDisabledThroughCss=o,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}},kN=El({passive:!0,capture:!0}),yD=class{constructor(){this._events=new Map,this._delegateEventHandler=e=>{let r=Ds(e);r&&this._events.get(e.type)?.forEach((t,o)=>{(o===r||o.contains(r))&&t.forEach(n=>n.handleEvent(e))})}}addHandler(e,r,t,o){let n=this._events.get(r);if(n){let d=n.get(t);d?d.add(o):n.set(t,new Set([o]))}else this._events.set(r,new Map([[t,new Set([o])]])),e.runOutsideAngular(()=>{document.addEventListener(r,this._delegateEventHandler,kN)})}removeHandler(e,r,t){let o=this._events.get(e);if(!o)return;let n=o.get(r);n&&(n.delete(t),n.size===0&&o.delete(r),o.size===0&&(this._events.delete(e),document.removeEventListener(e,this._delegateEventHandler,kN)))}},AN={enterDuration:225,exitDuration:150},DQ=800,PN=El({passive:!0,capture:!0}),ON=["mousedown","touchstart"],RN=["mouseup","mouseleave","touchend","touchcancel"],d0=class d0{constructor(e,r,t,o){this._target=e,this._ngZone=r,this._platform=o,this._isPointerDown=!1,this._activeRipples=new Map,this._pointerUpEventsRegistered=!1,o.isBrowser&&(this._containerElement=vr(t))}fadeInRipple(e,r,t={}){let o=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),n=bt(bt({},AN),t.animation);t.centered&&(e=o.left+o.width/2,r=o.top+o.height/2);let d=t.radius||MQ(e,r,o),_=e-o.left,C=r-o.top,M=n.enterDuration,j=document.createElement("div");j.classList.add("mat-ripple-element"),j.style.left=`${_-d}px`,j.style.top=`${C-d}px`,j.style.height=`${d*2}px`,j.style.width=`${d*2}px`,t.color!=null&&(j.style.backgroundColor=t.color),j.style.transitionDuration=`${M}ms`,this._containerElement.appendChild(j);let G=window.getComputedStyle(j),ie=G.transitionProperty,_e=G.transitionDuration,Ee=ie==="none"||_e==="0s"||_e==="0s, 0s"||o.width===0&&o.height===0,Ye=new vD(this,j,t,Ee);j.style.transform="scale3d(1, 1, 1)",Ye.state=0,t.persistent||(this._mostRecentTransientRipple=Ye);let $e=null;return!Ee&&(M||n.exitDuration)&&this._ngZone.runOutsideAngular(()=>{let at=()=>this._finishRippleTransition(Ye),Lt=()=>this._destroyRipple(Ye);j.addEventListener("transitionend",at),j.addEventListener("transitioncancel",Lt),$e={onTransitionEnd:at,onTransitionCancel:Lt}}),this._activeRipples.set(Ye,$e),(Ee||!M)&&this._finishRippleTransition(Ye),Ye}fadeOutRipple(e){if(e.state===2||e.state===3)return;let r=e.element,t=bt(bt({},AN),e.config.animation);r.style.transitionDuration=`${t.exitDuration}
1326ms`,r.style.opacity="0",e.state=2,(e._animationForciblyDisabledThroughCss||!t.exitDuration)&&this._finishRippleTransition(e)}fadeOutAll(){this._getActiveRipples().forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._getActiveRipples().forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){let r=vr(e);!this._platform.isBrowser||!r||r===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=r,ON.forEach(t=>{d0._eventManager.addHandler(this._ngZone,t,r,this)}))}handleEvent(e){e.type==="mousedown"?this._onMousedown(e):e.type==="touchstart"?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._ngZone.runOutsideAngular(()=>{RN.forEach(r=>{this._triggerElement.addEventListener(r,this,PN)})}),this._pointerUpEventsRegistered=!0)}_finishRippleTransition(e){e.state===0?this._startFadeOutTransition(e):e.state===2&&this._destroyRipple(e)}_startFadeOutTransition(e){let r=e===this._mostRecentTransientRipple,{persistent:t}=e.config;e.state=1,!t&&(!r||!this._isPointerDown)&&e.fadeOut()}_destroyRipple(e){let r=this._activeRipples.get(e)??null;this._activeRipples.delete(e),this._activeRipples.size||(this._containerRect=null),e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),e.state=3,r!==null&&(e.element.removeEventListener("transitionend",r.onTransitionEnd),e.element.removeEventListener("transitioncancel",r.onTransitionCancel)),e.element.remove()}_onMousedown(e){let r=c0(e),t=this._lastTouchStartEvent&&Date.now()<this._lastTouchStartEvent+DQ;!this._target.rippleDisabled&&!r&&!t&&(this._isPointerDown=!0,this.fadeInRipple(e.clientX,e.clientY,this._target.rippleConfig))}_onTouchStart(e){if(!this._target.rippleDisabled&&!u0(e)){this._lastTouchStartEvent=Date.now(),this._isPointerDown=!0;let r=e.changedTouches;if(r)for(let t=0;t<r.length;t++)this.fadeInRipple(r[t].clientX,r[t].clientY,this._target.rippleConfig)}}_onPointerUp(){this._isPointerDown&&(this._isPointerDown=!1,this._getActiveRipples().forEach(e=>{let r=e.state===1||e.config.terminateOnPointerUp&&e.state===0;!e.config.persistent&&r&&e.fadeOut()}))}_getActiveRipples(){return Array.from(this._activeRipples.keys())}_removeTriggerEvents(){let e=this._triggerElement;e&&(ON.forEach(r=>d0._eventManager.removeHandler(r,e,this)),this._pointerUpEventsRegistered&&RN.forEach(r=>e.removeEventListener(r,this,PN)))}};d0._eventManager=new yD;var bD=d0;function MQ(i,e,r){let t=Math.max(Math.abs(i-r.left),Math.abs(i-r.right)),o=Math.max(Math.abs(e-r.top),Math.abs(e-r.bottom));return Math.sqrt(t*t+o*o)}var kQ=new Ct("mat-ripple-global-options"),LN=(()=>{let e=class e{get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}constructor(t,o,n,d,_){this._elementRef=t,this._animationMode=_,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=d||{},this._rippleRenderer=new bD(this,o,t,n)}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:bt(bt(bt({},this._globalOptions.animation),this._animationMode==="NoopAnimations"?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,o=0,n){return typeof t=="number"?this._rippleRenderer.fadeInRipple(t,o,bt(bt({},this.rippleConfig),n)):this._rippleRenderer.fadeInRipple(0,0,bt(bt({},this.rippleConfig),t))}};e.\u0275fac=function(o){return new(o||e)(ae(Pi),ae(qt),ae(ia),ae(kQ,8),ae(tc,8))},e.\u0275dir=bi({type:e,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(o,n){o&2&&Yi("mat-ripple-unbounded",n.unbounded)},inputs:{color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],radius:["matRippleRadius","radius"],animation:["matRippleAnimation","animation"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"]},exportAs:["matRipple"]});let i=e;return i})(),FN=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({imports:[h0,h0]});let i=e;return i})();var PQ=["switch"];function OQ(i,e){i&1&&(S(0,"div",12),RP(),S(1,"svg",13),Z(2,"path",14),E(),S(3,"svg",15),Z(4,"path",16),E()())}var RQ=["*"],LQ=new Ct("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1})}),FQ={provide:Qs,useExisting:Jr(()=>xD),multi:!0},f1=class{constructor(e,r){this.source=e,this.checked=r}},NQ=0,xD=(()=>{let e=class e{_createChangeEvent(t){return new f1(this,t)}get buttonId(){return`${this.id||this._uniqueId}-button`}focus(){this._switchElement.nativeElement.focus()}get checked(){return this._checked}set checked(t){this._checked=t,this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}constructor(t,o,n,d,_,C){this._elementRef=t,this._focusMonitor=o,this._changeDetectorRef=n,this.defaults=_,this._onChange=M=>{},this._onTouched=()=>{},this._checked=!1,this.name=null,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.disabled=!1,this.disableRipple=!1,this.tabIndex=0,this.change=new Fe,this.toggleChange=new Fe,this.tabIndex=parseInt(d)||0,this.color=_.color||"accent",this._noopAnimations=C==="NoopAnimations",this.id=this._uniqueId=`mat-mdc-slide-toggle-${++NQ}`,this.hideIcon=_.hideIcon??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t==="keyboard"||t==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):t||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new f1(this,this.checked)))}
1326_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}};e.\u0275fac=function(o){return new(o||e)(ae(Pi),ae(IN),ae(Or),Wg("tabindex"),ae(LQ),ae(tc,8))},e.\u0275cmp=st({type:e,selectors:[["mat-slide-toggle"]],viewQuery:function(o,n){if(o&1&&ni(PQ,5),o&2){let d;Xt(d=Yt())&&(n._switchElement=d.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(o,n){o&2&&(kb("id",n.id),Bn("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),cl(n.color?"mat-"+n.color:""),Yi("mat-mdc-slide-toggle-focused",n._focused)("mat-mdc-slide-toggle-checked",n.checked)("_mat-animation-noopable",n._noopAnimations))},inputs:{disabled:["disabled","disabled",Rr],disableRipple:["disableRipple","disableRipple",Rr],color:"color",tabIndex:["tabIndex","tabIndex",t=>t==null?0:QS(t)],name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"],required:["required","required",Rr],checked:["checked","checked",Rr],hideIcon:["hideIcon","hideIcon",Rr]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[It([FQ]),$s],ngContentSelectors:RQ,decls:13,vars:25,consts:[[1,"mdc-form-field"],["role","switch","type","button",1,"mdc-switch",3,"tabIndex","disabled","click"],["switch",""],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-mdc-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],["class","mdc-switch__icons"],[1,"mdc-label",3,"for","click"],[1,"mdc-switch__icons"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(o,n){if(o&1&&(Zd(),S(0,"div",0)(1,"button",1,2),se("click",function(){return n._handleClick()}),Z(3,"div",3),S(4,"div",4)(5,"div",5)(6,"div",6),Z(7,"div",7),E(),S(8,"div",8),Z(9,"div",9),E(),ce(10,OQ,5,0,"div",10),E()()(),S(11,"label",11),se("click",function(_){return _.stopPropagation()}),Kd(12),E()()),o&2){let d=or(2);Yi("mdc-form-field--align-end",n.labelPosition=="before"),P(1),Yi("mdc-switch--selected",n.checked)("mdc-switch--unselected",!n.checked)("mdc-switch--checked",n.checked)("mdc-switch--disabled",n.disabled),N("tabIndex",n.disabled?-1:n.tabIndex)("disabled",n.disabled),Bn("id",n.buttonId)("name",n.name)("aria-label",n.ariaLabel)("aria-labelledby",n._getAriaLabelledBy())("aria-describedby",n.ariaDescribedby)("aria-required",n.required||null)("aria-checked",n.checked),P(8),N("matRippleTrigger",d)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),P(1),XS(10,n.hideIcon?-1:10),P(1),N("for",n.buttonId),Bn("id",n._labelId)}},dependencies:[LN],styles:['.mdc-form-field{display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field[hidden]{display:none}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:var(--mdc-elevation-overlay-color)}.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative}.mdc-switch[hidden]{display:none}.mdc-switch:disabled{cursor:default;pointer-events:none}.mdc-switch__track{overflow:hidden;position:relative;width:100%}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%}@media screen and (forced-colors: active){.mdc-switch__track::before,.mdc-switch__track::after{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0)}.mdc-switch__track::after{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(-100%)}[dir=rtl] .mdc-switch__track::after,.mdc-switch__track[dir=rtl]::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track[dir=rtl]::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::after{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0)}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0)}[dir=rtl] .mdc-switch__handle-track,.mdc-switch__handle-track[dir=rtl]{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track,.mdc-switch--selected .mdc-switch__handle-track[dir=rtl]{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto}[dir=rtl] .mdc-switch__handle,.mdc-switch__handle[dir=rtl]{left:auto;right:0}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media screen and (forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-elevation-overlay{bottom:0;left:0;right:0;top:0}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1}.mdc-switch:disabled .mdc-switch__ripple{display:none}
1326.mdc-switch__icons{height:100%;position:relative;width:100%;z-index:1}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mdc-switch{width:var(--mdc-switch-track-width)}.mdc-switch.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color)}.mdc-switch.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color)}.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color)}.mdc-switch.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color)}.mdc-switch.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color)}.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color)}.mdc-switch .mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation)}.mdc-switch:disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation)}.mdc-switch .mdc-switch__focus-ring-wrapper,.mdc-switch .mdc-switch__handle{height:var(--mdc-switch-handle-height)}.mdc-switch:disabled .mdc-switch__handle::after{opacity:var(--mdc-switch-disabled-handle-opacity)}.mdc-switch .mdc-switch__handle{border-radius:var(--mdc-switch-handle-shape)}.mdc-switch .mdc-switch__handle{width:var(--mdc-switch-handle-width)}.mdc-switch .mdc-switch__handle-track{width:calc(100% - var(--mdc-switch-handle-width))}.mdc-switch.mdc-switch--selected:enabled .mdc-switch__icon{fill:var(--mdc-switch-selected-icon-color)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color)}.mdc-switch.mdc-switch--unselected:enabled .mdc-switch__icon{fill:var(--mdc-switch-unselected-icon-color)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity)}.mdc-switch.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size);height:var(--mdc-switch-selected-icon-size)}.mdc-switch.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size);height:var(--mdc-switch-unselected-icon-size)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background-color:var(--mdc-switch-selected-hover-state-layer-color)}.mdc-switch.mdc-switch--selected:enabled:focus .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background-color:var(--mdc-switch-selected-focus-state-layer-color)}.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background-color:var(--mdc-switch-selected-pressed-state-layer-color)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background-color:var(--mdc-switch-unselected-hover-state-layer-color)}.mdc-switch.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background-color:var(--mdc-switch-unselected-focus-state-layer-color)}.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background-color:var(--mdc-switch-unselected-pressed-state-layer-color)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus):hover .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus).mdc-ripple-surface--hover .mdc-switch__ripple::before{opacity:var(--mdc-switch-selected-hover-state-layer-opacity)}.mdc-switch.mdc-switch--selected:enabled:focus.mdc-ripple-upgraded--background-focused .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:focus:not(.mdc-ripple-upgraded):focus .mdc-switch__ripple::before{transition-duration:75ms;opacity:var(--mdc-switch-selected-focus-state-layer-opacity)}.mdc-switch.mdc-switch--selected:enabled:active:not(.mdc-ripple-upgraded) .mdc-switch__ripple::after{transition:opacity 150ms linear}.mdc-switch.mdc-switch--selected:enabled:active:not(.mdc-ripple-upgraded):active .mdc-switch__ripple::after{transition-duration:75ms;opacity:var(--mdc-switch-selected-pressed-state-layer-opacity)}.mdc-switch.mdc-switch--selected:enabled:active.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-switch-selected-pressed-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus):hover .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus).mdc-ripple-surface--hover .mdc-switch__ripple::before{opacity:var(--mdc-switch-unselected-hover-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:focus.mdc-ripple-upgraded--background-focused .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:focus:not(.mdc-ripple-upgraded):focus .mdc-switch__ripple::before{transition-duration:75ms;opacity:var(--mdc-switch-unselected-focus-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:active:not(.mdc-ripple-upgraded) .mdc-switch__ripple::after{transition:opacity 150ms linear}.mdc-switch.mdc-switch--unselected:enabled:active:not(.mdc-ripple-upgraded):active .mdc-switch__ripple::after{transition-duration:75ms;opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity)}.mdc-switch.mdc-switch--unselected:enabled:active.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity)}.mdc-switch .mdc-switch__ripple{height:var(--mdc-switch-state-layer-size);width:var(--mdc-switch-state-layer-size)}.mdc-switch .mdc-switch__track{height:var(--mdc-switch-track-height)}.mdc-switch:disabled .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity)}.mdc-switch:enabled .mdc-switch__track::after{background:var(--mdc-switch-selected-track-color)}
1326.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color)}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color)}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color)}.mdc-switch:disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color)}.mdc-switch:enabled .mdc-switch__track::before{background:var(--mdc-switch-unselected-track-color)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color)}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color)}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color)}.mdc-switch:disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color)}.mdc-switch .mdc-switch__track{border-radius:var(--mdc-switch-track-shape)}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mdc-switch:disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mat-mdc-slide-toggle .mdc-label{font-family:var(--mat-slide-toggle-label-text-font);font-size:var(--mat-slide-toggle-label-text-size);letter-spacing:var(--mat-slide-toggle-label-text-tracking);line-height:var(--mat-slide-toggle-label-text-line-height);font-weight:var(--mat-slide-toggle-label-text-weight)}.mat-mdc-slide-toggle{display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle .mdc-switch__ripple::after{content:"";opacity:0}.mat-mdc-slide-toggle .mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:opacity 75ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-mdc-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-mdc-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-elevation-overlay,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}'],encapsulation:2,changeDetection:0});let i=e;return i})();var NN=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({});let i=e;return i})(),zN=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({imports:[NN,h0,FN,NN,h0]});let i=e;return i})();function jQ(i,e){if(i&1){let r=Ge();S(0,"div",4),se("click",function(){Se(r);let o=q();return Te(o.close())}),E()}}function VQ(i,e){if(i&1){let r=Ge();S(0,"div",5),se("click",function(){Se(r);let o=q();return Te(o.close())}),A(1,"X"),E()}}function BQ(i,e){if(i&1){let r=Ge();S(0,"div",6)(1,"div",7),se("click",function(o){Se(r);let n=q();return Te(n.clickedInside(o))}),Z(2,"iframe",8),E(),S(3,"div",9),Z(4,"app-random-banner",10),E()()}if(i&2){let r=q();P(2),N("src",r.webcamURL(),MS)}}function UQ(i,e){if(i&1&&(S(0,"div"),Z(1,"img",11),E()),i&2){let r=q();P(1),fn("alt","Spletna kamera ",r.webcam.title,""),Hi("src",r.webcam.images.current.preview,Ei)}}var Tu=(()=>{let e=class e{constructor(t){this.sanitizer=t,this.webcam=null,this.popup=!0,this.camLoaded=!1,this.onClose=new Fe}clickedOutside(t){this.camLoaded&&this.close()}clickedInside(t){t.preventDefault(),t.stopPropagation()}webcamURL(){return this.sanitizer.bypassSecurityTrustResourceUrl(this.webcam.player.day)}webcamLoaded(t){console.log(t)}close(){this.camLoaded=!1,this.webcam=null,this.onClose.emit(!0)}};e.\u0275fac=function(o){return new(o||e)(ae(__))},e.\u0275cmp=st({type:e,selectors:[["app-webcam"]],hostBindings:function(o,n){o&1&&se("click",function(_){return n.clickedOutside(_)},!1,ns)},inputs:{webcam:"webcam",popup:"popup"},outputs:{onClose:"onClose"},standalone:!0,features:[gt],decls:4,vars:4,consts:[["class","popup-outer",3,"click",4,"ngIf"],["class","close-popup",3,"click",4,"ngIf"],["class","popup",4,"ngIf"],[4,"ngIf"],[1,"popup-outer",3,"click"],[1,"close-popup",3,"click"],[1,"popup"],[1,"center","camera-view-part","holds-the-iframe",3,"click"],["height","100%","width","100%",2,"border","0",3,"src"],[1,"center","camera-ad-part"],["medium","webcam_banner"],["width","100%",3,"alt","src"]],template:function(o,n){o&1&&ce(0,jQ,1,0,"div",0)(1,VQ,2,0,"div",1)(2,BQ,5,1,"div",2)(3,UQ,2,2,"div",3),o&2&&(N("ngIf",n.webcam&&n.popup),P(1),N("ngIf",n.webcam&&n.popup),P(1),N("ngIf",n.webcam&&n.popup),P(1),N("ngIf",n.webcam&&!n.popup))},dependencies:[Dt,At,Cu]});let i=e;return i})();var Eo=(()=>{let e=class e{constructor(t){this.http=t,this.mainUrl="https://api.windy.com/webcams/api/v3/",this.apiKey="QzwwA36tDfrPVSJOKH1FN3KbkrSxEczL"}getWebcamsBox(t,o,n,d){let _=this.mainUrl+"webcams?bbox="+d+","+t+","+n+","+o+"&lang=en&include=images%2Clocation%2Cplayer",C=new Qn({"X-WINDY-API-KEY":this.apiKey});return this.http.get(_,{headers:C})}getWebcamsNearby(t,o,n,d=0,_=10){let C=this.mainUrl+"webcams?nearby="+t+","+o+","+n+"&lang=sl&include=images%2Clocation%2Cplayer",M=new Qn({"X-WINDY-API-KEY":this.apiKey});return this.http.get(C,{headers:M})}timeConverter(t){let o=new Date(t*1e3),n=["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],d=o.getFullYear(),_=n[o.getMonth()],C=o.getDate(),M=o.getHours(),j=o.getMinutes(),G=o.getSeconds();
1326return C+". "+_+" "+d+", "+M+":"+j+":"+G}degreesToRadians(t){return t*Math.PI/180}distanceInKmBetweenEarthCoordinates(t,o,n,d){let C=this.degreesToRadians(n-t),M=this.degreesToRadians(d-o);t=this.degreesToRadians(t),n=this.degreesToRadians(n);let j=Math.sin(C/2)*Math.sin(C/2)+Math.sin(M/2)*Math.sin(M/2)*Math.cos(t)*Math.cos(n);return 6371*(2*Math.atan2(Math.sqrt(j),Math.sqrt(1-j)))}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var HQ=["storyList"],$Q=["countryFilter"],GQ=["hikingTimeFilter"],qQ=["mountainRangeFilter"],WQ=["endHeightFilter"],ZQ=["startHeightFilter"],KQ=["destinationTypeFilter"],XQ=["difficultyFilter"],YQ=["distanceFilter"],QQ=["destinationsList"],JQ=["roadsList"];function eJ(i,e){i&1&&Z(0,"img",49)}function tJ(i,e){i&1&&Z(0,"span",50)}var wD=i=>({"hidden-mobile":i});function iJ(i,e){if(i&1){let r=Ge();S(0,"div",31)(1,"div",51),se("click",function(){Se(r);let o=q();return Te(o.mobileRoadsDrillDownVisible=!1)}),A(2,"\u2190 Nazaj na destinacije"),E(),S(3,"app-road-list",52),se("onRoadSelect",function(o){Se(r);let n=q();return Te(n.onDestinationRoadSelect(o))})("onActionSelect",function(o){Se(r);let n=q();return Te(n.onRoadActionSelect(o))}),E()()}if(i&2){let r=q();N("ngClass",kt(6,wD,!r.mobileRoadsDrillDownVisible)),P(3),N("fields","i
1326d,slug,name,starting_point,end_point,hiking_time_formated,hiking_time,rating,closed")("selectedDestination",r.selectedDestinationForRoads)("selectableRows",!0)("header",!0)("showSearchInput",!1)}}function nJ(i,e){i&1&&(S(0,"div",53),Z(1,"span",54),A(2," Nalagam \u2026 "),E())}function rJ(i,e){i&1&&(S(0,"div",53),Z(1,"span",54),A(2," Nalagam GPS sled \u2026 "),E())}var oJ=i=>[i],sJ=(i,e)=>[i,e];function aJ(i,e){if(i&1){let r=Ge();S(0,"mgl-map",55),se("mapCreate",function(o){Se(r);let n=q();return Te(n.loadMap(o))}),E()}if(i&2){let r=q();Gs("mapbox://styles/silko/cjb1va19f6xm72spde16k92nx"),N("zoom",kt(4,oJ,r.zoom))("center",mn(6,sJ,r.lng,r.lat))}}function lJ(i,e){if(i&1){let r=Ge();S(0,"app-webcam",56),se("onClose",function(){Se(r);let o=q();return Te(o.chosenWebcam=null)}),E()}if(i&2){let r=q();N("webcam",r.chosenWebcam)("popup",!0)}}function cJ(i,e){if(i&1){let r=Ge();S(0,"button",57),se("click",function(){Se(r);let o=q();return Te(o.centerOnSelectedRoadTrack())}),Z(1,"span",58),E()}}var jN=i=>({active:i}),uJ=i=>({country:i}),dJ=i=>({"search-sidebar-collapsed":i}),VN=(i,e)=>({"search-tab-hidden":i,"hidden-mobile":e}),hJ=(i,e)=>({"search-panel-half-shrunk":i,"hidden-mobile":e}),UN=(()=>{let e=class e{get destinationsListVisible(){return!this.leftPanelCollapsed&&this.activeTab==="destinations"}get roadsListVisible(){return!this.leftPanelCollapsed&&this.activeTab==="roads"}get mapVisible(){return!this.isMobileDevice||this.leftPanelCollapsed}constructor(t,o,n,d,_,C,M,j){if(this.destinationService=o,this.roadService=n,this.webcamService=d,this.router=_,this.route=C,this.cdr=M,this.ngZone=j,this.subList=null,this.country=null,this.mountain_range=null,this.type=null,this.difficulty=null,this.destination=null,this.end_point_min_height=null,this.end_point_max_height=null,this.starting_point_min_height=null,this.starting_point_max_height=null,this.min_hiking_time=null,this.max_hiking_time=null,this.distance=null,this.search_lat=null,this.search_lng=null,this.d_ordering=null,this.r_ordering=null,this.filtersVisible=!1,this.destinations_order="-",this.destinations_ordering="height",this.roads_order="-",this.roads_ordering="hiking_time",this.zoom=7,this.lat=46.378284103405775,this.lng=13.83660336823749,this.geoJsonDestinations={type:"FeatureCollection",features:[]},this.map=null,this.mapResized=!1,this.isBrowser=!1,this.activeTab="destinations",this.leftPanelCollapsed=!1,this.isMobileDevice=!1,this.mapDataLoading=!1,this.gpsTrackLoading=!1,this.selectedDestinationForRoads=null,this.mobileRoadsDrillDownVisible=!1,this.selectedRoadForCenter=null,this.pendingMobileRoadSelection=null,this.pendingMobileDrilldownRoadSelection=null,this.destinationTracksSub=null,this.selectedTrackPoints=[],this.allTracksBounds=null,this.trackFocusMode=!1,this.showWebcamPins=!0,this.chosenWebcam=null,this.webcamPinsLoaded=!1,this.webcamHandlersBound=!1,this.showStoryPins=!0,this.storyPinsData=[],this.storyHandlersBound=!1,this.storyList=null,this.geoJsonRoads={type:"FeatureCollection",features:[]},this.roadsGeoSub=null,this.roadsHandlersBound=!1,this.destinationsHandlersBound=!1,this.mapIconsRegistered=!1,this.countryFilter=null,this.hikingTimeFilter=null,this.mountainRangeFilter=null,this.endHeightFilter=null,this.startHeightFilter=null,this.destinationTypeFilter=null,this.difficultyFilter=null,this.distanceFilter=null,this.destinationsList=null,this.roadsList=null,this.mapResizeObserver=null,this.cachedDestinationTracksId=null,this.cachedDestinationTracksFeatures=null,this.cachedDestinationTracksBounds=null,this.webcamPinsData=[],this.isBrowser=Si(t),this.isBrowser){let G=navigator.userAgent;this.isMobileDevice=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(G)}}destinationDetails(t){t.target.classList.contains("open-destination")&&this.router.navigate(["./destinations/"+this.destination]),t.target.classList.contains("mapboxgl-popup-close-button")&&(this.destination=null)}ngOnInit(){this.route.queryParams.subscribe(t=>{this.country=t.country||null,this.mountain_range=t.mountain_range||null,this.type=t.type||null,this.difficulty=t.difficulty||null,this.min_hiking_time=t.hiking_time__lowValue||null,this.max_hiking_time=t.hiking_time__highValue||null,this.starting_point_min_height=t.starting_point__lowValue||null,this.starting_point_max_height=t.starting_point__highValue||null,this.end_point_min_height=t.end_point__lowValue||null,this.end_point_max_height=t.end_point__highValue||null,this.distance=parseFloat(t.distance)||null,this.search_lat=parseFloat(t.lat)||null,this.search_lng=parseFloat(t.lng)||null,this.mapVisible&&this.search_lat&&(this.lat=this.search_lat),this.mapVisible&&this.search_lng&&(this.lng=this.search_lng),this.d_ordering=t.destinations_ordering||"-height",this.r_ordering=t.roads_ordering||"-hiking_time"})}ngAfterViewInit(){this.country!=null&&(this.countryFilter.selectedValues=this.country.split("|").map(function(t){return parseInt(t,10)})),this.mountain_range!=null&&(this.mountainRangeFilter.selectedValues=this.mountain_range.split("|").map(function(t){return parseInt(t,10)})),this.type!=null&&(this.destinationTypeFilter.selectedValues=this.type.split("|")),this.difficulty!=null&&(this.difficultyFilter.selectedValues=this.difficulty.split("|").map(function(t){return parseInt(t,10)})),this.hikingTimeFilter.lowValue=this.min_hiking_time,this.hikingTimeFilter.highValue=this.max_hiking_time,this.startHeightFilter.lowValue=this.starting_point_min_height,this.startHeightFilter.highValue=this.starting_point_max_height,this.endHeightFilter.lowValue=this.end_point_min_height,this.endHeightFilter.highValue=this.end_point_max_height,this.distanceFilter.lat=this.search_lat,this.distanceFilter.lng=this.search_lng,this.distanceFilter.highValue=this.distance,this.d_ordering[0]==="-"?(this.destinations_order="-",this.destinations_ordering=this.d_ordering.replace("-","")):(this.destinations_order="",this.destinations_ordering=this.d_ordering),this.r_ordering[0]==="-"?(this.roads_order="-",this.roads_ordering=this.r_ordering.replace("-","")):(this.roads_order="",this.roads_ordering=this.r_ordering),this.cdr.detectChanges()}showList(t){if(t==="map"){this.leftPanelCollapsed=!0,this.refreshActiveBaseLayer();return}this.isMobileDevice&&this.leftPanelCollapsed&&this.resetMapStateForMobileTeardown(),this.activeTab!==t?(this.clearTabState(this.activeTab),this.activeTab=t,this.refreshActiveBaseLayer()):t==="destinations"&&(this.mobileRoadsDrillDownVisible=!1),this.leftPanelCollapsed=!1}clearTabState(t){t==="destinations"?(this.selectedDestinationForRoads=null,this.mobileRoadsDrillDownVisible=!1,this.destination=null,this.closePopUp(),this.removeDestinationTracksLayer(),this.removeDestinationSelectedTrackLayer(),this.selectedRoadForCenter=null,this.allTracksBounds=null,this.trackFocusMode=!1):(this.removeRoadFocusLayer(),this.roadsList&&(this.roadsList.selectedRoad=null))}
1326refreshActiveBaseLayer(){!this.mapVisible||!this.map||(this.activeTab==="destinations"?(this.roadsGeoSub!==null&&(this.roadsGeoSub.unsubscribe(),this.roadsGeoSub=null),this.removeRoadsLayer(),this.loadGEOJson(!0)):(this.subList!==null&&(this.subList.unsubscribe(),this.subList=null),this.removeDestinationsLayer(),this.loadRoadsGEOJson(!0)))}toggleLeftPanel(){this.leftPanelCollapsed=!this.leftPanelCollapsed,setTimeout(()=>this.map?.resize(),260)}toggleMobileMapView(){this.leftPanelCollapsed?(this.resetMapStateForMobileTeardown(),this.leftPanelCollapsed=!1):this.showList("map")}resetMapStateForMobileTeardown(){this.isMobileDevice&&(this.map=null,this.mapResized=!1,this.mapIconsRegistered=!1,this.destinationsHandlersBound=!1,this.roadsHandlersBound=!1,this.webcamHandlersBound=!1,this.storyHandlersBound=!1,this.mapResizeObserver?.disconnect(),this.mapResizeObserver=null)}ngAfterViewChecked(){this.mapVisible&&this.map&&!this.mapResized&&(this.map.resize(),this.mapResized=!0)}ngOnDestroy(){this.mapResizeObserver?.disconnect()}observeMapContainerResize(){!this.map||typeof ResizeObserver>"u"||(this.mapResizeObserver?.disconnect(),this.mapResizeObserver=new ResizeObserver(()=>{this.map?.resize()}),this.mapResizeObserver.observe(this.map.getContainer()))}onCountrySelect(t){this.country=t,this.refreshActiveBaseLayer(),this.filtersChanged()}onMountainRangeSelect(t){this.mountain_range=t,this.refreshActiveBaseLayer(),this.filtersChanged()}onTypeSelect(t){this.type=t,this.refreshActiveBaseLayer(),this.filtersChanged()}onDifficultySelect(t){this.filtersChanged(),this.difficulty=t,this.refreshActiveBaseLayer(),this.filtersChanged()}onDestinationActionSelect(t){switch(t){case"show-on-map":this.showList("map");break;case"show-connected-roads":this.mobileRoadsDrillDownVisible=!0;break}}onRoadActionSelect(t){t==="show-on-map"&&this.showList("map")}onDestinationSelect(t){this.destination=t,this.selectedDestinationForRoads=t,t==null&&(this.mobileRoadsDrillDownVisible=!1),this.removeDestinationSelectedTrackLayer(),this.selectedRoadForCenter=null,this.trackFocusMode=!1,this.allTracksBounds=null,t==null?(this.removeDestinationTracksLayer(),this.lat=this.search_lat||46.378284103405775,this.lng=this.search_lng||13.83660336823749,this.distance?this.map.fitBounds([[this.lng+this.distance*.008999,this.lat+this.distance*.008999],[this.lng-this.distance*.008999,this.lat-this.distance*.008999]]):(this.zoom=7,this.flyToDestination([this.lng,this.lat],this.zoom)),this.closePopUp()):(this.destinationService.getDestination(t,null).subscribe(o=>{this.lat=o.width,this.lng=o.length,this.zoom=15,this.flyToDestination([this.lng,this.lat],this.zoom),this.createPopUp([o.length,o.width],o.title,o.height,o.main_image)}),this.loadDestinationRoadsTracks(t))}loadDestinationRoadsTracks(t){if(this.map){if(this.removeDestinationTracksLayer(),this.cachedDestinationTracksId===t&&this.cachedDestinationTracksFeatures){this.renderDestinationTracksLayer(this.cachedDestinationTracksFeatures),this.allTracksBounds=this.cachedDestinationTracksBounds,this.allTracksBounds&&!this.trackFocusMode&&this.map.fitBounds(this.allTracksBounds,{padding:{top:60,right:60,bottom:60,left:60}});return}this.destinationTracksSub!==null&&this.destinationTracksSub.unsubscribe(),this.destinationTracksSub=this.roadService.getRoads(200,0,null,{destination:t,fields:"id,starting_point,end_point"}).subscribe(o=>{let n=o.results||[];if(n.length===0)return;let d=n.length,_=[],C=90,M=-90,j=180,G=-180,ie=(Ee,Ye)=>{Ee>M&&(M=Ee),Ee<C&&(C=Ee),Ye>G&&(G=Ye),Ye<j&&(j=Ye)},_e=()=>{_.length===0||!this.map||(this.renderDestinationTracksLayer(_),this.allTracksBounds=[[j,C],[G,M]],this.trackFocusMode||this.map.fitBounds(this.allTracksBounds,{padding:{top:60,right:60,bottom:60,left:60}}),this.cachedDestinationTracksId=t,this.cachedDestinationTracksFeatures=_,this.cachedDestinationTracksBounds=this.allTracksBounds)};n.forEach(Ee=>{let Ye=()=>{d--,d===0&&_e()};this.roadService.getGPSTracks(Ee.id).subscribe($e=>{let at=[];if(($e.results||[]).forEach(Lt=>{(Lt.points||[]).forEach(jt=>{at.push([jt.longitude,jt.latitude]),ie(jt.latitude,jt.longitude)})}),at.length>=2)_.push({type:"Feature",geometry:{type:"LineString",coordinates:at},properties:{id:Ee.id}});else{let Lt=Ee.starting_point,jt=Ee.end_point;Lt?.length!=null&&Lt?.width!=null&&jt?.length!=null&&jt?.width!=null&&(Lt.length!==jt.length||Lt.width!==jt.width)&&(_.push({type:"Feature",geometry:{type:"LineString",coordinates:[[Lt.length,Lt.width],[jt.length,jt.width]]},properties:{id:Ee.id}}),ie(Lt.width,Lt.length),ie(jt.width,jt.length))}Ye()},()=>Ye())})})}}renderDestinationTracksLayer(t){if(!this.map)return;let o={type:"FeatureCollection",features:t},n=this.map.getSource("destination_tracks");n?n.setData(o):(this.map.addSource("destination_tracks",{type:"geojson",data:o}),this.map.addLayer({id:"destination_tracks_layer",type:"line",source:"destination_tracks",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#1e88e5","line-width":3,"line-opacity":.85}})),this.map.getLayer("destination_selected_track_layer")&&this.map.moveLayer("destination_selected_track_layer")}removeDestinationTracksLayer(){this.map&&(this.map.getLayer("destination_tracks_layer")&&this.map.removeLayer("destination_tracks_layer"),this.map.getSource("destination_tracks")&&this.map.removeSource("destination_tracks"))}onDestinationRoadSelect(t){if(this.removeDestinationSelectedTrackLayer(),this.selectedRoadForCenter=null,t!=null){if(!this.map){this.pendingMobileDrilldownRo
1326adSelection=t;return}this.selectedRoadForCenter=t,this.gpsTrackLoading=!0,this.roadService.getGPSTracks(t).subscribe(o=>{let n=[];(o.results||[]).forEach(d=>{(d.points||[]).forEach(_=>{n.push([_.longitude,_.latitude])})}),n.length>=2&&(this.renderDestinationSelectedTrack(n),this.trackFocusMode&&this.fitSelectedTrackBounds()),this.gpsTrackLoading=!1},()=>{this.gpsTrackLoading=!1})}}renderDestinationSelectedTrack(t){this.map&&(this.selectedTrackPoints=t,this.map.getLayer("destination_selected_track_layer")&&this.map.removeLayer("destination_selected_track_layer"),this.map.getSource("destination_selected_track")&&this.map.removeSource("destination_selected_track"),this.map.addSource("destination_selected_track",{type:"geojson",data:{type:"Feature",geometry:{type:"LineString",coordinates:t},properties:{}}}),this.map.addLayer({id:"destination_selected_track_layer",type:"line",source:"destination_selected_track",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#e53935","line-width":5}}))}removeDestinationSelectedTrackLayer(){this.map&&(this.map.getLayer("destination_selected_track_layer")&&this.map.removeLayer("destination_selected_track_layer"),this.map.getSource("destination_selected_track")&&this.map.removeSource("destination_selected_track"),this.selectedTrackPoints=[])}centerOnSelectedRoadTrack(){!this.map||this.selectedRoadForCenter==null||(this.trackFocusMode?(this.trackFocusMode=!1,this.allTracksBounds&&this.map.fitBounds(this.allTracksBounds,{padding:{top:60,right:60,bottom:60,left:60}})):(this.trackFocusMode=!0,this.fitSelectedTrackBounds()))}fitSelectedTrackBounds(){if(!this.map||!this.selectedTrackPoints.length)return;let t=90,o=-90,n=180,d=-180;this.selectedTrackPoints.forEach(([_,C])=>{C>o&&(o=C),C<t&&(t=C),_>d&&(d=_),_<n&&(n=_)}),this.map.fitBounds([[n,t],[d,o]],{padding:{top:60,right:60,bottom:60,left:60}})}onEndPointHeightChange(t){this.end_point_min_height=t.lowValue,this.end_point_max_height=t.highValue,this.refreshActiveBaseLayer(),this.filtersChanged()}onStartingPointHeightChange(t){this.starting_point_min_height=t.lowValue,this.starting_point_max_height=t.highValue,this.refreshActiveBaseLayer(),this.filtersChanged()}onHikingTimeChange(t){this.min_hiking_time=t.lowValue,this.max_hiking_time=t.highValue,this.refreshActiveBaseLayer(),this.filtersChanged()}onDistanceLocationChange(t){this.search_lat=t.lat,this.search_lng=t.lng,this.refreshActiveBaseLayer(),this.filtersChanged()}onDistanceRangeChange(t){this.distance=t.highValue,this.refreshActiveBaseLayer(),this.filtersChanged()}onOrderingChange(t,o){o==="destinations"?this.d_ordering=t:this.r_ordering=t,this.filtersChanged()}loadMap(t){this.isBrowser&&(this.map=t,this.map.resize(),this.observeMapContainerResize(),this.lat=this.search_lat||46.378284103405775,this.lng=this.search_lng||13.83660336823749,this.map.on("moveend",()=>this.ngZone.run(()=>this.onMapMoveEnd())),t.isStyleLoaded()?this.onMapStyleReady():t.once("style.load",()=>this.onMapStyleReady()))}onMapStyleReady(){this.registerMapIcons(()=>{this.destination&&(this.destinationService.getDestination(this.destination,null).subscribe(n=>{this.lat=n.width,this.lng=n.length,this.zoom=15,this.flyToDestination([this.lng,this.lat],this.zoom),this.createPopUp([n.length,n.width],n.title,n.height)}),this.loadDestinationRoadsTracks(this.destination));let t=!1;if(this.pendingMobileRoadSelection!=null){let n=this.pendingMobileRoadSelection;this.pendingMobileRoadSelection=null,t=!0,this.onRoadSelect(n,()=>this.refreshActiveBaseLayer())}let o=this.pendingMobileDrilldownRoadSelection??this.selectedRoadForCenter;this.pendingMobileDrilldownRoadSelection=null,o!=null&&this.onDestinationRoadSelect(o),t||this.refreshActiveBaseLayer(),this.showWebcamPins&&this.loadWebcamPins(),this.showStoryPins&&this.storyPinsData.length&&this.renderStoryPinsLayer()})}registerMapIcons(t){if(!this.map||this.mapIconsRegistered){t();return}let o=this.map,n=3,d=()=>{n--,n===0&&(this.mapIconsRegistered=!0,t())};o.loadImage("/assets/images/icon-wall-mount-camera-filled-50.png",(_,C)=>{!_&&C&&!o.hasImage("webcam-pin-icon")&&o.addImage("webcam-pin-icon",C),d()}),o.loadImage("/assets/images/camera-icon-white.png",(_,C)=>{!_&&C&&!o.hasImage("story-pin-icon")&&o.addImage("story-pin-icon",C),d()}),o.loadImage("/assets/images/road-flag-icon-white.png",(_,C)=>{!_&&C&&!o.hasImage("road-pin-icon")&&o.addImage("road-pin-icon",C),d()})}loadGEOJson(t=!1,o=1e3,n=0){if(this.isBrowser&&(t&&(this.geoJsonDestinations={type:"FeatureCollection",features:[]},this.mapDataLoading=!0),typeof this.map<"u")){typeof this.map.getLayer("cluster
1326s")<"u"&&(this.map.removeLayer("clusters"),this.map.removeLayer("cluster-count"),this.map.removeLayer("unclustered-point"),this.map.removeSource("destinations")),this.subList!==null&&this.subList.unsubscribe();let _=this.lat,C=this.lng,M=this.distance;this.subList=this.destinationService.getDestinations(o,n,this.country,this.mountain_range,this.end_point_min_height,this.end_point_max_height,this.type,null,null,null,!1,null,{radius:this.distance,lat:this.search_lat,lng:this.search_lng,coords_only:!0}).subscribe(j=>{for(let ie in j.results)if(j.results[ie].length!=null&&j.results[ie].width!=null){let _e={type:"Feature",geometry:{type:"Point",coordinates:[j.results[ie].length,j.results[ie].width]},properties:{id:j.results[ie].id,name:j.results[ie].title,height:j.results[ie].height,main_image:j.results[ie].image}};this.geoJsonDestinations.features.push(_e)}let G=this.map;if(G.addSource("destinations",{type:"geojson",data:this.geoJsonDestinations,cluster:!0,clusterMaxZoom:14,clusterRadius:50}),G.addLayer({id:"clusters",type:"circle",source:"destinations",filter:["has","point_count"],paint:{"circle-color":["step",["get","point_count"],"#e88d20",100,"#e88d20",750,"#e88d20"],"circle-radius":["step",["get","point_count"],20,100,30,750,40]}}),G.addLayer({id:"cluster-count",type:"symbol",source:"destinations",filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":12}}),G.addLayer({id:"unclustered-point",type:"circle",source:"destinations",filter:["!",["has","point_count"]],paint:{"circle-color":"#e88d20","circle-radius":4,"circle-stroke-width":1,"circle-stroke-color":"#fff"}}),!this.destinationsHandlersBound){let ie=this;G.on("click","unclustered-point",function(_e){let Ee=_e.features;if(Ee&&Ee.length){let $e=Ee[0].properties.id;ie.ngZone.run(()=>{ie.onDestinationSelect($e),ie.destinationsList?.selectAndScrollTo($e)})}}),G.on("mouseenter","unclustered-point",function(){G.getCanvas().style.cursor="pointer"}),G.on("mouseleave","unclustered-point",function(){G.getCanvas().style.cursor=""}),this.destinationsHandlersBound=!0}this.mapVisible&&this.distance&&G.fitBounds([[C+M*.008999,_+M*.008999],[C-M*.008999,_-M*.008999]]),this.mapDataLoading=!1,j.offset+j.limit<j.count&&this.loadGEOJson(!1,o,n+o)})}}removeDestinationsLayer(){this.map&&this.map.getLayer("clusters")&&(this.map.removeLayer("clusters"),this.map.removeLayer("cluster-count"),this.map.removeLayer("unclustered-point"),this.map.removeSource("destinations"))}flyToDestinationFromFeature(t){let o=t.geometry.coordinates;this.flyToDestination(o)}flyToDestination(t,o=15){typeof this.map<"u"&&this.map.flyTo({center:t,zoom:o})}createPopUpFromFeature(t){let o=t.geometry.coordinates;this.destination=t.properties.id,this.destinationService.getDestination(this.destination,null).subscribe(n=>{console.log(n);let d=n.title,_=n.height,C=n.main_image;this.createPopUp(o,d,_,C)})}createPopUp(t,o,n,d=null){let _=document.getElementsByClassName("mapboxgl-popup");_[0]&&_[0].remove(),this.map&&(d=d?d.file:"/assets/images/default-no-image.png",new BN.Popup({closeOnClick:!1}).setLngLat(t).setHTML('<div><span class="bold">'+o+"</span><br><span>"+n+' m</span><br><img alt="Glavna slika destinacije '+o+'" src="'+d+'" style="width: 120px;"></div><button class="btn btn-xs btn-primary float-right open-destination">Odpri</button>').addTo(this.map))}closePopUp(){let t=document.getElementsByClassName("mapboxgl-popup");t[0]&&t[0].remove()}showFilters(){this.filtersVisible=!0}filtersChanged(){let t={};this.country!=null&&this.country!==""&&(t.country=this.country),this.mountain_range!=null&&this.mountain_range!==""&&(t.mountain_range=this.mountain_range),this.difficulty!=null&&this.difficulty!==""&&(t.difficulty=this.difficulty),this.type!=null&&this.type!==""&&(t.type=this.type),this.starting_point_min_height!=null&&(t.starting_point__lowValue=this.starting_point_min_height),this.starting_point_max_height!=null&&(t.starting_point__highValue=this.starting_point_max_height),this.end_point_min_height!=null&&(t.end_point__lowValue=this.end_point_min_height),this.end_point_max_height!=null&&(t.end_point__highValue=this.end_point_max_height),this.min_hiking_time!=null&&(t.hiking_time__lowValue=this.min_hiking_time),this.max_hiking_time!=null&&(t.hiking_time__highValue=this.max_hiking_time),this.distance!=null&&(t.distance=this.distance,t.lat=this.search_lat,t.lng=this.search_lng),this.destinations_ordering!=null&&(t.de
1326stinations_ordering=this.d_ordering),this.roads_ordering!=null&&(t.roads_ordering=this.r_ordering),this.router.navigate(["/search"],{queryParams:t})}onRoadSelect(t,o){if(this.removeRoadFocusLayer(),t==null){o?.();return}if(!this.map){this.pendingMobileRoadSelection=t,o?.();return}this.gpsTrackLoading=!0,this.roadService.getRoad(t,null).subscribe(n=>{if(n.end_point?.id!==n.starting_point?.id&&this.map){let d=this.fitBoundsCorrection([n.end_point.length,n.starting_point.width],[n.starting_point.length,n.end_point.width]);d&&this.map.fitBounds(d,{padding:{top:30,right:30,bottom:30,left:30}})}this.loadRoadGpsTrack(t,o)},()=>{this.gpsTrackLoading=!1,o?.()})}fitBoundsCorrection(t,o){let n;if(t[0]>o[0]&&t[1]>o[1])n=[o,t];else if(o[0]>t[0]&&o[1]>t[1])n=[t,o];else if(t[0]>o[0]&&t[1]<o[1]){let d=[t[0],o[1]];n=[[o[0],t[1]],d]}else if(t[0]<o[0]&&t[1]>o[1]){let d=[o[0],t[1]];n=[[t[0],o[1]],d]}return n}loadRoadGpsTrack(t,o){if(!this.map){this.gpsTrackLoading=!1,o?.();return}this.roadService.getGPSTracks(t).subscribe(n=>{let d=[],_=-90,C=90,M=-180,j=180;if((n.results||[]).forEach(G=>{(G.points||[]).forEach(ie=>{d.push([ie.longitude,ie.latitude]),ie.latitude>_&&(_=ie.latitude),ie.latitude<C&&(C=ie.latitude),ie.longitude>M&&(M=ie.longitude),ie.longitude<j&&(j=ie.longitude)})}),d.length===0||!this.map){this.gpsTrackLoading=!1,o?.();return}this.map.addSource("search_gps_track",{type:"geojson",data:{type:"Feature",geometry:{type:"LineString",coordinates:d},properties:{}}}),this.map.addLayer({id:"search_gps_track_layer",type:"line",source:"search_gps_track",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#e53935","line-width":4}}),this.map.fitBounds([[j,C],[M,_]],{padding:{top:30,right:30,bottom:30,left:30}}),this.gpsTrackLoading=!1,o?.()},()=>{this.gpsTrackLoading=!1,o?.()})}removeRoadFocusLayer(){this.map&&(this.map.getLayer("search_gps_track_layer")&&this.map.removeLayer("search_gps_track_layer"),this.map.getSource("search_gps_track")&&this.map.removeSource("search_gps_track"))}loadRoadsGEOJson(t=!1,o=200,n=0,d=null,_=null,C=null){if(!this.isBrowser||!this.map)return;if(t)if(this.geoJsonRoads={type:"FeatureCollection",features:[]},this.mapDataLoading=!0,this.roadsGeoSub!==null&&this.roadsGeoSub.unsubscribe(),this.search_lat==null&&this.search_lng==null){let j=this.map.getCenter();d="distance",_=j.lat,C=j.lng}else d=this.roads_order+this.roads_ordering,_=this.search_lat,C=this.search_lng;let M={country:this.country,mountain_range:this.mountain_range,type:this.type,difficulty:this.difficulty,min_end_point_height:this.end_point_min_height,max_end_point_height:this.end_point_max_height,min_starting_point_height:this.starting_point_min_height,max_starting_point_height:this.starting_point_max_height,min_hiking_time:this.min_hiking_time,max_hiking_time:this.max_hiking_time,fields:"id,starting_point,end_point",lat:_,lng:C,radius:this.distance};this.roadsGeoSub=this.roadService.getRoads(o,n,d,M).subscribe(j=>{for(let G of j.results||[]){let ie=G.starting_point,_e=G.end_point;ie?.length!=null&&ie?.width!=null&&_e?.length!=null&&_e?.width!=null&&this.geoJsonRoads.features.push({type:"Feature",geometry:{type:"Point",coordinates:[(ie.length+_e.length)/2,(ie.width+_e.width)/2]},properties:{id:G.id}})}this.renderRoadsLayer(),this.mapDataLoading=!1,j.offset+j.limit<j.count&&this.loadRoadsGEOJson(!1,o,n+o,d,_,C)})}renderRoadsLayer(){if(!this.map)return;let t=this.map.getSource("search_roads");t?t.setData(this.geoJsonRoads):(this.map.addSource("search_roads",{type:"geojson",data:this.geoJsonRoads,cluster:!0,clusterMaxZoom:14,clusterRadius:50}),this.map.addLayer({id:"search_roads_clusters",type:"circle",source:"search_roads",filter:["has","point_count"],paint:{"circle-color":"#e53935","circle-radius":["step",["get","point_count"],16,25,22,100,28],"circle-stroke-width":2,"circle-stroke-color":"#fff"}}),this.map.addLayer({id:"search_roads_cluster_count",type:"symbol",source:"search_roads",filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":12},paint:{"text-color":"#fff"}}
1326),this.map.addLayer({id:"search_roads_layer",type:"circle",source:"search_roads",filter:["!",["has","point_count"]],paint:{"circle-color":"#e53935","circle-radius":9,"circle-stroke-width":2,"circle-stroke-color":"#fff"}}),this.map.addLayer({id:"search_roads_icon_layer",type:"symbol",source:"search_roads",filter:["!",["has","point_count"]],layout:{"icon-image":"road-pin-icon","icon-size":.05,"icon-allow-overlap":!0}})),this.roadsHandlersBound||(this.map.on("click","search_roads_layer",o=>{let n=o.features?.[0];if(n){let d=n.properties.id;this.ngZone.run(()=>{this.onRoadSelect(d),this.roadsList?.selectAndScrollTo(d)})}}),this.map.on("mouseenter","search_roads_layer",()=>{this.map.getCanvas().style.cursor="pointer"}),this.map.on("mouseleave","search_roads_layer",()=>{this.map.getCanvas().style.cursor=""}),this.roadsHandlersBound=!0)}removeRoadsLayer(){this.map&&(this.map.getLayer("search_roads_icon_layer")&&this.map.removeLayer("search_roads_icon_layer"),this.map.getLayer("search_roads_layer")&&this.map.removeLayer("search_roads_layer"),this.map.getLayer("search_roads_cluster_count")&&this.map.removeLayer("search_roads_cluster_count"),this.map.getLayer("search_roads_clusters")&&this.map.removeLayer("search_roads_clusters"),this.map.getSource("search_roads")&&this.map.removeSource("search_roads"))}toggleWebcamPins(){this.showWebcamPins=!this.showWebcamPins,this.showWebcamPins?this.loadWebcamPins():this.removeWebcamPins()}loadWebcamPins(t=this.lat,o=this.lng){!this.isBrowser||!this.map||this.webcamService.getWebcamsNearby(t,o,50,0,50).subscribe(n=>{let d=n.webcams||n.result?.webcams||[];this.webcamPinsData=d;let _=d.filter(M=>M.location?.latitude!=null&&M.location?.longitude!=null).map((M,j)=>({type:"Feature",geometry:{type:"Point",coordinates:[M.location.longitude,M.location.latitude]},properties:{index:j}}));if(!this.map)return;let C=this.map.getSource("search_webcams");C?C.setData({type:"FeatureCollection",features:_}):(this.map.addSource("search_webcams",{type:"geojson",data:{type:"FeatureCollection",features:_}}),this.map.addLayer({id:"search_webcams_layer",type:"circle",source:"search_webcams",paint:{"circle-color":"#03cea4","circle-radius":9,"circle-stroke-width":2,"circle-stroke-color":"#fff"}}),this.map.addLayer({id:"search_webcams_icon_layer",type:"symbol",source:"search_webcams",layout:{"icon-image":"webcam-pin-icon","icon-size":.22,"icon-allow-overlap":!0}})),this.webcamHandlersBound||(this.map.on("click","search_webcams_icon_layer",M=>{let j=M.features?.[0];j&&this.ngZone.run(()=>{this.chosenWebcam=this.webcamPinsData[j.properties.index]})}),this.map.on("mouseenter","search_webcams_icon_layer",()=>{this.map.getCanvas().style.cursor="pointer"}),this.map.on("mouseleave","search_webcams_icon_layer",()=>{this.map.getCanvas().style.cursor=""}),this.webcamHandlersBound=!0),this.webcamPinsLoaded=!0})}removeWebcamPins(t=!0){this.map&&(this.map.getLayer("search_webcams_icon_layer")&&this.map.removeLayer("search_webcams_icon_layer"),this.map.getLayer("search_webcams_layer")&&this.map.removeLayer("search_webcams_layer"),this.map.getSource("search_webcams")&&this.map.removeSource("search_webcams"),t&&(this.webcamPinsLoaded=!1))}toggleStoryPins(){this.showStoryPins=!this.showStoryPins,this.showStoryPins?this.renderStoryPinsLayer():this.removeStoryPinsLayer()}onStoriesLoaded(t){this.storyPinsData=t,this.showStoryPins&&this.renderStoryPinsLayer()}renderStoryPinsLayer(){if(!this.map)return;let t=this.storyPinsData.filter(n=>n.latitude!=null&&n.longitude!=null).map((n,d)=>({type:"Feature",geometry:{type:"Point",coordinates:[n.longitude,n.latitude]},properties:{index:d}})),o=this.map.getSource("search_stories");o?o.setData({type:"FeatureCollection",features:t}):(this.map.addSource("search_stories",{type:"geojson",data:{type:"FeatureCollection",features:t}}),this.map.addLayer({id:"search_stories_layer",type:"circle",source:"search_stories",paint:{"circle-color":"#2196f3","circle-radius":9,"circle-stroke-width":2,"circle-stroke-color":"#fff"}}),this.map.addLayer({id:"search_stories_icon_layer",type:"symbol",source:"search_stories",layout:{"icon-image":"story-pin-icon","icon-size":.039,"icon-allow-overlap":!0}}
1326)),this.storyHandlersBound||(this.map.on("click","search_stories_icon_layer",n=>{let d=n.features?.[0];d&&this.ngZone.run(()=>{let _=this.storyPinsData[d.properties.index];this.storyList?.openStory(_)})}),this.map.on("mouseenter","search_stories_icon_layer",()=>{this.map.getCanvas().style.cursor="pointer"}),this.map.on("mouseleave","search_stories_icon_layer",()=>{this.map.getCanvas().style.cursor=""}),this.storyHandlersBound=!0)}removeStoryPinsLayer(){this.map&&(this.map.getLayer("search_stories_icon_layer")&&this.map.removeLayer("search_stories_icon_layer"),this.map.getLayer("search_stories_layer")&&this.map.removeLayer("search_stories_layer"),this.map.getSource("search_stories")&&this.map.removeSource("search_stories"))}onMapMoveEnd(){if(!this.map)return;let t=this.map.getCenter();if(this.showWebcamPins&&this.loadWebcamPins(t.lat,t.lng),this.showStoryPins&&this.storyList){this.storyList.lat=t.lat,this.storyList.lng=t.lng;let o={lat:t.lat,lng:t.lng,radius:this.storyList.radius,limit:this.storyList.limit,recent:this.storyList.recent};this.storyList.maxDaysSinceCreation!=null&&(o.max_days_since_creation=this.storyList.maxDaysSinceCreation),this.storyList.loadStories(o)}}onStoryFlyTo(t){t&&(this.zoom=14,this.flyToDestination([t.lng,t.lat],this.zoom))}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(sn),ae(Ln),ae(Eo),ae(si),ae(Gi),ae(Or),ae(qt))},e.\u0275cmp=st({type:e,selectors:[["app-search"]],viewQuery:function(o,n){if(o&1&&(ni(HQ,5),ni($Q,5),ni(GQ,5),ni(qQ,5),ni(WQ,5),ni(ZQ,5),ni(KQ,5),ni(XQ,5),ni(YQ,5),ni(QQ,5),ni(JQ,5)),o&2){let d;Xt(d=Yt())&&(n.storyList=d.first),Xt(d=Yt())&&(n.countryFilter=d.first),Xt(d=Yt())&&(n.hikingTimeFilter=d.first),Xt(d=Yt())&&(n.mountainRangeFilter=d.first),Xt(d=Yt())&&(n.endHeightFilter=d.first),Xt(d=Yt())&&(n.startHeightFilter=d.first),Xt(d=Yt())&&(n.destinationTypeFilter=d.first),Xt(d=Yt())&&(n.difficultyFilter=d.first),Xt(d=Yt())&&(n.distanceFilter=d.first),Xt(d=Yt())&&(n.destinationsList=d.first),Xt(d=Yt())&&(n.roadsList=d.first)}},hostBindings:function(o,n){o&1&&se("click",function(_){return n.destinationDetails(_)},!1,ns)},standalone:!0,features:[It([sn,Ti,Js,Ln,Eo]),gt],decls:60,vars:129,consts:[[1,"nav-tab-bar","hidden","hidden-desktop"],[1,"float-left","nav-tab",3,"ngClass","click"],["src","/assets/images/icon-marker-filled-50.png","alt","Destinacije"],["src","/assets/images/icon-track-order-64.png","alt","Poti"],[1,"clearfix"],[1,"floating-button","hidden","hidden-desktop",3,"click"],["src","/assets/images/filter_icon.png","alt","Filtriraj",2,"width","35px","padding","8px"],[1,"floating-button","map-toggle-button","hidden","hidden-desktop",3,"click"],["src","/assets/images/icon-map-marker-80.png","alt","Zemljevid","style","width: 34px; padding: 8px;",4,"ngIf"],["class","list-toggle-icon",4,"ngIf"],["id","filters-search",1,"col-1-no-padding",3,"ngClass"],[3,"filterName","filterID","filterType","contentType","multipleSelect","onSelect"],["countryFilter",""],[3,"filterName","filterID","filterType","contentType","multipleSelect","params","onSelect"],["mountainRangeFilter",""],[3,"filterName","filterID","filterType","contentType","sliderCeil","sliderType","highValueTitle","unit","onRangeChange","onLocationChange"],["distanceFilter",""],[3,"filterName","filterID","filterType","contentType","multipleSelect","onRangeChange"],["endHeightFilter",""],[3,"filterName","filterID","multipleSelect","filterType","contentType","onRangeChange"],["startHeightFilter",""],[3,"filterName","filterID","filterType","contentType","multipleSelect","sliderCeil","onRangeChange"],["hikingTimeFilter",""],["destinationTypeFilter",""],["difficultyFilter",""],["id","submit-filters",1,"margin-10-top","float-right","btn","btn-primary","btn-sm","hidden","hidden-desktop",3,"click"],[1,"search-shell"],[1,"search-sidebar",3,"ngClass"],[1,"search-tabs","hidden-mobile"],["type","button",1,"search-tab",3,"click"],[1,"search-panel","search-panel-split",3,"ngClass"],[1,"search-panel-half",3,"ngClass"],[3,"fields","selectedCountry","selectedMountainRange","selectedType","minHeight","maxHeight","searchLat","searchLng","distance","showSearchInput","showTitle","order","ordering","onDestinationSelect","onActionSelect","onOrderingChange"],["destinationsList",""],["class","search-panel-half",3,"ngClass",4,"ngIf"],[1,"search-panel",3,"ngClass"],[3,"fields","selectedCountry","selectedMountainRange","selectedType","selectedDifficulty","minEndPointHeight","maxEndPointHeight","minStartingPointHeight","maxStartingPointHeight","minHikingTime","maxHikingTime","searchLat","searchLng","distance","showSearchInput","showTitle","selectableRows","order","ordering","onRoadSelect","onActionSelect","onOrderingChange"],["roadsList",""],["type","button",1,"search-panel-toggle","hidden-mobile",3,"click"],[1,"arrow",3,"ngClass"],[1,"search-map",3,"ngClass"],["class","map-loading-indicator",4,"ngIf"],[1,"search-map-controls"],["color","black",3,"checked","toggleChange"],[3,"style","zoom","center","mapCreate",4,"ngIf"],[3,"webcam","popup","onClose",4,"ngIf"],[3,"gridHidden","lat","lng","radius","limit","maxDaysSinceCreation","storiesLoaded","onStoryOpen"],["storyList",""],["type","button","class","center-track-button","title","Centriraj na izbrano pot",3,"click",4,"ngIf"],["src","/assets/images/icon-map-marker-80.png","alt","Zemljevid",2,"width","34px","padding","8px"],[1,"list-toggle-icon"],[1,"pointer","hidden","hidden-desktop","mobile-drilldown-back",3,"click"],[3,"fields","selectedDestination","selectableRows","header","showSearchInput","onRoadSelect","onActionSelect"],[1,"map-loading-indicator"],[1,"map-loading-spinner"],[3,"zoom","center","mapCreate"],[3,"webcam","popup","onClose"],["type","button","title","Centriraj na izbrano pot",1,"center-track-button",3,"click"],[1,"center-track-icon"]],template:function(o,n){o&1&&(S(0,"div",0)(1,"div",1),se("click",function(){return n.showList("destinations")}),Z(2,"img",2),E(),S(3,"div",1),se("click",function(){return n.showList("roads")}),Z(4,"img",3),E(),Z(5,"div",4),E(),S(6,"div",5),se("click",function(){return n.showFilters()}),Z(7,"img",6),E(),S(8,"div",7),se("click",function(){return n.toggleMobileMapView()}),ce(9,eJ,1,0,"img",8)(10,tJ,1,0,"span",9),E(),S(11,"div",10)(12,"app-filter",11,12),se("onSelect",function(_){return n.onCountrySelect(_)}),E(),S(14,"app-filter",13,14),se("onSelect",function(_){return n.onMountainRangeSelect(_)}),E(),S(16,"app-filter",15,16),se("onRangeChange",function(_){return n.onDistanceRangeChange(_)})("onLocationChange",function(_){return n.onDistanceLocationChange(_)}),E(),S(18,"app-filter",17,18),se("onRangeChange",function(_){return n.onEndPointHeightChange(_)}),E(),S(20,"app-filter",19,20),se("onRangeChange",function(_){return n.onStartingPointHeightChange(_)}),E(),S(22,"app-filter",21,22),se("onRangeChange",function(_){return n.onHikingTimeChange(_)}),E(),S(24,"app-filter",11,23),se("onSelect",function(_){return n.onTypeSelect(_)}),E(),S(26,"app-filter",11,24),se("onSelect",function(_){return n.onDifficultySelect(_)}),E(),S(28,"button",25),se("click",function(){return n.filtersVisible=!1}),A(29," Potrdi "),E()(),S(30,"div",26)(31,"div",27)(32,"div",28)(33,"button",29),se("click",function(){return n.showList("destinations")}),A(34,"Destinacije"),E(),S(35,"button",29),se("click",function(){return n.showList("roads")}),A(36,"Poti"),E()(),S(37,"div",30)(38,"div",31)(39,"app-destination-list",32,33),se("onDestinationSelect",function(_){return n.onDestinationSelect(_)})("onActionSelect",function(_){return n.onDestinationActionSelect(_)})("onOrderingChange",function(_){return n.onOrderingChange(_,"destinations")}),E()(),ce(41,iJ,4,8,"div",34),E(),S(42,"div",35)(43,"app-road-list",36,37),se("onRoadSelect",function(_){return n.onRoadSelect(_)})("onActionSelect",function(_){return n.onRoadActionSelect(_)})("onOrderingChange",function(_){return n.onOrderingChange(_,"roads")}),E()()(),S(45,"button",38),se("click",function(){return n.toggleLeftPanel()}),Z(46,"i",39),E(),S(47,"div",40),ce(48,nJ,3,0,"div",41)(49,rJ,3,0,"div",41),S(50,"div",42)(51,"mat-slide-toggle",43),se("toggleChange",function(){return n.toggleWebcamPins()}),A(52," Spletne kamere "),E(),S(53,"mat-slide-toggle",43),se("toggleChange",function(){return n.toggleStoryPins()}),A(54," Zgodbe "),E()(),ce(55,aJ,1,9,"mgl-map",44)(56,lJ,1,2,"app-webcam",45),S(57,"app-story-list",46,47),se("storiesLoaded",function(_){return n.onStoriesLoaded(_)})("onStoryOpen",function(_){return n.onStoryFlyTo(_)}),E(),ce(59,cJ,2,0,"button",48),E()()),o&2&&(P(1),N("ngClass",kt(108,jN,n.activeTab==="destinations")),P(2),N("ngClass",kt(110,jN,n.activeTab==="roads")),P(5),Bn("aria-label",n.leftPanelCollapsed?"Prika\u017Ei seznam":"Prika\u017Ei zemljevid"),P(1),N("ngIf",!n.leftPanelCollapsed),P(1),N("ngIf",n.leftPanelCollapsed),P(1),N("ngClass",kt(112,wD,!n.filtersVisible)),P(1),N("filterName","dr\u017Eava")("filterID","country")("filterType","list")("contentType","country")("multipleSelect",!0),P(2),N("filterName","gorovje")("filterID","mountain_range")("filterType","list")("contentType","mountain_range")("multipleSelect",!0)("params",kt(114,uJ,n.country)),P(2),N("filterName","oddaljenost")("filterID","distance")("filterType","distance")("contentType","distance")("sliderCeil",1e3)("sliderType","value")("highValueTitle","Oddaljenost:")("unit","km"),P(2),N("filterName","vi\u0161ina cilja")("filterID","end_height")("filterType","range")("contentType","height")("multipleSelect",!0),P(2),N("filterName","vi\u0161ina izhodi\u0161\u010Da")("filterID","start_height")("multipleSelect",!0)("filterType","range")("contentType","height"),P(2),N("filterName","\u010Das hoje")("filterID","hiking_time")("filterType","range")("contentType","hiking_time")("multipleSelect",!0)("sliderCeil",1440),P(2),N("filterName","vrsta cilja")("filterID","type")("filterType","list")("contentType","type")("multipleSelect",!0),P(2),N("filterName","zahtevnost")("filterID","difficulty")("filterType","list")("contentType","difficulty")("multipleSelect",!0),P(5),N("ngClass",kt(116,dJ,n.leftPanelCollapsed)),P(2),Yi("active",n.activeTab==="destinations"),P(2),Yi("active",n.activeTab==="roads"),P(2),N("ngClass",mn(118,VN,!n.destinationsListVisible,!n.destinationsListVisible)),P(1),N("ngClass",mn(121,hJ,n.selectedDestinationForRoads,n.mobileRoadsDrillDownVisible)),P(1),N("fields","i
1326d,slug,title,height")("selectedCountry",n.country)("selectedMountainRange",n.mountain_range)("selectedType",n.type)("minHeight",n.end_point_min_height!=null?n.end_point_min_height:n.starting_point_min_height)("maxHeight",n.end_point_max_height!=null?n.end_point_max_height:n.starting_point_max_height)("searchLat",n.search_lat)("searchLng",n.search_lng)("distance",n.distance)("showSearchInput",!0)("showTitle",!1)("order",n.destinations_order)("ordering",n.destinations_ordering),P(2),N("ngIf",n.selectedDestinationForRoads),P(1),N("ngClass",mn(124,VN,!n.roadsListVisible,!n.roadsListVisible)),P(1),N("fields","id,slug,name,starting_point,end_point,hiking_time_formated,hiking_time,rating,closed")("selectedCountry",n.country)("selectedMountainRange",n.mountain_range)("selectedType",n.type)("selectedDifficulty",n.difficulty)("minEndPointHeight",n.end_point_min_height)("maxEndPointHeight",n.end_point_max_height)("minStartingPointHeight",n.starting_point_min_height)("maxStartingPointHeight",n.starting_point_max_height)("minHikingTime",n.min_hiking_time)("maxHikingTime",n.max_hiking_time)("searchLat",n.search_lat)("searchLng",n.search_lng)("distance",n.distance)("showSearchInput",!0)("showTitle",!1)("selectableRows",!0)("order",n.roads_order)("ordering",n.roads_ordering),P(2),Bn("aria-label",n.leftPanelCollapsed?"Prika\u017Ei stranski meni":"Skrij stranski meni"),P(1),N("ngClass",n.leftPanelCollapsed?"right":"left"),P(1),N("ngClass",kt(127,wD,!n.leftPanelCollapsed)),P(1),N("ngIf",n.mapDataLoading),P(1),N("ngIf",!n.mapDataLoading&&n.gpsTrackLoading),P(2),N("checked",n.showWebcamPins),P(2),N("checked",n.showStoryPins),P(2),N("ngIf",n.isBrowser&&n.mapVisible),P(1),N("ngIf",n.chosenWebcam),P(1),N("gridHidden",!0)("lat",n.lat)("lng",n.lng)("radius",50)("limit",50)("maxDaysSinceCreation",7),P(2),N("ngIf",n.selectedRoadForCenter))},dependencies:[Dt,on,At,Hx,zN,xD,Ff,bu,vl,vu,Tu,Af],styles:['.nav-tab-bar[_ngcontent-%COMP%]{box-shadow:0 -2px 8px #00000014}.nav-tab[_ngcontent-%COMP%]{width:calc(50% - 1px);transition:background var(--transition-fast)}.floating-button[_ngcontent-%COMP%]{box-shadow:var(--shadow-md);transition:transform var(--transition-fast)}.floating-button[_ngcontent-%COMP%]:hover, .floating-button[_ngcontent-%COMP%]:active{transform:scale(1.06)}.map-toggle-button[_ngcontent-%COMP%]{left:10px;right:auto}.list-toggle-icon[_ngcontent-%COMP%]{display:block;width:22px;height:3px;margin:13px auto 0;background:#fff;border-radius:2px;box-shadow:0 7px #fff,0 14px #fff}#filters-search[_ngcontent-%COMP%]{background:var(--color-surface)}#filters-search[_ngcontent-%COMP%]   .btn-primary[_ngcontent-%COMP%]{border-radius:var(--radius-pill)}.search-shell[_ngcontent-%COMP%]{clear:both;height:calc(100vh - 50px);display:flex;align-items:stretch;position:relative}@media screen and (min-width: 1001px){[_nghost-%COMP%]{display:flex;flex-direction:column;height:calc(100vh - 50px - var(--cookie-banner-height, 0px));overflow:hidden}#filters-search[_ngcontent-%COMP%]{flex:none}.search-shell[_ngcontent-%COMP%]{height:auto;flex:1;min-height:0}}.search-sidebar[_ngcontent-%COMP%]{flex:0 0 380px;width:380px;min-width:0;display:flex;flex-direction:column;overflow:hidden;border-right:1px solid var(--color-border);transition:flex-basis var(--transition-base),width var(--transition-base),opacity var(--transition-base)}.search-sidebar-collapsed[_ngcontent-%COMP%]{flex-basis:0;width:0;opacity:0;border-right:none}.search-tabs[_ngcontent-%COMP%]{display:flex;flex:none;border-bottom:1px solid var(--color-border)}.search-tab[_ngcontent-%COMP%]{flex:1;border:0;background:none;padding:12px 6px;cursor:pointer;font-size:var(--font-size-sm);font-weight:600;color:var(--color-text-muted);border-bottom:2px solid transparent;transition:color var(--transition-fast),border-color var(--transition-fast),background var(--transition-fast)}.search-tab[_ngcontent-%COMP%]:hover{background:var(--color-surface-alt);color:var(--color-text)}.search-tab.active[_ngcontent-%COMP%]{background:var(--color-accent);color:#fff;border-bottom-color:var(--color-accent)}.search-panel[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column}.search-tab-hidden[_ngcontent-%COMP%]{display:none!important}.search-panel-split[_ngcontent-%COMP%]{flex-direction:column}.search-panel-half[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;transition:flex var(--transition-base)}.search-panel-half-shrunk[_ngcontent-%COMP%]{flex:0 0 50%;border-bottom:1px solid var(--color-border)}.mobile-drilldown-back[_ngcontent-%COMP%]{padding:10px 12px;font-weight:600;color:var(--color-accent);border-bottom:1px solid var(--color-border);cursor:pointer}.search-panel-toggle[_ngcontent-%COMP%]{position:absolute;top:50%;left:380px;transform:translate(-50%,-50%);z-index:6;flex:none;width:30px;height:30px;border-radius:50%;border:1px solid var(--color-border);cursor:pointer;background:var(--color-surface);box-shadow:var(--shadow-md);display:flex;align-items:center;justify-content:center;transition:background var(--transition-fast),border-color var(--transition-fast),left var(--transition-base)}.search-panel-toggle[_ngcontent-%COMP%]:hover{background:var(--color-accent);border-color:var(--color-accent)}.search-sidebar-collapsed[_ngcontent-%COMP%] ~ .search-panel-toggle[_ngcontent-%COMP%]{left:0}.search-panel-toggle[_ngcontent-%COMP%]   .arrow[_ngcontent-%COMP%]{padding:5px;margin-left:2px;border-width:0 2px 2px 0;border-color:var(--color-text-muted);transition:border-color var(--transition-fast)}.search-panel-toggle[_ngcontent-%COMP%]:hover   .arrow[_ngcontent-%COMP%]{border-color:#fff}.search-map[_ngcontent-%COMP%]{flex:1;min-height:0;position:relative}.search-map[_ngcontent-%COMP%]   mgl-map[_ngcontent-%COMP%]{height:100%;width:100%}.map-loading-indicator[_ngcontent-%COMP%]{position:absolute;top:12px;left:50%;transform:translate(-50%);z-index:5;display:flex;align-items:center;gap:8px;background:var(--color-surface);color:var(--color-text, #333);padding:7px 16px;border-radius:var(--radius-pill);box-shadow:var(--shadow-md);font-size:var(--font-size-sm)}.map-loading-spinner[_ngcontent-%COMP%]{width:14px;
1326height:14px;flex:none;border:2px solid var(--color-border);border-top-color:var(--color-accent);border-radius:50%;animation:_ngcontent-%COMP%_map-loading-spin .7s linear infinite}@keyframes _ngcontent-%COMP%_map-loading-spin{to{transform:rotate(360deg)}}.center-track-button[_ngcontent-%COMP%]{position:absolute;bottom:16px;right:16px;z-index:10;width:40px;height:40px;border-radius:50%;border:1px solid var(--color-border);background:var(--color-surface);box-shadow:var(--shadow-md);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background var(--transition-fast),transform var(--transition-fast)}.center-track-button[_ngcontent-%COMP%]:hover{background:#fff;transform:scale(1.06)}.center-track-icon[_ngcontent-%COMP%]{position:relative;width:18px;height:18px;border:2px solid #e53935;border-radius:50%}.center-track-icon[_ngcontent-%COMP%]:before{content:"";position:absolute;top:50%;left:50%;width:5px;height:5px;border-radius:50%;background:#e53935;transform:translate(-50%,-50%)}.center-track-icon[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:50%;width:26px;height:26px;transform:translate(-50%,-50%);background:linear-gradient(#e53935,#e53935) center 0 / 2px 6px no-repeat,linear-gradient(#e53935,#e53935) center 100% / 2px 6px no-repeat,linear-gradient(#e53935,#e53935) 0 center / 6px 2px no-repeat,linear-gradient(#e53935,#e53935) 100% center / 6px 2px no-repeat}.search-map-controls[_ngcontent-%COMP%]{position:absolute;top:12px;right:12px;z-index:10;background:var(--color-surface);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);padding:6px 12px;display:flex;flex-direction:column;gap:2px}@media screen and (max-width: 1000px){[_nghost-%COMP%]{display:flex;flex-direction:column;height:calc(100vh - 52px - var(--cookie-banner-height, 0px));overflow:hidden}.nav-tab-bar[_ngcontent-%COMP%], #filters-search[_ngcontent-%COMP%]{flex:none}.search-shell[_ngcontent-%COMP%]{flex:1;min-height:0;height:auto;display:block;overflow:hidden}.search-map[_ngcontent-%COMP%]{height:100%}.search-map-controls[_ngcontent-%COMP%]{top:8px;right:8px;padding:4px 8px;font-size:var(--font-size-xs);max-width:calc(100% - 16px)}.search-sidebar[_ngcontent-%COMP%]{width:100%;height:100%;flex-basis:auto;border-right:none}.search-sidebar-collapsed[_ngcontent-%COMP%], .search-panel-toggle[_ngcontent-%COMP%]{display:none}}']});let i=e;return i})();var pJ=(i,e,r,t)=>({"popup-error-message":i,"popup-success-message":e,"popup-warning-message":r,"popup-info-message":t});function fJ(i,e){if(i&1){let r=Ge();S(0,"div",1)(1,"div",2),A(2),E(),S(3,"div",3),se("click",function(){Se(r);let o=q();return Te(o.hidePopup())}),A(4,"x"),E()()}if(i&2){let r=q();lu("top",r.y)("left",r.x),N("ngClass",jR(6,pJ,r.messageType==1,r.messageType==2,r.messageType==3,r.messageType==4)),P(2),mt(r.message)}}var Bf=(()=>{let e=class e{constructor(){this.message="",this.popupVisible=!1,this.x="0",this.y="0",this.messageType=1,this.handleClick=!1}onDocClickHandler(t){let o=document.getElementsByClassName("popup-message");!this.handleClick&&t.type=="click"&&(!o[0]||!o[0].contains(t.target))&&(this.popupVisible=!1),this.handleClick=!1}showPopup(t,o=1,n=0,d=0){this.handleClick=!0,this.message=t,this.messageType=o,this.popupVisible=!0,this.x=n+20+"px",this.y=d-25+"px"}hidePopup(){this.message="",this.popupVisible=!1}};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=st({type:e,selectors:[["app-popup-message"]],hostBindings:function(o,n){o&1&&se("click",function(_){return n.onDocClickHandler(_)},!1,ns)},standalone:!0,features:[gt],decls:1,vars:1,consts:[["class","popup-message",3,"top","left","ngClass",4,"ngIf"],[1,"popup-message",3,"ngClass"],[1,"pm-content","float-left"],[1,"pm-close","float-right",3,"click"]],template:function(o,n){o&1&&ce(0,fJ,5,11,"div",0),o&2&&N("ngIf",n.popupVisible)},dependencies:[Dt,on,At]});let i=e;return i})();var Iu=(()=>{let e=class e{constructor(t){this.router=t,this.router.events.pipe(dn(o=>o instanceof pf),wy()).subscribe(o=>{sessionStorage.setItem("previousUrl",o[0].urlAfterRedirects),sessionStorage.setItem("currentUrl",o[0].urlAfterRedirects)})}};e.\u0275fac=function(o){return new(o||e)(Ve(si))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();function mJ(){return typeof window<"u"?window.navigator:void 0}function GN(i){return!!(i.parentElement&&i.parentElement.nodeName.toLowerCase()==="picture")}function p0(i){return i.nodeName.toLowerCase()==="img"}function qN(i,e,r){return p0(i)?r&&"srcset"in i?i.srcset=e:i.src=e:i.style.backgroundImage=`url('${e}')`,i}function ID(i){return e=>{let r=e.parentElement.getElementsByTagName("source");for(let t=0;t<r.length;t++){let o=r[t].getAttribute(i);o&&("srcset"in r[t]?r[t].srcset=o:r[t].src=o)}}}var gJ=ID("defaultImage"),WN=ID("lazyLoad"),_J=ID("errorImage");function DD(i){return(e,r,t)=>{p0(e)&&GN(e)&&i(e),r&&qN(e,r,t)}}var vJ=DD(gJ),yJ=DD(WN),bJ=DD(_J),ED=class{constructor(){this.navigator=mJ()}setPlatformId(e){this.platformId=e}onDestroy(e){}onAttributeChange(e){}},Uf={loaded:"ng-lazyloaded",loading:"ng-lazyloading",failed:"ng-failed-lazyloaded"};function $N(i,e){i.className=i.className.replace(e,"")}function CD(i,e){i.className.includes(e)||(i.className+=` ${e}`)}function xJ(i,e){return i.className&&i.className.includes(e)}
1326var SD=class extends ED{setup(e){vJ(e.element,e.defaultImagePath,e.useSrcset),e.imagePath&&CD(e.element,Uf.loading),xJ(e.element,Uf.loaded)&&$N(e.element,Uf.loaded)}finally(e){CD(e.element,Uf.loaded),$N(e.element,Uf.loading)}loadImage(e){if(this.skipLazyLoading(e))return[e.imagePath];let{element:r,useSrcset:t,imagePath:o,decode:n}=e,d;return p0(r)&&GN(r)?(d=r.parentNode.cloneNode(!0).getElementsByTagName("img")[0],WN(d),qN(d,o,t)):(d=new Image,p0(r)&&r.referrerPolicy&&(d.referrerPolicy=r.referrerPolicy),p0(r)&&r.sizes&&(d.sizes=r.sizes),t&&"srcset"in d?d.srcset=o:d.src=o),n&&d.decode?d.decode().then(()=>o):new Promise((_,C)=>{d.onload=()=>_(o),d.onerror=()=>C(null)})}setErrorImage(e,r){let{element:t,useSrcset:o,errorImagePath:n}=r;bJ(t,n,o),CD(t,Uf.failed)}setLoadedImage(e,r){let{element:t,useSrcset:o}=r;yJ(t,e,o)}isDisabled(){return u_(this.platformId)&&!this.isBot()}skipLazyLoading(e){return this.isBot(e)}isBot(e){return this.navigator?.userAgent?/googlebot|bingbot|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|duckduckbot|prerender/i.test(this.navigator.userAgent):!1}},TD=class extends SD{constructor(){super(...arguments),this.observers=new WeakMap,this.intersectionSubject=ne
1326w Jt,this.uniqKey={}}getObservable(e){if(this.skipLazyLoading(e))return Bt({isIntersecting:!0});if(e.customObservable)return e.customObservable;let r=e.scrollContainer||this.uniqKey,t={root:e.scrollContainer||null};e.offset&&(t.rootMargin=`${e.offset}px`);let o=this.observers.get(r);return o||(o=new IntersectionObserver(n=>this.loadingCallback(n),t),this.observers.set(r,o)),o.observe(e.element),gi.create(n=>{let d=this.intersectionSubject.pipe(dn(_=>_.target===e.element)).subscribe(n);return()=>{d.unsubscribe(),o.unobserve(e.element)}})}isVisible(e){return e.isIntersecting}loadingCallback(e){e.forEach(r=>this.intersectionSubject.next(r))}};function wJ(i,e){return r=>r.pipe(Vi(t=>e.onStateChange.emit({reason:"observer-emit",data:t})),dn(t=>i.isVisible(t,e)),Ur(1),Vi(()=>e.onStateChange.emit({reason:"start-loading"})),jn(()=>i.loadImage(e)),Vi(()=>e.onStateChange.emit({reason:"mount-image"})),Vi(t=>i.setLoadedImage(t,e)),Vi(()=>e.onStateChange.emit({reason:"loading-succeeded"})),ei(()=>!0),Vs(t=>(e.onStateChange.emit({reason:"loading-failed",data:t}),i.setErrorImage(t,e),Bt(!1))),Vi(()=>{e.onStateChange.emit({reason:"finally"}),i.finally(e)}))}var ZN=new Ct("LazyLoadImageHooks"),Hf=(()=>{class i{constructor(r,t,o,n){this.onStateChange=new Fe,this.elementRef=r,this.ngZone=t,this.propertyChanges$=new Tg,this.hooks=n,this.hooks.setPlatformId(o),this.uid=Math.random().toString(36).substr(2,9)}ngOnChanges(){this.debug===!0&&!this.debugSubscription&&(this.debugSubscription=this.onStateChange.subscribe(r=>console.log(r))),this.propertyChanges$.next({element:this.elementRef.nativeElement,imagePath:this.lazyImage,defaultImagePath:this.defaultImage,errorImagePath:this.errorImage,useSrcset:this.useSrcset,offset:this.offset?this.offset|0:0,scrollContainer:this.scrollTarget,customObservable:this.customObservable,decode:this.decode,onStateChange:this.onStateChange,id:this.uid})}ngAfterContentInit(){if(this.hooks.isDisabled())return null;this.ngZone.runOutsideAngular(()=>{this.loadSubscription=this.propertyChanges$.pipe(Vi(r=>this.hooks.onAttributeChange(r)),Vi(r=>r.onStateChange.emit({reason:"setup"})),Vi(r=>this.hooks.setup(r)),xr(r=>r.imagePath?this.hooks.getObservable(r).pipe(wJ(this.hooks,r)):PC())).subscribe({next:()=>null})})}ngOnDestroy(){this.propertyChanges$.pipe(Ur(1)).subscribe({next:r=>this.hooks.onDestroy(r)}).unsubscribe(),this.loadSubscription?.unsubscribe(),this.debugSubscription?.unsubscribe()}}return i.\u0275fac=function(r){return new(r||i)(ae(Pi),ae(qt),ae(Qt),ae(ZN))},i.\u0275dir=bi({type:i,selectors:[["","lazyLoad",""]],inputs:{lazyImage:["lazyLoad","lazyImage"],defaultImage:"defaultImage",errorImage:"errorImage",scrollTarget:"scrollTarget",customObservable:"customObservable",offset:"offset",useSrcset:"useSrcset",decode:"decode",debug:"debug"},outputs:{onStateChange:"onStateChange"},features:[hn]}),i})(),$f=(()=>{class i{}return i.\u0275fac=function(r){return new(r||i)},i.\u0275mod=Ui({type:i}),i.\u0275inj=Bi({providers:[{provide:ZN,useClass:TD}]}),i})(),g1=class i{constructor(e,r,t,o){this.left=e,this.top=r,this.right=t,this.bottom=o}static fromElement(e){let{left:r,top:t,right:o,bottom:n}=e.getBoundingClientRect();return r===0&&t===0&&o===0&&n===0?i.empty:new i(r,t,o,n)}static fromWindow(e){return new i(0,0,e.innerWidth,e.innerHeight)}inflate(e){this.left-=e,this.top-=e,this.right+=e,this.bottom+=e}intersectsWith(e){return e.left<this.right&&this.left<e.right&&e.top<this.bottom&&this.top<e.bottom}getIntersectionWith(e){let r=Math.max(this.left,e.left),t=Math.max(this.top,e.top),o=Math.min(this.right,e.right),n=Math.min(this.bottom,e.bottom);return o>=r&&n>=t?new i(r,t,o,n):i.empty}};g1.empty=new g1(0,0,0,0);function CJ(i,e){i&1&&(S(0,"div",6)(1,"div",7),A(2," Spletne kamere "),E(),Z(3,"div",8),E())}function EJ(i,e){if(i&1){let r=Ge();S(0,"ngx-slider",10),se("userChangeEnd",function(o){Se(r);let n=q(2);return Te(n.changeWebcamsRadius(o))}),E()}if(i&2){let r=q(2);N("value",r.radius)("options",r.radiusOptions)}}function SJ(i,e){if(i&1&&(S(0,"div"),A(1," Kamere oddaljene od cilja (km): "),ce(2,EJ,1,2,"ngx-slider",9),E()),i&2){let r=q();P(2),N("ngIf",r.isBrowser)}}function TJ(i,e){if(i&1){let r=Ge();S(0,"app-webcam",11),se("onClose",function(){Se(r);let o=q();return Te(o.chosenWebcam=null)}),E()}if(i&2){let r=q();N("webcam",r.chosenWebcam)}}
1326var IJ=i=>({"col-2-no-padding":i});function DJ(i,e){if(i&1){let r=Ge();S(0,"div",12),se("click",function(){let n=Se(r).$implicit,d=q();return Te(d.chooseWebcam(n))}),S(1,"div"),Z(2,"img",13),E(),S(3,"div")(4,"h4"),A(5),E(),A(6," Oddaljenost: "),S(7,"span",14),A(8),$r(9,"number"),E(),Z(10,"br"),A(11),Z(12,"br"),A(13),$r(14,"date"),E(),Z(15,"div",8),E()}if(i&2){let r=e.$implicit,t=q();N("ngClass",kt(19,IJ,t.cols==2)),P(1),ki("float-left margin-5 webcam-image-",t.currentImageType,""),P(1),fn("alt","Spletna kamera ",r.title,""),Hi("lazyLoad",r.images.current[t.currentImageType]),P(1),ki("float-left margin-5 webcam-text-",t.currentImageType,""),P(2),We("Spletna kamera: ",r.title,""),P(3),We(" ",Gr(9,13,r.distance,"1.2-2")," km "),P(3),We(" Status: ",r.status=="active"?"Aktivna":"Neaktivna",""),P(2),We(" Zadnji\u010D osve\u017Eena: ",Gr(14,16,r.lastUpdatedOn,"dd.MM.YYYY, HH:mm")," ")}}var _1=(()=>{let e=class e{constructor(t,o,n,d){this.platformId=t,this.webcamService=o,this.route=n,this.lc=d,this.loader=!1,this.limit=40,this.offset=0,this.finished=!1,this.webcams=[],this.chosenWebcam=null,this.currentImageType="preview",this.lat=null,this.lng=null,this.radius=15,this.cols=1,this.showHeader=!1,this.showRadiusSlider=!1,this.showSearchInput=!1,this.radiusOptions={floor:0,ceil:100},this.isBrowser=Si(this.platformId)}getWebcams(t=!1){if(t){if(this.finished)return;this.loader=!0}else this.finished=!1,this.offset=0,this.webcams=[],this.loader=!0;this.webcamService.getWebcamsNearby(this.lat,this.lng,this.radius,this.offset).subscribe(o=>{o.status==="OK"&&(o=o.result),o.total<=o.offset+o.limit?this.finished=!0:this.offset+=o.limit,t?this.webcams=this.webcams.concat(o.webcams):this.webcams=o.webcams;for(let n in this.webcams)this.webcams[n].distance=this.webcamService.distanceInKmBetweenEarthCoordinates(this.lat,this.lng,this.webcams[n].location.latitude,this.webcams[n].location.longitude);this.loader=!1})}chooseWebcam(t){this.chosenWebcam=t}changeWebcamsRadius(t){this.radius=t.value,this.getWebcams()}onScroll(){this.getWebcams(!0)}ngOnInit(){this.getWebcams()}ngOnChanges(t){for(let o in t)(o==="lat"||o==="lng")&&this.getWebcams()}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(Eo),ae(Gi),ae(qt))},e.\u0275cmp=st({type:e,selectors:[["app-webcam-list"]],inputs:{limit:"limit",currentImageType:"currentImageType",lat:"lat",lng:"lng",radius:"radius",cols:"cols",showHeader:"showHeader",showRadiusSlider:"showRadiusSlider",showSearchInput:"showSearchInput"},standalone:!0,features:[It([Eo]),hn,gt],decls:7,vars:10,consts:[["class","col-header",4,"ngIf"],[4,"ngIf"],["style","left: 0;",3,"webcam","onClose",4,"ngIf"],["infiniteScroll","",2,"height","calc(100% - 16px) !important","overflow","scroll",3,"infiniteScrollDistance","infiniteScrollThrottle","scrollWindow","scrolled"],["class","margin-10-top webcam-row",3,"ngClass","click",4,"ngFor","ngForOf"],["src","/assets/images/small_loader.gif"],[1,"col-header"],[1,"float-left"],[1,"clearfix"],[3,"value","options","userChangeEnd",4,"ngIf"],[3,"value","options","userChangeEnd"],[2,"left","0",3,"webcam","onClose"],[1,"margin-10-top","webcam-row",3,"ngClass","click"],["defaultImage","/assets/images/loader.gif",3,"alt","lazyLoad"],[1,"mountain-height","mountain-height-sm"]],template:function(o,n){o&1&&(ce(0,CJ,4,0,"div",0)(1,SJ,3,1,"div",1)(2,TJ,1,1,"app-webcam",2),S(3,"div",3),se("scrolled",function(){return n.onScroll()}),ce(4,DJ,16,21,"div",4),E(),S(5,"div"),Z(6,"img",5),E()),o&2&&(N("ngIf",n.showHeader),P(1),N("ngIf",n.showRadiusSlider),P(1),N("ngIf",n.isBrowser),P(1),N("infiniteScrollDistance",2)("infiniteScrollThrottle",1e3)("scrollWindow",!1),P(1),N("ngForOf",n.webcams),P(1),ki("",n.loader&&!n.finished?"":"hidden"," loader center-text margin-5"))},dependencies:[Nx,q_,Tu,kf,Mf,Dt,on,ti,At,rf,Xs,$f,Hf]});let i=e;return i})();var v1=(()=>{let e=class e{constructor(t){this.http=t,this.ratesUrl="/rates/",this.headers=new Qn({"Content-Type":"application/json"})}insertRate(t,o,n){let d=this.ratesUrl+o+"/"+t+"/create/";return this.http.post(d,{rate:n},this.jwt())}jwt(){let t=localStorage.getItem("token");return t?{headers:new Qn({"Content-Type":"application/json",Authorization:"JWT "+t})}:{}}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var kJ=["popupMessage"],y1=(()=>{let e=class e{constructor(t){this.rateService=t,this.mouseStar=null,this.version="normal",this.id=null,this.type=null,this.rating=null,this.active=!0,this.popup_message=null}rate(t,o){this.active&&this.rateService.insertRate(this.id,this.type,t).subscribe(n=>{this.rating=n.average_rate,this.popup_message.showPopup("Ocena uspe\u0161no oddana!",2,o.pageX,o.pageY)},n=>
1326{let d=n.error.non_field_errors?n.error.non_field_errors:n.error.detail;this.popup_message.showPopup(d,1,o.pageX,o.pageY)})}mouseOver(t){this.mouseStar=t}mouseLeave(){this.mouseStar=null}};e.\u0275fac=function(o){return new(o||e)(ae(v1))},e.\u0275cmp=st({type:e,selectors:[["app-rating"]],viewQuery:function(o,n){if(o&1&&ni(kJ,5),o&2){let d;Xt(d=Yt())&&(n.popup_message=d.first)}},inputs:{version:"version",id:"id",type:"type",rating:"rating",active:"active"},standalone:!0,features:[It([v1]),gt],decls:9,vars:25,consts:[[3,"mouseleave"],[3,"mouseover","click"],[1,"clearfix"],["popupMessage",""]],template:function(o,n){o&1&&(S(0,"div",0),se("mouseleave",function(){return n.mouseLeave()}),S(1,"div",1),se("mouseover",function(){return n.mouseOver(1)})("click",function(_){return n.rate(1,_)}),E(),S(2,"div",1),se("mouseover",function(){return n.mouseOver(2)})("click",function(_){return n.rate(2,_)}),E(),S(3,"div",1),se("mouseover",function(){return n.mouseOver(3)})("click",function(_){return n.rate(3,_)}),E(),S(4,"div",1),se("mouseover",function(){return n.mouseOver(4)})("click",function(_){return n.rate(4,_)}),E(),S(5,"div",1),se("mouseover",function(){return n.mouseOver(5)})("click",function(_){return n.rate(5,_)}),E(),Z(6,"div",2),E(),Z(7,"app-popup-message",null,3)),o&2&&(P(1),Jp("star",n.version=="small"?" star-sm":"","",n.mouseStar>=1&&n.active?" star-mouse-over":"","",n.rating>=.5?" star-full":"",""),P(1),Jp("star",n.version=="small"?" star-sm":"","",n.mouseStar>=2&&n.active?" star-mouse-over":"","",n.rating>=1.5?" star-full":"",""),P(1),Jp("star",n.version=="small"?" star-sm":"","",n.mouseStar>=3&&n.active?" star-mouse-over":"","",n.rating>=2.5?" star-full":"",""),P(1),Jp("star",n.version=="small"?" star-sm":"","",n.mouseStar>=4&&n.active?" star-mouse-over":"","",n.rating>=3.5?" star-full":"",""),P(1),Jp("star",n.version=="small"?" star-sm":"","",n.mouseStar>=5&&n.active?" star-mouse-over":"","",n.rating>=4.5?" star-full":"",""))},dependencies:[Bf]});let i=e;return i})();var b1=(()=>{let e=class e{constructor(t){this.http=t,this.url="https://api.openweathermap.org/data/2.5/forecast",this.key="c985051446ddc545537567b6383e90b1"}getForecastByCordinates(t,o){let n=this.url+"?appid="+this.key;return n=n+(t?"&lat="+t:""),n=n+(o?"&lon="+o:""),this.http.get(n)}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();function PJ(i,e){if(i&1&&(S(0,"th"),A(1),$r(2,"date"),E()),i&2){let r=e.$implicit;P(1),We(" ",Gr(2,1,r,"E")," ")}}function OJ(i,e){if(i&1&&Z(0,"img",3),i&2){let r=q().$implicit,t=q().$implicit,o=q();Ws("alt","Ikona vremena za datum ",r," ",t,""),fn("src","https://openweathermap.org/img/wn/",o.data[r+" "+t],"@2x.png",Ei)}}function RJ(i,e){if(i&1&&(S(0,"td"),ce(1,OJ,1,3,"img",2),E()),i&2){let r=e.$implicit,t=q().$implicit,o=q();P(1),N("ngIf",o.data[r+" "+t])}}function LJ(i,e){if(i&1&&(S(0,"tr")(1,"td")(2,"b"),A(3),E()(),ce(4,RJ,2,1,"td",1),E()),i&2){let r=e.$implicit,t=q();P(3),mt(r.split(":")[0]),P(1),N("ngForOf",t.dates)}}var x1=(()=>{let e=class e{constructor(t){this.weatherService=t,this.lat=null,this.lng=null,this.data={},this.dates=[],this.times=[]}ngOnInit(){this.getForecast()}ngOnChanges(t){for(let o in t)(o==="lat"||o==="lng")&&this.getForecast()}getForecast(){this.weatherService.getForecastByCordinates(this.lat,this.lng).subscribe(t=>{let o,n;for(let d of t.list)this.data[d.dt_txt]=d.weather[0].icon,o=d.dt_txt.split(" ")[0],n=d.dt_txt.split(" ")[1],this.dates.indexOf(o)===-1&&this.dates.push(o),this.times.indexOf(n)===-1&&n!=="21:00:00"&&n!=="00:00:00"&&n!=="03:00:00"&&n!=="06:00:00"&&this.times.push(n);this.dates.sort(),this.times.sort()})}};e.\u0275fac=function(o){return new(o||e)(ae(b1))},e.\u0275cmp=st({type:e,selectors:[["app-weather-forecast"]],inputs:{lat:"lat",lng:"lng"},standalone:!0,features:[It([b1]),hn,gt],decls:7,vars:2,consts:[[1,"full-width","weather-table"],[4,"ngFor","ngForOf"],["width","100%",3,"alt","src",4,"ngIf"],["width","100%",3,"alt","src"]],template:function(o,n){o&1&&(S(0,"table",0)(1,"thead")(2,"tr"),Z(3,"th"),ce(4,PJ,3,4,"th",1),E()(),S(5,"tbody"),ce(6,LJ,5,2,"tr",1),E()()),o&2&&(P(4),N("ngForOf",n.dates),P(2),N("ngForOf",n.times))},dependencies:[Xs,Dt,ti,At]});let i=e;return i})();var w1=(()=>{let e=class e{constructor(t){this.http=t,this.commentsUrl="/comments/",this.headers=new Qn({"Content-Type":"application/json"})}getComments(t,o,n=null,d=20,_=0){let C=this.commentsUrl+"?content_type="+o+"&c
1326ontent_type="+o+"&id="+t+"&limit="+d+"&offset="+_;return C+=n!=null?"&ordering="+n:"",this.http.get(C)}insertComment(t,o,n){let d=this.commentsUrl+"/create/"+o+"/"+t+"/";return this.http.post(d,{comment:n})}editComment(t,o){let n=this.commentsUrl+"edit/"+t+"/";return this.http.put(n,{comment:o})}deleteComment(t){let o=this.commentsUrl+"delete/"+t+"/";return this.http.delete(o)}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var Du=(()=>{let e=class e{constructor(t){this.isBrowser=Si(t)}localStorageItem(t){return this.isBrowser?localStorage.getItem(t):null}getUserFirstChar(){let t="";return localStorage.getItem("username")!=null&&(t=localStorage.getItem("username").charAt(0)),t}};e.\u0275fac=function(o){return new(o||e)(Ve(Qt))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var NJ=["newComment"];function zJ(i,e){if(i&1&&(S(0,"span",14),A(1),E()),i&2){let r=q(2);P(1),mt(r.specialTitle)}}function jJ(i,e){if(i&1&&(S(0,"div",11)(1,"h3",12),A(2),ce(3,zJ,2,1,"span",13),A(4,'" '),E()()),i&2){let r=q();P(2),tr(" Pogovor o ",r.type=="road"?"poti":"destinaciji",' "',r.commentsTitle," "),P(1),N("ngIf",r.specialTitle)}}function VJ(i,e){if(i&1){let r=Ge();S(0,"select",15),se("change",function(o){Se(r);let n=q();return Te(n.changeOrdering(o.target))}),S(1,"option",16),A(2,"Zadnji komentarji na vrhu"),E(),S(3,"option",17),A(4,"Prvi komentarji na vrhu"),E(),S(5,"option",18),A(6,"Najbolje ocenjeni komentarji na vrhu"),E(),S(7,"option",19),A(8,"Najslab\u0161e ocenjeni komentarji na vrhu"),E()()}}function BJ(i,e){if(i&1){let r=Ge();S(0,"button",20),se("click",function(){Se(r);let o=q();return Te(o.addComment())}),A(1,"Dodaj komentar"),E()}}function UJ(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.comment[0]," ")}}function HJ(i,e){if(i&1){let r=Ge();S(0,"div")(1,"form",21)(2,"textarea",22,23),se("keyup",function(o){Se(r);let n=q();return Te(n.newCommentKeyUp(o))}),E(),ce(4,UJ,2,1,"div",7),S(5,"div",24),A(6),E(),S(7,"button",25),se("click",function(){Se(r);let o=q();return Te(o.submitComment(o.commentForm.value))}),A(8,"Potrdi"),E()()()}if(i&2){let r=q();P(1),N("formGroup",r.commentForm),P(3),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.comment!==void 0),P(2),We(" Vnesete lahko \u0161e ",r.commentMax," znakov. ")}}function $J(i,e){i&1&&(S(0,"div"),A(1,"Ni komentarjev."),E())}function GJ(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages.detail," ")}}function qJ(i,e){if(i&1&&(S(0,"div"),A(1),E()),i&2){let r=q().$implicit;P(1),mt(r.comment)}}function WJ(i,e){if(i&1){let r=Ge();S(0,"form",21),Z(1,"textarea",33)(2,"br"),S(3,"button",34),se("click",function(){Se(r);let o=q().$implicit,n=q();return Te(n.submitEditedComment(o.id,n.editCommentForm.value))}),A(4,"Shrani"),E(),S(5,"button",35),se("click",function(){Se(r);let o=q(2);return Te(o.cancelEditComment())}),A(6,"Prekli\u010Di"),E()()}if(i&2){let r=q(2);N("formGroup",r.editCommentForm)}}function ZJ(i,e){if(i&1){let r=Ge();S(0,"div",36),Z(1,"br"),S(2,"a",37),se("click",function(){Se(r);let o=q().$implicit,n=q();return Te(n.deleteComment(o.id))}),A(3,"Izbri\u0161i"),E(),A(4,"\xA0\xA0\xA0\xA0 "),S(5,"a",37),se("click",function(){Se(r);let o=q().$implicit,n=q();return Te(n.editComment(o.id,o.comment))}),A(6,"Uredi"),E()()}}function KJ(i,e){if(i&1&&(S(0,"div",27),Z(1,"div",28),S(2,"div",29),ce(3,qJ,2,1,"div",6)(4,WJ,7,1,"form",30),E(),S(5,"div",31),A(6),Z(7,"br"),A(8),ce(9,ZJ,7,0,"div",32),E(),Z(10,"div",5),E()),i&2){let r=e.$implicit,t=q();P(3),N("ngIf",t.editCommentID!=r.id),P(1),N("ngIf",t.editCommentID==r.id),P(2),We(" ",r.user.username,""),P(2),We(" ",r.created_at," "),P(1),N("ngIf",r.user.id==t.gapp.localStorageItem("userID"))}}function XJ(i,e){if(i&1){let r=Ge();S(0,"a",37),se("click",function(){Se(r);let o=q();return Te(o.loadMore())}),A(1,"Prika\u017Ei ve\u010D komentarjev..."),E()}}var Gf=(()=>{let e=class e{constructor(t,o,n,d){this.gapp=t,this.commentService=o,this.route=n,this.formBuilder=d,this.loader=!1,this.comments=[],this.commentMax=600,this.limit=20,this.offset=0,this.ordering="-created_at",this.newCommentFormVisible=!1,this.moreToBeLoaded=!1,this.commentForm=null,this.editCommentForm=null,this.editCommentID=null,this.getIDfromURL=!0,this.id=null,this.type=null,this.commentsTitle=null,this.specialTitle=null,this.titleVisible=!0}addComment(){this.commentForm=this.formBuilder.group({comment:["",Wt.required]}),this.newCommentFormVisible=!0,setTimeout(()=>{this.newComment.nativeElement.focus()},0)}submitComment(t){this.newCommentFormVisible=!1,this.loader=!0,this.offset=0,this.comments=[],this.getIDfromURL?this.sub=this.route.params.subscribe(o=>{let n=+o.id;n&&this.commentService.insertComment(n,this.type,t.comment).subscribe(d=>{this.loadComments(n,!1),this.errorMessages=[]},d=>{this.loadComments(n,!1),this.newCommentFormVisible=!0,this.errorMessages=d.error})}):this.commentService.insertComment(this.id,this.type,t.comment).subscribe(o=>{this.loadComments(this.id,!1),this.errorMessages=[]},o=>{this.loadComments(this.id,!1),this.newCommentFormVisible=!0,this.errorMessages=o.error})}submitEditedComment(t,o){this.loader=!0,this.offset=0,this.comments=[],this.getIDfromURL?this.sub=this.route.params.subscribe(n=>{let d=+n.id;d&&this.commentService.editComment(t,o.comment).subscribe(_=>{this.editCommentID=null,this.loadComments(d,!1),this.errorMessages=[]},_=>{this.loadComments(d,!1),this.newCommentFormVisible=!0,this.errorMessages=JSON.parse(_.error)})}):this.commentService.editComment(t,o.comment).subscribe(n=>{this.editCommentID=null,this.loadComments(this.id,!1),this.errorMessages=[]},n=>{this.loadComments(this.id,!1),this.newCommentFormVisible=!0,this.errorMessages=JSON.parse(n.error)})}deleteComment(t){this.loader=!0,this.comments=[],this.offset=0,this.getIDfromURL?this.sub=this.route.params.subscribe(o=>{let n=+o.id;n&&this.commentService.deleteComment(t).subscribe(d=>{this.loadComments(n,!1),this.errorMessages=[]},d=>{this.loadComments(n,!1),this.errorMessages=JSON.parse(d.error)})}):this.commentService.deleteComment(t).subscribe(o=>{this.loadComments(this.id,!1),this.errorMessages=[]},o=>{this.loadComments(this.id,!1),this.errorMessages=JSON.parse(o.error)})}editComment(t,o){this.editCommentID=t,this.editCommentForm=this.formBuilder.group({comment:[o,Wt.required]})}cancelEditComment(){this.editCommentID=null}newCommentKeyUp(t){let o=t.target.value.length;this.commentMax=600-o}loadMore(){this.loader=!0,this.getIDfromURL?this.sub=this.route.params.subscribe(t=>{let o=+t.id;o&&this.loadComments(o)}):this.loadComments(this.id)}loadComments(t,o=!0){this.commentService.getComments(t,this.type,this.ordering,this.limit,this.offset).subscribe(n=>{o?this.comments=this.comments.concat(n.results):this.comments=n.results,this.offset+=this.limit,this.moreToBeLoaded=n.next!=null,this.loader=!1})}changeOrdering(t){this.loader=!0,this.ordering=t.ordering,this.offset=0,this.getIDfromURL?this.sub=this.route.params.subscribe(o=>{let n=+o.id;n&&this.commentService.getComments(n,this.type,this.ordering,this.limit,this.offset).subscribe(d=>{this.comments=d.results,this.offset+=this.limit,this.moreToBeLoaded=d.next!=null,this.loader=!1})}):this.commentService.getComments(this.id,this.type,this.ordering,this.limit,this.offset).subscribe(o=>{this.comments=o.results,this.offset+=this.limit,this.moreToBeLoaded=o.next!=null,this.loader=!1})}ngOnChanges(t){for(let o in t)o=="id"&&this.id&&(this.loader=!0,this.offset=0,this.loadComments(this.id,!1),this.newCommentFormVisible=!1)}ngOnInit(){this.getIDfromURL?this.sub=this.route.params.subscribe(t=>{let o=+t.id;o&&this.commentService.getComments(o,this.type,this.ordering,this.limit,this.offset).subscribe(n=>{this.comments=n.results,this.offset+=this.limit,this.moreToBeLoaded=n.next!=null})}):this.id&&this.commentService.getComments(this.id,this.type,this.ordering,this.limit,this.offset).subscribe(t=>{this.comments=t.results,this.offset+=this.limit,this.moreToBeLoaded=t.next!=null}),this.commentForm=this.formBuilder.group({comment:["",Wt.required]}),this.editCommentForm=this.formBuilder.group({comment:["",Wt.required]})}};
1326e.\u0275fac=function(o){return new(o||e)(ae(Du),ae(w1),ae(Gi),ae(ro))},e.\u0275cmp=st({type:e,selectors:[["app-comment-list"]],viewQuery:function(o,n){if(o&1&&ni(NJ,5),o&2){let d;Xt(d=Yt())&&(n.newComment=d.first)}},inputs:{getIDfromURL:"getIDfromURL",id:"id",type:"type",commentsTitle:"commentsTitle",specialTitle:"specialTitle",titleVisible:"titleVisible"},standalone:!0,features:[It([Du,w1]),hn,gt],decls:14,vars:11,consts:[["id","comments-part"],["class","float-left",4,"ngIf"],[1,"float-right"],["class","comments-ordering-selection",3,"change",4,"ngIf"],["class","btn btn-sm btn-default btn-circle",3,"click",4,"ngIf"],[1,"clearfix"],[4,"ngIf"],["class","error-message",4,"ngIf"],["class","comment-row",4,"ngFor","ngForOf"],["src","/assets/images/small_loader.gif"],[3,"click",4,"ngIf"],[1,"float-left"],[1,"h3-no-background"],["class","special-name",4,"ngIf"],[1,"special-name"],[1,"comments-ordering-selection",3,"change"],["value","-created_at","selected",""],["value","created_at"],["value","-num_votes"],["value","num_votes"],[1,"btn","btn-sm","btn-default","btn-circle",3,"click"],[3,"formGroup"],["id","add-comment","formControlName","comment","name","comment","placeholder","Vnesite va\u0161 komentar...","autofocus","","maxlength","600",3,"keyup"],["newComment",""],["id","comment-countdown",1,"float-left"],["type","button",1,"btn","btn-sm","btn-primary","float-right",3,"click"],[1,"error-message"],[1,"comment-row"],[1,"comment-voting"],[1,"comment-content"],[3,"formGroup",4,"ngIf"],[1,"comment-data"],["class","users-comment",4,"ngIf"],["formControlName","comment","name","comment",1,"full-width"],["type","button",1,"btn","btn-sm","btn-primary","float-right","margin-5-left",3,"click"],["type","button",1,"btn","btn-sm","btn-default","float-right",3,"click"],[1,"users-comment"],[3,"click"]],template:function(o,n){o&1&&(S(0,"div",0),ce(1,jJ,5,3,"div",1),S(2,"div",2),ce(3,VJ,9,0,"select",3)(4,BJ,2,0,"button",4),E(),Z(5,"div",5),ce(6,HJ,9,3,"div",6),Z(7,"div",5),ce(8,$J,2,0,"div",6)(9,GJ,2,1,"div",7)(10,KJ,11,5,"div",8),S(11,"div"),Z(12,"img",9),E(),ce(13,XJ,2,0,"a",10),E()),o&2&&(P(1),N("ngIf",n.titleVisible),P(2),N("ngIf",(n.comments==null?null:n.comments.length)>1),P(1),N("ngIf",!n.newCommentFormVisible),P(2),N("ngIf",n.newCommentFormVisible),P(2),N("ngIf",(n.comments==null?null:n.comments.length)==0),P(1),N("ngIf",n.errorMessages!==void 0&&n.errorMessages.detail!==void 0),P(1),N("ngForOf",n.comments),P(1),ki("",n.loader?"":"hidden"," loader center-text margin-5"),P(2),N("ngIf",n.moreToBeLoaded))},dependencies:[Nr,no,xf,wf,Fr,to,io,bI,oo,qr,Wr,Dt,ti,At]});let i=e;return i})();function YJ(i,e){i&1&&(S(0,"div",3)(1,"div",4),A(2,"Sorodne poti"),E(),Z(3,"div",5),E())}function QJ(i,e){if(i&1&&(S(0,"b",17),A(1),E()),i&2){let r=q().$implicit;P(1),We(" ",r.name," ")}}function JJ(i,e){i&1&&(S(0,"div",18)(1,"div",19)(2,"p"),A(3,"!"),E()(),A(4," POT ZAPRTA "),E())}function eee(i,e){if(i&1&&(S(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9),Z(4,"img",10),E()()(),S(5,"div",11)(6,"h4"),A(7),Z(8,"br"),ce(9,QJ,2,1,"b",12),E(),S(10,"div",13)(11,"div",14),A(12),E(),S(13,"div",15),Z(14,"div"),A(15),E(),ce(16,JJ,5,0,"div",16),Z(17,"div",5),E()(),Z(18,"div",5),E()),i&2){let r=e.$implicit;fn("routerLink","/poti/",r.slug,""),P(4),Ws("alt","",r.starting_point," - ",r.end_point," glavna slika"),Hi("src",r!=null&&r.image?r==null?null:r.image.file:"/assets/images/default-no-image.png",Ei),P(3),tr(" ",r.starting_point.title," - ",r.end_point.title,""),P(2),N("ngIf",r.name),P(3),We(" ",r.hiking_time_formated!=null?r.hiking_time_formated:"\u010Cas hoje neznan"," "),P(2),ki("dot dot-",r.difficulty.color,""),P(1),We(" ",r.difficulty.title," "),P(1),N("ngIf",r==null?null:r.closed)}}var XN=(()=>{let e=class e extends bu{ngOnInit(){this.sub=this.route.params.subscribe(t=>{let o=+t["id-or-slug"],n;isNaN(o)&&(o=null),n=t["id-or-slug"],(o||n)&&this.roadService.getRoad(o,n).subscribe(d=>{this.roadService.getRoads(null,null,null,{destination:d.end_point.id,id__not:d.id}).subscribe(_=>{this.roads=_.results})})})}};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275cmp=st({type:e,selectors:[["app-side-road-list"]],standalone:!0,features:[It([Ti]),Xn,gt],decls:3,vars:2,consts:[["id","side-part"],["class","col-header tabs height-45",4,"ngIf"],["class","side-row",3,"routerLink",4,"ngFor","ngForOf"],[1,"col-header","tabs","height-45"],[1,"tab","tab-inactive"],[1,"clearfix"],[1,"side-row",3,"routerLink"],[1,"side-row-image","float-left"],[1,"square"],[1,"square-content"],[3,"alt","src"],[1,"side-row-content","float-left"],["class","special-name",4,"ngIf"],[1,"full-width"],[1,"mountain-height","mountain-height-xs"],[2,"font-style","
1326italic","font-size","9pt"],["class","danger",4,"ngIf"],[1,"special-name"],[1,"danger"],[1,"danger-triangle"]],template:function(o,n){o&1&&(S(0,"div",0),ce(1,YJ,4,0,"div",1)(2,eee,19,13,"div",2),E()),o&2&&(P(1),N("ngIf",n.roads.length>0),P(1),N("ngForOf",n.roads))},dependencies:[qi,Dt,ti,At]});let i=e;return i})();function tee(i,e){if(i&1&&Z(0,"img",15),i&2){let r=q();fn("alt","Slika ",r.currentImg+1,""),Hi("src",r.allImages[r.currentImg]==null?null:r.allImages[r.currentImg].image.file,Ei)}}function iee(i,e){i&1&&(S(0,"div",16),A(1," Slika je v pregledu. Vidna je samo vam, ker \u0161e ni bila odobrena s strani administratorja. Po kon\u010Danem pregledu in odobritvi, bo slika vidna vsem uporabnikom portala."),E())}function nee(i,e){if(i&1){let r=Ge();S(0,"div",17),se("click",function(){Se(r);let o=q();return Te(o.prev())}),E()}}function ree(i,e){if(i&1){let r=Ge();S(0,"div",18),se("click",function(){Se(r);let o=q();return Te(o.next())}),E()}}function oee(i,e){i&1&&(S(0,"div",16),A(1," Slika je v pregledu. Vidna je samo vam, ker \u0161e ni bila odobrena s strani administratorja. Po kon\u010Danem pregledu in odobritvi, bo slika vidna vsem uporabnikom portala."),E())}var QN=i=>({"hidden-mobile":i});function see(i,e){if(i&1){let r=Ge();S(0,"div",19)(1,"div",20),ce(2,oee,2,0,"div",8),S(3,"p",21),A(4),E()(),S(5,"div",22),se("click",function(){Se(r);let o=q();return Te(o.toggleComments())}),A(6,"\u2039"),E(),Z(7,"app-comment-list",23),E()}if(i&2){let r=q();N("ngClass",kt(7,QN,!r.commentsVisible)),P(2),N("ngIf",r.allImages[r.currentImg]&&!(r.allImages[r.currentImg]!=null&&r.allImages[r.currentImg].published)),P(2),mt(r.allImages[r.currentImg]==null?null:r.allImages[r.currentImg].caption),P(3),N("type",r.imageType)("getIDfromURL",!1)("id",r.allImages[r.currentImg]==null?null:r.allImages[r.currentImg].id)("titleVisible",!1)}}var YN=i=>({hidden:i}),aee=(i,e)=>({hidden:i,"hidden-mobile":e}),C1=(()=>{let e=class e{constructor(){this.visible=!1,this.imageType=null,this.justOpened=!1,this.currentImg=0,this.onPopupOpen=new Fe,this.onPopupClose=new Fe,this.onCurrentImgChange=new Fe,this.commentsVisible=!1}clickedOutside(t){this.justOpened?(this.justOpened=!1,this.onPopupOpen.emit(!1)):this.close()}clickedInside(t){t.preventDefault(),t.stopPropagation()}close(){this.onPopupClose.emit(!1),this.visible=!1}prev(){this.currentImg>0&&this.currentImg--,this.onCurrentImgChange.emit(this.currentImg)}next(){this.currentImg<this.allImages.length-1&&this.currentImg++,this.onCurrentImgChange.emit(this.currentImg)}toggleComments(){this.commentsVisible=!this.commentsVisible}};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=st({type:e,selectors:[["app-gallery-popup"]],hostBindings:function(o,n){o&1&&se("click",function(_){return n.clickedOutside(_)},!1,ns)},inputs:{visible:"visible",imageType:"imageType",justOpened:"justOpened",currentImg:"currentImg",allImages:"allImages"},outputs:{onPopupOpen:"onPopupOpen",onPopupClose:"onPopupClose",onCurrentImgChange:"onCurrentImgChange"},standalone:!0,features:[gt],decls:17,vars:19,consts:[[1,"popup-outer",3,"ngClass"],[1,"close-popup",3,"ngClass","click"],[1,"popup",3,"ngClass"],[1,"center",3,"click"],[1,"gallery-image-part","float-left","float-left-nonmobile",3,"ngClass"],[1,"helper-center-vertical"],["class","center-vertical",3,"alt","src",4,"ngIf"],[1,"gallery-image-caption-part-mobile"],["class","warning-message",4,"ngIf"],[1,"margin-5"],["width","25px","height","25px","alt","Komentarji","src","/assets/images/comments-icon-white.png",1,"icon-hover","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"click"],["class","gallery-image-prev gallery-nav-button",3,"click",4,"ngIf"],["class","gallery-image-next gallery-nav-button",3,"click",4,"ngIf"],["class","gallery-comments-part float-right float-right-nonmobile",3,"ngClass",4,"ngIf"],[1,"clearfix"],[1,"center-vertical",3,"alt","src"],[1,"warning-message"],[1,"gallery-image-prev","gallery-nav-button",3,"click"],[1,"gallery-image-next","gallery-nav-button",3,"click"],[1,"gallery-comments-part","float-right","float-right-nonmobile",3,"ngClass"],[1,"gallery-image-caption-part"],[1,"margin-5","margin-20-top"],[1,"hidden","hidden-desktop","back-icon",3,"click"],[3,"type","getIDfromURL","id","titleVisible"]],template:function(o,n){o&1&&(Z(0,"div",0),S(1,"div",1),se("click",function(){return n.close()}
1326),A(2,"X"),E(),S(3,"div",2)(4,"div",3),se("click",function(_){return n.clickedInside(_)}),S(5,"div",4),Z(6,"span",5),ce(7,tee,1,2,"img",6),S(8,"div",7),ce(9,iee,2,0,"div",8),S(10,"p",9),A(11),E(),S(12,"img",10),se("click",function(){return n.toggleComments()}),E()(),ce(13,nee,1,0,"div",11)(14,ree,1,0,"div",12),E(),ce(15,see,8,9,"div",13),Z(16,"div",14),E()()),o&2&&(N("ngClass",kt(10,YN,!n.visible)),P(1),N("ngClass",mn(12,aee,!n.visible,n.commentsVisible)),P(2),N("ngClass",kt(15,YN,!n.visible)),P(2),N("ngClass",kt(17,QN,n.commentsVisible)),P(2),N("ngIf",n.allImages),P(2),N("ngIf",n.allImages[n.currentImg]&&!(n.allImages[n.currentImg]!=null&&n.allImages[n.currentImg].published)),P(2),mt(n.allImages[n.currentImg]==null?null:n.allImages[n.currentImg].caption),P(2),N("ngIf",n.currentImg>0),P(1),N("ngIf",n.currentImg<(n.allImages==null?null:n.allImages.length)-1),P(1),N("ngIf",(n.allImages==null?null:n.allImages.length)>0))},dependencies:[Dt,on,At,Gf]});let i=e;return i})();function lee(i,e){i&1&&(S(0,"div",8),A(1,"Trenutno ni zgodb."),E())}function cee(i,e){if(i&1&&(S(0,"span",17),A(1),E()),i&2){let r=q().$implicit;P(1),mt(r.user.username)}}function uee(i,e){if(i&1&&(S(0,"span",18),A(1),E()),i&2){let r=q().$implicit;P(1),We("",r.distance," stran")}}function dee(i,e){if(i&1){let r=Ge();S(0,"div",9),se("click",function(){let n=Se(r).index,d=q();return Te(d.viewStory(n))}),S(1,"div",10),Z(2,"img",11),S(3,"div",12)(4,"div",13),ce(5,cee,2,1,"span",14),S(6,"span",15),A(7),E(),ce(8,uee,2,1,"span",16),E()()()()}if(i&2){let r=e.$implicit,t=q(),o;P(2),N("src",(o=r.file.thumbnails.story)!==null&&o!==void 0?o:r.file.file,Ei),P(3),N("ngIf",r.user),P(2),mt(t.formatTime(r.time)),P(1),N("ngIf",r.distance)}}function hee(i,e){if(i&1&&(S(0,"div",35),A(1),E()),i&2){let r=q(2);P(1),We("Oddaljenost: ",r.stories[r.selectedStory].distance,"")}}function pee(i,e){if(i&1&&(Pa(0),Z(1,"img",36),Oa()),i&2){let r=q(2);P(1),N("src",r.stories[r.selectedStory].file.file,Ei)}}function fee(i,e){if(i&1&&(S(0,"video",37,38),Z(2,"source",39),A(3," Va\u0161 brskalnik ne podpira videa. "),E()),i&2){let r=q(2);P(2),N("src",r.stories[r.selectedStory].file.file,Ei)}}function mee(i,e){i&1&&(S(0,"div",44),A(1,"Nalaganje \u2026"),E())}function gee(i,e){if(i&1&&(S(0,"span",50),A(1),E()),i&2){let r=q().$implicit;P(1),We(" \xB7 ",r.distance,"")}}function _ee(i,e){if(i&1){let r=Ge();S(0,"div",48),se("click",function(){let n=Se(r).$implicit,d=q(4);return Te(d.openNearbyDestination(n.slug))}),A(1),ce(2,gee,2,1,"span",49),E()}if(i&2){let r=e.$implicit;P(1),We(" ",r.title,""),P(1),N("ngIf",r.distance)}}function vee(i,e){i&1&&(S(0,"div",51),A(1,"Ni bli\u017Enjih destinacij."),E())}function yee(i,e){if(i&1&&(S(0,"div",45),ce(1,_ee,3,2,"div",46)(2,vee,2,0,"div",47),E()),i&2){let r=q(3);P(1),N("ngForOf",r.nearbyDestinations),P(1),N("ngIf",r.nearbyDestinations.length===0)}}function bee(i,e){if(i&1&&(S(0,"div",40),se("click",function(t){return t.stopPropagation()}),S(1,"div",41),A(2,"Bli\u017Enje destinacije"),E(),ce(3,mee,2,0,"div",42)(4,yee,3,2,"div",43),E()),i&2){let r=q(2);P(3),N("ngIf",r.nearbyLoading),P(1),N("ngIf",!r.nearbyLoading)}}var JN=i=>({hidden:i});function xee(i,e){if(i&1){let r=Ge();S(0,"div",19),se("click",function(){Se(r);let o=q();return Te(o.closeStory())}),S(1,"div",20),se("click",function(){Se(r);let o=q();return Te(o.closeStory())}),A(2,"\u2715"),E(),S(3,"div",21)(4,"div",22)(5,"div",23),Z(6,"img",24),E(),S(7,"div",25)(8,"div",26),A(9),E(),S(10,"div",27),A(11),E(),ce(12,hee,2,1,"div",28),E()()(),S(13,"div",29),se("click",function(o){Se(r);let n=q();return Te(n.previousStory(o))}),A(14,"\u25C0"),E(),S(15,"div",30),se("click",function(o){Se(r);let n=q();return Te(n.nextStory(o))}),A(16,"\u25B6"),E(),S(17,"div",31),se("click",function(o){return o.stopPropagation()}),ce(18,pee,2,1,"ng-container",32)(19,fee,4,1,"ng-template",null,33,Rb),E(),ce(21,bee,5,2,"div",34),E()}if(i&2){let r=or(20),t=q(),o;P(6),N("src",(o=t.stories[t.selectedStory].user.picture)!==null&&o!==void 0?o:"/assets/images/ic_launcher.png",Ei),P(3),mt(t.stories[t.selectedStory].user.username),P(2),mt(t.formatTime(t.stories[t.selectedStory].time)),P(1),N("ngIf",t.stories[t.selectedStory].distance),P(1),N("ngClass",kt(9,JN,!t.showLeftArrow())),P(2),N("ngClass",kt(11,JN,!t.showRightArrow())),P(3),N("ngIf",!t.stories[t.selectedStory].file.file.includes(".mp4"))("ngIfElse",r),P(3),N("ngIf",t.stories[t.selectedStory].latitude!=null&&t.stories[t.selectedStory].longitude!=null)}}var E1=(()=>{let e=class e extends Af{constructor(t,o,n){super(t,o,n)}ngOnInit(){super.ngOnInit()}};e.\u0275fac=function(o){return new(o||e)(ae(wu),ae(sn),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-horizontal-story-list"]],standalone:!0,features:[It([wu,sn]),Xn,gt],decls:9,vars:3,consts:[[1,"story-grid"],[1,"story-item","add-story",3,"click"],[1,"story-square","add-story-square"],[1,"add-story-button"],[1,"add-story-button-inner"],["class","no-stories",4,"ngIf"],["class","story-item",3,"click",4,"ngFor","ngForOf"],["class","full-screen-story",3,"click",4,"ngIf"],[1,"no-stories"],[1,"story-item",3,"click"],[1,"story-square"],["alt","Story Thumbnail",1,"story-thumbn
1326ail",3,"src"],[1,"story-hover-overlay"],[1,"story-hover-info"],["class","story-hover-user",4,"ngIf"],[1,"story-hover-time"],["class","story-hover-distance",4,"ngIf"],[1,"story-hover-user"],[1,"story-hover-distance"],[1,"full-screen-story",3,"click"],[1,"close-button",3,"click"],[1,"story-header"],[1,"user-info"],[1,"user-image-wrapper"],["alt","User Image",1,"user-image",3,"src"],[1,"user-details"],[1,"username"],[1,"story-time"],["class","story-distance",4,"ngIf"],[1,"story-navigation","left-arrow",3,"ngClass","click"],[1,"story-navigation","right-arrow",3,"ngClass","click"],[1,"story-content",3,"click"],[4,"ngIf","ngIfElse"],["videoTemplate",""],["class","story-nearby-panel",3,"click",4,"ngIf"],[1,"story-distance"],["alt","Story Image",3,"src"],["autoplay",""],["videoPlayer",""],["type","video/mp4",3,"src"],[1,"story-nearby-panel",3,"click"],[1,"story-nearby-title"],["class","story-nearby-loading",4,"ngIf"],["class","story-nearby-list",4,"ngIf"],[1,"story-nearby-loading"],[1,"story-nearby-list"],["class","story-nearby-chip",3,"click",4,"ngFor","ngForOf"],["class","story-nearby-empty",4,"ngIf"],[1,"story-nearby-chip",3,"click"],["class","story-nearby-distance",4,"ngIf"],[1,"story-nearby-distance"],[1,"story-nearby-empty"]],template:function(o,n){o&1&&(S(0,"div",0)(1,"div",1),se("click",function(){return n.goToGooglePlay()}),S(2,"div",2)(3,"div",3)(4,"div",4),A(5," Dodaj razmere "),E()()()(),ce(6,lee,2,0,"div",5)(7,dee,9,4,"div",6),E(),ce(8,xee,22,13,"div",7)),o&2&&(P(6),N("ngIf",n.stories.length==0),P(1),N("ngForOf",n.stories),P(1),N("ngIf",n.selectedStory!==null))},dependencies:[Dt,on,ti,At],styles:[".story-grid[_ngcontent-%COMP%]{display:flex;overflow-x:auto;gap:10px;padding:10px;height:250px;-ms-overflow-style:none;scrollbar-width:none}@media (max-width: 768px){.story-grid[_ngcontent-%COMP%]{height:150px}}.story-item[_ngcontent-%COMP%]{position:relative;cursor:pointer;flex:0 0 auto;height:100%}.story-square[_ngcontent-%COMP%]{position:relative;height:100%;aspect-ratio:1 / 1;border-radius:var(--radius-sm);overflow:hidden;box-shadow:var(--shadow-sm);transition:box-shadow var(--transition-base)}.story-item[_ngcontent-%COMP%]:hover   .story-square[_ngcontent-%COMP%]{box-shadow:var(--shadow-md)}.add-story[_ngcontent-%COMP%]{position:relative;flex:0 0 auto;height:100%}.add-story-square[_ngcontent-%COMP%]{background-color:var(--color-surface);border:2px solid var(--color-border)}.add-story-button[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:10px;box-sizing:border-box}.add-story-button-inner[_ngcontent-%COMP%]{background-color:var(--color-accent);color:#fff;border-radius:var(--radius-sm);padding:8px;font-size:var(--font-size-sm);cursor:pointer;transition:background var(--transition-fast)}.add-story[_ngcontent-%COMP%]:hover   .add-story-button-inner[_ngcontent-%COMP%]{background-color:var(--color-accent-hover)}.story-thumbnail[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;display:block;object-fit:cover;transition:transform var(--transition-base)}.story-item[_ngcontent-%COMP%]:hover   .story-thumbnail[_ngcontent-%COMP%]{transform:scale(1.06)}.story-hover-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:flex-end;padding:8px;box-sizing:border-box;background:linear-gradient(to top,rgba(20,19,18,.85),rgba(20,19,18,0) 65%);opacity:0;transition:opacity var(--transition-fast);pointer-events:none}.story-item[_ngcontent-%COMP%]:hover   .story-hover-overlay[_ngcontent-%COMP%]{opacity:1}.story-hover-info[_ngcontent-%COMP%]{display:flex;flex-direction:column;color:#fff;font-size:var(--font-size-xs);line-height:1.4}.story-hover-user[_ngcontent-%COMP%]{font-weight:700}.story-hover-time[_ngcontent-%COMP%], .story-hover-distance[_ngcontent-%COMP%]{opacity:.85}.no-stories[_ngcontent-%COMP%]{display:flex;align-items:center;color:var(--color-text-muted)}.full-screen-story[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000c;display:flex;align-items:center;justify-content:center;padding:0;box-sizing:border-box;z-index:999999;overflow:hidden;flex-direction:column}.story-header[_ngcontent-%COMP%]{position:absolute;top:10px;left:10px;display:flex;align-items:center}.user-info[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:#00000080;border-radius:8px;padding:5px}.user-image-wrapper[_ngcontent-%COMP%]{border-radius:50%;overflow:hidden;width:40px;height:40px;background:var(--color-dark)}.user-image[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.user-details[_ngcontent-%COMP%]{margin-left:10px;color:#fff}.username[_ngcontent-%COMP%]{font-weight:700}
1326.story-time[_ngcontent-%COMP%]{font-size:12px}.story-distance[_ngcontent-%COMP%]{font-size:12px;opacity:.85}.story-content[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.story-content[_ngcontent-%COMP%]   img[_ngcontent-%COMP%], .story-content[_ngcontent-%COMP%]   video[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain}.close-button[_ngcontent-%COMP%], .story-navigation[_ngcontent-%COMP%]{position:absolute;color:#fff;font-size:2em;cursor:pointer;z-index:1000;background-color:#0009;border-radius:50%;padding:5px;box-shadow:0 1px 2px #0003}.close-button[_ngcontent-%COMP%]{top:12px;width:32px;right:20px;text-align:center}.story-navigation.left-arrow[_ngcontent-%COMP%]{left:20px;width:32px;top:50%;text-align:center;transform:translateY(-50%);background-color:#00000042}.story-navigation.right-arrow[_ngcontent-%COMP%]{right:20px;width:32px;top:50%;text-align:center;transform:translateY(-50%);background-color:#00000042}.story-nearby-panel[_ngcontent-%COMP%]{position:absolute;left:0;right:0;bottom:0;max-width:480px;margin:0 auto;padding:10px 16px 16px;background:linear-gradient(to top,rgba(0,0,0,.85),rgba(0,0,0,0));box-sizing:border-box}.story-nearby-title[_ngcontent-%COMP%]{color:#fff;font-size:var(--font-size-xs);font-weight:700;text-transform:uppercase;letter-spacing:.5px;opacity:.85;margin-bottom:8px}.story-nearby-loading[_ngcontent-%COMP%], .story-nearby-empty[_ngcontent-%COMP%]{color:#ffffffb3;font-size:var(--font-size-sm)}.story-nearby-list[_ngcontent-%COMP%]{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px}.story-nearby-chip[_ngcontent-%COMP%]{flex:none;cursor:pointer;background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.25);border-radius:var(--radius-pill);padding:7px 14px;font-size:var(--font-size-sm);white-space:nowrap;transition:background var(--transition-fast),border-color var(--transition-fast)}.story-nearby-chip[_ngcontent-%COMP%]:hover{background:var(--color-accent);border-color:var(--color-accent)}.story-nearby-distance[_ngcontent-%COMP%]{opacity:.8}"]});let i=e;return i})();var wee=["popupDifficultyInfoMessage"];function Cee(i,e){if(i&1&&(S(0,"h2",42),A(1),E()),i&2){let r=q();P(1),We(" ",r.road==null?null:r.road.name," ")}}function Eee(i,e){i&1&&(S(0,"div",43),A(1,"Pot je v pregledu. Vidna je samo vam, ker \u0161e ni bila odobrena s strani administratorja. Po kon\u010Danem pregledu in odobritvi, bo pot vidna vsem uporabnikom portala."),E())}function See(i,e){if(i&1&&(S(0,"div",44)(1,"div",45)(2,"p"),A(3,"!"),E()(),A(4),E()),i&2){let r=q();P(4),We(" ",r.road==null?null:r.road.closed_description," ")}}function Tee(i,e){if(i&1&&Z(0,"app-weather-forecast",46),i&2){let r=q();N("lat",r.road==null?null:r.road.end_point.width)("lng",r.road==null?null:r.road.end_point.length)}}function Iee(i,e){i&1&&(S(0,"div",47),Z(1,"img",48),S(2,"span"),A(3,"\xA0\xA0\xA0\xA0Najbli\u017Eja spletna kamera"),E()())}function Dee(i,e){if(i&1){let r=Ge();S(0,"app-webcam",49),se("click",function(){Se(r);let o=q();return Te(o.changeTab("webcams"))}),E()}if(i&2){let r=q();N("webcam",r.webcam)("popup",!1)}}function Mee(i,e){i&1&&(S(0,"div",50),Z(1,"img",51),S(2,"span"),A(3,"\xA0\xA0\xA0\xA0Zemljevid"),E()())}var ez=()=>[12],tz=()=>[13.764,46.245],ku=(i,e)=>[i,e];function kee(i,e){if(i&1){let r=Ge();S(0,"mgl-map",56),se("load",function(o){Se(r);let n=q(2);return Te(n.loadMap(o))}),S(1,"mgl-popup",57),A(2),E(),S(3,"mgl-marker",58),Z(4,"div",59),E(),S(5,"mgl-popup",57),A(6),E(),S(7,"mgl-marker",58),Z(8,"div",59),E()()}if(i&2){let r=q(2);Gs("mapbox://styles/silko/cjb1va19f6xm72spde16k92nx"),N("zoom",Zs(12,ez))("center",Zs(13,tz)),P(1),N("lngLat",mn(14,ku,r.road==null||r.road.starting_point==null?null:r.road.starting_point.length,r.road==null||r.road.starting_point==null?null:r.road.starting_point.width))("closeOnClick",!1),P(1),We(" ",r.road==null||r.road.starting_point==null?null:r.road.starting_point.title," "),P(1),N("lngLat",mn(17,ku,r.road==null||r.road.starting_point==null?null:r.road.starting_point.length,r.road==null||r.road.starting_point==null?null:r.road.starting_point.width)),P(2),N("lngLat",mn(20,ku,r.road==null||r.road.end_point==null?null:r.road.end_point.length,r.road==null||r.road.end_point==null?null:r.road.end_point.width))("closeOnClick",!1),P(1),We(" ",r.road==null||r.road.end_point==null?null:r.road.end_point.title," "),P(1),N("lngLat",mn(23,ku,r.road==null||r.road.end_point==null?null:r.road.end_point.length,r.road==null||r.road.end_point==null?null:r.road.end_point.width))}}function Aee(i,e){if(i&1&&(S(0,"div",52),ce(1,kee,9,26,"mgl-map",53),S(2,"div",54)(3,"a",55),A(4," Sledi tej poti "),E()()()),i&2){let r=q();P(1),N("ngIf",r.isBrowser)}}function Pee(i,e){if(i&1){let r=Ge();S(0,"div",60)(1,"button",61),Z(2,"img",62),E(),S(3,"button",63),Z(4,"img",64),E(),S(5,"button",65),se("click",function(){Se(r);let o=q();return Te(o.openGoogleMapsRoute(o.road==null||o.road.starting_point==null?null:o.road.starting_point.width,o.road==null||o.road.starting_point==null?null:o.road.starting_point.length))}),Z(6,"img",66),S(7,"span"),A(8," Dostop do izhodi\u0161\u010Da"),E()()()}if(i&2){let r=q();P(1),fn("routerLink","/roads/edit/",r.road==null?null:r.road.id,""),P(2),fn("routerLink","/roads/images/",r.road==null?null:r.road.id,"")}}function Oee(i,e){if(i&1){let r=Ge();S(0,"app-rating",77),se("ratedSuccess",function(){Se(r);let o=q(2);
1326return Te(o.onRate())}),E()}if(i&2){let r=q(2);N("id",r.road==null?null:r.road.id)("type","road")("rating",r.road==null?null:r.road.rating)}}function Ree(i,e){i&1&&(S(0,"span"),A(1,","),E())}function Lee(i,e){if(i&1&&(S(0,"span"),A(1),ce(2,Ree,2,0,"span",35),E()),i&2){let r=e.$implicit,t=e.last;P(1),We(" ",r.title,""),P(1),N("ngIf",!t)}}function Fee(i,e){if(i&1&&(S(0,"div"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r.title)}}function Nee(i,e){if(i&1){let r=Ge();S(0,"div")(1,"div",67)(2,"img",68),se("click",function(){Se(r);let o=q();return Te(o.openImage((o.road==null||o.road.main_image==null?null:o.road.main_image.position)-1))}),E(),S(3,"table",69)(4,"tbody")(5,"tr")(6,"td")(7,"b"),A(8,"Ocena:"),E()(),S(9,"td")(10,"div",70),ce(11,Oee,1,3,"app-rating",71),E()()(),S(12,"tr")(13,"td")(14,"b"),A(15,"Dr\u017Eava:"),E()(),S(16,"td"),ce(17,Lee,3,2,"span",72),E()(),S(18,"tr")(19,"td")(20,"b"),A(21,"Gorovje:"),E()(),S(22,"td"),A(23),E()(),S(24,"tr")(25,"td")(26,"b"),A(27,"Izhodi\u0161\u010De:"),E()(),S(28,"td")(29,"a",73),A(30),E()()(),S(31,"tr")(32,"td")(33,"b"),A(34,"Cilj:"),E()(),S(35,"td")(36,"a",73),A(37),E()()(),S(38,"tr")(39,"td")(40,"b"),A(41,"Izhodi\u0161\u010De \u0161irina/dol\u017Eina:"),E()(),S(42,"td"),A(43),$r(44,"number"),$r(45,"number"),E()(),S(46,"tr")(47,"td")(48,"b"),A(49,"Cilj \u0161irina/dol\u017Eina:"),E()(),S(50,"td"),A(51),$r(52,"number"),$r(53,"number"),E()(),S(54,"tr")(
132655,"td")(56,"b"),A(57,"Te\u017Eavnost:"),E()(),S(58,"td"),Z(59,"div"),S(60,"span"),A(61),E(),A(62,"\xA0\xA0 "),S(63,"img",74),se("click",function(o){Se(r);let n=q();return Te(n.showDifficultyInfoPopup(o))}),E(),Z(64,"app-popup-message",null,75),E()(),S(66,"tr")(67,"td")(68,"b"),A(69,"Priporo\u010Dena oprema:"),E()(),S(70,"td"),ce(71,Fee,2,1,"div",72),E()()()(),Z(72,"br"),S(73,"b"),A(74,"Dostop do izhodi\u0161\u010Da:"),E(),Z(75,"br"),S(76,"p",76),A(77),E(),S(78,"b"),A(79,"Opis poti:"),E(),Z(80,"br"),S(81,"p",76),A(82),E(),S(83,"b"),A(84,"Dodatni nasveti:"),E(),Z(85,"br"),S(86,"p",76),A(87),E()()()}if(i&2){let r=q();P(2),Ws("alt","",r.road==null||r.road.starting_point==null?null:r.road.starting_point.title," - ",r.road==null||r.road.end_point==null?null:r.road.end_point.title," prikazna slika"),Hi("src",r.road!=null&&r.road.main_image?r.road==null?null:r.road.main_image.file:"/assets/images/default-no-image.png",Ei),P(9),N("ngIf",r.road),P(6),N("ngForOf",r.road==null||r.road.end_point==null?null:r.road.end_point.country),P(6),We(" ",r.road==null||r.road.end_point==null||r.road.end_point.mountain_range==null?null:r.road.end_point.mountain_range.title," "),P(6),fn("routerLink","/destinacije/",r.road==null||r.road.starting_point==null?null:r.road.starting_point.slug,""),P(1),tr(" ",r.road==null||r.road.starting_point==null?null:r.road.starting_point.title," (",r.road==null||r.road.starting_point==null?null:r.road.starting_point.height," m) "),P(6),fn("routerLink","/destinacije/",r.road==null||r.road.end_point==null?null:r.road.end_point.slug,""),P(1),tr(" ",r.road==null||r.road.end_point==null?null:r.road.end_point.title," (",r.road==null||r.road.end_point==null?null:r.road.end_point.height," m) "),P(6),tr(" ",Gr(44,24,r.road==null||r.road.starting_point==null?null:r.road.starting_point.width,"1.2-4")," / ",Gr(45,27,r.road==null||r.road.starting_point==null?null:r.road.starting_point.length,"1.2-4")," "),P(8),tr(" ",Gr(52,30,r.road==null||r.road.end_point==null?null:r.road.end_point.width,"1.2-4")," / ",Gr(53,33,r.road==null||r.road.end_point==null?null:r.road.end_point.length,"1.2-4")," "),P(8),ki("dot dot-",r.road==null||r.road.difficulty==null?null:r.road.difficulty.color,""),P(2),mt(r.road==null||r.road.difficulty==null?null:r.road.difficulty.title),P(10),N("ngForOf",r.road==null?null:r.road.recommended_equipment),P(6),mt(r.road==null?null:r.road.access_to_the_starting_point),P(5),mt(r.road==null?null:r.road.desc_path),P(5),mt((r.road==null?null:r.road.additional_tips)!=""?r.road==null?null:r.road.additional_tips:"Ni dodatnih nasvetov.")}}function zee(i,e){i&1&&(S(0,"h3"),A(1,"Razmere v zgodbah"),E())}function jee(i,e){if(i&1&&Z(0,"app-horizontal-story-list",78),i&2){let r=q();N("lat",r.road==null||r.road.end_point==null?null:r.road.end_point.width)("lng",r.road==null||r.road.end_point==null?null:r.road.end_point.length)("limit",20)}}function Vee(i,e){i&1&&(S(0,"h3"),A(1,"Spletne kamere"),E())}function Bee(i,e){if(i&1&&Z(0,"app-webcam-list",80),i&2){let r=q(2);N("lat",r.road==null||r.road.end_point==null?null:r.road.end_point.width)("lng",r.road==null||r.road.end_point==null?null:r.road.end_point.length)("radius",15)("showRadiusSlider",!0)}}function Uee(i,e){if(i&1&&(S(0,"div"),ce(1,Bee,1,4,"app-webcam-list",79),E()),i&2){let r=q();P(1),N("ngIf",r.road&&r.webcamsTab)}}function Hee(i,e){i&1&&(S(0,"div",88),A(1,"!"),E())}function $ee(i,e){if(i&1){let r=Ge();S(0,"div",83),se("click",function(){let n=Se(r).index,d=q(2);return Te(d.openImage(n))}),S(1,"div",84)(2,"div",85),Z(3,"img",86),E()(),ce(4,Hee,2,0,"div",87),E()}if(i&2){let r=e.$implicit,t=e.index,o=q(2);P(3),s_("alt","",o.road==null||o.road.starting_point==null?null:o.road.starting_point.title," - ",o.road==null||o.road.end_point==null?null:o.road.end_point.title," slika ",t+1,""),Hi("src",r.image.file,Ei),N("lazyLoad",r.image.file),P(1),N("ngIf",!r.published)}}function Gee(i,e){if(i&1&&(S(0,"div",81),ce(1,$ee,5,6,"div",82),Z(2,"div",13),E()),i&2){let r=q();P(1),N("ngForOf",r.road==null?null:r.road.images)}}function qee(i,e){if(i&1){let r=Ge();S(0,"mgl-map",56),se("load",function(o){Se(r);let n=q(2);return Te(n.loadMap(o))}),S(1,"mgl-popup",57),A(2),E(),S(3,"mgl-marker",58),Z(4,"div",59),E(),S(5,"mgl-popup",57),A(6),E(),S(7,"mgl-marker",58),Z(8,"div",59),E()()}if(i&2){let r=q(2);Gs("mapbox://styles/silko/cjb1va19f6xm72spde16k92nx"),N("zoom",Zs(12,ez))("center",Zs(13,tz)),P(1),N("lngLat",mn(14,ku,r.road==null||r.road.starting_point==null?null:r.road.starting_point.length,r.road==null||r.road.starting_point==null?null:r.road.starting_point.width))("closeOnClick",!1),P(1),We(" ",r.road==null||r.road.starting_point==null?null:r.road.starting_point.title," "),P(1),N("lngLat",mn(17,ku,r.road==null||r.road.starting_point==null?null:r.road.starting_point.length,r.road==null||r.road.starting_point==null?null:r.road.starting_point.width)),P(2),N("lngLat",mn(20,ku,r.road==null||r.road.end_point==null?null:r.road.end_point.length,r.road==null||r.road.end_point==null?null:r.road.end_point.width))("closeOnClick",!1),P(1),We(" ",r.road==null||r.road.end_point==null?null:r.road.end_point.title," "),P(1),N("lngLat",mn(23,ku,r.road==null||r.road.end_point==null?null:r.road.end_point.length,r.road==null||r.road.end_point==null?null:r.road.end_point.width))}}function Wee(i,e){if(i&1&&(S(0,"div",89),ce(1,qee,9,26,"mgl-map",53),S(2,"div",54)(3,"a",55),A(4," Sledi tej poti "),E()()()),i&2){let r=q();P(1),N("ngIf",r.isBrowser)}}function Zee(i,e){i&1&&Z(0,"div",13)}function Kee(i,e){if(i&1&&Z(0,"app-comment-list",90),i&2){let r=q();N("type","road")("id",r.road==null?null:r.road.id)("getIDfromURL",!1)("titleVisible",!1)}}function Xee(i,e){if(i&1){let r=Ge();S(0,"app-gallery-popup",91),se("onPopupClose",function(o){Se(r);let n=q();return Te(n.onPopupClose(o))})("onCurrentImgChange",function(o){Se(r);let n=q();return Te(n.onCurrentImgChange(o))})("onPopupOpen",function(o){Se(r);let n=q();return Te(n.onPopupOpen(o))}),E()}if(i&2){let r=q();N("currentImg",r.imageIndex)("allImages",r.road==null?null:r.road.images)("visible",r.popupVisible)("imageType","road_image")("justOpened",r.justOpened)}}var S1=i=>({active:i}),Mu=i=>({hidden:i}),Yee=(i,e)=>({"width-80-percent-40":i,"width-80-percent":e}),Qee=i=>({"margin-20 margin-0-top":i}),f0=(()=>{let e=class e{constructor(t,o,n,d,_,C,M,j,G){this.location=o,this.meta=n,this.roadService=d,this.route=_,this.titleService=C,this.urlHistory=M,this.webcamService=j,this.router=G,this.id=null,this.slug=null,this.roadFullName=null,this.hikingTime=null,this.justOpened=!0,this.popupVisible=!1,this.imageIndex=null,this.generalTab=!0,this.imagesTab=!1,this.mapTab=!1,this.webcamsTab=!1,this.commentsTab=!1,this.tabParam="",this.tabTitle="Splo\u0161no",this.popup_message=null,this.map=null,this.mapInitialized=!1,this.isBrowser=Si(t)}onRate(){this.getRoad()}changeTab(t){t==="general"?(this.generalTab=!0,this.imagesTab=!1,this.mapTab=!1,this.webcamsTab=!1,this.commentsTab=!1,this.tabParam="",this.tabTitle="Splo\u0161no"):t==="images"?(this.generalTab=!1,this.imagesTab=!0,this.mapTab=!1,this.webcamsTab=!1,this.commentsTab=!1,this.tabParam="slike",this.tabTitle="Slike"):t==="map"?(this.generalTab=!1,this.imagesTab=!1,this.mapTab=!0,this.webcamsTab=!1,this.commentsTab=!1,this.tabParam="zemljevid",this.tabTitle="Zemljevid",this.loadGpsTrack()):t==="webcams"?(this.generalTab=!1,this.imagesTab=!1,this.mapTab=!1,this.webcamsTab=!0,this.commentsTab=!1,this.tabParam="spletne-kamere",this.tabTitle="Spletne kamere"):t==="comments"&&(this.generalTab=!1,this.imagesTab=!1,this.mapTab=!1,this.webcamsTab=!1,this.commentsTab=!0,this.tabParam="komentarji",this.tabTitle="Komentarji"),this.titleService.setTitle(this.roadFullName+" | "+this.tabTitle+" | Mountains Geek"),this.location.replaceState("/poti/"+this.slug+"/"+this.tabParam)}getRoad(){this.roadService.getRoad(this.id,this.slug).subscribe(t=>{switch(this.id=t.id,this.slug=t.slug,this.road=t,this.road.images=[],this.roadFullName=this.road.starting_point.title+" - "+this.road.end_point.title,this.tabParam){case"slike":this.changeTab("images");break;case"zemljevid":this.changeTab("map");break;case"spletne-kamere":this.changeTab("webcams");break;case"komentarji":this.changeTab("comments");break;default:this.changeTab("general");break}this.location.replaceState("/poti/"+this.slug+"/"+this.tabParam),this.loadRoadImages(10,0);let o=Math.floor(t.hiking_time/60),n=t.hiking_time-o*60;this.hikingTime=o+" ur "+n+" min",this.meta.updateTag({name:"description",content:"Splo\u0161ne informacije izleta  "+this.roadFullName+". Informacije o izletu "+this.roadFullName+" vsebujejo podroben opis poti, slike, GPS sled,..."}),this.meta.addTag({property:"og:description",content:"Splo\u0161ne informacije izleta  "+this.roadFullName+". Informacije o izletu "+this.roadFullName+" vsebujejo podroben opis poti, slike, GPS sled,..."}),this.meta.addTag({property:"og:title",content:this.roadFullName}),this.road.main_image!==null&&this.meta.addTag({property:"og:image",content:this.road.main_image.file}),this.webcamService.getWebcamsNearby(this.road.end_point.width,this.road.end_point.length,15,0,1).subscribe(d=>{d.total>0&&(this.webcam=d.webcams[0])})},t=>{t.status===404&&this.router.navigate(["/404"])})}loadRoadImages(t,o){this.roadService.getRoadImages(this.id,t,o).subscribe(n=>{this.road.images?this.road.images=this.road.images.concat(n.results):this.road.images=n.results,n.next&&this.loadRoadImages(t,o+t)})}ngOnInit(){this.sub=this.route.params.subscribe(t=>{this.id=+t["id-or-slug"],this.tabParam=t.tab,isNaN(this.id)&&(this.id=null,this.slug=t["id-or-slug"]),this.tabParam||(this.tabParam=""),this.getRoad()})}openImage(t){this.imageIndex=t,this.justOpened=!0,this.popupVisible=!0}onPopupOpen(t){this.justOpened=t}onPopupClose(t){this.imageIndex=null,this.popupVisible=t}onCurrentImgChange(t){this.imageIndex=t}showDifficultyInfoPopup(t){this.popup_message.showPopup(this.road.difficulty.description,4,t.pageX,t.pageY)}loadGpsTrack(){this.map&&this.roadService.getGPSTracks(this.id).subscribe(t=>{let o=[],n=-90,d=90,_=-180,C=180;
1326t.results.forEach(M=>{M.points.forEach(ie=>{o.push([ie.longitude,ie.latitude]),ie.latitude>n&&(n=ie.latitude),ie.latitude<d&&(d=ie.latitude),ie.longitude>_&&(_=ie.longitude),ie.longitude<C&&(C=ie.longitude)});let j={type:"geojson",data:{type:"Feature",geometry:{type:"LineString",coordinates:o},properties:{}}};this.map?.addSource("gps_track",j),this.map?.addLayer({id:"gps_track_layer",type:"line",source:"gps_track",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#FF5733","line-width":4}});let G=[[C,d],[_,n]];this.map?.fitBounds(G,{padding:{top:10,right:10,bottom:10,left:10}})})})}loadMap(t){if(this.map=t,t.resize(),this.road.end_point.id!=this.road.starting_point.id){let o=this.fitBoundsCorrection([this.road.end_point.length,this.road.starting_point.width],[this.road.starting_point.length,this.road.end_point.width]);t.fitBounds(o,{padding:{top:10,right:10,bottom:10,left:10}})}this.loadGpsTrack()}fitBoundsCorrection(t,o){let n;if(t[0]>o[0]&&t[1]>o[1])n=[o,t];else if(o[0]>t[0]&&o[1]>t[1])n=[t,o];else if(t[0]>o[0]&&t[1]<o[1]){let d=[t[0],o[1]];n=[[o[0],t[1]],d]}else if(t[0]<o[0]&&t[1]>o[1]){let d=[o[0],t[1]];n=[[t[0],o[1]],d]}return n}openGoogleMapsRoute(t,o){if(this.isBrowser){let n="https://maps.google.com?saddr=Current+Location&daddr="+t+","+o;window.open(n,"_blank")}}navigateBack(){sessionStorage.getItem("previousUrl")?this.location.back():this.router.navigate(["/"])}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(hl),ae(Qd),ae(Ln),ae(Gi),ae(uc),ae(Iu),ae(Eo),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-road-detail"]],viewQuery:function(o,n){if(o&1&&ni(wee,5),o&2){let d;Xt(d=Yt())&&(n.popup_message=d.first)}},standalone:!0,features:[It([Ln,Iu,Eo]),gt],decls:69,vars:72,consts:[["src","/assets/images/loader.gif",1,"mobile-100-percent-width"],["id","left-part"],[1,"col-header","tabs","tabs-mobile"],[1,"tab",3,"ngClass","click"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/info-icon-white.png",1,"icon-hover","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/info-icon-gray.png",1,"icon","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],[1,"float-left","hidden-mobile","text-12"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/camera-icon-white.png",1,"icon-hover","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/camera-icon-gray.png",1,"icon","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/map-icon-white.png",1,"icon-hover","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/map-icon-gray.png",1,"icon","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/webcam-icon-white.png",1,"icon-hover","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/webcam-icon-gray.png",1,"icon","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],[1,"clearfix"],[1,"main-content-header"],[1,"float-left","back-button-area"],[1,"btn","btn-default","btn-back",3,"click"],[1,"float-left","title-area"],["class","special-name",4,"ngIf"],[1,"mountain-height","float-left"],["class","warning-message",4,"ngIf"],["class","error-message",4,"ngIf"],[1,"swap-container"],[1,"mobile-100-percent-width-40","margin-20-mobile","float-left","swap-first-div",2,"width","20%"],[1,"side-widget-title",2,"padding","0"],["alt","Ikona oblaka","src","https://openweathermap.org/img/wn/[email protected]",2,"vertical-align","middle","width","32px"],[3,"lat","lng",4,"ngIf"],["class","side-widget-title margin-20-top-mobile",4,"ngIf"],["class","pointer",3,"webcam","popup","click",4,"ngIf"],["class","side-widget-title hidden-mobile",4,"ngIf"],["style","width: 100%; height: 150px; position: relative;","class","hidden-mobile",4,"ngIf"],[1,"float-left","margin-0-bottom-mobile","swap-second-div","mobile-100-percent-width",3,"ngClass"],["medium","road_detail_banner"],[3,"ngClass"],["class","margin-5 margin-20-right margin-0-left",4,"ngIf"],[4,"ngIf"],[3,"lat","lng","limit",4,"ngIf"],["id","images-part",4,"ngIf"],["style","width: 100%; height: calc(100vh - 164px); position: relative;",4,"ngIf"],["class","clearfix",4,"ngIf"],[3,"type","id","getIDfromURL","titleVisible",4,"ngIf"],[3,"currentImg","allImages","visible","imageType","justOpened","onPopupClose","onCurrentImgChange","onPopupOpen",4,"ngIf"],[1,"special-name"],[1,"warning-message"],[1,"error-message"],[1,"danger-triangle"],[3,"lat","lng"],[1,"side-widget-title","margin-20-top-mobile"],["alt","Ikona kamere","src","/assets/images/webcam-icon-white.png",2,"vertical-align","middle","width","20px"],[1,"pointer",3,"webcam","popup","click"],[1,"side-widget-title","hidden-mobile"],["src","/assets/images/map-icon-white.png",2,"vertical-align","middle","width","20px"],[1,"hidden-mobile",2,"width","100%","height","150px","position","relative"],[3,"style","zoom","center","load",4,"ngIf"],[1,"map-button-container"],["href","https://play.google.com/store/apps/details?id=si.aidi.mountains_geek","target","_blank",1,"map-button"],[3,"zoom","center","load"],[3,"lngLat","closeOnClick"],[3,"lngLat"],[1,"marker"],[1,"margin-5","margin-20-right","margin-0-left"],[1,"btn","btn-sm","btn-primary","btn-circle",3,"routerLink"],["alt","Uredi pot","src","/assets/images/edit-icon.png","width","23px","height","23px",1,"valign-middle"],[1,"btn","btn-sm","btn-default","btn-circle","margin-5-left",3,"routerLink"],["alt","Uredi slike","src","/assets/images/edit-images.png","width","23px",1,"valign-middle"],[1,"btn","btn-sm","btn-default","btn-circle","margin-5-left",3,"click"],["alt","Dostop do izhodi\u0161\u010Da","width","23px","src","/assets/images/direction-icon.png",1,"valign-middle"],[1,"mobile-100-percent-width","margin-5-top","float-left",2,"width","calc(100% - 20px)"],[1,"float-left","mobile-100-percent-width","detail-main-image",2,"width","50%","margin-right","20px","margin-bottom","5px",3,"alt","src","click"],["id","additional-data",1,"odd-even-rows","mobile-100-percent-width"],[1,"mountain-score"],[3,"id","type","rating","ratedSuccess",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"no-decor",3,"routerLink"],["alt","Dodatne informacije o zahtevnosti poti","width","18px","src","assets/images/info.png",1,"pointer","valign-middle",3,"click"],["popupDifficultyInfoMessage",""],[1,"preformated-text"],[3,"id","type","rating","ratedSuccess"],[3,"lat","lng","limit"],[3,"lat","lng","radius","showRadiusSlider",4,"ngIf"],[3,"lat","lng","radius","showRadiusSlider"],["id","images-part"],["class","gallery-thumb","style","position: relative; display: inline-block",3,"click",4,"ngFor","ngForOf"],[1,"gallery-thumb",2,"position","relative","display","inline-block",3,"click"],[1,"square"],[1,"square-content"],["defaultImage","/assets/images/loader.gif",2,"width","100%","height","100%","object-fit","cover",3,"alt","src","lazyLoad"],["class","warning-message warning-image","style","padding: 3px 10px; font-weight: bold;",4,"ngIf"],[1,"warning-message","warning-image",2,"padding","3px 10px","font-weight","bold"],[2,"width","100%","height","calc(100vh - 164px)","position","relative"],[3,"type","id","getIDfromURL","titleVisible"],[3,"currentImg","allImages","visible","imageType","justOpened","onPopupClose","onCurrentImgChange","onPopupOpen"]],template:function(o,n){o&1&&(S(0,"div"),Z(1,"img",0),E(),S(2,"div")(3,"div",1)(4,"div",2)(5,"div",3),se("
1326click",function(){return n.changeTab("general")}),Z(6,"img",4)(7,"img",5),S(8,"div",6),A(9,"Splo\u0161no"),E()(),S(10,"div",3),se("click",function(){return n.changeTab("images")}),Z(11,"img",7)(12,"img",8),S(13,"div",6),A(14,"Slike"),E()(),S(15,"div",3),se("click",function(){return n.changeTab("map")}),Z(16,"img",9)(17,"img",10),S(18,"div",6),A(19,"Zemljevid"),E()(),S(20,"div",3),se("click",function(){return n.changeTab("webcams")}),Z(21,"img",11)(22,"img",12),S(23,"div",6),A(24,"Spletne kamere"),E()(),Z(25,"div",13),E(),S(26,"div",14)(27,"div",15)(28,"button",16),se("click",function(){return n.navigateBack()}),A(29," \u2039 "),E()(),S(30,"div",17)(31,"h1"),A(32),E(),ce(33,Cee,2,1,"h2",18),Z(34,"div",13),S(35,"div")(36,"div",19),A(37),E(),Z(38,"div",13),E()(),Z(39,"div",13),E(),ce(40,Eee,2,0,"div",20)(41,See,5,1,"div",21),S(42,"div",22)(43,"div",23)(44,"div",24),Z(45,"img",25),S(46,"span"),A(47," Vreme"),E()(),ce(48,Tee,1,2,"app-weather-forecast",26)(49,Iee,4,0,"div",27)(50,Dee,1,2,"app-webcam",28)(51,Mee,4,0,"div",29)(52,Aee,5,1,"div",30),E(),S(53,"div",31),Z(54,"app-random-banner",32),S(55,"div",33),ce(56,Pee,9,2,"div",34)(57,Nee,88,36,"div",35)(58,zee,2,0,"h3",35)(59,jee,1,3,"app-horizontal-story-list",36)(60,Vee,2,0,"h3",35)(61,Uee,2,1,"div",35)(62,Gee,3,1,"div",37)(63,Wee,5,1,"div",38)(64,Zee,1,0,"div",39)(65,Kee,1,4,"app-comment-list",40),E()()()(),Z(66,"app-side-road-list")(67,"div",13),E(),ce(68,Xee,1,5,"app-gallery-popup",41)),o&2&&(ki("",n.road?"hidden":""," loader"),P(2),cl(n.road?"":"hidden"),P(3),N("ngClass",kt(43,S1,n.generalTab)),P(1),N("ngClass",kt(45,Mu,!n.generalTab)),P(1),N("ngClass",kt(47,Mu,n.generalTab)),P(3),N("ngClass",kt(49,S1,n.imagesTab)),P(1),N("ngClass",kt(51,Mu,!n.imagesTab)),P(1),N("ngClass",kt(53,Mu,n.imagesTab)),P(3),N("ngClass",kt(55,S1,n.mapTab)),P(1),N("ngClass",kt(57,Mu,!n.mapTab)),P(1),N("ngClass",kt(59,Mu,n.mapTab)),P(3),N("ngClass",kt(61,S1,n.webcamsTab)),P(1),N("ngClass",kt(63,Mu,!n.webcamsTab)),P(1),N("ngClass",kt(65,Mu,n.webcamsTab)),P(10),a_(" ",n.road==null||n.road.starting_point==null?null:n.road.starting_point.title," - ",n.road==null||n.road.end_point==null?null:n.road.end_point.title," (",n.tabTitle,") "),P(1),N("ngIf",n.road==null?null:n.road.name),P(4),mt(n.hikingTime),P(3),N("ngIf",n.road&&!(n.road!=null&&n.road.published)),P(1),N("ngIf",n.road&&(n.road==null?null:n.road.closed)),P(7),N("ngIf",n.road),P(1),N("ngIf",!n.webcamsTab),P(1),N("ngIf",!n.webcamsTab),P(1),N("ngIf",n.webcamsTab),P(1),N("ngIf",n.webcamsTab&&((n.road==null||n.road.starting_point==null?null:n.road.starting_point.length)!=null&&(n.road==null||n.road.starting_point==null?null:n.road.starting_point.width)!=null||(n.road==null||n.road.end_point==null?null:n.road.end_point.length)!=null&&(n.road==null||n.road.end_point==null?null:n.road.end_point.width)!=null)),P(1),N("ngClass",mn(67,Yee,!n.mapTab,n.mapTab)),P(2),N("ngClass",kt(70,Qee,!n.mapTab)),P(1),N("ngIf",!n.mapTab&&!n.commentsTab),P(1),N("ngIf",n.generalTab),P(1),N("ngIf",n.webcamsTab),P(1),N("ngIf",n.webcamsTab),P(1),N("ngIf",n.webcamsTab),P(1),N("ngIf",n.webcamsTab),P(1),N("ngIf",n.road&&n.imagesTab&&n.road.images.length>0),P(1),N("ngIf",n.mapTab&&((n.road==null||n.road.starting_point==null?null:n.road.starting_point.length)!=null&&(n.road==null||n.road.starting_point==null?null:n.road.starting_point.width)!=null||(n.road==null||n.road.end_point==null?null:n.road.end_point.length)!=null&&(n.road==null||n.road.end_point==null?null:n.road.end_point.width)!=null)),P(1),N("ngIf",n.generalTab),P(1),N("ngIf",n.generalTab),P(3),N("ngIf",n.imageIndex!==null))},dependencies:[Dt,on,ti,At,rf,Tu,vl,vu,Df,Vx,qi,Bf,_1,$f,Hf,y1,x1,Gf,XN,C1,E1,Cu],styles:[".map-button-container[_ngcontent-%COMP%]{position:absolute;top:10px;right:10px;z-index:10}.map-button[_ngcontent-%COMP%]{background-color:var(--color-accent);color:#fff;border:none;padding:10px 18px;border-radius:var(--radius-pill);text-decoration:none;font-size:14px;font-weight:700;display:flex;align-items:center;box-shadow:var(--shadow-sm);transition:background var(--transition-fast),transform var(--transition-fast)}.map-button[_ngcontent-%COMP%]:hover{background-color:var(--color-accent-hover);transform:translateY(-1px)}"]});let i=e;return i})();function Jee(i,e){i&1&&(S(0,"div",3)(1,"div",4),A(2,"Destinacije v bli\u017Eini"),E(),Z(3,"div",5),E())}function ete(i,e){if(i&1&&(S(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9),Z(4,"img",10),E()()(),S(5,"div",11)(6,"h4"),A(7),E(),S(8,"div",12)(9,"div",13),A(10),E(),Z(11,"div",5),E()(),Z(12,"div",5),E()),i&2){let r=e.$implicit;fn("routerLink","/destinacije/",r.slug,""),P(4),fn("alt","",r.title," glavna slika"),Hi("src",r!=null&&r.image?r==null?null:r.
1326image.file:"/assets/images/default-no-image.png",Ei),P(3),We(" ",r.title," "),P(3),We(" ",r.height!=null?r.height+" m":"Vi\u0161ina neznana"," ")}}var iz=(()=>{let e=class e extends Ff{ngOnInit(){this.sub=this.route.params.subscribe(t=>{let o=+t["id-or-slug"],n;isNaN(o)&&(o=null),n=t["id-or-slug"],(o||n)&&this.destinationService.getDestination(o,n).subscribe(d=>{this.destinationService.getDestinations(5,null,null,null,null,null,null,null,null,null,null,null,{lat:d.width,lng:d.length,distance:10,idnot:d.id}).subscribe(_=>{this.destinations=_.results})})})}};e.\u0275fac=(()=>{let t;return function(n){return(t||(t=uo(e)))(n||e)}})(),e.\u0275cmp=st({type:e,selectors:[["app-side-destination-list"]],standalone:!0,features:[It([Ti,Js]),Xn,gt],decls:3,vars:2,consts:[["id","side-part"],["class","col-header tabs height-45",4,"ngIf"],["class","side-row",3,"routerLink",4,"ngFor","ngForOf"],[1,"col-header","tabs","height-45"],[1,"tab","tab-inactive"],[1,"clearfix"],[1,"side-row",3,"routerLink"],[1,"side-row-image","float-left"],[1,"square"],[1,"square-content"],[3,"alt","src"],[1,"side-row-content","float-left"],[1,"full-width"],[1,"mountain-height","mountain-height-xs"]],template:function(o,n){o&1&&(S(0,"div",0),ce(1,Jee,4,0,"div",1)(2,ete,13,5,"div",2),E()),o&2&&(P(1),N("ngIf",n.destinations.length>0),P(1),N("ngForOf",n.destinations))},dependencies:[qi,Dt,ti,At]});let i=e;return i})();function tte(i,e){i&1&&(S(0,"div",45),A(1,"Destinacija je v pregledu. Vidna je samo vam, ker \u0161e ni bila odobrena s strani administratorja. Po kon\u010Danem pregledu in odobritvi, bo destinacija vidna vsem uporabnikom portala."),E())}function ite(i,e){if(i&1&&Z(0,"app-weather-forecast",46),i&2){let r=q();N("lat",r.destination==null?null:r.destination.width)("lng",r.destination==null?null:r.destination.length)}}function nte(i,e){i&1&&(S(0,"div",47),Z(1,"img",48),S(2,"span"),A(3,"\xA0\xA0\xA0\xA0Najbli\u017Eja spletna kamera"),E()())}function rte(i,e){if(i&1){let r=Ge();S(0,"app-webcam",49),se("click",function(){Se(r);let o=q();return Te(o.changeTab("webcams"))}),E()}if(i&2){let r=q();N("webcam",r.webcam)("popup",!1)}}function ote(i,e){i&1&&(S(0,"div",50),Z(1,"img",51),S(2,"span"),A(3,"\xA0\xA0\xA0\xA0Zemljevid"),E()())}var nz=()=>[12],qf=(i,e)=>[i,e];function ste(i,e){if(i&1&&(S(0,"mgl-map",54),se("load",function(t){return t.resize()}),S(1,"mgl-popup",55),A(2),E(),S(3,"mgl-marker",56),Z(4,"div",57),E()()),i&2){let r=q(2);Gs("mapbox://styles/silko/cjb1va19f6xm72spde16k92nx"),N("zoom",Zs(8,nz))("center",mn(9,qf,r.destination==null?null:r.destination.length,r.destination==null?null:r.destination.width)),P(1),N("lngLat",mn(12,qf,r.destination==null?null:r.destination.length,r.destination==null?null:r.destination.width))("closeOnClick",!1),P(1),We(" ",r.destination==null?null:r.destination.title," "),P(1),N("lngLat",mn(15,qf,r.destination==null?null:r.destination.length,r.destination==null?null:r.destination.width))}}function ate(i,e){if(i&1&&(S(0,"div",52),ce(1,ste,5,18,"mgl-map",53),E()),i&2){let r=q();P(1),N("ngIf",r.isBrowser)}}function lte(i,e){if(i&1){let r=Ge();S(0,"div",58)(1,"button",59),Z(2,"img",60),E(),S(3,"button",61),Z(4,"img",62),E(),S(5,"button",63),se("click",function(){Se(r);let o=q();return Te(o.openGoogleMapsRoute(o.destination==null?null:o.destination.width,o.destination==null?null:o.destination.length))}),Z(6,"img",64),S(7,"span",65),A(8," Dostop do destinacije"),E()()()}if(i&2){let r=q();P(1),fn("routerLink","/destinations/edit/",r.destination==null?null:r.destination.id,""),P(2),fn("routerLink","/destinations/images/",r.destination==null?null:r.destination.id,"")}}function cte(i,e){if(i&1){let r=Ge();S(0,"app-rating",73),se("ratedSuccess",function(){Se(r);let o=q(2);return Te(o.onRate())}),E()}if(i&2){let r=q(2);N("id",r.destination==null?null:r.destination.id)("type","destination")("rating",r.destination==null?null:r.destination.rating)}}function ute(i,e){i&1&&(S(0,"span"),A(1,","),E())}function dte(i,e){if(i&1&&(S(0,"span"),A(1),ce(2,ute,2,0,"span",33),E()),i&2){let r=e.$implicit,t=e.last;P(1),We(" ",r.title,""),P(1),N("ngIf",!t)}}function hte(i,e){if(i&1){let r=Ge();
1326S(0,"a",74),se("click",function(){Se(r);let o=q(2);return Te(o.scrollTo("roads"))}),A(1," (oglej si poti tukaj) "),E()}}function pte(i,e){if(i&1){let r=Ge();S(0,"div")(1,"div",66)(2,"img",67),se("click",function(){Se(r);let o=q();return Te(o.openImage((o.destination==null||o.destination.main_image==null?null:o.destination.main_image.position)-1))}),E(),S(3,"table",68)(4,"tbody")(5,"tr")(6,"td")(7,"b"),A(8,"Ocena:"),E()(),S(9,"td"),ce(10,cte,1,3,"app-rating",69),E()(),S(11,"tr")(12,"td")(13,"b"),A(14,"Tip destinacije:"),E()(),S(15,"td"),A(16),E()(),S(17,"tr")(18,"td")(19,"b"),A(20,"Dr\u017Eava:"),E()(),S(21,"td"),ce(22,dte,3,2,"span",70),E()(),S(23,"tr")(24,"td")(25,"b"),A(26,"Gorovje:"),E()(),S(27,"td"),A(28),E()(),S(29,"tr")(30,"td")(31,"b"),A(32,"\u0160irina/Dol\u017Eina:"),E()(),S(33,"td"),A(34),$r(35,"number"),$r(36,"number"),E()(),S(37,"tr")(38,"td")(39,"b"),A(40,"\u0160tevilo poti:"),E()(),S(41,"td"),A(42),ce(43,hte,2,0,"a",71),E()()()(),Z(44,"br"),S(45,"p",72),A(46),E()()()}if(i&2){let r=q();P(2),fn("alt","",r.destination==null?null:r.destination.title," prikazna slika"),Hi("src",r.destination!=null&&r.destination.main_image?r.destination==null?null:r.destination.main_image.file:"/assets/images/default-no-image.png",Ei),P(8),N("ngIf",r.destination),P(6),We(" ",r.destination==null?null:r.destination.type.title," "),P(6),N("ngForOf",r.destination==null?null:r.destination.country),P(6),We(" ",r.destination==null||r.destination.mountain_range==null?null:r.destination.mountain_range.title," "),P(6),tr(" ",Gr(35,11,r.destination==null?null:r.destination.width,"1.2-4")," / ",Gr(36,14,r.destination==null?null:r.destination.length,"1.2-4")," "),P(8),We(" ",r.destination==null?null:r.destination.roads_count," "),P(1),N("ngIf",(r.destination==null?null:r.destination.roads_count)>0),P(3),mt(r.destination==null?null:r.destination.desc)}}function fte(i,e){i&1&&Z(0,"div",13)}function mte(i,e){i&1&&(S(0,"h3"),A(1,"Zadnji vpisi"),E())}function gte(i,e){if(i&1&&Z(0,"app-checkin-list",75),i&2){let r=q();N("selectedDestination",r.destination==null?null:r.destination.uid)("limit",10)}}function _te(i,e){i&1&&Z(0,"br")}function vte(i,e){i&1&&(S(0,"h3",76),A(1,"Poti"),E())}function yte(i,e){if(i&1&&Z(0,"app-road-grid-list",77),i&2){let r=q();N("loadMoreVisible",!0)("cols",5)("limit",10)("oddEven","odd")("order","-")("ordering","id")("selectedDestination",r.destination==null?null:r.destination.id)}}function bte(i,e){i&1&&(S(0,"div",85),A(1,"!"),E())}function xte(i,e){if(i&1){let r=Ge();S(0,"div",80),se("click",function(){let n=Se(r).index,d=q(2);return Te(d.openImage(n))}),S(1,"div",81)(2,"div",82),Z(3,"img",83),E()(),ce(4,bte,2,0,"div",84),E()}if(i&2){let r=e.$implicit,t=e.index,o=q(2);P(3),Ws("alt","",o.destination==null?null:o.destination.title," slika ",t+1,""),Hi("lazyLoad",r.image.file),P(1),N("ngIf",!r.published)}}function wte(i,e){if(i&1&&(S(0,"div",78),ce(1,xte,5,4,"div",79),Z(2,"div",13),E()),i&2){let r=q();P(1),N("ngForOf",r.destination==null?null:r.destination.images)}}function Cte(i,e){i&1&&(S(0,"div",86)(1,"p"),A(2,"Koordinate izbrane destinacije niso znane."),E()())}function Ete(i,e){if(i&1&&(S(0,"mgl-map",54),se("load",function(t){return t.resize()}),S(1,"mgl-popup",55),A(2),E(),S(3,"mgl-marker",56),Z(4,"div",57),E()()),i&2){let r=q(2);Gs("mapbox://styles/silko/cjb1va19f6xm72spde16k92nx"),N("zoom",Zs(8,nz))("center",mn(9,qf,r.destination==null?null:r.destination.length,r.destination==null?null:r.destination.width)),P(1),N("lngLat",mn(12,qf,r.destination==null?null:r.destination.length,r.destination==null?null:r.destination.width))("closeOnClick",!1),P(1),We(" ",r.destination==null?null:r.destination.title," "),P(1),N("lngLat",mn(15,qf,r.destination==null?null:r.destination.length,r.destination==null?null:r.destination.width))}}function Ste(i,e){if(i&1&&(S(0,"div",87),ce(1,Ete,5,18,"mgl-map",53),E()),i&2){let r=q();P(1),N("ngIf",r.isBrowser)}}function Tte(i,e){i&1&&(S(0,"h3"),A(1,"Razmere v zgodbah"),E())}function Ite(i,e){if(i&1&&Z(0,"app-horizontal-story-list",88),i&2){let r=q();N("lat",r.destination==null?null:r.destination.width)("lng",r.destination==null?null:r.destination.length)("limit",20)}}function Dte(i,e){i&1&&(S(0,"h3"),A(1,"Spletne kamere"),E())}function Mte(i,e){if(i&1&&Z(0,"app-webcam-list",89),i&2){let r=q();N("lat",r.destination==null?null:r.destination.width)("lng",r.destination==null?null:r.destination.length)("radius",15)("showRadiusSlider",!0)}}function kte(i,e){i&1&&Z(0,"div",13)}function Ate(i,e){if(i&1&&Z(0,"app-comment-list",90),i&2){let r=q();N("type","destination")("id",r.destination==null?null:r.destination.id)("getIDfromURL",!1)("titleVisible",!1)}}function Pte(i,e){if(i&1){let r=Ge();S(0,"app-gallery-popup",91),se("onPopupClose",function(o){Se(r);let n=q();return Te(n.onPopupClose(o))})("onCurrentImgChange",function(o){Se(r);let n=q();return Te(n.onCurrentImgChange(o))})("onPopupOpen",function(o){Se(r);let n=q();return Te(n.onPopupOpen(o))}),E()}if(i&2){let r=q();N("currentImg",r.imageIndex)("allImages",r.destination==null?null:r.destination.images)("visible",r.popupVisible)("imageType","destination_image")("justOpened",r.justOpened)}}var T1=i=>({active:i}),Au=i=>({hidden:i}),Ote=(i,e)=>({"width-80-percent-40":i,"width-80-percent":e}),Rte=i=>({"margin-20 margin-0-top":i}),m0=(()=>{let e=class e{constructor(t,o,n,d,_,C,M,j,G,ie){this.webcamService=o,this.location=n,this.meta=d,this.destinationService=_,this.titleService=C,this.route=M,this.urlHistory=j,this.scroller=G,this.router=ie,this.id=null,this.slug=null,this.justOpened=!0,this.popupVisible=!1,this.imageIndex=null,this.generalTab=!0,this.roadsTab=!1,this.imagesTab=!1,this.mapTab=!1,this.webcamsTab=!1,this.commentsTab=!1,this.tabParam="",this.tabTitle="Splo\u0161no",this.webcam=null,this.isBrowser=Si(t)}onRate(){this.getDestination()}scrollTo(t){this.scroller.scrollToAnchor(t)}changeTab(t){t==="general"?(this.generalTab=!0,this.roadsTab=!1,this.imagesTab=!1,this.mapTab=!1,this.webcamsTab=!1,this.commentsTab=!1,this.tabParam="",this.tabTitle="Splo\u0161no"):t==="roads"?(this.generalTab=!1,this.roadsTab=!0,this.imagesTab=!1,this.mapTab=!1,this.webcamsTab=!1,this.commentsTab=!1,this.tabParam="poti",this.tabTitle="Poti"):t==="images"?(this.generalTab=!1,this.roadsTab=!1,this.imagesTab=!0,this.mapTab=!1,this.webcamsTab=!1,this.commentsTab=!1,this.tabParam="slike",this.tabTitle="Slike"):t==="map"?(this.generalTab=!1,this.roadsTab=!1,this.imagesTab=!1,this.mapTab=!0,this.webcamsTab=!1,this.commentsTab=!1,this.tabParam="zemljevid",this.tabTitle="Zemljevid"):t==="webcams"?(this.generalTab=!1,this.roadsTab=!1,this.imagesTab=!1,this.mapTab=!1,this.webcamsTab=!0,this.commentsTab=!1,this.tabParam="spletne-kamere",this.tabTitle="Spletne kamere"):t==="comments"&&(this.generalTab=!1,this.roadsTab=!1,this.imagesTab=!1,this.mapTab=!1,this.webcamsTab=!1,this.commentsTab=!0,this.tabParam="komentarji",this.tabTitle="Komentarji"),this.titleService.setTitle(this.destination.title+" | "+this.tabTitle+" | Mountains Geek"),this.location.replaceState("/destinacije/"+this.slug+"/"+this.tabParam)}
1326getDestination(){this.destinationService.getDestination(this.id,this.slug).subscribe(t=>{switch(this.id=t.id,this.slug=t.slug,this.destination=t,this.tabParam){case"poti":this.changeTab("roads");break;case"slike":this.changeTab("images");break;case"zemljevid":this.changeTab("map");break;case"spletne-kamere":this.changeTab("webcams");break;case"komentarji":this.changeTab("comments");break;default:this.changeTab("general");break}this.location.replaceState("/destinacije/"+this.slug+"/"+this.tabParam),this.destinationService.getDestinationImages(this.destination.id,10,0).subscribe(o=>{this.destination.images=o.results}),this.meta.updateTag({name:"description",content:"Splo\u0161ne informacije destinacije "+this.destination.title+" ("+this.destination.type_title+"). Informacije o destinaciji "+this.destination.title+" ("+this.destination.type_title+"). vsebujejo seznam poti, opis, slike,..."}),this.meta.addTag({property:"og:description",content:"Splo\u0161ne informacije destinacije "+this.destination.title+" ("+this.destination.type_title+"). Informacije o destinaciji "+this.destination.title+" ("+this.destination.type_title+"). vsebujejo seznam poti, opis, slike,..."}),this.meta.addTag({property:"og:title",content:this.destination.title}),this.destination.main_image!==null&&this.meta.addTag({property:"og:image",content:this.destination.main_image.file}),this.webcamService.getWebcamsNearby(this.destination.width,this.destination.length,15,0,1).subscribe(o=>{o.total>0&&(this.webcam=o.webcams[0])})},t=>{t.status===404&&this.router.navigate(["/404"])})}ngOnInit(){this.sub=this.route.params.subscribe(t=>{this.id=+t["id-or-slug"],this.tabParam=t.tab,isNaN(this.id)&&(this.id=null,this.slug=t["id-or-slug"]),this.tabParam||(this.tabParam=""),this.getDestination()})}openImage(t){this.imageIndex=t,this.justOpened=!0,this.popupVisible=!0}onPopupOpen(t){this.justOpened=t}onPopupClose(t){this.imageIndex=null,this.popupVisible=t}onCurrentImgChange(t){this.imageIndex=t}openGoogleMapsRoute(t,o){if(this.isBrowser){let n="https://maps.google.com?saddr=Current+Location&daddr="+t+","+o;window.open(n,"_blank")}}navigateBack(){sessionStorage.getItem("previousUrl")?this.location.back():this.router.navigate(["/"])}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(Eo),ae(hl),ae(Qd),ae(sn),ae(uc),ae(Gi),ae(Iu),ae(Xb),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-destination-detail"]],standalone:!0,features:[It([sn,Eo,Iu]),gt],decls:74,vars:76,consts:[["src","/assets/images/loader.gif",1,"mobile-100-percent-width"],["id","left-part"],[1,"col-header","tabs","tabs-mobile"],[1,"tab",3,"ngClass","click"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/info-icon-white.png",1,"icon-hover","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/info-icon-gray.png",1,"icon","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],[1,"float-left","hidden-mobile","text-12"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/camera-icon-white.png",1,"icon-hover","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/camera-icon-gray.png",1,"icon","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/map-icon-white.png",1,"icon-hover","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/map-icon-gray.png",1,"icon","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/webcam-icon-white.png",1,"icon-hover","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],["width","25px","height","25px","alt","Splo\u0161no","src","/assets/images/webcam-icon-gray.png",1,"icon","float-left","float-left-nonmobile","margin-5-right","margin-desktop",3,"ngClass"],[1,"clearfix"],[1,"main-content-header"],[1,"float-left","back-button-area"],[1,"btn","btn-default","btn-back",3,"click"],[1,"float-left","title-area"],[1,"mountain-height","float-left",2,"margin-top","8px"],["class","warning-message",4,"ngIf"],[1,"swap-container"],[1,"mobile-100-percent-width-40","margin-20-mobile","float-left","swap-first-div",2,"width","20%"],[1,"side-widget-title",2,"padding","0"],["alt","Ikona oblaka","src","https://openweathermap.org/img/wn/[email protected]",2,"vertical-align","middle","width","32px"],[3,"lat","lng",4,"ngIf"],["class","side-widget-title margin-20-top-mobile",4,"ngIf"],["class","pointer",3,"webcam","popup","click",4,"ngIf"],["class","side-widget-title hidden-mobile",4,"ngIf"],["style","width: 100%; height: 150px;","class","hidden-mobile",4,"ngIf"],[1,"float-left","mobile-100-percent-width","margin-0-bottom-mobile","swap-second-div",3,"ngClass"],["medium","destination_detail_banner"],[3,"ngClass"],["class","margin-5 margin-20-right margin-0-left",4,"ngIf"],[4,"ngIf"],["class","clearfix",4,"ngIf"],[3,"selectedDestination","limit",4,"ngIf"],["id","roads",4,"ngIf"],[3,"loadMoreVisible","cols","limit","oddEven","order","ordering","selectedDestination",4,"ngIf"],["id","images-part",4,"ngIf"],["class","margin-10",4,"ngIf"],["style","width: 100%; height: calc(100vh - 164px);",4,"ngIf"],[3,"lat","lng","limit",4,"ngIf"],[3,"lat","lng","radius","showRadiusSlider",4,"ngIf"],[3,"type","id","getIDfromURL","titleVisible",4,"ngIf"],[3,"currentImg","allImages","visible","imageType","justOpened","onPopupClose","onCurrentImgChange","onPopupOpen",4,"ngIf"],[1,"warning-message"],[3,"lat","lng"],[1,"side-widget-title","margin-20-top-mobile"],["alt","Ikona kamere","src","/assets/images/webcam-icon-white.png",2,"vertical-align","middle","width","20px"],[1,"pointer",3,"webcam","popup","click"],[1,"side-widget-title","hidden-mobile"],["src","/assets/images/map-icon-white.png",2,"vertical-align","middle","width","20px"],[1,"hidden-mobile",2,"width","100%","height","150px"],[3,"style","zoom","center","load",4,"ngIf"],[3,"zoom","center","load"],[3,"lngLat","closeOnClick"],[3,"lngLat"],[1,"marker"],[1,"margin-5","margin-20-right","margin-0-left"],[1,"btn","btn-sm","btn-primary","btn-circle",3,"routerLink"],["alt","Uredi pot","src","/assets/images/edit-icon.png","width","23px","height","23px",1,"valign-middle"],[1,"btn","btn-sm","btn-default","btn-circle","margin-5-left",3,"routerLink"],["alt","Uredi slike","src","/assets/images/edit-images.png","width","23px",1,"valign-middle"],[1,"btn","btn-sm","btn-default","btn-circle","margin-5-left",3,"click"],["alt","Dostop do destinacije","width","23px","src","/assets/images/direction-icon.png",1,"valign-middle"],[2,"font-size","9pt"],[1,"mobile-100-percent-width","grid-item-short-content","margin-10-bottom","float-left",2,"width","calc(100% - 20px)","padding","0"],[1,"float-left","mobile-100-percent-width","detail-main-image",2,"width","50%","margin-right","20px","margin-bottom","5px",3,"alt","src","click"],["id","additional-data",1,"odd-even-rows","mobile-100-percent-width"],[3,"id","type","rating","ratedSuccess",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"click",4,"ngIf"],[1,"preformated-text"],[3,"id","type","rating","ratedSuccess"],[3,"click"],[3,"selectedDestination","limit"],["id","roads"],[3,"loadMoreVisible","cols","limit","oddEven","order","ordering","selectedDestination"],["id","images-part"],["class","gallery-thumb","style","position: relative; display: inline-block",3,"click",4,"ngFor","ngForOf"],[1,"gallery-thumb",2,"position","relative","display","inline-block",3,"click"],[1,"square"],[1,"square-content"],["defaultImage","/assets/images/loader.gif",2,"width","100%","height","100%","object-fit","cover",3,"alt","lazyLoad"],["class","warning-message warning-image","style","padding: 3px 10px; font-weight: bold; font-size: 15pt;",4,"ngIf"],[1,"warning-message","warning-image",2,"padding","3px 10px","font-weight","bold","font-size","15pt"],[1,"margin-10"],[2,"width","100%","height","calc(100vh - 164px)"],[3,"lat","lng","limit"],[3,"lat","lng","radius","showRadiusSlider"],[3,"type","id","getIDfromURL","titleVisible"],[3,"currentImg","allImages","visible","imageType","justOpened","onPopupClose","onCurrentImgChange","onPopupOpen"]],template:function(o,n){o&1&&(S(0,"div"),Z(1,"img",0),E(),S(2,"div")(3,"div",1)(4,"div",2)(5,"div",3),se("
1326click",function(){return n.changeTab("general")}),Z(6,"img",4)(7,"img",5),S(8,"div",6),A(9,"Splo\u0161no"),E()(),S(10,"div",3),se("click",function(){return n.changeTab("images")}),Z(11,"img",7)(12,"img",8),S(13,"div",6),A(14,"Slike"),E()(),S(15,"div",3),se("click",function(){return n.changeTab("map")}),Z(16,"img",9)(17,"img",10),S(18,"div",6),A(19,"Zemljevid"),E()(),S(20,"div",3),se("click",function(){return n.changeTab("webcams")}),Z(21,"img",11)(22,"img",12),S(23,"div",6),A(24,"Spletne kamere"),E()(),Z(25,"div",13),E(),S(26,"div",14)(27,"div",15)(28,"button",16),se("click",function(){return n.navigateBack()}),A(29," \u2039 "),E()(),S(30,"div",17)(31,"h1"),A(32),E(),Z(33,"div",13),S(34,"div")(35,"div",18),A(36),E(),Z(37,"div",13),E()(),Z(38,"div",13),E(),ce(39,tte,2,0,"div",19),S(40,"div",20)(41,"div",21)(42,"div",22),Z(43,"img",23),S(44,"span"),A(45," Vreme"),E()(),ce(46,ite,1,2,"app-weather-forecast",24)(47,nte,4,0,"div",25)(48,rte,1,2,"app-webcam",26)(49,ote,4,0,"div",27)(50,ate,2,1,"div",28),E(),S(51,"div",29),Z(52,"app-random-banner",30),S(53,"div",31),ce(54,lte,9,2,"div",32)(55,pte,47,17,"div",33)(56,fte,1,0,"div",34)(57,mte,2,0,"h3",33)(58,gte,1,2,"app-checkin-list",35)(59,_te,1,0,"br",33)(60,vte,2,0,"h3",36)(61,yte,1,7,"app-road-grid-list",37)(62,wte,3,1,"div",38)(63,Cte,3,0,"div",39)(64,Ste,2,1,"div",40)(65,Tte,2,0,"h3",33)(66,Ite,1,3,"app-horizontal-story-list",41)(67,Dte,2,0,"h3",33)(68,Mte,1,4,"app-webcam-list",42)(69,kte,1,0,"div",34)(70,Ate,1,4,"app-comment-list",43),E()()()(),Z(71,"app-side-destination-list")(72,"div",13),E(),ce(73,Pte,1,5,"app-gallery-popup",44)),o&2&&(ki("",n.destination?"hidden":""," loader"),P(2),cl(n.destination?"":"hidden"),P(3),N("ngClass",kt(47,T1,n.generalTab)),P(1),N("ngClass",kt(49,Au,!n.generalTab)),P(1),N("ngClass",kt(51,Au,n.generalTab)),P(3),N("ngClass",kt(53,T1,n.imagesTab)),P(1),N("ngClass",kt(55,Au,!n.imagesTab)),P(1),N("ngClass",kt(57,Au,n.imagesTab)),P(3),N("ngClass",kt(59,T1,n.mapTab)),P(1),N("ngClass",kt(61,Au,!n.mapTab)),P(1),N("ngClass",kt(63,Au,n.mapTab)),P(3),N("ngClass",kt(65,T1,n.webcamsTab)),P(1),N("ngClass",kt(67,Au,!n.webcamsTab)),P(1),N("ngClass",kt(69,Au,n.webcamsTab)),P(10),tr(" ",n.destination==null?null:n.destination.title," (",n.tabTitle,") "),P(4),We("",n.destination==null?null:n.destination.height," m"),P(3),N("ngIf",n.destination&&!(n.destination!=null&&n.destination.published)),P(7),N("ngIf",n.destination),P(1),N("ngIf",!n.webcamsTab),P(1),N("ngIf",!n.webcamsTab),P(1),N("ngIf",n.webcamsTab),P(1),N("ngIf",n.webcamsTab&&(n.destination==null?null:n.destination.length)!=null&&(n.destination==null?null:n.destination.width)!=null),P(1),N("ngClass",mn(71,Ote,!n.mapTab,n.mapTab)),P(2),N("ngClass",kt(74,Rte,!n.mapTab)),P(1),N("ngIf",!n.mapTab&&!n.commentsTab),P(1),N("ngIf",n.generalTab),P(1),N("ngIf",n.generalTab),P(1),N("ngIf",n.generalTab),P(1),N("ngIf",n.destination&&n.generalTab),P(1),N("ngIf",n.generalTab),P(1),N("ngIf",n.generalTab),P(1),N("ngIf",n.generalTab),P(1),N("ngIf",n.imagesTab&&(n.destination==null||n.destination.images==null?null:n.destination.images.length)>0),P(1),N("ngIf",n.mapTab&&((n.destination==null?null:n.destination.length)==null||(n.destination==null?null:n.destination.width)==null)),P(1),N("ngIf",n.mapTab&&(n.destination==null?null:n.destination.length)!=null&&(n.destination==null?null:n.destination.width)!=null),P(1),N("ngIf",n.webcamsTab),P(1),N("ngIf",n.webcamsTab),P(1),N("ngIf",n.webcamsTab),P(1),N("ngIf",n.destination&&n.webcamsTab),P(1),N("ngIf",n.generalTab),P(1),N("ngIf",n.destination&&n.generalTab),P(3),N("ngIf",n.imageIndex!==null))},dependencies:[Dt,on,ti,At,rf,x1,Tu,vl,vu,Df,Vx,qi,y1,$f,Hf,_1,Gf,C1,iz,Gx,$x,E1,Cu]});let i=e;return i})();function Lte(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function Fte(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=q(2);P(1),mt(r.errorMessages==null?null:r.errorMessages.detail)}}function Nte(i,e){if(i&1&&(S(0,"div",26),A(1," Napake: "),S(2,"ul"),ce(3,Lte,2,1,"li",27)(4,Fte,2,1,"li",28),E()()),i&2){let r=q();P(3),N("ngForOf",r.errorMessages==null?null:r.errorMessages.non_field_errors),P(1),N("ngIf",r.errorMessages==null?null:r.errorMessages.detail)}}function zte(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.name[0]," ")}}function jte(i,e){if(i&1){let r=Ge();S(0,"app-dropdown",29),se("onSelect",function(o){Se(r);let n=q();return Te(n.selectDestination(o.value))}),E()}if(i&2){let r=q();N("links",r.destinationLinksList)("values",r.startingPointList)("categories",!1)}}function Vte(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.starting_point[0]," ")}}function Bte(i,e){if(i&1){let r=Ge();S(0,"app-dropdown",29),se("onSelect",function(o){Se(r);let n=q();return Te(n.selectDestination(o.value))}),E()}if(i&2){let r=q();N("links",r.destinationLinksList)("values",r.endPointList)("categories",!1)}}function Ute(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.end_point[0]," ")}}function Hte(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.hiking_time[0]," ")}}function $te(i,e){if(i&1){let r=Ge();S(0,"app-dropdown",30),se("onSelect",function(o){Se(r);let n=q();return Te(n.selectDifficulty(o.value))}),E()}if(i&2){let r=q();N("values",r.difficultyList)("categories",!1)}}function Gte(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.difficulty[0]," ")}}function qte(i,e){if(i&1&&(S(0,"div",31),A(1),E()),i&2){let r=q();P(1),We(" ",r.selectedDifficulty.description," ")}}function Wte(i,e){if(i&1){let r=Ge();S(0,"app-dropdown",30),se("onSelect",function(o){Se(r);let n=q();return Te(n.selectEquipment(o.value))}),E()}if(i&2){let r=q();N("values",r.equipmentList)("categories",!1)}}function Zte(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.recommended_equipment[0]," ")}}function Kte(i,e){if(i&1){let r=Ge();S(0,"button",34),se("click",function(){let n=Se(r).index,d=q(2);return Te(d.deleteEquipment(n))}),A(1),S(2,"span",35),A(3,"\xD7"),E()()}if(i&2){let r=e.$implicit;P(1),We(" ",r.title," ")}}function Xte(i,e){if(i&1&&(S(0,"div",32),ce(1,Kte,4,1,"button",33),E()),i&2){let r=q();P(1),N("ngForOf",r.selectedEquipmentList)}}function Yte(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.access_to_the_starting_point[0]," ")}}function Qte(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.desc_path[0]," ")}}function Jte(i,e){if(i&1&&(S(0,"div",26),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.additional_tips[0]," ")}}var rz=i=>({hidden:i}),g0=(()=>{let e=class e{constructor(t,o,n,d,_){this.destinationService=t,this.roadService=o,this.formBuilder=n,this.route=d,this.router=_,this.id=null,this.roadForm=null,this.startingPointList=[],this.endPointList=[],this.equipmentList=[],this.difficultyList=[],this.selectedEquipmentList=[],this.selectedEquipmentIds=[],this.searchTarget=null,this.selectedStartingPoint=null,this.selectedEndPoint=null,this.selectedDifficulty=null,this.showStartingPointDropdown=!1,this.showEndPointDropdown=!1,this.showEquipmentDropdown=!1,this.showDifficultyDropdown=!1,this.scrolled=!0,this.loader=!1,this.destinationLinksList=[{name:"Dod
1326aj novo destinacijo",url:"/destinations/add",icon:"/assets/images/icon_plus.png"}]}searchDestinations(t,o){let n=t.value;o.target.name==="starting_point"?this.showStartingPointDropdown=!0:this.showEndPointDropdown=!0,this.destinationService.getDestinations(15,0,null,null,null,null,null,n).subscribe(d=>{this.startingPointList=[],this.endPointList=[];for(let _ of d.results)o.target.name==="starting_point"?this.startingPointList.push({value:_,label:_.title,additional_data:""}):this.endPointList.push({value:_,label:_.title,additional_data:""})}),this.searchTarget=o.target}searchEquipment(t,o){let n=t.value;this.showEquipmentDropdown=!0,this.roadService.getEquipment(15,0,n).subscribe(d=>{this.equipmentList=[];for(let _ of d.results)this.selectedEquipmentIds.includes(_.id)||this.equipmentList.push({value:_,label:_.title,additional_data:""})}),this.searchTarget=o.target}searchDifficulty(t,o){let n=t.value;this.showDifficultyDropdown=!0,this.roadService.getDifficulty(15,0,n).subscribe(d=>{this.difficultyList=[];for(let _ of d.results)this.difficultyList.push({value:_,label:_.title,additional_data:""})}),this.searchTarget=o.target}selectDestination(t){this.searchTarget.value=t.title,this.searchTarget.name==="starting_point"?this.selectedStartingPoint=t:this.selectedEndPoint=t,this.searchTarget=null,this.showStartingPointDropdown=!1,this.showEndPointDropdown=!1,this.startingPointList=[],this.endPointList=[]}selectEquipment(t){this.searchTarget.value="",this.searchTarget=null,this.selectedEquipmentList.push(t),this.selectedEquipmentIds.push(t.id),this.showEquipmentDropdown=!1,this.equipmentList=[]}selectDifficulty(t){this.searchTarget.value=t.title,this.selectedDifficulty=t,this.searchTarget=null,this.showDifficultyDropdown=!1,this.difficultyList=[]}deleteEquipment(t){this.selectedEquipmentList.splice(t,1),this.selectedEquipmentIds.splice(t,1)}emptyList(t,o=null){if(o&&o.relatedTarget&&!o.relatedTarget.classList.contains("dropdown-link")||!o||!o.relatedTarget)switch(t){case"difficulty":this.showDifficultyDropdown=!1,this.difficultyList=[];break;case"startingpoint":this.showStartingPointDropdown=!1,this.startingPointList=[];break;case"endpoint":this.showEndPointDropdown=!1,this.endPointList=[];break;case"equipment":this.showEquipmentDropdown=!1,this.equipmentList=[];break}}onSubmit(t){this.loader=!0,this.errorMessages=null,this.selectedStartingPoint!=null&&(t.starting_point=this.selectedStartingPoint.id),this.selectedEndPoint!=null&&(t.end_point=this.selectedEndPoint.id),this.selectedDifficulty!=null&&(t.difficulty=this.selectedDifficulty.id),this.selectedEquipmentList.length>0&&(t.recommended_equipment=[],this.selectedEquipmentList.forEach(o=>{t.recommended_equipment.push(o.id)})),(t.hours!=null&&t.hours>0||t.minutes!=null&&t.minutes>0)&&(t.hiking_time=t.minutes+t.hours*60,t.hours=null,t.minutes=null),this.id?this.roadService.updateRoad(this.id,t).subscribe(o=>{this.router.navigate(["/poti/"+o.slug])},o=>{this.loader=!1,this.scrolled=!1,this.errorMessages=o.error}):this.roadService.insertRoad(t).subscribe(o=>{this.router.navigate(["/roads/images/"+o.id])},o=>{this.loader=!1,this.scrolled=!1,this.errorMessages=o.error})}ngAfterViewChecked(){this.scrolled||this.scrollToFirstError()}scrollToFirstError(){let t=document.querySelector(".error-message");t&&(setTimeout(()=>t.scrollIntoView(!0)),setTimeout(()=>window.scrollBy(0,-60)),this.scrolled=!0)}ngOnInit(){this.roadForm=this.formBuilder.group({name:[""],starting_point:["",Wt.required],end_point:["",Wt.required],difficulty:[""],access_to_the_starting_point:["",Wt.required],desc_path:["",Wt.required],additional_tips:[""],hours:[""],minutes:[""]}),this.sub=this.route.params.subscribe(t=>{this.id=+t.id,this.id&&this.roadService.getRoad(this.id,null).subscribe(o=>{this.road=o,this.selectedStartingPoint=o.starting_point,this.selectedEndPoint=o.end_point,this.selectedEquipmentList=o.recommended_equipment,this.selectedDifficulty=o.difficulty;let n=Math.floor(o.hiking_time/60),d=o.hiking_time-n*60;this.selectedEquipmentIds=[];for(let _ in o.recommended_equipment)this.selectedEquipmentIds.push(o.recommended_equipment[_].id);this.roadForm=this.formBuilder.group({name:[this.road.name],starting_point:[this.road.starting_point.title,Wt.required],end_point:[this.road.end_point.title,Wt.required],difficulty:[this.road.difficulty!=null?this.road.difficulty.title:""],access_to_the_starting_point:[this.road.access_to_the_starting_point,Wt.required],desc_path:[this.road.desc_path,Wt.required],additional_tips:[this.road.additional_tips],hours:[n],minutes:[d]})})})}};e.\u0275fac=function(o){return new(o||e)(ae(sn),ae(Ln),ae(ro),ae(Gi),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-road-add-edit"]],standalone:!0,features:[It([Ln,sn]),gt],decls:74,vars:24,consts:[[1,"loader","center-text","margin-5",3,"ngClass"],["src","/assets/images/loader.gif"],[1,"middle","light-bg",3,"ngClass"],[3,"formGroup","ngSubmit"],["class","error-message",4,"ngIf"],[1,"col-2-padding-nonmobile"],[1,"form-field"],["formControlName","name","type","text","name","name","value","",1,"form-control"],[1,"form-group"],["formControlName","starting_point","type","text","name","starting_point","placeholder","Vnesite naziv destinacije in izberite destinacijo iz seznama ali dodajte novo.",1,"form-control",3,"blur","focus","keyup"],[3,"links","values","categories","onSelect",4,"ngIf"],["formControlName","end_point","type","text","name","end_point","placeholder","Vnesite naziv destinacije in izberite destinacijo iz seznama ali dodajte novo.",1,"form-control",3,"blur","focus","keyup"],[1,"form-inline-row"],["type","number","formControlName","hours","name","hours",1,"form-control"],[1,"form-inline-row-unit"],["type","number","formControlName","minutes","name","minutes",1,"form-control"],["formControlName","difficulty","type","text","name","difficulty","placeholder","Izberite te\u017Eavnost iz seznama.",1,"form-control",3,"blur","focus","keyup"],[3,"values","categories","onSelect",4,"ngIf"],["class","info-message margin-5-top",4,"ngIf"],["type","text","placeholder","Izberite opremo iz seznama.",1,"form-control",3,"blur","focus","keyup"],["class","form-chip-list",4,"ngIf"],["placeholder",`Pri opisu za dostop do izhodi\u0161\u010Da upo\u0161tevajte naslednje smernice:
1327            - opi\u0161ite pot od ve\u010Djega, bolj znanega kraja do izhodi\u0161\u010Da,
1328            - opis naj bo objektiven, vsebuje naj le navodila kako priti od to\u010Dke A do to\u010Dke B.`,"formControlName","access_to_the_starting_point","name","access_to_the_starting_point","id","road-access-to-the-starting-point",1,"form-control","editor-sm"],["placeholder",`Pri opisu poti upo\u0161tevajte naslednje smernice:
1329            - opi\u0161ite pot od izhodi\u0161\u010Da do cilja,
1330            - opis naj bo objektiven, vsebuje naj le navodila kako priti od to\u010Dke A do to\u010Dke B,
1331            - v opisu upo\u0161tevajte vse razcepe, predvsem tiste kjer je la\u017Eje zaiti.`,"formControlName","desc_path","name","desc_path","i
1331d","road-desc-path",1,"form-control","editor-sm"],["formControlName","additional_tips","name","additional_tips","id","road-additional-tips",1,"form-control","editor-xs"],["type","submit",1,"btn","btn-sm","btn-primary","float-right"],[1,"clearfix"],[1,"error-message"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"links","values","categories","onSelect"],[3,"values","categories","onSelect"],[1,"info-message","margin-5-top"],[1,"form-chip-list"],["type","button","class","form-chip",3,"click",4,"ngFor","ngForOf"],["type","button",1,"form-chip",3,"click"],[1,"form-chip-remove"]],template:function(o,n){o&1&&(S(0,"div",0),Z(1,"img",1),E(),S(2,"div",2)(3,"form",3),se("ngSubmit",function(){return n.onSubmit(n.roadForm.value)}),Z(4,"br"),S(5,"h2"),A(6,"Vnos nove poti"),E(),ce(7,Nte,5,2,"div",4),S(8,"div",5)(9,"div",6)(10,"label"),A(11,"Naziv (neobvezno)"),E(),Z(12,"input",7),ce(13,zte,2,1,"div",4),E(),S(14,"div",6)(15,"label"),A(16,"Izhodi\u0161\u010De"),E(),S(17,"div",8)(18,"input",9),se("blur",function(_){return n.emptyList("startingpoint",_)})("focus",function(_){return n.searchDestinations("",_)})("keyup",function(_){return n.searchDestinations(_.target,_)}),E(),ce(19,jte,1,3,"app-dropdown",10)(20,Vte,2,1,"div",4),E()(),S(21,"div",6)(22,"label"),A(23,"Cilj"),E(),S(24,"div",8)(25,"input",11),se("blur",function(_){return n.emptyList("endpoint",_)})("focus",function(_){return n.searchDestinations("",_)})("keyup",function(_){return n.searchDestinations(_.target,_)}),E(),ce(26,Bte,1,3,"app-dropdown",10)(27,Ute,2,1,"div",4),E()(),S(28,"div",6)(29,"label"),A(30,"\u010Cas hoje"),E(),S(31,"div",12),Z(32,"input",13),S(33,"span",14),A(34,"ur"),E(),Z(35,"input",15),S(36,"span",14),A(37,"minut"),E()(),ce(38,Hte,2,1,"div",4),E(),S(39,"div",6)(40,"label"),A(41,"Te\u017Eavnost"),E(),S(42,"div",8)(43,"input",16),se("blur",function(){return n.emptyList("difficulty")})("focus",function(_){return n.searchDifficulty("",_)})("keyup",function(_){return n.searchDifficulty(_.target,_)}),E(),ce(44,$te,1,2,"app-dropdown",17)(45,Gte,2,1,"div",4)(46,qte,2,1,"div",18),E()(),S(47,"div",6)(48,"label"),A(49,"Priporo\u010Dena oprema"),E(),S(50,"div",8)(51,"input",19),se("blur",function(){return n.emptyList("equipment")})("focus",function(_){return n.searchEquipment("",_)})("keyup",function(_){return n.searchEquipment(_.target,_)}),E(),ce(52,Wte,1,2,"app-dropdown",17)(53,Zte,2,1,"div",4),E(),ce(54,Xte,2,1,"div",20),E()(),S(55,"div",5)(56,"div",6)(57,"label"),A(58,"Dostop do izhodi\u0161\u010Da"),E(),Z(59,"textarea",21),ce(60,Yte,2,1,"div",4),E(),S(61,"div",6)(62,"label"),A(63,"Opis poti"),E(),Z(64,"textarea",22),ce(65,Qte,2,1,"div",4),E(),S(66,"div",6)(67,"label"),A(68,"Dodatni nasvet"),E(),Z(69,"textarea",23),ce(70,Jte,2,1,"div",4),E()(),S(71,"button",24),A(72),E(),Z(73,"div",25),E()()),o&2&&(N("ngClass",kt(20,rz,!n.loader)),P(2),N("ngClass",kt(22,rz,n.loader)),P(1),N("formGroup",n.roadForm),P(4),N("ngIf",n.errorMessages!==void 0&&((n.errorMessages==null?null:n.errorMessages.non_field_errors)!==void 0||(n.errorMessages==null?null:n.errorMessages.detail)!==void 0)),P(6),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.name)!==void 0),P(6),N("ngIf",n.showStartingPointDropdown),P(1),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.starting_point)!==void 0),P(6),N("ngIf",n.showEndPointDropdown),P(1),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.end_point)!==void 0),P(11),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.hiking_time)!==void 0),P(6),N("ngIf",n.showDifficultyDropdown),P(1),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.difficulty)!==void 0),P(1),N("ngIf",n.selectedDifficulty),P(6),N("ngIf",n.showEquipmentDropdown),P(1),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.recommended_equipment)!==void 0),P(1),N("ngIf",n.selectedEquipmentList==null?null:n.selectedEquipmentList.length),P(6),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.access_to_the_starting_point)!==void 0),P(5),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.desc_path)!==void 0),P(5),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.additional_tips)!==void 0),P(2),mt(n.road!==void 0?"Shrani":"Shrani in dodaj slike"))},dependencies:[Nr,no,Fr,G_,to,io,oo,qr,Wr,Dt,on,ti,At,yu]});let i=e;return i})();var So=(i,e)=>{let r=_t(Ti),t=_t(si);return r.is_authenticated()?!0:(t.navigate(["login",e.url]),!1)};var Sl=(()=>{let e=class e{constructor(t){this.http=t}upload(t,o){let n=new Yd("POST",o,t,{headers:new Qn({"Content-Type":"empty"})});return this.http.request(n)}setMain(t){return this.http.put(t,null)}saveFileAdditional(t,o){return this.http.put(o,t)}removeFile(t){return this.http.delete(t)}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var eie=20,oz=(()=>{let e=class e{constructor(t,o,n){this._ngZone=t,this._platform=o,this._scrolled=new Jt,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=n}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){let o=this.scrollContainers.get(t);o&&(o.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=eie){return this._platform.isBrowser?new gi(o=>{this._globalSubscription||this._addGlobalListener();let n=t>0?this._scrolled.pipe(yy(t)).subscribe(o):this._scrolled.subscribe(o);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):Bt()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEac
1331h((t,o)=>this.deregister(o)),this._scrolled.complete()}ancestorScrolled(t,o){let n=this.getAncestorScrollContainers(t);return this.scrolled(o).pipe(dn(d=>!d||n.indexOf(d)>-1))}getAncestorScrollContainers(t){let o=[];return this.scrollContainers.forEach((n,d)=>{this._scrollableContainsElement(d,t)&&o.push(d)}),o}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,o){let n=vr(o),d=t.getElementRef().nativeElement;do if(n==d)return!0;while(n=n.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>{let t=this._getWindow();return Yc(t.document,"scroll").subscribe(()=>this._scrolled.next())})}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}};e.\u0275fac=function(o){return new(o||e)(Ve(qt),Ve(ia),Ve($i,8))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var tie=20,sz=(()=>{let e=class e{constructor(t,o,n){this._platform=t,this._change=new Jt,this._changeListener=d=>{this._change.next(d)},this._document=n,o.runOutsideAngular(()=>{if(t.isBrowser){let d=this._getWindow();d.addEventListener("resize",this._changeListener),d.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){let t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){let t=this.getViewportScrollPosition(),{width:o,height:n}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+n,right:t.left+o,height:n,width:o}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let t=this._document,o=this._getWindow(),n=t.documentElement,d=n.getBoundingClientRect(),_=-d.top||t.body.scrollTop||o.scrollY||n.scrollTop||0,C=-d.left||t.body.scrollLeft||o.scrollX||n.scrollLeft||0;return{top:_,left:C}}change(t=tie){return t>0?this._change.pipe(yy(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}};e.\u0275fac=function(o){return new(o||e)(Ve(ia),Ve(qt),Ve($i,8))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var az=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({});let i=e;return i})();function zD(i,e,r){for(let t in e)if(e.hasOwnProperty(t)){let o=e[t];o?i.setProperty(t,o,r?.has(t)?"important":""):i.removeProperty(t)}return i}function Wf(i,e){let r=e?"":"none";zD(i.style,{"touch-action":e?"":"none","-webkit-user-drag":e?"":"none","-webkit-tap-highlight-color":e?"":"transparent","user-select":r,"-ms-user-select":r,"-webkit-user-select":r,"-moz-user-select":r})}function lz(i,e,r){zD(i.style,{position:e?"":"fixed",top:e?"":"0",opacity:e?"":"0",left:e?"":"-999em"},r)}function k1(i,e){return e&&e!="none"?i+" "+e:i}function cz(i){let e=i.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(i)*e}function nie(i){let e=getComputedStyle(i),r=AD(e,"transition-property"),t=r.find(_=>_==="transform"||_==="all");if(!t)return 0;let o=r.indexOf(t),n=AD(e,"transition-duration"),d=AD(e,"transition-delay");return cz(n[o])+cz(d[o])}function AD(i,e){return i.getPropertyValue(e).split(",").map(t=>t.trim())}function jD(i){let e=i.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height,x:e.x,y:e.y}}function OD(i,e,r){let{top:t,bottom:o,left:n,right:d}=i;return r>=t&&r<=o&&e>=n&&e<=d}function v0(i,e,r){i.top+=e,i.bottom=i.top+i.height,i.left+=r,i.right=i.left+i.width}function uz(i,e,r,t){let{top:o,right:n,bottom:d,left:_,width:C,height:M}=i,j=C*e,G=M*e;return t>o-G&&t<d+G&&r>_-j&&r<n+j}var A1=class{constructor(e){this._document=e,this.positions=new Map}clear(){this.positions.clear()}cache(e){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),e.forEach(r=>{this.positions.set(r,{scrollPosition:{top:r.scrollTop,left:r.scrollLeft},clientRect:jD(r)})})}handleScroll(e){let r=Ds(e),t=this.positions.get(r);if(!t)return null;let o=t.scrollPosition,n,d;if(r===this._document){let M=this.getViewportScrollPosition();n=M.top,d=M.left}else n=r.scrollTop,d=r.scrollLeft;let _=o.top-n,C=o.left-d;return this.positions.forEach((M,j)=>{M.clientRect&&r!==j&&r.contains(j)&&v0(M.clientRect,_,C)}
1331),o.top=n,o.left=d,{top:_,left:C}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function dz(i){let e=i.cloneNode(!0),r=e.querySelectorAll("[id]"),t=i.nodeName.toLowerCase();e.removeAttribute("id");for(let o=0;o<r.length;o++)r[o].removeAttribute("id");return t==="canvas"?fz(i,e):(t==="input"||t==="select"||t==="textarea")&&pz(i,e),hz("canvas",i,e,fz),hz("input, textarea, select",i,e,pz),e}function hz(i,e,r,t){let o=e.querySelectorAll(i);if(o.length){let n=r.querySelectorAll(i);for(let d=0;d<o.length;d++)t(o[d],n[d])}}var rie=0;function pz(i,e){e.type!=="file"&&(e.value=i.value),e.type==="radio"&&e.name&&(e.name=`mat-clone-${e.name}-${rie++}`)}function fz(i,e){let r=e.getContext("2d");if(r)try{r.drawImage(i,0,0)}catch{}}var mz=El({passive:!0}),I1=El({passive:!1}),oie=800,PD=new Set(["position"]),RD=class{get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(e){e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(r=>Wf(r,e)))}constructor(e,r,t,o,n,d){this._config=r,this._document=t,this._ngZone=o,this._viewportRuler=n,this._dragDropRegistry=d,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._hasStartedDragging=!1,this._moveEvents=new Jt,this._pointerMoveSubscription=pn.EMPTY,this._pointerUpSubscription=pn.EMPTY,this._scrollSubscription=pn.EMPTY,this._resizeSubscription=pn.EMPTY,this._boundaryElement=null,this._nativeInteractionsEnabled=!0,this._handles=[],this._disabledHandles=new Set,this._direction="ltr",this.dragStartDelay=0,this._disabled=!1,this.beforeStarted=new Jt,this.started=new Jt,this.released=new Jt,this.ended=new Jt,this.entered=new Jt,this.exited=new Jt,this.dropped=new Jt,this.moved=this._moveEvents,this._pointerDown=_=>{if(this.beforeStarted.next(),this._handles.length){let C=this._getTargetHandle(_);C&&!this._disabledHandles.has(C)&&!this.disabled&&this._initializeDragSequence(C,_)}else this.disabled||this._initializeDragSequence(this._rootElement,_)},this._pointerMove=_=>{let C=this._getPointerPositionOnPage(_);if(!this._hasStartedDragging){let j=Math.abs(C.x-this._pickupPositionOnPage.x),G=Math.abs(C.y-this._pickupPositionOnPage.y);if(j+G>=this._config.dragStartThreshold){let _e=Date.now()>=this._dragStartTime+this._getDragStartDelay(_),Ee=this._dropContainer;if(!_e){this._endDragSequence(_);return}(!Ee||!Ee.isDragging()&&!Ee.isReceiving())&&(_.preventDefault(),this._hasStartedDragging=!0,this._ngZone.run(()=>this._startDragSequence(_)))}return}_.preventDefault();let M=this._getConstrainedPointerPosition(C);if(this._hasMoved=!0,this._lastKnownPointerPosition=C,this._updatePointerDirectionDelta(M),this._dropContainer)this._updateActiveDropContainer(M,C);else{let j=this.constrainPosition?this._initialClientRect:this._pickupPositionOnPage,G=this._activeTransform;G.x=M.x-j.x+this._passiveTransform.x,G.y=M.y-j.y+this._passiveTransform.y,this._applyRootElementTransform(G.x,G.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:M,event:_,distance:this._getDragDistance(M),delta:this._pointerDirectionDelta})})},this._pointerUp=_=>{this._endDragSequence(_)},this._nativeDragStart=_=>{if(this._handles.length){let C=this._getTargetHandle(_);C&&!this._disabledHandles.has(C)&&!this.disabled&&_.preventDefault()}else this.disabled||_.preventDefault()},this.withRootElement(e).withParent(r.parentDragRef||null),this._parentPositions=new A1(t),d.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(t=>vr(t)),this._handles.forEach(t=>Wf(t,this.disabled)),this._toggleNativeDragInteractions();let r=new Set;return this._disabledHandles.forEach(t=>{this._handles.indexOf(t)>-1&&r.add(t)}),this._disabledHandles=r,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){let r=vr(e);return r!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(()=>{r.addEventListener("mousedown",this._pointerDown,I1),r.addEventListener("touchstart",this._pointerDown,mz),r.addEventListener("dragstart",this._nativeDragStart,I1)}),this._initialTransform=void 0,this._rootElement=r),typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?vr(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&this._rootElement?.remove(),this._anchor?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeSubscriptions(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._anchor=this._parentDragRef=null}isDragging(){return this._hasStartedDragging&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),Wf(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),Wf(e,this.disabled))}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){let e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}withPreviewContainer(e){return this._previewContainer=e,this}_sortFromLastPointerPosition(){let e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){this._preview?.remove(),this._previewRef?.destroy(),this._preview=this._previewRef=null}
vendor: 7,830 bytes, line 1331
1331_destroyPlaceholder(){this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(e){if(this._dragDropRegistry.isDragging(this)&&(this._removeSubscriptions(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging))if(this.released.next({source:this,event:e}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let r=this._getPointerPositionOnPage(e);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(r),dropPoint:r,event:e})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(e){_0(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let r=this._dropContainer;if(r){let t=this._rootElement,o=t.parentNode,n=this._placeholder=this._createPlaceholderElement(),d=this._anchor=this._anchor||this._document.createComment(""),_=this._getShadowRoot();o.insertBefore(d,t),this._initialTransform=t.style.transform||"",this._preview=this._createPreviewElement(),lz(t,!1,PD),this._document.body.appendChild(o.replaceChild(n,t)),this._getPreviewInsertionPoint(o,_).appendChild(this._preview),this.started.next({source:this,event:e}),r.start(),this._initialContainer=r,this._initialIndex=r.getItemIndex(this)}else this.started.next({source:this,event:e}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(r?r.getScrollableParents():[])}_initializeDragSequence(e,r){this._parentDragRef&&r.stopPropagation();let t=this.isDragging(),o=_0(r),n=!o&&r.button!==0,d=this._rootElement,_=Ds(r),C=!o&&this._lastTouchEventTime&&this._lastTouchEventTime+oie>Date.now(),M=o?u0(r):c0(r);if(_&&_.draggable&&r.type==="mousedown"&&r.preventDefault(),t||n||C||M)return;if(this._handles.length){let ie=d.style;this._rootElementTapHighlight=ie.webkitTapHighlightColor||"",ie.webkitTapHighlightColor="transparent"}this._hasStartedDragging=this._hasMoved=!1,this._removeSubscriptions(),this._initialClientRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(ie=>this._updateOnScroll(ie)),this._boundaryElement&&(this._boundaryRect=jD(this._boundaryElement));let j=this._previewTemplate;this._pickupPositionInElement=j&&j.template&&!j.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialClientRect,e,r);let G=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(r);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:G.x,y:G.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,r)}_cleanupDragArtifacts(e){lz(this._rootElement,!0,PD),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._initialClientRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let r=this._dropContainer,t=r.getItemIndex(this),o=this._getPointerPositionOnPage(e),n=this._getDragDistance(o),d=r._isOverContainer(o.x,o.y);this.ended.next({source:this,distance:n,dropPoint:o,event:e}),this.dropped.next({item:this,currentIndex:t,previousIndex:this._initialIndex,container:r,previousContainer:this._initialContainer,isPointerOverContainer:d,distance:n,dropPoint:o,event:e}),r.drop(this,t,this._initialIndex,this._initialContainer,d,n,o,e),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:r},{x:t,y:o}){let n=this._initialContainer._getSiblingContainerFromPosition(this,e,r);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,r)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=n,this._dropContainer.enter(this,e,r,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(t,o),this._dropContainer._sortItem(this,e,r,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(e,r):this._applyPreviewTransform(e-this._pickupPositionInElement.x,r-this._pickupPositionInElement.y))}_createPreviewElement(){let e=this._previewTemplate,r=this.previewClass,t=e?e.template:null,o;if(t&&e){let n=e.matchSize?this._initialClientRect:null,d=e.viewContainer.createEmbeddedView(t,e.context);d.detectChanges(),o=_z(d,this._document),this._previewRef=d,e.matchSize?vz(o,n):o.style.transform=M1(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else o=dz(this._rootElement),vz(o,this._initialClientRect),this._initialTransform&&(o.style.transform=this._initialTransform);return zD(o.style,{"pointer-events":"none",margin:"0",position:"fixed",top:"0",left:"0","z-index":`${this._config.zIndex||1e3}`},PD),Wf(o,!1),o.classList.add("cdk-drag-preview"),o.setAttribute("dir",this._direction),r&&(Array.isArray(r)?r.forEach(n=>o.classList.add(n)):o.classList.add(r)),o}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let e=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._applyPreviewTransform(e.left,e.top);let r=nie(this._preview);return r===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(t=>{let o=d=>{(!d||Ds(d)===this._preview&&d.propertyName==="transform")&&(this._preview?.removeEventListener("transitionend",o),t(),clearTimeout(n))},n=setTimeout(o,r*1.5);this._preview.addEventListener("transitionend",o)}))}_createPlaceholderElement(){let e=this._placeholderTemplate,r=e?e.template:null,t;return r?(this._placeholderRef=e.viewContainer.createEmbeddedView(r,e.context),this._placeholderRef.detectChanges(),t=_z(this._placeholderRef,this._document)):t=dz(this._rootElement),t.style.pointerEvents="none",t.classList.add("cdk-drag-placeholder"),t}_getPointerPositionInElement(e,r,t){let o=r===this._rootElement?null:r,n=o?o.getBoundingClientRect():e,d=_0(t)?t.targetTouches[0]:t,_=this._getViewportScrollPosition(),C=d.pageX-n.left-_.left,M=d.pageY-n.top-_.top;return{x:n.left-e.left+C,y:n.top-e.top+M}}_getPointerPositionOnPage(e){let r=this._getViewportScrollPosition(),t=_0(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,o=t.pageX-r.left,n=t.pageY-r.top;if(this._ownerSVGElement){let d=this._ownerSVGElement.getScreenCTM();if(d){let _=this._ownerSVGElement.createSVGPoint();return _.x=o,_.y=n,_.matrixTransform(d.inverse())}}return{x:o,y:n}}_getConstrainedPointerPosition(e){let r=this._dropContainer?this._dropContainer.lockAxis:null,{x:t,y:o}=this.constrainPosition?this.constrainPosition(e,this,this._initialClientRect,this._pickupPositionInElement):e;if(this.lockAxis==="x"||r==="x"?o=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||r==="y")&&(t=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:d}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,_=this._boundaryRect,{width:C,height:M}=this._getPreviewRect(),j=_.top+d,G=_.bottom-(M-d),ie=_.left+n,_e=_.right-(C-n);
1331t=gz(t,ie,_e),o=gz(o,j,G)}return{x:t,y:o}}_updatePointerDirectionDelta(e){let{x:r,y:t}=e,o=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,d=Math.abs(r-n.x),_=Math.abs(t-n.y);return d>this._config.pointerDirectionChangeThreshold&&(o.x=r>n.x?1:-1,n.x=r),_>this._config.pointerDirectionChangeThreshold&&(o.y=t>n.y?1:-1,n.y=t),o}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,Wf(this._rootElement,e))}_removeRootElementListeners(e){e.removeEventListener("mousedown",this._pointerDown,I1),e.removeEventListener("touchstart",this._pointerDown,mz),e.removeEventListener("dragstart",this._nativeDragStart,I1)}_applyRootElementTransform(e,r){let t=M1(e,r),o=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=o.transform&&o.transform!="none"?o.transform:""),o.transform=k1(t,this._initialTransform)}_applyPreviewTransform(e,r){let t=this._previewTemplate?.template?void 0:this._initialTransform,o=M1(e,r);this._preview.style.transform=k1(o,t)}_getDragDistance(e){let r=this._pickupPositionOnPage;return r?{x:e.x-r.x,y:e.y-r.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:e,y:r}=this._passiveTransform;if(e===0&&r===0||this.isDragging()||!this._boundaryElement)return;let t=this._rootElement.getBoundingClientRect(),o=this._boundaryElement.getBoundingClientRect();if(o.width===0&&o.height===0||t.width===0&&t.height===0)return;let n=o.left-t.left,d=t.right-o.right,_=o.top-t.top,C=t.bottom-o.bottom;o.width>t.width?(n>0&&(e+=n),d>0&&(e-=d)):e=0,o.height>t.height?(_>0&&(r+=_),C>0&&(r-=C)):r=0,(e!==this._passiveTransform.x||r!==this._passiveTransform.y)&&this.setFreeDragPosition({y:r,x:e})}_getDragStartDelay(e){let r=this.dragStartDelay;return typeof r=="number"?r:_0(e)?r.touch:r?r.mouse:0}_updateOnScroll(e){let r=this._parentPositions.handleScroll(e);if(r){let t=Ds(e);this._boundaryRect&&t!==this._boundaryElement&&t.contains(this._boundaryElement)&&v0(this._boundaryRect,r.top,r.left),this._pickupPositionOnPage.x+=r.left,this._pickupPositionOnPage.y+=r.top,this._dropContainer||(this._activeTransform.x-=r.left,this._activeTransform.y-=r.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=s0(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(e,r){let t=this._previewContainer||"global";if(t==="parent")return e;if(t==="global"){let o=this._document;return r||o.fullscreenElement||o.webkitFullscreenElement||o.mozFullScreenElement||o.msFullscreenElement||o.body}return vr(t)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialClientRect),this._previewRect}_getTargetHandle(e){return this._handles.find(r=>e.target&&(e.target===r||r.contains(e.target)))}};function M1(i,e){return`translate3d(${Math.round(i)}px, ${Math.round(e)}px, 0)`}function gz(i,e,r){return Math.max(e,Math.min(r,i))}function _0(i){return i.type[0]==="t"}function _z(i,e){let r=i.rootNodes;if(r.length===1&&r[0].nodeType===e.ELEMENT_NODE)return r[0];let t=e.createElement("div");return r.forEach(o=>t.appendChild(o)),t}function vz(i,e){i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,i.style.transform=M1(e.left,e.top)}function sie(i,e,r){let t=yz(e,i.length-1),o=yz(r,i.length-1);if(t===o)return;let n=i[t],d=o<t?-1:1;for(let _=t;_!==o;_+=d)i[_]=i[_+d];i[o]=n}function yz(i,e){return Math.max(0,Math.min(e,i))}var LD=class{constructor(e,r){this._element=e,this._dragDropRegistry=r,this._itemPositions=[],this.orientation="vertical",this._previousSwap={drag:null,delta:0,overlaps:!1}}start(e){this.withItems(e)}sort(e,r,t,o){let n=this._itemPositions,d=this._getItemIndexFromPointerPosition(e,r,t,o);if(d===-1&&n.length>0)return null;let _=this.orientation==="horizontal",C=n.findIndex($e=>$e.drag===e),M=n[d],j=n[C].clientRect,G=M.clientRect,ie=C>d?1:-1,_e=this._getItemOffsetPx(j,G,ie),Ee=this._getSiblingOffsetPx(C,n,ie),Ye=n.slice();
1331return sie(n,C,d),n.forEach(($e,at)=>{if(Ye[at]===$e)return;let Lt=$e.drag===e,jt=Lt?_e:Ee,$t=Lt?e.getPlaceholderElement():$e.drag.getRootElement();$e.offset+=jt,_?($t.style.transform=k1(`translate3d(${Math.round($e.offset)}px, 0, 0)`,$e.initialTransform),v0($e.clientRect,0,jt)):($t.style.transform=k1(`translate3d(0, ${Math.round($e.offset)}px, 0)`,$e.initialTransform),v0($e.clientRect,jt,0))}),this._previousSwap.overlaps=OD(G,r,t),this._previousSwap.drag=M.drag,this._previousSwap.delta=_?o.x:o.y,{previousIndex:C,currentIndex:d}}enter(e,r,t,o){let n=o==null||o<0?this._getItemIndexFromPointerPosition(e,r,t):o,d=this._activeDraggables,_=d.indexOf(e),C=e.getPlaceholderElement(),M=d[n];if(M===e&&(M=d[n+1]),!M&&(n==null||n===-1||n<d.length-1)&&this._shouldEnterAsFirstChild(r,t)&&(M=d[0]),_>-1&&d.splice(_,1),M&&!this._dragDropRegistry.isDragging(M)){let j=M.getRootElement();j.parentElement.insertBefore(C,j),d.splice(n,0,e)}else vr(this._element).appendChild(C),d.push(e);C.style.transform="",this._cacheItemPositions()}withItems(e){this._activeDraggables=e.slice(),this._cacheItemPositions()}withSortPredicate(e){this._sortPredicate=e}reset(){this._activeDraggables.forEach(e=>{let r=e.getRootElement();if(r){let t=this._itemPositions.find(o=>o.drag===e)?.initialTransform;r.style.transform=t||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(e){return(this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions).findIndex(t=>t.drag===e)}updateOnScroll(e,r){this._itemPositions.forEach(({clientRect:t})=>{v0(t,e,r)}),this._itemPositions.forEach(({drag:t})=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}_cacheItemPositions(){let e=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(r=>{let t=r.getVisibleElement();return{drag:r,offset:0,initialTransform:t.style.transform||"",clientRect:jD(t)}}).sort((r,t)=>e?r.clientRect.left-t.clientRect.left:r.clientRect.top-t.clientRect.top)}_getItemOffsetPx(e,r,t){let o=this.orientation==="horizontal",n=o?r.left-e.left:r.top-e.top;return t===-1&&(n+=o?r.width-e.width:r.height-e.height),n}_getSiblingOffsetPx(e,r,t){let o=this.orientation==="horizontal",n=r[e].clientRect,d=r[e+t*-1],_=n[o?"width":"height"]*t;if(d){let C=o?"left":"top",M=o?"right":"bottom";t===-1?_-=d.clientRect[C]-n[M]:_+=n[C]-d.clientRect[M]}return _}_shouldEnterAsFirstChild(e,r){if(!this._activeDraggables.length)return!1;let t=this._itemPositions,o=this.orientation==="horizontal";if(t[0].drag!==this._activeDraggables[0]){let d=t[t.length-1].clientRect;return o?e>=d.right:r>=d.bottom}else{let d=t[0].clientRect;return o?e<=d.left:r<=d.top}}_getItemIndexFromPointerPosition(e,r,t,o){let n=this.orientation==="horizontal",d=this._itemPositions.findIndex(({drag:_,clientRect:C})=>{if(_===e)return!1;if(o){let M=n?o.x:o.y;if(_===this._previousSwap.drag&&this._previousSwap.overlaps&&M===this._previousSwap.delta)return!1}return n?r>=Math.floor(C.left)&&r<Math.floor(C.right):t>=Math.floor(C.top)&&t<Math.floor(C.bottom)});return d===-1||!this._sortPredicate(d,e)?-1:d}},bz=.05,Cz=.05,FD=class{constructor(e,r,t,o,n){this._dragDropRegistry=r,this._ngZone=o,this._viewportRuler=n,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.autoScrollStep=2,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.beforeStarted=new Jt,this.entered=new Jt,this.exited=new Jt,this.dropped=new Jt,this.sorted=new Jt,this.receivingStarted=new Jt,this.receivingStopped=new Jt,this._isDragging=!1,this._draggables=[],this._siblings=[],this._activeSiblings=new Set,this._viewportScrollSubscription=pn.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new Jt,this._cachedShadowRoot=null,this._startScrollInterval=()=>{this._stopScrolling(),AC(0,ty).pipe(es(this._stopScrollTimers)).subscribe(()=>{let d=this._scrollNode,_=this.autoScrollStep;this._verticalScrollDirection===1?d.scrollBy(0,-_):this._verticalScrollDirection===2&&d.scrollBy(0,_),this._horizontalScrollDirection===1?d.scrollBy(-_,0):this._horizontalScrollDirection===2&&d.scrollBy(_,0)})},this.element=vr(e),this._document=t,this.withScrollableParents([this.element]),r.registerDropContainer(this),this._parentPositions=new A1(t),this._sortStrategy=new LD(this.element,r),this._sortStrategy.withSortPredicate((d,_)=>this.sortPredicate(d,_,this))}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(e,r,t,o){this._draggingStarted(),o==null&&this.sortingDisabled&&(o=this._draggables.indexOf(e)),this._sortStrategy.enter(e,r,t,o),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,r,t,o,n,d,_,C={}){this._reset(),this.dropped.next({item:e,currentIndex:r,previousIndex:t,container:this,previousContainer:o,isPointerOverContainer:n,distance:d,dropPoint:_,event:C})}withItems(e){let r=this._draggables;return this._draggables=e,e.forEach(t=>t._withDropContainer(this)),this.isDragging()&&(r.filter(o=>o.isDragging()).every(o=>e.indexOf(o)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(e){return this._sortStrategy.direction=e,this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){return this._sortStrategy.orientation=e,this}withScrollableParents(e){let r=vr(this.element);return this._scrollableElements=e.indexOf(r)===-1?[r,...e]:e.slice(),this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?this._sortStrategy.getItemIndex(e):this._draggables.indexOf(e)}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,r,t,o){if(this.sortingDisabled||!this._clientRect||!uz(this._clientRect,bz,r,t))return;let n=this._sortStrategy.sort(e,r,t,o);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:e})}_startScrollingIfNecessary(e,r){if(this.autoScrollDisabled)return;let t,o=0,n=0;if(this._parentPositions.positions.forEach((d,_)=>{_===this._document||!d.clientRect||t||uz(d.clientRect,bz,e,r)&&([o,n]=aie(_,d.clientRect,e,r),(o||n)&&(t=_))}),!o&&!n){let{width:d,height:_}=this._viewportRuler.getViewportSize(),C={width:d,height:_,top:0,right:d,bottom:_,left:0};o=Ez(C,r),n=Sz(C,e),t=window}t&&(o!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||t!==this._scrollNode)&&(this._verticalScrollDirection=o,this._horizontalScrollDirection=n,this._scrollNode=t,(o||n)&&t?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let e=vr(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){let e=vr(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(e).
1331clientRect}_reset(){this._isDragging=!1;let e=vr(this.element).style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(r=>r._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_isOverContainer(e,r){return this._clientRect!=null&&OD(this._clientRect,e,r)}_getSiblingContainerFromPosition(e,r,t){return this._siblings.find(o=>o._canReceive(e,r,t))}_canReceive(e,r,t){if(!this._clientRect||!OD(this._clientRect,r,t)||!this.enterPredicate(e,this))return!1;let o=this._getShadowRoot().elementFromPoint(r,t);if(!o)return!1;let n=vr(this.element);return o===n||n.contains(o)}_startReceiving(e,r){let t=this._activeSiblings;!t.has(e)&&r.every(o=>this.enterPredicate(o,this)||this._draggables.indexOf(o)>-1)&&(t.add(e),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:e,receiver:this,items:r}))}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:e,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(e=>{if(this.isDragging()){let r=this._parentPositions.handleScroll(e);r&&this._sortStrategy.updateOnScroll(r.top,r.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let e=s0(vr(this.element));this._cachedShadowRoot=e||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let e=this._sortStrategy.getActiveItemsSnapshot().filter(r=>r.isDragging());this._siblings.forEach(r=>r._startReceiving(this,e))}};function Ez(i,e){let{top:r,bottom:t,height:o}=i,n=o*Cz;return e>=r-n&&e<=r+n?1:e>=t-n&&e<=t+n?2:0}function Sz(i,e){let{left:r,right:t,width:o}=i,n=o*Cz;return e>=r-n&&e<=r+n?1:e>=t-n&&e<=t+n?2:0}function aie(i,e,r,t){let o=Ez(e,t),n=Sz(e,r),d=0,_=0;if(o){let C=i.scrollTop;o===1?C>0&&(d=1):i.scrollHeight-C>i.clientHeight&&(d=2)}if(n){let C=i.scrollLeft;n===1?C>0&&(_=1):i.scrollWidth-C>i.clientWidth&&(_=2)}return[d,_]}var D1=El({passive:!1,capture:!0}),lie=(()=>{let e=class e{constructor(t,o){this._ngZone=t,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=[],this._globalListeners=new Map,this._draggingPredicate=n=>n.isDragging(),this.pointerMove=new Jt,this.pointerUp=new Jt,this.scroll=new Jt,this._preventDefaultWhileDragging=n=>{this._activeDragInstances.length>0&&n.preventDefault()},this._persistentTouchmoveListener=n=>{this._activeDragInstances.length>0&&(this._activeDragInstances.some(this._draggingPredicate)&&n.preventDefault(),this.pointerMove.next(n))},this._document=o}registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t)}registerDragItem(t){this._dragInstances.add(t),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._document.addEventListener("touchmove",this._persistentTouchmoveListener,D1)})}removeDropContainer(t){this._dropInstances.delete(t)}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),this._dragInstances.size===0&&this._document.removeEventListener("touchmove",this._persistentTouchmoveListener,D1)}startDragging(t,o){if(!(this._activeDragInstances.indexOf(t)>-1)&&(this._activeDragInstances.push(t),this._activeDragInstances.length===1)){let n=o.type.startsWith("touch");this._globalListeners.set(n?"touchend":"mouseup",{handler:d=>this.pointerUp.next(d),options:!0}).set("scroll",{handler:d=>this.scroll.next(d),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:D1}),n||this._globalListeners.set("mousemove",{handler:d=>this.pointerMove.next(d),options:D1}),this._ngZone.runOutsideAngular(()=>{this._globalListeners.forEach((d,_)=>{this._document.addEventListener(_,d.handler,d.options)})})}}stopDragging(t){let o=this._activeDragInstances.indexOf(t);o>-1&&(this._activeDragInstances.splice(o,1),this._activeDragInstances.length===0&&this._clearGlobalListeners())}isDragging(t){return this._activeDragInstances.indexOf(t)>-1}scrolled(t){let o=[this.scroll];return t&&t!==this._document&&o.push(new gi(n=>this._ngZone.runOutsideAngular(()=>{let _=C=>{this._activeDragInstances.length&&n.next(C)};return t.addEventListener("scroll",_,!0),()=>{t.removeEventListener("scroll",_,!0)}}))),Dp(...o)}
1331ngOnDestroy(){this._dragInstances.forEach(t=>this.removeDragItem(t)),this._dropInstances.forEach(t=>this.removeDropContainer(t)),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach((t,o)=>{this._document.removeEventListener(o,t.handler,t.options)}),this._globalListeners.clear()}};e.\u0275fac=function(o){return new(o||e)(Ve(qt),Ve($i))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),cie={dragStartThreshold:5,pointerDirectionChangeThreshold:5},VD=(()=>{let e=class e{constructor(t,o,n,d){this._document=t,this._ngZone=o,this._viewportRuler=n,this._dragDropRegistry=d}createDrag(t,o=cie){return new RD(t,o,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(t){return new FD(t,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}};e.\u0275fac=function(o){return new(o||e)(Ve($i),Ve(qt),Ve(sz),Ve(lie))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),xz=new Ct("CDK_DRAG_PARENT");var wz=new Ct("CdkDragHandle");var uie=new Ct("CdkDragPlaceholder");var die=new Ct("CdkDragPreview");var Tz=new Ct("CDK_DRAG_CONFIG"),hie="cdk-drag",Iz=new Ct("CdkDropList"),Dz=(()=>{let e=class e{get disabled(){return this._disabled||this.dropContainer&&this.dropContainer.disabled}set disabled(t){this._disabled=t,this._dragRef.disabled=this._disabled}constructor(t,o,n,d,_,C,M,j,G,ie,_e){this.element=t,this.dropContainer=o,this._ngZone=d,this._viewContainerRef=_,this._dir=M,this._changeDetectorRef=G,this._selfHandle=ie,this._parentDrag=_e,this._destroyed=new Jt,this.started=new Fe,this.released=new Fe,this.ended=new Fe,this.entered=new Fe,this.exited=new Fe,this.dropped=new Fe,this.moved=new gi(Ee=>{let Ye=this._dragRef.moved.pipe(ei($e=>({source:this,pointerPosition:$e.pointerPosition,event:$e.event,delta:$e.delta,distance:$e.distance}))).subscribe(Ee);return()=>{Ye.unsubscribe()}}),this._dragRef=j.createDrag(t,{dragStartThreshold:C&&C.dragStartThreshold!=null?C.dragStartThreshold:5,pointerDirectionChangeThreshold:C&&C.pointerDirectionChangeThreshold!=null?C.pointerDirectionChangeThreshold:5,zIndex:C?.zIndex}),this._dragRef.data=this,e._dragInstances.push(this),C&&this._assignDefaults(C),o&&(this._dragRef._withDropContainer(o._dropListRef),o.addItem(this)),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(t){this._dragRef.setFreeDragPosition(t)}ngAfterViewInit(){this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Ur(1),es(this._destroyed)).subscribe(()=>{this._updateRootElement(),this._setupHandlesListener(),this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)})})}ngOnChanges(t){let o=t.rootElementSelector,n=t.freeDragPosition;o&&!o.firstChange&&this._updateRootElement(),n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this);let t=e._dragInstances.indexOf(this);t>-1&&e._dragInstances.splice(t,1),this._ngZone.runOutsideAngular(()=>{this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_updateRootElement(){let t=this.element.nativeElement,o=t;this.rootElementSelector&&(o=t.closest!==void 0?t.closest(this.rootElementSelector):t.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(o||t)}_getBoundaryElement(){let t=this.boundaryElement;return t?typeof t=="string"?this.element.nativeElement.closest(t):vr(t):null}_syncInputs(t){t.beforeStarted.subscribe(()=>{if(!t.isDragging()){let o=this._dir,n=this.dragStartDelay,d=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,_=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.dragStartDelay=typeof n=="object"&&n?n:a0(n),t.constrainPosition=this.constrainPosition,t.previewClass=this.previewClass,t.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(d).withPreviewTemplate(_).withPreviewContainer(this.previewContainer||"global"),o&&t.withDirection(o.value)}}),t.beforeStarted.pipe(Ur(1)).subscribe(()=>{if(this._parentDrag){t.withParent(this._parentDrag._dragRef);return}let o=this.element.nativeElement.parentElement;for(;o;){if(o.classList.contains(hie)){t.withParent(e._dragInstances.find(n=>n.element.nativeElement===o)?._dragRef||null);break}o=o.parentElement}})}_handleEvents(t){t.started.subscribe(o=>{this.started.emit({source:this,event:o.event}),this._changeDetectorRef.markForCheck()}),t.released.subscribe(o=>
1331{this.released.emit({source:this,event:o.event})}),t.ended.subscribe(o=>{this.ended.emit({source:this,distance:o.distance,dropPoint:o.dropPoint,event:o.event}),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(o=>{this.entered.emit({container:o.container.data,item:this,currentIndex:o.currentIndex})}),t.exited.subscribe(o=>{this.exited.emit({container:o.container.data,item:this})}),t.dropped.subscribe(o=>{this.dropped.emit({previousIndex:o.previousIndex,currentIndex:o.currentIndex,previousContainer:o.previousContainer.data,container:o.container.data,isPointerOverContainer:o.isPointerOverContainer,item:this,distance:o.distance,dropPoint:o.dropPoint,event:o.event})})}_assignDefaults(t){let{lockAxis:o,dragStartDelay:n,constrainPosition:d,previewClass:_,boundaryElement:C,draggingDisabled:M,rootElementSelector:j,previewContainer:G}=t;this.disabled=M??!1,this.dragStartDelay=n||0,o&&(this.lockAxis=o),d&&(this.constrainPosition=d),_&&(this.previewClass=_),C&&(this.boundaryElement=C),j&&(this.rootElementSelector=j),G&&(this.previewContainer=G)}_setupHandlesListener(){this._handles.changes.pipe(Bs(this._handles),Vi(t=>{let o=t.filter(n=>n._parentDrag===this).map(n=>n.element);this._selfHandle&&this.rootElementSelector&&o.push(this.element),this._dragRef.withHandles(o)}),xr(t=>Dp(...t.map(o=>o._stateChanges.pipe(Bs(o))))),es(this._destroyed)).subscribe(t=>{let o=this._dragRef,n=t.element.nativeElement;t.disabled?o.disableHandle(n):o.enableHandle(n)})}};e._dragInstances=[],e.\u0275fac=function(o){return new(o||e)(ae(Pi),ae(Iz,12),ae($i),ae(qt),ae(qs),ae(Tz,8),ae(gD,8),ae(VD),ae(Or),ae(wz,10),ae(xz,12))},e.\u0275dir=bi({type:e,selectors:[["","cdkDrag",""]],contentQueries:function(o,n,d){if(o&1&&(cu(d,die,5),cu(d,uie,5),cu(d,wz,5)),o&2){let _;Xt(_=Yt())&&(n._previewTemplate=_.first),Xt(_=Yt())&&(n._placeholderTemplate=_.first),Xt(_=Yt())&&(n._handles=_)}},hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(o,n){o&2&&Yi("cdk-drag-disabled",n.disabled)("cdk-drag-dragging",n._dragRef.isDragging())},inputs:{data:["cdkDragData","data"],lockAxis:["cdkDragLockAxis","lockAxis"],rootElementSelector:["cdkDragRootElement","rootElementSelector"],boundaryElement:["cdkDragBoundary","boundaryElement"],dragStartDelay:["cdkDragStartDelay","dragStartDelay"],freeDragPosition:["cdkDragFreeDragPosition","freeDragPosition"],disabled:["cdkDragDisabled","disabled",Rr],constrainPosition:["cdkDragConstrainPosition","constrainPosition"],previewClass:["cdkDragPreviewClass","previewClass"],previewContainer:["cdkDragPreviewContainer","previewContainer"]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],standalone:!0,features:[It([{provide:xz,useExisting:e}]),$s,hn]});let i=e;return i})(),ND=new Ct("CdkDropListGroup"),Mz=(()=>{let e=class e{constructor(){this._items=new Set,this.disabled=!1}ngOnDestroy(){this._items.clear()}};e.\u0275fac=function(o){return new(o||e)},e.\u0275dir=bi({type:e,selectors:[["","cdkDropListGroup",""]],inputs:{disabled:["cdkDropListGroupDisabled","disabled",Rr]},exportAs:["cdkDropListGroup"],standalone:!0,features:[It([{provide:ND,useExisting:e}]),$s]});let i=e;return i})(),pie=0,kz=(()=>{let e=class e{get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=t}constructor(t,o,n,d,_,C,M){this.element=t,this._changeDetectorRef=n,this._scrollDispatcher=d,this._dir=_,this._group=C,this._destroyed=new Jt,this.connectedTo=[],this.id=`cdk-drop-list-${pie++}`,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.dropped=new Fe,this.entered=new Fe,this.exited=new Fe,this.sorted=new Fe,this._unsortedItems=new Set,this._dropListRef=o.createDropList(t),this._dropListRef.data=this,M&&this._assignDefaults(M),this._dropListRef.enterPredicate=(j,G)=>this.enterPredicate(j.data,G.data),this._dropListRef.sortPredicate=(j,G,ie)=>this.sortPredicate(j,G.data,ie.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),e._dropLists.push(this),C&&C._items.add(this)}addItem(t){this._unsortedItems.add(t),this._dropListRef.isDragging()&&this._syncItemsWithRef()}removeItem(t){this._unsortedItems.delete(t),this._dropListRef.isDragging()&&this._syncItemsWithRef()}getSortedItems(){return Array.from(this._unsortedItems).sort((t,o)=>t._dragRef.getVisibleElement().compareDocumentPosition(o._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let t=e._dropLists.indexOf(this);t>-1&&e._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(t){this._dir&&this._dir.change.pipe(Bs(this._dir.value),es(this._destroyed)).subscribe(o=>t.withDirection(o)),t.beforeStarted.subscribe(()=>{let o=l0(this.connectedTo).map(n=>{if(typeof n=="string"){let d=e._dropLists.find(_=>_.id===n);return d}return n});
1331if(this._group&&this._group._items.forEach(n=>{o.indexOf(n)===-1&&o.push(n)}),!this._scrollableParentsResolved){let n=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(d=>d.getElementRef().nativeElement);this._dropListRef.withScrollableParents(n),this._scrollableParentsResolved=!0}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=this.sortingDisabled,t.autoScrollDisabled=this.autoScrollDisabled,t.autoScrollStep=a0(this.autoScrollStep,2),t.connectedTo(o.filter(n=>n&&n!==this).map(n=>n._dropListRef)).withOrientation(this.orientation)})}_handleEvents(t){t.beforeStarted.subscribe(()=>{this._syncItemsWithRef(),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(o=>{this.entered.emit({container:this,item:o.item.data,currentIndex:o.currentIndex})}),t.exited.subscribe(o=>{this.exited.emit({container:this,item:o.item.data}),this._changeDetectorRef.markForCheck()}),t.sorted.subscribe(o=>{this.sorted.emit({previousIndex:o.previousIndex,currentIndex:o.currentIndex,container:this,item:o.item.data})}),t.dropped.subscribe(o=>{this.dropped.emit({previousIndex:o.previousIndex,currentIndex:o.currentIndex,previousContainer:o.previousContainer.data,container:o.container.data,item:o.item.data,isPointerOverContainer:o.isPointerOverContainer,distance:o.distance,dropPoint:o.dropPoint,event:o.event}),this._changeDetectorRef.markForCheck()}),Dp(t.receivingStarted,t.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(t){let{lockAxis:o,draggingDisabled:n,sortingDisabled:d,listAutoScrollDisabled:_,listOrientation:C}=t;this.disabled=n??!1,this.sortingDisabled=d??!1,this.autoScrollDisabled=_??!1,this.orientation=C||"vertical",o&&(this.lockAxis=o)}_syncItemsWithRef(){this._dropListRef.withItems(this.getSortedItems().map(t=>t._dragRef))}};e._dropLists=[],e.\u0275fac=function(o){return new(o||e)(ae(Pi),ae(VD),ae(Or),ae(oz),ae(gD,8),ae(ND,12),ae(Tz,8))},e.\u0275dir=bi({type:e,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(o,n){o&2&&(Bn("id",n.id),Yi("cdk-drop-list-disabled",n.disabled)("cdk-drop-list-dragging",n._dropListRef.isDragging())("cdk-drop-list-receiving",n._dropListRef.isReceiving()))},inputs:{connectedTo:["cdkDropListConnectedTo","connectedTo"],data:["cdkDropListData","data"],orientation:["cdkDropListOrientation","orientation"],id:"id",lockAxis:["cdkDropListLockAxis","lockAxis"],disabled:["cdkDropListDisabled","disabled",Rr],sortingDisabled:["cdkDropListSortingDisabled","sortingDisabled",Rr],enterPredicate:["cdkDropListEnterPredicate","enterPredicate"],sortPredicate:["cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:["cdkDropListAutoScrollDisabled","autoScrollDisabled",Rr],autoScrollStep:["cdkDropListAutoScrollStep","autoScrollStep"]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],standalone:!0,features:[It([{provide:ND,useValue:void 0},{provide:Iz,useExisting:e}]),$s]});let i=e;return i})();var Az=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275mod=Ui({type:e}),e.\u0275inj=Bi({providers:[VD],imports:[az]});let i=e;return i})();function mie(i,e){if(i&1&&(S(0,"b"),A(1),E()),i&2){let r=q().$implicit;P(1),We("",r.file," -")}}function gie(i,e){if(i&1&&(S(0,"li"),ce(1,mie,2,1,"b",15),A(2),E()),i&2){let r=e.$implicit;P(1),N("ngIf",r.file),P(1),We(" ",r.error,"")}}function _ie(i,e){if(i&1&&(S(0,"div",14)(1,"ul"),ce(2,gie,3,2,"li",13),E()()),i&2){let r=q(2);P(2),N("ngForOf",r.errors)}}function vie(i,e){if(i&1&&(S(0,"div",16),Z(1,"img",17),E()),i&2){let r=q(2);P(1),Hi("src",(r.mainImage==null?null:r.mainImage.file)||(r.mainImage==null?null:r.mainImage.image.file)||(r.mainImage==null?null:r.mainImage.image),Ei)}}function yie(i,e){if(i&1){let r=Ge();S(0,"div",29),se("click",function(){Se(r);let o=q(),n=o.$implicit,d=o.index,_=q(2);return Te(_.removeFile(n.id,d))}),Z(1,"img",30),E()}}var bie=(i,e)=>({item:i,index:e});function xie(i,e){if(i&1){let r=Ge();Pa(0),S(1,"div",18),se("cdkDropListDropped",function(o){Se(r);let n=q(2);return Te(n.imageDropped(o))}),S(2,"div",19)(3,"div")(4,"div",20),se("click",function(){let n=Se(r).index,d=q(2);return Te(d.moveUp(n))}),Z(5,"img",21),E(),S(6,"div",20),se("click",function(){let n=Se(r).index,d=q(2);return Te(d.moveDown(n))}),Z(7,"img",22),E(),S(8,"div",20),se("click",function(){let n=Se(r).index,d=q(2);return Te(d.setAsMain(n))}),Z(9,"img",23),E(),ce(10,yie,2,0,"div",24),E(),Z(11,"div",9),S(12,"div",25),se("dblclick",function(){let n=Se(r).index,d=q(2);return Te(d.setAsMain(n))}
1331),Z(13,"img",26),E(),S(14,"div",27)(15,"textarea",28),se("change",function(o){let d=Se(r).index,_=q(2);return Te(_.changeCaption(o.target,d))}),A(16),E()()()(),Oa()}if(i&2){let r=e.$implicit,t=e.index;P(1),N("cdkDropListData",mn(4,bie,r,t)),P(9),N("ngIf",!r.published),P(3),Hi("src",r.image.file||r.image,Ei),P(3),mt(r.caption)}}function wie(i,e){if(i&1){let r=Ge();S(0,"div",2)(1,"div",3)(2,"div",4)(3,"label"),A(4,"Prikazna slika"),E()(),S(5,"button",5),se("click",function(){Se(r);let o=q();return Te(o.saveImagesCaptionAndPosition())}),A(6," Shrani "),E(),S(7,"button",6),se("click",function(){Se(r);let o=or(10);return Te(o.click())}),A(8," + Dodaj slike "),E(),S(9,"input",7,8),se("change",function(o){Se(r);let n=q();return Te(n.onFileChange(o))}),E(),Z(11,"div",9),E(),ce(12,_ie,3,1,"div",10)(13,vie,2,1,"div",11),S(14,"div")(15,"label"),A(16,"Vse slike"),E()(),S(17,"div",12),ce(18,xie,17,7,"ng-container",13),E()()}if(i&2){let r=q();ki("images-upload ",r.dragAreaClass,""),P(9),N("multiple",r.maxFiles>1),P(3),N("ngIf",r.errors.length>0),P(1),N("ngIf",!r.loader&&r.mainImage),P(5),N("ngForOf",r.fileList)}}var P1=(()=>{let e=class e{constructor(t,o){this.fileService=t,this.router=o,this.errors=[],this.fileList=[],this.dragAreaClass="dragarea",this.loader=!1,this.uploadLoader=!1,this.uploadPercentage=0,this.loopIndex=0,this.startingIndex=null,this.mainImage=null,this.entityID=0,this.entityType=null,this.maxFiles=5,this.uploadStatus=new Fe,this.scrolled=!0}ngOnInit(){}onFileChange(t){let o=t.target.files;this.saveFiles(o)}onDragOver(t){this.dragAreaClass="droparea",t.preventDefault()}onDragEnter(t){this.dragAreaClass="droparea",t.preventDefault()}onDragEnd(t){this.dragAreaClass="dragarea",t.preventDefault()}onDragLeave(t){this.dragAreaClass="dragarea",t.preventDefault()}onDrop(t){this.dragAreaClass="dragarea",t.preventDefault(),t.stopPropagation();let o=t.dataTransfer.files;this.saveFiles(o)}saveFiles(t){if(this.errors=[],t.length>0&&!this.isValidFiles(t)){this.uploadStatus.emit(!1);return}if(t.length>0){let o="/"+this.entityType+"/upload_images/"+this.entityID+"/";this.loopUpload(t,o)}}loopUpload(t,o){let n=new FormData;n.append("image",t[this.loopIndex],t[this.loopIndex].name),this.uploadPercentage=0,this.uploadLoader=!0,this.fileService.upload(n,o).subscribe(d=>{if(d.type===pl.UploadProgress){let _=Math.round(100*d.loaded/d.total);this.uploadPercentage=_}else d instanceof cc&&(this.uploadStatus.emit(!0),d.body.images.length>0&&(this.fileList.push({id:d.body.images[0].id,image:d.body.images[0].file}),this.mainImage==null&&(this.mainImage={id:d.body.images[0].id,image:d.body.images[0].file})),this.loopIndex<t.length-1?(this.loopIndex++,this.loopUpload(t,o)):(this.loopIndex=0,this.uploadLoader=!1))},d=>{if(this.uploadStatus.emit(!0),d.ExceptionMessage!=null)this.errors.push({file:null,error:d.ExceptionMessage});else if(d.error!=null){let _=d.error;if(_.detail!=null&&this.errors.push({file:t[this.loopIndex].name,error:_.detail}),_.non_field_errors&&_.non_field_errors.length>0)for(let C=0;C<_.non_field_errors.length;C++)this.errors.push({file:t[this.loopIndex].name,error:_.non_field_errors[C]});if(_.file&&_.file.length>0)for(let C=0;C<_.file.length;C++)this.errors.push({file:t[this.loopIndex].name,error:_.file[C]})}this.scrolled=!1,this.uploadLoader=!1})}ngAfterViewChecked(){this.scrolled||this.scrollToFirstError()}scrollToFirstError(){let t=document.querySelector(".error-message");t&&(setTimeout(()=>t.scrollIntoView(!0)),setTimeout(()=>window.scrollBy(0,-120)),this.scrolled=!0)}removeFile(t,o){let n="/"+this.entityType+"/delete_image/"+t+"/";this.fileService.removeFile(n).subscribe(d=>{this.fileList.splice(o,1),this.mainImage.id===t&&(this.mainImage=null)},d=>{})}setAsMain(t){this.mainImage=this.fileList[t],this.fileList[t].main=!0}imageDropped(t){let o=t.previousContainer.data.index,n=t.container.data.index;if(o>n){let d=o,_=d-1;for(;d>n;)this.swap(_,d),d--,_--}else{let d=o,_=d+1;for(;d<n;)this.swap(_,d),d++,_++}}swap(t,o){let n=this.fileList[t];this.fileList[t]=this.fileList[o],this.fileList[o]=n}moveUp(t){t>=1&&this.swap(t,t-1)}moveDown(t){this.swap(t,t+1)}saveImagesCaptionAndPosition(t=0){this.loader=!0;let o="/"+this.entityType+"/update_image/",n=[];if(t<this.fileList.length){let d;this.fileList[t].main?d={caption:this.fileList[t].caption,main:this.fileList[t].main,position:t+1}:d={caption:this.fileList[t].caption,position:t+1},this.fileService.saveFileAdditional(d,o+this.fileList[t].id+"/").subscribe(_=>{this.saveImagesCaptionAndPosition(t+1)})}else{if(this.mainImage!=null){console.log(this.mainImage);let d=this.fileService.setMain("/"+this.entityType+"/set_as_main_image/"+this.mainImage.id+"/");n.push(d)}n.length===0?(this.loader=!1,this.router.navigate(["/"+this.entityType+"/"+this.entity
1331ID])):Dg(n).subscribe(d=>{this.loader=!1,this.router.navigate(["/"+this.entityType+"/"+this.entityID])},d=>{this.loader=!1,this.errors.push({file:"NAPAKA:",error:d.error.non_field_errors[0]})})}}isValidFiles(t){if(t.length>this.maxFiles){this.errors.push({file:"VSE DATOTEKE:",error:"Naenkrat lahko nalo\u017Eite le "+this.maxFiles+" datotek"});return}return this.errors.length===0}changeCaption(t,o){let n=t.value;this.fileList[o].caption=n}};e.\u0275fac=function(o){return new(o||e)(ae(Sl),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-file-upload"]],hostBindings:function(o,n){o&1&&se("dragover",function(_){return n.onDragOver(_)})("dragenter",function(_){return n.onDragEnter(_)})("dragend",function(_){return n.onDragEnd(_)})("dragleave",function(_){return n.onDragLeave(_)})("drop",function(_){return n.onDrop(_)})},inputs:{fileList:"fileList",mainImage:"mainImage",entityID:"entityID",entityType:"entityType",maxFiles:"maxFiles"},outputs:{uploadStatus:"uploadStatus"},standalone:!0,features:[gt],decls:3,vars:4,consts:[["src","/assets/images/loader.gif"],["draggable","true",3,"class",4,"ngIf"],["draggable","true"],[1,"images-upload-header"],[1,"float-left"],["type","button",1,"btn","btn-sm","btn-primary","float-right","margin-5-left",3,"click"],["type","button",1,"btn","btn-sm","btn-default","float-right",3,"click"],["type","file",2,"display","none",3,"multiple","change"],["fileInput",""],[1,"clearfix"],["class","row error-message",4,"ngIf"],["class","center-text",4,"ngIf"],["cdkDropListGroup","",1,"images-container","images-upload-container"],[4,"ngFor","ngForOf"],[1,"row","error-message"],[4,"ngIf"],[1,"center-text"],[2,"max-width","100%","max-height","400px",3,"src"],["cdkDropList","","cdkDropListOrientation","horizontal",3,"cdkDropListData","cdkDropListDropped"],["cdkDrag","",1,"img-container"],[1,"float-left","pointer",3,"click"],["src","/assets/images/arrow_up.svg",2,"height","17px","padding-right","7px"],["src","/assets/images/arrow_down.svg",2,"height","17px","padding-right","7px"],["src","/assets/images/image.png",2,"height","17px","padding-right","7px"],["class","float-right pointer",3,"click",4,"ngIf"],[1,"img-image",3,"dblclick"],[3,"src"],[1,"img-caption"],["placeholder","Vnesite kratek opis.",1,"img-caption-control",3,"change"],[1,"float-right","pointer",3,"click"],["src","/assets/images/close.png",2,"height","17px"]],template:function(o,n){o&1&&(S(0,"div"),Z(1,"img",0),E(),ce(2,wie,19,7,"div",1)),o&2&&(ki("",n.loader?"":"hidden"," loader"),P(2),N("ngIf",!n.loader))},dependencies:[Az,kz,Mz,Dz,Dt,ti,At]});let i=e;return i})();function Cie(i,e){i&1&&(S(0,"div",2),Z(1,"img",3),E())}function Eie(i,e){if(i&1&&(S(0,"span",8),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.road.name," ")}}function Sie(i,e){if(i&1&&(S(0,"div",4),Z(1,"br"),S(2,"h4"),A(3),ce(4,Eie,2,1,"span",5),E(),Z(5,"br"),S(6,"ul",6)(7,"li"),A(8,'Za dodajanje slik, kliknite na gumb "Dodaj slike".'),E(),S(9,"li"),A(10,"Za spreminjanje vrstnega reda, sliko z mi\u0161ko premaknite na \u017Eeleno mesto ali pa uporabite pu\u0161\u010Dice nad sliko."),E(),S(11,"li"),A(12,"Za izbiro prikazne slike poti, dvo-kliknite na sliko ali pa kliknite na ikono slike nad sliko, ki jo \u017Eelite izbrati kot prikazno."),E()(),Z(13,"app-file-upload",7),E()),i&2){let r=q();P(3),tr("Slike poti ",r.road==null?null:r.road.starting_point.title," - ",r.road==null?null:r.road.end_point.title," "),P(1),N("ngIf",r.road.name),P(9),N("entityID",r.road==null?null:r.road.id)("entityType","roads")("fileList",r.road==null?null:r.road.images)("mainImage",r.road==null?null:r.road.main_image)("maxFiles",100)}}var BD=(()=>{let e=class e{constructor(t,o,n){this.roadService=t,this.route=o,this.fileService=n,this.id=null,this.loader=!1}ngOnInit(){this.loader=!0,this.sub=this.route.params.subscribe(t=>{this.id=+t.id,this.id&&this.roadService.getRoad(this.id,null).subscribe(o=>{this.road=o,this.loadRoadImages(25,0)})})}loadRoadImages(t,o){this.roadService.getRoadImages(this.id,t,o).subscribe(n=>{this.road.images?this.road.images=this.road.images.concat(n.results):this.road.images=n.results,n.next?this.loadRoadImages(t,o+t):this.loader=!1})}};e.\u0275fac=function(o){return new(o||e)(ae(Ln),ae(Gi),ae(Sl))},e.\u0275cmp=st({type:e,selectors:[["app-road-upload-images"]],standalone:!0,features:[It([Ln,Sl]),gt],decls:2,vars:2,consts:[["class","loader",4,"ngIf"],["class","middle",4,"ngIf"],[1,"loader"],["src","/assets/images/loader.gif",1,"mobile-100-percent-width"],[1,"middle"],["class","special-name",4,"ngIf"],[1,"ul-outside",2,"font-size","10pt"],[3,"entityID","entityType","fileList","mainImage","maxFiles"],[1,"special-name"]],template:function(o,n){o&1&&ce(0,Cie,2,0,"div",0)(1,Sie,14,8,"div",1),o&2&&(N("ngIf",n.loader),P(1),N("ngIf",!n.loader))},dependencies:[P1,Dt,At]});let i=e;return i})();function Tie(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function Iie(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=q(2);P(1),mt(r.errorMessages==null?null:r.errorMessages.detail)}}function Die(i,e){if(i&1&&(S(0,"div",34),A(1," Napake: "),S(2,"ul"),ce(3,Tie,2,1,"li",35)(4,Iie,2,1,"li",36),E()()),i&2){let r=q();P(3),N("ngForOf",r.errorMessages==null?null:r.errorMessages.non_field_errors),P(1),N("ngIf",r.errorMessages==null?null:r.errorMessages.detail)}}function Mie(i,e){if(i&1&&(S(0,"div",34),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.name[0]," ")}}function kie(i,e){if(i&1&&(S(0,"div",34),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.type[0]," ")}}function Aie(i,e){if(i&1){let r=Ge();S(0,"app-dropdown",37),se("onSelect",function(o){Se(r);let n=q();return Te(n.selectCountry(o.value))}),E()}if(i&2){let r=q();N("values",r.countryList)("categories",!1)}}function Pie(i,e){if(i&1&&(S(0,"div",34),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.country[0]," ")}}function Oie(i,e){if(i&1){let r=Ge();S(0,"button",40),se("click",function(){let n=Se(r).index,d=q(2);return Te(d.deleteCountry(n))}),A(1),S(2,"span",41),A(3,"\xD7"),E()()}if(i&2){let r=e.$implicit;P(1),We(" ",r.title," ")}}function Rie(i,e){if(i&1&&(S(0,"div",38),ce(1,Oie,4,1,"button",39),E()),i&2){let r=q();P(1),N("ngForOf",r.selectedCountryList)}}function Lie(i,e){if(i&1&&(S(0,"div",34),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.height[0]," ")}}function Fie(i,e){if(i&1&&(S(0,"div",34),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.length[0]," ")}}function Nie(i,e){if(i&1&&(S(0,"div",34),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.width[0]," ")}}function zie(i,e){if(i&1){let r=Ge();S(0,"app-dropdown",37),se("onSelect",function(o){Se(r);let n=q();return Te(n.selectMountainRange(o.value))}),E()}if(i&2){let r=q();N("values",r.mountainRangeList)("categories",!1)}}function jie(i,e){if(i&1&&(S(0,"div",34),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.mountain_range[0]," ")}}function Vie(i,e){if(i&1&&(S(0,"div",34),A(1),E()),i&2){let r=q();P(1),We(" ",r.errorMessages==null?null:r.errorMessages.desc[0]," ")}}var Pz=i=>({hidden:i}),y0=(()=>{let e=class e{constructor(t,o,n,d,_,C,M,j){this.platformId=t,this.countryService=o,this.destinationService=n,this.mountainRangeService=d,this.googleMapsService=_,this.formBuilder=C,this.route=M,this.router=j,this.id=null,this.destinationForm=null,this.mountainRangeList=[],this.countryList=[],this.selectedCountryList=[],this.selectedCountryIds=[],this.searchTarget=null,this.selectedMountainRange=null,this.showMountainRangesDropdown=!1,this.showCountryDropdown=!1,this.mapVisible=!1,this.scrolled=!0,this.loader=!1,this.isBrowser=Si(t)}searchMountainRanges(t,o){let n=t.value;this.showMountainRangesDropdown=!0,this.mountainRangeService.getMountainRanges(15,0,null,n).subscribe(d=>{this.mountainRangeList=[];for(let _ of d.results)this.mountainRangeList.push({value:_,label:_.title,additional_data:""})}),this.searchTarget=o.target}searchCountries(t,o){let n=t.value;this.showCountryDropdown=!0,this.countryService.getCountries(15,0,null,n).subscribe(d=>{this.countryList=[];for(let _ of d.results)this.selectedCountryIds.includes(_.id)||this.countryList.push({value:_,label:_.title,additional_data:""})}),this.searchTarget=o.target}selectMountainRange(t){this.searchTarget.value=t.title,this.selectedMountainRange=t,this.searchTarget=null,this.showMountainRangesDropdown=!1,this.mountainRangeList=[]}selectCountry(t){this.searchTarget.value="",this.searchTarget=null,this.selectedCountryList.push(t),this.selectedCountryIds.push(t.id),this.showCountryDropdown=!1,this.countryList=[]}deleteCountry(t){this.selectedCountryList.splice(t,1),this.selectedCountryIds.splice(t,1)}submitCoordinates(t){this.destinationForm.patchValue({length:t.lng,width:t.lat})}onSubmit(t){this.loader=!0,this.errorMessages=null,t.length==""&&(t.length=null),t.width==""&&(t.width=null),t.height==""&&(t.height=null),this.selectedMountainRange!=null&&(t.mountain_range=this.selectedMountainRange.id),this.selectedCountryList.length>0&&(t.country=[],this.selectedCountryList.forEach(o=>{t.country.push(o.id)})),this.id?this.destinationService.updateDestination(this.id,t).subscribe(o=>{this.router.navigate(["/destinations/"+o.id])},o=>{this.loader=!1,this.scrolled=!1,this.errorMessages=o.error}):this.destinationService.insertDestination(t).subscribe(o=>{this.router.navigate(["/destinations/images/"+o.id])},o=>{this.loader=!1,this.scrolled=!1,this.errorMessages=o.error})}ngAfterViewChecked(){this.scrolled||this.scrollToFirstError()}scrollToFirstError(){let t=document.querySelector(".error-message");t&&(setTimeout(()=>t.scrollIntoView(!0)),setTimeout(()=>window.scrollBy(0,-60)),this.scrolled=!0)}ngOnInit(){this.loader=!0,this.destinationForm=this.formBuilder.group({title:["",Wt.required],type:["",Wt.required],height:["",Wt.required],length:[""],width:[""],mountain_range:[""],desc:["",Wt.required]}),this.sub=this.route.params.subscribe(t=>{this.id=+t.id,this.id?this.destinationService.getDestination(this.id,null).subscribe(o=>{this.destination=o,this.selectedMountainRange=this.destination.mountain_range,this.selectedCountryList=this.destination.country,this.selectedCountryIds=[];for(let n in this.destination.country)this.selectedCountryIds.push(this.destination.country[n].id);this.destinationForm=this.formBuilder.group({title:[this.destination.title,Wt.required],type:[this.destination.type.id,Wt.required],height:[this.destination.height,Wt.required],length:[this.destination.length],width:[this.destination.width],mountain_range:[this.destination.mountain_range!=null?this.destination.mountain_range.title:""],desc:[this.destination.desc,Wt.required]}),this.loader=!1}):this.loader=!1})}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(th),ae(sn),ae(ih),ae(_u),ae(ro),ae(Gi),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-destination-add-edit"]],standalone:!0,features:[It([th,ih,_u,sn]),gt],decls:84,vars:23,consts:[[1,"loader","center-text","margin-5",3,"ngClass"],["src","/assets/images/loader.gif"],[1,"middle","light-bg",3,"ngClass"],[3,"formGroup","ngSubmit"],["class","error-message",4,"ngIf"],[1,"col-2-padding-nonmobile"],[1,"form-field"],["formControlName","title","type","text","name","title","value","",1,"form-control"],["formControlName","type","name","type",1,"form-control"],["value",""],["value","1"],["value","2"],["value","3"],["value","4"],["value","5"],["value","7"],["value","8"],["value","9"],["value","6"],[1,"form-group"],["type","text","placeholder","Izberite dr\u017Eavo iz seznama.",1,"form-control",3,"blur","focus","keyup"],[3,"values","categories","onSelect",4,"ngIf"],["class","form-chip-list",4,"ngIf"],["formControlName","height","type","number","step","any","name","height","value","",1,"form-control"],[1,"form-field-label-row"],["type","button",1,"btn","btn-sm","btn-default",3,"click"],["formControlName","length","type","number","step","any","name","length","value","",1,"form-control"],["formControlName","width","type","number","step","any","name","width","value","",1,"form-control"],["formControlName","mountain_range","type","text","name","mountain_range","placeholder","Izberite gorovje iz seznama.",1,"form-control",3,"blur","focus","keyup"],["formControlName","desc","name","desc",1,"form-control","editor-lg"],["type","submit",1,"btn","btn-sm","btn-primary","float-right"],[1,"clearfix"],[3,"lat","lng","mapVisible","onCoordinatesChange"],["mapPopup",""],[1,"error-message"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"values","categories","onSelect"],[1,"form-chip-list"],["type","button","class","form-chip",3,"click",4,"ngFor","ngForOf"],["type","button",1,"form-chip",3,"click"],[1,"form-chip-remove"]],template:function(o,n){if(o&1){let d=Ge();S(0,"div",0),Z(1,"img",1),E(),S(2,"div",2)(3,"form",3),se("ngSubmit",function(){return n.onSubmit(n.destinationForm.value)}),Z(4,"br"),S(5,"h2"),A(6,"Vnos nove destinacije"),E(),ce(7,Die,5,2,"div",4),S(8,"div",5)(9,"div",6)(10,"label"),A(11,"Naziv"),E(),Z(12,"input",7),ce(13,Mie,2,1,"div",4),E(),S(14,"div",6)(15,"label"),A(16,"Tip"),E(),S(17,"select",8)(18,"option",9),A(19,"-Izberi-"),E(),S(20,"option",10),A(21,"Vrh"),E(),S(22,"option",11),A(23,"Ko\u010Da"),E(),S(24,"option",12),A(25,"Naselje"),E(),S(26,"option",13),A(27,"Prelaz"),E(),S(28,"option",14),A(29,"Jezero"),E(),S(30,"option",15),A(31,"Planina"),E(),S(32,"option",16),A(33,"Bivak"),E(),S(34,"option",17),A(35,"Slap"),E(),S(36,"option",18),A(37,"Drugo"),E()(),ce(38,kie,2,1,"div",4),E(),S(39,"div",6)(40,"label"),A(41,"Dr\u017Eava"),E(),S(42,"div",19)(43,"input",20),se("blur",function(){return n.showCountryDropdown=!1})("focus",function(C){return n.searchCountries("",C)})("keyup",function(C){return n.searchCountries(C.target,C)}),E(),ce(44,Aie,1,2,"app-dropdown",21)(45,Pie,2,1,"div",4),E(),ce(46,Rie,2,1,"div",22),E(),S(47,"div",6)(48,"label"),A(49,"Vi\u0161ina"),E(),Z(50,"input",23),ce(51,Lie,2,1,"div",4),E(),S(52,"div",6)(53,"label",24),A(54,"Dol\u017Eina "),S(55,"button",25),se("click",function(){Se(d);let C=or(83);return Te(C.openMap())}),A(56,"Mapa"),E()(),Z(57,"input",26),ce(58,Fie,2,1,"div",4),E(),S(59,"div",6)(60,"label",24),A(61,"\u0160irina "),S(62,"button",25),se("click",function(){Se(d);let C=or(83);return Te(C.openMap())}),A(63,"Mapa"),E()(),Z(64,"input",27),ce(65,Nie,2,1,"div",4),E(),S(66,"div",6)(67,"label"),A(68,"Gorovje"),E(),S(69,"div",19)(70,"input",28),se("blur",function(){return n.showMountainRangesDropdown=!1})("focus",function(C){return n.searchMountainRanges("",C)})("keyup",function(C){return n.searchMountainRanges(C.target,C)}),E(),ce(71,zie,1,2,"app-dropdown",21)(72,jie,2,1,"div",4),E()()(),S(73,"div",5)(74,"div",6)(75,"label"),A(76,"Opis"),E(),Z(77,"textarea",29),ce(78,Vie,2,1,"div",4),E()(),S(79,"button",30),A(80),E(),Z(81,"div",31),E()(),S(82,"a
1331pp-map-popup",32,33),se("onCoordinatesChange",function(C){return n.submitCoordinates(C)}),E()}o&2&&(N("ngClass",kt(19,Pz,!n.loader)),P(2),N("ngClass",kt(21,Pz,n.loader)),P(1),N("formGroup",n.destinationForm),P(4),N("ngIf",n.errorMessages!==void 0&&((n.errorMessages==null?null:n.errorMessages.non_field_errors)!==void 0||(n.errorMessages==null?null:n.errorMessages.detail)!==void 0)),P(6),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.name)!==void 0),P(25),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.type)!==void 0),P(6),N("ngIf",n.showCountryDropdown),P(1),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.country)!==void 0),P(1),N("ngIf",n.selectedCountryList==null?null:n.selectedCountryList.length),P(5),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.height)!==void 0),P(7),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.length)!==void 0),P(7),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.width)!==void 0),P(6),N("ngIf",n.showMountainRangesDropdown),P(1),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.mountain_range)!==void 0),P(6),N("ngIf",n.errorMessages!==void 0&&(n.errorMessages==null?null:n.errorMessages.desc)!==void 0),P(2),mt(n.destination!==void 0?"Shrani":"Shrani in dodaj slike"),P(2),N("lat",n.destination==null?null:n.destination.width)("lng",n.destination==null?null:n.destination.length)("mapVisible",!1))},dependencies:[Dt,on,ti,At,Nr,no,xf,wf,Fr,G_,bf,to,io,oo,qr,Wr,yu,Ux]});let i=e;return i})();function Bie(i,e){i&1&&(S(0,"div",2),Z(1,"img",3),E())}function Uie(i,e){if(i&1&&(S(0,"div",4),Z(1,"br"),S(2,"h2"),A(3),E(),Z(4,"br"),S(5,"ul",5)(6,"li"),A(7,'Za dodajanje slik, kliknite na gumb "Dodaj slike".'),E(),S(8,"li"),A(9,"Za spreminjanje vrstnega reda, sliko z mi\u0161ko premaknite na \u017Eeleno mesto ali pa uporabite pu\u0161\u010Dice nad sliko."),E(),S(10,"li"),A(11,"Za izbiro prikazne slike destinacije, dvo-kliknite na sliko ali pa kliknite na ikono slike nad sliko, ki jo \u017Eelite izbrati kot prikazno."),E()(),Z(12,"app-file-upload",6),E()),i&2){let r=q();P(3),We("Slike destinacije ",r.destination==null?null:r.destination.title,""),P(9),N("entityID",r.destination==null?null:r.destination.id)("entityType","destinations")("fileList",r.destination==null?null:r.destination.images)("mainImage",r.destination==null?null:r.destination.main_image)("maxFiles",100)}}var UD=(()=>{let e=class e{constructor(t,o,n){this.destinationService=t,this.route=o,this.fileService=n,this.id=null,this.loader=!1}ngOnInit(){this.loader=!0,this.sub=this.route.params.subscribe(t=>{this.id=+t.id,this.id&&this.destinationService.getDestination(this.id,null).subscribe(o=>{this.destination=o,this.destinationService.getDestinationImages(this.destination.id,10,0).subscribe(n=>{this.destination.images=n.results,this.loader=!1})})})}};e.\u0275fac=function(o){return new(o||e)(ae(sn),ae(Gi),ae(Sl))},e.\u0275cmp=st({type:e,selectors:[["app-destination-upload-images"]],standalone:!0,features:[It([sn,Sl]),gt],decls:2,vars:2,consts:[["class","loader",4,"ngIf"],["class","middle",4,"ngIf"],[1,"loader"],["src","/assets/images/loader.gif",1,"mobile-100-percent-width"],[1,"middle"],[1,"ul-outside",2,"font-size","10pt"],[3,"entityID","entityType","fileList","mainImage","maxFiles"]],template:function(o,n){o&1&&ce(0,Bie,2,0,"div",0)(1,Uie,13,6,"div",1),o&2&&(N("ngIf",n.loader),P(1),N("ngIf",!n.loader))},dependencies:[P1,Dt,At]});let i=e;return i})();function Hie(i,e){i&1&&(S(0,"div",29)(1,"b"),A(2,"POZOR!"),E(),A(3," Na va\u0161 e-naslov smo vam poslali sporo\u010Dilo s povezavo za aktivacijo va\u0161ega ra\u010Duna. Za nemoteno uporabo portala morate aktivirati va\u0161 ra\u010Dun. Aktivacija pote\u010De v dveh dneh od registracije. V primeru, da sporo\u010Dilo ne prispe v va\u0161 nabiralnik, preverite ne\u017Eeleno po\u0161to. \u010Ce sporo\u010Dila tudi tam ne najdete, nas kontaktirajte na "),S(4,"a",30),A(5,"[email protected]"),E(),A(6,". "),E())}function $ie(i,e){if(i&1&&Z(0,"img",31),i&2){let r=q();N("src",r.user.picture,Ei)}}function Gie(i,e){if(i&1&&(S(0,"span"),A(1),E()),i&2){let r=q();P(1),mt(r.user==null?null:r.user.username[0].toUpperCase())}}function qie(i,e){i&1&&(S(0,"span"),A(1,","),E())}function Wie(i,e){if(i&1&&(S(0,"td"),A(1),ce(2,qie,2,0,"span",7),A(3),E()),i&2){let r=q();P(1),We(" ",r.user==null?null:r.user.username,""),P(1),N("ngIf",(r.user==null?null:r.user.gender)!=""&&(r.user==null?null:r.user.gender)!=null),P(1),We(" ",r.user==null?null:r.user.gender," ")}}function Zie(i,e){i&1&&(S(0,"span"),A(1,","),E())}function Kie(i,e){if(i&1&&(S(0,"td"),A(1),ce(2,Zie,2,0,"span",7),A(3),E()),i&2){let r=q();P(1),a_(" ",r.user==null?null:r.user.first_name," ",r.user==null?null:r.user.last_name," 
1331(",r.user==null?null:r.user.username,")"),P(1),N("ngIf",(r.user==null?null:r.user.gender)!=""&&(r.user==null?null:r.user.gender)!=null),P(1),We(" ",r.user==null?null:r.user.gender," ")}}function Xie(i,e){if(i&1&&(S(0,"div",41)(1,"div",42)(2,"div",43),A(3),E(),S(4,"div",44),A(5,"Vpisov ta mesec"),E()(),S(6,"div",42)(7,"div",43),A(8),E(),S(9,"div",44),A(10,"Vpisov to leto"),E()(),S(11,"div",42)(12,"div",43),A(13),E(),S(14,"div",44),A(15,"Vpisov skupaj"),E()()()),i&2){let r=q(2);P(3),mt(r.personalStats.monthly_total_count),P(5),mt(r.personalStats.yearly_total_count),P(5),mt(r.personalStats.total_count)}}function Yie(i,e){if(i&1&&(S(0,"div",45)(1,"span",46),A(2),E(),S(3,"a",47),A(4),E(),S(5,"span",48),A(6),E()()),i&2){let r=e.$implicit,t=e.index;P(2),mt(t+1),P(1),fn("routerLink","/destinacije/",r.destination__id,""),P(1),mt(r.destination__title),P(2),We("",r.checkins,"\xD7")}}function Qie(i,e){i&1&&(S(0,"p",49),A(1,"Ni podatkov za to obdobje."),E())}function Jie(i,e){if(i&1&&(S(0,"div",45)(1,"span",46),A(2),E(),S(3,"a",47),A(4),E(),S(5,"span",48),A(6),E()()),i&2){let r=e.$implicit,t=e.index;P(2),mt(t+1),P(1),fn("routerLink","/destinacije/",r.destination__id,""),P(1),mt(r.destination__title),P(2),We("",r.destination__height," m")}}function ene(i,e){i&1&&(S(0,"p",49),A(1,"Ni podatkov za to obdobje."),E())}function tne(i,e){if(i&1){let r=Ge();S(0,"div",32),ce(1,Xie,16,3,"div",33),S(2,"div",34)(3,"button",35),se("click",function(){Se(r);let o=q();return Te(o.setStatsCutoff("all"))}),A(4,"Vse"),E(),S(5,"button",35),se("click",function(){Se(r);let o=q();return Te(o.setStatsCutoff("this-year"))}),A(6,"Letos"),E(),S(7,"button",35),se("click",function(){Se(r);let o=q();return Te(o.setStatsCutoff("this-month"))}),A(8,"Ta mesec"),E()(),S(9,"div",36)(10,"div",37)(11,"div",38),A(12,"Najbolj obiskano"),E(),ce(13,Yie,7,4,"div",39)(14,Qie,2,0,"p",40),E(),S(15,"div",37)(16,"div",38),A(17,"Najvi\u0161je osvojeno"),E(),ce(18,Jie,7,4,"div",39)(19,ene,2,0,"p",40),E()()()}if(i&2){let r=q();P(1),N("ngIf",r.personalStats),P(2),Yi("active",r.statsCutoff==="all"),P(2),Yi("active",r.statsCutoff==="this-year"),P(2),Yi("active",r.statsCutoff==="this-month"),P(6),N("ngForOf",r.mostVisited),P(1),N("ngIf",!r.mostVisited.length),P(4),N("ngForOf",r.highestVisited),P(1),N("ngIf",!r.highestVisited.length)}}function ine(i,e){i&1&&(S(0,"p",50),A(1,"Ni podatkov."),E())}function nne(i,e){if(i&1&&Z(0,"app-destination-list",51),i&2){let r=q();N("header",!1)("openOnDbClick",!1)("user",r.user==null?null:r.user.id)("loadMoreVisible",!0)("autoHeight",!0)}}function rne(i,e){if(i&1&&Z(0,"app-road-list",52),i&2){let r=q();N("header",!1)("user",r.user==null?null:r.user.id)("loadMoreVisible",!0)("autoHeight",!0)}}var HD=i=>({active:i}),Oz=(()=>{let e=class e{constructor(t,o,n){this.userService=t,this.checkinService=o,this.router=n,this.loader=!1,this.analyticsTab=!0,this.destinationsTab=!1,this.roadsTab=!1,this.gpsTab=!1,this.personalStats=null,this.mostVisited=[],this.highestVisited=[],this.statsCutoff="all",this.userId=0}changeTab(t){this.analyticsTab=t==="analytics",this.destinationsTab=t==="destinations",this.roadsTab=t==="roads",this.gpsTab=t==="gps"}ngOnInit(){this.loader=!0,this.userId=parseInt(localStorage.getItem("userID")),this.userService.get_user(this.userId).subscribe(t=>{this.user=t,this.loader=!1}),this.checkinService.getPersonalStats(this.userId).subscribe(t=>{this.personalStats=t&&t.length?t[0]:null}),this.loadLeaderboards()}setStatsCutoff(t){this.statsCutoff!==t&&(this.statsCutoff=t,this.loadLeaderboards())}loadLeaderboards(){let t={dest_board:!0,user:this.userId,limit:5},o={dest_height:!0,user:this.userId,limit:5};this.statsCutoff!=="all"&&(t.cutoff=this.statsCutoff,o.cutoff=this.statsCutoff),this.checkinService.getLeaderboard(t).subscribe(n=>{this.mostVisited=n.results??[]}),this.checkinService.getLeaderboard(o).subscribe(n=>{this.highestVisited=n.results??[]})}};e.\u0275fac=function(o){return new(o||e)(ae(Ti),ae(ea),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-profile"]],standalone:!0,features:[It([Ti,ea]),gt],decls:66,vars:34,consts:[[1,"middle"],["class","warning-message","style","margin-top: 15px; font-size: 12pt;",4,"ngIf"],["src","/assets/images/loader.gif",1,"mobile-100-percent-width"],["id","profile-general-data"],["id","profile-image-container",1,"float-left"],["id","profile-image"],["alt","Profilna slika",3,"src",4,"ngIf"],[4,"ngIf"],["id","profile-data",1,"float-left"],[1,"table-padding-5"],["width","20px","src","/assets/images/user-icon.png","t
1331itle","Uporabi\u0161ko ime in spol","alt","Uporabi\u0161ko ime in spol"],["width","20px","src","/assets/images/email-icon.png","title","E-naslov","alt","E-naslov"],["width","20px","src","/assets/images/birthday-icon.png","title","Datum rojstva (starost)","alt","Datum rojstva (starost)"],["id","profile-summary",1,"float-left"],["id","activity-summary"],["width","20px","src","/assets/images/stats-icon.png","title","Povzetek aktivnosti","alt","Povzetek aktivnosti"],[1,"float-right","margin-10-top"],["routerLink","/profile/change_password",2,"text-decoration","none"],[1,"btn","btn-default","btn-pill"],["routerLink","/profile/edit",1,"margin-5-left"],[1,"btn","btn-primary","btn-pill"],[1,"clearfix"],["id","profile-activity"],[1,"col-header","tabs"],[1,"tab",3,"ngClass","click"],["id","profile-stats",4,"ngIf"],["class","profile-stats-empty margin-10",4,"ngIf"],[3,"header","openOnDbClick","user","loadMoreVisible","autoHeight",4,"ngIf"],[3,"header","user","loadMoreVisible","autoHeight",4,"ngIf"],[1,"warning-message",2,"margin-top","15px","font-size","12pt"],["href","mailto:[email protected]",2,"color","blue"],["alt","Profilna slika",3,"src"],["id","profile-stats"],["class","profile-stats-counters",4,"ngIf"],[1,"profile-stats-filter"],["type","button",1,"profile-stats-filter-btn",3,"click"],[1,"profile-stats-lists"],[1,"profile-stats-list"],[1,"profile-stats-list-title"],["class","profile-stats-list-row",4,"ngFor","ngForOf"],["class","profile-stats-empty",4,"ngIf"],[1,"profile-stats-counters"],[1,"profile-stat-card"],[1,"profile-stat-value"],[1,"profile-stat-label"],[1,"profile-stats-list-row"],[1,"profile-stats-rank"],[1,"profile-stats-name",3,"routerLink"],[1,"profile-stats-count"],[1,"profile-stats-empty"],[1,"profile-stats-empty","margin-10"],[3,"header","openOnDbClick","user","loadMoreVisible","autoHeight"],[3,"header","user","loadMoreVisible","autoHeight"]],template:function(o,n){o&1&&(S(0,"div",0),ce(1,Hie,7,0,"div",1),S(2,"div"),Z(3,"img",2),E(),S(4,"div",3)(5,"div",4)(6,"div",5),ce(7,$ie,1,1,"img",6)(8,Gie,2,1,"span",7),E()(),S(9,"div",8)(10,"table",9)(11,"tr")(12,"td"),Z(13,"img",10),E(),ce(14,Wie,4,3,"td",7)(15,Kie,4,5,"td",7),E(),S(16,"tr")(17,"td"),Z(18,"img",11),E(),S(19,"td"),A(20),E()(),S(21,"tr")(22,"td"),Z(23,"img",12),E(),S(24,"td"),A(25),$r(26,"date"),E()()()(),S(27,"div",13)(28,"div",14),Z(29,"img",15)(30,"br")(31,"br"),S(32,"table",9)(33,"tr")(34,"td")(35,"b"),A(36,"\u0160t. vne\u0161enih destinacij:"),E()(),S(37,"td"),A(38),E()(),S(39,"tr")(40,"td")(41,"b"),A(42,"\u0160t. vne\u0161enih poti:"),E()(),S(43,"td"),A(44),E()()()()(),S(45,"div",16)(46,"a",17)(47,"button",18),A(48,"Spremeni geslo"),E()(),S(49,"a",19)(50,"button",20),A(51,"Uredi profil"),E()()(),Z(52,"div",21),E(),S(53,"div",22)(54,"div",23)(55,"div",24),se("click",function(){return n.changeTab("analytics")}),A(56," Analitika "),E(),S(57,"div",24),se("click",function(){return n.changeTab("destinations")}),A(58," Moje destinacije "),E(),S(59,"div",24),se("click",function(){return n.changeTab("roads")}),A(60," Moje poti "),E(),Z(61,"div",21),E(),ce(62,tne,20,11,"div",25)(63,ine,2,0,"p",26)(64,nne,1,5,"app-destination-list",27)(65,rne,1,4,"app-road-list",28),E()()),o&2&&(P(1),N("ngIf",!(n.user!=null&&n.user.email_confirmed)&&!n.loader),P(1),ki("",n.loader?"":"hidden"," loader center-text margin-5"),P(2),cl(n.loader?"hidden":""),P(3),N("ngIf",n.user==null?null:n.user.picture),P(1),N("ngIf",!(n.user!=null&&n.user.picture)),P(6),N("ngIf",(n.user==null?null:n.user.first_name)==null||(n.user==null?null:n.user.first_name)==""),P(1),N("ngIf",(n.user==null?null:n.user.first_name)!=null&&(n.user==null?null:n.user.first_name)!=""),P(5),mt(n.user==null?null:n.user.email),P(5),mt(n.user!=null&&n.user.birth_date?Gr(26,25,n.user==null?null:n.user.birth_date,"dd.MM.yyyy"):"/"),P(13),We(" ",n.user==null?null:n.user.num_inserted_destinations," "),P(6),We(" ",n.user==null?null:n.user.num_inserted_roads," "),P(9),ki("",n.loader?"hidden":""," margin-10-top"),P(2),N("ngClass",kt(28,HD,n.analyticsTab)),P(2),N("ngClass",kt(30,HD,n.destinationsTab)),P(2),N("ngClass",kt(32,HD,n.roadsTab)),P(3),N("ngIf",n.analyticsTab&&(n.personalStats||n.mostVisited.length||n.highestVisited.length)),P(1),N("ngIf",n.analyticsTab&&!n.personalStats&&!n.mostVisited.length&&!n.highestVisited.length),P(1),N("ngIf",n.destinationsTab),P(1),N("ngIf",n.roadsTab))},dependencies:[Dt,on,ti,At,Xs,Ff,bu,qi],styles:["#profile-stats[_ngcontent-%COMP%]{padding:10px}.profile-stats-counters[_ngcontent-%COMP%]{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:16px}.profile-stat-card[_ngcontent-%COMP%]{flex:1;min-width:120px;background:var(--color-surface-alt);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:16px;text-align:center;box-sizing:border-box}.profile-stat-value[_ngcontent-%COMP%]{font-size:22pt;font-weight:700;color:var(--color-accent);line-height:1.1}.profile-stat-label[_ngcontent-%COMP%]{font-size:var(--font-size-sm);color:#666;margin-top:4px}.profile-stats-filter[_ngcontent-%COMP%]{display:flex;gap:8px;margin-bottom:12px}.profile-stats-filter-btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);background:var(--color-surface);color:#666;padding:5px 14px;border-radius:var(--radius-pill);font-size:var(--font-size-sm);cursor:pointer;
1331transition:background var(--transition-fast),color var(--transition-fast),border-color var(--transition-fast)}.profile-stats-filter-btn[_ngcontent-%COMP%]:hover{border-color:var(--color-accent);color:var(--color-accent)}.profile-stats-filter-btn.active[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.profile-stats-lists[_ngcontent-%COMP%]{display:flex;gap:16px;flex-wrap:wrap}.profile-stats-list[_ngcontent-%COMP%]{flex:1;min-width:240px;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:14px 16px;box-sizing:border-box}.profile-stats-list-title[_ngcontent-%COMP%]{font-weight:700;font-size:var(--font-size-sm);text-transform:uppercase;letter-spacing:.4px;color:#838386;margin-bottom:10px}.profile-stats-list-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid var(--color-border)}.profile-stats-list-row[_ngcontent-%COMP%]:last-child{border-bottom:none}.profile-stats-rank[_ngcontent-%COMP%]{flex:none;width:20px;font-weight:700;color:var(--color-accent);text-align:center}.profile-stats-name[_ngcontent-%COMP%]{flex:1;color:inherit;text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-stats-name[_ngcontent-%COMP%]:hover{color:var(--color-accent)}.profile-stats-count[_ngcontent-%COMP%]{flex:none;font-size:var(--font-size-sm);color:#666}.profile-stats-empty[_ngcontent-%COMP%]{color:#666;font-size:var(--font-size-sm);padding:6px 0;margin:0}@media screen and (max-width: 1000px){.profile-stats-counters[_ngcontent-%COMP%], .profile-stats-lists[_ngcontent-%COMP%]{flex-direction:column}}"]});let i=e;return i})();function one(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function sne(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=q(3);P(1),mt(r.errorMessages.detail)}}function ane(i,e){if(i&1&&(S(0,"div",39),A(1," Error messages: "),S(2,"ul"),ce(3,one,2,1,"li",40)(4,sne,2,1,"li",10),E()()),i&2){let r=q(2);P(3),N("ngForOf",r.errorMessages.non_field_errors),P(1),N("ngIf",r.errorMessages.detail)}}function lne(i,e){if(i&1&&Z(0,"img",41),i&2){let r=q(2);N("src",r.currentPicture,Ei)}}function cne(i,e){if(i&1&&(S(0,"span"),A(1),E()),i&2){let r=q(2);P(1),mt((r.currentUsername||"?")[0].toUpperCase())}}function une(i,e){if(i&1){let r=Ge();S(0,"button",42),se("click",function(){Se(r);let o=q(2);return Te(o.removePicture())}),Z(1,"span",43),E()}if(i&2){let r=q(2);N("disabled",r.pictureUploading)}}function dne(i,e){i&1&&(S(0,"span"),A(1,"Nalagam ..."),E())}function hne(i,e){if(i&1&&(S(0,"span",39),A(1),E()),i&2){let r=q(3);P(1),mt(r.pictureError)}}function pne(i,e){if(i&1&&(S(0,"div",44),ce(1,dne,2,0,"span",10)(2,hne,2,1,"span",5),E()),i&2){let r=q(2);P(1),N("ngIf",r.pictureUploading),P(1),N("ngIf",r.pictureError)}}function fne(i,e){if(i&1&&(S(0,"div",39),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.first_name[0]," ")}}function mne(i,e){if(i&1&&(S(0,"div",39),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.last_name[0]," ")}}function gne(i,e){if(i&1&&(S(0,"div",39),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.username[0]," ")}}function _ne(i,e){if(i&1&&(S(0,"div",39),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.email[0]," ")}}function vne(i,e){if(i&1&&(S(0,"div",39),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.birth_date[0]," ")}}function yne(i,e){if(i&1&&(S(0,"div",39),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.gender[0]," ")}}function bne(i,e){if(i&1){let r=Ge();S(0,"div",2)(1,"div",3)(2,"form",4),se("ngSubmit",function(){Se(r);let o=q();return Te(o.onSubmit(o.profileForm.value))}),S(3,"h2"),A(4,"Urejanje profila"),E(),Z(5,"br"),ce(6,ane,5,2,"div",5),S(7,"div",6)(8,"div",7)(9,"div",8),se("
1331click",function(){Se(r);let o=or(18);return Te(o.click())}),ce(10,lne,1,1,"img",9)(11,cne,2,1,"span",10),E(),S(12,"div",11)(13,"button",12),se("click",function(){Se(r);let o=or(18);return Te(o.click())}),Z(14,"span",13),E(),ce(15,une,2,1,"button",14),E()(),ce(16,pne,3,2,"div",15),S(17,"input",16,17),se("change",function(o){Se(r);let n=q();return Te(n.onPictureSelected(o))}),E()(),S(19,"div",18)(20,"label",19),A(21,"Ime"),E(),Z(22,"input",20),ce(23,fne,2,1,"div",5),E(),S(24,"div",18)(25,"label",21),A(26,"Priimek"),E(),Z(27,"input",22),ce(28,mne,2,1,"div",5),E(),S(29,"div",18)(30,"label",23),A(31,"Uporabni\u0161ko ime"),E(),Z(32,"input",24),ce(33,gne,2,1,"div",5),E(),S(34,"div",18)(35,"label",25),A(36,"E-naslov"),E(),Z(37,"input",26),ce(38,_ne,2,1,"div",5),E(),S(39,"div",18)(40,"label",27),A(41,"Datum rojstva"),E(),Z(42,"input",28),ce(43,vne,2,1,"div",5),E(),S(44,"div",18)(45,"label",29),A(46,"Spol"),E(),S(47,"select",30)(48,"option",31),A(49,"-Izberi-"),E(),S(50,"option",32),A(51,"Mo\u0161ki"),E(),S(52,"option",33),A(53,"\u017Denska"),E()(),ce(54,yne,2,1,"div",5),E(),S(55,"div"),A(56," Dovoljujem uporabo osebnih podatkov za:"),Z(57,"br")(58,"input",34),A(59," po\u0161iljanje e-obvestil z raznimi novicami, ki se navezujejo na Mountains Geek ponudbo in storitve,"),Z(60,"br")(61,"input",35),A(62," spletno ogla\u0161evanje."),Z(63,"br")(64,"br"),E(),Z(65,"br"),S(66,"a",36)(67,"button",37),A(68," Prekli\u010Di "),E()(),S(69,"button",38),A(70,"Potrdi"),E()()()()}if(i&2){let r=q();P(2),N("formGroup",r.profileForm),P(4),N("ngIf",r.errorMessages!==void 0&&(r.errorMessages.non_field_errors!==void 0||r.errorMessages.detail!==void 0)),P(4),N("ngIf",r.currentPicture),P(1),N("ngIf",!r.currentPicture),P(2),N("disabled",r.pictureUploading),P(2),N("ngIf",r.currentPicture),P(1),N("ngIf",r.pictureUploading||r.pictureError),P(7),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.first_name!==void 0),P(5),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.last_name!==void 0),P(5),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.username!==void 0),P(5),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.email!==void 0),P(5),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.birth_date!==void 0),P(11),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.gender!==void 0)}}var Rz=(()=>{let e=class e{constructor(t,o,n){this.formBuilder=t,this.userService=o,this.router=n,this.profileForm=null,this.loader=!1,this.userId=0,this.currentPicture=null,this.currentUsername="",this.pictureUploading=!1,this.pictureError=null}onSubmit(t){this.loader=!0;let o=bt({},t);if(o.birth_date){let[n,d,_]=o.birth_date.split("-");o.birth_date=`${_}.${d}.${n}`}this.userService.update_user(this.userId,o).subscribe(n=>{this.router.navigate(["/profile"])},n=>{this.loader=!1,this.errorMessages=n.error})}onPictureSelected(t){let o=t.target,n=o.files&&o.files[0];if(!n)return;let d=new FormData;d.append("image",n,n.name),this.uploadPicture(d,o)}removePicture(){this.uploadPicture(new FormData,null)}uploadPicture(t,o){this.pictureError=null,this.pictureUploading=!0,this.userService.upload_picture(this.userId,t).subscribe(n=>{this.currentPicture=n.file??null,this.pictureUploading=!1,o&&(o.value="")},()=>{this.pictureUploading=!1,this.pictureError="Slike ni bilo mogo\u010De nalo\u017Eiti. Poskusite znova.",o&&(o.value="")})}ngOnInit(){this.loader=!0,this.userId=parseInt(localStorage.getItem("userID")),this.profileForm=this.formBuilder.group({first_name:["",Wt.required],last_name:["",Wt.required],username:["",Wt.required],email:["",Wt.required],birth_date:[""],gender:[""],allow_notifications:[!1],allow_online_advertising:[!1]}),this.userService.get_user(this.userId).subscribe(t=>{this.profileForm=this.formBuilder.group({first_name:[t.first_name,Wt.required],last_name:[t.last_name,Wt.required],username:[t.username,Wt.required],email:[t.email,Wt.required],birth_date:[t.birth_date],gender:[t.gender],allow_notifications:[t.allow_notifications],allow_online_advertising:[t.allow_online_advertising]}),this.currentPicture=t.picture??null,this.currentUsername=t.username??"",this.loader=!1},t=>{t.status===401&&(this.userService.logout(),this.router.navigate(["/login"]))})}};e.\u0275fac=function(o){return new(o||e)(ae(ro),ae(Ti),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-profile-edit"]],standalone:!0,features:[It([Ti]),gt],decls:3,vars:4,consts:[["src","/assets/images/loader.gif",1,"mobile-100-percent-width"],["class","center-box",4,"ngIf"],[1,"center-box"],[1,"center-box-inner"],[3,"formGroup","ngSubmit"],["class","error-message",4,"ngIf"],[1,"avatar-edit-row"],[1,"avatar-edit-preview"],[1,"avatar-edit-circle",3,"click"],["alt","Profilna slika",3,"src",4,"ngIf"],[4,"ngIf"],[1,"avatar-edit-badges"],["type","button","title","Zamenjaj sliko","aria-label","Zamenjaj sliko",1,"avatar-edit-badge","avatar-edit-badge-primary",3,"disabled","click"],[1,"avatar-edit-badge-icon","avatar-edit-badge-icon-camera"],["type","button","class","avatar-edit-badge avatar-edit-badge-danger","title","Odstrani sliko","aria-label","Odstrani sliko",3,"disabled","click",4,"ngIf"],["class","avatar-edit-status",4,"ngIf"],["type","file","accept","image/*",1,"hidden",3,"change"],["pictureInput",""],[1,"form-field"],["for","first_name"],["type","text","id","first_name","name","first_name","formControlName","first_name",1,"form-control"],["for","last_name"],["type","text","id","last_name","name","last_name","formControlName","last_name",1,"form-control"],["for","username"],["type","text","id","username","name","username","formControlName","username",1,"form-control"],["for","email"],["type","email","id","email","name","email","formControlName","email",1,"form-control"],["for","birth_date"],["type","date","id","birth_date","name","birth_date","formControlName","birth_date",1,"form-control"],["for","gender"],["id","gender","name","gender","formControlName","gender",1,"form-control"],["value",""],["value","male"],["value","female"],["type","checkbox","formControlName","allow_notifications","name","allow_notifications","value","True"],["type","checkbox","formControlName","allow_online_advertising","name","allow_online_advertising","value","True"],["routerLink","/profile",2,"text-decoration","none"],["type","button",1,"btn","btn-default","btn-pill"],["type","submit",1,"btn","btn-primary","btn-pill","float-right"],[1,"error-message"],[4,"ngFor","ngForOf"],["alt","Profilna slika",3,"src"],["type","button","title","Odstrani sliko","aria-label","Odstrani sliko",1,"avatar-edit-badge","avatar-edit-badge-danger",3,"disabled","click"],[1,"avatar-edit-badge-icon","avatar-edit-badge-icon-remove"],[1,"avatar-edit-status"]],template:function(o,n){o&1&&(S(0,"div"),Z(1,"img",0),E(),ce(2,bne,71,13,"div",1)),o&2&&(ki("",n.loader?"":"hidden"," loader center-text margin-5"),P(2),N("ngIf",!n.loader))},dependencies:[Nr,no,xf,wf,Fr,$_,bf,to,io,oo,qr,Wr,Dt,ti,At,qi],styles:['.avatar-edit-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;margin-bottom:25px}.avatar-edit-preview[_ngcontent-%COMP%]{position:relative;width:100px;height:100px;flex-shrink:0}
1331.avatar-edit-circle[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:50%;overflow:hidden;background:var(--color-accent);color:#fff;display:flex;align-items:center;justify-content:center;font-size:32pt;font-weight:600;cursor:pointer}.avatar-edit-circle[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.avatar-edit-badges[_ngcontent-%COMP%]{position:absolute;bottom:-2px;right:-2px;display:flex;gap:6px}.avatar-edit-badge[_ngcontent-%COMP%]{width:30px;height:30px;border-radius:50%;border:2px solid var(--color-surface);padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:var(--shadow-sm);transition:background var(--transition-fast),transform var(--transition-fast)}.avatar-edit-badge[_ngcontent-%COMP%]:hover:not(:disabled){transform:scale(1.08)}.avatar-edit-badge[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:default}.avatar-edit-badge-primary[_ngcontent-%COMP%]{background:var(--color-accent)}.avatar-edit-badge-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-hover)}.avatar-edit-badge-danger[_ngcontent-%COMP%]{background:var(--color-danger)}.avatar-edit-badge-danger[_ngcontent-%COMP%]:hover:not(:disabled){background:#d32f2f}.avatar-edit-badge-icon-camera[_ngcontent-%COMP%]{width:13px;height:10px;background:white;border-radius:2px;position:relative}.avatar-edit-badge-icon-camera[_ngcontent-%COMP%]:before{content:"";position:absolute;top:-3px;left:3px;width:6px;height:3px;background:white;border-radius:1px 1px 0 0}.avatar-edit-badge-icon-camera[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:50%;width:4px;height:4px;border-radius:50%;background:var(--color-accent);transform:translate(-50%,-50%)}.avatar-edit-badge-icon-remove[_ngcontent-%COMP%]{width:11px;height:11px;position:relative}.avatar-edit-badge-icon-remove[_ngcontent-%COMP%]:before, .avatar-edit-badge-icon-remove[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:0;width:100%;height:2px;background:white;border-radius:1px}.avatar-edit-badge-icon-remove[_ngcontent-%COMP%]:before{transform:rotate(45deg)}.avatar-edit-badge-icon-remove[_ngcontent-%COMP%]:after{transform:rotate(-45deg)}.avatar-edit-status[_ngcontent-%COMP%]{font-size:var(--font-size-sm);color:#666}']});let i=e;return i})();function xne(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function wne(i,e){if(i&1&&(S(0,"li"),A(1),E()),i&2){let r=q(3);P(1),mt(r.errorMessages.detail)}}function Cne(i,e){if(i&1&&(S(0,"div",16),A(1," Error messages: "),S(2,"ul"),ce(3,xne,2,1,"li",17)(4,wne,2,1,"li",18),E()()),i&2){let r=q(2);P(3),N("ngForOf",r.errorMessages.non_field_errors),P(1),N("ngIf",r.errorMessages.detail)}}function Ene(i,e){if(i&1&&(S(0,"div",16),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.old_password[0]," ")}}function Sne(i,e){if(i&1&&(S(0,"div",16),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.password[0]," ")}}function Tne(i,e){if(i&1&&(S(0,"div",16),A(1),E()),i&2){let r=q(2);P(1),We(" ",r.errorMessages.new_password_submit[0]," ")}}function Ine(i,e){if(i&1){let r=Ge();S(0,"div",2)(1,"div",3)(2,"form",4),se("ngSubmit",function(){Se(r);let o=q();return Te(o.onSubmit(o.profilecpForm.value))}),S(3,"h2"),A(4,"Spreminjanje gesla"),E(),Z(5,"br"),ce(6,Cne,5,2,"div",5),S(7,"div",6)(8,"label",7),A(9,"Staro geslo"),E(),Z(10,"input",8),ce(11,Ene,2,1,"div",5),E(),S(12,"div",6)(13,"label",9),A(14,"Novo geslo"),E(),Z(15,"input",10),ce(16,Sne,2,1,"div",5),E(),S(17,"div",6)(18,"label",11),A(19,"Ponovi geslo"),E(),Z(20,"input",12),ce(21,Tne,2,1,"div",5),E(),S(22,"a",13)(23,"button",14),A(24," Prekli\u010Di "),E()(),S(25,"button",15),A(26,"Potrdi"),E()()()()}if(i&2){let r=q();P(2),N("formGroup",r.profilecpForm),P(4),N("ngIf",r.errorMessages!==void 0&&(r.errorMessages.non_field_errors!==void 0||r.errorMessages.detail!==void 0)),P(5),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.old_password!==void 0),P(5),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.password!==void 0),P(5),N("ngIf",r.errorMessages!==void 0&&r.errorMessages.new_password_submit!==void 0)}}var Lz=(()=>{let e=class e{constructor(t,o,n){this.formBuilder=t,this.userService=o,this.router=n,this.profilecpForm=null,this.loader=!1}onSubmit(t){this.loader=!0,this.userService.update_password(parseInt(localStorage.getItem("userID")),t).subscribe(o=>{this.router.navigate(["/profile"])},o=>{o.status==401&&(this.userService.logout(),this.router.navigate(["/login"])),this.loader=!1,this.errorMessages=o.error})}ngOnInit(){this.loader=!1,this.profilecpForm=this.formBuilder.group({old_password:["",Wt.required],password:["",Wt.required],new_password_submit:["",Wt.required]})}};e.\u0275fac=function(o){return new(o||e)(ae(ro),ae(Ti),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-profile-change-password"]],standalone:!0,features:[gt],decls:3,vars:4,consts:[["src","/assets/images/loader.gif",1,"mobile-100-percent-width"],["class","center-box",4,"ngIf"],[1,"center-box"],[1,"center-box-inner"],[3,"formGroup","ngSubmit"],["class","error-message",4,"ngIf"],[1,"form-field"],["for","old_password"],["type","password","id","old_password","name","old_password","formControlName","old_password",1,"form-control"],["for","password"],["type","password","id","password","name","password","formControlName","password",1,"form-control"],["for","new_password_submit"],["type","password","id","new_password_submit","name","new_password_submit","formControlName","new_password_submit",1,"form-control"],["routerLink","/profile",2,"text-decoration","none"],["type","button",1,"btn","btn-default","btn-pill"],["type","submit",1,"btn","btn-primary","btn-pill","float-right"],[1,"error-message"],[4,"ngFor","ngForOf"],[4,"ngIf"]],template:function(o,n){o&1&&(S(0,"div"),Z(1,"img",0),E(),ce(2,Ine,27,5,"div",1)),o&2&&(ki("",n.loader?"":"hidden"," loader center-text margin-5"),P(2),N("ngIf",!n.loader))},dependencies:[Nr,no,Fr,to,io,oo,qr,Wr,Dt,ti,At,qi]});let i=e;return i})();function Dne(i,e){if(i&1&&(S(0,"div"),A(1),E()),i&2){let r=e.$implicit;P(1),We(" ",r," ")}}function Mne(i,e){if(i&1&&(S(0,"div",1),ce(1,Dne,2,1,"div",2),S(2,"a",3),A(3,"Domov >>"),E()()),i&2){let r=q();P(1),N("ngForOf",r.errorMessages.non_field_errors)}}var Fz=(()=>{let e=class e{constructor(t,o,n){this.route=t,this.router=o,this.userService=n,this.id=null,this.activationKey=null}ngOnInit(){this.sub=this.route.params.subscribe(t=>{this.id=+t.id,this.activationKey=t.activation_key;let o={email_confirmed:!0,activation_key:this.activationKey};this.userService.activate(this.id,o).subscribe(n=>{this.router.navigate(["/"])},n=>{this.errorMessages=n.error})})}};e.\u0275fac=function(o){return new(o||e)(ae(Gi),ae(si),ae(Ti))},e.\u0275cmp=st({type:e,selectors:[["app-profile-activate"]],standalone:!0,features:[It([Ti]),gt],decls:1,vars:1,consts:[["class","error-message",4,"ngIf"],[1,"error-message"],[4,"ngFor","ngForOf"],["routerLink","/",2,"color","blue"]],template:function(o,n){o&1&&ce(0,Mne,4,1,"div",0),o&2&&N("ngIf",n.errorMessages)},dependencies:[Dt,ti,At,qi]});let i=e;return i})();var O1=(()=>{let e=class e{constructor(t){this.http=t}getSitemap(){return this.http.get("/sitemap",{responseType:"text"})}};e.\u0275fac=function(o){return new(o||e)(Ve(ln))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac});let i=e;return i})();var Nz=(()=>{let e=class e{constructor(t,o){this.sitemapService=t,this.sanitizer=o,this.data=null}ngOnInit(){this.sitemapService.getSitemap().subscribe(t=>{this.sitemap=t})}};e.\u0275fac=function(o){return new(o||e)(ae(O1),ae(__))},e.\u0275cmp=st({type:e,selectors:[["app-sitemap"]],standalone:!0,features:[It([O1]),gt],decls:2,vars:1,template:function(o,n){o&1&&(S(0,"pre"),A(1),E()),o&2&&(P(1),mt(n.sitemap))}});let i=e;return i})();var zz=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=st({type:e,selectors:[["app-delete-user"]],standalone:!0,features:[gt],decls:24,vars:0,consts:[[1,"margin-10-top","margin-10-bottom","middle"],["href","mailto: [email protected]"]],template:function(o,n){o&1&&(S(0,"div",0)(1,"h1"),A(2,"IZBRIS UPORABNIKA"),E(),Z(3,"br"),S(4,"p"),A(5,"Za izbris uporabnika po\u0161ljite elektronsko sporo\u010Dilo iz elektronskega naslova, ki ga uporabljate za prijavo v aplikacijo ali spletno stran Mountains Geek, na "),S(6,"a",1),A(7,"[email protected]"),E(),A(8,'. V zadevo vpi\u0161ite "Izbris uporabnika". Prejeli boste odgovor za potrditev izbrisa. Po potrditvi bo uporabnik nepreklicno izbrisan, kar pomeni:'),E(),S(9,"ul")(10,"li"),A(11,"Uporabnikovi osebni podatki, kot so ime, priimek, elektronski naslov, naslov ter spol bodo anonimizirani,"),E(),S(12,"li"),A(13,"uporabniku bo onemogo\u010Den dostop do strani in delov aplikacije dostopnih s prijavo,"),E(),S(14,"li"),A(15,"podatki kot so osebne GPS sledi ter vpisi v vpisno knjigo bodo izbrisani,"),E(),S(16,"li"),A(17,"komentarji uporabnika se ohranijo, komentator postane anonimiziran uporabnik,"),E(),S(18,"li"),A(19,"ocene uporabnika se ohranijo, ocenjevalec postane anonimiziran uporabnik,"),E(),S(20,"li"),A(21,"podatki deljeni z Mountains Geek skupnostjo, kot so opisi poti, destinacije, slike poti in destinacij ter GPS sledi, se ohranijo,"),E(),S(22,"li"),A(23,"po izbrisu uporabnika, uporabi\u0161kega ra\u010Duna ni ve\u010D mogo\u010De obnoviti."),E()()())}});let i=e;return i})();var jz=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=st({type:e,selectors:[["app-app-privacy-policy"]],standalone:!0,features:[gt],decls:140,vars:0,consts:[[1,"margin-10-top","margin-10-bottom","middle"],["href","mailto: [email protected]"],["href","/delete_user"]],template:function(o,n){o&1&&(S(0,"div",0)(1,"h1"),A(2,"Politika zasebnosti pri uporabi aplikacije Mountains Geek"),E(),S(3,"p"),A(4,"Datum za\u010Detka veljavnosti: 10.6.2024"),E(),S(5,"p"),A(6," Aidi d.o.o. upravlja mobilno aplikacijo Mountains Geek (\u201Eaplikacija\u201C). Na tej strani vas obve\u0161\u010Damo o na\u0161ih pravilih glede zbiranja, uporabe in raz
1331kritja osebnih podatkov, ko uporabljate na\u0161o aplikacijo. "),E(),S(7,"h2"),A(8,"1. Zbiranje in uporaba informacij"),E(),Z(9,"br"),S(10,"p"),A(11,"Za zagotavljanje in izbolj\u0161anje na\u0161e aplikacije zbiramo ve\u010D vrst informacij za razli\u010Dne namene."),E(),S(12,"h3"),A(13,"Osebni podatki"),E(),S(14,"p"),A(15,"Med uporabo na\u0161e aplikacije vas lahko prosimo, da nam posredujete dolo\u010Dene osebne podatke, ki jih je mogo\u010De uporabiti za stik z vami ali va\u0161o identifikacijo (\u201Eosebni podatki\u201C). Osebni podatki lahko med drugim vklju\u010Dujejo:"),E(),S(16,"ul")(17,"li"),A(18,"Ime"),E(),S(19,"li"),A(20,"Priimek"),E(),S(21,"li"),A(22,"E-po\u0161tni naslov"),E(),S(23,"li"),A(24,"Uporabni\u0161ko ime"),E(),S(25,"li"),A(26,"Podatke o lokaciji (za GPS navigacijo in vpise v e-vpisno knjigo)"),E()(),Z(27,"br"),S(28,"h3"),A(29,"Podatki o uporabi"),E(),S(30,"p"),A(31,"Zbiramo lahko tudi podatke o tem, kako se do aplikacije dostopa in kako se uporablja (\u201Epodatki o uporabi\u201C). Ti podatki o uporabi lahko vklju\u010Dujejo informacije, kot so naslov internetnega protokola (IP) va\u0161e naprave, vrsta naprave, razli\u010Dica operacijskega sistema, konfiguracija aplikacije pri uporabi na\u0161e storitve, \u010Das in datum va\u0161e uporabe aplikacije ter drugi statisti\u010Dni podatki."),E(),S(32,"h3"),A(33,"Podatki o napakah"),E(),S(34,"p"),A(35,"\u010Ce aplikacija odpove ali naleti na napako, v va\u0161em telefonu zbiramo podatke in informacije (prek izdelkov tretjih oseb), ki se imenujejo podatki o napakah. Ti podatki o trkih lahko vklju\u010Dujejo informacije, kot so naslov internetnega protokola (IP) va\u0161e naprave, ime naprave, razli\u010Dica operacijskega sistema, konfiguracija aplikacije pri uporabi na\u0161e storitve, \u010Das in datum va\u0161e uporabe aplikacije ter druge statisti\u010Dne podatke."),E(),S(36,"h2"),A(37,"2. Uporaba podatkov"),E(),Z(38,"br"),S(39,"p"),A(40,"Zbrane podatke uporabljamo za razli\u010Dne namene:"),E(),S(41,"ul")(42,"li"),A(43,"za zagotavljanje in vzdr\u017Eevanje na\u0161e aplikacije,"),E(),S(44,"li"),A(45,"za obve\u0161\u010Danje o spremembah na\u0161e aplikacije,"),E(),S(46,"li"),A(47,"da vam omogo\u010Dimo sodelovanje v interaktivnih funkcijah na\u0161e aplikacije, \u010De se za to odlo\u010Dite,"),E(),S(48,"li"),A(49,"za zagotavljanje podpore strankam,"),E(),S(50,"li"),A(51,"za zbiranje analiz ali dragocenih informacij, da lahko izbolj\u0161amo svojo aplikacijo,"),E(),S(52,"li"),A(53,"za spremljanje uporabe na\u0161e aplikacije,"),E(),S(54,"li"),A(55,"za odkrivanje, prepre\u010Devanje in odpravljanje tehni\u010Dnih te\u017Eav,"),E(),S(56,"li"),A(57,"za razumevanje in analizo, kako uporabljate na\u0161o aplikacijo,"),E(),S(58,"li"),A(59,"za popravljanje in izbolj\u0161evanje aplikacije."),E()(),Z(60,"br"),S(61,"h2"),A(62,"3. Podatki o lokaciji"),E(),Z(63,"br"),S(64,"p"),A(65,"Uporabljamo in shranjujemo lahko podatke o va\u0161i lokaciji, \u010De nam to dovolite (\u201Epodatki o lokaciji\u201C). Te podatke uporabljamo za zagotavljanje funkcij na\u0161e Aplikacije ter za izbolj\u0161anje in prilagajanje na\u0161e Aplikacije. Ko uporabljate na\u0161o aplikacijo, lahko v nastavitvah svoje naprave kadar koli omogo\u010Dite ali onemogo\u010Dite lokacijske storitve."),E(),S(66,"h2"),A(67,"4. Politika hrambe in brisanja podatkov"),E(),Z(68,"br"),S(69,"p"),A(70,"Va\u0161e osebne podatke bomo hranili le toliko \u010Dasa, kolikor je potrebno za namene, dolo\u010Dene v tem pravilniku o zasebnosti. Uporabniki lahko zahtevajo izbris svojih podatkov z upo\u0161tevanjem navodil, ki so na voljo na tej povezavi."),E(),S(71,"h2"),A(72,"5. Razkritje podatkov"),E(),Z(73,"br"),S(74,"p"),A(75,"Va\u0161e osebne podatke lahko razkrijemo v dobri veri, da je tak\u0161no dejanje potrebno za:"),E(),S(76,"ul")(77,"li"),A(78,"izpolnjevanje zakonskih obveznosti,"),E(),S(79,"li"),A(80,"za za\u0161\u010Dito in obrambo pravic ali lastnine podjetja Aidi d.o.o.,"),E(),S(81,"li"),A(82,"prepre\u010Dimo ali razi\u0161\u010Demo morebitne nepravilnosti v zvezi z aplikacijo,"),E(),S(83,"li"),A(84,"za\u0161\u010Dita osebne varnosti uporabnikov aplikacije ali javnosti,"),E(),S(85,"li"),A(86,"za\u0161\u010Dito pred pravno odgovornostjo."),E()(),Z(87,"br"),S(88,"h2"),A(89,"6. Varnost podatkov"),E(),Z(90,"br"),S(91,"p"),A(92,"Cenimo va\u0161e zaupanje, da nam posredujete svoje osebne podatke, zato si prizadevamo uporabljati komercialno sprejemljiva sredstva za njihovo za\u0161\u010Dito. Vendar ne pozabite, da noben na\u010Din prenosa prek interneta ali na\u010Din ele
1331ktronskega shranjevanja ni 100-odstotno varen in zanesljiv, zato ne moremo zagotoviti njegove popolne varnosti."),E(),S(93,"h2"),A(94,"7. Spremembe tega pravilnika o zasebnosti"),E(),Z(95,"br"),S(96,"p"),A(97,"Svoj pravilnik o zasebnosti lahko ob\u010Dasno posodobimo. Zato vam svetujemo, da ob\u010Dasno pregledate to stran in preverite morebitne spremembe. O morebitnih spremembah vas bomo obvestili z objavo novega pravilnika o zasebnosti na tej strani. Te spremembe za\u010Dnejo veljati takoj po objavi na tej strani."),E(),S(98,"h2"),A(99,"8. Pi\u0161ite nam"),E(),S(100,"p"),A(101,"\u010Ce imate kakr\u0161na koli vpra\u0161anja ali predloge v zvezi z na\u0161im pravilnikom o zasebnosti, se obrnite na nas na naslov:"),E(),S(102,"p"),A(103," Aidi d.o.o."),Z(104,"br"),A(105," Zatolmin 64d,"),Z(106,"br"),A(107," 5220 Tolmin"),Z(108,"br"),A(109," Elektronska po\u0161ta: "),S(110,"a",1),A(111,"[email protected]"),E()(),S(112,"h2"),A(113,"9. Storitve tretjih oseb"),E(),Z(114,"br"),S(115,"p"),A(116,"Aplikacija lahko vsebuje povezave do drugih spletnih mest. \u010Ce kliknete na povezavo tretje osebe, boste preusmerjeni na to spletno mesto. Upo\u0161tevajte, da s temi zunanjimi spletnimi mesti ne upravljamo mi. Zato vam svetujemo, da si ogledate pravilnik o zasebnosti teh spletnih mest. Nimamo nadzora nad vsebino, politiko zasebnosti ali prakso spletnih mest ali storitev tretjih oseb in ne prevzemamo nobene odgovornosti zanje."),E(),S(117,"h2"),A(118,"10. Ob\u010Dutljivi uporabni\u0161ki podatki"),E(),Z(119,"br"),S(120,"p"),A(121,"Ob\u010Dutljivi uporabni\u0161ki podatki vklju\u010Dujejo vse podatke, ki se lahko uporabijo za identifikacijo posameznika, ali podatke, ki so po naravi \u0161e posebej ob\u010Dutljivi. To vklju\u010Duje:"),E(),S(122,"ul")(123,"li"),A(124,"osebne identifikatorje, kot so ime, priimek, e-po\u0161tni naslov in uporabni\u0161ko ime,"),E(),S(125,"li"),A(126,"podatke o lokaciji, ki se uporabljajo za navigacijo GPS in vpis v e-vpisno knjigo,"),E(),S(127,"li"),A(128,"podatke o uporabi, ki vklju\u010Dujejo na\u010Din dostopa do aplikacije in njene uporabe,"),E(),S(129,"li"),A(130,"podatke o okvarah, ki vklju\u010Dujejo informacije, zbrane ob okvari aplikacije ali napaki."),E()(),Z(131,"br"),S(132,"h2"),A(133,"11. Politika hranjenja in brisanja podatkov"),E(),Z(134,"br"),S(135,"p"),A(136,"Va\u0161e osebne podatke bomo hranili le toliko \u010Dasa, kolikor je potrebno za namene, dolo\u010Dene v tem pravilniku o zasebnosti. Izbris svojih podatkov lahko zahtevate tako, da sledite navodilom na "),S(137,"a",2),A(138,"tej povezavi"),E(),A(139,"."),E()())}});let i=e;return i})();var Vz=(()=>{let e=class e{constructor(t,o){this.platformId=t,this.activatedRoute=o,this.platform="android"}ngOnInit(){if(Si(this.platformId)){this.platform=K_();let t=this.activatedRoute.snapshot.queryParamMap.get("src")||"direct";xu("app_download_landing_view",{source:t})}}download(t){Ss("app_download_landing_page",t)}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(Gi))},e.\u0275cmp=st({type:e,selectors:[["app-app-download"]],standalone:!0,features:[gt],decls:11,vars:4,consts:[[1,"app-download-page"],["alt","Mountains Geek","src","/assets/images/logo_orange.png",1,"app-download-logo"],[1,"app-download-subtitle"],[1,"app-download-badges"],["alt","Prenesi na Google Play","src","/assets/images/google-play-button.png",1,"app-download-badge",3,"click"],["alt","Prenesi v App Store","src","/assets/images/app-store-badge.svg",1,"app-download-badge",3,"click"],["href","/",1,"app-download-back-link"]],template:function(o,n){o&1&&(S(0,"div",0),Z(1,"img",1),S(2,"h1"),A(3,"Prenesite aplikacijo Mountains Geek"),E(),S(4,"p",2),A(5,"Brezpla\u010Dna aplikacija za pohodnike \u2013 GPS sledi izletov, vpisna knjiga na vrhovih in spletne kamere na dlani."),E(),S(6,"div",3)(7,"img",4),se("click",function(){return n.download("android")}),E(),S(8,"img",5),se("click",function(){return n.download("ios")}),E()(),S(9,"a",6),A(10,"Nazaj na spletno stran"),E()()),o&2&&(P(7),Yi("app-download-badge-highlight",n.platform==="android"),P(1),Yi("app-download-badge-highlight",n.platform==="ios"))},dependencies:[Dt],styles:[".app-download-page[_ngcontent-%COMP%]{max-width:500px;margin:60px auto;padding:20px;text-align:center}.app-download-logo[_ngcontent-%COMP%]{width:90px;margin-bottom:15px}.app-download-subtitle[_ngcontent-%COMP%]{font-size:11pt;color:#555;line-height:17pt;margin:15px 0 30px}.app-download-badges[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:15px}.app-download-badge[_ngcontent-%COMP%]{height:55px;cursor:pointer;transition:transform .15s ease}.app-download-badge-highlight[_ngcontent-%COMP%]{transform:scale(1.12)}.app-download-back-link[_ngcontent-%COMP%]{display:inline-block;margin-top:40px;color:#ea8e1f}"]});let i=e;return i})();var Bz=[{path:"",component:O3},{path:"sitemap",component:Nz},{path:"prenesi-aplikacijo",component:Vz,data:{title:"Prenesi aplikacijo | Mountains Geek | Hribi, gore in pohodni\u0161tvo",description:"Nalo\u017Eite brezpla\u010Dno aplikacijo Mountains Geek za Android in iOS - GPS sledi izletov, vpisna knjiga na vrhovih in spletne kamere."}},{path:"destinacije/dodaj",component:y0,canActivate:[So],data:{title:"Dodaj destinacijo | Mountains Geek"}},{path:"destinacije/uredi/:id",component:y0,canActivate:[So],data:{title:"Urejanje destinacije | Mountains Geek"}},{path:"destinacije/slike/:id",component:UD,canActivate:[So],data:{title:"Urejanje slik destinacije | Mountains Geek"}},{path:"destinacije/:id-or-slug",component:m0},{path:"destinacije/:id-or-slug/:tab",component:m0},{path:"poti/dodaj",component:g0,canActivate:[So],data:{title:"Dodajanje poti | Mountains Geek"}},{path:"poti/uredi/:id",component:g0,canActivate:[So],data:{title:"Urejanje poti | Mountains Geek"}},{path:"poti/slike/:id",component:BD,canActivate:[So],data:{title:"Urejanje slik poti | Mountains Geek"}},{path:"poti/:id-or-slug",component:f0},{path:"poti/:id-or-slug/:tab",component:f0},{path:"login",component:NI,data:{title:"Prijava | Mountains Geek | Hribi, gore in pohodni\u0161tvo"}},{path:"login/:redirect_url",component:NI,data:{title:"Prijava | Mountains Geek | Hribi, gore in pohodni\u0161tvo"}},{path:"register",component:U3,data:{title:"Registracija | Mountains Geek | Hribi, gore in pohodni\u0161tvo"}},{path:"password_recovery",component:zI,data:{title:"Obnovitev gesla | Mountains Geek | Hribi, gore in pohodni\u0161tvo"}},{path:"password_recovery/:id/:recovery_key",component:zI},{path:"profile",component:Oz,canActivate:[So],data:{title:"Moj profil | Mountains Geek | Hribi, gore in pohodni\u0161tvo"}},{path:"profile/edit",component:Rz,canActivate:[So],data:{title:"Urejanje mojega profila | Mountains Geek"}},{path:"profile/change_password",component:Lz,canActivate:[So],data:{title:"Sprememba gesla | Mountains Geek"}},{path:"profile/activate/:id/:activation_key",component:Fz},{path:"contact",component:B3,data:{title:"Kontakt | Mountains Geek | Hribi, gore in pohodni\u0161tvo"}},{path:"search",component:UN,data:{title:"Kam v hribe? | Mountains Geek",description:"Napredni iskalnik izletov v hribe. Tukaj lahko s pomo\u010Djo dolo\u010Danja kriterijev najdete ideje kam v hribe."}},{path:"terms_of_use",component:F3,data:{title:"Pogoji poslovanja | Mountains Geek | Hribi, gore in pohodni\u0161tvo"}},{path:"delete_user",component:zz,data:{title:"Izbris uporabnika | Mountains Geek | Hribi, gore in pohodni\u0161tvo"}},{path:"app_privacy_policy",component:jz,data:{title:"Politika zasebnosti | Mountains Geek | Hribi, gore in pohodni\u0161tvo"}},{path:"cookies",component:L3,data:{title:"Pi\u0161kotki | Mountains Geek | Hribi, gore in pohodni\u0161tvo"}},{path:"our_vision",component:R3,data:{title:"Na\u0161a vizija | Mountains Geek | Hribi, gore in pohodni\u0161tvo",description:"Predstavitev vizije ekipe in portala Mountains Geek o \u017Eelji po nastanku gorske spletne skupnosti ljubiteljev hribov, gora in pohodni\u0161tva."}},{path:"destinations/add",component:y0,canActivate:[So],data:{title:"Dodajanje destinacije | Mountains Geek"}},{path:"destinations/edit/:id",component:y0,canActivate:[So],data:{title:"Urejanje destinacije | Mountains Geek"}},{path:"destinations/images/:id",component:UD,canActivate:[So],data:{title:"Urejanje slik destinacije | Mountains Geek"}},{path:"destinations/:id-or-slug",component:m0},{path:"destinations/:id-or-slug/:slug",component:m0},{path:"roads/add",component:g0,canActivate:[So],data:{title:"Dodajanje poti | Mountains Geek"}},{path:"roads/edit/:id",component:g0,canActivate:[So],data:{title:"Urejanje poti | Mountains Geek"}},{path:"roads/images/:id",component:BD,canActivate:[So],data:{title:"Urejanje slik poti | Mountains Geek"}},{path:"roads/:id-or-slug/:slug",component:f0},{path:"roads/:id-or-slug",component:f0}];var Uz=(()=>{let e=class e{constructor(t,o){this.http=t,this.isBrowser=Si(o)}parseJwtPayLoad(t){let n=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),d=decodeURIComponent(atob(n).split("").map(_=>"%"+("00"+_.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(d)}refreshToken(){if(!this.isBrowser)return Bt(!1);let t=localStorage.getItem("token")||"",o=localStorage.getItem("refresh_token")||"";if(!t)return Bt(!1);let n=this.parseJwtPayLoad(t);if(Date.now()<n.exp*1e3)return Bt(!0);let d=new Qn({"Content-Type":"application/json; charset=UTF-8"}),_={refresh:o};return this.http.post("/users/refresh/",_,{headers:d}).pipe(ei(C=>(localStorage.setItem("token",C.access),localStorage.setItem("refresh_token",C.refresh_token),!0)),Vs(C=>(localStorage.removeItem("token"),localStorage.removeItem("refresh_token"),localStorage.removeItem("userID"),localStorage.removeItem("email"),localStorage.removeItem("email_confirmed"),localStorage.removeItem("username"),localStorage.removeItem("ads_enabled"),localStorage.removeItem("stories_enabled"),Bt(!1))))}};e.\u0275fac=function(o){return new(o||e)(Ve(ln),Ve(Qt))},e.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var Hz=(i,e)=>{let r=_t(Uz);if(i.url.endsWith("/users/refresh/"))return e(i);if(!i.url.includes("http")){let t=ss.apiURL;i=i.clone({url:t+i.url})}if(i.url.includes(ss.apiURL)){let t=i.headers.get("Content-Type");t?t=="empty"&&(i=i.clone({headers:i.headers.delete("Content-Type")})):i=i.clone({headers:i.headers.set("Content-Type","application/json")});try{return Rn(r.refreshToken()).pipe(xr(o=>{if(o){let n=localStorage.getItem("token");n&&(i=i.clone({headers:i.headers.set("Authorization",`JWT ${n}`)}))}return e(i)}))}catch(o){console.log(o)}}return e(i)};var $z={providers:[vS(vl.withConfig({accessToken:"pk.eyJ1Ijoic2lsa28iLCJhIjoiY2pld2h2dXlzMG5icDJybzlva2Rr
1331cDAwYSJ9.51NypXzcRa3DSEijVvTO9w"})),yl,{provide:nh,useValue:nh},AF(Bz),$L(),PL(RL(),OL([Hz])),yN()]};function Pne(i,e){if(i&1){let r=Ge();S(0,"div",1)(1,"p"),A(2,"Spletno mesto Mountains Geek uporablja pi\u0161kotke za zagotavljanje spletne storitve, analizo uporabe, oglasnih sistemov in funkcionalnosti, ki jih brez pi\u0161kotkov ne bi mogli nuditi. Z nadaljnjo uporabo spletnega mesta sogla\u0161ate s pi\u0161kotki. "),S(3,"a",2),A(4,"Ve\u010D o pi\u0161kotkih si lahko preberete tukaj >>"),E()(),S(5,"button",3),se("click",function(){Se(r);let o=q();return Te(o.acceptCookies())}),A(6,"OK"),E(),S(7,"button",4),se("click",function(){Se(r);let o=q();return Te(o.deleteAllCookies())}),A(8," Zapusti stran in odstrani pi\u0161kotke "),E(),Z(9,"div",5),E()}}var Gz=(()=>{let e=class e{constructor(t,o,n){this.cookieService=o,this.elementRef=n,this.notificationVisible=!1,this.cookiesAccepted=!1,this.lastMeasuredHeight=-1,this.isBrowser=Si(t)}acceptCookies(){this.cookieService.set("cookies_accepted","true",{expires:10*365,path:"/",secure:!1,sameSite:"Strict"}),this.setNotificationVisibility()}setNotificationVisibility(){this.cookiesAccepted=this.cookieService.get("cookies_accepted")==="true",this.recomputeVisibility()}isBlockedByMobileAppPromo(){if(!this.isBrowser)return!1;let t=window.innerWidth<=1e3,o=this.cookieService.get(Z_)==="true";return t&&!o}recomputeVisibility(){this.notificationVisible=!this.cookiesAccepted&&!this.isBlockedByMobileAppPromo()}pollForExternalVisibilityChange(){let t=!this.cookiesAccepted&&!this.isBlockedByMobileAppPromo();t!==this.notificationVisible&&setTimeout(()=>{this.notificationVisible=t})}deleteAllCookies(){this.cookieService.deleteAll("/",""),confirm("Ali ste prepri\u010Dani da \u017Eelite zapustiti spletno mesto Mountains Geek?")&&(location.href="https://www.google.com/")}onWindowResize(){this.recomputeVisibility(),this.updateBannerHeightVar()}updateBannerHeightVar(){let t=this.notificationVisible?this.elementRef.nativeElement.querySelector("#cookies-notification"):null,o=t?t.offsetHeight:0;o!==this.lastMeasuredHeight&&(this.lastMeasuredHeight=o,document.documentElement.style.setProperty("--cookie-banner-height",o+"px"))}ngAfterViewChecked(){this.pollForExternalVisibilityChange(),this.updateBannerHeightVar()}ngOnInit(){this.setNotificationVisibility()}ngOnDestroy(){document.documentElement.style.setProperty("--cookie-banner-height","0px")}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(xl),ae(Pi))},e.\u0275cmp=st({type:e,selectors:[["app-cookies-notification"]],hostBindings:function(o,n){o&1&&se("resize",function(){return n.onWindowResize()},!1,Jg)},standalone:!0,features:[It([xl]),gt],decls:1,vars:1,consts:[["class","padding-10","id","cookies-notification",4,"ngIf"],["id","cookies-notification",1,"padding-10"],["routerLink","/cookies"],[1,"btn","btn-sm","btn-primary","float-right","margin-5",3,"click"],[1,"btn","btn-sm","btn-default","float-right","margin-5",3,"click"],[1,"clearfix"]],template:function(o,n){o&1&&ce(0,Pne,10,0,"div",0),o&2&&N("ngIf",n.notificationVisible)},dependencies:[Dt,At,qi],styles:["#cookies-notification[_ngcontent-%COMP%]{position:fixed;z-index:999999;background:white;width:calc(100% - 20px)}.cookies-correction[_ngcontent-%COMP%]{top:173px!important}@media screen and (max-width: 450px){.cookies-correction[_ngcontent-%COMP%]{top:231px!important}}"]});let i=e;return i})();var One=["searchField"],Rne=["togglerMain"],Lne=["togglerProfile"],Fne=i=>({hidden:i});function Nne(i,e){if(i&1){let r=Ge();S(0,"app-dropdown",25),se("onSelect",function(o){Se(r);let n=q();return Te(n.select(o))})("onLoadMore",function(o){Se(r);let n=q(),d=or(27);return Te(n.loadMore(d.value,o))}),E()}if(i&2){let r=q();N("values",r.searchList)("links",r.linksList)("ngClass",kt(3,Fne,!r.searchListVisible))}}function zne(i,e){if(i&1&&Z(0,"img",37),i&2){let r=q(2);N("src",r.profilePicture,Ei)}}function jne(i,e){if(i&1&&(S(0,"b"),A(1),E()),i&2){let r=q(2);P(1),mt(r.gapp.getUserFirstChar().toUpperCase())}}function Vne(i,e){if(i&1){let r=Ge();S(0,"div")(1,"input",26,27),se("click",function(){Se(r);let o=q();return Te(o.toggle_menus("profile"))}),E(),S(3,"div",28),ce(4,zne,1,1,"img",29)(5,jne,2,1,"b",19),E(),S(6,"div",30),Z(7,"div"),E(),Z(8,"div",31),S(9,"div",32)(10,"div")(11,"div")(12,"ul")(13,"li")(14,"a",33),se("click",function(){Se(r);let o=or(2),n=q();return Te(n.toggle_menu(o))}),A(15,"Moj profil"),E()(),S(16,"li")(17,"a",34),se("click",function(){Se(r);let o=or(2),n=q();return Te(n.toggle_menu(o))}),A(18,"Vnesi novo pot"),E()(),S(19,"li")(20,"a",35),se("click",function(){Se(r);let o=or(2),n=q();return Te(n.toggle_menu(o))}
1331),A(21,"Vnesi novo destinacijo"),E()(),S(22,"li")(23,"a",36),se("click",function(){return Se(r),q().logout(),Te(!1)}),A(24,"Odjava"),E()()()()()()()}if(i&2){let r=q();P(4),N("ngIf",r.profilePicture),P(1),N("ngIf",!r.profilePicture)}}function Bne(i,e){i&1&&(S(0,"div",38)(1,"a",39),A(2,"REGISTRACIJA"),E()())}function Une(i,e){i&1&&(S(0,"div",40)(1,"a",41),A(2,"VPIS"),E()())}var qz=i=>({"menu-holder-search-visible":i}),Hne=(i,e)=>({"hidden-mobile":i,"cookies-correction":e}),Wz=(()=>{let e=class e{constructor(t,o,n,d,_,C,M){this.platformId=t,this.gapp=o,this.roadService=n,this.destinationService=d,this.userService=_,this.cookieService=C,this.router=M,this.subDests=null,this.subRoads=null,this.roadList=[],this.destinationList=[],this.searchList=[],this.searchTarget=null,this.profileMenuVisible=!1,this.mainMenuVisible=!1,this.searchListVisible=!0,this.searchMobileVisible=!1,this.linksList=[],this.finishedRoads=!1,this.offsetRoads=null,this.finishedDestinations=!1,this.offsetDestinations=null,this.cookies_accepted="false",this.changeSelectionVisible=!1,this.isBrowser=!1,this.profilePicture=null,this.isBrowser=Si(this.platformId)}ngOnInit(){if(this.gapp.localStorageItem("username")!=null){let t=parseInt(this.gapp.localStorageItem("userID"));this.userService.get_user(t).subscribe(o=>{this.profilePicture=o.picture??null})}}initSearch(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.search(t)},450)}onDocClickHandler(t){if(this.isBrowser){let o=["search","search-icon","profile-icon","menu-icon"];for(let n in o){let d=document.getElementById(o[n]);if(t.type==="mouseup"&&this.changeSelectionVisible)switch(o[n]){case"search":this.searchListVisible=!1;break;case"search-icon":t.target!==this.searchField.nativeElement&&!t.target.classList.contains("search-load-more")&&(this.searchMobileVisible=!1);break;case"profile-icon":this.profileMenuVisible=!1;break;case"menu-icon":this.mainMenuVisible=!1;break}else t.type==="mousedown"&&(!d||!d.contains(t.target))&&(this.changeSelectionVisible=!0)}t.type==="mouseup"&&this.changeSelectionVisible&&(this.changeSelectionVisible=!1)}}focusSearchBar(){this.linksList=[{name:"Napredno iskanje...",url:"/search",icon:"/assets/images/icon-search-32-black.png"}],this.searchListVisible=!0}loadMore(t,o){o==="road"?this.loadRoads(t,!0):this.loadDestinations(t,!0),this.searchListVisible=!0}search(t){t.target.value!==""?(this.loadRoads(t.target.value),this.loadDestinations(t.target.value),this.searchTarget=t.target):(this.destinationList=[],this.roadList=[],this.searchList=[])}loadRoads(t,o=!1){if(o){if(this.finishedRoads)return}else this.finishedRoads=!1,this.offsetRoads=null,this.roadList=[];this.subRoads!==null&&this.subRoads.unsubscribe(),this.subRoads=this.roadService.getRoads(15,this.offsetRoads,null,{search:t}).subscribe(n=>{this.finishedRoads=n.next==null,this.offsetRoads=n.next_offset;for(let d of n.results)this.roadList.push({value:d.id,label:d.starting_point.title+" - "+d.end_point.title,slug:d.slug,additional_data:d.name});this.roadList.length>0?this.searchList[1]={title:"Poti",values:this.roadList,type:"road",finished:n.next==null}:this.searchList.splice(1,1)})}loadDestinations(t,o=!1){if(o){if(this.finishedDestinations)return}else this.finishedDestinations=!1,this.offsetDestinations=null,this.destinationList=[];this.subDests!==null&&this.subDests.unsubscribe(),this.subDests=this.destinationService.getDestinations(15,this.offsetDestinations,null,null,null,null,null,t).subscribe(n=>{this.finishedDestinations=n.next==null,this.offsetDestinations=n.next_offset;for(let d of n.results)this.destinationList.push({value:d.id,label:d.title,slug:d.slug});this.destinationList.length>0?this.searchList[0]={title:"Destinacije",values:this.destinationList,type:"destination",finished:n.next==null}:this.searchList.splice(0,1)})}routing(t){this.profileMenuVisible=!1,this.router.navigate([t])}toggle_menu(t){t.checked=!t.checked}toggle_menus(t){switch(t){case"main":this.togglerProfile&&(this.togglerProfile.nativeElement.checked=!1);break;case"profile":this.togglerMain.nativeElement.checked=!1;break}}
1331toggle_search(){this.cookies_accepted=this.cookieService.get("cookies_accepted"),this.searchMobileVisible=!this.searchMobileVisible,setTimeout(()=>{this.searchField.nativeElement.focus()},0)}logout(){this.userService.logout(),this.profileMenuVisible=!1,this.router.navigate(["/"])}select(t){t.type==="road"?this.router.navigate(["./poti/"+t.slug]):this.router.navigate(["./destinacije/"+t.slug]),this.searchTarget.value="",this.searchTarget=null,this.roadList=[],this.destinationList=[],this.searchList=[],this.searchListVisible=!1,this.searchMobileVisible=!1}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(Du),ae(Ln),ae(sn),ae(Ti),ae(xl),ae(si))},e.\u0275cmp=st({type:e,selectors:[["app-main-navigation"]],viewQuery:function(o,n){if(o&1&&(ni(One,5),ni(Rne,5),ni(Lne,5)),o&2){let d;Xt(d=Yt())&&(n.searchField=d.first),Xt(d=Yt())&&(n.togglerMain=d.first),Xt(d=Yt())&&(n.togglerProfile=d.first)}},hostBindings:function(o,n){o&1&&se("mousedown",function(_){return n.onDocClickHandler(_)},!1,ns)("mouseup",function(_){return n.onDocClickHandler(_)},!1,ns)},standalone:!0,features:[It([Du,Ln,sn,Ti]),gt],decls:37,vars:14,consts:[["id","menu",1,"transparent-text-select",3,"ngClass"],[1,"toggler-holder"],["type","checkbox","id","toggler-checbox","aria-label","Glavna navigacija",1,"toggler","toggler-main",3,"click"],["togglerMain",""],[1,"hamburger"],[1,"main-menu","menu"],["routerLink","/",3,"click"],["routerLink","/search",3,"click"],["routerLink","/our_vision",3,"click"],["href","https://shop.mountainsgeek.com"],[1,"float-left"],["routerLink","/"],["alt","Logo","src","/assets/images/logo_orange.png","id","logo"],["id","search",3,"ngClass"],["id","search-input","placeholder","Iskanje destinacij oz. poti...",3,"keyup","click","focus"],["searchField",""],["for","search-input"],["alt","Iskanje","src","/assets/images/icon-search-32.png",1,"input-search-icon"],[3,"values","links","ngClass","onSelect","onLoadMore",4,"ngIf"],[4,"ngIf"],["class","float-right main-menu-link hidden-mobile",4,"ngIf"],["class","float-right main-menu-link",4,"ngIf"],["id","search-icon",1,"hidden","hidden-desktop","transparent-text-select",3,"click"],["alt","Iskanje","src","/assets/images/icon-search-32.png"],[1,"menu-holder",3,"ngClass"],[3,"values","links","ngClass","onSelect","onLoadMore"],["type","checkbox",1,"toggler","toggler-profile",3,"click"],["togglerProfile",""],["id","profile-icon"],["alt","Profilna slika",3,"src",4,"ngIf"],["id","profile-icon-close"],[1,"toggler-holder","toggler-holder-profile"],[1,"profile-menu","menu"],["routerLink","/profile",3,"click"],["routerLink","/roads/add",3,"click"],["routerLink","/destinations/add",3,"click"],["href","#",3,"click"],["alt","Profilna slika",3,"src"],[1,"float-right","main-menu-link","hidden-mobile"],["routerLink","register"],[1,"float-right","main-menu-link"],["routerLink","login"]],template:function(o,n){if(o&1){let d=Ge();S(0,"div",0),Z(1,"div",1),S(2,"input",2,3),se("click",function(){return n.toggle_menus("main")}),E(),S(4,"div",4),Z(5,"div"),E(),S(6,"div",5)(7,"div")(8,"div")(9,"ul")(10,"li")(11,"a",6),se("click",function(){Se(d);let C=or(3);return Te(n.toggle_menu(C))}),A(12,"Domov"),E()(),S(13,"li")(14,"a",7),se("click",function(){Se(d);let C=or(3);return Te(n.toggle_menu(C))}),A(15,"Napredno iskanje"),E()(),S(16,"li")(17,"a",8),se("click",function(){Se(d);let C=or(3);return Te(n.toggle_menu(C))}),A(18,"Na\u0161a vizija"),E()(),S(19,"li")(20,"a",9),A(21,"Trgovina"),E()()()()()(),S(22,"div",10)(23,"a",11),Z(24,"img",12),E()(),S(25,"div",13)(26,"input",14,15),se("keyup",function(C){return n.initSearch(C)})("click",function(){return n.focusSearchBar()})("focus",function(){return n.focusSearchBar()}),E(),S(28,"label",16),Z(29,"img",17),E(),ce(30,Nne,1,5,"app-dropdown",18),E(),ce(31,Vne,25,2,"div",19)(32,Bne,3,0,"div",20)(33,Une,3,0,"div",21),S(34,"div",22),se("click",function(){return n.toggle_search()}),Z(35,"img",23),E()(),Z(36,"div",24)}o&2&&(N("ngClass",kt(7,qz,n.searchMobileVisible)),P(25),N("ngClass",mn(9,Hne,!n.searchMobileVisible,!n.cookies_accepted&&n.searchMobileVisible)),P(5),N("ngIf",n.searchList.length>0||n.linksList.length>0),P(1),N("ngIf",n.gapp.localStorageItem("username")!=null),P(1),N("ngIf",n.gapp.localStorageItem("username")==null),P(1),N("ngIf",n.gapp.localStorageItem("username")==null),P(3),N("ngClass",kt(12,qz,n.searchMobileVisible)))},dependencies:[Dt,on,At,yu,qi],styles:["[_nghost-%COMP%]{display:block;height:calc(var(--cookie-banner-height, 0px) + 50px)}@media screen and (max-width: 1000px){[_nghost-%COMP%]{height:calc(var(--cookie-banner-height, 0px) + 52px)}}#menu[_ngcontent-%COMP%]{box-shadow:var(--shadow-sm)}#logo[_ngcontent-%COMP%]{transition:opacity var(--transition-fast)}#logo[_ngcontent-%COMP%]:hover{opacity:.85}#menu[_ngcontent-%COMP%]   .hamburger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{border-radius:2px;transition:transform var(--transition-base)}#menu[_ngcontent-%COMP%]   .hamburger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:before, #menu[_ngcontent-%COMP%]   .hamburger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:after{border-radius:2px;transition:top var(--transition-base),transform var(--transition-base)}#menu[_ngcontent-%COMP%]   .menu[_ngcontent-%COMP%]{align-items:stretch;justify-content:stretch}#menu[_ngcontent-%COMP%]   .menu[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{background:rgba(33,31,30,.97);border-radius:0;width:100%;height:100%;transform:none;opacity:0;visibility:hidden;transition:opacity var(--transition-base),visibility var(--transition-base)}#menu[_ngcontent-%COMP%]   .toggler-main[_ngcontent-%COMP%]:checked ~ .main-menu[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], #menu[_ngcontent-%COMP%]   .toggler-profile[_ngcontent-%COMP%]:checked ~ .profile-menu[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{opacity:1;visibility:visible}#menu[_ngcontent-%COMP%]   .menu[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{opacity:0;transform:translateY(10px);transition:opacity var(--transition-base),transform var(--transition-base)}#menu[_ngcontent-%COMP%]   .toggler-main[_ngcontent-%COMP%]:checked ~ .main-menu[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], #menu[_ngcontent-%COMP%]   .toggler-profile[_ngcontent-%COMP%]:checked ~ .profile-menu[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{opacity:1;transform:translateY(0);transition-delay:60ms}#menu[_ngcontent-%COMP%]   .menu[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{padding:.9rem 1rem}#menu[_ngcontent-%COMP%]   .menu[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{font-weight:600;letter-spacing:.3px;transition:color var(--transition-fast)}#menu[_ngcontent-%COMP%]   .menu[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover, #menu[_ngcontent-%COMP%]   .menu[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:focus-visible{color:var(--color-accent)}#search[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{border-radius:var(--radius-pill) 0 0 var(--radius-pill);padding:4px 4px 6px;
1331transition:box-shadow var(--transition-fast)}#search[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 3px var(--color-accent-soft)}#search[_ngcontent-%COMP%]   .input-search-icon[_ngcontent-%COMP%]{border-radius:0 var(--radius-pill) var(--radius-pill) 0;padding:2px 3px}#profile-icon[_ngcontent-%COMP%]{background:var(--color-accent);color:var(--color-surface);font-weight:600;transition:transform var(--transition-fast);width:34px;height:34px;padding:0;border-radius:50%;display:flex;align-items:center;justify-content:center;overflow:hidden}#profile-icon[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}#profile-icon[_ngcontent-%COMP%]:hover{transform:scale(1.05)}.main-menu-link[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{letter-spacing:.4px;padding:6px 14px;border-radius:var(--radius-pill);transition:background var(--transition-fast)}.main-menu-link[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover, .main-menu-link[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:focus-visible{background:rgba(255,255,255,.12)}@media screen and (max-width: 1000px){#menu[_ngcontent-%COMP%]   .menu[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{font-size:1.05rem}}"]});let i=e;return i})();function $ne(i,e){i&1&&Z(0,"img",15)}function Gne(i,e){i&1&&Z(0,"img",16)}function qne(i,e){if(i&1){let r=Ge();S(0,"div",17)(1,"div",18),se("click",function(){Se(r);let o=q();return Te(o.close())}),A(2,"\u2715"),E(),S(3,"div",19),Z(4,"img",20),E(),S(5,"div",21)(6,"div",22)(7,"div",23)(8,"div",24),A(9,"Mountains Geek je \u0161e bolj\u0161i v aplikaciji"),E(),S(10,"div",25),A(11,"GPS sledi, vpisna knjiga in spletne kamere na dlani."),E()(),S(12,"div",26),Z(13,"img",27),E()(),S(14,"div",28)(15,"img",29),se("click",function(){Se(r);let o=q();return Te(o.downloadAppFor("android"))}),E(),S(16,"img",30),se("click",function(){Se(r);let o=q();return Te(o.downloadAppFor("ios"))}),E()()()()}}var Zz=i=>({"hidden-mobile":i}),Kz=(()=>{let e=class e{constructor(t,o){this.platformId=t,this.cookieService=o,this.notificationVisible=!1,this.isBrowser=!1,this.platform="android",this.isBrowser=Si(this.platformId)}setSeen(){this.cookieService.set(Z_,"true",{expires:90,path:"/",secure:!1,sameSite:"Strict"}),this.setNotificationVisibility()}setNotificationVisibility(){let t=this.cookieService.get(Z_);this.notificationVisible=t!=="true",this.notificationVisible&&this.isBrowser&&xu("app_promo_shown",{link_location:LI()?"first_visit_popup_mobile":"first_visit_card_desktop"})}close(){this.setSeen()}downloadApp(){Ss(LI()?"first_visit_popup_mobile":"first_visit_card_desktop")}downloadAppFor(t){Ss("first_visit_card_desktop",t)}ngOnInit(){this.isBrowser&&(this.platform=K_()),this.setNotificationVisibility()}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(xl))},e.\u0275cmp=st({type:e,selectors:[["app-mobile-app-notification"]],standalone:!0,features:[gt],decls:24,vars:9,consts:[[1,"ps-popup-outer","popup-outer","hidden","hidden-desktop",3,"ngClass"],[1,"hidden","hidden-desktop","popup-second",3,"ngClass"],[1,"center-box"],[1,"popup-logo-band"],["alt","Mountains Geek","src","/assets/images/logo_orange.png",1,"popup-logo"],[1,"center-text","popup-body"],[1,"header-text"],[1,"benefits-list"],[1,"download-section",3,"click"],["alt","Prenesi v App Store","src","/assets/images/app-store-badge.svg","class","store-badge-image",4,"ngIf"],["alt","Prenesi na Google Play","src","/assets/images/google-play-button.png","class","store-badge-image",4,"ngIf"],[1,"margin-20","popup-actions"],["type","button",1,"btn","btn-default","btn-pill",3,"click"],["type","button",1,"btn","btn-primary","btn-pill",3,"click"],["class","desktop-app-card",4,"ngIf"],["alt","Prenesi v App Store","src","/assets/images/app-store-badge.svg",1,"store-badge-image"],["alt","Prenesi na Google Play","src","/assets/images/google-play-button.png",1,"store-badge-image"],[1,"desktop-app-card"],[1,"desktop-app-card-close",3,"click"],[1,"desktop-app-card-logo-band"],["alt","Mountains Geek","src","/assets/images/logo_orange.png",1,"desktop-app-card-logo"],[1,"desktop-app-card-body"],[1,"desktop-app-card-row"],[1,"desktop-app-card-text"],[1,"desktop-app-card-title"],[1,"desktop-app-card-subtitle"],[1,"desktop-app-card-qr-wrap"],["alt","QR koda za prenos aplikacije","src","/assets/images/app-qr-code.png",1,"desktop-app-card-qr"],[1,"desktop-app-card-badges"],["alt","Prenesi na Google Play","src","/assets/images/google-play-button.png",1,"desktop-store-badge",3,"click"],["alt","Prenesi v App Store","src","/assets/images/app-store-badge.svg",1,"desktop-store-badge",3,"click"]],template:function(o,n){o&1&&(Z(0,"div",0),S(1,"div",1)(2,"div",2)(3,"div",3),Z(4,"img",4),E(),S(5,"div",5)(6,"div",6),A(7," Mountains Geek je \u0161e bolj\u0161i v aplikaciji "),E(),S(8,"ul",7)(9,"li"),A(10,"GPS sledi in zemljevidi izletov"),E(),S(11,"li"),A(12,"Vpi\u0161i se na vrhu in deli razmere v \u017Eivo"),E(),S(13,"li"),A(14,"Spletne kamere in vreme na dlani"),E()(),S(15,"div",8),se("
1331click",function(){return n.downloadApp()}),ce(16,$ne,1,0,"img",9)(17,Gne,1,0,"img",10),E(),S(18,"div",11)(19,"button",12),se("click",function(){return n.close()}),A(20,"Nadaljuj na spletno stran"),E(),S(21,"button",13),se("click",function(){return n.downloadApp()}),A(22,"Odpri aplikacijo"),E()()()()(),ce(23,qne,17,0,"div",14)),o&2&&(N("ngClass",kt(5,Zz,!n.notificationVisible)),P(1),N("ngClass",kt(7,Zz,!n.notificationVisible)),P(15),N("ngIf",n.platform==="ios"),P(1),N("ngIf",n.platform!=="ios"),P(6),N("ngIf",n.notificationVisible))},dependencies:[Dt,on,At],styles:['.ps-popup-outer[_ngcontent-%COMP%]{z-index:9999999}.ps-close-popup[_ngcontent-%COMP%]{z-index:99999999}.popup-second[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;z-index:99999999}.center-box[_ngcontent-%COMP%]{background-color:#fff;margin-top:15%;min-height:0;border-radius:14px;overflow:hidden}.center-text[_ngcontent-%COMP%]{text-align:center}.popup-logo-band[_ngcontent-%COMP%]{background:#424040;padding:20px 20px 16px;text-align:center}.popup-logo[_ngcontent-%COMP%]{width:130px}.popup-body[_ngcontent-%COMP%]{padding:20px}.header-text[_ngcontent-%COMP%]{font-weight:700;font-size:15pt;margin-top:5px;margin-bottom:15px}.benefits-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0 0 10px;font-size:10.5pt;color:#424040;text-align:left;display:inline-block}.benefits-list[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{padding:3px 0 3px 22px;position:relative}.benefits-list[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:before{content:"\\2713";position:absolute;left:0;color:#ea8e1f;font-weight:700}.download-section[_ngcontent-%COMP%]{padding:5px;width:190px;margin:25px auto;cursor:pointer}.store-badge-image[_ngcontent-%COMP%]{width:190px}.popup-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-wrap:wrap;gap:var(--space-3, 12px)}.desktop-app-card[_ngcontent-%COMP%]{display:block;position:fixed;bottom:20px;left:20px;z-index:99999;background:white;border-radius:14px;overflow:hidden;box-shadow:0 4px 20px #0003;width:420px}.desktop-app-card-close[_ngcontent-%COMP%]{position:absolute;top:10px;right:14px;cursor:pointer;color:#cfcfcf;font-size:13pt;z-index:1}.desktop-app-card-logo-band[_ngcontent-%COMP%]{background:#424040;padding:18px 20px 14px;text-align:center}.desktop-app-card-logo[_ngcontent-%COMP%]{width:130px}.desktop-app-card-body[_ngcontent-%COMP%]{padding:18px 20px 20px}.desktop-app-card-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:18px}.desktop-app-card-text[_ngcontent-%COMP%]{flex-grow:1}.desktop-app-card-title[_ngcontent-%COMP%]{font-weight:700;font-size:13pt;line-height:1.3}.desktop-app-card-subtitle[_ngcontent-%COMP%]{font-size:10pt;color:#666;margin-top:6px;line-height:1.4}.desktop-app-card-qr-wrap[_ngcontent-%COMP%]{flex-shrink:0;padding:8px;background:white;border:1px solid var(--color-border);border-radius:10px}.desktop-app-card-qr[_ngcontent-%COMP%]{display:block;width:128px;height:128px}.desktop-app-card-badges[_ngcontent-%COMP%]{margin-top:18px;text-align:center}.desktop-store-badge[_ngcontent-%COMP%]{height:44px;margin:0 6px;cursor:pointer}@media screen and (max-width: 1000px){.desktop-app-card[_ngcontent-%COMP%]{display:none!important}}']});let i=e;return i})();var Xz=(()=>{let e=class e{};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=st({type:e,selectors:[["app-loader"]],standalone:!0,features:[gt],decls:4,vars:0,consts:[[1,"loader-wrapper"],[1,"loader"],[1,"loader-border"],["src","assets/images/ic_launcher.png","alt","Loader Icon",1,"loader-image"]],template:function(o,n){o&1&&(S(0,"div",0)(1,"div",1),Z(2,"div",2)(3,"img",3),E()())},styles:[".loader-wrapper[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%;background:white;display:flex;justify-content:center;align-items:center;z-index:999999999}.loader[_ngcontent-%COMP%]{position:relative;width:120px;height:120px;display:flex;justify-content:center;align-items:center}.loader-border[_ngcontent-%COMP%]{position:absolute;border:16px solid #f3f3f3;border-top:16px solid #e88d20;border-radius:50%;width:100%;height:100%;animation:_ngcontent-%COMP%_spin 2s linear infinite}.loader-image[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;object-fit:contain;z-index:-1;border-radius:50%;background-color:#424040}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"]});let i=e;return i})();function Wne(i,e){i&1&&Z(0,"router-outlet")}function Zne(i,e){i&1&&Z(0,"app-loader")}function Kne(i,e){i&1&&Z(0,"app-mobile-app-notification")}function Xne(i,e){i&1&&Z(0,"app-cookies-notification")}function Yne(i,e){if(i&1&&(S(0,"span"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function Qne(i,e){if(i&1){let r=Ge();S(0,"div",8)(1,"img",9),se("click",function(){Se(r);let o=q(3);return Te(o.errorMessages=null)}),E(),ce(2,Yne,2,1,"span",10),E()}if(i&2){let r=q(3);P(2),N("ngForOf",r.errorMessages)}}function Jne(i,e){if(i&1&&(S(0,"span"),A(1),E()),i&2){let r=e.$implicit;P(1),mt(r)}}function ere(i,e){if(i&1){let r=Ge();
1331S(0,"div",11)(1,"img",12),se("click",function(){Se(r);let o=q(3);return Te(o.successMessages=null)}),E(),ce(2,Jne,2,1,"span",10),E()}if(i&2){let r=q(3);P(2),N("ngForOf",r.successMessages)}}function tre(i,e){if(i&1&&(S(0,"div",5),Z(1,"app-main-navigation"),ce(2,Qne,3,1,"div",6)(3,ere,3,1,"div",7),Z(4,"router-outlet"),E()),i&2){let r=q(2);Yi("page-fullscreen",r.isFullscreenPage),P(2),N("ngIf",r.errorMessages&&r.errorMessages.length>0),P(1),N("ngIf",r.successMessages&&r.successMessages.length>0)}}function ire(i,e){if(i&1&&(S(0,"div",13)(1,"a",14),A(2,"Pogoji poslovanja"),E(),S(3,"a",15),A(4,"Zasebnost in pi\u0161kotki"),E(),S(5,"a",16),A(6,"Kontakt"),E(),Z(7,"br"),S(8,"a",17),Z(9,"img",18),E(),S(10,"a",19),Z(11,"img",20),E(),Z(12,"br"),S(13,"a",21),A(14,"Mountains Geek"),E(),A(15),$r(16,"date"),E()),i&2){let r=q(2);P(15),We(" \xA9 ",Gr(16,1,r.currentYear,"yyyy")," ")}}function nre(i,e){i&1&&Z(0,"app-popup-message")}function rre(i,e){if(i&1&&(S(0,"div",2),ce(1,Zne,1,0,"app-loader",0)(2,Kne,1,0,"app-mobile-app-notification",0)(3,Xne,1,0,"app-cookies-notification",0)(4,tre,5,4,"div",3)(5,ire,17,4,"div",4)(6,nre,1,0,"app-popup-message",0),E()),i&2){let r=q();P(1),N("ngIf",r.loaderVisible),P(1),N("ngIf",!r.loaderVisible&&r.shouldDisplayMobileAppNotification),P(1),N("ngIf",!r.loaderVisible),P(1),N("ngIf",!r.loaderVisible),P(1),N("ngIf",!r.loaderVisible&&!r.isFullscreenPage),P(1),N("ngIf",!r.loaderVisible)}}var Yz=(()=>{let e=class e{constructor(t,o,n,d,_,C,M){this.platformId=t,this.messageService=o,this.activatedRoute=n,this.router=d,this.meta=_,this.titleService=C,this.renderer=M,this.title="Mountains Geek",this.errorMessages=null,this.successMessages=null,this.carouselHidden=!0,this.currentYear=null,this.isBrowser=!1,this.sitemap=!1,this.isFullscreenPage=!1,this.loaderVisible=!0,this.shouldDisplayMobileAppNotification=!0,this.isBrowser=Si(this.platformId),this.router.events.subscribe(j=>{j instanceof zo&&(j.url.includes("sitemap")?this.sitemap=!0:this.sitemap=!1,this.isFullscreenPage=j.url.startsWith("/search")),this.renderer.listen("window","load",()=>{this.hideLoader()})})}ngOnInit(){this.currentYear=new Date,this.router.events.subscribe(t=>{this.errorMessages=null,this.successMessages=null,t instanceof zo&&(this.shouldDisplayMobileAppNotification=this.shouldDisplayNotification(t.url)),t instanceof zo&&(this.isBrowser&&window.scrollTo(0,0),this.modifyHeader(t))}),this.router.events.pipe(dn(t=>t instanceof zo),ei(()=>this.activatedRoute),ei(t=>{for(;t.firstChild;)t=t.firstChild;return t}),dn(t=>t.outlet==="primary"),jn(t=>t.data)).subscribe(t=>{t.title?this.titleService.setTitle(t.title):this.titleService.setTitle("Mountains Geek | Hribi, gore in pohodni\u0161tvo"),t.description?this.meta.addTag({name:"description",content:t.description}):this.meta.addTag({name:"description",content:"Skupnost ljubiteljev gora, hribov in pohodni\u0161tva. Tukaj lahko najde\u0161 ideje kam v hribe ali na izlet, opise poti, slike, GPS sledi, spletne kamere."})}),this.messageService.errorUpdated.subscribe(t=>{this.errorMessages=t}
1331),this.messageService.successUpdated.subscribe(t=>{this.successMessages=t})}ngAfterViewInit(){this.router.events.subscribe(t=>{})}modifyHeader(t){this.carouselHidden=t.url!=="/"}hideLoader(){setTimeout(()=>{this.loaderVisible=!1},300)}shouldDisplayNotification(t){return!t.includes("/profile/activate")&&!t.includes("/password_recovery")&&!t.includes("/prenesi-aplikacijo")}};e.\u0275fac=function(o){return new(o||e)(ae(Qt),ae(Lf),ae(Gi),ae(si),ae(Qd),ae(uc),ae(eo))},e.\u0275cmp=st({type:e,selectors:[["app-root"]],standalone:!0,features:[It([Lf,{provide:nh,useValue:nh},yl]),gt],decls:2,vars:2,consts:[[4,"ngIf"],["class","app-shell",4,"ngIf"],[1,"app-shell"],["id","page",3,"page-fullscreen",4,"ngIf"],["id","footer",4,"ngIf"],["id","page"],["class","error-message message-main",4,"ngIf"],["class","success-message message-main",4,"ngIf"],[1,"error-message","message-main"],["width","10px","src","/assets/images/close-icon-red.png",1,"float-right","btn","btn-sm",3,"click"],[4,"ngFor","ngForOf"],[1,"success-message","message-main"],["width","10px","src","/assets/images/close-icon-green.png",1,"float-right","btn","btn-sm",3,"click"],["id","footer"],["routerLink","/terms_of_use",1,"footer-link"],["routerLink","/cookies",1,"footer-link"],["routerLink","/contact",1,"footer-link"],["target","_blank","href","https://www.instagram.com/mountains_geek/","rel","noopener"],["alt","Instagram","src","/assets/images/instagram1.png","id","instagram-icon",1,"social-icon"],["target","_blank","href","https://www.facebook.com/mountainsgeek/","rel","noopener"],["alt","Facebook","src","/assets/images/facebook1.png","id","facebook-icon",1,"social-icon"],["routerLink","/"]],template:function(o,n){o&1&&ce(0,Wne,1,0,"router-outlet",0)(1,rre,7,6,"div",1),o&2&&(N("ngIf",n.sitemap),P(1),N("ngIf",!n.sitemap))},dependencies:[Dt,ti,At,Xs,sI,Gz,Bf,Wz,qi,Kz,Xz],styles:[".app-shell[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100vh}#page[_ngcontent-%COMP%]{flex:1 0 auto}.page-fullscreen[_ngcontent-%COMP%]{max-height:100vh;overflow:hidden}#footer[_ngcontent-%COMP%]{flex:none}"]});let i=e;return i})();var $D=document.createElement("script");$D.src="https://www.googletagmanager.com/gtag/js?id="+ss.googleAnalyticsID;$D.async=!0;document.head.appendChild($D);var Qz=document.createElement("script");Qz.innerHTML=`
1332  window.dataLayer = window.dataLayer || [];
1333  function gtag(){dataLayer.push(arguments);}
1334  gtag('js', new Date());
1335  gtag('config', '`+ss.googleAnalyticsID+`');
1336`;document.head.appendChild(Qz);UL(Yz,$z).catch(i=>console.error(i));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.