1/*! For license information please see listings-page.5a81f74f.js.LICENSE.txt */ 2(self.webpackChunkstw_seems=self.webpackChunkstw_seems||[]).push([[199,298,498,990],{6659:function(e,t,i){var n={"./map-marker-em.svg":3454,"./map-marker.svg":5699};function r(e){var t=o(e);return i(t)}function o(e){if(!i.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=o,e.exports=r,r.id=6659},1578:function(e,t,i){"use strict";i.d(t,{A:function(){return s}});i(4423),i(4114),i(8992),i(3949);var n=class{constructor(e){this.setDocument(e)}createImpotentAnchor(e,t){t=Object.assign(t||{},{href:"javascript:"});const i=this.getDocument().createElement("a");return"string"==typeof e?i.innerHTML=e:i.append(e),Object.entries(t).forEach(function(e){i.setAttribute(e[0],e[1])}),i}setDocument(e){return this.document=e,this}getDocument(){return this.document}},r=i(9295);i(1454);class o{static alertTypeIcons={info:"fa-info-circle",warning:"fa-exclamation-triangle",danger:"fa-skull-crossbones",success:"fa-smile"};static createAttributesHtml(e){const t=[];return Object.entries(e).forEach(function(e){const i=e[1];if(null==i)return;const n="boolean"==typeof i?i?"1":"0":String(i);t.push(`${e[0]}="${n}"`)}),t.join(" ")}attachHtmlTo(e,t,i){const n=t.appendChild(t.ownerDocument.createElement("template"));return n.innerHTML=e,t[i](n.content),n.remove(),"append"===i?t.lastElementChild:t.firstElementChild}appendHtmlTo(e,t){return this.attachHtmlTo(e,t,"append")}prependHtmlTo(e,t){return this.attachHtmlTo(e,t,"prepend")}createButton(e,t,i){let n="",r={};void 0!==t&&("string"==typeof t?(n=t,r=i||{}):r=t);const s=`btn ${n}`,a=Object.assign({type:"button"},r);return void 0===a.class?a.class=s:null!==a.class&&a.class.indexOf("%defaults%")>=0&&(a.class=a.class.replace("%defaults%",s)),`<button ${o.createAttributesHtml(a)}>${e}</button>`}createIcon(e,t={}){const i=e.split("."),n=i[1]||"l",r={l:"fa-light",r:"fa-regular",s:"fa-solid"}[n];if(!r)throw new Error(`The weight abbreviation, \`${n}\`, is invalid`);const o=`fa-sharp ${r} ${i[0]}`,s=Object.assign({"aria-hidden":"true"},t,{class:`${o} `+(t.class||"")});let a="";return Object.entries(s).forEach(function(e){a+=` ${e[0]}="${e[1]}"`}),`<i${a}></i>`}createIconWithText(e,t,i=!0){if(void 0===t)return this.createIcon(e);let n="";return i||(n='class="visually-hidden"'),this.createIcon(e,{})+` <span ${n}>${t}</span>`}createAccountRating(e,t){const i="account",n=`${i}__rating`;return`<span class="${i}">\n <span\n class="${n} ${n}--${t}"\n title="#${e} ${t}"\n >${this.createIconWithText("fa-star",t,!0)}</span>\n </span>`}createRemoveIcon(e){return this.createIconWithText("fa-trash-can",e)}createClearIcon(e,t=!0){return this.createIconWithText("fa-times",e,t)}createBooleanIcon(e){return this.createIcon(1===parseInt(e,10)?"fa-check":"fa-times")}createAlertTypeIcon(e,t={}){const i=o.alertTypeIcons[e];if(!i)throw new Error(`The alert-type \`${e}\` is invalid`);return this.createIcon(i,t)}createMaximizeIcon(e){return this.createIconWithText(e?"fa-expand-alt":"fa-compress-alt",e?"Maximize":"Minimize",!1)}createAddIcon(e){return this.createIconWithText("fa-plus",e,!1)}createToast(e,t,i="SeeMS"){const n=`text-bg-${e}`,r=this.createAlertTypeIcon(e,{role:"img",class:"flex-shrink-0 me-2"});return`\n <div class="toast overflow-hidden border-0 flash-message" role="alert" aria-live="assertive" aria-atomic="true">\n <div class="toast-header ${n}">\n <strong class="me-auto">${i}</strong>\n ${this.createButton("",{class:"btn-close btn-close-white","data-bs-dismiss":"toast","aria-label":"Close"})}\n </div>\n <div class="toast-body d-flex align-items-center ${n}">${r}<div>${t}</div></div>\n </div>\n `}createAddButton(e){return this.createButton(this.createAddIcon(e),"btn btn-sm btn-success")}createGoogleStaticMapUrl(e,t,n,r,o,s){const a=`${t},${n}`,l={center:a,zoom:r,size:`${o}x${s}`,markers:`icon:${new URL(i(5497),i.b).toString()}|${a}`,key:e};
2return`https://maps.googleapis.com/maps/api/staticmap?${Object.entries(l).map(function(e){return`${e[0]}=${e[1]}`}).join("&")}`}}class s{static createAllBySelector(e,t){t.querySelectorAll(e).forEach(e=>{new this(e)})}constructor(e,t={}){this.initialize(e,t)}initialize(e,t){this.setEventHandlerArgsArray().setRootElem(e).setOptions(t),this.setUp()}reconstruct(e,t){this.tearDown();const i="string"==typeof e?r.A.replaceOuterHtml(this.getRootElem(),e):e;this.initialize(i,t||this.getOptions())}addEventListenerTo(e,t,i,n){const r=[e,t,i,n];return e.addEventListener(t,i,n),this.getEventHandlerArgsArray().push(r),this}addEventListener(e,t){return this.addEventListenerTo(this.getRootElem(),e,t)}setUp(){}tearDown(){this.getEventHandlerArgsArray().forEach(e=>{const[t,i,n,r]=e;t.removeEventListener(i,n,r)}),this.setEventHandlerArgsArray()}setEventHandlerArgsArray(e=[]){return this.eventHandlerArgsArray=e,this}getEventHandlerArgsArray(){return this.eventHandlerArgsArray}setRootElem(e){if(!(e instanceof HTMLElement))throw new Error("The root element is not an `HTMLElement`");return this.rootElem=e,this}getRootElem(){return this.rootElem}setOptions(e){return this.options=e,this}getOptions(){return this.options}getDocument(){return this.getRootElem().ownerDocument}getWindow(){return this.getDocument().defaultView}getHtmlHelper(){return void 0===this.htmlHelper&&(this.htmlHelper=new o),this.htmlHelper}getDomHelper(){return void 0===this.domHelper&&(this.domHelper=new n(this.getDocument())),this.domHelper}data(e,t){return void 0===t?this.getRootElem().dataset[e]:null===t?(delete this.getRootElem().dataset[e],this):(this.getRootElem().dataset[e]=t,this)}dataInt(e){return parseInt(this.data(e),10)}dataBool(e){return e in this.getRootElem().dataset&&["",e].includes(this.getRootElem().dataset[e])}dataString(e){return String(this.data(e))}toggleCssClass(e,t){return this.getRootElem().classList.toggle(e,t),this}}},5611:function(e,t){"use strict";t.A=class{constructor(e){this.setEvent(e)}fromInput(e){const t=this.getTarget();return"INPUT"===t.tagName&&(void 0===e||t.type===e)}fromCheckbox(){return this.fromInput("checkbox")}getActionTarget(e,t=1){let i=this.getTarget();do{if(e instanceof HTMLElement&&i===e||"string"==typeof e&&i.matches(e))return i;i=i.parentElement,t-=1}while(t>=0&&null!==i);return null}getAnchorTarget(e=1){return this.getActionTarget("a",e)}getButtonTarget(e=1){return this.getActionTarget("button",e)}getAnyActionTarget(e=1){return this.getActionTarget("a, button",e)}setEvent(e){return this.event=e,this}getEvent(){return this.event}getTarget(){return this.getEvent().target}}},9295:function(e,t,i){"use strict";var n=i(848);t.A=class{static createName(e=""){return n.A.uniqid(e)}static replaceOuterHtml(e,t){const i=e.ownerDocument.createElement("template");i.innerHTML=t;const n=i.content.firstElementChild;return e.replaceWith(n),i.remove(),n}static appendHtmlTo(e,t){const i=t.ownerDocument.createElement("template");i.innerHTML=e,t.append(...i.content.childNodes),i.remove()}}},848:function(e,t,i){"use strict";i.d(t,{A:function(){return o}});var n=i.cw(function(e,t){var n=i(6518),r=i(9565),o=i(2652),s=i(9306),a=i(8551),l=i(1767),c=i(9539),u=i(4549)("some",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:u},{some:function(e){a(this);try{s(e)}catch(e){c(this,"throw",e)}if(u)return r(u,this,e);var t=l(this),i=0;return o(t,function(t,n){if(e(t,i++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}),r=i.cw(function(e,t){n()});i(4423),i(8992);r();var o=class{static nvl(e,t){return null===e?t:e}static simpleDeepClone(e){return JSON.parse(JSON.stringify(e))}static isPlainObject(e){return e&&[void 0,Object].includes(e.constructor)}static toDecimalInteger(e){return parseInt(e,10)}static isPositiveNumber(e){const t=this.toDecimalInteger(e);return!isNaN(t)&&t>0}static onlyDigits(e){return!e.split("").some(function(e){const t=e.charCodeAt(0);return!(t>=48&&t<=57)})}static uniqid(e=""){return e+Date.now().toString(36)+Math.random().toString(36).substr(2)}static isTouchDevice(){return window.matchMedia("(pointer: coarse)").matches}static isDesktop(){return window.matchMedia("(min-width: 1024px)").matches}static shuffle(e){let t,i,n=e.length;for(;n;
2)i=Math.floor(Math.random()*n--),t=e[n],e[n]=e[i],e[i]=t;return e}static shadeHexColor(e,t){const i=parseInt(e.slice(1),16),n=t<0?0:255,r=t<0?-1*t:t,o=i>>16,s=i>>8&255,a=255&i;return"#"+(16777216+65536*(Math.round((n-o)*r)+o)+256*(Math.round((n-s)*r)+s)+(Math.round((n-a)*r)+a)).toString(16).slice(1)}}},9015:function(e,t,i){"use strict";i.d(t,{A:function(){return n}});i(8992),i(3949);class n{static setUpGroupOfCtas(e){if(!e)return;const t=e.querySelectorAll(".c-item-cta");if(t.length<2)return;let i;t.forEach(function(e){"TAG_booking_com_embed"===e.dataset.varmachinename&&(i=e)}),i&&t.forEach(function(e){e!==i&&e.addEventListener("click",function(e){const t=e.target.ownerDocument,n=t.createElement("img");n.src=i.href,n.alt="Cookie drop",n.style.display="none",t.body.append(n)})})}constructor(e){this.setRootElem(e),this.setUp()}setRootElem(e){return this.rootElem=e,this}getRootElem(){return this.rootElem}setUp(){n.setUpGroupOfCtas(this.getRootElem().querySelector(".main-ctas"))}}},8299:function(e,t){"use strict";class i{static EVENT_CONTENT_RELOADED="seems:content-reloaded";static TYPE_C_ITEM="MbCItem";constructor(e){this.document=e}contentReloaded(e,t){e.dispatchEvent(new CustomEvent(i.EVENT_CONTENT_RELOADED,{bubbles:!0,detail:{type:t}}))}cItemReloaded(e){this.contentReloaded(e,i.TYPE_C_ITEM)}handleContentReloaded(e){this.document.addEventListener(i.EVENT_CONTENT_RELOADED,t=>{e(t)})}}t.A=new i(document)},3132:function(e,t,i){"use strict";var n=i.cw(function(e,t){var n=i(6518),r=i(9565),o=i(9306),s=i(8551),a=i(1767),l=i(9462),c=i(6319),u=i(6395),h=i(9539),d=i(684),f=i(4549),p=!u&&!d("filter",function(){}),m=!u&&!p&&f("filter",TypeError),_=u||p||m,g=l(function(){for(var e,t,i=this.iterator,n=this.predicate,o=this.next;;){if(e=s(r(o,i)),this.done=!!e.done)return;if(t=e.value,c(i,n,[t,this.counter++],!0))return t}});n({target:"Iterator",proto:!0,real:!0,forced:_},{filter:function(e){s(this);try{o(e)}catch(e){h(this,"throw",e)}return m?r(m,this,e):new g(a(this),{predicate:e})}})}),r=i.cw(function(e,t){n()}),o=(i(6784),i(4298),i(6330)),s=(i(199),i(9048));i(7414),i(896);i(8992);r();i(3949),i(1454);var a=i(848),l=class{static normalisePositiveIntegerOrNull(e){if("number"==typeof e)return Number.isInteger(e)&&e>0?e:null;if("string"==typeof e&&/^\d+$/.test(e)){const t=Number.parseInt(e);return t>0?t:null}return null}static formatDateForFilters(e){const t=new Date(e);return`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}-${t.getDate().toString().padStart(2,"0")}`}static serialise(e){return Object.entries({...e.primary,...e.secondary}).map(([e,t])=>{if(void 0===t.value||null===t.value)return!1;if(Array.isArray(t.value)){const e=t.value.map(this.normalisePositiveIntegerOrNull).filter(e=>null!==e);return 0!==e.length&&e.map(e=>`${t.name}=${e}`).join("&")}if("date"===t.type){const e=t.value instanceof Date?t.value:null!=t.value?new Date(t.value):null;return null===e||Number.isNaN(e.getTime())?"":`${t.name}=${this.formatDateForFilters(e)}`}if("price"===t.type){let e="";return t.value.min>0&&(e+=`price[min]=${t.value.min}`),t.value.max>0&&(""!==e&&(e+="&"),e+=`price[max]=${t.value.max}`),e}if("option_set"===t.type){const e=this.normalisePositiveIntegerOrNull(t.value);return null!==e&&`${t.name}=${e}`}return`${t.name}=${t.value}`}).filter(e=>e).join("&")}static deserialiseFilterPanelFieldsJson(e){const t=JSON.parse(e);return this.normaliseDateValuesInBag(t.primary),this.normaliseDateValuesInBag(t.secondary),t}static normaliseDateValuesInBag(e={}){Object.entries(e).forEach(([e,t])=>{"date"===t.type&&(""!==t.value&&null!==t.value&&void 0!==t.value?t.value=new Date(t.value):t.value=null)})}static checkFieldsForEquality(e,t){if(typeof e!=typeof t)return!1;for(const i in e){if(void 0===t[i])return!1;const n=e[i].value,r=t[i].value;if(Array.isArray(n)){if(!Array.isArray(r))return!1;if(n.length!==r.length)return!1;if(n.sort((e,t)=>Math.sign(e-t)).join("")!==r.sort((e,t)=>Math.sign(e-t)).join(""))return!1;continue}if(n instanceof Date||r instanceof Date){if((n instanceof Date?n.getTime():n)!==(r instanceof Date?r.getTime():r))return!1}if(n!=r)return!1}return!0}static filterPanelFieldObjectsHaveMatchingValues(e,t){return this.checkFieldsForEquality(e.primary,t.primary)&&this.checkFieldsForEquality(e.secondary,t.secondary)}static hasPrimaryFields(e){return void 0!==e.primary&&Object.keys(e.primary).length>0}static formatDateForHumans(e){const t=new Date,i=new Date;i.setFullYear(t.getFullYear()+1,t.getMonth(),t.getDate()-1);const n=new Date(e),r={day:"numeric",month:"short"};return n>i&&(r.year="numeric"),n.toLocaleDateString("en-GB",r)}static createValueTextForPartySize(e){return 0===e?"Any party size":1===e?"1 Person":`${e} People`}static getValueOptionLabelFromField(e){const t=e.value,i=Array.isArray(t)?t:[t];if(0===i.length)return"";if(i.length>1)return`${e.label} (${i.length} selected)`;for(let t=0;t<e.options.length;t++)if(e.options[t].value===i[0])return e.options[t].label;return""}static getSpecificValueLabel(e,t){if("price"===e.type){if(!a.A.isPlainObject(t))return"";const i=e.pickers[0];if((void 0===t.min||0===Number.parseInt(t.min))&&(void 0===t.max||Number.parseInt(t.max)>
2=i.price_data.max))return"";const n=Intl.NumberFormat("en-GB",{style:"currency",currency:"EUR",maximumFractionDigits:0});return`${t.min>0?n.format(t.min):"No min"} - ${t.max<i.price_data.max?n.format(t.max):"No max"}`}if("option_set"===e.type||"multi_select_option_set"===e.type){for(const i of e.options)if(i.value===Number.parseInt(t))return i.label;return""}return"Something else"}static getCurrentValueLabel(e){const t=e.label;if(!e.value)return"option_set"===e.type?`Any ${e.label}`:t;switch(e.type){case"date":return this.formatDateForHumans(e.value);case"party_size":return this.createValueTextForPartySize(e.value);case"option_set":case"multi_select_option_set":return this.getValueOptionLabelFromField(e)}return t}};class c{static parseInputValue(e){switch(typeof e){case"string":return parseFloat(e);case"number":return e;default:throw new TypeError("The value is neither a string nor a number")}}static create(e,t){return new this(e.min,e.max,t,20)}static createInitial(e){return this.create(e,{min:0,max:null})}constructor(e,t,i,n){this.absMin=e,this.absMax=t,this.currValue=i,this.numRules=n,this.minGap=this.absMax/this.numRules,this.setUp()}setUp(){if(this.currValue){this.currValue.min=Math.max(c.parseInputValue(this.currValue.min),this.absMin),this.currValue.max=null===this.currValue.max?this.absMax:Math.min(c.parseInputValue(this.currValue.max),this.absMax);const e=this.currValue.max-this.minGap;this.currValue.min>e&&(this.currValue.min=Math.max(e,this.absMin)),this.currValue.min=Math.trunc(this.currValue.min);const t=this.currValue.min+this.minGap;this.currValue.max<t&&(this.currValue.max=Math.min(t,this.absMax)),this.currValue.max=Math.trunc(this.currValue.max)}}getMin(){return this.currValue.min}getMax(){return this.currValue.max}calculateAmountSlid(e){const t=this.absMax-this.absMin;return(e-this.absMin)/t*100}calculateMinPct(){return this.currValue?this.calculateAmountSlid(this.currValue.min):0}calculateMaxPct(){return this.currValue?this.calculateAmountSlid(this.currValue.max):100}getCurrencyFormatter(){return this.currencyFormatter||(this.currencyFormatter=Intl.NumberFormat("en-GB",{style:"currency",currency:"EUR",maximumFractionDigits:0})),this.currencyFormatter}formatMin(){return this.getCurrencyFormatter().format(this.getMin())}formatMax(){return this.getCurrencyFormatter().format(this.getMax())}getPlainRangeObject(){return{min:this.getMin(),max:this.getMax()}}}const u=function(e){const t=[];e={...e};const i=i=>{l.filterPanelFieldObjectsHaveMatchingValues(i,e)||(e={...i},t.forEach(function(e){e({...i})}))};return{subscribe:i=>{const n=Object.keys(t).length;return t[n]=i,i(e),()=>{delete t[n]}},set:i,update:t=>{i(t(e))},updateField:(t,n,r)=>{"string"==typeof r&&""!==r&&void 0!==e[n][r]&&i({...e,[n]:{...e[n],[r]:{...e[n][r],value:t}}})},clearAllSecondary:()=>{(t=>{const n=a.A.simpleDeepClone(e),r=n[t];for(const e in r)r[e].value="price"===e?c.createInitial(r[e].pickers[0].price_data).getPlainRangeObject():null;i(n)})("secondary")}}}({primary:{},secondary:{}});function h(e){const{subscribe:t,set:i,update:n}=(0,s.T5)(e);return{subscribe:t,set:function(e){e?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden"),i(e)},update:n}}const d=h(!1),f=h(null),p=(0,s.T5)(null);i(2077),i(6467);var m=i(1626),_=i(7421);const g=new Date,y=new Date;y.setFullYear(g.getFullYear()+1,g.getMonth(),g.getDate()-1);const v=(e,t)=>({altInput:!0,altInputClass:"visually-hidden",dateFormat:"Y-m-d",altFormat:e>y.getTime()?"j F Y":"j F",minDate:new Date((new Date).toDateString()),locale:{firstDayOfWeek:1,weekdays:{shorthand:["S","M","T","W","T","F","S"],longhand:["S","M","T","W","T","F","S"]}},showMonths:a.A.isDesktop()?2:1,monthSelectorType:"static",onDayCreate:(e,t,i,n)=>{n.classList.add("highlight-interactivity")},inline:!0,...t});var x=m.vUu('<fieldset class="date-field"><label class="h3"> </label> <input type="text"/></fieldset>');function b(e,t){m.VCO(t,!1);let i=m._w2(t,"field",8),n=m._w2(t,"onFieldChange",8,()=>{}),r=null!==i().value,s=m.zgK(),a=null;function l(){const e={defaultDate:i().value,onChange:e=>{var t;r?r=!1:void 0!==e[0]&&(t=e[0],n()({...i(),value:t}))}};return null!==i().options&&(e.enable=i().options),v(i().value,e)}(0,o.Rc)(()=>{a=(0,_.A)(m.JtY(s),l())}),(0,o.sA)(()=>{null!==a&&(a.destroy(),a=null)}),m.M3l(()=>{},()=>{!function(){if(null===a)return;const e=a.selectedDates[0]??null,t=null===e?null:e.getTime();if(null===i().value)return void(null!==e&&a.clear());const n=new Date(i().value);n.getTime()!==t&&a.setDate(n,!1)}()}),m.iqF(),m.TsN();var c=x(),u=m.jfp(c),h=m.IuP(u),d=m.hg4(u,2);m.Lcc(d,e=>m.hZp(s,e),()=>m.JtY(s)),m.cLc(c),m.vNg(e=>{m.aIK(u,"for",(m.iTV(i()),m.vzK(()=>i().name))),m.jax(h,`Choose your ${e??""}`),m.aIK(d,"name",(m.iTV(i()),m.vzK(()=>i().name))),m.aIK(d,"id",(m.iTV(i()),m.vzK(()=>i().name)))},[()=>(m.iTV(i()),m.vzK(()=>i().label.toLowerCase()))]),m.BCw(e,c),m.uYY()}var w=m.vUu('<div class="d-flex align-items-start input-container"><input type="checkbox"/> <label> </label></div>'),T=m.vUu('<fieldset class="multi-select-option-set-field"><legend class="h3"> </legend> <!></fieldset>');function E(e,t){m.VCO(t,!1);const i=m.zgK();let n=m._w2(t,"field",8),r=m._w2(t,"onFieldChange",8,()=>{});function o(e){const t=[...m.JtY(i)],o=e.target,s=Number.parseInt(o.value);if(o.checked&&!t.includes(s))t.push(s);else if(!o.checked&&t.includes(s)){const e=t.indexOf(s);t.splice(e,1)}r()({...n(),value:t})}m.M3l(()=>m.iTV(n()),()=>{m.hZp(i,n().value||[])}),m.iqF(),m.TsN();var s=T(),a=m.jfp(s),l=m.IuP(a,!0),c=m.hg4(a,2);m.__1(c,1,()=>(m.iTV(n()),m.vzK(()=>n().options)),m.Pe0,(e,t)=>{const r=m.Xdt(()=>(m.JtY(t),m.vzK(()=>{return e=m.JtY(t).value,m.JtY(i).includes(e);var e})));var s=w(),a=m.jfp(s);m.R0j(a);var l=m.hg4(a,2);let c;var u=m.IuP(l,!0);m.cLc(s),m.vNg(()=>{m.aIK(a,"id",`${m.iTV(n()),m.vzK(()=>n().name)??""}_${m.JtY(t),m.vzK(()=>m.JtY(t).value)??""}`),m.to4(a,(m.JtY(t),m.vzK(()=>m.JtY(t).value))),m.BYB(a,m.JtY(r)),m.aIK(l,"for",`${m.iTV(n()),m.vzK(()=>n().name)??""}_${m.JtY(t),m.vzK(()=>m.JtY(t).value)??""}`),c=m.ysU(l,1,"",null,c,{checked:m.JtY(r)}),m.jax(u,(m.JtY(t),m.vzK(()=>m.JtY(t).label)))}),m.f0J("change",a,o),m.BCw(e,s)}),m.cLc(s),m.vNg(()=>m.jax(l,(m.iTV(n()),m.vzK(()=>n().label)))),m.BCw(e,s),m.uYY()}var S=m.vUu('<input type="radio"/> <label> </label>',1),I=m.vUu('<fieldset class="option-set-field"><legend class="h3"> </legend> <button type="button">Any</button> <!></fieldset>');function A(e,t){m.VCO(t,!1);let i=m._w2(t,"field",8),n=m._w2(t,"onFieldChange",8,()=>{});function r(e){const t={...i()};null===e?(t.value=null,delete t.value):t.value=e,n()(t)}m.TsN();var o=I(),s=m.jfp(o),a=m.IuP(s,!0),l=m.hg4(s,2);let c;var u=m.hg4(l,2);m.__1(u,1,()=>(m.iTV(i()),m.vzK(()=>i().options)),m.Pe0,(e,t)=>{const n=m.Xdt(()=>(m.JtY(t),m.vzK(()=>{return e=m.JtY(t).value,i().value===e;var e})));var o=S(),s=m.esp(o);m.R0j(s);var a=m.hg4(s,2);let l;var c=m.IuP(a,!0);m.vNg(()=>{m.aIK(s,"id",`${m.iTV(i()),m.vzK(()=>i().name)??""}_${m.JtY(t),m.vzK(()=>m.JtY(t).value)??""}`),m.to4(s,(m.JtY(t),m.vzK(()=>m.JtY(t).value))),m.BYB(s,m.JtY(n)),m.aIK(a,"for",`${m.iTV(i()),m.vzK(()=>i().name)??""}_${m.JtY(t),m.vzK(()=>m.JtY(t).value)??""}`),l=m.ysU(a,1,"button--radio",null,l,{selected:m.JtY(n)}),m.jax(c,(m.JtY(t),m.vzK(()=>m.JtY(t).label)))}
2),m.f0J("click",s,()=>r(m.JtY(t).value)),m.BCw(e,o)}),m.cLc(o),m.vNg(()=>{m.jax(a,(m.iTV(i()),m.vzK(()=>i().label))),c=m.ysU(l,1,"button--radio",null,c,{selected:!i().value})}),m.f0J("click",l,()=>r(null)),m.BCw(e,o),m.uYY()}var M=i(5611),C=i(1776),D=m.vUu('<fieldset class="party-size-field"><label class="h3"> </label> <div class="d-flex align-items-center justify-content-center"><button type="button" aria-label="Subtract One" data-action="decrease"></button> <input type="text" pattern="\\d*"/> <button type="button" aria-label="Add One" data-action="increase"></button></div></fieldset>');function P(e,t){m.VCO(t,!1);let i=m._w2(t,"field",8),n=m._w2(t,"onFieldChange",8,()=>{});function r(e){const t=new M.A(e).getButtonTarget(2);if(!t)return;const n=t.dataset.action;if(!n)return;const r=document.getElementById(i().name),o=a.A.toDecimalInteger(r.value);let s;switch(n){case"decrease":s=o-1;break;case"increase":s=o+1;break;default:throw new Error(`The action, \`${n}\`, is not supported`)}s===o||s<i().min||s>i().max||(r.value=s.toString(),r.dispatchEvent(new Event("input",{bubbles:!0})))}m.TsN();var o=D(),s=m.jfp(o),l=m.IuP(s,!0),c=m.hg4(s,2),u=m.jfp(c);m.qyt(u,()=>(m.iTV(C.A),m.vzK(()=>C.A.decrement())),!0),m.cLc(u);var h=m.hg4(u,2);m.R0j(h);var d=m.hg4(h,2);m.qyt(d,()=>(m.iTV(C.A),m.vzK(()=>C.A.increment())),!0),m.cLc(d),m.cLc(c),m.cLc(o),m.vNg(()=>{m.aIK(s,"for",(m.iTV(i()),m.vzK(()=>i().name))),m.jax(l,(m.iTV(i()),m.vzK(()=>i().label))),m.to4(h,(m.iTV(i()),m.vzK(()=>i().value||i().min))),m.aIK(h,"min",(m.iTV(i()),m.vzK(()=>i().min))),m.aIK(h,"max",(m.iTV(i()),m.vzK(()=>i().max))),m.aIK(h,"size",(m.iTV(i()),m.vzK(()=>i().size))),m.aIK(h,"id",(m.iTV(i()),m.vzK(()=>i().name)))}),m.f0J("click",u,r),m.f0J("input",h,function(e){const t=e.target;if(t.value,""!==t.value)if(a.A.onlyDigits(t.value)){const e=a.A.toDecimalInteger(t.value);e<i().min?t.value=i().min.toString():e>i().max&&(t.value=i().max.toString())}else{const i=e.data;i&&(t.value=t.value.replaceAll(i,""))}""===t.value&&(t.value=i().min.toString());const r=a.A.toDecimalInteger(t.value);if(!("number"==typeof(o=r)&&Number.isInteger(o)&&o>=i().min&&o<=i().max))throw new Error(`The value is not an integer between ${i().min} and ${i().max}`);var o;n()({...i(),value:r})}),m.f0J("click",d,r),m.BCw(e,o),m.uYY()}var R=m.vUu('<div class="price-picker-chart__bar"></div>'),L=m.vUu('<div class="price-picker" id="price_whole_property" style="--price-picker--thumb-size: 2rem;"><label for="price_whole_property" class="h3"> </label> <div class="price-picker-text"><span class="price-text-min"> </span> – <span class="price-text-max"> </span></div> <div class="price-picker-popup open"><div class="price-picker-slider"><div class="price-picker-slider__visuals"><div class="outside-left"></div> <div class="inside"></div> <div class="outside-right"></div> <span class="min-thumb"><span class="price-thumb-label"> </span></span> <span class="max-thumb"><span class="price-thumb-label"> </span></span></div> <input type="range" class="min-price"/> <input type="range" class="max-price"/></div> <div class="price-picker-chart"></div></div></div>');function z(e,t){m.VCO(t,!1);const i=m.zgK(),n=m.zgK(),r=m.zgK(),s=m.zgK(),a=m.zgK(),l=m.zgK(),u=m.zgK(),h=m.zgK();let d=m._w2(t,"field",8),f=m._w2(t,"onFieldChange",8,()=>{}),p=m.zgK(),_=m.zgK(),g=m.zgK();(0,o.Rc)(()=>{const e=c.create(m.JtY(i).price_data,m.JtY(n));m.Tk$(_,m.JtY(_).value=String(e.getMin())),m.Tk$(g,m.JtY(g).value=String(e.getMax()))}),m.M3l(()=>m.iTV(d()),()=>{m.hZp(i,d().pickers[0])}),m.M3l(()=>(m.JtY(i),m.iTV(d())),()=>{m.hZp(n,c.create(m.JtY(i).price_data,d().value).getPlainRangeObject())}),m.M3l(()=>{},()=>{m.hZp(r,"price")}),m.M3l(()=>(m.JtY(i),m.JtY(n)),()=>{m.hZp(s,c.create(m.JtY(i).price_data,m.JtY(n)).calculateMinPct())}),m.M3l(()=>(m.JtY(i),m.JtY(n)),()=>{m.hZp(a,c.create(m.JtY(i).price_data,m.JtY(n)).calculateMaxPct())}),m.M3l(()=>(m.JtY(i),m.JtY(n)),()=>{m.hZp(l,c.create(m.JtY(i).price_data,m.JtY(n)).formatMin())}),m.M3l(()=>(m.JtY(i),m.JtY(n)),()=>{m.hZp(u,c.create(m.JtY(i).price_data,m.JtY(n)).formatMax())}),m.M3l(()=>m.JtY(i),()=>{m.hZp(h,Math.max(...m.JtY(i).price_data.frequencyData))}),m.iqF(),m.TsN();var y=L(),v=m.jfp(y),x=m.IuP(v,!0),b=m.hg4(v,2),w=m.jfp(b),T=m.IuP(w,!0),E=m.hg4(w,2),S=m.IuP(E,!0);m.cLc(b);var I=m.hg4(b,2),A=m.jfp(I),M=m.jfp(A),C=m.jfp(M),D=m.hg4(C,2),P=m.hg4(D,2),z=m.hg4(P,2),F=m.jfp(z),O=m.IuP(F,!0);m.cLc(z);var k=m.hg4(z,2),B=m.jfp(k),N=m.IuP(B,!0);m.cLc(k),m.cLc(M);var V=m.hg4(M,2);m.R0j(V),m.Lcc(V,e=>m.hZp(_,e),()=>m.JtY(_));var U=m.hg4(V,2);m.R0j(U),m.Lcc(U,e=>m.hZp(g,e),()=>m.JtY(g)),m.cLc(A);var j=m.hg4(A,2);m.__1(j,5,()=>(m.JtY(i),m.vzK(()=>m.JtY(i).price_data.frequencyData)),m.Pe0,(e,t)=>{var i=R();m.vNg(()=>m.hgi(i,`height: ${m.JtY(t)/m.JtY(h)*100}%`)),m.BCw(e,i)}),m.cLc(j),m.cLc(I),m.cLc(y),m.Lcc(y,e=>m.hZp(p,e),()=>m.JtY(p)),m.vNg((e,t)=>{m.jax(x,(m.JtY(i),m.vzK(()=>m.JtY(i).label))),m.jax(T,m.JtY(l)),m.jax(S,m.JtY(u)),m.hgi(C,`width: ${m.JtY(s)??""}%`),m.hgi(D,`left: ${m.JtY(s)??""}%; right: ${100-m.JtY(a)}%;`),m.hgi(P,`left: ${m.JtY(a)??""}%; right: 0;`),m.hgi(z,`left: ${m.JtY(s)??""}%`),m.jax(O,m.JtY(l)),m.hgi(k,`left: calc(${m.JtY(a)??""}% - (var(--price-picker--thumb-size) / 2))`),m.jax(N,m.JtY(u)),m.to4(V,e),m.aIK(V,"min",(m.JtY(i),m.vzK(()=>m.JtY(i).price_data.min))),m.aIK(V,"max",(m.JtY(i),m.vzK(()=>
2m.JtY(i).price_data.max))),m.to4(U,t),m.aIK(U,"min",(m.JtY(i),m.vzK(()=>m.JtY(i).price_data.min))),m.aIK(U,"max",(m.JtY(i),m.vzK(()=>m.JtY(i).price_data.max)))},[()=>(m.iTV(c),m.JtY(i),m.JtY(n),m.vzK(()=>String(c.create(m.JtY(i).price_data,m.JtY(n)).getMin()))),()=>(m.iTV(c),m.JtY(i),m.JtY(n),m.vzK(()=>String(c.create(m.JtY(i).price_data,m.JtY(n)).getMax())))]),m.f0J("input",V,function(e){m.hZp(n,c.create(m.JtY(i).price_data,{min:e.target.value,max:m.JtY(n).max}).getPlainRangeObject()),m.Tk$(_,m.JtY(_).value=String(m.JtY(n).min))}),m.f0J("change",V,function(e){const t=c.create(m.JtY(i).price_data,{min:e.target.value,max:m.JtY(n).max}).getMin();f()({...d(),value:{...d().value,min:t}})}),m.f0J("input",U,function(e){m.hZp(n,c.create(m.JtY(i).price_data,{min:m.JtY(n).min,max:e.target.value}).getPlainRangeObject()),m.Tk$(g,m.JtY(g).value=String(m.JtY(n).max))}),m.f0J("change",U,function(e){const t=c.create(m.JtY(i).price_data,{min:m.JtY(n).min,max:e.target.value}).getMax();f()({...d(),value:{...d().value,max:t}})}),m.BCw(e,y),m.uYY()}function F(e,t){m.VCO(t,!1);const i=m.zgK();let n=m._w2(t,"field",8),r=m._w2(t,"onFieldChange",8,()=>{});m.M3l(()=>m.iTV(n()),()=>{m.hZp(i,(e=>{switch(e.type){case"party_size":return P;case"multi_select_option_set":return E;case"option_set":return A;case"date":return b;case"price":return z}})(n()))}),m.iqF();var o=m.Imx(),s=m.esp(o),a=e=>{var t=m.Imx(),o=m.esp(t);m.s9R(o,()=>m.JtY(i),(e,t)=>{t(e,{get field(){return n()},get onFieldChange(){return r()}})}),m.BCw(e,t)};m.if(s,e=>{null!==m.JtY(i)&&e(a)}),m.BCw(e,o),m.uYY()}var O=m.vUu("<div> </div>");function k(e,t){m.VCO(t,!1);const i=()=>m.Hzn(u,"$filterPanelFields",n),[n,r]=m.DZI(),o=m.zgK(),s=m.zgK();let a=m._w2(t,"fieldName",8),c=m._w2(t,"additionalClasses",8,"");m.M3l(()=>(i(),m.iTV(a())),()=>{m.hZp(o,i().primary[a()])}),m.M3l(()=>m.JtY(o),()=>{m.hZp(s,(e=>{if("multi_select_option_set"===e.type&&Array.isArray(e.value)&&e.value.length>1)return`${e.label} (${e.value.length} selected)`;try{return l.getCurrentValueLabel(e)}catch{return e.label}})(m.JtY(o)))}),m.iqF(),m.TsN();var h=O(),d=m.IuP(h,!0);m.vNg(()=>{m.ysU(h,1,`primary-field ${c()}`),m.aIK(h,"title",(m.JtY(o),m.vzK(()=>m.JtY(o).label))),m.jax(d,m.JtY(s))}),m.BCw(e,h),m.uYY(),r()}var B={ID_ACCOMMODATION_USAGE_WHOLE_PROPERTY:609,ID_ACCOMMODATION_USAGE_SHARED:32,ID_TRANSFER_JOURNEY_TYPE_ONE_WAY:94,ID_TRANSFER_JOURNEY_TYPE_RETURN:95},N=m.vUu('<button type="button"><!></button>'),V=m.vUu('<!> <button type="button" title="Click to change dates"><div class="primary-field" title="Select your date(s)"><!></div></button>',1),U=m.vUu("<strong> </strong>"),j=m.vUu('<div class="d-flex align-items-start pipe-separated interpunct"></div>'),G=m.vUu('<button type="button" class="one-primaryfield-button highlight-interactivity" title="Click to change"><div class="d-flex align-items-center search-icon"></div> <div class="one-primaryfield-button-fields"><div class="primary-field"><!></div> <!></div></button>');function $(e,t){m.VCO(t,!1);const i=()=>m.Hzn(u,"$filterPanelFields",r),n=()=>m.Hzn(f,"$primaryFieldBeingEditedIndex",r),[r,o]=m.DZI();let s=m._w2(t,"forceSeparateButtons",8,!1);const a=["filter_start_date","filter_end_date","ptp_4"];function c(e,t,i){return e.value?function(e){const t=e.value;return Array.isArray(t)&&t.includes(B.ID_TRANSFER_JOURNEY_TYPE_ONE_WAY)}(i)?`${l.formatDateForHumans(e.value)}, one way`:t.value?`${l.formatDateForHumans(e.value)}, returning ${l.formatDateForHumans(t.value)}`:`${l.formatDateForHumans(e.value)}, returning any date`:"Dates"}m.TsN();var h=m.Imx(),d=m.esp(h),p=e=>{var t=V(),r=m.esp(t);m.__1(r,1,()=>(i(),m.vzK(()=>Object.entries(i().primary))),m.Pe0,(e,t)=>{var i=m.unG(()=>m._Nj(m.JtY(t),2));let r=()=>m.JtY(i)[0],o=()=>m.JtY(i)[1];var s=m.Imx(),l=m.esp(s),c=e=>{var t=N();let i;k(m.jfp(t),{get fieldName(){return r()},$$events:{click:()=>m.fTr(f,r())}}),m.cLc(t),m.vNg(()=>{i=m.ysU(t,1,"highlight-interactivity",null,i,{current:n()===r()}),m.aIK(t,"title",(o(),m.vzK(()=>`Click to change ${o().label}`)))}),m.f0J("click",t,()=>m.fTr(f,r())),m.BCw(e,t)},u=m.unG(()=>(r(),m.vzK(()=>!a.includes(r()))));m.if(l,e=>{m.JtY(u)&&e(c)}),m.BCw(e,s)});var o=m.hg4(r,2);let s;var l=m.jfp(o),u=m.jfp(l);m.Ebd(u,()=>(i(),m.vzK(()=>(i().primary.filter_start_date.value?i().primary.filter_start_date.value.toString():"")+(i().primary.filter_end_date.value?i().primary.filter_end_date.value.toString():"")+(i().primary.ptp_4.value?i().primary.ptp_4.value[0]:""))),e=>{var t=m.Qq7();m.vNg(e=>m.jax(t,e),[()=>(i(),m.vzK(()=>c(i().primary.filter_start_date,i().primary.filter_end_date,i().primary.ptp_4)))]),m.BCw(e,t)}),m.cLc(l),m.cLc(o),m.vNg(e=>s=m.ysU(o,1,"highlight-interactivity",null,s,{current:e}),[()=>a.includes(n())]),m.f0J("click",o,()=>m.fTr(f,"filter_start_date")),m.BCw(e,t)},_=e=>{var t=G(),n=m.jfp(t);m.qyt(n,()=>(m.iTV(C.A),m.vzK(()=>C.A.search())),!0),m.cLc(n);var r=m.hg4(n,2),o=m.jfp(r),s=m.jfp(o);m.Ebd(s,()=>(i(),m.vzK(()=>(i().primary.filter_start_date.value?i().primary.filter_start_date.value.toString():"")+(i().primary.filter_end_date.value?i().primary.filter_end_date.value.toString():"")+(i().primary.ptp_4.value?i().primary.ptp_4.value[0]:""))),e=>{var t=U(),n=m.IuP(t,!0);m.vNg(e=>m.jax(n,e),[()=>(i(),m.vzK(()=>c(i().primary.filter_start_date,i().primary.filter_end_date,i().primary.ptp_4)))]),m.BCw(e,t)}),m.cLc(o);var l=m.hg4(o,2),u=e=>{var t=j();m.__1(t,5,()=>(i(),m.vzK(()=>Object.entries(i().primary))),m.Pe0,(e,t)=>{var i=m.unG(()=>m._Nj(m.JtY(t),1));let n=()=>m.JtY(i)[0];var r=m.Imx(),o=m.esp(r),s=e=>{k(e,{get fieldName(){return n()},additionalClasses:"extra",$$events:{click:()=>m.fTr(f,n())}})},l=m.unG(()=>(n(),m.vzK(()=>!a.includes(n()))));m.if(o,e=>{m.JtY(l)&&e(s)}),m.BCw(e,r)}),m.cLc(t),m.BCw(e,t)},h=m.unG(()=>(i(),m.vzK(()=>Object.keys(i().primary).length>1)));m.if(l,e=>{m.JtY(h)&&e(u)}),m.cLc(r),m.cLc(t),m.f0J("click",t,()=>m.fTr(f,Object.keys(i().primary)[0])),m.BCw(e,t)};m.if(d,e=>{s()?e(p):e(_,-1)}),m.BCw(e,h),m.uYY(),o()}var H=m.vUu('<button type="button"><!></button>'),Z=m.vUu("<strong><!></strong>"),q=m.vUu('<div class="d-flex align-items-start pipe-separated interpunct"></div>'),W=m.vUu('<button type="button" class="one-primaryfield-button highlight-interactivity" title="Click to change"><div class="d-flex align-items-center search-icon"></div> <div class="one-primaryfield-button-fields"><!> <!></div></button>');var Y=m.vUu('<button type="button"><!></button>'),X=m.vUu('<!> <button type="button" title="Click to change dates"><div class="primary-field" title="Select your date(s)"><!></div></button>',1),J=m.vUu("<strong> </strong>"),K=m.vUu('<div class="d-flex align-items-start pipe-separated interpunct"></div>'),Q=m.vUu('<button type="button" class="one-primaryfield-button highlight-interactivity" title="Click to change"><div class="d-flex align-items-center search-icon"></div> <div class="one-primaryfield-button-fields"><div class="primary-field"><!></div> <!></div></button>');var ee=m.vUu("<div><!></div>");function te(e,t){m.VCO(t,!1);const i=()=>m.Hzn(u,"$filterPanelFields",n),[n,r]=m.DZI();let o=m._w2(t,"forceSeparateButtons",8,!1),s=Object.keys(i().primary).includes("ptp_4"),a=Object.keys(i().primary).includes("filter_start_date")&&Object.keys(i().primary).includes("filter_end_date");m.TsN();var c=ee();let h;
2var d=m.jfp(c),p=e=>{$(e,{get forceSeparateButtons(){return o()}})},_=e=>{!function(e,t){m.VCO(t,!1);const i=()=>m.Hzn(u,"$filterPanelFields",r),n=()=>m.Hzn(f,"$primaryFieldBeingEditedIndex",r),[r,o]=m.DZI();let s=m._w2(t,"forceSeparateButtons",8,!1);const a=["filter_start_date","filter_end_date"];function c(e,t){return e.value||t.value?t.value?e.value?`${l.formatDateForHumans(e.value)} - ${l.formatDateForHumans(t.value)}`:`Any date - ${l.formatDateForHumans(t.value)}`:`${l.formatDateForHumans(e.value)} - any date`:"Dates"}m.TsN();var h=m.Imx(),d=m.esp(h),p=e=>{var t=X(),r=m.esp(t);m.__1(r,1,()=>(i(),m.vzK(()=>Object.entries(i().primary))),m.Pe0,(e,t)=>{var i=m.unG(()=>m._Nj(m.JtY(t),2));let r=()=>m.JtY(i)[0],o=()=>m.JtY(i)[1];var s=m.Imx(),l=m.esp(s),c=e=>{var t=Y();let i;k(m.jfp(t),{get fieldName(){return r()},$$events:{click:()=>m.fTr(f,r())}}),m.cLc(t),m.vNg(()=>{i=m.ysU(t,1,"highlight-interactivity",null,i,{current:n()===r()}),m.aIK(t,"title",(o(),m.vzK(()=>`Click to change ${o().label}`)))}),m.f0J("click",t,()=>m.fTr(f,r())),m.BCw(e,t)},u=m.unG(()=>(r(),m.vzK(()=>!a.includes(r()))));m.if(l,e=>{m.JtY(u)&&e(c)}),m.BCw(e,s)});var o=m.hg4(r,2);let s;var l=m.jfp(o),u=m.jfp(l);m.Ebd(u,()=>(i(),m.vzK(()=>(i().primary.filter_start_date.value?i().primary.filter_start_date.value.toString():"")+(i().primary.filter_end_date.value?i().primary.filter_end_date.value.toString():""))),e=>{var t=m.Qq7();m.vNg(e=>m.jax(t,e),[()=>(i(),m.vzK(()=>c(i().primary.filter_start_date,i().primary.filter_end_date)))]),m.BCw(e,t)}),m.cLc(l),m.cLc(o),m.vNg(e=>s=m.ysU(o,1,"highlight-interactivity",null,s,{current:e}),[()=>a.includes(n())]),m.f0J("click",o,()=>m.fTr(f,"filter_start_date")),m.BCw(e,t)},_=e=>{var t=Q(),n=m.jfp(t);m.qyt(n,()=>(m.iTV(C.A),m.vzK(()=>C.A.search())),!0),m.cLc(n);var r=m.hg4(n,2),o=m.jfp(r),s=m.jfp(o);m.Ebd(s,()=>(i(),m.vzK(()=>(i().primary.filter_start_date.value?i().primary.filter_start_date.value.toString():"")+(i().primary.filter_end_date.value?i().primary.filter_end_date.value.toString():""))),e=>{var t=J(),n=m.IuP(t,!0);m.vNg(e=>m.jax(n,e),[()=>(i(),m.vzK(()=>c(i().primary.filter_start_date,i().primary.filter_end_date)))]),m.BCw(e,t)}),m.cLc(o);var l=m.hg4(o,2),u=e=>{var t=K();m.__1(t,5,()=>(i(),m.vzK(()=>Object.entries(i().primary))),m.Pe0,(e,t)=>{var i=m.unG(()=>m._Nj(m.JtY(t),1));let n=()=>m.JtY(i)[0];var r=m.Imx(),o=m.esp(r),s=e=>{k(e,{get fieldName(){return n()},additionalClasses:"extra",$$events:{click:()=>m.fTr(f,n())}})},l=m.unG(()=>(n(),m.vzK(()=>!a.includes(n()))));m.if(o,e=>{m.JtY(l)&&e(s)}),m.BCw(e,r)}),m.cLc(t),m.BCw(e,t)},h=m.unG(()=>(i(),m.vzK(()=>Object.keys(i().primary).length>1)));m.if(l,e=>{m.JtY(h)&&e(u)}),m.cLc(r),m.cLc(t),m.f0J("click",t,()=>m.fTr(f,Object.keys(i().primary)[0])),m.BCw(e,t)};m.if(d,e=>{s()?e(p):e(_,-1)}),m.BCw(e,h),m.uYY(),o()}(e,{get forceSeparateButtons(){return o()}})},g=e=>{!function(e,t){m.VCO(t,!1);const i=()=>m.Hzn(u,"$filterPanelFields",n),[n,r]=m.DZI();let o=m._w2(t,"forceSeparateButtons",8,!1);m.TsN();var s=m.Imx(),a=m.esp(s),l=e=>{var t=m.Imx(),r=m.esp(t);m.__1(r,1,()=>(i(),m.vzK(()=>Object.entries(i().primary))),m.Pe0,(e,t)=>{var i=m.unG(()=>m._Nj(m.JtY(t),2));let r=()=>m.JtY(i)[0],o=()=>m.JtY(i)[1];var s=H();let a;k(m.jfp(s),{get fieldName(){return r()},$$events:{click:()=>m.fTr(f,r())}}),m.cLc(s),m.vNg(()=>{a=m.ysU(s,1,"highlight-interactivity",null,a,{current:m.Hzn(f,"$primaryFieldBeingEditedIndex",n)===r()}),m.aIK(s,"title",(o(),m.vzK(()=>`Click to change ${o().label}`)))}
2),m.f0J("click",s,()=>m.fTr(f,r())),m.BCw(e,s)}),m.BCw(e,t)},c=e=>{var t=W(),n=m.jfp(t);m.qyt(n,()=>(m.iTV(C.A),m.vzK(()=>C.A.search())),!0),m.cLc(n);var r=m.hg4(n,2),o=m.jfp(r);m.__1(o,1,()=>(i(),m.vzK(()=>Object.entries(i().primary))),m.Pe0,(e,t,i)=>{var n=m.unG(()=>m._Nj(m.JtY(t),1));let r=()=>m.JtY(n)[0];var o=m.Imx(),s=m.esp(o),a=e=>{var t=Z();k(m.jfp(t),{get fieldName(){return r()},$$events:{click:()=>m.fTr(f,r())}}),m.cLc(t),m.BCw(e,t)};m.if(s,e=>{0===i&&e(a)}),m.BCw(e,o)});var s=m.hg4(o,2),a=e=>{var t=q();m.__1(t,5,()=>(i(),m.vzK(()=>Object.entries(i().primary))),m.Pe0,(e,t,i)=>{var n=m.unG(()=>m._Nj(m.JtY(t),1));let r=()=>m.JtY(n)[0];var o=m.Imx(),s=m.esp(o),a=e=>{k(e,{get fieldName(){return r()},additionalClasses:"extra",$$events:{click:()=>m.fTr(f,r())}})};m.if(s,e=>{i>0&&e(a)}),m.BCw(e,o)}),m.cLc(t),m.BCw(e,t)},l=m.unG(()=>(i(),m.vzK(()=>Object.entries(i().primary).length>1)));m.if(s,e=>{m.JtY(l)&&e(a)}),m.cLc(r),m.cLc(t),m.f0J("click",t,()=>m.fTr(f,Object.keys(i().primary)[0])),m.BCw(e,t)};m.if(a,e=>{o()?e(l):e(c,-1)}),m.BCw(e,s),m.uYY(),r()}(e,{get forceSeparateButtons(){return o()}})};m.if(d,e=>{s?e(p):a?e(_,1):e(g,-1)}),m.cLc(c),m.vNg(()=>h=m.ysU(c,1,"filters-summary",null,h,{open:null!==m.Hzn(f,"$primaryFieldBeingEditedIndex",n)})),m.BCw(e,c),m.uYY(),r()}var ie=m.vUu('<button type="button" class="start-your-search-button"><!> <span>Start your search</span></button>');function ne(e,t){m.VCO(t,!1);const[i,n]=m.DZI();m.TsN();var r=ie(),o=m.jfp(r);m.qyt(o,()=>C.A.search()),m.K2T(2),m.cLc(r),m.f0J("click",r,()=>m.fTr(f,Object.keys(m.Hzn(u,"$filterPanelFields",i).primary)[0])),m.BCw(e,r),m.uYY(),n()}var re=i(7496);i(4423);function oe(e,t){const i=Object.keys(t.primary),n=i.indexOf(e);return-1===n?null:i[n+1]??null}function se(e,t){return null===oe(e,t)}function ae(e,t){return t.includes(e)}function le(e,t){const i=Object.keys(e.primary),n=i[i.length-1];return void 0!==n&&t.includes(n)}var ce=m.vUu('<fieldset class="transfers-date-field"><div class="h3">Choose your dates</div> <input type="text" id="filter_combined_dates"/></fieldset>');function ue(e,t){m.VCO(t,!1);const i=()=>m.Hzn(u,"$filterPanelFields",n),[n,r]=m.DZI();let s=m.zgK(),a=null;function l(){const e=[];return i().primary.filter_start_date.value&&e.push(i().primary.filter_start_date.value),i().primary.filter_end_date.value&&e.push(i().primary.filter_end_date.value),e}(0,o.Rc)(()=>{const e=function(){const e=l();return v(e,{defaultDate:e,mode:"range",onChange:e=>{u.updateField(e.length>=1?e[0]:null,"primary","filter_start_date"),u.updateField(2===e.length?e[1]:null,"primary","filter_end_date")}})}();a=(0,_.A)(m.JtY(s),e)}),(0,o.sA)(()=>{null!==a&&(a.destroy(),a=null)}),m.M3l(()=>{},()=>{!function(){if(null===a)return;const e=a.selectedDates,t=l();var i,n;n=t,(i=e).length===n.length&&i.every((e,t)=>e.getTime()===n[t].getTime())||a.setDate(t,!1)}()}),m.iqF(),m.TsN();var c=ce(),h=m.hg4(m.jfp(c),2);m.Lcc(h,e=>m.hZp(s,e),()=>m.JtY(s)),m.cLc(c),m.BCw(e,c),m.uYY(),r()}var he=m.vUu('<p class="mt-3">Please select a return date</p>'),de=m.vUu('<fieldset class="transfers-date-field"><div class="h3">Choose your dates</div> <input type="text" id="transfers_combined_dates"/> <div class="d-flex align-items-start justify-content-center input-container"><input id="return-needed" type="checkbox"/> <label for="return-needed">Return needed</label></div> <!></fieldset>');function fe(e,t){m.VCO(t,!1);const i=()=>m.Hzn(u,"$filterPanelFields",n),[n,r]=m.DZI(),s=m.zgK();let a=!1,l=m.zgK(),c=null;const h=i().primary.ptp_4;let d;function f(){const e=[];return i().primary.filter_start_date.value&&e.push(i().primary.filter_start_date.value),m.JtY(s)&&i().primary.filter_end_date.value&&e.push(i().primary.filter_end_date.value),e}function p(){const e=v(f(),{defaultDate:f(),onChange:e=>{a?a=!1:(u.updateField(e.length>=1?e[0]:null,"primary","filter_start_date"),u.updateField(2===e.length?e[1]:null,"primary","filter_end_date"))}});return m.JtY(s)&&(e.mode="range"),e}function g(){null!==c&&(c.destroy(),c=null)}function y(){if(null===c)return;if(d!==m.JtY(s))return d=m.JtY(s),g(),void(c=(0,_.A)(m.JtY(l),p()));const e=c.selectedDates,t=f();var i,n;n=t,(i=e).length===n.length&&i.every((e,t)=>e.getTime()===n[t].getTime())||c.setDate(t,!1)}(0,o.Rc)(()=>{c=(0,_.A)(m.JtY(l),p()),d=m.JtY(s)}),(0,o.sA)(()=>{g()}),m.M3l(()=>B,()=>{m.hZp(s,h.value&&h.value===B.ID_TRANSFER_JOURNEY_TYPE_RETURN)}),m.M3l(()=>{},()=>{y()}),m.iqF(),m.TsN();var x=de(),b=m.hg4(m.jfp(x),2);m.Lcc(b,e=>m.hZp(l,e),()=>m.JtY(l));var w=m.hg4(b,2),T=m.jfp(w);m.R0j(T);var E=m.hg4(T,2);let S;m.cLc(w);var I=m.hg4(w,2),A=e=>{var t=he();m.BCw(e,t)};m.if(I,e=>{m.JtY(s),i(),m.vzK(()=>m.JtY(s)&&!i().primary.filter_end_date.value)&&e(A)}),m.cLc(x),m.vNg(()=>{m.BYB(T,m.JtY(s)),S=m.ysU(E,1,"",null,S,{checked:m.JtY(s)})}),m.f0J("change",T,function(e){const t=e.target;m.hZp(s,t.checked),a=!0,u.updateField(t.checked?[B.ID_TRANSFER_JOURNEY_TYPE_RETURN]:[B.ID_TRANSFER_JOURNEY_TYPE_ONE_WAY],"primary","ptp_4"),u.updateField(t.checked?i().primary.filter_end_date.value:null,"primary","filter_end_date")}),m.BCw(e,x),m.uYY(),r()}var pe=m.vUu("<small> </small>"),me=m.vUu("Show Results <!>",1),_e=m.vUu('<div id="primary-filters-expanded" class="overlay"><button type="button" class="close-button close-button--plain" title="Close"></button> <div id="primary-filters-expanded-inner" class="d-flex"><!> <!> <div class="primary-filters-button-row"><button type="button"><!></button></div></div></div>');function ge(e,t){m.VCO(t,!1);const i=()=>m.Hzn(u,"$filterPanelFields",o),n=()=>m.Hzn(f,"$primaryFieldBeingEditedIndex",o),r=()=>m.Hzn(p,"$resultsCountForCurrentFilters",o),[o,s]=m.DZI(),a=m.zgK();let l=Object.keys(i().primary).includes("ptp_4"),c=Object.keys(i().primary).includes("filter_start_date")&&Object.keys(i().primary).includes("filter_end_date");const h=["filter_start_date","filter_end_date","ptp_4"],d=["filter_start_date","filter_end_date"],_=(e,t)=>
2{m.fTr(f,function(e,t,i,n){if(!i||!ae(e,n))return oe(e,t);let r=e;for(;null!==r&&ae(r,n);)r=oe(r,t);return r}(e,t,c,h))};m.M3l(()=>(n(),i(),ae),()=>{m.hZp(a,se(n(),i())||le(i(),h)&&ae(n(),h))}),m.iqF(),m.TsN();var g=_e(),y=m.jfp(g);m.qyt(y,()=>(m.iTV(C.A),m.vzK(()=>C.A.close())),!0),m.cLc(y);var v=m.hg4(y,2),x=m.jfp(v);te(x,{forceSeparateButtons:!0});var b=m.hg4(x,2),w=e=>{fe(e,{})},T=m.unG(()=>(n(),m.vzK(()=>l&&h.includes(n())))),E=e=>{ue(e,{})},S=m.unG(()=>(n(),m.vzK(()=>c&&!l&&d.includes(n())))),I=e=>{var t=m.Imx(),r=m.esp(t);m.Ebd(r,n,e=>{{let t=m.Xdt(()=>(i(),n(),m.vzK(()=>({...i().primary[n()]}))));F(e,{get field(){return m.JtY(t)},onFieldChange:e=>{const t=n();t&&void 0!==i().primary[t]&&(u.updateField(e.value,"primary",t),function(e,t){const i=t.primary[e];return void 0!==i&&"party_size"===i.type}(t,i())||_(t,i()))}})}}),m.BCw(e,t)};m.if(b,e=>{m.JtY(T)?e(w):m.JtY(S)?e(E,1):e(I,-1)});var A=m.hg4(b,2),M=m.jfp(A),D=m.jfp(M),P=e=>{var t=me(),i=m.hg4(m.esp(t)),n=e=>{var t=pe(),i=m.IuP(t);m.vNg(()=>m.jax(i,`(${r()??""})`)),m.BCw(e,t)};m.if(i,e=>{null!==r()&&e(n)}),m.BCw(e,t)},R=e=>{var t=m.Qq7("Next");m.BCw(e,t)};m.if(D,e=>{m.JtY(a)?e(P):e(R,-1)}),m.cLc(M),m.cLc(A),m.cLc(v),m.cLc(g),m.vNg(()=>m.ysU(M,1,`btn ${m.JtY(a)?"type-submit":""} ${m.JtY(a)&&null===r()?"in-progress":""}`)),m.f0J("click",y,()=>m.fTr(f,null)),m.f0J("click",M,()=>_(n(),i())),m.BCw(e,g),m.uYY(),s()}var ye=m.vUu('<button type="button" class="open-secondary highlight-interactivity"> </button>'),ve=m.vUu("<span> </span>"),xe=m.vUu('<li><!> <button type="button" class="remove-secondary-filter highlight-interactivity"></button></li>'),be=m.vUu('<ul class="secondary-filters-applied"></ul>');function we(e,t){m.VCO(t,!1);const[i,n]=m.DZI();let r=m._w2(t,"includeButtonsToOpenSecondary",8,!1);const o=function(){return Object.entries(m.Hzn(u,"$filterPanelFields",i).secondary)};m.TsN();var s=be();m.__1(s,5,()=>m.vzK(o),m.Pe0,(e,t)=>{var i=m.unG(()=>m._Nj(m.JtY(t),2));let n=()=>m.JtY(i)[0],o=()=>m.JtY(i)[1];var s=m.Imx(),a=m.esp(s),c=e=>{const t=m.Xdt(()=>(m.iTV(l),o(),m.vzK(()=>l.getCurrentValueLabel(o()))));var i=m.Imx(),s=m.esp(i),a=e=>{var i=xe(),o=m.jfp(i),s=e=>{var i=ye(),n=m.IuP(i,!0);m.vNg(()=>m.jax(n,m.JtY(t))),m.f0J("click",i,()=>m.fTr(d,!0)),m.BCw(e,i)},a=e=>{var i=ve(),n=m.IuP(i,!0);m.vNg(()=>m.jax(n,m.JtY(t))),m.BCw(e,i)};m.if(o,e=>{r()?e(s):e(a,-1)});var l=m.hg4(o,2);m.qyt(l,()=>(m.iTV(C.A),m.vzK(()=>C.A.remove())),!0),m.cLc(l),m.cLc(i),m.f0J("click",l,()=>{u.updateField(void 0,"secondary",n())}),m.BCw(e,i)};m.if(s,e=>{m.JtY(t)&&e(a)}),m.BCw(e,i)},h=e=>{var t=m.Imx(),i=m.esp(t);m.__1(i,1,()=>(o(),m.vzK(()=>o().value)),m.Pe0,(e,t)=>{const i=m.Xdt(()=>(m.iTV(l),o(),m.JtY(t),m.vzK(()=>l.getSpecificValueLabel(o(),m.JtY(t)))));var s=m.Imx(),a=m.esp(s),c=e=>{var s=xe(),a=m.jfp(s),l=e=>{var t=ye(),n=m.IuP(t,!0);m.vNg(()=>m.jax(n,m.JtY(i))),m.f0J("click",t,()=>m.fTr(d,!0)),m.BCw(e,t)},c=e=>{var t=ve(),n=m.IuP(t,!0);m.vNg(()=>m.jax(n,m.JtY(i))),m.BCw(e,t)};m.if(a,e=>{r()?e(l):e(c,-1)});var h=m.hg4(a,2);m.qyt(h,()=>(m.iTV(C.A),m.vzK(()=>C.A.remove())),!0),m.cLc(h),m.cLc(s),m.f0J("click",h,()=>{const e=[...o().value];e.splice(e.indexOf(m.JtY(t)),1);const i=0===e.length?void 0:e;u.updateField(i,"secondary",n())}),m.BCw(e,s)};m.if(a,e=>{m.JtY(i)&&e(c)}),m.BCw(e,s)}),m.BCw(e,t)},f=m.unG(()=>(o(),m.vzK(()=>"multi_select_option_set"===o().type&&Array.isArray(o().value)))),p=e=>{const t=m.Xdt(()=>(m.iTV(l),o(),m.vzK(()=>l.getCurrentValueLabel(o()))));var i=m.Imx(),s=m.esp(i),a=e=>{var i=xe(),o=m.jfp(i),s=e=>{var i=ye(),n=m.IuP(i,!0);m.vNg(()=>m.jax(n,m.JtY(t))),m.f0J("click",i,()=>m.fTr(d,!0)),m.BCw(e,i)},a=e=>{var i=ve(),n=m.IuP(i,!0);m.vNg(()=>m.jax(n,m.JtY(t))),m.BCw(e,i)};m.if(o,e=>{r()?e(s):e(a,-1)});var l=m.hg4(o,2);m.qyt(l,()=>(m.iTV(C.A),m.vzK(()=>C.A.remove())),!0),m.cLc(l),m.cLc(i),m.f0J("click",l,()=>{u.updateField(void 0,"secondary",n())}),m.BCw(e,i)};m.if(s,e=>{m.JtY(t)&&e(a)}),m.BCw(e,i)};m.if(a,e=>{o(),m.vzK(()=>
2"price"===o().type)?e(c):m.JtY(f)?e(h,1):(o(),m.vzK(()=>"option_set"===o().type&&void 0!==o().value)&&e(p,2))}),m.BCw(e,s)}),m.cLc(s),m.BCw(e,s),m.uYY(),n()}var Te=m.vUu("<form><!> <!></form>"),Ee=m.vUu('<span class="count-indicator"> </span>'),Se=m.vUu('<button type="button" title="More filters" id="secondary-filters-button"><!> <span class="text">Filters</span> <!></button>'),Ie=m.vUu("<small> </small>"),Ae=m.vUu('<div id="secondary-filters"><button type="button" class="close-button close-button--plain" title="Close"></button> <div id="secondary-filters-inner" class="d-flex flex-column justify-content-between mt-4"><div id="secondary-filters-fields"><div><h1>Filters</h1> <!></div> <!></div> <div class="d-flex align-items-center justify-content-between gap-3" id="secondary-filters-buttons"><button type="button">Clear All</button> <button type="button">Show Results <!></button></div></div></div>'),Me=m.vUu('<div id="filter-panel-row-one"><!> <!> <!></div> <!> <div id="secondary-filters-applied-container"><!></div>',1);function Ce(e,t){m.VCO(t,!1);const i=()=>m.Hzn(p,"$resultsCountForCurrentFilters",c),n=()=>m.Hzn(u,"$filterPanelFields",c),r=()=>m.Hzn(f,"$primaryFieldBeingEditedIndex",c),s=()=>m.Hzn(d,"$showSecondaryFilters",c),[c,h]=m.DZI(),_=m.zgK(),g=m.zgK();let y=m._w2(t,"onUpdate",8),v=m._w2(t,"pageHasMap",8),x=m._w2(t,"mapContainer",8),b=!0,w={primary:{},secondary:{}};const T=u.subscribe(e=>{w=e,b?b=!1:y()()});function E(){return l.serialise(w)}function S(e){m.fTr(p,e)}(0,o.sA)(T);const I=e=>{const t=new URLSearchParams(window.location.search);let i=0;return Object.entries(e).forEach(function([e,n]){const r=n.name,o=n.value;if(!t.has(r)){let i=!1;if(a.A.isPlainObject(o)&&Object.keys(o).forEach(function(n){i=t.has(`${e}[${n}]`)}),!i)return}i+=Array.isArray(o)?o.length:1}),i};m.M3l(()=>n(),()=>{m.hZp(_,I(n().secondary))}),m.M3l(()=>n(),()=>{m.hZp(g,I(n().primary))}),m.iqF();var A={serialise:E,setResultsCountForCurrentFilters:S};m.TsN();var M=Me(),D=m.esp(M);let P;var R=m.jfp(D),L=e=>{var t=Te(),i=m.jfp(t),o=e=>{var t=m.Imx(),i=m.esp(t),r=e=>{te(e,{})},o=e=>{ne(e,{})},s=m.unG(()=>(m.iTV(l),n(),m.vzK(()=>l.hasPrimaryFields(n()))));m.if(i,e=>{m.JtY(g)>0?e(r):m.JtY(s)&&e(o,1)}),m.BCw(e,t)};m.if(i,e=>{r()||e(o)});var s=m.hg4(i,2),a=e=>{ge(e,{})};m.if(s,e=>{r()&&e(a)}),m.cLc(t),m.BCw(e,t)},z=m.unG(()=>(m.iTV(l),n(),m.vzK(()=>l.hasPrimaryFields(n()))));m.if(R,e=>{m.JtY(z)&&e(L)});var O=m.hg4(R,2),k=e=>{var t=Se(),i=m.jfp(t);m.qyt(i,()=>(m.iTV(C.A),m.vzK(()=>C.A.filters())));var n=m.hg4(i,4),r=e=>{var t=Ee(),i=m.IuP(t,!0);m.vNg(()=>m.jax(i,m.JtY(_))),m.BCw(e,t)};m.if(n,e=>{m.JtY(_)>0&&e(r)}),m.cLc(t),m.f0J("click",t,()=>m.fTr(d,!s())),m.BCw(e,t)},B=m.unG(()=>(n(),m.vzK(()=>void 0!==n().secondary&&Object.entries(n().secondary).length>0)));m.if(O,e=>{m.JtY(B)&&e(k)});var N=m.hg4(O,2),V=e=>{(0,re.A)(e,{get mapContainer(){return x()}})};m.if(N,e=>{v()&&e(V)}),m.cLc(D);var U=m.hg4(D,2),j=e=>{var t=Ae(),r=m.jfp(t);m.qyt(r,()=>(m.iTV(C.A),m.vzK(()=>C.A.close())),!0),m.cLc(r);var o=m.hg4(r,2),s=m.jfp(o),a=m.jfp(s);we(m.hg4(m.jfp(a),2),{}),m.cLc(a);var l=m.hg4(a,2);m.__1(l,1,()=>(n(),m.vzK(()=>Object.entries(n().secondary))),m.Pe0,(e,t)=>{var i=m.unG(()=>m._Nj(m.JtY(t),2));let n=()=>m.JtY(i)[1];{let t=m.Xdt(()=>(n(),m.vzK(()=>({...n()}))));F(e,{get field(){return m.JtY(t)},onFieldChange:e=>u.updateField(e.value,"secondary",m.JtY(i)[0])})}}),m.cLc(s);var c=m.hg4(s,2),h=m.jfp(c),f=m.hg4(h,2),p=m.hg4(m.jfp(f)),_=e=>{var t=Ie(),n=m.IuP(t);m.vNg(()=>m.jax(n,`(${i()??""})`)),m.BCw(e,t)};m.if(p,e=>{null!==i()&&e(_)}),m.cLc(f),m.cLc(c),m.cLc(o),m.cLc(t),m.vNg(()=>m.ysU(f,1,"btn type-submit "+(null===i()?"in-progress":""))),m.f0J("click",r,()=>m.fTr(d,!1)),m.f0J("click",h,function(...e){u.clearAllSecondary?.apply(this,e)}),m.f0J("click",f,()=>m.fTr(d,!1)),m.BCw(e,t)};m.if(U,e=>{s()&&e(j)});var G=m.hg4(U,2);we(m.jfp(G),{includeButtonsToOpenSecondary:!0}),m.cLc(G),m.vNg(e=>{P=m.ysU(D,1,"",null,P,{"has-primary-fields":e}),m.ysU(G,1,m.$z$(0===m.JtY(_)?"empty":""))},[()=>l.hasPrimaryFields(n())]),m.BCw(e,M),m.Ekk(t,"serialise",E),m.Ekk(t,"setResultsCountForCurrentFilters",S);var $=m.uYY(A);return h(),$}class De{constructor(e,t,i){this.rootElem=e,this.search=t,this.mapContainer=i,this.setUp()}setUpForm(){if(null==this.rootElem.querySelector("#filter-panel-placeholder"))return;const e=this.rootElem.querySelector("script").innerText;u.set(l.deserialiseFilterPanelFieldsJson(e))}setUp(){this.setUpForm(),this.rootElem.innerText="";const e=(0,o.Or)(Ce,{target:this.rootElem,props:{onUpdate:()=>{this.search.doNewSearch(!0)},pageHasMap:"1"===this.rootElem.dataset.pagehasmap,mapContainer:this.mapContainer}}
2);this.search.setSvelteFilterPanel(e),this.search.run(),null!==this.mapContainer&&this.mapContainer.load()}}var Pe=i(6240),Re=i(2139),Le=i(3123),ze=i(7507);const Fe=document.querySelector("main");ze.A.createAll(Fe);const Oe=document.getElementById("map-container"),ke=null===Oe?null:new Pe.A(Oe,!0),Be=new Le.A(document.querySelector(".webpage-results"),ke),Ne=document.body.classList.contains("listings-page--top-ten"),Ve=document.getElementById("filter-panel-container");if(Ne||null===Ve){null!==document.querySelector(".map-toggle")&&new Re.A(document.querySelector(".map-toggle"),ke),Be.run(),ke.load()}else new De(Ve,Be,ke)},7507:function(e,t,i){"use strict";i(8992),i(3949);class n{static createAll(e){e.querySelectorAll(".tc-canvas").forEach(function(e){new n(e)})}constructor(e){this.rootElem=e,this.rootElem.ownerDocument.defaultView.addEventListener("load",this.handleWindowLoaded.bind(this)),this.getTabsElem()?.addEventListener("click",this.handleTabButtonClick.bind(this))}getTabsElem(){return this.rootElem.querySelector(":scope > .tc-tabs")}getTabButtonElems(){const e=this.getTabsElem();return null===e?[]:Array.from(e.querySelectorAll("button"))}getPaneElems(){const e=this.rootElem.querySelector(":scope > .tc-panes");return Array.from(e.children)}handleTabButtonClick(e){const t=e.target;if("BUTTON"!==t.tagName)return;const i=t.dataset.bsTarget;if(void 0===i)throw new Error("The tab-button does not identify the selector of the tab-pane it activates");
2this.getPaneElems().forEach(e=>{const t=[n.CN_SHOW,n.CN_ACTIVE];e.matches(i)?e.classList.add(...t):e.classList.remove(...t)}),this.getTabButtonElems().forEach(e=>{e===t?(e.classList.add(n.CN_ACTIVE),e.ariaSelected="true"):(e.classList.remove(n.CN_ACTIVE),e.ariaSelected="false")})}handleWindowLoaded(){let e=0;this.getPaneElems().forEach(function(t){t.offsetHeight>e&&(e=t.offsetHeight)}),this.getPaneElems().forEach(function(t){t.style.minHeight=`${e}px`})}}n.CN_SHOW="tc--show",n.CN_ACTIVE="tc--active",t.A=n},1776:function(e,t,i){"use strict";i.d(t,{A:function(){return n}});class n{static finalizeIcon(e){return e}static map(){return this.finalizeIcon('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Pro v7.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2026 Fonticons, Inc.--\x3e<path d="M576 90.7L576 64.7L552.8 76.4L416.9 144.8L230.6 82.7L224.6 80.7L218.9 83.3L73.3 149.4L63.9 153.7L63.9 575.4L87.1 563.7L223 495.3L397.9 553.6C389.3 540.5 380.8 526.4 373.3 511.7L239.9 467.2L239.9 119.5L399.9 172.8L399.9 282.2C409.6 273.6 420.4 266.1 431.9 260L431.9 173L543.9 116.6L543.9 243C555 245.1 565.7 248.3 575.9 252.5L575.9 90.7zM208 467L96 523.4L96 174.2L208 123.4L208 467zM512 320C561.1 320 600 359 600 405.9C600 423.1 594.4 443.3 584.2 465.4C574.1 487.2 560.4 508.9 546.1 528.5C534 545.1 521.9 559.7 512 571.1C502 559.7 489.9 545.1 477.9 528.5C463.7 508.9 449.9 487.2 439.8 465.4C429.6 443.3 424 423.1 424 405.9C424 359 462.9 320 512 320zM533.9 594.6C568.5 555.5 632 474.5 632 405.9C632 340.8 578.3 288 512 288C445.7 288 392 340.8 392 405.9C392 474.5 455.5 555.6 490.1 594.7C497.1 602.6 502.9 608.7 506.7 612.8C510 616.3 511.9 618.1 511.9 618.1C511.9 618.1 513.8 616.2 517.1 612.8C521 608.8 526.8 602.6 533.7 594.7zM512 432C498.7 432 488 421.3 488 408C488 394.7 498.7 384 512 384C525.3 384 536 394.7 536 408C536 421.3 525.3 432 512 432zM456 408C456 438.9 481.1 464 512 464C542.9 464 568 438.9 568 408C568 377.1 542.9 352 512 352C481.1 352 456 377.1 456 408z"/></svg>')}static close(){return this.finalizeIcon('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Pro v7.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2026 Fonticons, Inc.--\x3e<path d="M68.8 91.3L57.5 80L80.1 57.4L91.4 68.7L320.1 297.4L548.8 68.7L560.1 57.4L582.8 80L571.4 91.3L342.8 320L571.4 548.7L582.8 560L560.1 582.6L548.8 571.3L320.1 342.6L91.4 571.3L80.1 582.6L57.5 560L68.8 548.7L297.5 320L68.8 91.3z"/></svg>')}static search(){return this.finalizeIcon('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Pro v7.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2026 Fonticons, Inc.--\x3e<path d="M448.1 272C448.1 174.8 369.3 96 272.1 96C174.9 96 96.1 174.8 96.1 272C96.1 369.2 174.9 448 272.1 448C369.3 448 448.1 369.2 448.1 272zM407.5 430C371.1 461.2 323.8 480 272.2 480C157.3 480 64.2 386.9 64.2 272C64.2 157.1 157.3 64 272.2 64C387.1 64 480.2 157.1 480.2 272C480.2 323.7 461.4 371 430.2 407.3L571.6 548.7L582.9 560L560.3 582.6L549 571.3L407.6 429.9z"/></svg>')}static filters(){return this.finalizeIcon('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Pro v7.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2026 Fonticons, Inc.--\x3e<path d="M64 464L144 464L144 400L304 400L304 464L576 464L576 496L304 496L304 560L144 560L144 496L64 496L64 464zM272 496L272 432L176 432L176 528L272 528L272 496zM64 304L336 304L336 240L496 240L496 304L576 304L576 336L496 336L496 400L336 400L336 336L64 336L64 304zM176 176L64 176L64 144L176 144L176 80L336 80L336 144L576 144L576 176L336 176L336 240L176 240L176 176zM208 176L208 208L304 208L304 112L208 112L208 176zM464 304L464 272L368 272L368 368L464 368L464 304z"/></svg>')}static increment(){return this.finalizeIcon('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Pro v7.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2026 Fonticons, Inc.--\x3e<path d="M336 112L336 96L304 96L304 304L96 304L96 336L304 336L304 544L336 544L336 336L544 336L544 304L336 304L336 112z"/></svg>')}
2static decrement(){return this.finalizeIcon('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Pro v7.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2026 Fonticons, Inc.--\x3e<path d="M96 304L544 304L544 336L96 336L96 304z"/></svg>')}static remove(){return this.finalizeIcon('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Pro v7.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2026 Fonticons, Inc.--\x3e<path d="M248 48L236.1 48L232.7 59.4L212.1 128L96 128L96 160L544 160L544 128L427.9 128L407.3 59.4L403.9 48L248 48zM394.5 128L245.5 128L259.9 80L380.1 80L394.5 128zM124.7 208L152 576L488 576L515.3 208L483.2 208L458.3 544L181.7 544L156.8 208L124.7 208z"/></svg>')}}},6784:function(e,t,i){"use strict";var n=i.cw(function(e,t){window.addEventListener("load",()=>{const e=document.createElement("img"),t="srcset"in e;e.remove();const i=(e,i,n,r)=>{if(n.length>0&&t)r.length>0&&(e.sizes=r),e.srcset=n;else{if(!(i.length>0))throw new Error("No valid image source");e.src=i}},n=e=>{s.unobserve(e),e.classList.add("lazyloading"),e.classList.remove("lazyload");const t=e.getAttribute("data-sizes")??"",n=e.getAttribute("data-srcset")??"",r=e.getAttribute("data-src")??"",o=document.createElement("img");o.onload=()=>{e.classList.add("lazyloaded"),e.classList.remove("lazyloading"),i(e,r,n,t)},i(o,r,n,t)};let r=[];const o=()=>{for(const e of r)if(null!==e.target.querySelector("img.lazyload")){a();break}r.length=0};new MutationObserver(e=>{r=[...r,...e],r.length>0&&window.requestAnimationFrame(o)}).observe(document.body,{childList:!0,subtree:!0});const s=new IntersectionObserver(e=>{for(const t of e)t.isIntersecting&&!t.target.classList.contains("lazyloaded")&&n(t.target)},{root:null,rootMargin:"100px",threshold:0}),a=()=>{s.disconnect();const e=document.querySelectorAll("img.lazyload");for(const t of e)s.observe(t)};a()})}),r=i.cw(function(e,t){(class{static activate(e){null!=e&&new this(e)}constructor(e){this.rootElem=e,this.setUp()}getDocument(){return this.rootElem.ownerDocument}getWindow(){return this.getDocument().defaultView}handlePageScrolled(){const e=this.getDocument().documentElement.scrollTop>=this.adjStickingPositionPx,t=this.rootElem.getBoundingClientRect().top<=this.adjStickingPositionPx,i=e&&t;this.rootElem.classList.toggle("opaque",i)}setUp(){const e=parseInt(this.getWindow().getComputedStyle(this.rootElem).top,10);this.adjStickingPositionPx=e+1-.1,this.getWindow().addEventListener("scroll",this.handlePageScrolled.bind(this),{passive:!0}),this.handlePageScrolled()}}).activate(document.getElementById("main-header"))});i(8992),i(3949);n();var o=i(5611);class s{constructor(e){this.rootElem=e,this.setUp()}hideSubmenusAndDeselectTheirTriggers(e=null){e=e??{};this.rootElem.querySelectorAll(`.${s.CN_SUBMENU}`).forEach(function(e){e.classList.remove(s.CN_SHOW)});this.rootElem.querySelectorAll("button.toggle-submenu").forEach(function(e){e.classList.remove(s.CN_SELECTED)}),this.rootElem.classList.remove(s.CN_SUBMENU_SHOWN_INSIDE),(void 0===e.dispatchEvents||e.dispatchEvents)&&this.rootElem.dispatchEvent(new CustomEvent("main-menu:submenus-hidden"))}toggleSubmenu(e){const t=e.parentElement.querySelector(`.${s.CN_SUBMENU}`),i=t.classList.contains(s.CN_SHOW);this.hideSubmenusAndDeselectTheirTriggers({dispatchEvents:i}),i||(t.classList.add(s.CN_SHOW),e.classList.add(s.CN_SELECTED),this.rootElem.classList.add(s.CN_SUBMENU_SHOWN_INSIDE),this.rootElem.dispatchEvent(new CustomEvent("main-menu:submenu-shown")))}showFlyout(){this.hideSubmenusAndDeselectTheirTriggers({dispatchEvents:!1}),this.rootElem.classList.add(s.CN_SHOW),this.rootElem.dispatchEvent(new CustomEvent("main-menu:flyout-shown"))}resetFlyout(){this.hideSubmenusAndDeselectTheirTriggers(),this.rootElem.classList.remove(s.CN_SHOW),this.rootElem.dispatchEvent(new CustomEvent("main-menu:flyout-reset"))}handleButtonClicked(e){const t=new o.A(e).getButtonTarget(2);if(t instanceof HTMLButtonElement)switch(e.preventDefault(),!0){case t.classList.contains("mm-internal-trigger--hide-submenu"):this.hideSubmenusAndDeselectTheirTriggers();break;case t.classList.contains("mm-internal-trigger--reset-flyout"):this.resetFlyout();break;case t.classList.contains("toggle-submenu"):this.toggleSubmenu(t)}}setUp(){this.rootElem.addEventListener("click",this.handleButtonClicked.bind(this))}}s.CN_SHOW="open",s.CN_SUBMENU="secondary",s.CN_SUBMENU_SHOWN_INSIDE="mm--submenu-shown",s.CN_SELECTED="selected";const a=document.getElementById("main-menu"),l=new s(a);!function(e){if(null===e)return;const t=e.ownerDocument.body;a.addEventListener("main-menu:submenu-shown",function(){t.classList.add("submenu-is-shown")}),a.addEventListener("main-menu:submenus-hidden",function(){t.classList.remove("submenu-is-shown")}),a.addEventListener("main-menu:flyout-shown",function(){t.classList.add("menu-is-shown")}),a.addEventListener("main-menu:flyout-reset",function(){t.classList.remove("menu-is-shown")})}(document.getElementById("main-header"));document.querySelectorAll(".start-your-search-button, #menu-open-button").forEach(function(e){e.addEventListener("click",function(e){e.preventDefault(),l.showFlyout()})});var c=i(1578);class u extends c.A{static BEM_BLOCK="tag-question-whirligig";isExpandable(){return this.getRootElem().classList.contains(`${u.BEM_BLOCK}--expandable`)}setUpCarousel(){i.e(298).then(i.bind(i,4298))}handleExpandBodyButtonClicked(e){e.preventDefault();const t=new o.A(e).getButtonTarget();this.getRootElem().classList.add("expanded"),t.parentElement.removeChild(t)}setUpGrid(){if(this.isExpandable()){const e=this.getRootElem().querySelector(`.${u.BEM_BLOCK}__expand-body`);e&&e.addEventListener("click",this.handleExpandBodyButtonClicked.bind(this))}}setUp(){this.getRootElem().classList.contains(`${u.BEM_BLOCK}--film-strip`)?this.setUpCarousel():this.getRootElem().classList.contains(`${u.BEM_BLOCK}--grid`)&&this.setUpGrid()}}
2(new class{loadPanel(e){fetch(e.dataset.source).then(async function(t){t.ok&&(e.innerHTML=await t.text(),e.classList.remove("loading-spinner"))})}observerCallback(e,t){e.forEach(e=>{e.isIntersecting&&(this.loadPanel(e.target),t.unobserve(e.target))})}loadAll(e){const t=document.querySelectorAll(e),i=new IntersectionObserver(this.observerCallback.bind(this),{rootMargin:"500px",threshold:0});t.forEach(e=>{i.observe(e)})}}).loadAll(".lazy-loaded.panel"),document.querySelectorAll(".tag-question-whirligig").forEach(function(e){new u(e)}),r();i(8140);class h{constructor(e,t){this.url=e,this.pageUrl=t}getFragmentId(){return new URL(this.url).hash}containsFragmentId(){return""!==this.getFragmentId()}isJustFragmentId(){return!!this.containsFragmentId()&&this.url.replace(this.pageUrl,"")===this.getFragmentId()}}document.querySelectorAll(".buy-ski-passes").forEach(function(e){e.addEventListener("click",function(e){const t=new o.A(e).getAnchorTarget(2);if(!new h(t.href,window.location.href).isJustFragmentId())return;e.preventDefault();document.querySelector("#menu-open-button").click();document.querySelector("#main-menu .buy-ski-passes-menu :is(button,a)").click()})});const d=document.querySelector(".service-announcement");null!==d&&(d.addEventListener("click",function(e){if(!e.target.classList.contains("dismiss"))return;e.preventDefault();document.cookie="service_announcement_show=0;max-age=1814400",d.remove()}),d.classList.add("show")),document.body.addEventListener("click",function(e){if(!(e.target instanceof HTMLAnchorElement))return;const t=e.target,i=new h(t.href,window.location.href);i.isJustFragmentId()&&(e.preventDefault(),function(e,t=0){const i=e.getBoundingClientRect().top+window.pageYOffset-t;e.ownerDocument?.defaultView.scrollTo({top:i,behavior:"smooth"})}(document.querySelector(i.getFragmentId()),document.getElementById("main-header").offsetHeight))})},1498:function(e,t,i){"use strict";i.d(t,{default:function(){return s}});i(4114),i(8992),i(2577),i(3949);var n=i(842),r=i.n(n);i(1454);class o{onAdd(e){return this.map=e,this.container=document.createElement("form"),this.container.className="search-when-map-moves-form mapboxgl-ctrl mapboxgl-ctrl-group",this.container.innerHTML='\n <div class="p-1 mb-0">\n <input id="search-after-move-map" type="checkbox" checked></input>\n <label for="search-after-move-map"><span>Search after moving map</span></label>\n <div>\n ',this.container}onRemove(){this.container.parentNode.removeChild(this.container),this.map=void 0}}class s{constructor(e,t){this.hasBeenDisplayed=!1,this.mapboxMap=null,this.replaceMarkers([]),this.rootElem=e,this.options={...t},this.defaultCentre=JSON.parse(this.getRootElem().dataset.location),this.setMarkerLocations(this.options.markerLocations)}setMarkerLocations(e,t=!1){this.markerLocations=e,this.hasBeenDisplayed&&this.refreshMarkers(this.markerLocations,t)}getMarkerLocations(){return this.markerLocations}hasMarkerLocations(){return this.getMarkerLocations().length>0}setMapUpdateCallback(e){this.mapUpdateCallback=e}initialiseMapboxMapAndIncurCharge(){r().accessToken="pk.eyJ1IjoicG93ZGVyYmx1ZSIsImEiOiJja2psY3FkMGkwbXh1MnpzMmZiZWw5ZzFpIn0.n8jGRFNfYX-RgZ_iFJiXLw";const e={container:this.getRootElem(),style:"mapbox://styles/mapbox/light-v10?optimize=true",minZoom:4};if(this.hasMarkerLocations()){const t=new n.LngLatBounds;this.getMarkerLocations().forEach(e=>{t.extend([e.lng,e.lat])}),e.bounds=t}else e.center=[this.defaultCentre.lng,this.defaultCentre.lat],e.zoom=8;this.mapboxMap=new n.Map(e),this.setUpCustomControls(),this.refreshMarkers(this.getMarkerLocations(),!1),this.mapboxMap.on("load",()=>this.getRootElem().classList.remove("loading-spinner")),this.getWindow().addEventListener("resize",()=>this.handleLayoutChange()),this.recenter(),this.mapboxMap.on("dragend",()=>this.afterMapMove()),this.mapboxMap.on("zoomend",()=>this.afterMapMove()),this.mapboxMap.on("rotateend",()=>this.afterMapMove()),this.mapboxMap.on("boxzoomend",()=>this.afterMapMove()),this.mapboxMap.on("pitchend",()=>this.afterMapMove()),this.hasBeenDisplayed=!0}afterMapMove(){if(this.latestMoveWasAuto)return void(this.latestMoveWasAuto=!1);if(!this.hasBeenDisplayed||!this.options.showMapOptionsPanel)return;this.getDocument().getElementById("search-after-move-map").checked&&this.mapUpdateCallback()}setUpCustomControls(){this.options.showMapOptionsPanel&&this.mapboxMap.addControl(new o,"bottom-right"),this.mapboxMap.addControl(new n.NavigationControl({showCompass:!1}),"bottom-right")}
2replaceMarkers(e){void 0!==this.markers&&this.markers.forEach(e=>{e.remove()}),this.markers=e}getMarkers(){return this.markers}show(){this.hasBeenDisplayed?this.mapboxMap.triggerRepaint():this.initialiseMapboxMapAndIncurCharge()}getSerialisedMapBounds(){if(!this.hasBeenDisplayed)return"";const e=this.mapboxMap.getBounds();return"map[n]="+String(e.getNorth())+"&map[e]="+String(e.getEast())+"&map[s]="+String(e.getSouth())+"&map[w]="+String(e.getWest())}handleLayoutChange(){this.latestMoveWasAuto=!0,this.hasBeenDisplayed&&(this.mapboxMap.resize(),this.recenter())}recenter(){if(this.latestMoveWasAuto=!0,this.hasMarkerLocations()){const e=new n.LngLatBounds;this.getMarkerLocations().forEach(t=>{e.extend([t.lng,t.lat])}),this.mapboxMap.fitBounds(e,{padding:112,maxZoom:17})}else this.mapboxMap.setZoom(8),this.mapboxMap.setCenter([this.defaultCentre.lng,this.defaultCentre.lat])}createMarkerImageElem(e){const t=this.getDocument().createElement("img");return t.src=i(6659)("./map-marker"+(e?"-em":"")+".svg").toString(),t.classList.add("map-marker"),e&&t.classList.add("special"),t}refreshMarkers(e,t=!1){const i=[];0!==e.length&&(e.sort((e,t)=>e._is_special?1:t._is_special?-1:0),e.forEach(e=>{const t=new n.Popup({focusAfterOpen:!1,closeButton:!1});t.setHTML('<div><div class="loading-spinner"></div></div>'),t.on("open",async function(){const i=t.getElement();if(null!==i.querySelector(".map-popup-content"))return;const n=await fetch(e._info_url);n.ok&&(t.setHTML(await n.text()),i.querySelector(".close-button").addEventListener("click",t.remove.bind(t)))});const r=new n.Marker({anchor:"bottom",element:this.createMarkerImageElem(e._is_special)}).setLngLat([e.lng,e.lat]).setPopup(t).addTo(this.mapboxMap);r.getElement().dataset.id=e.id_c_item.toString(),r.getElement().addEventListener("click",()=>{this.latestMoveWasAuto=!0}),i.push(r)}),this.replaceMarkers(i),t||this.recenter())}findMarker(e){return this.getMarkers().find(t=>{const i=t.getElement().dataset.id;return parseInt(i)===e})}highlightItem(e,t=!0){const i=this.findMarker(e);if(void 0===i||!this.hasBeenDisplayed)return;const n=t?"add":"remove";i.getElement().classList[n]("map-pin-highlight")}getRootElem(){return this.rootElem}getDocument(){return this.getRootElem().ownerDocument}getWindow(){return this.getDocument().defaultView}}},6240:function(e,t,i){"use strict";class n{constructor(e,t,i=[]){this.indexPageMap=null,this.mapUpdateCallback=null,this.mapLoaded=!1,this.setMapIsVisible(!1),this.rootElem=e,this.showMapOptionsPanel=t,this.setMarkerLocations(i)}getDocument(){return this.rootElem.ownerDocument}setMapIsVisible(e){this.mapIsVisible=e}isMapVisible(){return this.mapIsVisible}setMarkerLocations(e){if(!Array.isArray(e))throw new Error("Marker locations is not an array");if(this.markerLocations=e,null!==this.indexPageMap){const e=!0;this.indexPageMap.setMarkerLocations(this.markerLocations,!e)}}getMarkerLocations(){return this.markerLocations}getIndexPageMap(){return this.indexPageMap}show(){const e=this.getDocument().querySelector("#main-header");this.rootElem.style.paddingTop=`${e.offsetHeight}px`,this.getDocument().body.classList.add(n.CN_MAP_SHOWN),this.loadMap(),this.setMapIsVisible(!0)}hide(){this.getDocument().body.classList.remove(n.CN_MAP_SHOWN),this.setMapIsVisible(!1)}toggle(){return this.isMapVisible()?(this.hide(),!1):(this.show(),!0)}load(){}loadMap(){this.mapLoaded||(this.mapLoaded=!0,Promise.all([i.e(990),i.e(498)]).then(i.bind(i,1498)).then(e=>{const t=e.default;this.indexPageMap=new t(this.rootElem.querySelector(".interactive-map"),{showMapOptionsPanel:this.showMapOptionsPanel,markerLocations:this.getMarkerLocations()}),this.indexPageMap.show(),null!==this.mapUpdateCallback&&this.indexPageMap.setMapUpdateCallback(this.mapUpdateCallback)}))}setMapUpdateCallback(e){null!=this.indexPageMap?this.indexPageMap.setMapUpdateCallback(e):this.mapUpdateCallback=e}}n.CN_MAP_SHOWN="map-is-shown",t.A=n},2139:function(e,t,i){"use strict";i.d(t,{A:function(){return n}});class n{constructor(e,t){this.rootElem=e,this.mapContainer=t,this.setUp()}handleClick(e){this.mapContainer.isMapVisible()?(this.rootElem.querySelector("span").innerHTML="Show map",this.rootElem.classList.remove("selected"),this.mapContainer.hide()):(this.rootElem.querySelector("span").innerHTML="Hide map",this.rootElem.classList.add("selected"),this.mapContainer.show())}setUp(){this.rootElem.addEventListener("click",this.handleClick.bind(this))}}},3123:function(e,t,i){"use strict";i.d(t,{A:function(){return h}});
2i(4114),i(8992),i(3949);var n=i(8140),r=(i(5299),i(9015));class o extends r.A{}var s=i(9295),a=i(8299),l=i(1498),c=i(848);class u{constructor(e,t=null){this.xhr=null,this.rootElem=e,this.mapContainer=t;const i=this.getRootElem().querySelector(".webpage-results__data");null!==i&&(this.initialData=JSON.parse(i.textContent));let n=null,r=!1;void 0!==this.initialData&&(n=void 0===this.initialData.nextPage?null:this.initialData.nextPage,r=!0),this.setWorkingState(n,r)}getRootElem(){return this.rootElem}getMapContainer(){return this.mapContainer}getFeaturedElem(){return this.getRootElem().querySelector(".webpage-results__featured")}getItemsElem(){return this.getRootElem().querySelector(".webpage-results__items")}log(...e){console.log("[Search]",...e)}clearResults(){this.getFeaturedElem().replaceChildren(),this.log("Cleared featured"),this.getItemsElem().replaceChildren(),this.log("Cleared items")}divvyFetchedResults(e){void 0!==e.featured&&(s.A.appendHtmlTo(e.featured,this.getFeaturedElem()),this.log("Inserted featured")),void 0!==e.items&&(s.A.appendHtmlTo(e.items,this.getItemsElem()),this.log("Inserted items"))}getLazyLoadTriggerElem(){return this.getRootElem().querySelector(".infinite-scroll-trigger")}markLoading(){this.getLazyLoadTriggerElem().classList.add(u.CN_SPINNER)}markLoaded(){this.getLazyLoadTriggerElem().classList.remove(u.CN_SPINNER)}disableFetching(){this.fetchingEnabled=!1}setWorkingState(e,t=!0){if(null===e)t=!1;else{const t=e;if(e=c.A.toDecimalInteger(e),isNaN(e)||e<1)throw new Error(`The page to fetch, \`${t}\`, is invalid`)}this.pageToFetch=e,this.fetchingEnabled=t}getPageToFetch(){return this.pageToFetch}isFetchingEnabled(){return this.fetchingEnabled}setSvelteFilterPanel(e){this.svelteFilterPanel=e}getSvelteFilterPanel(){return this.svelteFilterPanel}highlightResultOnMap(e,t=!0){if(null===this.getMapContainer()||null===this.getMapContainer().getIndexPageMap())return;const i=e.closest(u.SELECTOR_RESULT);if(!i.classList.contains("has-location"))return;const n=c.A.toDecimalInteger(i.dataset.id);this.getMapContainer().getIndexPageMap().highlightItem(n,t)}handleResultMouseover(e){this.highlightResultOnMap(e.target)}handleResultMouseout(e){this.highlightResultOnMap(e.target,!1)}setUpAfterResultsAdded(e,t){null!==e&&void 0!==this.getSvelteFilterPanel()&&this.getSvelteFilterPanel().setResultsCountForCurrentFilters(e),null!==t&&null!==this.getMapContainer()&&this.getMapContainer().setMarkerLocations(t);this.getRootElem().querySelectorAll(u.SELECTOR_RESULT).forEach(e=>{void 0===e.dataset.searchadded&&((0,n.E)(e),new o(e),e.addEventListener("mouseover",this.handleResultMouseover.bind(this)),e.addEventListener("mouseleave",this.handleResultMouseout.bind(this)),e.dataset.searchadded="1",a.A.cItemReloaded(e))})}gatherFilterParams(e=!1){const t=[];return void 0!==this.getSvelteFilterPanel()&&t.push(this.getSvelteFilterPanel().serialise()),e&&this.getMapContainer()?.getIndexPageMap()instanceof l.default&&c.A.isDesktop()&&t.push(this.getMapContainer().getIndexPageMap().getSerialisedMapBounds()),t}abortAnExistingRequest(){null!==this.xhr&&(this.xhr.abort(),this.xhr=null,this.log("ð","Aborted existing"))}recreateRequest(){return this.abortAnExistingRequest(),this.xhr=new XMLHttpRequest,this.xhr.responseType="json",this.log("âï¸","Created new"),this.xhr}handleFetchDone(e,t,i,n){if(e===this.xhr&&e.readyState===XMLHttpRequest.DONE){if(this.markLoaded(),200===e.status){const i=e.response.result,r=i.itemsTotalForFilters;return this.log("â¬
ï¸","itemsTotalForFilters:",r),this.divvyFetchedResults(i),this.setUpAfterResultsAdded(r,t?i.allResultLocations:null),this.setWorkingState(i.nextPage,!i.isLastPage),void(void 0!==n&&n())}return 404===e.status?(this.log("â¬
ï¸","No results"),void this.setWorkingState(null)):void 0}}fetchResults(e,t,i){if(e&&(this.abortAnExistingRequest(),this.setWorkingState(1),this.clearResults()),!this.isFetchingEnabled())return;this.disableFetching(),this.markLoading();const n=[...this.gatherFilterParams(t),"page="+(String(this.getPageToFetch())??""),"_format=json"].filter(function(e){return""!==e});this.log("â¡ï¸",n);const r=this.recreateRequest();r.open("GET",`${window.location.pathname}?${n.join("&")}`),r.onreadystatechange=this.handleFetchDone.bind(this,r,e,t,i),r.send()}setupInfiniteScrolling(){new IntersectionObserver(e=>
2{this.isFetchingEnabled()&&e.forEach(e=>{e.isIntersecting&&this.fetchResults(!1,!0)})},{rootMargin:"500px"}).observe(this.getLazyLoadTriggerElem())}setupBrowseFullRange(){this.getRootElem().addEventListener("click",e=>{"browse-full-range"===e.target.id&&(e.preventDefault(),window.history.pushState("","browse","?browse"),this.fetchResults(!0,!1))})}setupMapUpdateCallback(){null!==this.getMapContainer()&&this.getMapContainer().setMapUpdateCallback(this.doNewSearch.bind(this,!1,!0))}run(){if(this.setupInfiniteScrolling(),this.setupBrowseFullRange(),this.setupMapUpdateCallback(),1===this.getPageToFetch())this.fetchResults(!1,!0);else{let e=null,t=null;void 0!==this.initialData&&(e=this.initialData.itemsTotalForFilters??null,t=Array.isArray(this.initialData.allResultLocations)?this.initialData.allResultLocations:null),this.setUpAfterResultsAdded(e,t)}}scrollToItems(){this.getRootElem().scrollIntoView({behavior:"smooth"})}doNewSearch(e,t=!1){window.history.pushState("","search",`?${this.gatherFilterParams().join("&")}`),void 0!==this.getSvelteFilterPanel()&&this.getSvelteFilterPanel().setResultsCountForCurrentFilters(null);const i=e?()=>{c.A.isDesktop()||this.scrollToItems()}:void 0;this.fetchResults(!0,t,i)}}u.SELECTOR_RESULT=".c-item",u.CN_SPINNER="loading-spinner";var h=u},4298:function(e,t,i){"use strict";i(8992),i(3949);var n=i(848);class r{constructor(e,t=null){this.rootElem=e,this.buttonsRelativeTo=t,this.carouselElem=this.getRootElem().querySelector(".carousel__items"),this.setUp()}getRootElem(){return this.rootElem}getCarouselElem(){return this.carouselElem}getWindow(){return this.getRootElem().ownerDocument.defaultView}getDeltaPx(){if(void 0===this.deltaPx){const e=this.getCarouselElem().children.item(0).offsetWidth,t=this.getWindow().getComputedStyle(this.getCarouselElem()),i=e+n.A.toDecimalInteger(t.gap),r=n.A.toDecimalInteger(t.width),o=Math.floor(r/i);this.deltaPx=o*i}return this.deltaPx}move(e){this.getCarouselElem().scrollBy({left:e*this.getDeltaPx(),behavior:"smooth"})}setUp(){const e=this.getCarouselElem(),t=this.getRootElem().querySelector(".direction-button--next"),i=this.getRootElem().querySelector(".direction-button--prev");if(e.scrollWidth>e.parentElement.clientWidth){if(null!==this.buttonsRelativeTo){const n=e.querySelector(this.buttonsRelativeTo);if(null!==n){const e=String(n.offsetHeight/2-t.offsetHeight/2)+"px";t.style.top=e,i.style.top=e}}t.addEventListener("click",this.move.bind(this,1)),i.addEventListener("click",this.move.bind(this,-1))}else t.style.display="none",i.style.display="none";this.getRootElem().classList.add("loaded")}}document.querySelectorAll(".carousel").forEach(e=>{new r(e,".summary-image-in-link")})},5299:function(e,t,i){"use strict";var n=i(2046);document.body.addEventListener("click",function(e){const t=e.target;"A"===t.tagName&&t.classList.contains("internal-booking-enquiry-cta")&&(e.preventDefault(),n.A.openLocation(t.href))})},2046:function(e,t,i){"use strict";i.d(t,{A:function(){return a}});i(8992),i(3949);var n=i(5611),r=i(1776);window.SeeTheWorld||(window.SeeTheWorld={});var o=window.SeeTheWorld;class s{constructor(e){this.setDocument(e),this.setUp()}mkElem(e,t,i){const n=this.getDocument().createElement(e);return Object.entries(t).forEach(e=>{n.setAttribute(e[0],e[1])}),void 0!==i&&(n.innerHTML=i),n}revealSpinner(){this.getContentElem().classList.add(s.CLASS_NAME_HIDDEN),this.loadingElem.classList.remove(s.CLASS_NAME_HIDDEN)}revealContent(){this.loadingElem.classList.add(s.CLASS_NAME_HIDDEN),this.getContentElem().classList.remove(s.CLASS_NAME_HIDDEN)}show(){this.getBodyElem().classList.add(s.CN_MODAL_OPEN),this.overlayElem.classList.add(s.CLASS_NAME_OVERLAY_OPEN),this.boxElem.classList.add(s.CLASS_NAME_BOX_OPEN)}open(){this.revealSpinner(),this.show()}openLocation(e,t=!0){if(!t)throw new Error("The feature is not yet supported");this.open();const i=this.mkElem("iframe",{src:e});this.getContentElem().replaceChildren(i),i.addEventListener("load",()=>{this.revealContent()})}close(){this.boxElem.classList.remove(s.CLASS_NAME_BOX_OPEN),this.overlayElem.classList.remove(s.CLASS_NAME_OVERLAY_OPEN),this.overlayElem.classList.add(s.CLASS_NAME_OVERLAY_CLOSING),this.overlayElem.addEventListener("animationend",()=>{this.overlayElem.classList.remove(s.CLASS_NAME_OVERLAY_CLOSING),this.getBodyElem().classList.remove(s.CN_MODAL_OPEN),this.getContentElem().replaceChildren()},{once:!0})}handleDismissed(e){if(!(e.target===this.overlayElem)){const t=new n.A(e).getAnyActionTarget(2);if(null==t||!t.classList.contains(s.CLASS_NAME_DISMISS))return}e.preventDefault(),this.close()}
2setUp(){this.overlayElem=this.mkElem("div",{class:`${s.CLASS_NAME_DISMISS} ${s.CLASS_NAME_OVERLAY}`});const e=this.mkElem("button",{class:s.CLASS_NAME_DISMISS,"aria-label":"Close Popup",title:"Close Popup"},r.A.close());this.loadingElem=this.mkElem("div",{class:"loading-spinner"}),this.setContentElem(this.mkElem("div",{class:"modal-box__content"})),this.boxElem=this.mkElem("div",{class:s.CLASS_NAME_BOX}),this.boxElem.append(e,this.loadingElem,this.getContentElem());const t=this.getBodyElem();t.append(this.overlayElem,this.boxElem),t.addEventListener("click",this.handleDismissed.bind(this))}setDocument(e){return this.document=e,this}getDocument(){return this.document}getBodyElem(){return this.getDocument().body}setContentElem(e){return this.contentElem=e,this}getContentElem(){return this.contentElem}}s.CN_MODAL_OPEN="modal-is-open",s.CLASS_NAME_BOX="modal-box",s.CLASS_NAME_BOX_OPEN="modal-box--open",s.CLASS_NAME_OVERLAY="modal-overlay",s.CLASS_NAME_OVERLAY_OPEN="modal-overlay--open",s.CLASS_NAME_OVERLAY_CLOSING="modal-overlay--closing",s.CLASS_NAME_DISMISS="dismiss-modal",s.CLASS_NAME_HIDDEN="hidden",o.modal=new s(document);var a=o.modal},8140:function(e,t,i){"use strict";i.d(t,{E:function(){return n}});i(8992),i(3949);function n(e){const t=e instanceof Document?e:e.ownerDocument;e.querySelectorAll("table").forEach(e=>{if(null!==e.closest(".table-container"))return;const i=t.createElement("div");i.classList.add("table-container"),e.parentElement.replaceChild(i,e),i.appendChild(e)})}n(document)},7421:function(e,t,i){"use strict";i.d(t,{A:function(){return z}});var n=i.cw(function(e,t){"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var n=function(t){t&&Object.keys(t).forEach(function(i){return e[i]=t[i]})},r=0,o=t;r<o.length;r++){n(o[r])}return e})}),r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],o={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var i=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},s={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},a=s,l=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},c=function(e){return!0===e?1:0};function u(e,t){var i;return function(){var n=this,r=arguments;clearTimeout(i),i=setTimeout(function(){return e.apply(n,r)},t)}}var h=function(e){return e instanceof Array?e:[e]};function d(e,t,i){if(!0===i)return e.classList.add(t);e.classList.remove(t)}function f(e,t,i){var n=window.document.createElement(e);return t=t||"",i=i||"",n.className=t,void 0!==i&&(n.textContent=i),n}function p(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function m(e,t){return t(e)?e:e.parentNode?m(e.parentNode,t):void 0}function _(e,t){var i=f("div","numInputWrapper"),n=f("input","numInput "+e),r=f("span","arrowUp"),o=f("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?n.type="number":(n.type="text",n.pattern="\\d*"),void 0!==t)for(var s in t)n.setAttribute(s,t[s]);return i.appendChild(n),i.appendChild(r),i.appendChild(o),i}function g(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var y=function(){},v=function(e,t,i){return i.months[t?"shorthand":"longhand"][e]},x={D:y,F:function(e,t,i){e.setMonth(i.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,i){e.setHours(e.getHours()%12+12*c(new RegExp(i.amPM[1],"i").test(t)))},M:function(e,t,i){e.setMonth(i.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,i){var n=parseInt(t),r=new Date(e.getFullYear(),0,2+7*(n-1),0,0,0,0);return r.setDate(r.getDate()-r.getDay()+i.firstDayOfWeek),r},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:y,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:y,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},b={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"
2(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},w={Z:function(e){return e.toISOString()},D:function(e,t,i){return t.weekdays.shorthand[w.w(e,t,i)]},F:function(e,t,i){return v(w.n(e,t,i)-1,!1,t)},G:function(e,t,i){return l(w.h(e,t,i))},H:function(e){return l(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[c(e.getHours()>11)]},M:function(e,t){return v(e.getMonth(),!0,t)},S:function(e){return l(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,i){return i.getWeek(e)},Y:function(e){return l(e.getFullYear(),4)},d:function(e){return l(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return l(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return l(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},T=function(e){var t=e.config,i=void 0===t?o:t,n=e.l10n,r=void 0===n?s:n,a=e.isMobile,l=void 0!==a&&a;return function(e,t,n){var o=n||r;return void 0===i.formatDate||l?t.split("").map(function(t,n,r){return w[t]&&"\\"!==r[n-1]?w[t](e,o,i):"\\"!==t?t:""}).join(""):i.formatDate(e,t,o)}},E=function(e){var t=e.config,i=void 0===t?o:t,n=e.l10n,r=void 0===n?s:n;return function(e,t,n,s){if(0===e||e){var a,l=s||r,c=e;if(e instanceof Date)a=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)a=new Date(e);else if("string"==typeof e){var u=t||(i||o).dateFormat,h=String(e).trim();if("today"===h)a=new Date,n=!0;else if(i&&i.parseDate)a=i.parseDate(e,u);else if(/Z$/.test(h)||/GMT$/.test(h))a=new Date(e);else{for(var d=void 0,f=[],p=0,m=0,_="";p<u.length;p++){var g=u[p],y="\\"===g,v="\\"===u[p-1]||y;if(b[g]&&!v){_+=b[g];var w=new RegExp(_).exec(e);w&&(d=!0)&&f["Y"!==g?"push":"unshift"]({fn:x[g],val:w[++m]})}else y||(_+=".")}a=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),f.forEach(function(e){var t=e.fn,i=e.val;return a=t(a,i,l)||a}),a=d?a:void 0}}if(a instanceof Date&&!isNaN(a.getTime()))return!0===n&&a.setHours(0,0,0,0),a;i.errorHandler(new Error("Invalid date provided: "+c))}}};function S(e,t,i){return void 0===i&&(i=!0),!1!==i?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var I=function(e,t,i){return 3600*e+60*t+i},A=864e5;function M(e){var t=e.defaultHour,i=e.defaultMinute,n=e.defaultSeconds;if(void 0!==e.minDate){var r=e.minDate.getHours(),o=e.minDate.getMinutes(),s=e.minDate.getSeconds();t<r&&(t=r),t===r&&i<o&&(i=o),t===r&&i===o&&n<s&&(n=e.minDate.getSeconds())}if(void 0!==e.maxDate){var a=e.maxDate.getHours(),l=e.maxDate.getMinutes();(t=Math.min(t,a))===a&&(i=Math.min(l,i)),t===a&&i===l&&(n=e.maxDate.getSeconds())}return{hours:t,minutes:i,seconds:n}}n();var C=function(){return C=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},C.apply(this,arguments)},D=function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var n=Array(e),r=0;for(t=0;t<i;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)n[r]=o[s];return n};function P(e,t){var i={config:C(C({},o),L.defaultConfig),l10n:a};function n(){var e;return(null===(e=i.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function s(e){return e.bind(i)}function y(){var e=i.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame(function(){if(void 0!==i.calendarContainer&&(i.calendarContainer.style.visibility="hidden",i.calendarContainer.style.display="block"),void 0!==i.daysContainer){var t=(i.days.offsetWidth+1)*e.showMonths;i.daysContainer.style.width=t+"px",i.calendarContainer.style.width=t+(void 0!==i.weekWrapper?i.weekWrapper.offsetWidth:0)+"px",i.calendarContainer.style.removeProperty("visibility"),i.calendarContainer.style.removeProperty("display")}})}function x(e){if(0===i.selectedDates.length){var t=void 0===i.config.minDate||S(new Date,i.config.minDate)>=0?new Date:new Date(i.config.minDate.getTime()),n=M(i.config);t.setHours(n.hours,n.minutes,n.seconds,t.getMilliseconds()),i.selectedDates=[t],i.latestSelectedDateObj=t}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,n=g(e),r=n;void 0!==i.amPM&&n===i.amPM&&(i.amPM.textContent=i.l10n.amPM[c(i.amPM.textContent===i.l10n.amPM[0])]);var o=parseFloat(r.getAttribute("min")),s=parseFloat(r.getAttribute("max")),a=parseFloat(r.getAttribute("step")),u=parseInt(r.value,10),h=e.delta||(t?38===e.which?1:-1:0),d=u+a*h;if(void 0!==r.value&&2===r.value.length){var f=r===i.hourElement,p=r===i.minuteElement;d<o?(d=s+d+c(!f)+(c(f)&&c(!i.amPM)),p&&N(void 0,-1,i.hourElement)):d>s&&(d=r===i.hourElement?d-s-c(!i.amPM):o,p&&N(void 0,1,i.hourElement)),i.amPM&&f&&(1===a?d+u===23:Math.abs(d-u)>a)&&(i.amPM.textContent=i.l10n.amPM[c(i.amPM.textContent===i.l10n.amPM[0])]),r.value=l(d)}}(e);var r=i._input.value;w(),Te(),i._input.value!==r&&i._debouncedChange()}function w(){if(void 0!==i.hourElement&&void 0!==i.minuteElement){var e,t,n=(parseInt(i.hourElement.value.slice(-2),10)||0)%24,r=(parseInt(i.minuteElement.value,10)||0)%60,o=void 0!==i.secondElement?(parseInt(i.secondElement.value,10)||0)%60:0;void 0!==i.amPM&&(e=n,t=i.amPM.textContent,n=e%12+12*c(t===i.l10n.amPM[1]));var s=void 0!==i.config.minTime||i.config.minDate&&i.minDateHasTime&&i.latestSelectedDateObj&&0===S(i.latestSelectedDateObj,i.config.minDate,!0),a=void 0!==i.config.maxTime||i.config.maxDate&&i.maxDateHasTime&&i.latestSelectedDateObj&&0===S(i.latestSelectedDateObj,i.config.maxDate,!0);if(void 0!==i.config.maxTime&&void 0!==i.config.minTime&&i.config.minTime>i.config.maxTime){var l=I(i.config.minTime.getHours(),i.config.minTime.getMinutes(),i.config.minTime.getSeconds()),u=
vendor: 9,572 bytes, line 2
2I(i.config.maxTime.getHours(),i.config.maxTime.getMinutes(),i.config.maxTime.getSeconds()),h=I(n,r,o);if(h>u&&h<l){var d=function(e){var t=Math.floor(e/3600),i=(e-3600*t)/60;return[t,i,e-3600*t-60*i]}(l);n=d[0],r=d[1],o=d[2]}}else{if(a){var f=void 0!==i.config.maxTime?i.config.maxTime:i.config.maxDate;(n=Math.min(n,f.getHours()))===f.getHours()&&(r=Math.min(r,f.getMinutes())),r===f.getMinutes()&&(o=Math.min(o,f.getSeconds()))}if(s){var p=void 0!==i.config.minTime?i.config.minTime:i.config.minDate;(n=Math.max(n,p.getHours()))===p.getHours()&&r<p.getMinutes()&&(r=p.getMinutes()),r===p.getMinutes()&&(o=Math.max(o,p.getSeconds()))}}R(n,r,o)}}function P(e){var t=e||i.latestSelectedDateObj;t&&t instanceof Date&&R(t.getHours(),t.getMinutes(),t.getSeconds())}function R(e,t,n){void 0!==i.latestSelectedDateObj&&i.latestSelectedDateObj.setHours(e%24,t,n||0,0),i.hourElement&&i.minuteElement&&!i.isMobile&&(i.hourElement.value=l(i.config.time_24hr?e:(12+e)%12+12*c(e%12==0)),i.minuteElement.value=l(t),void 0!==i.amPM&&(i.amPM.textContent=i.l10n.amPM[c(e>=12)]),void 0!==i.secondElement&&(i.secondElement.value=l(n)))}function z(e){var t=g(e),i=parseInt(t.value)+(e.delta||0);(i/1e3>1||"Enter"===e.key&&!/[^\d]/.test(i.toString()))&&ee(i)}function F(e,t,n,r){return t instanceof Array?t.forEach(function(t){return F(e,t,n,r)}):e instanceof Array?e.forEach(function(e){return F(e,t,n,r)}):(e.addEventListener(t,n,r),void i._handlers.push({remove:function(){return e.removeEventListener(t,n,r)}}))}function O(){ye("onChange")}function k(e,t){var n=void 0!==e?i.parseDate(e):i.latestSelectedDateObj||(i.config.minDate&&i.config.minDate>i.now?i.config.minDate:i.config.maxDate&&i.config.maxDate<i.now?i.config.maxDate:i.now),r=i.currentYear,o=i.currentMonth;try{void 0!==n&&(i.currentYear=n.getFullYear(),i.currentMonth=n.getMonth())}catch(e){e.message="Invalid date supplied: "+n,i.config.errorHandler(e)}t&&i.currentYear!==r&&(ye("onYearChange"),Z()),!t||i.currentYear===r&&i.currentMonth===o||ye("onMonthChange"),i.redraw()}function B(e){var t=g(e);~t.className.indexOf("arrow")&&N(e,t.classList.contains("arrowUp")?1:-1)}function N(e,t,i){var n=e&&g(e),r=i||n&&n.parentNode&&n.parentNode.firstChild,o=ve("increment");o.delta=t,r&&r.dispatchEvent(o)}function V(e,t,n,r){var o=te(t,!0),s=f("span",e,t.getDate().toString());return s.dateObj=t,s.$i=r,s.setAttribute("aria-label",i.formatDate(t,i.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===S(t,i.now)&&(i.todayDateElem=s,s.classList.add("today"),s.setAttribute("aria-current","date")),o?(s.tabIndex=-1,xe(t)&&(s.classList.add("selected"),i.selectedDateElem=s,"range"===i.config.mode&&(d(s,"startRange",i.selectedDates[0]&&0===S(t,i.selectedDates[0],!0)),d(s,"endRange",i.selectedDates[1]&&0===S(t,i.selectedDates[1],!0)),"nextMonthDay"===e&&s.classList.add("inRange")))):s.classList.add("flatpickr-disabled"),"range"===i.config.mode&&function(e){return!("range"!==i.config.mode||i.selectedDates.length<2)&&(S(e,i.selectedDates[0])>=0&&S(e,i.selectedDates[1])<=0)}(t)&&!xe(t)&&s.classList.add("inRange"),i.weekNumbers&&1===i.config.showMonths&&"prevMonthDay"!==e&&r%7==6&&i.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+i.config.getWeek(t)+"</span>"),ye("onDayCreate",s),s}function U(e){e.focus(),"range"===i.config.mode&&oe(e)}function j(e){for(var t=e>0?0:i.config.showMonths-1,n=e>0?i.config.showMonths:-1,r=t;r!=n;r+=e)for(var o=i.daysContainer.children[r],s=e>0?0:o.children.length-1,a=e>0?o.children.length:-1,l=s;l!=a;l+=e){var c=o.children[l];if(-1===c.className.indexOf("hidden")&&te(c.dateObj))return c}}function G(e,t){var r=n(),o=ie(r||document.body),s=void 0!==e?e:o?r:void 0!==i.selectedDateElem&&ie(i.selectedDateElem)?i.selectedDateElem:void 0!==i.todayDateElem&&ie(i.todayDateElem)?i.todayDateElem:j(t>0?1:-1);void 0===s?i._input.focus():o?function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():i.currentMonth,r=t>0?i.config.showMonths:-1,o=t>0?1:-1,s=n-i.currentMonth;s!=r;s+=o)for(var a=i.daysContainer.children[s],l=n-i.currentMonth===s?e.$i+t:t<0?a.children.length-1:0,c=a.children.length,u=l;u>=0&&u<c&&u!=(t>0?c:-1);u+=o){var h=a.children[u];if(-1===h.className.indexOf("hidden")&&te(h.dateObj)&&Math.abs(e.$i-u)>=Math.abs(t))return U(h)}i.changeMonth(o),G(j(o),0)}(s,t):U(s)}function $(e,t){for(var n=(new Date(e,t,1).getDay()-i.l10n.firstDayOfWeek+7)%7,r=i.utils.getDaysInMonth((t-1+12)%12,e),o=i.utils.getDaysInMonth(t,e),s=window.document.createDocumentFragment(),a=i.config.showMonths>1,l=a?"prevMonthDay hidden":"prevMonthDay",c=a?"nextMonthDay hidden":"nextMonthDay",u=r+1-n,h=0;u<=r;u++,h++)s.appendChild(V("flatpickr-day "+l,new Date(e,t-1,u),0,h));for(u=1;u<=o;u++,h++)s.appendChild(V("flatpickr-day",new Date(e,t,u),0,h));for(var d=o+1;d<=42-n&&(1===i.config.showMonths||h%7!=0);d++,h++)s.appendChild(V("flatpickr-day "+c,new Date(e,t+1,d%o),0,h));var p=f("div","dayContainer");return p.appendChild(s),p}function H(){if(void 0!==i.daysContainer){p(i.daysContainer),i.weekNumbers&&p(i.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<i.config.showMonths;t++){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+t),e.appendChild($(n.getFullYear(),n.getMonth()))}i.daysContainer.appendChild(e),i.days=i.daysContainer.firstChild,"range"===i.config.mode&&1===i.selectedDates.length&&oe()}}function Z(){if(!(i.config.showMonths>1||"dropdown"!==i.config.monthSelectorType)){var e=function(e){return!(void 0!==i.config.minDate&&i.currentYear===i.config.minDate.getFullYear()&&e<i.config.minDate.getMonth())&&!(void 0!==i.config.maxDate&&i.currentYear===i.config.maxDate.getFullYear()&&e>i.config.maxDate.getMonth())};i.monthsDropdownContainer.tabIndex=-1,i.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var n=f("option","flatpickr-monthDropdown-month");n.value=new Date(i.currentYear,t).getMonth().toString(),n.textContent=v(t,i.config.shorthandCurrentMonth,i.l10n),n.tabIndex=-1,i.currentMonth===t&&(n.selected=!0),i.monthsDropdownContainer.appendChild(n)}}}function q(){var e,t=f("div","flatpickr-month"),n=window.document.createDocumentFragment();i.config.showMonths>1||"static"===i.config.monthSelectorType?e=f("span","cur-month"):(i.monthsDropdownContainer=f("select","flatpickr-monthDropdown-months"),i.monthsDropdownContainer.setAttribute("aria-label",i.l10n.monthAriaLabel),F(i.monthsDropdownContainer,"change",function(e){var t=g(e),n=parseInt(t.value,10);i.changeMonth(n-i.currentMonth),ye("onMonthChange")}),Z(),e=i.monthsDropdownContainer);var r=_("cur-year",{tabindex:"-1"}),o=r.getElementsByTagName("input")[0];o.setAttribute("aria-label",i.l10n.yearAriaLabel),i.config.minDate&&o.setAttribute("min",i.config.minDate.getFullYear().toString()),i.config.maxDate&&(o.setAttribute("max",i.config.maxDate.getFullYear().toString()),o.disabled=!!i.config.minDate&&i.config.minDate.getFullYear()===i.config.maxDate.getFullYear());var s=f("div","flatpickr-current-month");return s.appendChild(e),s.appendChild(r),n.appendChild(s),t.appendChild(n),{container:t,yearElement:o,monthElement:e}}function W(){p(i.monthNav),i.monthNav.appendChild(i.prevMonthNav),i.config.showMonths&&(i.yearElements=[],i.monthElements=[]);for(var e=i.config.showMonths;e--;){var t=q();i.yearElements.push(t.yearElement),i.monthElements.push(t.monthElement),i.monthNav.appendChild(t.container)}i.monthNav.appendChild(i.nextMonthNav)}function Y(){i.weekdayContainer?p(i.weekdayContainer):i.weekdayContainer=f("div","flatpickr-weekdays");for(var e=i.config.showMonths;e--;){var t=f("div","flatpickr-weekdaycontainer");i.weekdayContainer.appendChild(t)}return X(),i.weekdayContainer}function X(){if(i.weekdayContainer){var e=i.l10n.firstDayOfWeek,t=D(i.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=D(t.splice(e,t.length),t.splice(0,e)));for(var n=i.config.showMonths;n--;)i.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function J(e,t){void 0===t&&(t=!0);var n=t?e:e-i.currentMonth;n<0&&!0===i._hidePrevMonthArrow||n>0&&!0===i._hideNextMonthArrow||(i.currentMonth+=n,(i.currentMonth<0||i.currentMonth>11)&&(i.currentYear+=i.currentMonth>11?1:-1,i.currentMonth=(i.currentMonth+12)%12,ye("onYearChange"),Z()),H(),ye("onMonthChange"),be())}function K(e){return i.calendarContainer.contains(e)}function Q(e){if(i.isOpen&&!i.config.inline){var t=g(e),n=K(t),r=!(t===i.input||t===i.altInput||i.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(i.input)||~e.path.indexOf(i.altInput)))&&!n&&!K(e.relatedTarget),o=!i.config.ignoredFocusElements.some(function(e){return e.contains(t)});r&&o&&(i.config.allowInput&&i.setDate(i._input.value,!1,i.config.altInput?i.config.altFormat:i.config.dateFormat),void 0!==i.timeContainer&&void 0!==i.minuteElement&&void 0!==i.hourElement&&""!==i.input.value&&void 0!==i.input.value&&x(),i.close(),i.config&&"range"===i.config.mode&&1===i.selectedDates.length&&i.clear(!1))}}function ee(e){if(!(!e||i.config.minDate&&e<i.config.minDate.getFullYear()||i.config.maxDate&&e>i.config.maxDate.getFullYear())){var t=e,n=i.currentYear!==t;i.currentYear=t||i.currentYear,i.config.maxDate&&i.currentYear===i.config.maxDate.getFullYear()?i.currentMonth=Math.min(i.config.maxDate.getMonth(),i.currentMonth):i.config.minDate&&i.currentYear===i.config.minDate.getFullYear()&&(i.currentMonth=Math.max(i.config.minDate.getMonth(),i.currentMonth)),n&&(i.redraw(),ye("onYearChange"),Z())}}function te(e,t){var n;void 0===t&&(t=!0);var r=i.parseDate(e,void 0,t);
vendor: 5,958 bytes, line 2
2if(i.config.minDate&&r&&S(r,i.config.minDate,void 0!==t?t:!i.minDateHasTime)<0||i.config.maxDate&&r&&S(r,i.config.maxDate,void 0!==t?t:!i.maxDateHasTime)>0)return!1;if(!i.config.enable&&0===i.config.disable.length)return!0;if(void 0===r)return!1;for(var o=!!i.config.enable,s=null!==(n=i.config.enable)&&void 0!==n?n:i.config.disable,a=0,l=void 0;a<s.length;a++){if("function"==typeof(l=s[a])&&l(r))return o;if(l instanceof Date&&void 0!==r&&l.getTime()===r.getTime())return o;if("string"==typeof l){var c=i.parseDate(l,void 0,!0);return c&&c.getTime()===r.getTime()?o:!o}if("object"==typeof l&&void 0!==r&&l.from&&l.to&&r.getTime()>=l.from.getTime()&&r.getTime()<=l.to.getTime())return o}return!o}function ie(e){return void 0!==i.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&i.daysContainer.contains(e))}function ne(e){var t=e.target===i._input,n=i._input.value.trimEnd()!==we();!t||!n||e.relatedTarget&&K(e.relatedTarget)||i.setDate(i._input.value,!0,e.target===i.altInput?i.config.altFormat:i.config.dateFormat)}function re(t){var r=g(t),o=i.config.wrap?e.contains(r):r===i._input,s=i.config.allowInput,a=i.isOpen&&(!s||!o),l=i.config.inline&&o&&!s;if(13===t.keyCode&&o){if(s)return i.setDate(i._input.value,!0,r===i.altInput?i.config.altFormat:i.config.dateFormat),i.close(),r.blur();i.open()}else if(K(r)||a||l){var c=!!i.timeContainer&&i.timeContainer.contains(r);switch(t.keyCode){case 13:c?(t.preventDefault(),x(),de()):fe(t);break;case 27:t.preventDefault(),de();break;case 8:case 46:o&&!i.config.allowInput&&(t.preventDefault(),i.clear());break;case 37:case 39:if(c||o)i.hourElement&&i.hourElement.focus();else{t.preventDefault();var u=n();if(void 0!==i.daysContainer&&(!1===s||u&&ie(u))){var h=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),J(h),G(j(1),0)):G(void 0,h)}}break;case 38:case 40:t.preventDefault();var d=40===t.keyCode?1:-1;i.daysContainer&&void 0!==r.$i||r===i.input||r===i.altInput?t.ctrlKey?(t.stopPropagation(),ee(i.currentYear-d),G(j(1),0)):c||G(void 0,7*d):r===i.currentYearElement?ee(i.currentYear-d):i.config.enableTime&&(!c&&i.hourElement&&i.hourElement.focus(),x(t),i._debouncedChange());break;case 9:if(c){var f=[i.hourElement,i.minuteElement,i.secondElement,i.amPM].concat(i.pluginElements).filter(function(e){return e}),p=f.indexOf(r);if(-1!==p){var m=f[p+(t.shiftKey?-1:1)];t.preventDefault(),(m||i._input).focus()}}else!i.config.noCalendar&&i.daysContainer&&i.daysContainer.contains(r)&&t.shiftKey&&(t.preventDefault(),i._input.focus())}}if(void 0!==i.amPM&&r===i.amPM)switch(t.key){case i.l10n.amPM[0].charAt(0):case i.l10n.amPM[0].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[0],w(),Te();break;case i.l10n.amPM[1].charAt(0):case i.l10n.amPM[1].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[1],w(),Te()}(o||K(r))&&ye("onKeyDown",t)}function oe(e,t){if(void 0===t&&(t="flatpickr-day"),1===i.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var n=e?e.dateObj.getTime():i.days.firstElementChild.dateObj.getTime(),r=i.parseDate(i.selectedDates[0],void 0,!0).getTime(),o=Math.min(n,i.selectedDates[0].getTime()),s=Math.max(n,i.selectedDates[0].getTime()),a=!1,l=0,c=0,u=o;u<s;u+=A)te(new Date(u),!0)||(a=a||u>o&&u<s,u<r&&(!l||u>l)?l=u:u>r&&(!c||u<c)&&(c=u));Array.from(i.rContainer.querySelectorAll("*:nth-child(-n+"+i.config.showMonths+") > ."+t)).forEach(function(t){var o,s,u,h=t.dateObj.getTime(),d=l>0&&h<l||c>0&&h>c;if(d)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(e){t.classList.remove(e)});a&&!d||(["startRange","inRange","endRange","notAllowed"].forEach(function(e){t.classList.remove(e)}),void 0!==e&&(e.classList.add(n<=i.selectedDates[0].getTime()?"startRange":"endRange"),r<n&&h===r?t.classList.add("startRange"):r>n&&h===r&&t.classList.add("endRange"),h>=l&&(0===c||h<=c)&&(s=r,u=n,(o=h)>Math.min(s,u)&&o<Math.max(s,u))&&t.classList.add("inRange")))})}}function se(){!i.isOpen||i.config.static||i.config.inline||ue()}function ae(e){return function(t){var n=i.config["_"+e+"Date"]=i.parseDate(t,i.config.dateFormat),r=i.config["_"+("min"===e?"max":"min")+"Date"];void 0!==n&&(i["min"===e?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0),i.selectedDates&&(i.selectedDates=i.selectedDates.filter(function(e){return te(e)}),i.selectedDates.length||"min"!==e||P(n),Te()),i.daysContainer&&(he(),void 0!==n?i.currentYearElement[e]=n.getFullYear().toString():i.currentYearElement.removeAttribute(e),i.currentYearElement.disabled=!!r&&void 0!==n&&r.getFullYear()===n.getFullYear())}}function le(){return i.config.wrap?e.querySelector("[data-input]"):e}function ce(){"object"!=typeof i.config.locale&&void 0===L.l10ns[i.config.locale]&&i.config.errorHandler(new Error("flatpickr: invalid locale "+i.config.locale)),i.l10n=C(C({},L.l10ns.default),"object"==typeof i.config.locale?i.config.locale:"default"!==i.config.locale?L.l10ns[i.config.locale]:void 0),b.D="("+i.l10n.weekdays.shorthand.join("|")+")",b.l="("+i.l10n.weekdays.longhand.join("|")+")",b.M="("+i.l10n.months.shorthand.join("|")+")",b.F="("+i.l10n.months.longhand.join("|")+")",b.K="("+i.l10n.amPM[0]+"|"+i.l10n.amPM[1]+"|"+i.l10n.amPM[0].toLowerCase()+"|"+i.l10n.amPM[1].toLowerCase()+")",void 0===C(C({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===L.defaultConfig.time_24hr&&(i.config.time_24hr=i.l10n.time_24hr),i.formatDate=T(i),i.parseDate=E({config:i.config,l10n:i.l10n})}function ue(e){if("function"!=typeof i.config.position){if(void 0!==i.calendarContainer){ye("onPreCalendarPosition");var t=e||i._positionElement,n=Array.prototype.reduce.call(i.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),r=i.calendarContainer.offsetWidth,o=i.config.position.split(" "),s=o[0],a=o.length>1?o[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,u="above"===s||"below"!==s&&c<n&&l.to
vendor: 4,908 bytes, line 2
2p>n,h=window.pageYOffset+l.top+(u?-n-2:t.offsetHeight+2);if(d(i.calendarContainer,"arrowTop",!u),d(i.calendarContainer,"arrowBottom",u),!i.config.inline){var f=window.pageXOffset+l.left,p=!1,m=!1;"center"===a?(f-=(r-l.width)/2,p=!0):"right"===a&&(f-=r-l.width,m=!0),d(i.calendarContainer,"arrowLeft",!p&&!m),d(i.calendarContainer,"arrowCenter",p),d(i.calendarContainer,"arrowRight",m);var _=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=f+r>window.document.body.offsetWidth,y=_+r>window.document.body.offsetWidth;if(d(i.calendarContainer,"rightMost",g),!i.config.static)if(i.calendarContainer.style.top=h+"px",g)if(y){var v=function(){for(var e=null,t=0;t<document.styleSheets.length;t++){var i=document.styleSheets[t];if(i.cssRules){try{i.cssRules}catch(e){continue}e=i;break}}return null!=e?e:(n=document.createElement("style"),document.head.appendChild(n),n.sheet);var n}();if(void 0===v)return;var x=window.document.body.offsetWidth,b=Math.max(0,x/2-r/2),w=v.cssRules.length,T="{left:"+l.left+"px;right:auto;}";d(i.calendarContainer,"rightMost",!1),d(i.calendarContainer,"centerMost",!0),v.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+T,w),i.calendarContainer.style.left=b+"px",i.calendarContainer.style.right="auto"}else i.calendarContainer.style.left="auto",i.calendarContainer.style.right=_+"px";else i.calendarContainer.style.left=f+"px",i.calendarContainer.style.right="auto"}}}else i.config.position(i,e)}function he(){i.config.noCalendar||i.isMobile||(Z(),be(),H())}function de(){i._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(i.close,0):i.close()}function fe(e){e.preventDefault(),e.stopPropagation();var t=m(g(e),function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,r=i.latestSelectedDateObj=new Date(n.dateObj.getTime()),o=(r.getMonth()<i.currentMonth||r.getMonth()>i.currentMonth+i.config.showMonths-1)&&"range"!==i.config.mode;if(i.selectedDateElem=n,"single"===i.config.mode)i.selectedDates=[r];else if("multiple"===i.config.mode){var s=xe(r);s?i.selectedDates.splice(parseInt(s),1):i.selectedDates.push(r)}else"range"===i.config.mode&&(2===i.selectedDates.length&&i.clear(!1,!1),i.latestSelectedDateObj=r,i.selectedDates.push(r),0!==S(r,i.selectedDates[0],!0)&&i.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(w(),o){var a=i.currentYear!==r.getFullYear();i.currentYear=r.getFullYear(),i.currentMonth=r.getMonth(),a&&(ye("onYearChange"),Z()),ye("onMonthChange")}if(be(),H(),Te(),o||"range"===i.config.mode||1!==i.config.showMonths?void 0!==i.selectedDateElem&&void 0===i.hourElement&&i.selectedDateElem&&i.selectedDateElem.focus():U(n),void 0!==i.hourElement&&void 0!==i.hourElement&&i.hourElement.focus(),i.config.closeOnSelect){var l="single"===i.config.mode&&!i.config.enableTime,c="range"===i.config.mode&&2===i.selectedDates.length&&!i.config.enableTime;(l||c)&&de()}O()}}i.parseDate=E({config:i.config,l10n:i.l10n}),i._handlers=[],i.pluginElements=[],i.loadedPlugins=[],i._bind=F,i._setHoursFromDate=P,i._positionCalendar=ue,i.changeMonth=J,i.changeYear=ee,i.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);i.input.value="",void 0!==i.altInput&&(i.altInput.value="");void 0!==i.mobileInput&&(i.mobileInput.value="");i.selectedDates=[],i.latestSelectedDateObj=void 0,!0===t&&(i.currentYear=i._initialDate.getFullYear(),i.currentMonth=i._initialDate.getMonth());if(!0===i.config.enableTime){var n=M(i.config);R(n.hours,n.minutes,n.seconds)}i.redraw(),e&&ye("onChange")},i.close=function(){i.isOpen=!1,i.isMobile||(void 0!==i.calendarContainer&&i.calendarContainer.classList.remove("open"),void 0!==i._input&&i._input.classList.remove("active"));ye("onClose")},i.onMouseOver=oe,i._createElement=f,i.createDay=V,i.destroy=function(){void 0!==i.config&&ye("onDestroy");for(var e=i._handlers.length;e--;)i._handlers[e].remove();if(i._handlers=[],i.mobileInput)i.mobileInput.parentNode&&i.mobileInput.parentNode.removeChild(i.mobileInput),i.mobileInput=void 0;else if(i.calendarContainer&&i.calendarContainer.parentNode)if(i.config.static&&i.calendarContainer.parentNode){var t=i.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else i.calendarContainer.parentNode.removeChild(i.calendarContainer);i.altInput&&(i.input.type="text",i.altInput.parentNode&&i.altInput.parentNode.removeChild(i.altInput),delete i.altInput);i.input&&(i.input.type=i.input._type,i.input.classList.remove("flatpickr-input"),i.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","
2isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete i[e]}catch(e){}})},i.isEnabled=te,i.jumpToDate=k,i.updateValue=Te,i.open=function(e,t){void 0===t&&(t=i._positionElement);if(!0===i.isMobile){if(e){e.preventDefault();var n=g(e);n&&n.blur()}return void 0!==i.mobileInput&&(i.mobileInput.focus(),i.mobileInput.click()),void ye("onOpen")}if(i._input.disabled||i.config.inline)return;var r=i.isOpen;i.isOpen=!0,r||(i.calendarContainer.classList.add("open"),i._input.classList.add("active"),ye("onOpen"),ue(t));!0===i.config.enableTime&&!0===i.config.noCalendar&&(!1!==i.config.allowInput||void 0!==e&&i.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return i.hourElement.select()},50))},i.redraw=he,i.set=function(e,t){if(null!==e&&"object"==typeof e)for(var n in Object.assign(i.config,e),e)void 0!==pe[n]&&pe[n].forEach(function(e){return e()});else i.config[e]=t,void 0!==pe[e]?pe[e].forEach(function(e){return e()}):r.indexOf(e)>-1&&(i.config[e]=h(t));i.redraw(),Te(!0)},i.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=i.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return i.clear(t);me(e,n),i.latestSelectedDateObj=i.selectedDates[i.selectedDates.length-1],i.redraw(),k(void 0,t),P(),0===i.selectedDates.length&&i.clear(!1);Te(t),t&&ye("onChange")},i.toggle=function(e){if(!0===i.isOpen)return i.close();i.open(e)};var pe={locale:[ce,X],showMonths:[W,y,Y],minDate:[k],maxDate:[k],positionElement:[ge],clickOpens:[function(){!0===i.config.clickOpens?(F(i._input,"focus",i.open),F(i._input,"click",i.open)):(i._input.removeEventListener("focus",i.open),i._input.removeEventListener("click",i.open))}]};function me(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return i.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[i.parseDate(e,t)];else if("string"==typeof e)switch(i.config.mode){case"single":case"time":n=[i.parseDate(e,t)];break;case"multiple":n=e.split(i.config.conjunction).map(function(e){return i.parseDate(e,t)});break;case"range":n=e.split(i.l10n.rangeSeparator).map(function(e){return i.parseDate(e,t)})}else i.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));i.selectedDates=i.config.allowInvalidPreload?n:n.filter(function(e){return e instanceof Date&&te(e,!1)}),"range"===i.config.mode&&i.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function _e(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?i.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:i.parseDate(e.from,void 0),to:i.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function ge(){i._positionElement=i.config.positionElement||i._input}function ye(e,t){if(void 0!==i.config){var n=i.config[e];if(void 0!==n&&n.length>0)for(var r=0;n[r]&&r<n.length;r++)n[r](i.selectedDates,i.input.value,i,t);"onChange"===e&&(i.input.dispatchEvent(ve("change")),i.input.dispatchEvent(ve("input")))}}function ve(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function xe(e){for(var t=0;t<i.selectedDates.length;t++){var n=i.selectedDates[t];if(n instanceof Date&&0===S(n,e))return""+t}return!1}function be(){i.config.noCalendar||i.isMobile||!i.monthNav||(i.yearElements.forEach(function(e,t){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+t),i.config.showMonths>1||"static"===i.config.monthSelectorType?i.monthElements[t].textContent=v(n.getMonth(),i.config.shorthandCurrentMonth,i.l10n)+" ":i.monthsDropdownContainer.value=n.getMonth().toString(),e.value=n.getFullYear().toString()}),i._hidePrevMonthArrow=void 0!==i.config.minDate&&(i.currentYear===i.config.minDate.getFullYear()?i.currentMonth<=i.config.minDate.getMonth():i.currentYear<i.config.minDate.getFullYear()),i._hideNextMonthArrow=void 0!==i.config.maxDate&&(i.currentYear===i.config.maxDate.getFullYear()?i.currentMonth+1>i.config.maxDate.getMonth():i.currentYear>i.config.maxDate.getFullYear()))}function we(e){var t=e||(i.config.altInput?i.config.altFormat:i.config.dateFormat);return i.selectedDates.map(function(e){return i.formatDate(e,t)}).filter(function(e,t,n){return"range"!==i.config.mode||i.config.enableTime||n.indexOf(e)===t}).join("range"!==i.config.mode?i.config.conjunction:i.l10n.rangeSeparator)}function Te(e){void 0===e&&(e=!0),void 0!==i.mobileInput&&i.mobileFormatStr&&(i.mobileInput.value=void 0!==i.latestSelectedDateObj?i.formatDate(i.latestSelectedDateObj,i.mobileFormatStr):""),i.input.value=we(i.config.dateFormat),void 0!==i.altInput&&(i.altInput.value=we(i.config.altFormat)),!1!==e&&ye("onValueUpdate")}function Ee(e){var t=g(e),n=i.prevMonthNav.contains(t),r=i.nextMonthNav.contains(t);n||r?J(n?-1:1):i.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?i.changeYear(i.currentYear+1):t.classList.contains("arrowDown")&&i.changeYear(i.currentYear-1)}return function(){i.element=i.input=e,i.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=C(C({},JSON.parse(JSON.stringify(e.dataset||{}))),t),l={};i.config.parseDate=a.parseDate,i.config.formatDate=a.formatDate,Object.defineProperty(i.config,"enable",{get:function(){return i.config._enable},set:function(e){i.config._enable=_e(e)}}),Object.defineProperty(i.config,"disable",{get:function(){return i.config._disable},set:function(e){i.config._disable=_e(e)}});var c="time"===a.mode;if(!a.dateFormat&&(a.enableTime||c)){var u=L.defaultConfig.dateFormat||o.dateFormat;l.dateFormat=a.noCalendar||c?"H:i"+(a.enableSeconds?":S":""):u+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||c)&&!a.altFormat){var d=L.defaultConfig.altFormat||o.altFormat;l.altFormat=a.noCalendar||c?"h:i"+(a.enableSeconds?":S K":" K"):d+" h:i"+(a.enableSeconds?":S":"")+" K"}Object.defineProperty(i.config,"minDate",{get:function(){return i.config._minDate},set:ae("min")}),Object.defineProperty(i.config,"maxDate",{get:function(){return i.config._maxDate},set:ae("max")}
vendor: 12,328 bytes, line 2
2);var f=function(e){return function(t){i.config["min"===e?"_minTime":"_maxTime"]=i.parseDate(t,"H:i:S")}};Object.defineProperty(i.config,"minTime",{get:function(){return i.config._minTime},set:f("min")}),Object.defineProperty(i.config,"maxTime",{get:function(){return i.config._maxTime},set:f("max")}),"time"===a.mode&&(i.config.noCalendar=!0,i.config.enableTime=!0);Object.assign(i.config,l,a);for(var p=0;p<n.length;p++)i.config[n[p]]=!0===i.config[n[p]]||"true"===i.config[n[p]];r.filter(function(e){return void 0!==i.config[e]}).forEach(function(e){i.config[e]=h(i.config[e]||[]).map(s)}),i.isMobile=!i.config.disableMobile&&!i.config.inline&&"single"===i.config.mode&&!i.config.disable.length&&!i.config.enable&&!i.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(p=0;p<i.config.plugins.length;p++){var m=i.config.plugins[p](i)||{};for(var _ in m)r.indexOf(_)>-1?i.config[_]=h(m[_]).map(s).concat(i.config[_]):void 0===a[_]&&(i.config[_]=m[_])}a.altInputClass||(i.config.altInputClass=le().className+" "+i.config.altInputClass);ye("onParseConfig")}(),ce(),function(){if(i.input=le(),!i.input)return void i.config.errorHandler(new Error("Invalid input element specified"));i.input._type=i.input.type,i.input.type="text",i.input.classList.add("flatpickr-input"),i._input=i.input,i.config.altInput&&(i.altInput=f(i.input.nodeName,i.config.altInputClass),i._input=i.altInput,i.altInput.placeholder=i.input.placeholder,i.altInput.disabled=i.input.disabled,i.altInput.required=i.input.required,i.altInput.tabIndex=i.input.tabIndex,i.altInput.type="text",i.input.setAttribute("type","hidden"),!i.config.static&&i.input.parentNode&&i.input.parentNode.insertBefore(i.altInput,i.input.nextSibling));i.config.allowInput||i._input.setAttribute("readonly","readonly");ge()}(),function(){i.selectedDates=[],i.now=i.parseDate(i.config.now)||new Date;var e=i.config.defaultDate||("INPUT"!==i.input.nodeName&&"TEXTAREA"!==i.input.nodeName||!i.input.placeholder||i.input.value!==i.input.placeholder?i.input.value:null);e&&me(e,i.config.dateFormat);i._initialDate=i.selectedDates.length>0?i.selectedDates[0]:i.config.minDate&&i.config.minDate.getTime()>i.now.getTime()?i.config.minDate:i.config.maxDate&&i.config.maxDate.getTime()<i.now.getTime()?i.config.maxDate:i.now,i.currentYear=i._initialDate.getFullYear(),i.currentMonth=i._initialDate.getMonth(),i.selectedDates.length>0&&(i.latestSelectedDateObj=i.selectedDates[0]);void 0!==i.config.minTime&&(i.config.minTime=i.parseDate(i.config.minTime,"H:i"));void 0!==i.config.maxTime&&(i.config.maxTime=i.parseDate(i.config.maxTime,"H:i"));i.minDateHasTime=!!i.config.minDate&&(i.config.minDate.getHours()>0||i.config.minDate.getMinutes()>0||i.config.minDate.getSeconds()>0),i.maxDateHasTime=!!i.config.maxDate&&(i.config.maxDate.getHours()>0||i.config.maxDate.getMinutes()>0||i.config.maxDate.getSeconds()>0)}(),i.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=i.currentMonth),void 0===t&&(t=i.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:i.l10n.daysInMonth[e]}},i.isMobile||function(){var e=window.document.createDocumentFragment();if(i.calendarContainer=f("div","flatpickr-calendar"),i.calendarContainer.tabIndex=-1,!i.config.noCalendar){if(e.appendChild((i.monthNav=f("div","flatpickr-months"),i.yearElements=[],i.monthElements=[],i.prevMonthNav=f("span","flatpickr-prev-month"),i.prevMonthNav.innerHTML=i.config.prevArrow,i.nextMonthNav=f("span","flatpickr-next-month"),i.nextMonthNav.innerHTML=i.config.nextArrow,W(),Object.defineProperty(i,"_hidePrevMonthArrow",{get:function(){return i.__hidePrevMonthArrow},set:function(e){i.__hidePrevMonthArrow!==e&&(d(i.prevMonthNav,"flatpickr-disabled",e),i.__hidePrevMonthArrow=e)}}),Object.defineProperty(i,"_hideNextMonthArrow",{get:function(){return i.__hideNextMonthArrow},set:function(e){i.__hideNextMonthArrow!==e&&(d(i.nextMonthNav,"flatpickr-disabled",e),i.__hideNextMonthArrow=e)}}),i.currentYearElement=i.yearElements[0],be(),i.monthNav)),i.innerContainer=f("div","flatpickr-innerContainer"),i.config.weekNumbers){var t=function(){i.calendarContainer.classList.add("hasWeeks");var e=f("div","flatpickr-weekwrapper");e.appendChild(f("span","flatpickr-weekday",i.l10n.weekAbbreviation));var t=f("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,r=t.weekNumbers;i.innerContainer.appendChild(n),i.weekNumbers=r,i.weekWrapper=n}i.rContainer=f("div","flatpickr-rContainer"),i.rContainer.appendChild(Y()),i.daysContainer||(i.daysContainer=f("div","flatpickr-days"),i.daysContainer.tabIndex=-1),H(),i.rContainer.appendChild(i.daysContainer),i.innerContainer.appendChild(i.rContainer),e.appendChild(i.innerContainer)}i.config.enableTime&&e.appendChild(function(){i.calendarContainer.classList.add("hasTime"),i.config.noCalendar&&i.calendarContainer.classList.add("noCalendar");var e=M(i.config);i.timeContainer=f("div","flatpickr-time"),i.timeContainer.tabIndex=-1;var t=f("span","flatpickr-time-separator",":"),n=_("flatpickr-hour",{"aria-label":i.l10n.hourAriaLabel});i.hourElement=n.getElementsByTagName("input")[0];var r=_("flatpickr-minute",{"aria-label":i.l10n.minuteAriaLabel});i.minuteElement=r.getElementsByTagName("input")[0],i.hourElement.tabIndex=i.minuteElement.tabIndex=-1,i.hourElement.value=l(i.latestSelectedDateObj?i.latestSelectedDateObj.getHours():i.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),i.minuteElement.value=l(i.latestSelectedDateObj?i.latestSelectedDateObj.getMinutes():e.minutes),i.hourElement.setAttribute("step",i.config.hourIncrement.toString()),i.minuteElement.setAttribute("step",i.config.minuteIncrement.toString()),i.hourElement.setAttribute("min",i.config.time_24hr?"0":"1"),i.hourElement.setAttribute("max",i.config.time_24hr?"23":"12"),i.hourElement.setAttribute("maxlength","2"),i.minuteElement.setAttribute("min","0"),i.minuteElement.setAttribute("max","59"),i.minuteElement.setAttribute("maxlength","2"),i.timeContainer.appendChild(n),i.timeContainer.appendChild(t),i.timeContainer.appendChild(r),i.config.time_24hr&&i.timeContainer.classList.add("time24hr");if(i.config.enableSeconds){i.timeContainer.classList.add("hasSeconds");var o=_("flatpickr-second");i.secondElement=o.getElementsByTagName("input")[0],i.secondElement.value=l(i.latestSelectedDateObj?i.latestSelectedDateObj.getSeconds():e.seconds),i.secondElement.setAttribute("step",i.minuteElement.getAttribute("step")),i.secondElement.setAttribute("min","0"),i.secondElement.setAttribute("max","59"),i.secondElement.setAttribute("maxlength","2"),i.timeContainer.appendChild(f("span","flatpickr-time-separator",":")),i.timeContainer.appendChild(o)}i.config.time_24hr||(i.amPM=f("span","flatpickr-am-pm",i.l10n.amPM[c((i.latestSelectedDateObj?i.hourElement.value:i.config.defaultHour)>11)]),i.amPM.title=i.l10n.toggleTitle,i.amPM.tabIndex=-1,i.timeContainer.appendChild(i.amPM));return i.timeContainer}());d(i.calendarContainer,"rangeMode","range"===i.config.mode),d(i.calendarContainer,"animate",!0===i.config.animate),d(i.calendarContainer,"multiMonth",i.config.showMonths>1),i.calendarContainer.appendChild(e);var o=void 0!==i.config.appendTo&&void 0!==i.config.appendTo.nodeType;if((i.config.inline||i.config.static)&&(i.calendarContainer.classList.add(i.config.inline?"inline":"static"),i.config.inline&&(!o&&i.element.parentNode?i.element.parentNode.insertBefore(i.calendarContainer,i._input.nextSibling):void 0!==i.config.appendTo&&i.config.appendTo.appendChild(i.calendarContainer)),i.config.static)){var s=f("div","flatpickr-wrapper");i.element.parentNode&&i.element.parentNode.insertBefore(s,i.element),s.appendChild(i.element),i.altInput&&s.appendChild(i.altInput),s.appendChild(i.calendarContainer)}i.config.static||i.config.inline||(void 0!==i.config.appendTo?i.config.appendTo:window.document.body).appendChild(i.calendarContainer)}(),function(){i.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(i.element.querySelectorAll("[data-"+e+"]"),function(t){return F(t,"click",i[e])})});if(i.isMobile)return void function(){var e=i.config.enableTime?i.config.noCalendar?"time":"datetime-local":"date";i.mobileInput=f("input",i.input.className+" flatpickr-mobile"),i.mobileInput.tabIndex=1,i.mobileInput.type=e,i.mobileInput.disabled=i.input.disabled,i.mobileInput.required=i.input.required,i.mobileInput.placeholder=i.input.placeholder,i.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",i.selectedDates.length>0&&(i.mobileInput.defaultValue=i.mobileInput.value=i.formatDate(i.selectedDates[0],i.mobileFormatStr));i.config.minDate&&(i.mobileInput.min=i.formatDate(i.config.minDate,"Y-m-d"));i.config.maxDate&&(i.mobileInput.max=i.formatDate(i.config.maxDate,"Y-m-d"));i.input.getAttribute("step")&&(i.mobileInput.step=String(i.input.getAttribute("step")));i.input.type="hidden",void 0!==i.altInput&&(i.altInput.type="hidden");try{i.input.parentNode&&i.input.parentNode.insertBefore(i.mobileInput,i.input.nextSibling)}catch(e){}F(i.mobileInput,"change",function(e){i.setDate(g(e).value,!1,i.mobileFormatStr),ye("onChange"),ye("onClose")})}();var e=u(se,50);i._debouncedChange=u(O,300),i.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&F(i.daysContainer,"mouseover",function(e){"range"===i.config.mode&&oe(g(e))});F(i._input,"keydown",re),void 0!==i.calendarContainer&&F(i.calendarContainer,"keydown",re);i.config.inline||i.config.static||F(window,"resize",e);void 0!==window.ontouchstart?F(window.document,"touchstart",Q):F(window.document,"mousedown",Q);F(window.document,"focus",Q,{capture:!0}),!0===i.config.clickOpens&&(F(i._input,"focus",i.open),F(i._input,"click",i.open));void 0!==i.daysContainer&&(F(i.monthNav,"click",Ee),F(i.monthNav,["keyup","increment"],z),F(i.daysContainer,"click",fe));if(void 0!==i.timeContainer&&void 0!==i.minuteElement&&void 0!==i.hourElement){var t=function(e){return g(e).select()};F(i.timeContainer,["increment"],x),F(i.timeContainer,"blur",x,{capture:!0}),F(i.timeContainer,"click",B),F([i.hourElement,i.minuteElement],["focus","click"],t),void 0!==i.secondElement&&F(i.secondElement,"focus",function(){return i.secondElement&&i.secondElement.select()}),void 0!==i.amPM&&F(i.amPM,"click",function(e){x(e)})}i.config.allowInput&&F(i._input,"blur",ne)}(),(i.selectedDates.length||i.config.noCalendar)&&(i.config.enableTime&&P(i.config.noCalendar?i.latestSelectedDateObj:void 0),Te(!1)),y();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!i.isMobile&&n&&ue(),ye("onReady")}(),i}function R(e,t){for(var i=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),n=[],r=0;r<i.length;r++){var o=i[r];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=P(o,t||{}),n.push(o._flatpickr)}catch(e){console.error(e)}}return 1===n.length?n[0]:n}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return R(this,e)},HTMLElement.prototype.flatpickr=function(e){return R([this],e)});var L=function(e,t){return"string"==typeof e?R(window.document.querySelectorAll(e),t):e instanceof Node?R([e],t):R(e,t)};L.defaultConfig={},L.l10ns={en:C({},a),default:C({},a)},L.localize=function(e){L.l10ns.default=C(C({},L.l10ns.default),e)},L.setDefaults=function(e){L.defaultConfig=C(C({},L.defaultConfig),e)},L.parseDate=E({}),L.formatDate=T({}),L.compareDates=S,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return R(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=L);var z=L},842:function(e){e.exports=function(){"use strict";let e,t,i;function n(n,r){if(e)if(t){const n={};e(void 0,n),i=r(n);const o="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 = {}; self.__mapboxImport = (u) => import(u);
2 ("+e+")(undefined, sharedChunk); ("+t+")(undefined, sharedChunk); self.onerror = null;";"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(i.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=r;else e=r}return"undefined"!=typeof self&&(self.__mapboxImport=e=>import(e)),n(["require","exports"],function(e,t){var i="3.31.0",n=1e-6,r="undefined"!=typeof Float32Array?Float32Array:Array;function o(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=i*o-r*n;return s?(e[0]=o*(s=1/s),e[1]=-n*s,e[2]=-r*s,e[3]=i*s,e):null}function s(){var e=new r(9);return r!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function a(e,t,i){var n=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=i[0],f=i[1],p=i[2],m=i[3],_=i[4],g=i[5],y=i[6],v=i[7],x=i[8];return e[0]=d*n+f*s+p*c,e[1]=d*r+f*a+p*u,e[2]=d*o+f*l+p*h,e[3]=m*n+_*s+g*c,e[4]=m*r+_*a+g*u,e[5]=m*o+_*l+g*h,e[6]=y*n+v*s+x*c,e[7]=y*r+v*a+x*u,e[8]=y*o+v*l+x*h,e}function l(e,t){var i=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function c(){var e=new r(16);return r!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function u(e){var t=new r(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function h(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function d(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function f(e,t){if(e===t){var i=t[1],n=t[2],r=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=r,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function p(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],_=t[14],g=t[15],y=i*a-n*s,v=i*l-r*s,x=i*c-o*s,b=n*l-r*a,w=n*c-o*a,T=r*c-o*l,E=u*m-h*p,S=u*_-d*p,I=u*g-f*p,A=h*_-d*m,M=h*g-f*m,C=d*g-f*_,D=y*C-v*M+x*A+b*I-w*S+T*E;return D?(e[0]=(a*C-l*M+c*A)*(D=1/D),e[1]=(r*M-n*C-o*A)*D,e[2]=(m*T-_*w+g*b)*D,e[3]=(d*w-h*T-f*b)*D,e[4]=(l*I-s*C-c*S)*D,e[5]=(i*C-r*I+o*S)*D,e[6]=(_*x-p*T-g*v)*D,e[7]=(u*T-d*x+f*v)*D,e[8]=(s*M-a*I+c*E)*D,e[9]=(n*I-i*M-o*E)*D,e[10]=(p*w-m*x+g*y)*D,e[11]=(h*x-u*w-f*y)*D,e[12]=(a*S-s*A-l*E)*D,e[13]=(i*A-n*S+r*E)*D,e[14]=(m*v-p*b-_*y)*D,e[15]=(u*b-h*v+d*y)*D,e):null}function m(e,t,i){var n=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],_=t[13],g=t[14],y=t[15],v=i[0],x=i[1],b=i[2],w=i[3];return e[0]=v*n+x*a+b*h+w*m,e[1]=v*r+x*l+b*d+w*_,e[2]=v*o+x*c+b*f+w*g,e[3]=v*s+x*u+b*p+w*y,e[4]=(v=i[4])*n+(x=i[5])*a+(b=i[6])*h+(w=i[7])*m,e[5]=v*r+x*l+b*d+w*_,e[6]=v*o+x*c+b*f+w*g,e[7]=v*s+x*u+b*p+w*y,e[8]=(v=i[8])*n+(x=i[9])*a+(b=i[10])*h+(w=i[11])*m,e[9]=v*r+x*l+b*d+w*_,e[10]=v*o+x*c+b*f+w*g,e[11]=v*s+x*u+b*p+w*y,e[12]=(v=i[12])*n+(x=i[13])*a+(b=i[14])*h+(w=i[15])*m,e[13]=v*r+x*l+b*d+w*_,e[14]=v*o+x*c+b*f+w*g,e[15]=v*s+x*u+b*p+w*y,e}function _(e,t,i){var n,r,o,s,a,l,c,u,h,d,f,p,m=i[0],_=i[1],g=i[2];return t===e?(e[12]=t[0]*m+t[4]*_+t[8]*g+t[12],e[13]=t[1]*m+t[5]*_+t[9]*g+t[13],e[14]=t[2]*m+t[6]*_+t[10]*g+t[14],e[15]=t[3]*m+t[7]*_+t[11]*g+t[15]):(r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=n=t[0],e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=n*m+a*_+h*g+t[12],e[13]=r*m+l*_+d*g+t[13],e[14]=o*m+c*_+f*g+t[14],e[15]=s*m+u*_+p*g+t[15]),e}function g(e,t,i){var n=i[0],r=i[1],o=i[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function y(e,t,i){var n=Math.sin(i),r=Math.cos(i),o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*r+c*n,e[5]=s*r+u*n,e[6]=a*r+h*n,e[7]=l*r+d*n,e[8]=c*r-o*n,e[9]=u*r-s*n,e[10
vendor: 22,451 bytes, line 2
2]=h*r-a*n,e[11]=d*r-l*n,e}function v(e,t,i){var n=Math.sin(i),r=Math.cos(i),o=t[0],s=t[1],a=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*r-c*n,e[1]=s*r-u*n,e[2]=a*r-h*n,e[3]=l*r-d*n,e[8]=o*n+c*r,e[9]=s*n+u*r,e[10]=a*n+h*r,e[11]=l*n+d*r,e}function x(e,t,i){var n=Math.sin(i),r=Math.cos(i),o=t[0],s=t[1],a=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*r+c*n,e[1]=s*r+u*n,e[2]=a*r+h*n,e[3]=l*r+d*n,e[4]=c*r-o*n,e[5]=u*r-s*n,e[6]=h*r-a*n,e[7]=d*r-l*n,e}function b(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function w(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function T(e,t,i){var r,o,s,a=i[0],l=i[1],c=i[2],u=Math.sqrt(a*a+l*l+c*c);return u<n?null:(a*=u=1/u,l*=u,c*=u,r=Math.sin(t),o=Math.cos(t),e[0]=a*a*(s=1-o)+o,e[1]=l*a*s+c*r,e[2]=c*a*s-l*r,e[3]=0,e[4]=a*l*s-c*r,e[5]=l*l*s+o,e[6]=c*l*s+a*r,e[7]=0,e[8]=a*c*s+l*r,e[9]=l*c*s-a*r,e[10]=c*c*s+o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function E(e,t){var i=t[0],n=t[1],r=t[2],o=t[4],s=t[5],a=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.sqrt(i*i+n*n+r*r),e[1]=Math.sqrt(o*o+s*s+a*a),e[2]=Math.sqrt(l*l+c*c+u*u),e}function S(e,t){var i=new r(3);E(i,t);var n=1/i[0],o=1/i[1],s=1/i[2],a=t[0]*n,l=t[1]*o,c=t[2]*s,u=t[4]*n,h=t[5]*o,d=t[6]*s,f=t[8]*n,p=t[9]*o,m=t[10]*s,_=a+h+m,g=0;return _>0?(g=2*Math.sqrt(_+1),e[3]=.25*g,e[0]=(d-p)/g,e[1]=(f-c)/g,e[2]=(l-u)/g):a>h&&a>m?(g=2*Math.sqrt(1+a-h-m),e[3]=(d-p)/g,e[0]=.25*g,e[1]=(l+u)/g,e[2]=(f+c)/g):h>m?(g=2*Math.sqrt(1+h-a-m),e[3]=(f-c)/g,e[0]=(l+u)/g,e[1]=.25*g,e[2]=(d+p)/g):(g=2*Math.sqrt(1+m-a-h),e[3]=(l-u)/g,e[0]=(f+c)/g,e[1]=(d+p)/g,e[2]=.25*g),e}function I(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=i+i,a=n+n,l=r+r,c=i*s,u=n*s,h=n*a,d=r*s,f=r*a,p=r*l,m=o*s,_=o*a,g=o*l;return e[0]=1-h-p,e[1]=u+g,e[2]=d-_,e[3]=0,e[4]=u-g,e[5]=1-c-p,e[6]=f+m,e[7]=0,e[8]=d+_,e[9]=f-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}var A=function(e,t,i,n,r){var o=1/Math.tan(t/2);if(e[0]=o/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=r&&r!==1/0){var s=1/(n-r);e[10]=(r+n)*s,e[14]=2*r*n*s}else e[10]=-1,e[14]=-2*n;return e},M=function(e,t,i,n,r,o,s){var a=1/(t-i),l=1/(n-r),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+i)*a,e[13]=(r+n)*l,e[14]=(s+o)*c,e[15]=1,e},C=m;function D(){var e=new r(3);return r!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function P(e){var t=new r(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function R(e){var t=e[0],i=e[1],n=e[2];return Math.sqrt(t*t+i*i+n*n)}function L(e,t,i){var n=new r(3);return n[0]=e,n[1]=t,n[2]=i,n}function z(e,t,i,n){return e[0]=t,e[1]=i,e[2]=n,e}function F(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function O(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function k(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e}function B(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e}function N(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e}function V(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function U(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e[2]=t[2]+i[2]*n,e}function j(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(i*i+n*n+r*r)}function G(e,t){var i=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2];return i*i+n*n+r*r}function $(e){var t=e[0],i=e[1],n=e[2];return t*t+i*i+n*n}function H(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function Z(e,t){var i=t[0],n=t[1],r=t[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function q(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function W(e,t,i){var n=t[0],r=t[1],o=t[2],s=i[0],a=i[1],l=i[2];return e[0]=r*l-o*a,e[1]=o*s-n*l,e[2]=n*a-r*s,e}function Y(e,t,i,n){var r=t[0],o=t[1],s=t[2];return e[0]=r+n*(i[0]-r),e[1]=o+n*(i[1]-o),e[2]=s+n*(i[2]-s),e}function X(e,t,i){var n=t[0],r=t[1],o=t[2],s=i[3]*n+i[7]*r+i[11]*o+i[15];return e[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/(s=s||1),e[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/s,e[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/s,e}function J(e,t,i){var n=t[0],r=t[1],o=t[2];return e[0]=n*i[0]+r*i[3]+o*i[6],e[1]=n*i[1]+r*i[4]+o*i[7],e[2]=n*i[2]+r*i[5]+o*i[8],e}function K(e,t,i){var n=i[0],r=i[1],o=i[2],s=i[3],a=t[0],l=t[1],c=t[2],u=r*c-o*l,h=o*a-n*c,d=n*l-r*a;return e[0]=a+s*(u+=u)+r*(d+=d)-o*(h+=h),e[1]=l+s*h+o*u-n*d,e[2]=c+s*d+n*h-r*u,e}function Q(e){return e[0]=0,e[1]=0,e[2]=0,e}function ee(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}var te=O,ie=k,ne=R;function re(){var e=new r(4);return r!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function oe(e,t,i,n){var o=new r(4);return o[0]=e,o[1]=t,o[2]=i,o[3]=n,o}function se(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e}function ae(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=i*i+n*n+r*r+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=i*s,e[1]=n*s,e[2]=r*s,e[3]=o*s,e}function le(e,t,i){var n=t[0],r=t[1],o=t[2],s=t[3];return e[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*s,e[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*s,e[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*s,e[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*s,e}function ce(){var e=new r(4);return r!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ue(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function he(e,t){var i=2*Math.acos(t[3]),r=Math.sin(i/2);return r>n?(e[0]=t[0]/r,e[1]=t[1]/r,e[2]=t[2]/r):(e[0]=1,e[1]=0,e[2]=0),i}function de(e,t,i){i*=.5;var n=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l+s*a,e[1]=r*l+o*a,e[2]=o*l-r*a,e[3]=s*l-n*a,e}function fe(e,t,i){i*=.5;var n=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l-o*a,e[1]=r*l+s*a,e[2]=o*l+n*a,e[3]=s*l-r*a,e}function pe(e,t,i){i*=.5;var n=t[0],r=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=n*l+r*a,e[1]=r*l-n*a,e[2]=o*l+s*a,e[3]=s*l-o*a,e}D(),re();var me,_e,ge,ye=ae,ve=(me=D(),_e=L(1,0,0),ge=L(0,1,0),function(e,t,i){var n=q(t,i);return n<-.999999?(W(me,_e,t),ne(me)<1e-6&&W(me,ge,t),Z(me,me),function(e,t,i){i*=.5;var n=Math.sin(i);e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i)}(e,me,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(W(me,t,i),e[0]=me[0],e[1]=me[1],e[2]=me[2],e[3]=1+n,ye(e,e))});function xe(){var e=new r(2);return r!=Float32Array&&(e[0]=0,e[1]=0),e}function be(e,t){var i=new r(2);return i[0]=e,i[1]=t,i}function we(e,t,i){return e[0]=t,e[1]=i,e}function Te(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function Ee(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function Se(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function Ie(e){var t=e[0],i=e[1];return Math.sqrt(t*t+i*i)}function Ae(e,t){var i=t[0],n=t[1],r=i*i+n*n;return r>0&&(r=1/Math.sqrt(r)),e[0]=t[0]*r,e[1]=t[1]*r,e}function Me(e,t){return e[0]*t[0]+e[1]*t[1]}ce(),ce(),s();var Ce=Ee;function De(e,t,i,n){const r=3*e,o=3*(i-e)-r,s=1-r-o,a=3*t,l=3*(n-t)-a,c=1-a-l;return function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let i=e;for(let n=0;n<8;n++){const n=((s*i+o)*i+r)*i-e;if(Math.abs(n)<t)return((c*i+l)*i+a)*i;const u=(3*s*i+2*o)*i+r;if(Math.abs(u)<1e-6)break;i-=n/u}let n=0,u=1;i=e;for(let a=0;a<20;a++){const a=((s*i+o)*i+r)*i;if(Math.abs(a-e)<t)break;e>a?n=i:u=i,i=.5*(n+u)}return((c*i+l)*i+a)*i}}function Pe(e,t){this.x=e,this.y=t}function Re(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!Re(e[i],t[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;const i=e,n=t;if(Object.keys(i).length!==Object.keys(n).length)return!1;for(const e in i)if(!Re(i[e],n[e]))return!1;return!0}return e===t}function Le(e,t,i=0,n=e.length-1,r=Fe){for(;n>i;){if(n-i>600){const o=n-i+1,s=t-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);Le(e,t,Math.max(i,Math.floor(t-s*l/o+c)),Math.min(n,Math.floor(t+(o-s)*l/o+c)),r)}const o=e[t];let s=i,a=n;for(ze(e,i,t),r(e[n],o)>0&&ze(e,i,n);s<a;){for(ze(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}0===r(e[i],o)?ze(e,i,a):(a++,ze(e,a,n)),a<=t&&(i=a+1),t<=a&&(n=a-1)}}function ze(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function Fe(e,t){return e<t?-1:e>t?1:0}function Oe(e){let t=0;for(let i,n,r=0,o=e.length,s=o-1;r<o;s=r++)i=e[r],n=e[s],t+=(n.x-i.x)*(i.y+n.y);return t}function ke(e,t){return t.area-e.area}function Be(e){const t=e.length;if(t<3)return!0;const i=e[0];let n=0,r=0,o=1;for(;o<t&&(n=e[o].x-i.x,r=e[o].y-i.y,0===n&&0===r);o++);if(o===t)return!0;for(;o<t;o++)if(n*(e[o].y-i.y)-r*(e[o].x-i.x)!==0)return!1;return!0}function Ne(e,t){const i=e.length,n=[];let r,o;for(let t=0;t<i;t++){const i=Oe(e[t]);0===i&&Be(e[t])||(e[t].area=Math.abs(i),void 0===o&&(o=i<0),o===i<0?(r&&n.push(r),r=[e[t]]):r.push(e[t]))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++){const i=n[e];i.length<=t||(Le(i,t,1,i.length-1,ke),n[e]=i.slice(0,t))}return n}function Ve(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Ue(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function je(e,t,i){const n=e[0]-t[0],r=e[1]-t[1],o=e[0]-i[0],s=e[1]-i[1];return n*s-o*r===0&&n*o<=0&&r*s<=0}function Ge(e,t,i){return t[1]>e[1]!=i[1]>e[1]&&e[0]<(i[0]-t[0])*(e[1]-t[1])/(i[1]-t[1])+t[0]}function $e(e,t,i=!1){let n=!1;for(let r=0,o=t.length;r<o;r++){const o=t[r];for(let t=0,r=o.length,s=r-1;t<r;s=t++){const r=o[s],a=o[t];if(je(e,r,a))return i;Ge(e,r,a)&&(n=!n)}}return n}function He(e,t,i,n){const r=n[0]-i[0],o=n[1]-i[1],s=(e[0]-i[0])*o-r*(e[1]-i[1]),a=(t[0]-i[0])*o-r*(t[1]-i[1]);return s>0&&a<0||s<0&&a>0}function Ze(e,t,i,n){return 0!==(r=[n[0]-i[0],n[1]-i[1]])[0]*(o=[t[0]-e[0],t[1]-e[1]])[1]-r[1]*o[0]&&!(!He(e,t,i,n)||!He(i,n,e,t));var r,o}function qe(e){const t=new Pe(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),i=new Pe(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const n of e[0])t.x>n.x&&(t.x=n.x),t.y>n.y&&(t.y=n.y),i.x<n.x&&(i.x=n.x),i.y<n.y&&(i.y=n.y);return{min:t,max:i}}xe(),Pe.prototype={clone(){return new Pe(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),i=Math.sin(e),n=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=n,this},_rotateAround(e,t){const i=Math.cos(e),n=Math.sin(e),r=t.y+n*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-n*(this.y-t.y),this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Pe},Pe.convert=function(e){if(e instanceof Pe)return e;if(Array.isArray(e))return new Pe(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new Pe(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};const We=Math.PI/180,Ye=180/Math.PI,Xe=/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Je(e){return e*We}function Ke(e){return e*Ye}const Qe=[[0,0],[1,0],[1,1],[0,1]];function et(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,i=t*e;return 4*(e<.5?i:3*(e-t)+i-.75)}const tt=De(.25,.1,.25,1);function it(e,t,i){return Math.min(i,Math.max(t,e))}function nt(e,t,i){return(i=it((i-e)/(t-e),0,1))*i*(3-2*i)}function rt(e,t,i){const n=i-t,r=((e-t)%n+n)%n+t;return r===t?i:r}function ot(e,t,i){if(!e.length)return i(null,[]);let n=e.length;const r=new Array(e.length);let o=null;e.forEach((e,s)=>{t(e,(e,t)=>{e&&(o=e),r[s]=t,0===--n&&i(o,r)})})}function st(e,t){const i={};for(let n=0;n<t.length;n++){const r=t[n];r in e&&(i[r]=e[r])}return i}let at=1;function lt(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function ct(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log2(e)))}function ut(e){return!!e&&Xe.test(e)}function ht(e,t){e.forEach(e=>{t[e]&&(t[e]=t[e].bind(t))})}function dt(e,t,i){const n={};for(const i in e)n[i]=t.call(this,e[i],i,e);return n}function ft(e,t,i){const n={};for(const i in e)t.call(this,e[i],i,e)&&(n[i]=e[i]);return n}function pt(e){return Array.isArray(e)?e.map(pt):"object"==typeof e&&e?dt(e,pt):e}function mt(e,t){for(let i=0;i<e.length;i++)if(t.includes(e[i]))return!0;return!1}const _t={};function gt(e){_t[e]||("undefined"!=typeof console&&console.warn(e),_t[e]=!0)}function yt(e,t,i){return(i.y-e.y)*(t.x-e.x)>(t.y-e.y)*(i.x-e.x)}function vt([e,t,i]){const n=Je(t+90),r=Je(i);return{x:e*Math.cos(n)*Math.sin(r),y:e*Math.sin(n)*Math.sin(r),z:e*Math.cos(r),azimuthal:t,polar:i}}function xt(e,t,i){const n=Math.sqrt(e*e+t*t+i*i),r=n>0?Math.acos(i/n)*Ye:0;let o=0!==e||0!==t?Math.atan2(-t,-e)*Ye+90:0;return o<0&&(o+=360),[n,o,r]}function bt(e){return("undefined"!=typeof self||void 0!==e)&&"undefined"!=typeof WorkerGlobalScope&&(void 0!==e?e:self)instanceof WorkerGlobalScope}function wt(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(e,i,n,r)=>{const o=n||r;return t[i]=!o||o.toLowerCase(),""}),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}function Tt(e){return e?{cacheControl:e.get("cache-control"),expires:e.get("expires")}:{cacheControl:void 0,expires:void 0}}function Et(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function St(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function It(e,t,i){e[4*t+0]=i[0],e[4*t+1]=i[1],e[4*t+2]=i[2],e[4*t+3]=i[3]}function At(e){return[Math.pow(e[0],1/2.2),Math.pow(e[1],1/2.2),Math.pow(e[2],1/2.2)]}function Mt(e){return e>0?1/(1.001-e):1+e}function Ct(e){return e>0?1-1/(1.001-e):-e}function Dt(e,t,i){return(e-t.min)*(i.max-i.min)/(t.max-t.min)+i.min}function Pt(e){return e*e*e*e*e}function Rt(e){return e>>>=0,e=Math.imul(2747636419^e,2654435769)>>>0,e=Math.imul(e^e>>>16,2654435769)>>>0,(e=Math.imul(e^e>>>16,2654435769)>>>0)/4294967296}let Lt,zt,Ft,Ot,kt,Bt;function Nt(){return Lt??=self.OffscreenCanvas&&!!new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap,Lt}const Vt={requestIdleCallback:e=>{if("undefined"!=typeof requestIdleCallback)return requestIdleCallback(e);setTimeout(()=>e({didTimeout:!1,timeRemaining:()=>50}),0)},now:()=>void 0!==Ot?Ot:performance.now(),setNow(e){Ot=e},restoreNow(){Ot=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:i,height:n}=e;kt||(kt=document.createElement("canvas"));const r=kt.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return(i>kt.width||n>kt.height)&&(kt.width=i,kt.height=n),r.clearRect(-t,-t,i+2*t,n+2*t),r.drawImage(e,0,0,i,n),r.getImageData(-t,-t,i+2*t,n+2*t)},resolveURL:e=>(zt||(zt=document.createElement("a")),zt.href=e,zt.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(Ft??=window.matchMedia("(prefers-reduced-motion: reduce)"),Ft.matches)},hasCanvasFingerprintNoise(){if(void 0!==Bt)return Bt;if(!Nt())return Bt=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let i=0;for(let n=0;n<e.width;++n)t.fillStyle=`rgba(${i++},${i++},${i++}, 255)`,t.fillRect(n,0,1,1);const n=t.getImageData(0,0,e.width,e.height);i=0;for(let e=0;e<n.data.length;++e)if(e%4!=3&&i++!==n.data[e])return Bt=!0,!0;return Bt=!1,!1}};let Ut;const jt={API_URL:"https://api.mapbox.com",API_URL_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i,API_TILEJSON_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i,API_SPRITE_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i,API_FONTS_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i,API_STYLE_REGEX:/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i,API_CDN_URL_REGEX:/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i,get EVENTS_URL(){if(!jt.API_URL)return null;try{const e=new URL(jt.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"/mapbox-gl-js/meshopt_base_v1.2.wasm",MESHOPT_SIMD_URL:"/mapbox-gl-js/meshopt_simd_v1.2.wasm",BUILDING_GEN_URL:"/mapbox-gl-js/building-gen/building_gen_v1.2.6.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1",TILE_PROVIDER_URLS:Object.assign(Object.create(null),{pmtiles:"/mapbox-gl-js/plugins/mapbox-gl-pmtiles-provider/v0.0.2/mapbox-gl-pmtiles-provider.js"})};function Gt(){return new URL(jt.DRACO_URL,jt.API_URL).href}function $t(){if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return new URL(function(){if(void 0===Ut){if("object"!=typeof WebAssembly)return!1;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);Ut=WebAssembly.validate(e)}return Ut}()?jt.MESHOPT_SIMD_URL:jt.MESHOPT_URL,jt.API_URL).href}function Ht(){return new URL(jt.BUILDING_GEN_URL,jt.API_URL).href}function Zt(e,t){const i=e.indexOf("?"),n=i<0?e:e.slice(0,i),r=new URLSearchParams(i<0?"":e.slice(i));for(const[e,i]of Object.entries(t))r.set(e,i);return`${n}?${r}`}function qt(e,t={persistentParams:[]}){const i=e.indexOf("?");if(i<0)return e;const n=new URLSearchParams,r=new URLSearchParams(e.slice(i));for(const e of t.persistentParams){const t=r.get(e);t&&n.set(e,t)}const o=n.toString();return`${e.slice(0,i)}${o.length>0?`?${o}`:""}`}const Wt="mapbox-tiles";let Yt=500,Xt=50;const Jt=["language","worldview","jobid"];let Kt;function Qt(){try{return caches}catch(e){}}function ei(){const e=Qt();e&&null==Kt&&(Kt=e.open(Wt))}let ti=1/0;function ii(e){return jt.API_URL_REGEX.test(e)}function ni(e){return 0===e.indexOf("mapbox:")}function ri(e){return jt.API_CDN_URL_REGEX.test(e)}function oi(e){return jt.API_SPRITE_REGEX.test(e)}function si(e){return jt.API_STYLE_REGEX.test(e)&&!oi(e)}const ai={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};Object.freeze(ai);class li extends Error{constructor(e,t,i){super(),this.url=i,this.statusText=e,this.status=t}get message(){return 401===this.status&&ii(this.url)?`${this.statusText}: you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/guides/#access-tokens-and-token-scopes`:this.statusText}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}function ci(e){return"object"==typeof e&&null!==e&&"status"in e&&404===e.status}const ui=bt()?()=>self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,hi=/^\w+:/,di=/[\r\n]+/;async function fi(e,t){let i;return i="arrayBuffer"===e.type?await t.arrayBuffer():"json"===e.type?await t.json():await t.text(),{data:i,headers:t.headers}}async function pi(e,t){return t&&t.throwIfAborted(),(i=e.url).startsWith("file:")||ui().startsWith("file:")&&!hi.test(i)?async function(e,t){return new Promise((i,n)=>{const r=new XMLHttpRequest,o=()=>{t.removeEventListener("abort",o),r.abort(),n(t.reason)};t&&t.addEventListener("abort",o),r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer");for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{t&&t.removeEventListener("abort",o),n(new Error(r.statusText))},r.onload=()=>{if(t&&t.removeEventListener("abort",o),(r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let t=r.response;if("json"===e.type)try{t=JSON.parse(r.response)}catch(e){return void n(e)}const o=new Headers;r.getAllResponseHeaders().trim().split(di).forEach(e=>{const t=e.split(": "),i=t.shift(),n=t.join(": ");i&&o.set(i,n)}),i({data:t,headers:o})}else n(new li(r.statusText,r.status,e.url))},r.send(e.body)})}(e,t):async function(e,t){const i=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:ui(),referrerPolicy:e.referrerPolicy,signal:t}),n=(r=i.url).indexOf("sku=")>0&&ii(r);var r;if("json"===e.type&&i.headers.set("Accept","application/json"),n){let n=null;try{n=await async function(e){if(ei(),null==Kt)return null;const t=await Kt;
vendor: 1,162 bytes, line 2
2let i=qt(e.url,{persistentParams:Jt});const n=e.headers.get("Range");n&&(i=Zt(i,{range:n}));const r=await t.match(i);if(!r)return null;const o=function(e){if(!e)return!1;const t=new Date(e.headers.get("expires")||0),i=wt(e.headers.get("cache-control")||"");return Number(t)>Date.now()&&!i["no-cache"]}(r);return t.delete(i).catch(e=>gt(e.message)),o&&t.put(i,r.clone()).catch(e=>gt(e.message)),{response:r,fresh:o}}(i)}catch(e){"SecurityError"!==e.message&>(e.toString())}if(n&&n.fresh)return t&&t.throwIfAborted(),fi(e,n.response)}const o=Date.now();let s;try{s=await fetch(i)}catch(t){if("AbortError"===t.name)throw t;throw new Error(`${t.message} ${e.url}`,{cause:t})}if(t&&t.throwIfAborted(),!s.ok)throw new li(s.statusText,s.status,e.url);const a=n?s.clone():null,l=await fi(e,s);return a&&async function(e,t,i){if(ei(),null==Kt)return;const n=wt(t.headers.get("cache-control")||"");if(n["no-store"])return;const r={status:t.status,statusText:t.statusText,headers:new Headers(t.headers)};n["max-age"]&&r.headers.set("Expires",new Date(i+1e3*n["max-age"]).toUTCString());const o=r.headers.get("expires");if(!o)return;if(new Date(o).getTime()-i<42e4)return;
vendor: 7,095 bytes, line 2
2let s=qt(e.url,{persistentParams:Jt});if(206===t.status){const t=e.headers.get("Range");if(!t)return;r.status=200,s=Zt(s,{range:t})}const a=new Response(200!==(l=t.status)&&404!==l&&[101,103,204,205,304].includes(l)?null:t.body,r);var l;if(ei(),null!=Kt)try{const e=await Kt;await e.put(s,a)}catch(e){gt(e.message)}}(i,a,o),l}(e,t);var i}async function mi(e,t){return pi(Object.assign(e,{type:"json"}),t)}async function _i(e,t){return pi(Object.assign(e,{type:"arrayBuffer"}),t)}function gi(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}let yi,vi;yi=[],vi=0;const xi="01",bi={create:"create",load:"load",fullLoad:"fullLoad"},wi={mark(e){performance.mark(e)},measure(e,t,i){performance.measure(e,t,i)}};function Ti(e){const t=e.name.split("?")[0];return ri(t)&&t.includes("mapbox-gl.js")?"javascript":ri(t)&&t.includes("mapbox-gl.css")?"css":function(e){return jt.API_FONTS_REGEX.test(e)}(t)?"fontRange":oi(t)?"sprite":si(t)?"style":function(e){return jt.API_TILEJSON_REGEX.test(e)}(t)?"tilejson":"other"}const Ei=/(\.(png|jpg)\d*)(?=$)/,Si=/^.+\/v4\//,Ii=/\.[\w]+$/,Ai=/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/,Mi=/^access_token=(.*)$/,Ci="NO_ACCESS_TOKEN",Di=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Pi(e){const t=e.match(Di);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Ri(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const Li="mapbox.eventData";function zi(e){if(!e)return null;const t=e.split(".");if(!t||3!==t.length)return null;try{return JSON.parse(decodeURIComponent(atob(t[1]).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch(e){return null}}function Fi(e){return!(!jt.EVENTS_URL||!e&&!jt.ACCESS_TOKEN)}let Oi;const ki=/^[\w.+-]+(\/[\w.+-]+)?$/;let Bi="other";class Ni{constructor(e){this.type=e,this.anonId=null,this.anonIdTimestamp=null,this.eventData={},this.queue=[],this.pendingRequest=!1}getStorageKey(e){const t=zi(jt.ACCESS_TOKEN);let i="";return i=t&&t.u?btoa(encodeURIComponent(t.u).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(Number("0x"+t)))):jt.ACCESS_TOKEN||"",e?`${Li}.${e}:${i}`:`${Li}:${i}`}fetchEventData(){const e=Et("localStorage"),t=this.getStorageKey(),i=this.getStorageKey("uuid"),n=this.getStorageKey("uuidTimestamp");if(e)try{const e=localStorage.getItem(t);e&&(this.eventData=JSON.parse(e));const r=localStorage.getItem(i);r&&(this.anonId=r);const o=localStorage.getItem(n);o&&(this.anonIdTimestamp=Number(o));const s=Date.now()-864e5;(!this.anonIdTimestamp||this.anonIdTimestamp<s)&&this.refreshUUID()}catch(e){gt("Unable to read from LocalStorage")}}refreshUUID(){this.anonId=lt(),this.anonIdTimestamp=Date.now()}saveEventData(){const e=Et("localStorage"),t=this.getStorageKey(),i=this.getStorageKey("uuid"),n=this.getStorageKey("uuidTimestamp"),r=this.anonId,o=this.anonIdTimestamp;if(e&&r)try{localStorage.setItem(i,r),Object.keys(this.eventData).length>=1&&localStorage.setItem(t,JSON.stringify(this.eventData)),o&&localStorage.setItem(n,o.toString())}catch(e){gt("Unable to write to LocalStorage")}}processRequests(){}postEvent(e,t,i,n){if(!jt.EVENTS_URL)return;const r=Pi(jt.EVENTS_URL);r.params.push(`access_token=${n||jt.ACCESS_TOKEN||""}`);const o={event:this.type,created:new Date(e).toISOString()},s=t?Object.assign(o,t):o,a={url:Ri(r),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=!0,async function(e){return pi(Object.assign(e,{method:"POST"}),void 0)}(a).then(()=>{this.pendingRequest=!1,i(null),this.saveEventData(),this.processRequests()}).catch(e=>{this.pendingRequest=!1,i(e),this.saveEventData(),this.processRequests()})}queueRequest(e,t){this.queue.push({...e,customAccessToken:t}),this.processRequests()}}class Vi extends Ni{constructor(e){super("metrics"),e&&(this.data=e)}postMetricsEvent(e){if(!Fi(e))return;this.anonId||this.fetchEventData(),ut(this.anonId)||this.refreshUUID();const t={...this.data,sessionId:this.anonId};this.queueRequest({timestamp:Date.now(),payload:t},e)}processRequests(){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:e,payload:t,customAccessToken:i}=this.queue.shift();this.postEvent(e,t,()=>{},i)}}const Ui=new class extends Ni{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,t){Fi(t)&&Array.isArray(e)&&e.some(e=>ni(e)||ii(e))&&this.queueRequest({timestamp:Date.now()},t)}processRequests(){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.anonIdTimestamp&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=zi(jt.ACCESS_TOKEN),t=e?e.u:jt.ACCESS_TOKEN;let n=t!==this.eventData.tokenU;ut(this.anonId)||(this.refreshUUID(),n=!0);const{timestamp:r,customAccessToken:o}=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(r),i=(r-this.eventData.lastSuccess)/864e5;n=n||i>=1||i<-1||e.getDate()!==t.getDate()}else n=!0;if(!n)return void this.processRequests();const s={version:"2.2",sdkIdentifier:"mapbox-gl-js",sdkVersion:i,skuId:xi,"enabled.telemetry":!1,userId:this.anonId,bundleFormat:"umd",bundleDistribution:Bi};Oi&&(s.sdkInfo=Oi),this.postEvent(r,s,e=>{e||(this.eventData.lastSuccess=r,this.eventData.tokenU=t)},o)}},ji=Ui.postTurnstileEvent.bind(Ui),Gi=new class extends Ni{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(e,t,i,n){this.skuToken=t,this.errorCb=n,jt.EVENTS_URL&&(i||jt.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},i):this.errorCb(new Error(Ci)))}processRequests(){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:t,customAccessToken:n}=this.queue.shift();if(e&&this.success[e])return;this.anonId&&this.anonIdTimestamp||this.fetchEventData(),ut(this.anonId)||this.refreshUUID();const r={version:"2.2",sdkIdentifier:"mapbox-gl-js",sdkVersion:i,skuId:xi,skuToken:this.skuToken,userId:this.anonId,bundleFormat:"umd",bundleDistribution:Bi};Oi&&(r.sdkInfo=Oi),this.postEvent(t,r,t=>{t?this.errorCb(t):e&&(this.success[e]=!0)},n)}remove(){this.errorCb=null}},$i=Gi.postMapLoadEvent.bind(Gi),Hi=new class extends Ni{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(e){let t=this.mapInstanceIdMap.get(e);return t||(t=lt(),this.mapInstanceIdMap.set(e,t)),t}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(e,t){const{map:i,style:n,importedStyles:r}=t;if(!Fi(e))return;const o=this.getMapInstanceId(i),s={mapInstanceId:o,eventId:this.getEventId(o),style:n};r.length&&(s.importedStyles=r),this.queueRequest({timestamp:Date.now(),payload:s},e)}processRequests(){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:e,payload:t,customAccessToken:i}=this.queue.shift();this.postEvent(e,t,()=>{},i)}},Zi=Hi.postStyleLoadEvent.bind(Hi),qi=new Vi({attributes:[{name:"maps/js/layer
2-animations/style-with-appearances"}]}),Wi=qi.postMetricsEvent.bind(qi),Yi=new Vi({attributes:[{name:"maps/js/layer-animations/runtime-appearances"}]}),Xi=Yi.postMetricsEvent.bind(Yi),Ji=new class extends Ni{constructor(){super("gljs.performance")}postPerformanceEvent(e,t){Fi(e)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}processRequests(){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:e,performanceData:t,customAccessToken:n}=this.queue.shift(),r=function(e){const t=performance.getEntriesByType("resource"),n=performance.getEntriesByType("mark"),r=function(e){const t={};if(e)for(const i in e)if("other"!==i)for(const n of e[i]){const e=`${i}ResolveRangeMin`,r=`${i}ResolveRangeMax`,o=`${i}RequestCount`,s=`${i}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,n.startTime),t[r]=Math.max(t[r]||-1/0,n.responseEnd);const a=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==n.transferSize&&0===n.transferSize&&a(s),a(o)}return t}(function(e,t){const i={};if(e)for(const n of e){const e=t(n);void 0===i[e]&&(i[e]=[]),i[e].push(n)}return i}(t,Ti)),o=window.devicePixelRatio,s=navigator.connection||navigator.mozConnection||navigator.webkitConnection,a=s?s.effectiveType:void 0,l={counters:[],metadata:[],attributes:[]},c=(e,t,i)=>{null!=i&&e.push({name:t,value:i.toString()})};for(const e in r)c(l.counters,e,r[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(c(l.counters,"interactionRangeMin",e.interactionRange[0]),c(l.counters,"interactionRangeMax",e.interactionRange[1])),n)for(const e of Object.values(bi)){const t=n.find(t=>t.name===e);t&&c(l.counters,e,t.startTime)}return c(l.counters,"visibilityHidden",e.visibilityHidden),c(l.attributes,"style",function(e){if(e)for(const t of e){const e=t.name.split("?")[0];if(si(e)){const t=e.split("/").slice(-2);if(2===t.length)return`mapbox://styles/${t[0]}/${t[1]}`}}}(t)),c(l.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),c(l.attributes,"fogEnabled",e.fogEnabled?"true":"false"),c(l.attributes,"projection",e.projection),c(l.attributes,"zoom",e.zoom),c(l.metadata,"devicePixelRatio",o),c(l.metadata,"connectionEffectiveType",a),c(l.metadata,"navigatorUserAgent",navigator.userAgent),c(l.metadata,"screenWidth",window.screen.width),c(l.metadata,"screenHeight",window.screen.height),c(l.metadata,"windowWidth",window.innerWidth),c(l.metadata,"windowHeight",window.innerHeight),c(l.metadata,"mapWidth",e.width/o),c(l.metadata,"mapHeight",e.height/o),c(l.metadata,"webglRenderer",e.renderer),c(l.metadata,"webglVendor",e.vendor),c(l.metadata,"sdkVersion",i),c(l.metadata,"sdkIdentifier","mapbox-gl-js"),l}(t);for(const e of r.metadata);for(const e of r.counters);for(const e of r.attributes);this.postEvent(e,r,()=>{},n)}},Ki=Ji.postPerformanceEvent.bind(Ji),Qi=new class extends Ni{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,t,i,n){if(!jt.API_URL||!jt.SESSION_PATH)return;const r=Pi(jt.API_URL+jt.SESSION_PATH);r.params.push(`sku=${t||""}`),r.params.push(`access_token=${n||jt.ACCESS_TOKEN||""}`);const o={url:Ri(r),headers:{"Content-Type":"text/plain"}};this.pendingRequest=!0,async function(e){return pi(Object.assign(e,{method:"GET"}),void 0)}(o).then(()=>{this.pendingRequest=!1,i(null),this.saveEventData(),this.processRequests()}).catch(e=>{this.pendingRequest=!1,i(e),this.saveEventData(),this.processRequests()})}getSessionAPI(e,t,i,n){this.skuToken=t,this.errorCb=n,jt.EVENTS_URL&&jt.SESSION_PATH&&jt.API_URL&&(i||jt.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},i):this.errorCb(new Error(Ci)))}processRequests(){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:t,customAccessToken:i}=this.queue.shift();e&&this.success[e]||this.getSession(t,this.skuToken,t=>{t?this.errorCb(t):e&&(this.success[e]=!0)},i)}remove(){this.errorCb=null}},en=Qi.getSessionAPI.bind(Qi),tn=new Set;function nn(e,t=0){const i=3432918353,n=461845907,r=e.length,o=r-(3&r);let s,a=0|t,l=0;for(;l<o;)s=255&e.charCodeAt(l)|(255&e.charCodeAt(l+1))<<8|(255&e.charCodeAt(l+2))<<16|(255&e.charCodeAt(l+3))<<24,l+=4,s=Math.imul(s,i),s=s<<15|s>>>17,s=Math.imul(s,n),a^=s,a=a<<13|a>>>19,a=Math.imul(a,5)+3864292196|0;s=0;const c=3&r;return c>0&&(c>=3&&(s^=(255&e.charCodeAt(l+2))<<16),c>=2&&(s^=(255&e.charCodeAt(l+1))<<8),s^=255&e.charCodeAt(l),s=Math.imul(s,i),s=s<<15|s>>>17,s=Math.imul(s,n),a^=s),a^=r,a^=a>>>
vendor: 12,678 bytes, line 2
216,a=Math.imul(a,2246822507),a^=a>>>13,a=Math.imul(a,3266489909),a^=a>>>16,a>>>0}class rn{constructor(e,...t){Object.assign(this,t[0]||{}),this.type=e}}class on extends rn{constructor(e,t={}){super("error",{error:e,...t}),this.error=e}}function sn(e,t,i){i[e]&&i[e].includes(t)||(i[e]=i[e]||[],i[e].push(t))}function an(e,t,i){if(i[e]){const n=i[e].indexOf(t);-1!==n&&i[e].splice(n,1)}}class ln{constructor(){this._listeners={},this._oneTimeListeners={}}on(e,t){return sn(e,t,this._listeners),this}off(e,t){return an(e,t,this._listeners),an(e,t,this._oneTimeListeners),this}once(e,t){return t?(sn(e,t,this._oneTimeListeners),this):new Promise(t=>{this.once(e,t)})}fire(e,t){const i="string"==typeof e?new rn(e,t):e,n=i.type;if(this.listens(n)){i.target=this;const e=this._listeners[n]?this._listeners[n].slice():[];for(const t of e)t.call(this,i);const t=this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const e of t)an(n,e,this._oneTimeListeners),e.call(this,i);const r=this._eventedParent;if(r){const e="function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData;Object.assign(i,e),r.fire(i)}}else i instanceof on&&console.error(i.error);return this}listens(e){return!!(this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}class cn{constructor(e){"string"==typeof e?this.name=e:(this.name=e.name,this.iconsetId=e.iconsetId)}static from(e){return new cn(e)}static toString(e){return e.iconsetId?`${e.name}�${e.iconsetId}`:e.name}static parse(e){const[t,i]=e.split("�");return new cn({name:t,iconsetId:i})}static isEqual(e,t){return e.name===t.name&&e.iconsetId===t.iconsetId}toString(){return cn.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}var un,hn={},dn=function(){if(un)return hn;un=1;var e={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 t(e){return(e=Math.round(e))<0?0:e>255?255:e}function i(e){return t("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function n(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function r(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}try{hn.parseCSSColor=function(o){var s,a=o.replace(/ /g,"").toLowerCase();if(a in e)return e[a].slice();if("#"===a[0])return 4===a.length?(s=parseInt(a.substr(1),16))>=0&&s<=4095?[(3840&s)>>4|(3840&s)>>8,240&s|(240&s)>>4,15&s|(15&s)<<4,1]:null:7===a.length&&(s=parseInt(a.substr(1),16))>=0&&s<=16777215?[(16711680&s)>>16,(65280&s)>>8,255&s,1]:null;var l=a.indexOf("("),c=a.indexOf(")");if(-1!==l&&c+1===a.length){var u=a.substr(0,l),h=a.substr(l+1,c-(l+1)).split(","),d=1;switch(u){case"rgba":if(4!==h.length)return null;d=n(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),d];case"hsla":if(4!==h.length)return null;d=n(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,p=n(h[1]),m=n(h[2]),_=m<=.5?m*(p+1):m+p-m*p,g=2*m-_;return[t(255*r(g,_,f+1/3)),t(255*r(g,_,f)),t(255*r(g,_,f-1/3)),d];default:return null}}return null}}catch(e){}return hn}();function fn(e,t,i){return e*(1-i)+t*i}const pn=new Map;class mn{constructor(e,t,i,n=1){this.r=e,this.g=t,this.b=i,this.a=n}static parse(e){if(!e)return;if(e instanceof mn)return e;if("string"!=typeof e)return;const t=pn.get(e);if(t)return t;const i=dn.parseCSSColor(e);if(!i)return;const n=new mn(i[0]/255,i[1]/255,i[2]/255,i[3]);return pn.set(e,n),n}toString(){const{r:e,g:t,b:i,a:n}=this;return`rgba(${Math.round(255*e)},${Math.round(255*t)},${Math.round(255*i)},${n})`}toNonPremultipliedRenderColor(e){const{r:t,g:i,b:n,a:r}=this;return new gn(e,t,i,n,r)}toPremultipliedRenderColor(e){const{r:t,g:i,b:n,a:r}=this;return new yn(e,t*r,i*r,n*r,r)}clone(){return new mn(this.r,this.g,this.b,this.a)}}class _n{constructor(e,t,i,n,r,o=!1){if(this.premultiplied=!1,this.premultiplied=o,e){const o=e.image.height,s=o*o;this.premultiplied?(t=0===r?0:t/r*(o-1),i=0===r?0:i/r*(o-1),n=0===r?0:n/r*(o-1)):(t*=o-1,i*=o-1,n*=o-1),t=Math.max(0,Math.min(o-1,t)),i=Math.max(0,Math.min(o-1,i)),n=Math.max(0,Math.min(o-1,n));const a=Math.floor(t),l=Math.floor(i),c=Math.floor(n),u=Math.ceil(t),h=Math.ceil(i),d=Math.ceil(n),f=t-a,p=i-l,m=n-c,_=e.image.data,g=4*(a+l*s+c*o),y=4*(a+l*s+d*o),v=4*(a+h*s+c*o),x=4*(a+h*s+d*o),b=4*(u+l*s+c*o),w=4*(u+l*s+d*o),T=4*(u+h*s+c*o),E=4*(u+h*s+d*o);this.r=fn(fn(fn(_[g],_[y],m),fn(_[v],_[x],m),p),fn(fn(_[b],_[w],m),fn(_[T],_[E],m),p),f)/255*(this.premultiplied?r:1),this.g=fn(fn(fn(_[g+1],_[y+1],m),fn(_[v+1],_[x+1],m),p),fn(fn(_[b+1],_[w+1],m),fn(_[T+1],_[E+1],m),p),f)/255*(this.premultiplied?r:1),this.b=fn(fn(fn(_[g+2],_[y+2],m),fn(_[v+2],_[x+2],m),p),fn(fn(_[b+2],_[w+2],m),fn(_[T+2],_[E+2],m),p),f)/255*(this.premultiplied?r:1),this.a=r}else this.r=t,this.g=i,this.b=n,this.a=r}toArray(){const{r:e,g:t,b:i,a:n}=this;return[255*e,255*t,255*i,n]}toHslaArray(){let{r:e,g:t,b:i,a:n}=this;if(this.premultiplied){if(0===n)return[0,0,0,0];const r=1/n;e*=r,t*=r,i*=r}const r=Math.min(Math.max(e,0),1),o=Math.min(Math.max(t,0),1),s=Math.min(Math.max(i,0),1),a=Math.min(r,o,s),l=Math.max(r,o,s),c=l-a,u=.5*(a+l);if(0===c)return[0,0,100*u,n];const h=u>.5?c/(2-l-a):c/(l+a);let d;switch(l){case r:d=60*((o-s)/c+(o<s?6:0));break;case o:d=60*((s-r)/c+2);break;default:d=60*((r-o)/c+4)}return[d,100*h,100*u,n]}toArray01(){const{r:e,g:t,b:i,a:n}=this;return[e,t,i,n]}toArray01Scaled(e){const{r:t,g:i,b:n}=this;return[t*e,i*e,n*e]}toArray01Linear(){const{r:e,g:t,b:i,a:n}=this;return[Math.pow(e,2.2),Math.pow(t,2.2),Math.pow(i,2.2),n]}}class gn extends _n{constructor(e,t,i,n,r){super(e,t,i,n,r,!1)}}class yn extends _n{constructor(e,t,i,n,r){super(e,t,i,n,r,!0)}}function vn(e,t,i){return e.map((e,n)=>fn(e,t[n],i))}mn.black=new mn(0,0,0,1),mn.white=new mn(1,1,1,1),mn.transparent=new mn(0,0,0,0),mn.red=new mn(1,0,0,1),mn.blue=new mn(0,0,1,1);var xn=Object.freeze({__proto__:null,array:vn,color:function(e,t,i){return new mn(fn(e.r,t.r,i),fn(e.g,t.g,i),fn(e.b,t.b,i),fn(e.a,t.a,i))},number:fn});class bn extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class wn{constructor(e,t=[]){this.parent=e,this.bindings=Object.create(null);for(const[e,i]of t)this.bindings[e]=i}concat(e){return new wn(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Tn={kind:"null"},En={kind:"number"},Sn={kind:"string"},In={kind:"boolean"},An={kind:"color"},Mn={kind:"object"},Cn={kind:"value"},Dn={kind:"collator"},Pn={kind:"formatted"},Rn={kind:"resolvedImage"};function Ln(e,t){return{kind:"array",itemType:e,N:t}}function zn(e){if("array"===e.kind){const t=zn(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Fn=[Tn,En,Sn,In,An,Pn,Mn,Ln(Cn),Rn];function On(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!On(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Fn)if(!On(e,t))return null}return`Expected ${zn(e)} but found ${zn(t)} instead.`}function kn(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function Bn(e,t){return"array"===e.kind&&"array"===t.kind?e.N===t.N&&Bn(e.itemType,t.itemType):e.kind===t.kind}class Nn{constructor(e,t,i){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Vn{constructor(e,t,i,n,r){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=i,this.fontStack=n,this.textColor=r}}class Un{constructor(e){this.sections=e}static fromString(e){return new Un([new Vn(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||!!e.image&&e.image.hasPrimary())}static factory(e){return e instanceof Un?e:Un.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){const i=t.image.getPrimary().id.toString();e.push(["image",i]);continue}e.push(t.text);const i={};t.fontStack&&(i["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(i["font-scale"]=t.scale),t.textColor&&(i["text-color"]=["rgba"].concat(t.textColor.toNonPremultipliedRenderColor(null).toArray())),e.push(i)}return e}}class jn{constructor(e,t={}){this.id=cn.from(e),this.params=t.params,this.sx=t.sx||1,this.sy=t.sy||
vendor: 17,779 bytes, line 2
21}toString(){return JSON.stringify(this)}static parse(e){let t,i,n,r;try{({id:t,params:i,sx:n,sy:r}=JSON.parse(e)||{})}catch(e){return null}return t?new jn(t,{params:i,sx:n,sy:r}):null}scaleSelf(e,t=e){return this.sx*=e,this.sy*=t,this}}class Gn{constructor(e,t,i,n,r=!1){this.primaryId=cn.from(e),this.primaryOptions=t,i&&(this.secondaryId=cn.from(i)),this.secondaryOptions=n,this.available=r}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return!!this.primaryId}getPrimary(){return new jn(this.primaryId,this.primaryOptions)}hasSecondary(){return!!this.secondaryId}getSecondary(){return this.secondaryId?new jn(this.secondaryId,this.secondaryOptions):null}static from(e){return"string"!=typeof e?e:Gn.build({name:e})}static build(e,t,i,n){return!e||"object"==typeof e&&!("name"in e)?null:new Gn(e,i,t,n)}}function $n(e,t,i,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,i,n]:[e,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Hn(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof mn)return!0;if(e instanceof Nn)return!0;if(e instanceof Un)return!0;if(e instanceof Gn)return!0;if(Array.isArray(e)){for(const t of e)if(!Hn(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!Hn(e[t]))return!1;return!0}return!1}function Zn(e){if(null===e)return Tn;if("string"==typeof e)return Sn;if("boolean"==typeof e)return In;if("number"==typeof e)return En;if(e instanceof mn)return An;if(e instanceof Nn)return Dn;if(e instanceof Un)return Pn;if(e instanceof Gn)return Rn;if(Array.isArray(e)){const t=e.length;let i;for(const t of e){const e=Zn(t);if(i){if(i===e)continue;i=Cn;break}i=e}return Ln(i||Cn,t)}return Mn}function qn(e){return null===e?"":"string"==typeof e||"number"==typeof e||"boolean"==typeof e?String(e):e instanceof Un||e instanceof Gn||e instanceof mn?e.toString():JSON.stringify(e)}class Wn{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Hn(e[1]))return t.error("invalid value");const i=e[1];let n=Zn(i);const r=t.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new Wn(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof mn?["rgba"].concat(this.value.toNonPremultipliedRenderColor(null).toArray()):this.value instanceof Un?this.value.serialize():this.value}}class Yn{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Xn={string:Sn,number:En,boolean:In,object:Mn};class Jn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i,n=1;const r=e[0];if("array"===r){let r,o;if(e.length>2){const i=e[1];if("string"!=typeof i||!(i in Xn)||"object"===i)return t.error('The item type argument of "array" must be one of string, number, boolean',1);r=Xn[i],n++}else r=Cn;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}i=Ln(r,o)}else i=Xn[r];const o=[];for(;n<e.length;n++){const i=t.parse(e[n],n,Cn);if(!i)return null;o.push(i)}return new Jn(i,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const i=this.args[t].evaluate(e);if(!On(this.type,Zn(i)))return i;if(t===this.args.length-1)throw new Yn(`The expression ${JSON.stringify(this.args[t].serialize())} evaluated to ${zn(Zn(i))} but was expected to be of type ${zn(this.type)}.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const i=e.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){t.push(i.kind);const n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map(e=>e.serialize()))}}class Kn{constructor(e){this.type=Pn,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[1];if(!Array.isArray(i)&&"object"==typeof i)return t.error("First argument must be an image or text section.");const n=[];let r=!1;for(let i=1;i<=e.length-1;++i){const o=e[i];if(r&&"object"==typeof o&&!Array.isArray(o)){r=!1;let e=null;if(o["font-scale"]&&(e=t.parseObjectValue(o["font-scale"],i,"font-scale",En),!e))return null;let s=null;if(o["text-font"]&&(s=t.parseObjectValue(o["text-font"],i,"text-font",Ln(Sn)),!s))return null;let a=null;if(o["text-color"]&&(a=t.parseObjectValue(o["text-color"],i,"text-color",An),!a))return null;const l=n.at(-1);l.scale=e,l.font=s,l.textColor=a}else{const o=t.parse(e[i],i,Cn);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new Kn(n)}evaluate(e){return new Un(this.sections.map(t=>{const i=t.content.evaluate(e);return Bn(Zn(i),Rn)?new Vn("",i,null,null,null):new Vn(qn(i),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const i={};t.scale&&(i["font-scale"]=t.scale.serialize()),t.font&&(i["text-font"]=t.font.serialize()),t.textColor&&(i["text-color"]=t.textColor.serialize()),e.push(i)}return e}}class Qn{constructor(e,t,i,n){this._imageWarnHistory={},this.type=Rn,this.namePrimary=e,this.nameSecondary=t,i&&(this.paramsPrimary=i.params,this.iconsetIdPrimary=i.iconset?i.iconset.id:void 0),n&&(this.paramsSecondary=n.params,this.iconsetIdSecondary=n.iconset?n.iconset.id:void 0)}static parse(e,t){if(e.length<2)return t.error("Expected two or more arguments.");let i=1;const n=[];function r(){if(i<e.length){const r=t.parse(e[i],i++,Sn);return r?(n.push({image:r,options:{}}),!0):(t.error(n.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return!0}function o(){if(i<e.length){const o=e[i];if(null===(r=o)||"object"!=typeof r||Array.isArray(r))return!0;const s=o.params,a=o.iconset,l=t.concat(i);if(!s&&!a)return i++,!0;if(s){if("object"!=typeof s||s.constructor!==Object)return l.error('Image options "params" should be an object'),!1;const e={},t=l.concat(void 0,"params");for(const i in s){if(!i)return t.error("Image parameter name should be non-empty"),!1;const n=t.concat(void 0,i).parse(s[i],void 0,An,void 0,{typeAnnotation:"coerce"});if(!n)return!1;e[i]=n}n.at(-1).options.params=e}if(a){if("object"!=typeof a||a.constructor!==Object)return l.error('Image options "iconset" should be an object'),!1;if(!a.id)return l.error('Image options "iconset" should have an "id" property'),!1;n.at(-1).options.iconset=a}return i++,!0}var r;return!0}for(let e=0;e<2;e++)if(!r()||!o())return;return new Qn(n[0].image,n[1]?n[1].image:void 0,n[0].options,n[1]?n[1].options:void 0)}evaluateParams(e,t){const i={};if(t){for(const n in t)if(t[n])try{i[n]=t[n].evaluate(e)}catch(e){continue}if(0!==Object.keys(i).length)return{params:i}}}evaluate(e){const t={name:this.namePrimary.evaluate(e),iconsetId:this.iconsetIdPrimary},i=this.nameSecondary?{name:this.nameSecondary.evaluate(e),iconsetId:this.iconsetIdSecondary}:void 0,n=Gn.build(t,i,this.paramsPrimary?this.evaluateParams(e,this.paramsPrimary):void 0,this.paramsSecondary?this.evaluateParams(e,this.paramsSecondary):void 0);if(n&&e.availableImages){const t=n.getPrimary().id;if(n.available=e.availableImages.some(e=>cn.isEqual(e,t)),n.available){const t=n.getSecondary()?n.getSecondary().id:null;t&&(n.available=e.availableImages.some(e=>cn.isEqual(e,t)))}}return n}eachChild(e){if(e(this.namePrimary),this.paramsPrimary)for(const t in this.paramsPrimary)this.paramsPrimary[t]&&e(this.paramsPrimary[t]);if(this.nameSecondary&&(e(this.nameSecondary),this.paramsSecondary))for(const t in this.paramsSecondary)this.paramsSecondary[t]&&e(this.paramsSecondary[t])}outputDefined(){return!1}serializeOptions(e,t){const i={};if(t&&(i.iconset={id:t}),e){i.params={};for(const t in e)e[t]&&(i.params[t]=e[t].serialize())}return Object.keys(i).length>0?i:void 0}serialize(){const e=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){const t=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);t&&e.push(t)}if(this.nameSecondary&&(e.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){const t=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);t&&e.push(t)}return e}}function er(e){return ir(e)?"string":nr(e)?"number":rr(e)?"boolean":Array.isArray(e)?"array":null===e?"null":tr(e)?"object":typeof e}function tr(e){return null!=e&&!Array.isArray(e)&&"function"!=typeof e&&!(e instanceof String||e instanceof Number||e instanceof Boolean)&&"object"==typeof e}function ir(e){return"string"==typeof e||e instanceof String}function nr(e){return"number"==typeof e||e instanceof Number}function rr(e){return"boolean"==typeof e||e instanceof Boolean}const or={"to-boolean":In,"to-color":An,"to-number":En,"to-string":Sn};class sr{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[0],n=[];let r=Tn;if("to-array"===i){if(!Array.isArray(e[1]))return null;const i=e[1].length;if(t.expectedType){if("array"!==t.expectedType.kind)return t.error(`Expected ${t.expectedType.kind} but found array.`);r=Ln(t.expectedType.itemType,i)}else{if(!(i>0&&Hn(e[1][0])))return null;r=Ln(Zn(e[1][0]),i)}for(let o=0;o<i;o++){const i=e[1][o];let s;if(Array.isArray(i))s=t.parse(i,void 0,r.itemType);else{const e=er(i);if(e!==r.itemType.kind)return t.error(`Expected ${r.itemType.kind} but found ${e}.`);s=t.registry.literal.parse(["literal",void 0===i?null:i],t)}if(!s)return null;n.push(s)}}else{if(("to-boolean"===i||"to-string"===i)&&2!==e.length)return t.error("Expected one argument.");r=or[i];for(let i=1;i<e.length;i++){const r=t.parse(e[i],i,Cn);if(!r)return null;n.push(r)}}return new sr(r,n)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,i;for(const n of this.args){if(t=n.evaluate(e),i=null,t instanceof mn)return t;if("string"==typeof t){const i=e.parseColor(t);if(i)return i}else if(Array.isArray(t)&&(i=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:$n(t[0],t[1],t[2],t[3]),!i))return new mn(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Yn(i||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const i of this.args){if(t=i.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new Yn(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?Un.fromString(qn(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Gn.build(qn(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map(t=>t.evaluate(e)):qn(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if("formatted"===this.type.kind)return new Kn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Qn(this.args[0]).serialize();const e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild(t=>{e.push(t.serialize())}),e}}const ar=["Unknown","Point","LineString","Polygon"];class lr{constructor(e,t,i){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=t,this.iconImageUseTheme=i}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ar[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||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*t-e[0])+this.featureDistanceData.bearing[1]*(n*t-e[1])}return 0}parseColor(e){return mn.parse(e)}getConfig(e){return this.options?this.options.get(e):null}}class cr{constructor(e,t,i,n,r){this.name=e,this.type=t,this._evaluate=i,this.args=n,this._overloadIndex=r}evaluate(e){if(!this._evaluate){const e=cr.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,t){const i=e[0],n=cr.definitions[i];if(!n)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=[];let a=null,l=-1;for(const[n,c]of o){if(Array.isArray(n)&&n.length!==e.length-1)continue;s.push(n),l++,null===a?a=t._forkForSignature():a.errors.length=0;const o=[];let u=!1;for(let t=1;t<e.length;t++){const i=e[t],r=Array.isArray(n)?n[t-1]:n.type,s=a.parse(i,1+o.length,r);if(!s){u=!0;break}o.push(s)}if(!u)if(Array.isArray(n)&&n.length!==o.length)a.error(`Expected ${n.length} arguments, but found ${o.length} instead.`);else{for(let e=0;e<o.length;e++){const t=Array.isArray(n)?n[e]:n.type;a.checkSubtype(t,o[e].type,e+1)}if(0===a.errors.length)return new cr(i,r,c,o,l)}}if(1===s.length)t.errors.push(...a.errors);else{const i=(s.length?s:o.map(([e])=>e)).map(ur).join(" | "),n=[];for(let i=1;i<e.length;i++){const r=t.parse(e[i],1+n.length);if(!r)return null;n.push(zn(r.type))}t.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){cr.definitions=t;for(const i in t)e[i]=cr}}function ur(e){return Array.isArray(e)?`(${e.map(zn).join(", ")})`:`(${zn(e.type)}...)`}class hr{constructor(e,t,i){this.type=Dn,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument."),null;const i=e[1];if("object"!=typeof i||Array.isArray(i))return t.error("Collator options argument must be an object."),null;const n=void 0===i["case-sensitive"]?t.parse(!1,1,In):t.parseObjectValue(i["case-sensitive"],1,"case-sensitive",In);if(!n)return null;const r=void 0===i["diacritic-sensitive"]?t.parse(!1,1,In):t.parseObjectValue(i["diacritic-sensitive"],1,"diacritic-sensitive",In);if(!r)return null;let o=null;return i.locale&&(o=t.parseObjectValue(i.locale,1,"locale",Sn),!o)?null:new hr(n,r,o)}evaluate(e){return new Nn(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}function dr(e){return(180+e)/360}function fr(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function pr(e){return 360*e-180}function mr(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}const _r=8192;function gr(e,t){const i=dr(e[0]),n=fr(e[1]),r=Math.pow(2,t.z);return[Math.round(i*r*_r),Math.round(n*r*_r)]}function yr(e,t){for(let i=0;i<t.length;i++)if($e(e,t[i]))return!0;return!1}function vr(e,t,i){for(const n of i)for(let i=0,r=n.length,o=r-1;i<r;o=i++)if(Ze(e,t,n[o],n[i]))return!0;return!1}function xr(e,t){for(let i=0;i<e.length;++i)if(!$e(e[i],t))return!1;for(let i=0;i<e.length-1;++i)if(vr(e[i],e[i+1],t))return!1;return!0}function br(e,t){for(let i=0;i<t.length;i++)if(xr(e,t[i]))return!0;return!1}function wr(e,t,i){const n=[];for(let r=0;r<e.length;r++){const o=[];for(let n=0;n<e[r].length;n++){const s=gr(e[r][n],i);Ve(t,s),o.push(s)}n.push(o)}return n}function Tr(e,t,i){const n=[];for(let r=0;r<e.length;r++){const o=wr(e[r],t,i);n.push(o)}return n}function Er(e,t,i,n){if(e[0]<i[0]||e[0]>i[2]){const t=.5*n;let r=e[0]-i[0]>t?-n:i[0]-e[0]>t?n:0;0===r&&(r=e[0]-i[2]>t?-n:i[2]-e[0]>t?n:0),e[0]+=r}Ve(t,e)}function Sr(e,t,i,n){const r=Math.pow(2,n.z)*_r,o=[n.x*_r,n.y*_r],s=[];if(!e)return s;for(const n of e)for(const e of n){const n=[e.x+o[0],e.y+o[1]];Er(n,t,i,r),s.push(n)}return s}function Ir(e,t,i,n){const r=Math.pow(2,n.z)*_r,o=[n.x*_r,n.y*_r],s=[];if(!e)return s;for(const i of e){const e=[];for(const n of i){const i=[n.x+o[0],n.y+o[1]];Ve(t,i),e.push(i)}s.push(e)}if(t[2]-t[0]<=r/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;
vendor: 5,866 bytes, line 2
2for(const e of s)for(const n of e)Er(n,t,i,r)}var a;return s}class Ar{constructor(e,t){this.type=In,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Hn(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const i=t.features[e].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Ar(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new Ar(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new Ar(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=e.canonicalID();if(!r)return!1;if("Polygon"===t.type){const o=wr(t.coordinates,n,r),s=Sr(e.geometry(),i,n,r);if(!Ue(i,n))return!1;for(const e of s)if(!$e(e,o))return!1}if("MultiPolygon"===t.type){const o=Tr(t.coordinates,n,r),s=Sr(e.geometry(),i,n,r);if(!Ue(i,n))return!1;for(const e of s)if(!yr(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=e.canonicalID();if(!r)return!1;if("Polygon"===t.type){const o=wr(t.coordinates,n,r),s=Ir(e.geometry(),i,n,r);if(!Ue(i,n))return!1;for(const e of s)if(!xr(e,o))return!1}if("MultiPolygon"===t.type){const o=Tr(t.coordinates,n,r),s=Ir(e.geometry(),i,n,r);if(!Ue(i,n))return!1;for(const e of s)if(!br(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}class Mr{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:i}=this,n=t[e];for(;e>0;){const r=e-1>>1,o=t[r];if(i(n,o)>=0)break;t[e]=o,e=r}t[e]=n}_down(e){const{data:t,compare:i}=this,n=this.length>>1,r=t[e];for(;e<n;){let n=1+(e<<1);const o=n+1;if(o<this.length&&i(t[o],t[n])<0&&(n=o),i(t[n],r)>=0)break;t[e]=t[n],e=n}t[e]=r}}var Cr=8192;function Dr(e,t,i){return[e,t,i].filter(Boolean).join("�")}function Pr(e,t){switch(e){case"string":return qn(t);case"number":return+t;case"boolean":return!!t;case"color":return mn.parse(t);case"formatted":return Un.fromString(qn(t));case"resolvedImage":return Gn.build(qn(t))}return t}function Rr(e,t,i,n){return void 0!==n&&(e=n*Math.round(e/n)),void 0!==t&&e<t&&(e=t),void 0!==i&&e>i&&(e=i),e}class Lr{constructor(e,t,i,n=!1){this.type=e,this.key=t,this.scope=i,this.featureConstant=n}static parse(e,t){let i=t.expectedType;if(i??=Cn,e.length<2||e.length>3)return t.error("Invalid number of arguments for 'config' expression.");const n=t.parse(e[1],1);if(!(n instanceof Wn))return t.error("Key name of 'config' expression must be a string literal.");let r,o=!0;const s=qn(n.value);if(e.length>=3){const i=t.parse(e[2],2);if(!(i instanceof Wn))return t.error("Scope of 'config' expression must be a string literal.");r=qn(i.value)}if(t.options){const e=Dr(s,r,t._scope),i=t.options.get(e);i&&(o=zr(i.value||i.default))}return new Lr(i,s,r,o)}evaluate(e){const t=Dr(this.key,this.scope,e.scope),i=e.getConfig(t);if(!i)return null;const{type:n,value:r,values:o,minValue:s,maxValue:a,stepValue:l}=i,c=i.default.evaluate(e);let u=c;if(r){const t=e.scope;e.scope=(t||"").split("�").slice(1).join("�"),u=r.evaluate(e),e.scope=t}return n&&(u=Pr(n,u)),void 0===u||void 0===s&&void 0===a&&void 0===l||("number"==typeof u?u=Rr(u,s,a,l):Array.isArray(u)&&(u=u.map(e=>"number"==typeof e?Rr(e,s,a,l):e))),void 0!==r&&void 0!==u&&o&&!o.includes(u)&&(u=c,n&&(u=Pr(n,u))),(n&&n!==this.type||void 0!==u&&!Bn(Zn(u),this.type))&&(u=Pr(this.type.kind,u)),u}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.scope),e}}function zr(e){if(e instanceof cr){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(e.name.startsWith("filter-"))return!1}if(e instanceof Ar)return!1;if(e instanceof bo)return!1;if(e instanceof Lr)return e.featureConstant;let t=!0;return e.eachChild(e=>{t&&!zr(e)&&(t=!1)}),t}function Fr(e){if(e instanceof cr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!Fr(e)&&(t=!1)}),t}function Or(e,t){if(e instanceof cr&&t.has(e.name))return!1;let i=!0;return e.eachChild(e=>{i&&!Or(e,t)&&(i=!1)}),i}function kr(e,t){return Or(e,new Set(t))}const Br=1/298.257223563,Nr=Br*(2-Br),Vr=Math.PI/180;function Ur(e){const t=6378.137*Vr*1e3,i=Math.cos(e*Vr),n=1/(1-Nr*(1-i*i)),r=Math.sqrt(n);return[t*r*i,t*r*n*(1-Nr)]}function jr(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}function Gr(e,t,i,n){const r=jr(e[0]-t[0])*i,o=(e[1]-t[1])*n;return Math.sqrt(r*r+o*o)}function $r(e,t,i,n,r){let o=t[0],s=t[1],a=jr(i[0]-o)*n,l=(i[1]-s)*r;if(0!==a||0!==l){const t=(jr(e[0]-o)*n*a+(e[1]-s)*r*l)/(a*a+l*l);t>1?(o=i[0],s=i[1]):t>0&&(o+=a/n*t,s+=l/r*t)}return a=jr(e[0]-o)*n,l=(e[1]-s)*r,Math.sqrt(a*a+l*l)}function Hr(e,t){return t.dist-e.dist}function Zr(e){const t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function qr(e){return e[1]-e[0]+1}function Wr(e,t){const i=e[1]>=e[0]&&e[1]<t;return i||console.warn("Distance Expression: Index is out of range"),i}function Yr(e,t){if(e[0]>
vendor: 10,879 bytes, line 2
2e[1])return[null,null];const i=qr(e);if(t){if(2===i)return[e,null];const t=Math.floor(i/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}{if(1===i)return[e,null];const t=Math.floor(i/2)-1;return[[e[0],e[0]+t],[e[0]+t+1,e[1]]]}}function Xr(e,t){const i=[1/0,1/0,-1/0,-1/0];if(!Wr(t,e.length))return i;for(let n=t[0];n<=t[1];++n)Ve(i,e[n]);return i}function Jr(e){const t=[1/0,1/0,-1/0,-1/0];for(let i=0;i<e.length;++i)for(let n=0;n<e[i].length;++n)Ve(t,e[i][n]);return t}function Kr(e,t,i,n){if(Zr(e)||Zr(t))return NaN;let r=0,o=0;return e[2]<t[0]&&(r=t[0]-e[2]),e[0]>t[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(o=e[1]-t[3]),e[3]<t[1]&&(o=t[1]-e[3]),Gr([0,0],[r,o],i,n)}function Qr(e,t,i=8192){const n=Math.pow(2,t.z),r=(e.y/i+t.y)/n;return[pr((e.x/i+t.x)/n),mr(r)]}function eo(e,t){const i=[];for(let n=0;n<e.length;++n)i.push(Qr(e[n],t));return i}function to(e,t,i,n){const r=function(e,t,i,n){let r=1/0,o=e[0][0],s=e[0][1];for(let a=0;a<e.length-1;a++){let l=e[a][0],c=e[a][1],u=jr(e[a+1][0]-l)*i,h=(e[a+1][1]-c)*n,d=0;0===u&&0===h||(d=(jr(t[0]-l)*i*u+(t[1]-c)*n*h)/(u*u+h*h),d>1?(l=e[a+1][0],c=e[a+1][1]):d>0&&(l+=u/i*d,c+=h/n*d)),u=jr(t[0]-l)*i,h=(t[1]-c)*n;const f=u*u+h*h;f<r&&(r=f,o=l,s=c)}return[o,s]}(t,e,i,n);return Gr(e,r,i,n)}function io(e,t,i,n,r,o){const s=i.slice(n[0],n[1]+1);let a=1/0;for(let i=t[0];i<=t[1];++i)if(0===(a=Math.min(a,to(e[i],s,r,o))))return 0;return a}function no(e,t,i,n,r,o){const s=Math.min($r(e,i,n,r,o),$r(t,i,n,r,o)),a=Math.min($r(i,e,t,r,o),$r(n,e,t,r,o));return Math.min(s,a)}function ro(e,t,i,n,r,o){if(!Wr(t,e.length)||!Wr(n,i.length))return NaN;let s=1/0;for(let a=t[0];a<t[1];++a)for(let t=n[0];t<n[1];++t){if(Ze(e[a],e[a+1],i[t],i[t+1]))return 0;s=Math.min(s,no(e[a],e[a+1],i[t],i[t+1],r,o))}return s}function oo(e,t,i,n,r,o){if(!Wr(t,e.length)||!Wr(n,i.length))return NaN;let s=1/0;for(let a=t[0];a<=t[1];++a)for(let t=n[0];t<=n[1];++t)if(0===(s=Math.min(s,Gr(e[a],i[t],r,o))))return s;return s}function so(e,t,i,n){if($e(e,t,!0))return 0;let r=1/0;for(const o of t){const t=o.length;if(t<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(o[0]!==o[t-1]&&0===(r=Math.min(r,$r(e,o[t-1],o[0],i,n))))return r;if(0===(r=Math.min(r,to(e,o,i,n))))return r}return r}function ao(e,t,i,n,r){if(!Wr(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if($e(e[n],i,!0))return 0;let o=1/0;for(let s=t[0];s<t[1];++s)for(const t of i)for(let i=0,a=t.length,l=a-1;i<a;l=i++){if(Ze(e[s],e[s+1],t[l],t[i]))return 0;o=Math.min(o,no(e[s],e[s+1],t[l],t[i],n,r))}return o}function lo(e,t){for(const i of e)for(let e=0;e<=i.length-1;++e)if($e(i[e],t,!0))return!0;return!1}function co(e,t,i,n,r=1/0){const o=Jr(e),s=Jr(t);if(r!==1/0&&Kr(o,s,i,n)>=r)return r;if(Ue(o,s)){if(lo(e,t))return 0}else if(lo(t,e))return 0;let a=r;for(const r of e)for(let e=0,o=r.length,s=o-1;e<o;s=e++)for(const o of t)for(let t=0,l=o.length,c=l-1;t<l;c=t++){if(Ze(r[s],r[e],o[c],o[t]))return 0;a=Math.min(a,no(r[s],r[e],o[c],o[t],i,n))}return a}function uo(e,t,i,n,r,o,s,a){if(null===s||null===a)return;const l=Kr(Xr(r,s),Xr(o,a),i,n);l<t&&e.push({dist:l,range1:s,range2:a})}function ho(e,t,i,n,r,o=1/0){let s=Math.min(Gr(e[0],i[0][0],n,r),o);if(0===s)return s;const a=new Mr([{dist:0,range1:[0,e.length-1],range2:[0,0]}],Hr),l=t?50:100,c=Jr(i);for(;a.length;){const o=a.pop();if(o.dist>=s)continue;const u=o.range1;if(qr(u)<=l){if(!Wr(u,e.length))return NaN;if(t){const t=ao(e,u,i,n,r);if(0===(s=Math.min(s,t)))return s}else for(let t=u[0];t<=u[1];++t){const o=so(e[t],i,n,r);if(0===(s=Math.min(s,o)))return s}}else{const i=Yr(u,t);if(null!==i[0]){const t=Kr(Xr(e,i[0]),c,n,r);t<s&&a.push({dist:t,range1:i[0],range2:[0,0]})}if(null!==i[1]){const t=Kr(Xr(e,i[1]),c,n,r);t<s&&a.push({dist:t,range1:i[1],range2:[0,0]})}}}return s}function fo(e,t,i,n,r,o,s=1/0){let a=Math.min(s,Gr(e[0],i[0],r,o));if(0===a)return a;const l=new Mr([{dist:0,range1:[0,e.length-1],range2:[0,i.length-1]}],Hr),c=t?50:100,u=n?50:100;for(;l.length;){const s=l.pop();if(s.dist>=a)continue;const h=s.range1,d=s.range2;if(qr(h)<=c&&qr(d)<=u){if(!Wr(h,e.length)||!Wr(d,i.length))return NaN;if(t&&n?a=Math.min(a,ro(e,h,i,d,r,o)):t||n?t&&!n?a=Math.min(a,io(i,d,e,h,r,o)):!t&&n&&(a=Math.min(a,io(e,h,i,d,r,o))):a=Math.min(a,oo(e,h,i,d,r,o)),0===a)return a}else{const s=Yr(h,t),c=Yr(d,n);uo(l,a,r,o,e,i,s[0],c[0]),uo(l,a,r,o,e,i,s[0],c[1]),uo(l,a,r,o,e,i,s[1],c[0]),uo(l,a,r,o,e,i,s[1],c[1])}}return a}function po(e,t,i,n,r,o=1/0){let s=o;const a=Xr(e,[0,e.length-1]);for(const o of i)if(!(s!==1/0&&Kr(a,Xr(o,[0,o.length-1]),n,r)>=s)&&(s=Math.min(s,fo(e,t,o,!0,n,r,s)),0===s))return s;return s}function mo(e,t,i,n,r,o=1/0){let s=o;const a=Xr(e,[0,e.length-1]);for(const o of i){if(s!==1/0&&Kr(a,Jr(o),n,r)>=s)continue;const i=ho(e,t,o,n,r,s);if(isNaN(i))return i;if(0===(s=Math.min(s,i)))return s}return s}function _o(e,t,i){const n=[];for(const i of e)for(const e of i)n.push(Qr(e,t));const[r,o]=Ur(n[0][1]);return"Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type?fo(n,!1,"Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,r,o):"MultiLineString"===i.type?po(n,!1,i.coordinates,r,o):"Polygon"===i.type||"MultiPolygon"===i.type?mo(n,!1,"Polygon"===i.type?[i.coordinates]:i.coordinates,r,o):null}function go(e,t,i){const n=[];for(const i of e){const e=[];for(const n of i)e.push(Qr(n,t));n.push(e)}const[r,o]=Ur(n[0][0][1]);if("Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type)return po("Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,n,r,o);if("MultiLineString"===i.type){let e=1/0;for(let t=0;t<i.coordinates.length;t++){const s=po(i.coordinates[t],!0,n,r,o,e);if(isNaN(s))return s;if(0===(e=Math.min(e,s)))return e}return e}if("Polygon"===i.type||"MultiPolygon"===i.type){let e=1/0;for(let t=0;t<n.length;t++){const s=mo(n[t],!0,"Polygon"===i.type?[i.coordinates]:i.coordinates,r,o,e);if(isNaN(s))return s;if(0===(e=Math.min(e,s)))return e}return e}return null}function yo(e,t,i){const n=[];for(const i of Ne(e,0)){const e=[];for(let n=0;n<i.length;++n)e.push(eo(i[n],t));n.push(e)}const[r,o]=Ur(n[0][0][0][1]);if("Point"===i.type||"MultiPoint"===i.type||"LineString"===i.type)return mo("Point"===i.type?[i.coordinates]:i.coordinates,"LineString"===i.type,n,r,o);if("MultiLineString"===i.type){let e=1/0;for(let t=0;t<i.coordinates.length;t++){const s=mo(i.coordinates[t],!0,n,r,o,e);if(isNaN(s))return s;if(0===(e=Math.min(e,s)))return e}return e}return"Polygon"===i.type||"MultiPolygon"===i.type?function(e,t,i,n){let r=1/0;for(const o of e)for(const e of t){const t=co(o,e,i,n,r);if(isNaN(t))return t;if(0===(r=Math.min(r,t)))return r}return r}("Polygon"===i.type?[i.coordinates]:i.coordinates,n,r,o):null}function vo(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}function xo(e){if(!Hn(e)||"object"!=typeof e||null===e||Array.isArray(e))return null;const t=e;if("FeatureCollection"===t.type){if(0===t.features.length)return null;const e=[];for(const i of t.features){if(!vo(i.geometry.type))return null;e.push(i.geometry)}return e}return"Feature"===t.type?vo(t.geometry.type)?[t.geometry]:null:vo(t.type)?[t]:null}class bo{constructor(e){this.type=En,this.geojson=e}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);const i=e[1],n=Hn(i)&&!Array.isArray(i),r=t.parse(n?["literal",i]:i,1,Cn);if(!r)return null;for(const[e,i]of[[["measure-light"],"brightness"],[["pitch"],"pitch"],[["distance-from-center"],"distance-from-center"]])if(!kr(r,e))return t.error(`'distance' expression may not depend on ${i}.`);return Fr(r)?r instanceof Wn&&!xo(r.value)?t.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj]."):new bo(r):t.error("'distance' expression may not depend on feature-state.")}evaluate(e){const t=xo(this.geojson.evaluate(e));if(!t)return console.warn("Distance Expression: could not resolve a valid Point/LineString/Polygon GeoJSON geometry."),null;const i=e.geometry(),n=e.canonicalID();if(null==i||null==n)return console.warn("Distance Expression: requires valid feature and canonical information."),null;const r=e.geometryType(),o="Point"===r?_o:"LineString"===r?go:"Polygon"===r?yo:null;if(!o)return console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries."),null;let s=1/0;for(const e of t){const t=o(i,n,e);if(null==t||isNaN(t))return t;if(0===(s=Math.min(s,t)))break}return s}eachChild(e){e(this.geojson)}outputDefined(){return!0}serialize(){return["distance",this.geojson.serialize()]}}class wo{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const i=e[1];return t.scope.has(i)?new wo(i,t.scope.get(i)):t.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class To{constructor(e,t=[],i,n=new wn,r=[],o,s,a){this.registry=e,this.path=t,this.scope=n,this.errors=r,this.expectedType=i,this._scope=o,this.options=s,this.iconImageUseTheme=a}get key(){let e="";for(let t=0;t<this.path.length;t++){const i=this.path[t];e+="string"==typeof i?`['${i}']`:`[${i}]`}return e}parse(e,t,i,n,r={}){if(t||i){const o=this.expectedType,s=this.scope;n&&(this.scope=this.scope.concat(n)),this.expectedType=i||null;const a="number"==typeof t;a&&this.path.push(t);const l=this._parse(e,r);return a&&this.path.pop(),this.expectedType=o,this.scope=s,l}return this._parse(e,r)}parseObjectValue(e,t,i,n,r,o={}){const s=this.expectedType,a=this.scope;r&&(this.scope=this.scope.concat(r)),this.expectedType=n||null,this.path.push(t),this.path.push(i);const l=this._parse(e,o);return this.path.pop(),this.path.pop(),this.expectedType=s,this.scope=a,l}_parse(e,t){if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i="string"==typeof e[0]&&Object.hasOwn(this.registry,e[0])?this.registry[e[0]]:void 0;if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,i=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==i.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==i.kind&&"string"!==i.kind){if(this.checkSubtype(e,i))return null}else n=So(n,e,t.typeAnnotation||"coerce");else n=So(n,e,t.typeAnnotation||"assert")}if(!(n instanceof Wn)&&"resolvedImage"!==n.type.kind&&Io(n)){const t=new lr(this._scope,this.options,this.iconImageUseTheme);
vendor: 5,068 bytes, line 2
2try{n=new Wn(n.type,n.evaluate(t))}catch(e){return this.error(e.message),null}}return n}return sr.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,i,n){const r=n?this.scope.concat(n):this.scope,o=this.path.slice();return"number"==typeof e&&o.push(e),"string"==typeof t&&o.push(t),new To(this.registry,o,i||null,r,this.errors,this._scope,this.options,this.iconImageUseTheme)}_forkForSignature(){return new To(this.registry,this.path.slice(),null,this.scope,[],this._scope,this.options,this.iconImageUseTheme)}error(e,...t){const i=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new bn(i,e))}checkSubtype(e,t,i){const n=On(e,t);return n&&this.error(n,..."number"==typeof i?[i]:[]),n}}const Eo=new Set(["zoom","heatmap-density","worldview","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed","is-active-floor"]);function So(e,t,i){return"assert"===i?new Jn(t,[e]):"coerce"===i?new sr(t,[e]):e}function Io(e){if(e instanceof wo)return Io(e.boundExpression);if(e instanceof cr&&"error"===e.name)return!1;if(e instanceof hr)return!1;if(e instanceof Ar)return!1;if(e instanceof bo)return!1;if(e instanceof Lr)return!1;const t=e instanceof sr||e instanceof Jn;let i=!0;return e.eachChild(e=>{i=t?i&&Io(e):i&&e instanceof Wn}),!!i&&zr(e)&&Or(e,Eo)}function Ao(e,t){const i=e.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=e[a],r=e[a+1],n<=t){if(a===i||t<r)return a;o=a+1}else{if(!(n>t))throw new Yn("Input is not a number.");s=a-1}return 0}class Mo{constructor(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const i=t.parse(e[1],1,En);if(!i)return null;const n=[];let r=null;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(let i=1;i<e.length;i+=2){const o=1===i?-1/0:e[i],s=e[i+1],a=i,l=i+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n.at(-1)[0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=t.parse(s,l,r);if(!c)return null;r=r||c.type,n.push([o,c])}return new Mo(r,i,n)}evaluate(e){const t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return i[0].evaluate(e);const r=t.length;return n>=t[r-1]?i[r-1].evaluate(e):i[Ao(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}const Co=.95047,Do=1.08883,Po=4/29,Ro=6/29,Lo=3*Ro*Ro,zo=Ro*Ro*Ro,Fo=Math.PI/180,Oo=180/Math.PI;function ko(e){return e>zo?Math.pow(e,1/3):e/Lo+Po}function Bo(e){return e>Ro?e*e*e:Lo*(e-Po)}function No(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Vo(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Uo(e){const t=Vo(e.r),i=Vo(e.g),n=Vo(e.b),r=ko((.4124564*t+.3575761*i+.1804375*n)/Co),o=ko((.2126729*t+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-ko((.0193339*t+.119192*i+.9503041*n)/Do)),alpha:e.a}}function jo(e){let t=(e.l+16)/116,i=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*Bo(t),i=Co*Bo(i),n=Do*Bo(n),new mn(No(3.2404542*i-1.5371385*t-.4985314*n),No(-.969266*i+1.8760108*t+.041556*n),No(.0556434*i-.2040259*t+1.0572252*n),e.alpha)}function Go(e,t,i){const n=t-e;return e+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const $o={forward:Uo,reverse:jo,interpolate:function(e,t,i){return{l:fn(e.l,t.l,i),a:fn(e.a,t.a,i),b:fn(e.b,t.b,i),alpha:fn(e.alpha,t.alpha,i)}}},Ho={forward:function(e){const{l:t,a:i,b:n}=Uo(e),r=Math.atan2(n,i)*Oo;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:t,alpha:e.a}},reverse:function(e){const t=e.h*Fo,i=e.c;return jo({l:e.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:e.alpha})},interpolate:function(e,t,i){return{h:Go(e.h,t.h,i),c:fn(e.c,t.c,i),l:fn(e.l,t.l,i),alpha:fn(e.alpha,t.alpha,i)}}};var Zo=Object.freeze({__proto__:null,hcl:Ho,lab:$o});class qo{constructor(e,t,i,n,r){this.type=e,this.operator=t,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,i,n){let r=0;if("exponential"===e.name)r=Wo(t,e.base,i,n);else if("linear"===e.name)r=Wo(t,1,i,n);else if("cubic-bezier"===e.name){const o=e.controlPoints;
vendor: 19,432 bytes, line 2
2r=De(o[0],o[1],o[2],o[3])(Wo(t,1,i,n))}return r}static parse(e,t){let[i,n,r,...o]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length-1>3&&(e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(r=t.parse(r,2,En),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=An:t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let e=0;e<o.length;e+=2){const i=o[e],n=o[e+1],r=e+3,l=e+4;if("number"!=typeof i)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',r);if(s.length&&s.at(-1)[0]>=i)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',r);const c=t.parse(n,l,a);if(!c)return null;a=a||c.type,s.push([i,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new qo(a,i,n,r,s):t.error(`Type ${zn(a)} is not interpolatable.`)}evaluate(e){const t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return i[0].evaluate(e);const r=t.length;if(n>=t[r-1])return i[r-1].evaluate(e);const o=Ao(t,n),s=qo.interpolationFactor(this.interpolation,n,t[o],t[o+1]),a=i[o].evaluate(e),l=i[o+1].evaluate(e);return"interpolate"===this.operator?xn[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?Ho.reverse(Ho.interpolate(Ho.forward(a),Ho.forward(l),s)):$o.reverse($o.interpolate($o.forward(a),$o.forward(l),s))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier",...this.interpolation.controlPoints];const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function Wo(e,t,i,n){const r=n-i,o=e-i;return 0===r?0:1===t?o/r:(Math.pow(t,o)-1)/(Math.pow(t,r)-1)}class Yo{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument."),null;let i=null;const n=t.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const n of e.slice(1)){const e=t.parse(n,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!e)return null;i=i||e.type,r.push(e)}const o=n&&r.some(e=>On(n,e.type));return new Yo(o?Cn:i,r)}evaluate(e){let t,i=null,n=0;for(const r of this.args){if(n++,i=r.evaluate(e),i&&i instanceof Gn&&!i.available&&(t||(t=i),i=null,n===this.args.length))return t;if(null!==i)break}return i}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(t=>{e.push(t.serialize())}),e}}const Xo=/[^a-zA-Z0-9_]/;class Jo{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const i=[];for(let n=1;n<e.length-1;n+=2){const r=e[n];if("string"!=typeof r)return t.error(`Expected string, but found ${typeof r} instead.`,n);if(Xo.test(r))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const o=t.parse(e[n+1],n+1);if(!o)return null;i.push([r,o])}const n=t.parse(e.at(-1),e.length-1,t.expectedType,i);return n?new Jo(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,i]of this.bindings)e.push(t,i.serialize());return e.push(this.result.serialize()),e}}class Ko{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,En),n=t.parse(e[2],2,Ln(t.expectedType||Cn));return i&&n?new Ko(n.type.itemType,i,n):null}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new Yn("Array index out of bounds: negative index");if(t>=i.length)throw new Yn("Array index out of bounds: index exceeds array size");if(t!==Math.floor(t))throw new Yn("Array index must be an integer. Use at-interpolated for fractional indices");return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Qo{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,En),n=t.parse(e[2],2,Ln(t.expectedType||Cn));return i&&n?new Qo(n.type.itemType,i,n):null}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new Yn(`Array index out of bounds: ${t} < 0.`);if(t>i.length-1)throw new Yn(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t===Math.floor(t))return i[t];const n=Math.floor(t),r=Math.ceil(t),o=i[n],s=i[r];if("number"!=typeof o||"number"!=typeof s)throw new Yn(`Cannot interpolate between non-number values at index ${t}.`);return fn(o,s,t-n)}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at-interpolated",this.index.serialize(),this.input.serialize()]}}class es{constructor(e,t,i,n,r,o){this.inputType=e,this.type=t,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let i,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const r={},o=[];for(let s=2;s<e.length-1;s+=2){let a=e[s];const l=e[s+1];if(Array.isArray(a)||(a=[a]),0===a.length)return t.error("Expected at least one branch label.",s);for(const e of a){if("number"!=typeof e&&"string"!=typeof e)return t.error("Branch labels must be numbers or strings.",s);if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return t.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`,s);if("number"==typeof e&&Math.floor(e)!==e)return t.error("Numeric branch labels must be integer values.",s);if(i){if(t.checkSubtype(i,Zn(e),s))return null}else i=Zn(e);if(void 0!==r[String(e)])return t.error("Branch labels must be unique.",s);r[String(e)]=o.length}const c=t.parse(l,s,n);if(!c)return null;n=n||c.type,o.push(c)}const s=t.parse(e[1],1,Cn);if(!s)return null;const a=t.parse(e.at(-1),e.length-1,n);return a?"value"!==s.type.kind&&t.checkSubtype(i,s.type,1)?null:new es(i,n,s,r,o,a):null}evaluate(e){const t=this.input.evaluate(e);return(Bn(Zn(t),this.inputType)&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),i=[],n={};for(const e of t){const t=n[this.cases[e]];void 0===t?(n[this.cases[e]]=i.length,i.push([this.cases[e],[e]])):i[t][1].push(e)}const r=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,n]of i)e.push(1===n.length?r(n[0]):n.map(r)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}class ts{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`),null;if(e.length%2!=0)return t.error("Expected an odd number of arguments."),null;let i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);const n=[];for(let r=1;r<e.length-1;r+=2){const o=t.parse(e[r],r,In);if(!o)return null;const s=t.parse(e[r+1],r+1,i);if(!s)return null;n.push([o,s]),i=i||s.type}const r=t.parse(e.at(-1),e.length-1,i);return r?new ts(i,n,r):null}evaluate(e){for(const[t,i]of this.branches)if(t.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,i]of this.branches)e(t),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(t=>{e.push(t.serialize())}),e}}class is{constructor(e,t,i,n){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`),null;const i=t.parse(e[1],1,Cn),n=t.parse(e[2],2,En);if(!i||!n)return null;if(r=i.type,![Ln(Cn),Sn,Cn].some(e=>e.kind===r.kind))return t.error(`Expected first argument to be of type array or string, but found ${zn(i.type)} instead`),null;var r;if(4===e.length){const r=t.parse(e[3],3,En);return r?new is(i.type,i,n,r):null}return new is(i.type,i,n)}evaluate(e){const t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(!kn(t,["string","array"]))throw new Yn(`Expected first argument to be of type array or string, but found ${zn(Zn(t))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(e);return t.slice(i,n)}return t.slice(i)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function ns(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function rs(e,t,i,n){return 0===n.compare(t,i)}function os(e,t,i){const n="=="!==e&&"!="!==e;return class r{constructor(e,t,i){this.type=In,this.lhs=e,this.rhs=t,this.collator=i,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const i=e[0];let o=t.parse(e[1],1,Cn);if(!o)return null;if(!ns(i,o.type))return t.error(`"${i}" comparisons are not supported for type '${zn(o.type)}'.`,1);let s=t.parse(e[2],2,Cn);if(!s)return null;if(!ns(i,s.type))return t.error(`"${i}" comparisons are not supported for type '${zn(s.type)}'.`,2);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${zn(o.type)}' and '${zn(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new Jn(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new Jn(o.type,[s])));let a=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(a=t.parse(e[3],3,Dn),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const t=Zn(o),i=Zn(s);if(t.kind!==i.kind||"string"!==t.kind&&"number"!==t.kind)throw new Yn(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=Zn(o),i=Zn(s);if("string"!==e.kind||"string"!==i.kind)return t(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):t(r,o,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild(e=>{t.push(e.serialize())}),t}}}const ss=os("==",function(e,t,i){return t===i},rs),as=os("!=",function(e,t,i){return t!==i},function(e,t,i,n){return!rs(0,t,i,n)}),ls=os("<",function(e,t,i){return t<i},function(e,t,i,n){return n.compare(t,i)<0}),cs=os(">",function(e,t,i){return t>i},function(e,t,i,n){return n.compare(t,i)>0}),us=os("<=",function(e,t,i){return t<=i},function(e,t,i,n){return n.compare(t,i)<=0}),hs=os(">=",function(e,t,i){return t>=i},function(e,t,i,n){return n.compare(t,i)>=0});class ds{constructor(e,t,i,n,r,o){this.type=Sn,this.number=e,this.locale=t,this.currency=i,this.unit=n,this.minFractionDigits=r,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const i=t.parse(e[1],1,En);if(!i)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=t.parseObjectValue(n.locale,2,"locale",Sn),!r))return null;let o=null;if(n.currency&&(o=t.parseObjectValue(n.currency,2,"currency",Sn),!o))return null;let s=null;if(n.unit&&(s=t.parseObjectValue(n.unit,2,"unit",Sn),!s))return null;let a=null;if(void 0!==n["min-fraction-digits"]&&(a=t.parseObjectValue(n["min-fraction-digits"],2,"min-fraction-digits",En),!a))return null;let l=null;return void 0===n["max-fraction-digits"]||(l=t.parseObjectValue(n["max-fraction-digits"],2,"max-fraction-digits",En),l)?new ds(i,r,o,s,a,l):null}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class fs{constructor(e){this.type=En,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`),null;const i=t.parse(e[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?(t.error(`Expected argument of type string or array, but found ${zn(i.type)} instead.`),null):new fs(i):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Yn(`Expected value to be of type string or array, but found ${zn(Zn(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(t=>{e.push(t.serialize())}),e}}function ps(e){return function(){e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const ms={"==":ss,"!=":as,">":cs,"<":ls,">=":hs,"<=":us,array:Jn,at:Ko,"at-interpolated":Qo,boolean:Jn,case:ts,coalesce:Yo,collator:hr,format:Kn,image:Qn,interpolate:qo,"interpolate-hcl":qo,"interpolate-lab":qo,length:fs,let:Jo,literal:Wn,match:es,number:Jn,"number-format":ds,object:Jn,slice:is,step:Mo,string:Jn,"to-boolean":sr,"to-color":sr,"to-number":sr,"to-string":sr,var:wo,within:Ar,distance:bo,config:Lr};function _s(e,[t,i,n,r]){t=t.evaluate(e),i=i.evaluate(e),n=n.evaluate(e);const o=r?r.evaluate(e):1,s=$n(t,i,n,o);if(s)throw new Yn(s);return new mn(t/255,i/255,n/255,o)}function gs(e,[t,i,n,r]){t=t.evaluate(e),i=i.evaluate(e),n=n.evaluate(e);const o=r?r.evaluate(e):1,s=function(e,t,i,n){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof i&&i>=0&&i<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid hsla value [${[e,t,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof n?[e,t,i,n]:[e,t,i]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof n?[e,t,i,n]:[e,t,i]).join(", ")}]: 'h' must be between 0 and 360.`}(t,i,n,o);if(s)throw new Yn(s);const a=`hsla(${t}, ${i}%, ${n}%, ${o})`,l=mn.parse(a);if(!l)throw new Yn(`Failed to parse HSLA color: ${a}`);return l}function ys(e,t){return e in t}function vs(e,t){const i=t[e];return void 0===i?null:i}function xs(e){return{type:e}}function bs(e,t){if(!kn(e,["boolean","string","number","null"]))throw new Yn(`Expected first argument to be of type boolean, string, number or null, but found ${zn(Zn(e))} instead.`);if(!kn(t,["string","array"]))throw new Yn(`Expected second argument to be of type array or string, but found ${zn(Zn(t))} instead.`)}function ws(e){if(e instanceof Lr)return new Set([e.key]);let t=new Set;return e.eachChild(e=>{t=new Set([...t,...ws(e)])}),t}function Ts(e){if(e instanceof cr&&"is-active-floor"===e.name)return!0;let t=!1;return e.eachChild(e=>{!t&&Ts(e)&&(t=!0)}),t}function Es(e){return{result:"success",value:e}}function Ss(e){return{result:"error",value:e}}function Is(e,t){return!!e&&!!e.parameters&&e.parameters.includes(t)}function As(e){return"data-driven"===e["property-type"]}function Ms(e){return Is(e.expression,"measure-light")}function Cs(e){return Is(e.expression,"zoom")}function Ds(e){return!!e.expression&&e.expression.interpolated}function Ps(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Rs(e){return e}function Ls(e,t){const i="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],r=n||!(n||void 0!==e.property),o=e.type||(Ds(t)?"exponential":"interval");if(i&&((e={...e}).stops&&(e.stops=e.stops.map(e=>[e[0],mn.parse(e[1])])),e.default=mn.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Zo[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let s,a,l;if("exponential"===o)s=ks;else if("interval"===o)s=Os;else if("categorical"===o){s=Fs,a=Object.create(null);for(const t of e.stops)a[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);s=Bs}if(n){const i={},n=[];for(let t=0;t<e.stops.length;t++){const r=e.stops[t],o=r[0].zoom;void 0===i[o]&&(i[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},n.push(o)),i[o].stops.push([r[0].value,r[1]])}const r=[];for(const e of n)r.push([i[e].zoom,Ls(i[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:qo.interpolationFactor.bind(void 0,o),zoomStops:r.map(e=>e[0]),evaluate:({zoom:i},n)=>ks({stops:r,base:e.base},t,i).evaluate(i,n)}}if(r){const i="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base
vendor: 10,233 bytes, line 2
2:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:qo.interpolationFactor.bind(void 0,i),zoomStops:e.stops.map(e=>e[0]),evaluate:({zoom:i})=>s(e,t,i,a,l)}}return{kind:"source",evaluate(i,n){const r=n&&n.properties?n.properties[e.property]:void 0;return void 0===r?zs(e.default,t.default):s(e,t,r,a,l)}}}function zs(e,t,i){return void 0!==e?e:void 0!==t?t:void 0!==i?i:void 0}function Fs(e,t,i,n,r){return zs(typeof i===r?n[i]:void 0,e.default,t.default)}function Os(e,t,i){if(!nr(i))return zs(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[n-1][0])return e.stops[n-1][1];const r=Ao(e.stops.map(e=>e[0]),i);return e.stops[r][1]}function ks(e,t,i){const n=void 0!==e.base?e.base:1;if(!nr(i))return zs(e.default,t.default);const r=e.stops.length;if(1===r)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[r-1][0])return e.stops[r-1][1];const o=Ao(e.stops.map(e=>e[0]),i),s=function(e,t,i,n){const r=n-i,o=e-i;return 0===r?0:1===t?o/r:(Math.pow(t,o)-1)/(Math.pow(t,r)-1)}(i,n,e.stops[o][0],e.stops[o+1][0]),a=e.stops[o][1],l=e.stops[o+1][1];let c=xn[t.type]||Rs;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=Zo[e.colorSpace];c=(e,i)=>t.reverse(t.interpolate(t.forward(e),t.forward(i),s))}return"function"==typeof a.evaluate?{evaluate(...e){const t=a.evaluate.apply(void 0,e),i=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==i)return c(t,i,s)}}:c(a,l,s)}function Bs(e,t,i){return"color"===t.type?i=mn.parse(i):"formatted"===t.type?i=Un.fromString(i.toString()):"resolvedImage"===t.type?i=Gn.build(i.toString()):er(i)===t.type||"enum"===t.type&&t.values[i]||(i=void 0),zs(i,e.default,t.default)}cr.register(ms,{error:[{kind:"error"},[Sn],(e,[t])=>{throw new Yn(t.evaluate(e))}],typeof:[Sn,[Cn],(e,[t])=>zn(Zn(t.evaluate(e)))],"to-rgba":[Ln(En,4),[An],(e,[t])=>t.evaluate(e).toNonPremultipliedRenderColor(null).toArray()],"to-hsla":[Ln(En,4),[An],(e,[t])=>t.evaluate(e).toNonPremultipliedRenderColor(null).toHslaArray()],rgb:[An,[En,En,En],_s],rgba:[An,[En,En,En,En],_s],hsl:[An,[En,En,En],gs],hsla:[An,[En,En,En,En],gs],has:{type:In,overloads:[[[Sn],(e,[t])=>ys(t.evaluate(e),e.properties())],[[Sn,Mn],(e,[t,i])=>ys(t.evaluate(e),i.evaluate(e))]]},get:{type:Cn,overloads:[[[Sn],(e,[t])=>vs(t.evaluate(e),e.properties())],[[Sn,Mn],(e,[t,i])=>vs(t.evaluate(e),i.evaluate(e))]]},"feature-state":[Cn,[Sn],(e,[t])=>vs(t.evaluate(e),e.featureState||{})],properties:[Mn,[],e=>e.properties()],"geometry-type":[Sn,[],e=>e.geometryType()],worldview:[Sn,[],e=>e.globals.worldview||""],"is-active-floor":[In,xs(Sn),(e,t)=>{if(!(e.globals&&e.globals.activeFloors&&e.globals.activeFloors.size>0))return!1;if(0===t.length)return!0;const i=e.globals.activeFloors;return t.some(t=>{const n=t.evaluate(e);return i.has(n)})}],id:[Cn,[],e=>e.id()],zoom:[En,[],e=>e.globals.zoom],pitch:[En,[],e=>e.globals.pitch||0],"distance-from-center":[En,[],e=>e.distanceFromCenter()],"measure-light":[En,[Sn],(e,[t])=>e.measureLight(t.evaluate(e))],"heatmap-density":[En,[],e=>e.globals.heatmapDensity||0],"line-progress":[En,[],e=>e.globals.lineProgress||0],"raster-value":[En,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[En,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[En,[],e=>e.globals.skyRadialProgress||0],accumulated:[Cn,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[En,xs(En),(e,t)=>{let i=0;for(const n of t)i+=n.evaluate(e);return i}],"*":[En,xs(En),(e,t)=>{let i=1;for(const n of t)i*=n.evaluate(e);return i}],"-":{type:En,overloads:[[[En,En],(e,[t,i])=>t.evaluate(e)-i.evaluate(e)],[[En],(e,[t])=>-t.evaluate(e)]]},"/":[En,[En,En],(e,[t,i])=>t.evaluate(e)/i.evaluate(e)],"%":[En,[En,En],(e,[t,i])=>t.evaluate(e)%i.evaluate(e)],ln2:[En,[],()=>Math.LN2],pi:[En,[],()=>Math.PI],e:[En,[],()=>Math.E],"^":[En,[En,En],(e,[t,i])=>Math.pow(t.evaluate(e),i.evaluate(e))],sqrt:[En,[En],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[En,[En],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[En,[En],(e,[t])=>Math.log(t.evaluate(e))],log2:[En,[En],(e,[t])=>Math.log2(t.evaluate(e))],sin:[En,[En],(e,[t])=>Math.sin(t.evaluate(e))],cos:[En,[En],(e,[t])=>Math.cos(t.evaluate(e))],tan:[En,[En],(e,[t])=>Math.tan(t.evaluate(e))],asin:[En,[En],(e,[t])=>Math.asin(t.evaluate(e))],acos:[En,[En],(e,[t])=>Math.acos(t.evaluate(e))],atan:[En,[En],(e,[t])=>Math.atan(t.evaluate(e))],min:[En,xs(En),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[En,xs(En),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[En,[En],(e,[t])=>Math.abs(t.evaluate(e))],round:[En,[En],(e,[t])=>{const i=t.evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[En,[En],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[En,[En],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[In,[Sn,Cn],(e,[t,i])=>e.properties()[t.value]===i.value],"filter-id-==":[In,[Cn],(e,[t])=>e.id()===t.value],"filter-type-==":[In,[Sn],(e,[t])=>e.geometryType()===t.value],"filter-<":[In,[Sn,Cn],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[In,[Cn],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i<n}],"filter->":[In,[Sn,Cn],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[In,[Cn],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i>n}],"filter-<=":[In,[Sn,Cn],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[In,[Cn],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i<=n}],"filter->=":[In,[Sn,Cn],(e,[t,i])=>{const n=e.properties()[t.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[In,[Cn],(e,[t])=>{const i=e.id(),n=t.value;return typeof i==typeof n&&i>=n}],"filter-has":[In,[Cn],(e,[t])=>t.value in e.properties()],"filter-has-id":[In,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[In,[Ln(Sn)],(e,[t])=>t.value.includes(e.geometryType())],"filter-id-in":[In,[Ln(Cn)],(e,[t])=>t.value.includes(e.id())],"filter-in-small":[In,[Sn,Ln(Cn)],(e,[t,i])=>i.value.includes(e.properties()[t.value])],"filter-in-large":[In,[Sn,Ln(Cn)],(e,[t,i])=>function(e,t,i,n){for(;i<=n;){const r=i+n>>1;if(t[r]===e)return!0;t[r]>e?n=r-1:i=r+1}return!1}(e.properties()[t.value],i.value,0,i.value.length-1)],all:{type:In,overloads:[[[In,In],(e,[t,i])=>t.evaluate(e)&&i.evaluate(e)],[xs(In),(e,t)=>{for(const i of t)if(!i.evaluate(e))return!1;return!0}]]},any:{type:In,overloads:[[[In,In],(e,[t,i])=>t.evaluate(e)||i.evaluate(e)],[xs(In),(e,t)=>{for(const i of t)if(i.evaluate(e))return!0;return!1}]]},"!":[In,[In],(e,[t])=>!t.evaluate(e)],"is-supported-script":[In,[Sn],(e,[t])=>{const i=e.globals&&e.globals.isSupportedScript;return!i||i(t.evaluate(e))}],upcase:[Sn,[Sn],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Sn,[Sn],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Sn,xs(Cn),(e,t)=>t.map(t=>qn(t.evaluate(e))).join("")],split:[Ln(Sn),[Sn,Sn],(e,[t,i])=>t.evaluate(e).split(i.evaluate(e))],in:[In,[Cn,Cn],(e,[t,i])=>{const n=t.evaluate(e),r=i.evaluate(e);return null!=r&&(bs(n,r),r.includes(n))}],"index-of":{type:En,overloads:[[[Cn,Cn],(e,[t,i])=>{const n=t.evaluate(e),r=i.evaluate(e);return bs(n,r),r.indexOf(n)}],[[Cn,Cn,En],(e,[t,i,n])=>{const r=t.evaluate(e),o=i.evaluate(e),s=n.evaluate(e);return bs(r,o),o.indexOf(r,s)}]]},"resolved-locale":[Sn,[Dn],(e,[t])=>t.evaluate(e).resolvedLocale()],random:[En,[En,En,Cn],(e,t)=>{const[i,n,r]=t.map(t=>t.evaluate(e));if(i>n)return i;if(i===n)return i;let o;if("string"==typeof r)o=function(e){let t=0;if(0===e.length)return t;for(let i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t&=t;return t}(r);else{if("number"!=typeof r)throw new Yn(`Invalid seed input: ${r}`);o=r}return i+ps(o)()*(n-i)}]});class Ns{constructor(e,t,i,n,r){this.expression=e,this._warningHistory={},this._scope=i,this._options=n,this._iconImageUseTheme=r,this._evaluator=new lr(i,n,r),this._defaultValue=t?function(e){return"color"===e.type&&(Ps(e.default)||Array.isArray(e.default))?new mn(0,0,0,0):"color"===e.type?mn.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this.configDependencies=ws(e),this.isIndoorDependent=Ts(e)}evaluateWithoutErrorHandling(e,t,i,n,r,o,s,a){const l=this._evaluator;return l.globals=e,l.feature=t,l.featureState=i,l.canonical=n||null,l.availableImages=r||null,l.formattedSection=o,l.featureTileCoord=s||null,l.featureDistanceData=a||null,this.expression.evaluate(l)}evaluate(e,t,i,n,r,o,s,a,l){this._evaluator||(this._evaluator=new lr(this._scope,this._options,this._iconImageUseTheme)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null,this._evaluator.iconImageUseTheme=l||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Yn(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){const t=e;return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${t.message}`)),this._defaultValue}}}function Vs(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&Object.hasOwn(ms,e[0])}function Us(e,t,i,n,r){const o=new To(ms,[],t?function(e){const t={color:An,string:Sn,number:En,enum:Sn,boolean:In,formatted:Pn,resolvedImage:Rn,object:Mn};return"array"===e.type?Ln(t[e.value]||Cn,e.length):t[e.type]}(t):void 0,void 0,void 0,i,n,r),s=o.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return s?Es(new Ns(s,t,i,n,r)):Ss(o.errors)}class js{constructor(e,t,i,n){this.kind=e,this._styleExpression=t,this.isLightConstant=i,this.isLineProgressConstant=n,this.isStateDependent="constant"!==e&&!Fr(t.expression),this.configDependencies=ws(t.expression),this.isIndo
vendor: 23,656 bytes, line 2
2orDependent=Ts(t.expression)}evaluateWithoutErrorHandling(e,t,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,n,r,o)}evaluate(e,t,i,n,r,o,s){return this._styleExpression.evaluate(e,t,i,n,r,o,void 0,void 0,s)}}class Gs{constructor(e,t,i,n,r,o){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Fr(t.expression),this.isIndoorDependent=Ts(t.expression),this.isLightConstant=r,this.isLineProgressConstant=o,this.configDependencies=ws(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,n,r,o)}evaluate(e,t,i,n,r,o){return this._styleExpression.evaluate(e,t,i,n,r,o)}interpolationFactor(e,t,i){return this.interpolationType?qo.interpolationFactor(this.interpolationType,e,t,i):0}}function $s(e,t,i,n,r){if("error"===(e=Us(e,t,i,n,r)).result)return e;const o=e.value.expression,s=zr(o);if(!s&&!As(t))return Ss([new bn("","data expressions not supported")]);const a=kr(o,["zoom","pitch","distance-from-center"]);if(!a&&!Cs(t))return Ss([new bn("","zoom expressions not supported")]);const l=kr(o,["measure-light"]);if(!l&&!Ms(t))return Ss([new bn("","measure-light expression not supported")]);const c=kr(o,["line-progress"]);if(!c&&!function(e){return Is(e.expression,"line-progress")}(t))return Ss([new bn("","line-progress expression not supported")]);const u=t.expression&&t.expression.relaxZoomRestriction,h=Zs(o);return h||a||u?h instanceof bn?Ss([h]):h instanceof qo&&!Ds(t)?Ss([new bn("",'"interpolate" expressions cannot be used with this property')]):Es(h?new Gs(s&&c?"camera":"composite",e.value,h.labels,h instanceof qo?h.interpolation:void 0,l,c):new js(s&&c?"constant":"source",e.value,l,c)):Ss([new bn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class Hs{constructor(e,t){this._parameters=e,this._specification=t,Object.assign(this,Ls(this._parameters,this._specification))}static deserialize(e){return new Hs(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Zs(e){let t=null;if(e instanceof Jo)t=Zs(e.result);else if(e instanceof Yo){for(const i of e.args)if(t=Zs(i),t)break}else(e instanceof Mo||e instanceof qo)&&e.input instanceof cr&&"zoom"===e.input.name&&(t=e);return t instanceof bn||e.eachChild(e=>{const i=Zs(e);i instanceof bn?t=i:t&&i&&t!==i&&(t=new bn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}class qs{constructor(e,t,i){if(this.boxSeen=new Uint32Array(0),this.circleSeen=new Uint32Array(0),this.generation=0,e instanceof ArrayBuffer){const t=new Int32Array(e);this.width=t[0],this.height=t[1],this.xCellCount=t[2],this.yCellCount=t[3],this.boxUid=t[4],this.circleUid=t[5];const i=this.xCellCount*this.yCellCount,n=[];for(let e=0;e<i;e++){const i=t[6+e],r=t[6+e+1];n.push(i===r?null:t.subarray(i,r))}const r=t[6+i],o=[];for(let e=0;e<i;e++){const i=t[r+e],n=t[r+e+1];o.push(i===n?null:t.subarray(i,n))}let s=t[r+i];this.boxCells=n,this.circleCells=o,this.boxKeys=t.subarray(s,s+this.boxUid),s+=this.boxUid,this.circleKeys=t.subarray(s,s+this.circleUid),s+=this.circleUid,this.bboxes=t.subarray(s,s+4*this.boxUid),s+=4*this.boxUid,this.circles=t.subarray(s,s+3*this.circleUid)}else{this.width=e,this.height=t,this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(t/i);const n=this.xCellCount*this.yCellCount,r=[],o=[];for(let e=0;e<n;e++)r.push([]),o.push([]);this.boxCells=r,this.circleCells=o,this.boxKeys=[],this.circleKeys=[],this.bboxes=[],this.circles=[],this.boxUid=0,this.circleUid=0}this.xScale=this.xCellCount/this.width,this.yScale=this.yCellCount/this.height}keysLength(){return this.boxKeys.length+this.circleKeys.length}clear(){for(const e of this.boxCells)e&&(e.length=0);for(const e of this.circleCells)e&&(e.length=0);this.circleKeys.length=0,this.boxKeys.length=0,this.bboxes.length=0,this.circles.length=0,this.boxUid=0,this.circleUid=0}insert(e,t,i,n,r){const o=this.boxUid++,s=this._xCell(t),a=this._yCell(i),l=this._xCell(n),c=this._yCell(r);for(let e=s;e<=l;e++)for(let t=a;t<=c;t++)this.boxCells[this.xCellCount*t+e].push(o);this.boxKeys.push(e),this.bboxes.push(t,i,n,r)}insertCircle(e,t,i,n){const r=this.circleUid++,o=this._xCell(t-n),s=this._yCell(i-n),a=this._xCell(t+n),l=this._yCell(i+n);for(let e=o;e<=a;e++)for(let t=s;t<=l;t++)this.circleCells[this.xCellCount*t+e].push(r);this.circleKeys.push(e),this.circles.push(t,i,n)}query(e,t,i,n,r){const o=[];if(i<0||e>this.width||n<0||t>this.height)return o;const s=this._nextGen(),{boxCells:a,circleCells:l,boxKeys:c,circleKeys:u,bboxes:h,circles:d,boxSeen:f,circleSeen:p,xCellCount:m}=this,_=this._xCell(e),g=this._yCell(t),y=this._xCell(i),v=this._yCell(n);for(let x=_;x<=y;x++)for(let _=g;_<=v;_++){const g=m*_+x,y=a[g];if(y)for(let a=0;a<y.length;a++){const l=y[a];if(f[l]===s)continue;f[l]=s;const u=4*l,d=h[u],p=h[u+1],m=h[u+2],_=h[u+3];e<=m&&t<=_&&i>=d&&n>=p&&(!r||r(c[l]))&&o.push({key:c[l],x1:d,y1:p,x2:m,y2:_})}const v=l[g];if(v)for(let a=0;a<v.length;a++){const l=v[a];if(p[l]===s)continue;p[l]=s;const c=3*l,h=d[c],f=d[c+1],m=d[c+2];!this._circleAndRectCollide(h,f,m,e,t,i,n)||r&&!r(u[l])||o.push({key:u[l],x1:h-m,y1:f-m,x2:h+m,y2:f+m})}}return o}queryKeys(e,t,i,n,r){const o=[];if(i<0||e>this.width||n<0||t>this.height)return o;const s=this._nextGen(),{boxCells:a,boxKeys:l,bboxes:c,boxSeen:u,xCellCount:h,xScale:d,yScale:f}=this,p=this._xCell(e),m=this._yCell(t),_=this._xCell(i),g=this._yCell(n);for(let y=p;y<=_;y++)for(let p=m;p<=g;p++){if(r&&!r(y/d,p/f,(y+1)/d,(p+1)/f))continue;const m=a[h*p+y];if(m)for(let a=0;a<m.length;a++){const h=m[a];if(u[h]===s)continue;u[h]=s;const d=4*h,f=c[d],p=c[d+1],_=c[d+2],g=c[d+3];(r?r(f,p,_,g):e<=_&&t<=g&&i>=f&&n>=p)&&o.push(l[h])}}return o}hitTest(e,t,i,n,r){if(i<0||e>this.width||n<0||t>this.height)return!1;const o=this._nextGen(),{boxCells:s,circleCells:a,boxKeys:l,circleKeys:c,bboxes:u,circles:h,boxSeen:d,circleSeen:f,xCellCount:p}=this,m=this._xCell(e),_=this._yCell(t),g=this._xCell(i),y=this._yCell(n);for(let v=m;v<=g;v++)for(let m=_;m<=y;m++){const _=p*m+v,g=s[_];if(g)for(let s=0;s<g.length;s++){const a=g[s];if(d[a]===o)continue;d[a]=o;const c=4*a;if(e<=u[c+2]&&t<=u[c+3]&&i>=u[c]&&n>=u[c+1]&&(!r||r(l[a])))return!0}const y=a[_];if(y)for(let s=0;s<y.length;s++){const a=y[s];if(f[a]===o)continue;f[a]=o;const l=3*a;if(this._circleAndRectCollide(h[l],h[l+1],h[l+2],e,t,i,n)&&(!r||r(c[a])))return!0}}return!1}hitTestCircle(e,t,i,n){const r=e-i,o=t-i,s=e+i,a=t+i;if(s<0||r>this.width||a<0||o>this.height)return!1;const l=this._nextGen(),{boxCells:c,circleCells:u,boxKeys:h,circleKeys:d,bboxes:f,circles:p,boxSeen:m,circleSeen:_,xCellCount:g}=this,y=this._xCell(r),v=this._yCell(o),x=this._xCell(s),b=this._yCell(a);for(let r=y;r<=x;r++)for(let o=v;o<=b;o++){const s=g*o+r,a=c[s];if(a)for(let r=0;r<a.length;r++){const o=a[r];if(m[o]===l)continue;m[o]=l;const s=4*o;if(this._circleAndRectCollide(e,t,i,f[s],f[s+1],f[s+2],f[s+3])&&(!n||n(h[o])))return!0}const y=u[s];if(y)for(let r=0;r<y.length;r++){const o=y[r];if(_[o]===l)continue;_[o]=l;const s=3*o;if(this._circlesCollide(p[s],p[s+1],p[s+2],e,t,i)&&(!n||n(d[o])))return!0}}return!1}static serialize(e,t){const i=e.toArrayBuffer();return t&&t.add(i),{buffer:i}}static deserialize(e){return new qs(e.buffer)}toArrayBuffer(){const e=this.xCellCount*this.yCellCount;let t=0,i=0;for(let n=0;n<e;n++)t+=this.boxCells[n].length,i+=this.circleCells[n].length;const n=new Int32Array(6+(e+1)+t+(e+1)+i+this.boxUid+this.circleUid+4*this.boxUid+3*this.circleUid);n[0]=this.width,n[1]=this.height,n[2]=this.xCellCount,n[3]=this.yCellCount,n[4]=this.boxUid,n[5]=this.circleUid;let r=6+(e+1);for(let t=0;t<e;t++){n[6+t]=r;const e=this.boxCells[t];n.set(e,r),r+=e.length}n[6+e]=r;const o=r;r+=e+1;for(let t=0;t<e;t++){n[o+t]=r;const e=this.circleCells[t];n.set(e,r),r+=e.length}return n[o+e]=r,n.set(this.boxKeys,r),r+=this.boxUid,n.set(this.circleKeys,r),r+=this.circleUid,n.set(this.bboxes,r),r+=4*this.boxUid,n.set(this.circles,r),n.buffer}_xCell(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_yCell(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_nextGen(){return this.boxSeen.length<this.boxUid&&(this.boxSeen=new Uint32Array(this.boxUid)),this.circleSeen.length<this.circleUid&&(this.circleSeen=new Uint32Array(this.circleUid)),this.generation=this.generation+1>>>0,0===this.generation&&(this.boxSeen.fill(0),this.circleSeen.fill(0),this.generation=1),this.generation}_circlesCollide(e,t,i,n,r,o){const s=n-e,a=r-t,l=i+o;return l*l>s*s+a*a}_circleAndRectCollide(e,t,i,n,r,o,s){const a=(o-n)/2,l=Math.abs(e-(n+a));if(l>a+i)return!1;const c=(s-r)/2,u=Math.abs(t-(r+c));if(u>c+i)return!1;if(l<=a||u<=c)return!0;const h=l-a,d=u-c;return h*h+d*d<=i*i}}const Ws={};function Ys(e,t,i={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writable:!1}),Ws[t]={klass:e,omit:i.omit||[]}}Ys(Object,"Object"),Ys(qs,"Grid"),delete Pe.prototype.constructor,Ys(mn,"Color"),Ys(Un,"Formatted"),Ys(Vn,"FormattedSection"),Ys(Gn,"ResolvedImage"),Ys(Hs,"StylePropertyFunction"),Ys(Ns,"StyleExpression",{omit:["_evaluator"]}),Ys(cn,"ImageId"),Ys(jn,"ImageVariant"),Ys(Gs,"ZoomDependentExpression"),Ys(js,"ZoomConstantExpression"),Ys(cr,"CompoundExpression",{omit:["_evaluate"]});for(const e in ms)Ws[ms[e]._classRegistryKey]||Ys(ms[e],`Expression${e}`);function Xs(e){return e&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}const Js={Error:Error,TypeError:TypeError,RangeError:RangeError,SyntaxError:SyntaxError,ReferenceError:ReferenceError,URIError:URIError,EvalError:EvalError},Ks=new Set(["message","stack","cause","errors","name","class"]);function Qs(e,t){if(null===e)return null;const i=typeof e;if("object"!==i)return"bigint"===i?{$name:"BigInt",value:e.toString()}:e;if(Array.isArray(e)){const i=e.length,n=[];n.length=i;for(let r=0;r<i;r++)n[r]=Qs(e[r],t);return n}if(ArrayBuffer.isView(e))return t&&t.add(e.buffer),e;if(Xs(e)||e instanceof ImageBitmap)return t&&t.add(e),e;if(e instanceof ImageData)return t&&t.add(e.data.buffer),e;if(e instanceof Map){const i={$name:"Map",entries:[]};for(const[n,r]of e.entries())i.entries.push(Qs(n),Qs(r,t));return i}if(e instanceof Headers)return{$name:"Headers",entries:[...e]};if(e instanceof Set){const t={$name:"Set"};let i=0;for(const n of e.values())t[++i]=Qs(n);return t}if(e instanceof Date||e instanceof RegExp||e instanceof Boolean||e instanceof Number||e instanceof String)return e;if(e instanceof Error){const i=e,n=i.constructor&&i.constructor.name||"Error",r={$name:"$Error",class:i instanceof li?"AJAXError":i instanceof DOMException?"DOMException":i instanceof AggregateError?"AggregateError":Js[n]?n:"Error",name:i.name,message:i.message};i.stack&&(r.stack=i.stack),"cause"in i&&i.cause!==i&&(r.cause=Qs(i.cause,t)),i instanceof AggregateError&&(r.errors=i.errors.filter(e=>e!==i).map(e=>Qs(e,t)));const o=i;for(const e in o)Object.hasOwn(o,e)&&(Ks.has(e)||(r[e]=Qs(o[e],t)));return r}const n=e.constructor||Object,r=n._classRegistryKey;if(!r)throw new Error(`Can't serialize object of unregistered class "${n.name}".`);const o=n.serialize?n.serialize(e,t):{};if(!n.serialize){const i=Ws[r].omit,n=e;for(const e in n)Object.hasOwn(n,e)&&(i.includes(e)||(o[e]=Qs(n[e],t)))}if(o.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(o.$name=r),o}function ea(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e)){for(let t=0;t<e.length;t++)e[t]=ea(e[t]);return e}if(ArrayBuffer.isView(e)||Xs(e)||e instanceof ImageBitmap||e instanceof ImageData||e instanceof Date||e instanceof RegExp||e instanceof Boolean||e instanceof Number||e instanceof String)return e;const t=e.$name||"Object";if("Map"===t){const t=e.entries||[],i=new Map;for(let e=0;e<t.length;e+=2)i.set(ea(t[e]),ea(t[e+1]));return i}if("Headers"===t)return new Headers(e.entries);if("Set"===t){const t=new Set;for(const i in e)"$name"!==i&&t.add(ea(e[i]));return t}if("BigInt"===t)return BigInt(e.value);if("$Error"===t){const t=e.class||"Error",i=e.name||t,n=e.message||"";let r;r="DOMException"===t?new DOMException(n,i):"AggregateError"===t?new AggregateError((e.errors||[]).map(ea),n):"AJAXError"===t?new li(e.statusText,e.status,e.url):new(Js[t]||Error)(n),"DOMException"!==t&&(r.name=i),e.stack&&(r.stack=e.stack),"cause"in e&&(r.cause=ea(e.cause));const o=r;for(const t in e)Object.hasOwn(e,t)&&("$name"===t||Ks.has(t)||(o[t]=ea(e[t])));return r}const{klass:i}=Ws[t];if(!i)throw new Error(`Can't deserialize unregistered class "${t}".`);if(i.deserialize)return i.deserialize(e);const n=Object.create(i.prototype);for(const t in e)"$name"!==t&&(n[t]=ea(e[t]));return n}const ta=e=>e>=1536&&e<=1791,ia=e=>e>=1872&&e<=1919,na=e=>e>=2208&&e<=2303,ra=e=>e>=11904&&e<=12031,oa=e=>e>=12032&&e<=12255,sa=e=>e>=12272&&e<=12287,aa=e=>e>=12288&&e<=12351,la=e=>e>=12352&&e<=12447,ca=e=>e>=12448&&e<=12543,ua=e=>e>=12544&&e<=12591,ha=e=>e>=12704&&e<=12735,da=e=>e>=12736&&e<=12783,fa=e=>e>=12784&&e<=12799,pa=e=>e>=12800&&e<=13055,ma=e=>e>=13056&&e<=13311,_a=e=>e>=13312&&e<=19903,ga=e=>e>=19968&&e<=40959,ya=e=>e>=40960&&e<=42127,va=e=>e>=42128&&e<=42191,xa=e=>e>=44032&&e<=55215,ba=e=>e>=63744&&e<=64255,wa=e=>e>=64336&&e<=65023,Ta=e=>e>=65040&&e<=65055,Ea=e=>e>=65072&&e<=65103,Sa=e=>e>=65104&&e<=65135,Ia=e=>e>=65136&&e<=65279,Aa=e=>e>=65280&&e<=65519;function Ma(e){for(const t of e)if(Da(t.charCodeAt(0)))return!0;return!1}function Ca(e){return!(ta(e)||ia(e)||na(e)||wa(e)||Ia(e))}function Da(e){return!(746!==e&&747!==e&&(e<4352||!(ha(e)||ua(e)||Ea(e)&&!(e>=65097&&e<=65103)||ba(e)||ma(e)||ra(e)||da(e)||!(!aa(e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||_a(e)||ga(e)||pa(e)||(e=>e>=12592&&e<=12687)(e)||(e=>e>=43360&&e<=43391)(e)||(e=>e>=55216&&e<=55295)(e)||(e=>e>=4352&&e<=4607)(e)||xa(e)||la(e)||sa(e)||(e=>e>=12688&&e<=12703)(e)||oa(e)||fa(e)||ca(e)&&12540!==e||!(!Aa(e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!Sa(e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||(e=>e>=5120&&e<=5759)(e)||(e=>e>=6320&&e<=6399)(e)||Ta(e)||(e=>e>=19904&&e<=19967)(e)||ya(e)||va(e))))}function Pa(e){return!(Da(e)||function(e){return!!((e=>e>=128&&e<=255)(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||(e=>e>=8192&&e<=8303)(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||(e=>e>=8448&&e<=8527)(e)||(e=>e>=8528&&e<=8591)(e)||(e=>e>=8960&&e<=9215)(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||(e=>e>=9216&&e<=9279)(e)&&9251!==e||(e=>e>=9280&&e<=9311)(e)||(e=>e>=9312&&e<=9471)(e)||(e=>e>=9632&&e<=9727)(e)||(e=>e>=9728&&e<=9983)(e)&&!(e>=9754&&e<=9759)||(e=>e>=11008&&e<=11263)(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||aa(e)||ca(e)||(e=>e>=57344&&e<=63743)(e)||Ea(e)||Sa(e)||Aa(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function Ra(e){return e>=1424&&e<=2303||wa(e)||Ia(e)}function La(e,t){return!(!t&&Ra(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||(e=>e>=6016&&e<=6143)(e))}function za(e){for(const t of e)if(Ra(t.charCodeAt(0)))return!0;return!1}const Fa={unavailable:"unavailable",deferred:"deferred",loading:"loading",parsing:"parsing",parsed:"parsed",loaded:"loaded",error:"error"};let Oa=null,ka=Fa.unavailable,Ba=null;const Na=function(e){e&&(ka=Fa.error),Oa&&Oa(e)};function Va(){Ua.fire(new rn("pluginStateChange",{pluginStatus:ka,pluginURL:Ba}))}const Ua=new ln,ja=function(){return ka},Ga=function(){if(ka!==Fa.deferred||!Ba)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ka=Fa.loading,Va(),Ba&&_i({url:Ba}).then(()=>{ka=Fa.loaded,Va()}).catch(e=>{Na(e)})},$a={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>ka===Fa.loaded||null!=$a.applyArabicShaping,isLoading:()=>ka===Fa.loading,setState(e){ka=e.pluginStatus,Ba=e.pluginURL},isParsing:()=>ka===Fa.parsing,isParsed:()=>ka===Fa.parsed,getPluginURL:()=>Ba};class Ha{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch,this.brightness=t.brightness,this.worldview=t.worldview,this.activeFloors=t.activeFloors):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(e,t){for(const i of e)if(!La(i.charCodeAt(0),t))return!1;return!0}(e,$a.isLoaded())}}class Za{constructor(e,t,i,n,r){this.property=e,this.value=t,this.expression=function(e,t,i,n,r){if(Ps(e))return new Hs(e,t);if(Vs(e)||Array.isArray(e)&&e.length>0){const o=$s(e,t,i,n,r);if("error"===o.result)throw new Error(o.value.map(e=>`${e.key}: ${e.message}`).join(", "));return o.value}{let i=e;return"string"==typeof e&&"color"===t.type&&(i=mn.parse(e)),{kind:"constant",configDependencies:new Set,isIndoorDependent:!1,evaluate:()=>i}}}(void 0===t?e.specification.default:t,e.specification,i,n,r)}isIndoorDependent(){return this.expression.isIndoorDependent}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,i,n){return this.property.possiblyEvaluate(this,e,t,i,n)}}class qa{constructor(e,t,i,n){this.property=e,this.value=new Za(e,void 0,t,i,n)}transitioned(e,t){return new Ya(this.property,this.value,t,{...e.transition,...this.transition},e.now)}untransitioned(){return new Ya(this.property,this.value,null,{},0)}}class Wa{constructor(e,t,i,n){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=t,this._options=i,this._iconImageUseTheme=n,this._isIndoorDependent=!1,this.configDependencies=new Set}getValue(e){return pt(this._values[e].value.value)}setValue(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new qa(this._values[e].property,this._scope,this._options,this._iconImageUseTheme)),this._values[e].value=new Za(this._values[e].property,null===t?void 0:pt(t),this._scope,this._options,this._iconImageUseTheme),this._values[e].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].value.expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[e].value.isIndoorDependent())}setTransitionOrValue(e,t){t&&(this._options=t);const i=this._properties.properties;if(e)for(const t in e){const n=e[t];if(t.endsWith("-transition")){const e=t.slice(0,-11);i[e]&&this.setTransition(e,n)}else Object.hasOwn(i,t)&&this.setValue(t,n)}}getTransition(e){return pt(this._values[e].transition)}setTransition(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new qa(this._values[e].property)),this._values[e].transition=pt(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const i=this.getValue(t);void 0!==i&&(e[t]=i);const n=this.getTransition(t);void 0!==n&&(e[`${t}-transition`]=n)}return e}transitioned(e,t){const i=new Xa(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].transitioned(e,t._values[n]);return i}untransitioned(){const e=new Xa(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}isIndoorDependent(){return this._isIndoorDependent}}class Ya{constructor(e,t,i,n,r){const o=n.delay||0,s=n.duration||0;r=r||0,this.property=e,this.value=t,this.begin=r+o,this.end=this.begin+s,e.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(e,t,i){const n=e.now||0,r=this.value.possiblyEvaluate(e,t,i),o=this.prior;if(o){if(n>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(n<this.begin)return o.possiblyEvaluate(e,t,i);{const s=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,i),r,et(s))}}return r}}class Xa{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,i){const n=new Qa(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].possiblyEvaluate(e,t,i);return n}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Ja{constructor(e,t,i,n){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=t,this._options=i,this._iconImageUseTheme=n,this._isIndoorDependent=!1,this.configDependencies=new Set}getValue(e){return pt(this._values[e].value)}setValue(e,t){this._values[e]=new Za(this._values[e].property,null===t?void 0:pt(t),this._scope,this._options,this._iconImageUseTheme),this._values[e].expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[e].isIndoorDependent())}serialize(){const e={};for(const t of Object.keys(this._values)){const i=this.getValue(t);void 0!==i&&(e[t]=i)}return e}possiblyEvaluate(e,t,i,n){const r=new Qa(this._properties);for(const o of Object.keys(this._values))r._values[o]=this._values[o].possiblyEvaluate(e,t,i,n);return r}isIndoorDependent(){return this._isIndoorDependent}}class Ka{constructor(e,t,i,n){this.property=e,this.value=t,this.parameters=i,this.iconImageUseTheme=n}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,i,n,r){return this.property.evaluate(this.value,this.parameters,e,t,i,n,this.iconImageUseTheme,r)}}class Qa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class el{constructor(e){this.specification=e}possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,i){const n=xn[this.specification.type];return n?n(e,t,i):e}}class tl{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,i,n,r){return"constant"===e.expression.kind||"camera"===e.expression.kind?new Ka(this,{kind:"constant",value:e.expression.evaluate(t,null,{},i,n,void 0,r)},t):new Ka(this,e.expression,t,r)}interpolate(e,t,i){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Ka(this,{kind:"constant",value:void 0},e.parameters);const n=xn[this.specification.type];return n?new Ka(this,{kind:"constant",value:n(e.value.value,t.value.value,i)},e.parameters):e}evaluate(e,t,i,n,r,o,s,a){return"constant"===e.kind?e.value:e.evaluate(t,i,n,r,o,a,s)}}class il{constructor(e){this.specification=e}possiblyEvaluate(e,t,i,n){return!!e.expression.evaluate(t,null,{},i,n)}interpolate(){return!1}}class nl{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new Ha(0,{});for(const i in e){const n=e[i],r=n.specification;r&&r.overridable&&this.overridableProperties.push(i);const o=this.defaultPropertyValues[i]=new Za(n,void 0),s=this.defaultTransitionablePropertyValues[i]=new qa(n);this.defaultTransitioningPropertyValues[i]=s.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=o.possiblyEvaluate(t)}}}Ys(tl,"DataDrivenProperty"),Ys(el,"DataConstantProperty"),Ys(il,"ColorRampProperty");var rl=
vendor: 18,779 bytes, line 2
2JSON.parse('{"expression":1,"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"appearance":{"condition":{"type":"boolean","expression":{"interpolated":1,"parameters":["distance-from-center","feature","feature-state","measure-light","pitch","zoom"]},"property-type":"data-driven"},"name":{"type":"string"},"properties":{"type":"*"}},"function":{"type":{"type":"enum","default":"exponential","values":{"identity":1,"exponential":1,"interval":1,"categorical":1}},"default":{"type":"*"},"expression":1,"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"colorSpace":{"type":"enum","default":"rgb","values":{"rgb":1,"lab":1,"hcl":1}}},"$version":8,"$root":{"transition":{"type":"transition"},"version":{"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"snow":{"type":"snow"},"rain":{"type":"rain"},"camera":{"type":"camera"},"color-theme":{"type":"colorTheme"},"indoor":{"type":"indoor"},"imports":{"type":"array","value":"import"},"iconsets":{"type":"iconsets"},"schema":{"type":"schema"},"sources":{"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"projection":{"type":"projection"},"layers":{"type":"array","value":"layer"},"models":{"type":"models"},"featuresets":{"type":"featuresets"}},"featuresets":{"*":{"type":"featureset"}},"featureset":{"metadata":{"type":"*"},"selectors":{"type":"array","value":"selector"}},"selector":{"layer":{"type":"string"},"properties":{"type":"selectorProperty"},"featureNamespace":{"type":"string"},"_uniqueFeatureID":{"type":"boolean"}},"selectorProperty":{"*":{"type":"*"}},"model":{"type":"string"},"import":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"config"},"data":{"type":"$root"},"color-theme":{"type":"colorTheme","optional":true}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1,"object":{}}},"default":{"type":"*","expression":1},"values":{"type":"array","value":"*"},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}},"id":{"type":"string"},"properties":{"type":"properties"}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"use-theme":1},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"cast-shadows":{"type":"boolean","default":false},"shadow-quality":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"parameters":["zoom"]}},"shadow-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"shadow-draw-before-layer":{"type":"string"}},"properties_light_ambient":{"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"use-theme":1},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"use-theme":1},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"iconsets":{"*":{"type":"iconset"}},"iconset":["iconset_sprite","iconset_source"],"iconset_sprite":{"type":{"type":"enum","values":{"sprite":1}},"url":{"type":"string"}},"iconset_source":{"type":{"type":"enum","values":{"source":1}},"source":{"type":"string"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"type":"enum","values":{"vector":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","default":[-180,-85.051129,180,85.051129],"length":4,"value":"number"},"extra_bounds":{"type":"array","value":{"type":"array","length":4,"value":"number"}},"scheme":{"type":"enum","default":"xyz","values":{"xyz":1,"tms":1}},"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":{"type":"enum","values":{"raster":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","default":[-180,-85.051129,180,85.051129],"length":4,"value":"number"},"extra_bounds":{"type":"array","value":{"type":"array","length":4,"value":"number"}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"scheme":{"type":"enum","default":"xyz","values":{"xyz":1,"tms":1}},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"type":"enum","values":{"raster-dem":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","default":[-180,-85.051129,180,85.051129],"length":4,"value":"number"},"extra_bounds":{"type":"array","value":{"type":"array","length":4,"value":"number"}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"encoding":{"type":"enum","default":"mapbox","values":{"terrarium":1,"mapbox":1}},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"type":"enum","values":{"raster-array":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","default":[-180,-85.051129,180,85.051129],"length":4,"value":"number"},"extra_bounds":{"type":"array","value":{"type":"array","length":4,"value":"number"}},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"minimum":0,"maximum":512},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"type":"enum","values":{"video":1}},"urls":{"type":"array","value":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"type":"enum","values":{"image":1}},"url":{"type":"string"},"coordinates":{"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"modelNodeOverride":{"orientation":{"type":"array","default":[0,0,0],"length":3,"value":"number"}},"modelLightOverrides":{"light-ambient-color":{"type":"color"},"light-ambient-intensity":{"type":"number"},"light-directional-color":{"type":"color"},"light-directional-intensity":{"type":"number"}},"modelNodeOverrides":{"*":{"type":"modelNodeOverride"}},"modelMaterialOverride":{"model-color":{"type":"color"},"model-color-mix-intensity":{"type":"number"},"model-opacity":{"type":"number"},"model-emissive-strength":{"type":"number"}},"modelMaterialOverrides":{"*":{"type":"modelMaterialOverride"}},"modelSourceModel":{"uri":{"type":"string"},"position":{"type":"array","default":[0,0],"minimum":[-180,-90],"maximum":[180,90],"length":2,"value":"number"},"orientation":{"type":"array","default":[0,0,0],"length":3,"value":"number"},"lightOverrides":{"type":"modelLightOverrides"},"nodeOverrides":{"type":"modelNodeOverrides"},"materialOverrides":{"type":"modelMaterialOverrides"},"nodeOverrideNames":{"type":"array","value":"string"},"materialOverrideNames":{"type":"array","value":"string"},"featureProperties":{"type":"*"}},"modelSourceModels":{"*":{"type":"modelSourceModel"}},"source_model":{"type":{"type":"enum","values":{"model":1,"batched-model":1}},"url":{"type":"string"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"},"models":{"type":"modelSourceModels"}},"layer":{"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"building":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{},"placement-group":{},"clip":{}}},"id":{"type":"string"},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"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"},"appearances":{"type":"array","value":"appearance"}},"layout":["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_building","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_sky":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_model":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1},"model-id":{"type":"string","default":"","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"model-allow-density-reduction":{"type":"boolean","default":true}},"layout_clip":{"clip-layer-types":{"type":"array","default":[],"value":"enum","values":{"model":1,"symbol":1},"expression":1},"clip-layer-scope":{"type":"array","default":[],"value":"string","expression":1},"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1},"fill-elevation-reference":{"type":"enum","default":"none","values":{"none":1,"hd-road-base":1,"hd-road-markup":1},"expression":1},"fill-construct-bridge-guard-rail":{"type":"boolean","default":"true","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"circle-elevation-reference":{"type":"enum","default":"none","values":{"none":1,"hd-road-markup":1},"expression":1},"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_heatmap":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_fill-extrusion":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1},"fill-extrusion-edge-radius":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"source-max-zoom":{"type":"number","minimum":0,"maximum":24}},"layout_building":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1},"building-facade":{"type":"boolean","default":false,"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-facade-floors":{"type":"number","default":3,"minimum":1,"maximum":200,"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-facade-unit-width":{"type":"number","default":3.1,"minimum":1,"maximum":20,"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-facade-window":{"type":"array","default":[0.9,0.9],"minimum":0.1,"maximum":1,"length":2,"value":"number","expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-roof-shape":{"type":"enum","default":"flat","values":{"flat":1,"hipped":1,"gabled":1,"parapet":1,"mansard":1,"skillion":1,"pyramidal":1},"expression":{"parameters":["feature"]},"property-type":"data-driven"},"building-height":{"type":"number","default":0,"minimum":0,"expression":1,"transition":1,"property-type":"data-driven"},"building-base":{"type":"number","default":0,"minimum":0,"expression":1,"transition":1,"property-type":"data-driven"},"building-flood-light-wall-radius":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"building-flood-light-ground-radius":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"building-flip-roof-orientation":{"type":"boolean","default":false,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"}},"layout_line":{"line-cap":{"type":"enum","default":"butt","values":{"butt":1,"round":1,"square":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-join":{"type":"enum","default":"miter","values":{"bevel":1,"round":1,"miter":1,"none":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":1,"parameters":["zoom"]}},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":1,"parameters":["zoom"]}},"line-sort-key":{"type":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","default":0,"expression":{"parameters":["feature","line-progress","zoom"]},"property-type":"data-driven"},"line-elevation-reference":{"type":"enum","default":"none","values":{"none":1,"sea":1,"ground":1,"hd-road-markup":1},"expression":1},"line-cross-slope":{"type":"number","expression":1},"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1},"line-width-unit":{"type":"enum","default":"pixels","values":{"pixels":1,"meters":1},"expression":{"parameters":["zoom"]}},"line-elevation-ground-scale":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","line-progress","zoom"]},"transition":1,"property-type":"data-driven"}},"layout_symbol":{"symbol-placement":{"type":"enum","default":"point","values":{"point":1,"line":1,"line-center":1},"expression":{"parameters":["zoom"]}},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":1,"parameters":["zoom"]}},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-sort-key":{"type":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","default":"auto","values":{"auto":1,"viewport-y":1,"source":1},"expression":{"parameters":["zoom"]}},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"symbol-elevation-reference":{"type":"enum","default":"ground","values":{"sea":1,"ground":1,"hd-road-markup":1},"expression":{"parameters":["zoom"]}},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-rotation-alignment":{"type":"enum","default":"auto","values":{"map":1,"viewport":1,"auto":1},"expression":{"parameters":["zoom"]}},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"icon-size-scale-range":{"type":"array","default":[0.8,2],"minimum":[0.1,0.1],"maximum":[10,10],"length":2,"value":"number","expression":1},"icon-text-fit":{"type":"enum","default":"none","values":{"none":1,"width":1,"height":1,"both":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","default":[0,0,0,0],"length":4,"value":"number","expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"use-theme":1,"property-type":"data-driven","appearance":1,"tokens":1},"icon-rotate":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]}},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"icon-offset":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"icon-anchor":{"type":"enum","default":"center","values":{"center":1,"left"
vendor: 23,040 bytes, line 2
2:1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","default":"auto","values":{"map":1,"viewport":1,"auto":1},"expression":{"parameters":["zoom"]}},"text-pitch-alignment":{"type":"enum","default":"auto","values":{"map":1,"viewport":1,"auto":1},"expression":{"parameters":["zoom"]}},"text-rotation-alignment":{"type":"enum","default":"auto","values":{"map":1,"viewport":1,"auto":1},"expression":{"parameters":["zoom"]}},"text-field":{"type":"formatted","default":"","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven","tokens":1},"text-font":{"type":"array","default":["Open Sans Regular","Arial Unicode MS Regular"],"value":"string","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"text-size-scale-range":{"type":"array","default":[0.8,2],"minimum":[0.1,0.1],"maximum":[10,10],"length":2,"value":"number","expression":1},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-justify":{"type":"enum","default":"center","values":{"auto":1,"left":1,"center":1,"right":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]}},"text-anchor":{"type":"enum","default":"center","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":1,"parameters":["zoom"]}},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]}},"text-rotate":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]}},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"text-transform":{"type":"enum","default":"none","values":{"none":1,"uppercase":1,"lowercase":1},"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"text-offset":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["feature","zoom"]},"property-type":"data-driven","appearance":1},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]}},"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_raster":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_raster-particle":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"layout_hillshade":{"visibility":{"type":"enum","default":"visible","values":{"visible":1,"none":1},"expression":1}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"expression":{"parameters":["distance-from-center","feature","pitch","zoom"]},"property-type":"data-driven"},"filter_fill":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_hillshade":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_raster":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_raster-particle":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_clip":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_model":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_line":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_circle":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_fill-extrusion":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_building":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_heatmap":{"type":"boolean","default":false,"expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"function_stop":{"type":"array","minimum":0,"maximum":24,"length":2,"value":["number","color"]},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"high-color":{"type":"color","default":"#245cdf","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"space-color":{"type":"color","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"horizon-blend":{"type":"number","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"star-intensity":{"type":"number","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1}},"snow":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"center-thinning":{"type":"number","default":0.4,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"flake-size":{"type":"number","default":0.71,"minimum":0,"maximum":5,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1}},"rain":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"opacity":{"type":"number","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette-color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"center-thinning":{"type":"number","default":0.57,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"distortion-strength":{"type":"number","default":0.7,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1}},"camera":{"camera-projection":{"type":"enum","default":"perspective","values":{"perspective":1,"orthographic":1}}},"colorTheme":{"data":{"type":"string","expression":1}},"indoor_source":{"sourceId":{"type":"string"},"sourceLayers":{"type":"array","value":"string"}},"indoor":{"*":{"type":"indoor_source"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"use-theme":1},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"projection":{"name":{"type":"enum","default":"mercator","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1}},"center":{"type":"array","minimum":[-180,-90],"maximum":[180,90],"length":2,"value":"number"},"parallels":{"type":"array","minimum":[-90,-90],"maximum":[90,90],"length":2,"value":"number"}},"terrain":{"source":{"type":"string"},"exaggeration":{"type":"number","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_building","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-outline-color":{"type":"color","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"fill-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"fill-z-offset":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"transition":1,"property-type":"data-driven"},"fill-bridge-guard-rail-color":{"type":"color","default":"rgba(241, 236, 225, 255)","expression":{"interpolated":1,"parameters":["feature","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-tunnel-structure-color":{"type":"color","default":"rgba(241, 236, 225, 255)","expression":{"interpolated":1,"parameters":["feature","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"fill-extrusion-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","default":"flat","values":{"terrain":1,"flat":1}},"fill-extrusion-base-alignment":{"type":"enum","default":"terrain","values":{"terrain":1,"flat":1}},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-wall-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-flood-light-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"fill-extrusion-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"fill-extrusion-flood-light-wall-radius":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-flood-light-ground-radius":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-vertical-scale":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"fill-extrusion-front-cutoff":{"type":"array","default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]}},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true}},"paint_building":{"building-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"parameters":[]},"transition":1},"building-ambient-occlusion-ground-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-vertical-scale":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-cast-shadows":{"type":"boolean","default":true},"building-color":{"type":"color","default":"rgba(193, 154, 127, 1)","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"use-theme":1,"property-type":"data-driven"},"building-emissive-strength":{"type":"number","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-facade-emissive-chance":{"type":"number","default":0.35,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"building-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"building-front-cutoff":{"type":"array","default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]}},"building-flood-light-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"building-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"building-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"line-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"line-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"line-width":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","line-progress","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"}
vendor: 19,045 bytes, line 2
2,"line-blur":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-dasharray":{"type":"array","minimum":0,"value":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"line-gradient":{"type":"color","expression":{"interpolated":1,"parameters":["line-progress"]},"use-theme":1},"line-trim-offset":{"type":"array","default":[0,0],"minimum":[0,0],"maximum":[1,1],"length":2,"value":"number"},"line-trim-fade-range":{"type":"array","default":[0,0],"minimum":[0,0],"maximum":[1,1],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"line-trim-color":{"type":"color","default":"transparent","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["line-progress","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-border-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"line-border-color":{"type":"color","default":"rgba(0, 0, 0, 0)","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"line-border-gradient":{"type":"color","expression":{"interpolated":1,"parameters":["line-progress"]},"use-theme":1},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"line-blend-mode":{"type":"enum","default":"default","values":{"default":1,"multiply":1,"additive":1},"expression":{"parameters":["zoom"]}},"line-blend-additive-clamp":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]}},"line-cutout-depth":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"circle-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"circle-pitch-scale":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"circle-pitch-alignment":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"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"],"expression":{"interpolated":1,"parameters":["heatmap-density"]},"use-theme":1},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1},"icon-halo-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"appearance":1},"icon-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"icon-image-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1,"overridable":1},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1},"text-halo-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-halo-blur":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"appearance":1},"text-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":1},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":1},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":1},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"placement-priority":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["distance-from-center","feature","feature-state","measure-light","pitch","zoom"]},"property-type":"data-driven","appearance":1},"placement-group":{"type":"string","expression":{"parameters":["distance-from-center","feature","feature-state","measure-light","pitch","zoom"]},"property-type":"data-driven","appearance":1}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-color":{"type":"color","expression":{"interpolated":1,"parameters":["raster-value"]},"use-theme":1},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-color-range":{"type":"array","length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-color-scale":{"type":"enum","default":"linear","values":{"linear":1,"log":1},"expression":{"parameters":[]}},"raster-hue-rotate":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-resampling":{"type":"enum","default":"linear","values":{"linear":1,"nearest":1},"expression":{"parameters":["zoom"]}},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]}},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"raster-array-band":{"type":"string"},"raster-elevation":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-elevation-reference":{"type":"enum","default":"sea","values":{"sea":1,"ground":1},"expression":1}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string"},"raster-particle-count":{"type":"number","default":512,"minimum":1},"raster-particle-color":{"type":"color","expression":{"interpolated":1,"parameters":["raster-particle-speed"]},"use-theme":1},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":1,"parameters":["zoom"]}},"hillshade-illumination-anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"hillshade-shadow-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"hillshade-accent-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1}},"paint_background":{"background-pitch-alignment":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":[]}},"background-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]}},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1}},"paint_sky":{"sky-type":{"type":"enum","default":"atmosphere","values":{"gradient":1,"atmosphere":1},"expression":{"parameters":["zoom"]}},"sky-atmosphere-sun":{"type":"array","minimum":[0,0],"maximum":[360,180],"length":2,"value":"number","expression":{"parameters":["zoom"]}},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100},"sky-gradient-center":{"type":"array","default":[0,0],"minimum":[0,0],"maximum":[360,180],"length":2,"value":"number","expression":{"parameters":["zoom"]}},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]}},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":1,"parameters":["sky-radial-progress"]},"use-theme":1},"sky-atmosphere-halo-color":{"type":"color","default":"white","use-theme":1},"sky-atmosphere-color":{"type":"color","default":"white","use-theme":1},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-rotation":{"type":"array","default":[0,0,0],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-scale":{"type":"array","default":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-translation":{"type":"array","default":[0,0,0],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"model-color-mix-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"transition":1,"property-type":"data-driven"},"model-type":{"type":"enum","default":"common-3d","values":{"common-3d":1,"location-indicator":1}},"model-cast-shadows":{"type":"boolean","default":true},"model-receive-shadows":{"type":"boolean","default":true},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"model-emissive-strength":{"type":"number","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"transition":1,"property-type":"data-driven"},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"transition":1,"property-type":"data-driven"},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"model-front-cutoff":{"type":"array","default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]}},"model-elevation-reference":{"type":"enum","default":"ground","values":{"sea":1,"ground":1,"hd-road-markup":1},"expression":1},"model-line-cutout-mode":{"type":"enum","default":"enabled","values":{"enabled":1,"disabled":1,"enabled-above-cutout":1},"expression":1}},"promoteId":{"*":{"type":"*"}}}');
vendor: 11,480 bytes, line 2
2function ol(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function sl(e){if(Array.isArray(e))return e.map(sl);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={},i=e;for(const e in i)t[e]=sl(i[e]);return t}return ol(e)}function al(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!al(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function ll(e,t="",i=null,n="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};al(e)||(e=ml(e));const r=e;let o=!0;try{o=function(e){if(!hl(e))return e;let t=sl(e);return ul(t),t=cl(t),t}(r)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}let s=null,a=null;if("background"!==n&&"sky"!==n&&"slot"!==n){a=rl[`filter_${n}`];const e=Us(o,a,t,i);if("error"===e.result)throw new Error(e.value.map(e=>`${e.key}: ${e.message}`).join(", "));s=(t,i,n)=>e.value.evaluate(t,i,{},n)}let l=null,c=null;if(o!==r){const e=Us(r,a,t,i);if("error"===e.result)throw new Error(e.value.map(e=>`${e.key}: ${e.message}`).join(", "));l=(t,i,n,r,o)=>e.value.evaluate(t,i,{},n,void 0,void 0,r,o),c=!zr(e.value.expression)}return{filter:s,dynamicFilter:l||void 0,needGeometry:pl(o),needFeature:!!c}}function cl(e){if(!Array.isArray(e))return e;const t=function(e){if(dl.has(e[0]))for(let t=1;t<e.length;t++)if(hl(e[t]))return!0;return e}(e);return!0===t?t:t.map(e=>cl(e))}function ul(e){let t=!1;const i=[];if("case"===e[0]){for(let n=1;n<e.length-1;n+=2)t=t||hl(e[n]),i.push(e[n+1]);i.push(e.at(-1))}else if("match"===e[0]){t=t||hl(e[1]);for(let t=2;t<e.length-1;t+=2)i.push(e[t+1]);i.push(e.at(-1))}else if("step"===e[0]){t=t||hl(e[1]);for(let t=1;t<e.length-1;t+=2)i.push(e[t+1])}t&&(e.length=0,e.push("any",...i));for(let t=1;t<e.length;t++)ul(e[t])}function hl(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(hl(e[t]))return!0;return!1}const dl=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function fl(e,t){return e<t?-1:e>t?1:0}function pl(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(pl(e[t]))return!0;return!1}function ml(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?_l(e[1],e[2],"=="):"!="===t?vl(_l(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?_l(e[1],e[2],t):"any"===t?(i=e.slice(1),["any"].concat(i.map(ml))):"all"===t?["all"].concat(e.slice(1).map(ml)):"none"===t?["all"].concat(e.slice(1).map(ml).map(vl)):"in"===t?gl(e[1],e.slice(2)):"!in"===t?vl(gl(e[1],e.slice(2))):"has"===t?yl(e[1]):"!has"!==t||vl(yl(e[1]));var i}function _l(e,t,i){switch(e){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,e,t]}}function gl(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?["filter-in-large",e,["literal",t.sort(fl)]]:["filter-in-small",e,["literal",t]]}}function yl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function vl(e){return["!",e]}const xl="�";function bl(e,t){return t?`${e}${xl}${t}`:e}function wl(e){const t=e.indexOf(xl);return t>=0?e.slice(t+1):""}let Tl,El=1;const Sl=()=>Tl||(Tl=new nl({"icon-size":new tl(rl.layout_symbol["icon-size"]),"icon-image":new tl(rl.layout_symbol["icon-image"]),"icon-rotate":new tl(rl.layout_symbol["icon-rotate"]),"icon-offset":new tl(rl.layout_symbol["icon-offset"]),"text-size":new tl(rl.layout_symbol["text-size"]),"text-rotate":new tl(rl.layout_symbol["text-rotate"]),"text-offset":new tl(rl.layout_symbol["text-offset"])}));let Il;const Al=()=>Il||(Il=new nl({"icon-opacity":new tl(rl.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new tl(rl.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new tl(rl.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new tl(rl.paint_symbol["text-emissive-strength"]),"icon-color":new tl(rl.paint_symbol["icon-color"]),"icon-halo-color":new tl(rl.paint_symbol["icon-halo-color"]),"icon-halo-width":new tl(rl.paint_symbol["icon-halo-width"]),"icon-halo-blur":new tl(rl.paint_symbol["icon-halo-blur"]),"icon-translate":new tl(rl.paint_symbol["icon-translate"]),"text-opacity":new tl(rl.paint_symbol["text-opacity"]),"text-occlusion-opacity":new tl(rl.paint_symbol["text-occlusion-opacity"]),"text-color":new tl(rl.paint_symbol["text-color"],{runtimeType:An,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new tl(rl.paint_symbol["text-halo-color"]),"text-halo-width":new tl(rl.paint_symbol["text-halo-width"]),"text-halo-blur":new tl(rl.paint_symbol["text-halo-blur"]),"text-translate":new tl(rl.paint_symbol["text-translate"]),"symbol-z-offset":new tl(rl.paint_symbol["symbol-z-offset"]),"placement-priority":new tl(rl.paint_symbol["placement-priority"]),"placement-group":new tl(rl.paint_symbol["placement-group"]),"icon-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}));class Ml{constructor(e,t,i,n,r,o){this._conditionSpec=e,this._propertiesSpec=i;const s=Us(e,rl.appearance.condition);if("success"===s.result&&(this.condition=s.value),this.name=t,i){this.layoutProperties=new Qa(Sl()),this.unevaluatedLayout=new Ja(Sl(),n,r,o),this.paintProperties=new Qa(Al()),this.unevaluatedPaint=new Ja(Al(),n,r,"");for(const e in i)e in this.unevaluatedLayout._values?this.unevaluatedLayout.setValue(e,i[e]):e in this.unevaluatedPaint._values&&this.unevaluatedPaint.setValue(e,i[e])}}isActive(e){return!(this.condition||!e.isHidden||"hidden"!==this.name)||this.condition.evaluate(e.globals,e.feature,e.featureState,e.canonical)}getCondition(){return this.condition}getName(){return this.name}getLayoutProperty(e){return this.layoutProperties.get(e)}getPaintProperty(e){return this.paintProperties.get(e)}getUnevaluatedLayoutProperties(){return this.unevaluatedLayout}getUnevaluatedLayoutProperty(e){return this.unevaluatedLayout._values[e]}getUnevaluatedPaintProperty(e){return this.unevaluatedPaint._values[e]}recalculate(e,t,i){this.unevaluatedLayout&&(this.layoutProperties=this.unevaluatedLayout.possiblyEvaluate(e,void 0,t,i)),this.unevaluatedPaint&&(this.paintProperties=this.unevaluatedPaint.possiblyEvaluate(e,void 0,t,""))}serialize(){const e={};e.condition=this.condition.expression.serialize(),this.name&&(e.name=this.name);const t={...this.unevaluatedLayout?this.unevaluatedLayout.serialize():{},...this.unevaluatedPaint?this.unevaluatedPaint.serialize():{}};return Object.keys(t).length>0&&(e.properties=t),e}hasIconLayoutProperties(){const e=this.hasLayoutProperty("icon-image"),t=this.hasLayoutProperty("icon-size"),i=this.hasLayoutProperty("icon-offset"),n=this.hasLayoutProperty("icon-rotate");return e||t||i||n}hasTextLayoutProperties(){const e=this.hasLayoutProperty("text-size"),t=this.hasLayoutProperty("text-offset"),i=this.hasLayoutProperty("text-rotate");return e||t||i}hasIconPaintProperties(){return!!this.unevaluatedPaint&&Object.keys(this.unevaluatedPaint._values).filter(e=>!e.endsWith("-use-theme")).some(e=>(e.startsWith("icon-")||"symbol-z-offset"===e)&&this.hasPaintProperty(e))}hasTextPaintProperties(){return!!this.unevaluatedPaint&&Object.keys(this.unevaluatedPaint._values).filter(e=>!e.endsWith("-use-theme")).some(e=>(e.startsWith("text-")||"symbol-z-offset"===e)&&this.hasPaintProperty(e))}hasLayoutProperty(e){return this.unevaluatedLayout&&void 0!==this.unevaluatedLayout._values[e].value}hasPaintProperty(e){return this.unevaluatedPaint&&void 0!==this.unevaluatedPaint._values[e].value}}const Cl="-transition",Dl=new Set(["fill","line","background","hillshade","raster"]);class Pl extends ln{constructor(e,t,i,n,r,o){if(super(),this.id=e.id,this.fqid=bl(this.id,i),this.runtimeLayerUID=El++,this.type=e.type,this.scope=i,this.lut=n,this.options=r,this.iconImageUseTheme=o,this.appearances=new Array,this.appearancesVersion=0,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type&&"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type&&"placement-group"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),e.slot&&(this.slot=e.slot),e.appearances&&this.setAppearances(e.appearances),t.layout&&(this._unevaluatedLayout=new Ja(t.layout,this.scope,r,this.iconImageUseTheme)),t.paint)){this._transitionablePaint=new Wa(t.paint,this.scope,r);for(const t in e.paint)this.setPaintProperty(t,e.paint[t]);for(const t in e.layout)this.setLayoutProperty(t,e.layout[t]);this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Qa(t.paint)}}onAdd(e){}onRemove(e){}placeSymbols(e,t,i,n,r){}isDraped(e){return!this.is3D(!0)&&Dl.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){if("custom"===this.type&&"visibility"===e)return void(this.visibility=t);const i=this._unevaluatedLayout;i._properties.properties[e]&&(i.setValue(e,t),"visibility"===e&&this.possiblyEvaluateVisibility())}setAppearances(e){this.appearances=[],e.forEach(e=>{this.appearances.push(new Ml(e.condition,e.name,e.properties,this.scope,this.options,this.iconImageUseTheme))}),this.appearancesVersion++}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(e){return e.endsWith(Cl)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}isPaintProperty(e){return!!this._transitionablePaint._properties.properties[e]}setPaintProperty(e,t){const i=this._transitionablePaint,n=i._properties.properties;if(e.endsWith(Cl)){const r=e.slice(0,-11);return n[r]&&i.setTransition(r,t||void 0),!1}if(!n[e])return!1;const r=i._values[e],o=r.value.isDataDriven(),s=r.value;i.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);const a=i._values[e].value,l=a.isDataDriven(),c=e.endsWith("pattern")||"line-dasharray"===e;return l||o||c||this._handleOverridablePaintPropertyUpdate(e,s,a)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,t,i){return null}_handleOverridablePaintPropertyUpdate(e,t,i){return!1}
vendor: 22,140 bytes, line 2
2isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t,this.iconImageUseTheme)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){const e={id:this.id,type:this.type,slot:this.slot,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 0!==this.appearances.length&&(e.appearances=this.appearances.map(e=>e.serialize())),ft(e,(e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length))}is3D(e){return!1}hasElevation(){return!1}mayUse(e){return!1}prepare(){return Promise.resolve()}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}_clear(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Ka&&As(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}for(const e of this.appearances)if(!Fr(e.condition.expression))return!0;return!1}compileFilter(e){this._filterCompiled||(this._featureFilter=ll(this.filter,this.scope,e),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}dynamicFilterNeedsGeometry(){return this._featureFilter.needGeometry}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}getAppearances(){return this.appearances}queryRenderedFeatures(e,t,i){return{}}queryRadius(e){}queryIntersectsFeature(e,t,i,n,r,o,s,a,l,c){}}function Rl(e,t,i){if(!e._unevaluatedLayout)return!1;const n=e._unevaluatedLayout.getValue(t);return void 0!==n&&("string"!=typeof n||i(n))}function Ll(e,t,i=2){const n=t&&t.length,r=n?t[0]*i:e.length;let o=zl(e,0,r,i,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,c;if(n&&(o=function(e,t,i,n){const r=[];for(let i=0,o=t.length;i<o;i++){const s=zl(e,t[i]*n,i<o-1?t[i+1]*n:e.length,n,!1);s===s.next&&(s.steiner=!0),r.push(Hl(s))}r.sort(Ul);for(let e=0;e<r.length;e++)i=jl(r[e],i);return i}(e,t,o,i)),e.length>80*i){a=e[0],l=e[1];let t=a,n=l;for(let o=i;o<r;o+=i){const i=e[o],r=e[o+1];i<a&&(a=i),r<l&&(l=r),i>t&&(t=i),r>n&&(n=r)}c=Math.max(t-a,n-l),c=0!==c?32767/c:0}return Ol(o,s,i,a,l,c,0),s}function zl(e,t,i,n,r){let o;if(r===function(e,t,i,n){let r=0;for(let o=t,s=i-n;o<i;o+=n)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}(e,t,i,n)>0)for(let r=t;r<i;r+=n)o=ic(r/n|0,e[r],e[r+1],o);else for(let r=i-n;r>=t;r-=n)o=ic(r/n|0,e[r],e[r+1],o);return o&&Xl(o,o.next)&&(nc(o),o=o.next),o}function Fl(e,t){if(!e)return e;t||(t=e);let i,n=e;do{if(i=!1,n.steiner||!Xl(n,n.next)&&0!==Yl(n.prev,n,n.next))n=n.next;else{if(nc(n),n=t=n.prev,n===n.next)break;i=!0}}while(i||n!==t);return t}function Ol(e,t,i,n,r,o,s){if(!e)return;!s&&o&&function(e,t,i,n){let r=e;do{0===r.z&&(r.z=$l(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,i=1;do{let n,r=e;e=null;let o=null;for(t=0;r;){t++;let s=r,a=0;for(let e=0;e<i&&(a++,s=s.nextZ,s);e++);let l=i;for(;a>0||l>0&&s;)0!==a&&(0===l||!s||r.z<=s.z)?(n=r,r=r.nextZ,a--):(n=s,s=s.nextZ,l--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=s}o.nextZ=null,i*=2}while(t>1)}(r)}(e,n,r,o);let a=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(o?Bl(e,n,r,o):kl(e))t.push(l.i,e.i,c.i),nc(e),e=c.next,a=c.next;else if((e=c)===a){s?1===s?Ol(e=Nl(Fl(e),t),t,i,n,r,o,2):2===s&&Vl(e,t,i,n,r,o):Ol(Fl(e),t,i,n,r,o,1);break}}}function kl(e){const t=e.prev,i=e,n=e.next;if(Yl(t,i,n)>=0)return!1;const r=t.x,o=i.x,s=n.x,a=t.y,l=i.y,c=n.y,u=Math.min(r,o,s),h=Math.min(a,l,c),d=Math.max(r,o,s),f=Math.max(a,l,c);let p=n.next;for(;p!==t;){if(p.x>=u&&p.x<=d&&p.y>=h&&p.y<=f&&ql(r,a,o,l,s,c,p.x,p.y)&&Yl(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Bl(e,t,i,n){const r=e.prev,o=e,s=e.next;if(Yl(r,o,s)>=0)return!1;const a=r.x,l=o.x,c=s.x,u=r.y,h=o.y,d=s.y,f=Math.min(a,l,c),p=Math.min(u,h,d),m=Math.max(a,l,c),_=Math.max(u,h,d),g=$l(f,p,t,i,n),y=$l(m,_,t,i,n);let v=e.prevZ,x=e.nextZ;for(;v&&v.z>=g&&x&&x.z<=y;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=_&&v!==r&&v!==s&&ql(a,u,l,h,c,d,v.x,v.y)&&Yl(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=_&&x!==r&&x!==s&&ql(a,u,l,h,c,d,x.x,x.y)&&Yl(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=g;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=_&&v!==r&&v!==s&&ql(a,u,l,h,c,d,v.x,v.y)&&Yl(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=_&&x!==r&&x!==s&&ql(a,u,l,h,c,d,x.x,x.y)&&Yl(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Nl(e,t){let i=e;do{const n=i.prev,r=i.next.next;!Xl(n,r)&&Jl(n,i,i.next,r)&&ec(n,r)&&ec(r,n)&&(t.push(n.i,i.i,r.i),nc(i),nc(i.next),i=e=r),i=i.next}while(i!==e);return Fl(i)}function Vl(e,t,i,n,r,o){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&Wl(s,e)){let a=tc(s,e);return s=Fl(s,s.next),a=Fl(a,a.next),Ol(s,t,i,n,r,o,0),void Ol(a,t,i,n,r,o,0)}e=e.next}s=s.next}while(s!==e)}function Ul(e,t){let i=e.x-t.x;return 0===i&&(i=e.y-t.y,0===i)&&(i=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),i}function jl(e,t){const i=function(e,t){let i=t;const n=e.x,r=e.y;let o,s=-1/0;if(Xl(e,i))return i;do{if(Xl(e,i.next))return i.next;if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const e=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=n&&e>s&&(s=e,o=i.x<i.next.x?i:i.next,e===n))return o}i=i.next}while(i!==t);if(!o)return null;const a=o,l=o.x,c=o.y;let u=1/0;i=o;do{if(n>=i.x&&i.x>=l&&n!==i.x&&Zl(r<c?n:s,r,l,c,r<c?s:n,r,i.x,i.y)){const t=Math.abs(r-i.y)/(n-i.x);ec(i,e)&&(t<u||t===u&&(i.x>o.x||i.x===o.x&&Gl(o,i)))&&(o=i,u=t)}i=i.next}while(i!==a);return o}(e,t);if(!i)return t;const n=tc(i,e);return Fl(n,n.next),Fl(i,i.next)}function Gl(e,t){return Yl(e.prev,e,t.prev)<0&&Yl(t.next,e,e.next)<0}function $l(e,t,i,n,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Hl(e){let t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function Zl(e,t,i,n,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(n-a)>=(i-s)*(t-a)&&(i-s)*(o-a)>=(r-s)*(n-a)}function ql(e,t,i,n,r,o,s,a){return!(e===s&&t===a)&&Zl(e,t,i,n,r,o,s,a)}function Wl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&Jl(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(ec(e,t)&&ec(t,e)&&function(e,t){let i=e,n=!1;const r=(e.x+t.x)/2,o=(e.y+t.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(Yl(e.prev,e,t.prev)||Yl(e,t.prev,t))||Xl(e,t)&&Yl(e.prev,e,e.next)>0&&Yl(t.prev,t,t.next)>0)}function Yl(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Xl(e,t){return e.x===t.x&&e.y===t.y}function Jl(e,t,i,n){const r=Ql(Yl(e,t,i)),o=Ql(Yl(e,t,n)),s=Ql(Yl(i,n,e)),a=Ql(Yl(i,n,t));return r!==o&&s!==a||!(0!==r||!Kl(e,i,t))||!(0!==o||!Kl(e,n,t))||!(0!==s||!Kl(i,e,n))||!(0!==a||!Kl(i,t,n))}function Kl(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function Ql(e){return e>0?1:e<0?-1:0}function ec(e,t){return Yl(e.prev,e,e.next)<0?Yl(e,t,e.next)>=0&&Yl(e,e.prev,t)>=0:Yl(e,t,e.prev)<0||Yl(e,e.next,t)<0}function tc(e,t){const i=rc(e.i,e.x,e.y),n=rc(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function ic(e,t,i,n){const r=rc(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function nc(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function rc(e,t,i){return{i:e,x:t,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function oc(e,t,i=1){if(!e)return null;const n="string"==typeof e?Gn.from(e).getPrimary():e.getPrimary(),r="string"==typeof e?null:e.getSecondary();for(const e of[n,r]){if(!e)continue;const n=e.id.toString();t.has(n)||t.set(n,[]),e.scaleSelf(i),t.get(n).push(e)}return{primary:n.toString(),secondary:r?r.toString():null}}function sc(e,t,i,n){const r=n.patternDependencies;let o=!1;for(const n of t){const t=n.paint.get(`${e}-pattern`);t.isConstant()||(o=!0),oc(t.constantOr(null),r,i)&&(o=!0)}return o}function ac(e,t,i,n,r,o){const s=o.patternDependencies;for(const a of t){const t=a.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){const e=oc(t.evaluate({zoom:n},i,{},void 0,o.availableImages),s,r);if(!e)continue;const{primary:l,secondary:c}=e;l&&(i.patterns[a.id]=[l,c].filter(Boolean))}}return i}const lc=Cr/Math.PI/2,cc=64,uc=[cc,32,16],hc=-lc,dc=lc;function fc(e,t,i,n=lc){return i=Je(i),[e*Math.sin(i)*n,-t*n,e*Math.cos(i)*n]}function pc(e,t,i){return fc(Math.cos(Je(e)),Math.sin(Je(e)),t,i)}const mc=6371008.8,_c=2*Math.PI*mc;class gc{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new gc(rt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,i=this.lat*t,n=e.lat*t,r=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return mc*Math.acos(Math.min(r,1))}toBounds(e=0){const t=360*e/40075017,i=t/Math.cos(Math.PI/180*this.lat);return new yc({lng:this.lng-i,lat:this.lat-t},{lng:this.lng+i,lat:this.lat+t})}toEcef(e){return pc(this.lat,this.lng,lc+e*lc/mc)}static convert(e){if(e instanceof gc)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new gc(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new gc(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class yc{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof gc?new gc(e.lng,e.lat):gc.convert(e),this}setSouthWest(e){return this._sw=e instanceof gc?new gc(e.lng,e.lat):gc.convert(e),this}extend(e){const t=this._sw,i=this._ne;let n,r;if(e instanceof gc)n=e,r=e;else{if(!(e instanceof yc))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(yc.convert(e)):this.extend(gc.convert(e)):"object"==typeof e&&null!==e&&Object.hasOwn(e,"lat")&&(Object.hasOwn(e,"lon")||Object.hasOwn(e,"lng"))?this.extend(gc.convert(e)):this;if(n=e._sw,r=e._ne,!n||!r)return this}return t||i?(t.lng=Math.min(n.lng,t.lng),t.lat=Math.min(n.lat,t.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new gc(n.lng,n.lat),this._ne=new gc(r.lng,r.lat)),this}getCenter(){return new gc((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 gc(this.getWest(),this.getNorth())}getSouthEast(){return new gc(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:i}=gc.convert(e);let n=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n}static convert(e){if(e)return e instanceof yc?e:new yc(e)}}function vc(e){return _c*Math.cos(e*Math.PI/180)}function xc(e,t){return e/vc(t)}function bc(e,t){return e*vc(mr(t))}const wc=85.051129;function Tc(e){return Math.cos(Je(it(e,-85.051129,wc)))}function Ec(e,t){const i=it(t,0,25.5),n=Math.pow(2,i);return Tc(e)*_c/(512*n)}function Sc(e){return 1/Math.cos(e*Math.PI/180)}function Ic(e,t=0){const i=Math.exp(Math.PI*(1-(e.y+t/Cr)/(1<<e.z)*2));return 80150034*i/(i*i+1)/Cr/(1<<e.z)}class Ac{constructor(e,t,i=0){this.x=+e,this.y=+t,this.z=+i}static fromLngLat(e,t=0){const i=gc.convert(e);return new Ac(dr(i.lng),fr(i.lat),xc(t,i.lat))}toLngLat(){return new gc(pr(this.x),mr(this.y))}toAltitude(){return bc(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/_c*Sc(mr(this.y))}}function Mc(e,t,i,n,r,o,s,a,l){const c=(t+n)/2,u=(i+r)/2,h=new Pe(c,u);a(h),function(e,t,i,n,r,o){const s=i-r,a=n-o;return Math.abs((n-t)*s-(i-e)*a)/Math.hypot(s,a)}(h.x,h.y,o.x,o.y,s.x,s.y)>=l?(Mc(e,t,i,c,u,o,h,a,l),Mc(e,c,u,n,r,h,s,a,l)):e.push(s)}function Cc(e,t,i){let n=e[0],r=n.x,o=n.y;t(n);const s=[n];for(let a=1;a<e.length;a++){const l=e[a],{x:c,y:u}=l;t(l),Mc(s,r,o,c,u,n,l,t,i),r=c,o=u,n=l}return s}function Dc(e,t,i,n){if(n(t,i)){const r=t.add(i)._mult(.5);Dc(e,t,r,n),Dc(e,r,i,n)}else e.push(i)}function Pc(e,t){let i=e[0];const n=[i];for(let r=1;r<e.length;r++){const o=e[r];Dc(n,i,o,t),i=o}return n}const Rc=Math.pow(2,14)-1,Lc=-Rc-1;function zc(e,t){const i=Math.round(e.x*t),n=Math.round(e.y*t);return e.x=it(i,Lc,Rc),e.y=it(n,Lc,Rc),(i<e.x||i>e.x+1||n<e.y||n>e.y+1)&>("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function Fc(e,t,i){const n=e.loadGeometry(),r=e.extent,o=Cr/r;if(t&&i&&i.projection.isReprojectedInTileSpace){const o=1<<t.z,{scale:s,x:a,y:l,projection:c}=i,u=e=>{const i=pr((t.x+e.x/r)/o),n=mr((t.y+e.y/r)/o),u=c.project(i,n);e.x=(u.x*s-a)*r,e.y=(u.y*s-l)*r};for(let t=0;t<n.length;t++)if(1!==e.type)n[t]=Cc(n[t],u,1);else{const e=[];for(const i of n[t])i.x<0||i.x>=r||i.y<0||i.y>=r||(u(i),e.push(i));n[t]=e}}for(const e of n)for(const t of e)zc(t,o);return n}function Oc(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Fc(e):[]}}const kc={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Bc{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}const Nc=new ArrayBuffer(0);class Vc{constructor(){this._reallocCount=0,this.capacity=0,this.length=0}static serialize(e,t){return e._trim(),t&&e.arrayBuffer&&t.add(e.arrayBuffer),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,e.arrayBuffer?t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement:(t.capacity=0,t.arrayBuffer=Nc),t._refreshViews(),t}_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(e){this.reserve(e),this.length=e}resizeExact(e){this.reserveExact(e),this.length=e}reserve(e){e>this.capacity&&this._allocate(Math.max(e,Math.floor(5*this.capacity),128))}reserveExact(e){(e>this.capacity||!this.arrayBuffer)&&this._allocate(e)}_allocate(e){this._reallocCount++,this.capacity=e,this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}reserveForAdditional(e){this.reserve(this.length+e)}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() 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 Uc(e,t=1){let i=0,n=0;return{members:e.map(e=>{const r=kc[e.type].BYTES_PER_ELEMENT,o=i=jc(i,Math.max(t,r)),s=e.components||1;return n=Math.max(n,r),i+=r*s,{name:e.name,type:e.type,components:s,offset:o,normalized:e.normalized}}),size:jc(i,Math.max(n,t)),alignment:t}}function jc(e,t){return Math.ceil(e/t)*t}class Gc extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const n=2*e;return this.int16[n+0]=t,this.int16[n+1]=i,e}}Gc.prototype.bytesPerElement=4,Ys(Gc,"StructArrayLayout2i4");class $c extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=3*e;return this.int16[r+0]=t,this.int16[r+1]=i,this.int16[r+2]=n,e}}$c.prototype.bytesPerElement=6,Ys($c,"StructArrayLayout3i6");class Hc extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=i,this.uint16[o+2]=n,this.uint16[o+3]=r,e}}Hc.prototype.bytesPerElement=8,Ys(Hc,"StructArrayLayout2i2ui8");class Zc extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}Zc.prototype.bytesPerElement=4,Ys(Zc,"StructArrayLayout1f4");class qc extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=4*e,o=2*e;return this.int16[r+0]=t,this.int16[r+1]=i,this.float32[o+1]=n,e}}qc.prototype.bytesPerElement=8,Ys(qc,"StructArrayLayout2i1f8");class Wc extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=4*e;return this.int16[r+0]=t,this.int16[r+1]=i,this.int16[r+2]=n,e}}Wc.prototype.bytesPerElement=8,Ys(Wc,"StructArrayLayout3i8");class Yc extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=i,this.int16[o+2]=n,this.int16[o+3]=r,e}}Yc.prototype.bytesPerElement=8,Ys(Yc,"StructArrayLayout4i8");class Xc extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r)}emplace(e,t,i,n,r,o){const s=5*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.int16[s+2]=n,this.int16[s+3]=r,this.int16[s+4]=o,e}}Xc.prototype.bytesPerElement=10,Ys(Xc,"StructArrayLayout5i10");class Jc extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,o,s)}emplace(e,t,i,n,r,o,s,a){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=i,this.uint8[c+4]=n,this.uint8[c+5]=r,this.uint8[c+6]=o,this.uint8[c+7]=s,this.float32[u+2]=a,e}}Jc.prototype.bytesPerElement=12,Ys(Jc,"StructArrayLayout2i4ub1f12");class Kc extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=3*e;return this.float32[r+0]=t,this.float32[r+1]=i,this.float32[r+2]=n,e}}Kc.prototype.bytesPerElement=12,Ys(Kc,"StructArrayLayout3f12");class Qc extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r)}emplace(e,t,i,n,r,o){const s=6*e,a=3*e;return this.uint16[s+0]=t,this.uint16[s+1]=i,this.uint16[s+2]=n,this.uint16[s+3]=r,this.float32[a+2]=o,e}}Qc.prototype.bytesPerElement=12,Ys(Qc,"StructArrayLayout4ui1f12");class eu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=i,this.uint16[o+2]=n,this.uint16[o+3]=r,e}}eu.prototype.bytesPerElement=8,Ys(eu,"StructArrayLayout4ui8");class tu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r,o)}emplace(e,t,i,n,r,o,s){const a=6*e;return this.int16[a+0]=t,this.int16[a+1]=i,this.int16[a+2]=n,this.int16[a+3]=r,this.int16[a+4]=o,this.int16[a+
vendor: 15,637 bytes, line 2
25]=s,e}}tu.prototype.bytesPerElement=12,Ys(tu,"StructArrayLayout6i12");class iu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,i,n,r,o,s,a,l,c,u,h)}emplace(e,t,i,n,r,o,s,a,l,c,u,h,d){const f=12*e;return this.int16[f+0]=t,this.int16[f+1]=i,this.int16[f+2]=n,this.int16[f+3]=r,this.uint16[f+4]=o,this.uint16[f+5]=s,this.uint16[f+6]=a,this.uint16[f+7]=l,this.int16[f+8]=c,this.int16[f+9]=u,this.int16[f+10]=h,this.int16[f+11]=d,e}}iu.prototype.bytesPerElement=24,Ys(iu,"StructArrayLayout4i4ui4i24");class nu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r,o)}emplace(e,t,i,n,r,o,s){const a=10*e,l=5*e;return this.int16[a+0]=t,this.int16[a+1]=i,this.int16[a+2]=n,this.float32[l+2]=r,this.float32[l+3]=o,this.float32[l+4]=s,e}}nu.prototype.bytesPerElement=20,Ys(nu,"StructArrayLayout3i3f20");class ru extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=i,this.float32[o+2]=n,this.float32[o+3]=r,e}}ru.prototype.bytesPerElement=16,Ys(ru,"StructArrayLayout4f16");class ou extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}ou.prototype.bytesPerElement=4,Ys(ou,"StructArrayLayout1ul4");class su extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=i,e}}su.prototype.bytesPerElement=4,Ys(su,"StructArrayLayout2ui4");class au extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u,h,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,t,i,n,r,o,s,a,l,c,u,h,d)}emplace(e,t,i,n,r,o,s,a,l,c,u,h,d,f){const p=20*e,m=10*e;return this.int16[p+0]=t,this.int16[p+1]=i,this.int16[p+2]=n,this.int16[p+3]=r,this.int16[p+4]=o,this.float32[m+3]=s,this.float32[m+4]=a,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[p+14]=u,this.uint32[m+8]=h,this.uint16[p+18]=d,this.uint16[p+19]=f,e}}au.prototype.bytesPerElement=40,Ys(au,"StructArrayLayout5i4f1i1ul2ui40");class lu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,o,s)}emplace(e,t,i,n,r,o,s,a){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+4]=r,this.int16[l+5]=o,this.int16[l+6]=s,this.int16[l+7]=a,e}}lu.prototype.bytesPerElement=16,Ys(lu,"StructArrayLayout3i2i2i16");class cu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r)}emplace(e,t,i,n,r,o){const s=4*e,a=8*e;return this.float32[s+0]=t,this.float32[s+1]=i,this.float32[s+2]=n,this.int16[a+6]=r,this.int16[a+7]=o,e}}cu.prototype.bytesPerElement=16,Ys(cu,"StructArrayLayout2f1f2i16");class uu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r,o)}emplace(e,t,i,n,r,o,s){const a=20*e,l=5*e;return this.uint8[a+0]=t,this.uint8[a+1]=i,this.float32[l+1]=n,this.float32[l+2]=r,this.float32[l+3]=o,this.float32[l+4]=s,e}}uu.prototype.bytesPerElement=20,Ys(uu,"StructArrayLayout2ub4f20");class hu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i)}emplace(e,t,i,n){const r=3*e;return this.uint16[r+0]=t,this.uint16[r+1]=i,this.uint16[r+2]=n,e}}hu.prototype.bytesPerElement=6,Ys(hu,"StructArrayLayout3ui6");class du extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x){const b=this.length;return this.resize(b+1),this.emplace(b,e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x)}emplace(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b){const w=30*e,T=15*e,E=60*e;return this.int16[w+0]=t,this.int16[w+1]=i,this.int16[w+2]=n,this.float32[T+2]=r,this.float32[T+3]=o,this.uint16[w+8]=s,this.uint16[w+9]=a,this.uint32[T+5]=l,this.uint32[T+6]=c,this.uint32[T+7]=u,this.uint16[w+16]=h,this.uint16[w+17]=d,this.uint16[w+18]=f,this.float32[T+10]=p,this.float32[T+11]=m,this.uint8[E+48]=_,this.uint8[E+49]=g,this.uint8[E+50]=y,this.uint32[T+13]=v,this.int16[w+28]=x,this.uint8[E+58]=b,e}}du.prototype.bytesPerElement=60,Ys(du,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class fu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,E,S,I,A,M,C,D,P,R){const L=this.length;return this.resize(L+1),this.emplace(L,e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,E,S,I,A,M,C,D,P,R)}emplace(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,E,S,I,A,M,C,D,P,R,L){const z=20*e,F=40*e,O=80*e;return this.float32[z+0]=t,this.float32[z+1]=i,this.int16[F+4]=n,this.int16[F+5]=r,this.int16[F+6]=o,this.int16[F+7]=s,this.int16[F+8]=a,this.int16[F+9]=l,this.int16[F+10]=c,this.int16[F+11]=u,this.int16[F+12]=h,this.uint16[F+13]=d,this.uint16[F+14]=f,this.uint16[F+15]=p,this.uint16[F+16]=m,this.uint16[F+17]=_,this.uint16[F+18]=g,this.uint16[F+19]=y,this.uint16[F+20]=v,this.uint16[F+21]=x,this.uint16[F+22]=b,this.uint16[F+23]=w,this.uint16[F+24]=T,this.uint16[F+25]=E,this.uint16[F+26]=S,this.uint16[F+27]=I,this.uint32[z+14]=A,this.float32[z+15]=M,this.float32[z+16]=C,this.float32[z+17]=D,this.float32[z+18]=P,this.uint8[O+76]=R,this.uint16[F+39]=L,e}}fu.prototype.bytesPerElement=80,Ys(fu,"StructArrayLayout2f9i15ui1ul4f1ub1ui80");class pu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,n,r,o)}emplace(e,t,i,n,r,o,s){const a=6*e;return this.float32[a+0]=t,this.float32[a+1]=i,this.float32[a+2]=n,this.float32[a+3]=r,this.float32[a+4]=o,this.float32[a+5]=s,e}}pu.prototype.bytesPerElement=24,Ys(pu,"StructArrayLayout6f24");class mu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,n,r)}emplace(e,t,i,n,r,o){const s=5*e;return this.float32[s+0]=t,this.float32[s+1]=i,this.float32[s+2]=n,this.float32[s+3]=r,this.float32[s+4]=o,e}}mu.prototype.bytesPerElement=20,Ys(mu,"StructArrayLayout5f20");class _u extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,n,r,o,s)}emplace(e,t,i,n,r,o,s,a){const l=7*e;return this.float32[l+0]=t,this.float32[l+1]=i,this.float32[l+2]=n,this.float32[l+3]=r,this.float32[l+4]=o,this.float32[l+5]=s,this.float32[l+6]=a,e}}_u.prototype.bytesPerElement=28,Ys(_u,"StructArrayLayout7f28");class gu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u){const h=this.length;return this.resize(h+1),this.emplace(h,e,t,i,n,r,o,s,a,l,c,u)}emplace(e,t,i,n,r,o,s,a,l,c,u,h){const d=11*e;return this.float32[d+0]=t,this.float32[d+1]=i,this.float32[d+2]=n,this.float32[d+3]=r,this.float32[d+4]=o,this.float32[d+5]=s,this.float32[d+6]=a,this.float32[d+7]=l,this.float32[d+8]=c,this.float32[d+9]=u,this.float32[d+10]=h,e}}gu.prototype.bytesPerElement=44,Ys(gu,"StructArrayLayout11f44");class yu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l){const c=this.length;return this.resize(c+1),this.emplace(c,e,t,i,n,r,o,s,a,l)}emplace(e,t,i,n,r,o,s,a,l,c){const u=9*e;return this.float32[u+0]=t,this.float32[u+1]=i,this.float32[u+2]=n,this.float32[u+3]=r,this.float32[u+4]=o,this.float32[u+5]=s,this.float32[u+6]=a,this.float32[u+7]=l,this.float32[u+8]=c,e}}yu.prototype.bytesPerElement=36,Ys(yu,"StructArrayLayout9f36");class vu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const n=2*e;return this.float32[n+0]=t,this.float32[n+1]=i,e}}vu.prototype.bytesPerElement=8,Ys(vu,"StructArrayLayout2f8");class xu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=i,this.uint16[o+3]=n,this.uint16[o+4]=r,e}}xu.prototype.bytesPerElement=12,Ys(xu,"StructArrayLayout1ul3ui12");class bu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}bu.prototype.bytesPerElement=2,Ys(bu,"StructArrayLayout1ui2");class wu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int8=new Int8Array(this.arrayBuffer)}emplaceBack(e,t,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i,n)}emplace(e,t,i,n,r){const o=4*e;return this.int8[o+0]=t,this.int8[o+1]=i,this.int8[o+2]=n,this.int8[o+3]=r,e}}wu.prototype.bytesPerElement=4,Ys(wu,"StructArrayLayout4b4");class Tu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m){const _=this.length;return this.resize(_+1),this.emplace(_,e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m)}emplace(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_){const g=16*e;return this.float32[g+0]=t,this.float32[g+1]=i,this.float32[g+2]=n,this.float32[g+3]=r,this.float32[g+4]=o,this.float32[g+5]=s,this.float32[g+6]=a,this.float32[g+7]=l,this.float32[g+8]=c,this.float32[g+9]=u,this.float32[g+10]=h,this.float32[g+11]=d,this.float32[g+12]=f,this.float32[g+13]=p,this.float32[g+14]=m,this.float32[g+15]=_,e}}Tu.prototype.bytesPerElement=64,Ys(Tu,"StructArrayLayout16f64");class Eu extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.int16[1*e+0]=t,e}}Eu.prototype.bytesPerElement=2,Ys(Eu,"StructArrayLayout1i2");class Su extends Vc{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint8[1*e+0]=t,e}}Su.prototype.bytesPerElement=1,Ys(Su,"StructArrayLayout1ub1");class Iu extends Bc{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]}}Iu.prototype.size=40;class Au extends au{get(e){return new Iu(this,e)}}Ys(Au,"CollisionBoxArray");class Mu extends Bc{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}Mu.prototype.size=60;class Cu extends du{get(e){return new Mu(this,e)}}Ys(Cu,"PlacedSymbolArray");class Du extends Bc{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}
vendor: 19,966 bytes, line 2
2get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}get elevationFeatureIndex(){return this._structArray.uint16[this._pos2+39]}}Du.prototype.size=80;class Pu extends fu{get(e){return new Du(this,e)}}Ys(Pu,"SymbolInstanceArray");class Ru extends Zc{getoffsetX(e){return this.float32[1*e+0]}}Ys(Ru,"GlyphOffsetArray");class Lu extends Gc{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Ys(Lu,"SymbolLineVertexArray");class zu extends Bc{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]}}zu.prototype.size=12;class Fu extends xu{get(e){return new zu(this,e)}}Ys(Fu,"FeatureIndexArray");class Ou extends su{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Ys(Ou,"FillExtrusionCentroidArray");class ku extends Bc{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}ku.prototype.size=6;class Bu extends $c{get(e){return new ku(this,e)}}Ys(Bu,"FillExtrusionWallArray");const Nu=Uc([{name:"a_pos",components:2,type:"Int16"}],4),Vu=Uc([{name:"a_road_z_offset",components:1,type:"Float32"}],4),Uu=Uc([{name:"a_pos",components:2,type:"Int16"},{name:"a_height",components:1,type:"Float32"}],4),ju=Uc([{name:"a_pos_normal_3",components:3,type:"Int16"}],4);class Gu{constructor(e=[]){this.segments=e}_prepareSegment(e,t,i,n,r){let o=this.segments.at(-1);return e>Gu.MAX_VERTEX_ARRAY_LENGTH&>(`Max vertices per segment is ${Gu.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!o||o.vertexLength+e>Gu.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==n||void 0!==r&&o&&void 0!==o.batchIndex&&o.batchIndex!==r)&&(o={vertexOffset:t,primitiveOffset:i,vertexLength:0,primitiveLength:0},void 0!==n&&(o.sortKey=n),void 0!==r&&(o.batchIndex=r),this.segments.push(o)),o}prepareSegment(e,t,i,n,r){return this._prepareSegment(e,t.length,i.length,n,r)}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,i,n){return new Gu([{vertexOffset:e,primitiveOffset:t,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}}function $u(e,t){return 256*(e=it(Math.floor(e),0,255))+it(Math.floor(t),0,255)}Gu.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ys(Gu,"SegmentVector");const Hu=Uc([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Zu=Uc([{name:"a_pattern_b",components:4,type:"Uint16"}]),qu=Uc([{name:"a_dash",components:4,type:"Uint16"}]);class Wu{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,t,i,n){this.ids.push(Yu(e)),this.positions.push(t,i,n)}eachPosition(e,t){const i=Yu(e);let n=0,r=this.ids.length-1;for(;n<r;){const e=n+r>>1;this.ids[e]>=i?r=e:n=e+1}for(;this.ids[n]===i;)t(this.positions[3*n],this.positions[3*n+1],this.positions[3*n+2]),n++}static serialize(e,t){const i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Xu(i,n,0,i.length-1),t&&(t.add(i.buffer),t.add(n.buffer)),{ids:i,positions:n}}static deserialize(e){const t=new Wu;let i;t.ids=e.ids,t.positions=e.positions;for(const e of t.ids)e!==i&&t.uniqueIds.push(e),i=e;return t.indexed=!0,t}}function Yu(e){const t=+e;return Number.isSafeInteger(t)?t:nn(String(e))}function Xu(e,t,i,n){for(;i<n;){const r=e[i+n>>1];let o=i-1,s=n+1;for(;;){do{o++}while(e[o]<r);do{s--}while(e[s]>r);if(o>=s)break;Ju(e,o,s),Ju(t,3*o,3*s),Ju(t,3*o+1,3*s+1),Ju(t,3*o+2,3*s+2)}s-i<n-s?(Xu(e,t,i,s),i=s+1):(Xu(e,t,s+1,n),n=s)}}function Ju(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}Ys(Wu,"FeaturePositionMap");class Ku{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}set(e,t,i){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class Qu extends Ku{constructor(e){super(e),this.current=0}set(e,t,i){this.fetchUniformLocation(e,t)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}}class eh extends Ku{constructor(e){super(e),this.current=0}set(e,t,i){this.fetchUniformLocation(e,t)&&this.current!==i&&(this.current=i,this.gl.uniform1f(this.location,i))}}class th extends Ku{constructor(e){super(e),this.current=[0,0]}set(e,t,i){this.fetchUniformLocation(e,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}}class ih extends Ku{constructor(e){super(e),this.current=[0,0,0]}set(e,t,i){this.fetchUniformLocation(e,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}}class nh extends Ku{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,i){this.fetchUniformLocation(e,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]&&i[3]===this.current[3]||(this.current=i,this.gl.uniform4ui(this.location,i[0],i[1],i[2],i[3])))}}class rh extends Ku{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,i){this.fetchUniformLocation(e,t)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]&&i[3]===this.current[3]||(this.current=i,this.gl.uniform4f(this.location,i[0],i[1],i[2],i[3])))}}class oh extends Ku{constructor(e){super(e),this.current=mn.transparent.toPremultipliedRenderColor(null)}set(e,t,i){this.fetchUniformLocation(e,t)&&(i.r===this.current.r&&i.g===this.current.g&&i.b===this.current.b&&i.a===this.current.a||(this.current=i,this.gl.uniform4f(this.location,i.r,i.g,i.b,i.a)))}}class sh extends Ku{constructor(e){super(e),this.current=new Float32Array(16)}set(e,t,i){if(!this.fetchUniformLocation(e,t))return;const n=this.current;if(i[12]!==n[12]||i[0]!==n[0])return n.set(i),void this.gl.uniformMatrix4fv(this.location,!1,n);for(let e=1;e<16;e++)if(i[e]!==n[e]){n.set(i),this.gl.uniformMatrix4fv(this.location,!1,n);break}}}class ah extends Ku{constructor(e){super(e),this.current=new Float32Array(4)}set(e,t,i){if(!this.fetchUniformLocation(e,t))return;const n=this.current;for(let e=0;e<4;e++)if(i[e]!==n[e]){n.set(i),this.gl.uniformMatrix2fv(this.location,!1,n);break}}}function lh(e){return[$u(255*e.r,255*e.g),$u(255*e.b,255*e.a)]}function ch(e,t,i,n,r,o,s,a){return!!e&&("composite"===e.kind||"source"===e.kind?"none"===e.evaluate(new Ha(0,{brightness:o,worldview:a}),t,i,r,n,s):"none"===e.value)}class uh{constructor(e,t,i,n){this.value=e,this.uniformNames=t.map(e=>`u_${e}`),this.type=i,this.context=n}setUniform(e,t,i,n,r){const o=n.constantOr(this.value);t.set(e,r,o instanceof mn?o.toPremultipliedRenderColor(this.lutExpression&&"constant"===this.lutExpression.kind&&"none"===this.lutExpression.value?null:this.context.lut):o)}getBinding(e,t){return"color"===this.type?new oh(e):new eh(e)}}class hh{constructor(e,t){this.uniformNames=t.map(e=>`u_${e}`),this.pattern=null,this.patternTransition=null,this.pixelRatio=1}setConstantPatternPositions(e,t){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br),this.patternTransition=t?t.tl.concat(t.br):this.pattern}setUniform(e,t,i,n,r){let o=null;"u_pattern"!==r&&"u_dash"!==r||(o=this.pattern),"u_pattern_b"===r&&(o=this.patternTransition),"u_pixel_ratio"===r&&(o=this.pixelRatio),o&&t.set(e,r,o)}getBinding(e,t){return"u_pattern"===t||"u_pattern_b"===t||"u_dash"===t?new nh(e):new eh(e)}}class dh{constructor(e,t,i,n){this.expression=e,this.type=i,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===i?2:1,offset:0})),this.paintVertexArray=new n}populatePaintArray(e,t,i,n,r,o,s,a){const l=this.paintVertexArray.length,c="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate(new Ha(0,{brightness:o,worldview:a}),t,{},r,n,s):"constant"===this.expression.kind&&this.expression.value,u=ch(this.lutExpression,t,{},n,r,o,s,a);this.paintVertexArray.resize(e),this._setPaintValue(l,e,c,u?null:this.context.lut)}updatePaintArray(e,t,i,n,r,o,s,a){const l="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate({zoom:0,brightness:s,worldview:a},i,n,void 0,r):"constant"===this.expression.kind&&this.expression.value,c=ch(this.lutExpression,i,n,r,void 0,s,void 0,a);this._setPaintValue(e,t,l,c?null:this.context.lut)}_setPaintValue(e,t,i,n){if("color"===this.type){const r=lh(i.toPremultipliedRenderColor(n));for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r[0],r[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.lutExpression&&"constant"!==this.lutExpression.kind&&(this.lutExpression.isStateDependent||!this.lutExpression.isLightConstant)||"constant"!==this.expression.kind&&(this.expression.isStateDependent||!this.expression.isLightConstant)))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class fh{constructor(e,t,i,n,r,o){this.expression=e,this.uniformNames=t.map(e=>`u_${e}_t`),this.type=i,this.useIntegerZoom=n,this.context=r,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===i?4:2,offset:0})),this.paintVertexArray=new o}populatePaintArray(e,t,i,n,r,o,s,a){const l=this.expression.evaluate(new Ha(this.context.zoom,{brightness:o,worldview:a}),t,{},r,n,s),c=this.expression.evaluate(new Ha(this.context.zoom+1,{brightness:o,worldview:a}),t,{},r,n,s),u=ch(this.lutExpression,t,{},n,r,o,s,a),h=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(h,e,l,c,u?null:this.context.lut)}updatePaintArray(e,t,i,n,r,o,s,a){const l=this.expression.evaluate({zoom:this.context.zoom,brightness:s,worldview:a},i,n,void 0,r),c=this.expression.evaluate({zoom:this.context.zoom+1,brightness:s,worldview:a},i,n,void 0,r),u=ch(this.lutExpression,i,n,r,void 0,s,void 0,a);this._setPaintValue(e,t,l,c,u?null:this.context.lut)}_setPaintValue(e,t,i,n,r){if("color"===this.type){const o=lh(i.toPremultipliedRenderColor(r)),s=lh(n.toPremultipliedRenderColor(r));for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,o[0],o[1],s[0],s[1])}else{for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i,n);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,i,n,r){const o=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,s=it(this.expression.interpolationFactor(o,this.context.zoom,this.context.zoom+1),0,1);t.set(e,r,s)}getBinding(e,t){return new eh(e)}}class ph{constructor(e,t,i,n,r){this.expression=e,this.layerId=r,this.paintVertexAttributes=("array"===i?qu:Hu).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new n,this.paintTransitionVertexArray=new eu}populatePaintArray(e,t,i,n){const r=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(r,e,t.patterns&&t.patterns[this.layerId],i)}updatePaintArray(e,t,i,n,r,o,s){this._setPaintValues(e,t,i.patterns&&i.patterns[this.layerId],o)}_setPaintValues(e,t,i,n){if(!n||!i)return;const r=n[i[0]],o=n[i[1]];if(r){if(r){const{tl:i,br:n,pixelRatio:o}=r;for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1],n[0],n[1],o)}if(o){this.paintTransitionVertexArray.resize(this.paintVertexArray.length);const{tl:i,br:n}=o;for(let r=e;r<t;r++)this.paintTransitionVertexArray.emplace(r,i[0],i[1],n[0],n[1])}}}upload(e){const t=this.expression.isStateDependent||!this.expression.isLightConstant;this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,t)),this.paintTransitionVertexArray&&this.paintTransitionVertexArray.length&&(this.paintTransitionVertexBuffer=e.createVertexBuffer(this.paintTransitionVertexArray,Zu.members,t))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy(),this.paintTransitionVertexBuffer&&this.paintTransitionVertexBuffer.destroy()}}class mh{constructor(e,t,i=()=>!0){this.binders={},this._buffers=[],this.context=t;const n=[],r=e;for(const o in e.paint._values){const s=r.paint.get(o);if(o.endsWith("-use-theme"))continue;if(!i(o))continue;if(!(s instanceof Ka&&As(s.property.specification)))continue;const a=yh(o,e.type),l=s.value,c=s.property.specification.type,u=!!s.property.useIntegerZoom,h="line-dasharray"===o||o.endsWith("pattern"),d=r.paint.get(`${o}-use-theme`),f="line-dasharray"===o&&"constant"!==r.layout.get("line-cap").value.kind||d&&"constant"!==d.value.kind;if("constant"!==l.kind||f)if("source"===l.kind||f||h){const t=bh(o,c,"source");this.binders[o]=h?new ph(l,a,c,t,e.id):new dh(l,a,c,t),n.push(`/a_${o}`)}else{const e=bh(o,c,"composite");this.binders[o]=new fh(l,a,c,u,t,e),n.push(`/z_${o}`)}else this.binders[o]=h?new hh(l.value,a):new uh(l.value,a,c,t),n.push(`/u_${o}`);d&&(this.binders[o].lutExpression=d.value)}this.cacheKey=n.sort().join("")}updateExpressions(e){const t=e;for(const e in this.binders){const i=this.binders[e];if(i instanceof dh||i instanceof fh||i instanceof ph){const n=t.paint.get(e);i.expression=n.value}}}getMaxValue(e){const t=this.binders[e];return t instanceof dh||t instanceof fh?t.maxValue:0}populatePaintArrays(e,t,i,n,r,o,s,a){for(const l in this.binders){const c=this.binders[l];c.context=this.context,(c instanceof dh||c instanceof fh||c instanceof ph)&&c.populatePaintArray(e,t,i,n,r,o,s,a)}}setConstantPatternPositions(e,t){for(const i in this.binders){const n=this.binders[i];n instanceof hh&&n.setConstantPatternPositions(e,t)}}getPatternTransitionVertexBuffer(e){const t=this.binders[e];return t instanceof ph?t.paintTransitionVertexBuffer:null}updatePaintArrays(e,t,i,n,r,o,s,a,l,c){let u=!1;const h=Object.keys(e),d=0!==h.length&&!a,f=d?h:t.uniqueIds;this.context.lut=r.lut;for(const a in this.binders){const h=this.binders[a];if(h.context=this.context,(h instanceof dh||h instanceof fh||h instanceof ph)&&h.expression&&h.expression.kind&&"constant"!==h.expression.kind&&(!0===h.expression.isStateDependent||!1===h.expression.isLightConstant)){const p=r.paint.get(a);h.expression=p.value;for(const i of f){const r=e[i.toString()];t.eachPosition(i,(e,t,i)=>{const a=n.feature(e);h.updatePaintArray(t,i,a,r,o,s,l,c)})}if(!d)for(const t of i.uniqueIds){const r=e[t.toString()];i.eachPosition(t,(e,t,i)=>{const a=n.feature(e);h.updatePaintArray(t,i,a,r,o,s,l,c)})}u=!0}}return u}defines(){const e=[];for(const t in this.binders){const i=this.binders[t];(i instanceof uh||i instanceof hh)&&e.push(...i.uniformNames.map(e=>`#define HAS_UNIFORM_${e}`))}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof uh||n instanceof hh||n instanceof fh)for(const r of n.uniformNames)t.push({name:r,property:i,binding:n.getBinding(e,r)})}return t}setUniforms(e,t,i,n,r){for(const{name:t,property:o,binding:s}of i)this.binders[o].setUniform(e,s,r,n.get(o),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof dh||t instanceof fh||t instanceof ph)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer),t instanceof ph&&t.paintTransitionVertexBuffer&&this._buffers.push(t.paintTransitionVertexBuffer)}}upload(e){for(const t in this.binders){const i=this.binders[t];(i instanceof dh||i instanceof fh||i instanceof ph)&&i.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof dh||t instanceof fh||t instanceof ph)&&t.destroy()}}}class _h{constructor(e,t,i=()=>!0){this.programConfigurations={};for(const n of e)this.programConfigurations[n.id]=new mh(n,t,i);this.needsUpload=!1,this._featureMap=new Wu,this._featureMapWithoutIds=new Wu,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,t,i,n,r,o,s,a,l){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(e,t,n,r,o,s,a,l);void 0!==t.id?this._featureMap.add(t.id,i,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,i,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,i,n,r,o,s,a){for(const l of i)this.needsUpload=this.programConfigurations[l.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,t,l,n,r,o,s||0,a)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}updateExpressions(e){const t=new Set;for(const i of e){const e=this.programConfigurations[i.id];e&&(e.updateExpressions(i),t.add(i.id))}for(const e in this.programConfigurations)t.has(e)||delete this.programConfigurations[e]}}const gh={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"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"],"symbol-z-offset":["z_offset"],"line-gap-width":["ga
2pwidth"],"line-pattern":["pattern","pixel_ratio","pattern_b"],"fill-pattern":["pattern","pixel_ratio","pattern_b"],"fill-extrusion-pattern":["pattern","pixel_ratio","pattern_b"],"line-dasharray":["dash"],"fill-bridge-guard-rail-color":["structure_color"],"fill-tunnel-structure-color":["structure_color"]};function yh(e,t){return gh[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const vh={"line-pattern":{source:Qc,composite:Qc},"fill-pattern":{source:Qc,composite:Qc},"fill-extrusion-pattern":{source:Qc,composite:Qc},"line-dasharray":{source:eu,composite:eu}},xh={color:{source:vu,composite:ru},number:{source:Zc,composite:vu}};function bh(e,t,i){const n=vh[e];return n&&n[i]||xh[t][i]}Ys(uh,"ConstantBinder"),Ys(hh,"PatternConstantBinder"),Ys(dh,"SourceExpressionBinder",{omit:["expression"]}),Ys(ph,"PatternCompositeBinder",{omit:["expression"]}),Ys(fh,"CompositeExpressionBinder",{omit:["expression"]}),Ys(mh,"ProgramConfiguration",{omit:["_buffers"]}),Ys(_h,"ProgramConfigurationSet");class wh{constructor(e,t,i){this.layoutVertexArray=new Gc,this.indexArray=new hu,this.lineIndexArray=new su,this.triangleSegments=new Gu,this.lineSegments=new Gu,this.programConfigurations=new _h(e,{zoom:t,lut:i}),this.uploaded=!1}update(e,t,i,n,r,o,s,a){this.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,a)}isEmpty(){return 0===this.layoutVertexArray.length}needsUpload(){return this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Nu.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.lineIndexBuffer=e.createIndexBuffer(this.lineIndexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy())}populatePaintArrays(e,t,i,n,r,o,s){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,t,i,n,r,o,void 0,s)}}Ys(wh,"FillBufferData");class Th{constructor(e){this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lut=e.lut,this.bufferData=new wh(e.layers,e.zoom,e.lut),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.projection=e.projection,this.sourceLayerIndex=e.sourceLayerIndex,this.sourceLayerName=e.sourceLayerName||"",this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,i,n){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(e,t,i,n){this.hasPattern=sc("fill",this.layers,this.pixelRatio,t);const r=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:s,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Oc(s,e);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),u,i))continue;const h=r?r.evaluate(u,{},i,t.availableImages):void 0,d={id:a,properties:s.properties,type:s.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Fc(s,i,n),patterns:{},sortKey:h};o.push(d)}r&&o.sort((e,t)=>
vendor: 1,303 bytes, line 2
2e.sortKey-t.sortKey);for(const n of o){const{geometry:r,index:o,sourceLayerIndex:s}=n;if(this.hasPattern){const e=ac("fill",this.layers,n,this.zoom,this.pixelRatio,t);this.patternFeatures.push(e)}else this.addFeature(n,r,o,i,{},t.availableImages,t.brightness,t.elevationFeatures);t.featureIndex.insert(e[o].feature,r,o,s,this.index)}!this.hasPattern&&this.hdExt&&this.hdExt.buildFrcSegments(this)}update(e,t,i,n,r,o,s){this.bufferData.update(e,t,i,n,r,o,s,this.worldview),this.hdExt&&this.hdExt.update(e,t,i,n,r,o,s,this.worldview)}updateExpressions(e){this.bufferData.programConfigurations.updateExpressions(e),this.hdExt&&this.hdExt.updateExpressions(e)}addFeatures(e,t,i,n,r,o){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,t,i,n,o,e.elevationFeatures);this.hdExt&&this.hdExt.buildFrcSegments(this)}isEmpty(){return this.bufferData.isEmpty()&&(!this.hdExt||this.hdExt.isEmpty())}uploadPending(){return!this.uploaded||this.bufferData.needsUpload()||null!=this.hdExt&&this.hdExt.needsUpload()}upload(e){this.bufferData.upload(e),this.hdExt&&this.hdExt.upload(e)}destroy(){this.bufferData.destroy(),this.hdExt&&this.hdExt.destroy()}addFeature(e,t,i,n,r,o=[],s,a){const l=this.hdExt?this.hdExt.trackFeatureFrc(e.properties):null,c=this.bufferData.indexArray.length,u=Ne(t,500);
vendor: 13,838 bytes, line 2
2null!=this.hdExt&&this.hdExt.handleFeature(e,u,i,n,a,this)||this.addGeometry(u,this.bufferData),this.bufferData.populatePaintArrays(e,i,r,o,n,s,this.worldview),this.hdExt&&this.hdExt.populatePaintArrays(e,i,r,o,n,s,this.worldview),this.hdExt&&this.hdExt.recordFeatureRange(this,c,this.bufferData.indexArray.length,l)}addGeometry(e,t,i,n){let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=null;i&&(s=i.elevationSampler.constantElevation(i.elevation,i.bias),null!=s&&(r=s,o=s));const a=i?t:null,l=(e,t,n)=>{if(null!=i)if(t.push(e),null!=s)a.elevatedLayoutVertexArray.emplaceBack(s),n.push(s);else{const t=i.elevationSampler.pointElevation(e,i.elevation,i.bias);a.elevatedLayoutVertexArray.emplaceBack(t),n.push(t),r=Math.min(r,t),o=Math.max(o,t)}};for(const r of e){let e=0;for(const t of r)e+=t.length;const o=t.triangleSegments.prepareSegment(e,t.layoutVertexArray,t.indexArray),s=o.vertexLength,a=[],c=[],u=[],h=[],d=[],f=t.layoutVertexArray.length;for(const e of r){if(0===e.length)continue;e!==r[0]&&c.push(a.length/2);const n=t.lineSegments.prepareSegment(e.length,t.layoutVertexArray,t.lineIndexArray),o=n.vertexLength;i&&d.push(t.layoutVertexArray.length-f),l(e[0],u,h),t.layoutVertexArray.emplaceBack(e[0].x,e[0].y),t.lineIndexArray.emplaceBack(o+e.length-1,o),a.push(e[0].x),a.push(e[0].y);for(let i=1;i<e.length;i++)l(e[i],u,h),t.layoutVertexArray.emplaceBack(e[i].x,e[i].y),t.lineIndexArray.emplaceBack(o+i-1,o+i),a.push(e[i].x),a.push(e[i].y);n.vertexLength+=e.length,n.primitiveLength+=e.length}const p=Ll(a,c);for(let e=0;e<p.length;e+=3)t.indexArray.emplaceBack(s+p[e],s+p[e+1],s+p[e+2]);if(p.length>0&&i&&n){const e=i.elevation.isTunnel(),t=i.elevation.safeArea,r=n.addVertices(u,h);n.addTriangles(p,r,e);const o=d.length;if(o>0){for(let s=0;s<o-1;s++)n.addRenderableRing(i.index,d[s]+r,d[s+1]-d[s],e,t,i.featureInfo);n.addRenderableRing(i.index,d[o-1]+r,u.length-d[o-1],e,t,i.featureInfo)}}o.vertexLength+=e,o.primitiveLength+=p.length/3}return[r,o]}}Ys(Th,"FillBucket",{omit:["layers","patternFeatures"]});const Eh=Uc([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),Sh=Uc([{name:"a_z_offset_width",components:4,type:"Float32"}],4),Ih=Uc([{name:"a_elevation_id_col",components:3,type:"Float32"}],4),Ah=Uc([{name:"a_elevation_ground_scale",components:1,type:"Float32"}],4),{members:Mh}=Eh,Ch=Uc([{name:"a_packed",components:3,type:"Float32"}]),{members:Dh}=Ch,Ph=Uc([{name:"a_pattern_data",components:3,type:"Float32"}]),{members:Rh}=Ph;class Lh{constructor(e,t,i,n,r){for(this.properties=Object.create(null),this.extent=i,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=r;e.pos<t;){const t=e.readVarint();if(8===t)this.id=e.readVarint();else if(18===t){const t=e.readVarint()+e.pos;for(;e.pos<t;){const t=n[e.readVarint()],i=r[e.readVarint()];this.properties[t]=i}}else 24===t?this.type=e.readVarint():34===t?(this._geometry=e.pos,e.skip(t)):e.skip(t)}}loadGeometry(){if(this._geometry<0)throw new Error("feature has no geometry");const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos,i=[];let n,r=1,o=0,s=0,a=0;for(;e.pos<t;){if(o<=0){const t=e.readVarint();if(r=7&t,o=t>>3,0===o)continue}if(o--,1===r)s+=e.readSVarint(),a+=e.readSVarint(),n&&i.push(n),n=[new Pe(s,a)];else if(2===r)s+=e.readSVarint(),a+=e.readSVarint(),n&&n.push(new Pe(s,a));else{if(7!==r)throw new Error(`unknown command ${r}`);n&&n.push(n[0].clone())}}return n&&i.push(n),i}bbox(){if(this._geometry<0)throw new Error("feature has no geometry");const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let i=1,n=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;for(;e.pos<t;){if(n<=0){const t=e.readVarint();if(i=7&t,n=t>>3,0===n)continue}if(n--,1===i||2===i)r+=e.readSVarint(),o+=e.readSVarint(),r<s&&(s=r),r>a&&(a=r),o<l&&(l=o),o>c&&(c=o);else if(7!==i)throw new Error(`unknown command ${i}`)}return[s,l,a,c]}toGeoJSON(e,t,i){const n=this.extent*Math.pow(2,i),r=this.extent*e,o=this.extent*t,s=this.loadGeometry();function a(e){return[360*(e.x+r)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+o)/n)*Math.PI))-90]}function l(e){return e.map(a)}let c;if(1===this.type){const e=[];for(const t of s)e.push(t[0]);const t=l(e);c=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){const e=s.map(l);c=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else{if(3!==this.type)throw new Error("unknown feature type");{const e=function(e){const t=e.length;if(t<=1)return[e];const i=[];let n,r;for(let o=0;o<t;o++){const t=zh(e[o]);0!==t&&(void 0===r&&(r=t<0),r===t<0?(n&&i.push(n),n=[e[o]]):n&&n.push(e[o]))}return n&&i.push(n),i}(s),t=[];for(const i of e)t.push(i.map(l));c=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}}const u={type:"Feature",geometry:c,properties:this.properties};return null!=this.id&&(u.id=this.id),u}}function zh(e){let t=0;for(let i,n,r=0,o=e.length,s=o-1;r<o;s=r++)i=e[r],n=e[s],t+=(n.x-i.x)*(i.y+n.y);return t}Lh.types=["Unknown","Point","LineString","Polygon"];class Fh{constructor(e,t){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],void 0===t&&(t=e.length);e.pos<t;){const t=e.readVarint();10===t?this.name=e.readString():18===t?(this._features.push(e.pos),e.skip(t)):26===t?this._keys.push(e.readString()):34===t?this._values.push(Oh(e)):40===t?this.extent=e.readVarint():120===t?this.version=e.readVarint():e.skip(t)}this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const t=this._pbf.readVarint()+this._pbf.pos;return new Lh(this._pbf,t,this.extent,this._keys,this._values)}}function Oh(e){let t=null;const i=e.readVarint()+e.pos;for(;e.pos<i;){const i=e.readVarint();t=10===i?e.readString():21===i?e.readFloat():25===i?e.readDouble():32===i?e.readVarint(!0):40===i?e.readVarint():48===i?e.readSVarint():56===i?e.readBoolean():(e.skip(i),null)}if(null==t)throw new Error("unknown feature value");return t}class kh{constructor(e,t=e.length){const i=Object.create(null);for(;e.pos<t;){const t=e.readVarint();if(26===t){const t=new Fh(e,e.readVarint()+e.pos);t.length&&(i[t.name]=t)}else e.skip(t)}this.layers=i}}function Bh(e,t){for(let i=0;i<e.length;i++)if(Yh(t,e[i]))return!0;for(let i=0;i<t.length;i++)if(Yh(e,t[i]))return!0;return!!jh(e,t)}function Nh(e,t,i){return!!Yh(e,t)||!!Zh(t,e,i)}function Vh(e,t){if(1===e.length)return Wh(t,e[0]);for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t++)if(Yh(e,n[t]))return!0}for(let i=0;i<e.length;i++)if(Wh(t,e[i]))return!0;for(let i=0;i<t.length;i++)if(jh(e,t[i]))return!0;return!1}function Uh(e,t,i){if(e.length>1){if(jh(e,t))return!0;for(let n=0;n<t.length;n++)if(Zh(t[n],e,i))return!0}for(let n=0;n<e.length;n++)if(Zh(e[n],t,i))return!0;return!1}function jh(e,t){if(0===e.length||0===t.length)return!1;for(let i=0;i<e.length-1;i++){const n=e[i],r=e[i+1];for(let e=0;e<t.length-1;e++)if(Gh(n,r,t[e],t[e+1]))return!0}return!1}function Gh(e,t,i,n){return yt(e,i,n)!==yt(t,i,n)&&yt(e,t,i)!==yt(e,t,n)}function $h(e,t,i){return(e.x-i.x)*(t.y-i.y)-(e.y-i.y)*(t.x-i.x)}function Hh(e,t,i,n){const r=$h(e,t,n),o=$h(e,t,i);if(Math.sign(r)===Math.sign(o))return;const s=$h(i,n,e),a=s+o-r;return Math.sign(s)!==Math.sign(a)?[s/(s-a),o/(o-r)]:void 0}function Zh(e,t,i){const n=i*i;if(1===t.length)return e.distSqr(t[0])<n;for(let i=1;i<t.length;i++)if(qh(e,t[i-1],t[i])<n)return!0;return!1}function qh(e,t,i){const n=t.distSqr(i);if(0===n)return e.distSqr(t);const r=((e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y))/n;return e.distSqr(r<0?t:r>1?i:i.sub(t)._mult(r)._add(t))}function Wh(e,t){let i,n,r,o=!1;for(let s=0;s<e.length;s++){i=e[s];for(let e=0,s=i.length-1;e<i.length;s=e++)n=i[e],r=i[s],n.y>t.y!=r.y>t.y&&t.x<(r.x-n.x)*(t.y-n.y)/(r.y-n.y)+n.x&&(o=!o)}return o}function Yh(e,t){let i=!1;for(let n=0,r=e.length-1;n<e.length;r=n++){const o=e[n],s=e[r];o.y>t.y!=s.y>t.y&&t.x<(s.x-o.x)*(t.y-o.y)/(s.y-o.y)+o.x&&(i=!i)}return i}function Xh(e,t,i,n,r){for(const o of e)if(t<=o.x&&i<=o.y&&n>=o.x&&r>=o.y)return!0;const o=[new Pe(t,i),new Pe(t,r),new Pe(n,r),new Pe(n,i)];if(e.length>2)for(const t of o)if(Yh(e,t))return!0;for(let t=0;t<e.length-1;t++)if(Jh(e[t],e[t+1],o))return!0;return!1}function Jh(e,t,i){const n=i[0],r=i[2];if(e.x<n.x&&t.x<n.x||e.x>r.x&&t.x>r.x||e.y<n.y&&t.y<n.y||e.y>r.y&&t.y>r.y)return!1;const o=yt(e,t,i[0]);return o!==yt(e,t,i[1])||o!==yt(e,t,i[2])||o!==yt(e,t,i[3])}function Kh(e,t,i,n,r,o){let s=t.y-e.y,a=e.x-t.x;if(o=o||0){const e=s*s+a*a;if(0===e)return!0;const t=Math.sqrt(e);s/=t,a/=t}return!((i.x-e.x)*s+(i.y-e.y)*a-o<0||(n.x-e.x)*s+(n.y-e.y)*a-o<0||(r.x-e.x)*s+(r.y-e.y)*a-o<0)}function Qh(e,t,i,n,r,o,s){return!(Kh(e,t,n,r,o,s)||Kh(t,i,n,r,o,s)||Kh(i,e,n,r,o,s)||Kh(n,r,e,t,i,s)||Kh(r,o,e,t,i,s)||Kh(o,n,e,t,i,s))}class ed extends Pe{constructor(e,t,i){super(e,t),this.z=i}}class td extends ed{constructor(e,t,i,n){super(e,t,i),this.w=n}}function id(e,t,i,n){const r="x"===i?"y":"x",o=(n-e[i])/(t[i]-e[i]);e[r]=Math.round(e[r]+(t[r]-e[r])*o),e[i]=n,Object.hasOwn(e,"z")&&(e.z=fn(e.z,t.z,o)),Object.hasOwn(e,"w")&&(e.w=fn(e.w,t.w,o))}function nd(e,t,i,n){const r=i,o=n;for(const i of["x","y"]){let n=e,s=t;n[i]>=s[i]&&(n=t,s=e),n[i]<r&&s[i]>r&&id(n,s,i,r),n[i]<o&&s[i]>o&&id(s,n,i,o)}}function rd(e,t,i,n,r,o){const s=[];for(let a=0;a<e.length;a++){const l=e[a];let c;const u=s.length;let h=0;for(let e=0;e<l.length-1;e++){let u=l[e],d=l[e+1],f=0;const p=h;let m,_;o&&(f=Math.hypot(d.x-u.x,d.y-u.y),h+=f,m=u,_=d),u.x<t&&d.x<t||(u.x<t?u=new Pe(t,u.y+(t-u.x)/(d.x-u.x)*(d.y-u.y))._round():d.x<t&&(d=new Pe(t,u.y+(t-u.x)/(d.x-u.x)*(d.y-u.y))._round()),u.y<i&&d.y<i||(u.y<i?u=new Pe(u.x+(i-u.y)/(d.y-u.y)*(d.x-u.x),i)._round():d.y<i&&(d=new Pe(u.x+(i-u.y)/(d.y-u.y)*(d.x-u.x),i)._round()),u.x>=n&&d.x>=n||(u.x>=n?u=new Pe(n,u.y+(n-u.x)/(d.x-u.x)*(d.y-u.y))._round():d.x>=n&&(d=new Pe(n,u.y+(n-u.x)/(d.x-u.x)*(d.y-u.y))._round()),u.y>=r&&d.y>=r||(u.y>=r?u=new Pe(u.x+(r-u.y)/(d.y-u.y)*(d.x-u.x),r)._round():d.y>=r&&(d=new Pe(u.x+(r-u.y)/(d.y-u.y)*(d.x-u.x),r)._round()),c&&u.equals(c.at(-1))||(c=[u],s.push(c),o&&o.push({progress:{min:p+sd(m,_,u)*f,max:1},parentIndex:a,prevPoint:m,nextPoint:_})),c.push(d),o&&(o.at(-1).progress.max=p+sd(m,_,d)*f,o.at(-1).nextPoint=_)))))}if(o&&h>0)for(let e=u;e<s.length;e++)o[e].progress.min/=h,o[e].progress.max/=h}return s}function od(e,t,i,n,r){if(e.length<2)return void n.push(e);const o=[];for(;t.valid();){const[i,n]=t.get();for(let t=0;t<e.length-1;t++){const r=e[t],s=e[t+1],a=Hh(r,s,i,n);if(a){const[e]=a,i=new Pe(fn(r.x,s.x,e),fn(r.y,s.y,e));o.push({t:t+e,distance:0,point:i})}}t.next()}if(0===o.length)return void n.push(e);o.sort((e,t)=>e.t-t.t);let s=0,a=0,l=[];for(n.push(l);s!==e.length;){if(a===o.length){for(;s!==e.length;)0!==l.length&&l.at(-1).equals(e[s])||l.push(e[s]),s++;break}o[a].t<=s?(0!==l.length&&l.at(-1).equals(o[a].point)||l.push(o[a].point),Math.trunc(o[a].t),a++):(0!==l.length&&l.at(-1).equals(e[s])||l.push(e[s]),s++)}}function sd(e,t,i){return e.x!==t.x?(i.x-e.x)/(t.x-e.x):e.y!==t.y?(i.y-e.y)/(t.y-e.y):0}function ad(e,{width:t,height:i},n,r){if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==t*i*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(t*i*n);return e.width=t,e.height=i,e.data=r,e}function ld(e,t,i){const{width:n,height:r}=t;n===e.width&&r===e.height||(cd(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,r)},i,null),e.width=n,e.height=r,e.data=t.data)}function cd(e,t,i,n,r,o,s,a){if(0===r.width||0===r.height)return t;if(r.width>e.width||r.height>e.height||i.x>e.width-r.width||i.y>e.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>t.width||r.height>t.height||n.x>t.width-r.width||n.y>t.height-r.height)throw new RangeError("out of range destination coordinates for image copy");const l=e.data,c=t.data,u=4===o&&a;for(let a=0;a<r.height;a++){const h=((i.y+a)*e.width+i.x)*o,d=((n.y+a)*t.width+n.x)*o;if(u)for(let e=0;e<r.width;e++){const t=h+e*o+3,i=d+e*o;c[i+0]=255,c[i+1]=255,c[i+2]=255,c[i+3]=l[t]}else if(s)for(let e=0;e<r.width;e++){const t=h+e*o,i=d+e*o,n=new mn(l[t+0]/255,l[t+1]/255,l[t+2]/255,l[t+3]).toNonPremultipliedRenderColor(s).toArray();c[i+0]=n[0],c[i+1]=n[1],c[i+2]=n[2],c[i+3]=n[3]}else for(let e=0;e<r.width*o;e++)c[d+e]=l[h+e]}return t}class ud{constructor(e,t){ad(this,e,1,t)}resize(e){ld(this,new ud(e),1)}clone(){return new ud({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,i,n,r){cd(e,t,i,n,r,1,null)}}class hd{constructor(e,t){ad(this,e,4,t)}resize(e){ld(this,new hd(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new hd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,i,n,r,o,s){cd(e,t,i,n,r,4,o,s)}}class dd{constructor(e,t){this.width=e.width,this.height=e.height,this.data=t instanceof Uint8Array?new Float32Array(t.buffer):t}}Ys(ud,"AlphaImage"),Ys(hd,"RGBAImage");class fd{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new ud({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const i=this.getKey(e,t);return this.positions[i]}trim(){const e=this.width,t=this.height=ct(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,i){const n=[];let r=e.length%2==1?-e.at(-1)*i:0,o=e[0]*i,s=!0;n.push({left:r,right:o,isDash:s,zeroLength:0===e[0]});let a=e[0];for(let t=1;t<e.length;t++){s=!s;const l=e[t];r=a*i,a+=l,o=a*i,n.push({left:r,right:o,isDash:s,zeroLength:0===l})}return n}addRoundDash(e,t,i){const n=t/2;
vendor: 18,518 bytes, line 2
2for(let t=-i;t<=i;t++){const r=this.width*(this.nextRow+i+t);let o=0,s=e[o];for(let a=0;a<this.width;a++){a/s.right>1&&(s=e[++o]);const l=Math.abs(a-s.left),c=Math.abs(a-s.right),u=Math.min(l,c);let h;const d=t/i*(n+1);if(s.isDash){const e=n-Math.abs(d);h=Math.sqrt(u*u+e*e)}else h=n-Math.sqrt(u*u+d*d);this.image.data[r+a]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const i=e[t],n=e[t+1];i.zeroLength?e.splice(t,1):n&&n.isDash===i.isDash&&(n.left=i.left,e.splice(t,1))}const i=e[0],n=e.at(-1);i.isDash===n.isDash&&(i.left=n.left-this.width,n.right=i.right+this.width);const r=this.width*this.nextRow;let o=0,s=e[o];for(let i=0;i<this.width;i++){i/s.right>1&&(s=e[++o]);const n=Math.abs(i-s.left),a=Math.abs(i-s.right),l=Math.min(n,a);this.image.data[r+i]=Math.max(0,Math.min(255,(s.isDash?l:-l)+t+128))}}addDash(e,t){const i=this.getKey(e,t);if(this.positions[i])return this.positions[i];const n="round"===t,r=n?7:0,o=2*r+1;if(this.nextRow+o>this.height)return gt("LineAtlas out of space"),null;0===e.length&&e.push(1);let s=0;for(let t=0;t<e.length;t++)e[t]<0&&(gt("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),s+=e[t];if(0!==s){const i=this.width/s,o=this.getDashRanges(e,this.width,i);n?this.addRoundDash(o,i,r):this.addRegularDash(o,"square"===t?.5*i:0)}const a=this.nextRow+r;let l=0;if(0!==s){const e=this.width*a;for(let t=0;t<this.width;t++)this.image.data[e+t]>=128&&l++}const c=Math.round(l/this.width*4095);this.nextRow+=o;const u=Math.floor(s),h={tl:[a,r|c<<4],br:[u,Math.round(65535*(s-u))]};return this.positions[i]=h,h}}Ys(fd,"LineAtlas");const pd="3d_elevation_id",md="level",_d=Lh.types,gd=Math.cos(Math.PI/180*37.5),yd=Math.cos(Math.PI/180*5);class vd{constructor(e){this.evaluationGlobals={zoom:0,lineProgress:void 0},this.elevationType="none",this.isSeaLevelReference=!1,this.showElevationIdDebug=!1,this.terrainEnabled=!1,this.zoom=e.zoom,this.evaluationGlobals.zoom=this.zoom,this.overscaling=e.overscaling,this.pixelRatio=e.pixelRatio,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.borderGradients={},this.layers.forEach(e=>{this.gradients[e.id]={},this.borderGradients[e.id]={}}),this.layoutVertexArray=new Jc,this.layoutVertexArray2=new Kc,this.patternVertexArray=new Kc,this.indexArray=new hu,this.programConfigurations=new _h(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new Gu,this.sourceLayerName=e.sourceLayerName||"",this.maxLineLength=0,this.zOffsetVertexArray=new ru,this.elevationIdColVertexArray=new Kc,this.elevationGroundScaleVertexArray=new Zc,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.tessellationStep=e.tessellationStep?e.tessellationStep:128,this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,i,n){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(e,t,i,n){this.showElevationIdDebug=t.showElevationIdDebug,this.terrainEnabled=t.terrainEnabled,this.hasPattern=sc("line",this.layers,this.pixelRatio,t);const r=this.layers[0].layout.get("line-sort-key");this.tileToMeter=Ic(i);const o=this.layers[0].layout.get("line-elevation-reference");if("hd-road-markup"===o)this.elevationType="road";else{const e=this.layers[0].layout.get("line-z-offset"),t=e.isConstant()&&!e.constantOr(0);this.elevationType="sea"!==o&&"ground"!==o&&t?"none":"offset","offset"===this.elevationType&&"none"===o&>(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`),this.isSeaLevelReference="sea"===o}const s=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope="offset"===this.elevationType&&void 0!==s;const a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Oc(o,e);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),u,i))continue;const h=r?r.evaluate(u,{},i):void 0,d={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Fc(o,i,n),patterns:{},sortKey:h};a.push(d)}r&&a.sort((e,t)=>e.sortKey-t.sortKey);const{lineAtlas:l,featureIndex:c}=t,u=this.addConstantDashes(l);for(const n of a){const{geometry:r,index:o,sourceLayerIndex:s}=n;if(u&&this.addFeatureDashes(n,l),this.hasPattern){const e=ac("line",this.layers,n,this.zoom,this.pixelRatio,t);this.patternFeatures.push(e)}else this.addFeature(n,r,o,i,l.positions,t.availableImages,t.brightness,t.elevationFeatures,t.elevationParams,t.crossSourceElevationEnabled);c.insert(e[o].feature,r,o,s,this.index)}!this.hasPattern&&this.hdExt&&this.hdExt.buildFrcSegments(this),this.hdExt&&this.hdExt.endPopulate()}addConstantDashes(e){let t=!1;for(const i of this.layers){const n=i.paint.get("line-dasharray").value,r=i.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==r.kind)t=!0;else{const t=r.value,i=n.value;if(!i)continue;e.addDash(i,t)}}return t}addFeatureDashes(e,t){const i=this.zoom;for(const n of this.layers){const r=n.paint.get("line-dasharray").value,o=n.layout.get("line-cap").value;if("constant"===r.kind&&"constant"===o.kind)continue;let s,a;if("constant"===r.kind){if(s=r.value,!s)continue}else s=r.evaluate({zoom:i},e);a="constant"===o.kind?o.value:o.evaluate({zoom:i},e),t.addDash(s,a),e.patterns[n.id]=[t.getKey(s,a)]}}update(e,t,i,n,r,o,s,a,l){this.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,l)}updateExpressions(e){this.programConfigurations.updateExpressions(e)}addFeatures(e,t,i,n,r,o){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,t,i,n,o,e.elevationFeatures,e.elevationParams,e.crossSourceElevationEnabled);this.hdExt&&(this.hdExt.buildFrcSegments(this),this.hdExt.endPopulate())}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Dh)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,Rh)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Sh.members,!0)),!this.elevationIdColVertexBuffer&&this.elevationIdColVertexArray.length>0&&(this.elevationIdColVertexBuffer=e.createVertexBuffer(this.elevationIdColVertexArray,Ih.members,!0)),!this.elevationGroundScaleVertexBuffer&&this.elevationGroundScaleVertexArray.length>0&&(this.elevationGroundScaleVertexBuffer=e.createVertexBuffer(this.elevationGroundScaleVertexArray,Ah.members,!0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Mh),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.elevationIdColVertexBuffer&&this.elevationIdColVertexBuffer.destroy(),this.elevationGroundScaleVertexBuffer&&this.elevationGroundScaleVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e,t){let i,n;if(t&&t>0?(i=`mapbox_clip_start_${t}`,n=`mapbox_clip_end_${t}`):(i="mapbox_clip_start",n="mapbox_clip_end"),e.properties&&Object.hasOwn(e.properties,i)&&Object.hasOwn(e.properties,n))return{start:+e.properties[i],end:+e.properties[n]}}addFeature(e,t,i,n,r,o,s,a,l,c){const u=this.layers[0].layout,h=this.hdExt?this.hdExt.trackFeatureFrc(e.properties):null,d=this.indexArray.length,f=u.get("line-join").evaluate(e,{}),p=u.get("line-cap").evaluate(e,{}),m=u.get("line-miter-limit"),_=u.get("line-round-limit");this.lineClips=this.lineFeatureClips(e),this.lineFeature=e;const g=!(!e.properties||!Object.hasOwn(e.properties,"mapbox_line_metrics"))&&e.properties.mapbox_line_metrics;this.zOffsetValue=u.get("line-z-offset").value;const y=this.layers[0].paint,v=y.get("line-width").value;"constant"!==v.kind&&!1===v.isLineProgressConstant&&(this.variableWidthValue=v);const x=y.get("line-emissive-strength").value;if("constant"!==x.kind&&!1===x.isLineProgressConstant&&(this.variableEmissiveStrengthValue=x),this.isSeaLevelReference){const e=u.get("line-elevation-ground-scale").value;"constant"===e.kind&&0===e.value||(this.elevationGroundScaleValue=e)}if(null==this.hdExt||!this.hdExt.handleFeature(e,t,n,a,l,!!c,f,p,m,_,this))for(let i=0;i<t.length;i++)this.addLine(t[i],e,n,f,p,m,_,void 0,g&&i>0?i:null);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,r,o,n,s,void 0,this.worldview),this.hdExt&&this.hdExt.recordFeatureRange(this,d,this.indexArray.length,h)}fillNonElevatedRoadSegment(e){for(let t=Math.max(e,this.zOffsetVertexArray.length);t<this.layoutVertexArray.length;t++)this.zOffsetVertexArray.emplaceBack(0,0,0,0),this.showElevationIdDebug&&this.elevationIdColVertexArray.emplaceBack(0,0,0)}addLine(e,t,i,n,r,o,s,a,l){this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineSoFar=0,this.currentVertex=void 0,this.lineClips=l?this.lineFeatureClips(t,l):this.lineClips;const c="none"===n;this.patternJoinNone=this.hasPattern&&c,this.currentLineJoinType=n,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[];const u=a&&a.progress.min>0,h=a&&a.progress.max<1;if(this.lineClips){let i={min:this.lineClips.start,max:this.lineClips.end},n=1;if(a){const e=this.lineClips.end-this.lineClips.start;i=function(e,t,i){return{min:Dt(e.min,t,i),max:Dt(e.max,t,i)}}(a.progress,{min:0,max:1},i),e>0&&(n=(i.max-i.min)/e)}const r=+t.properties.mapbox_clip_feature_len,o=+t.properties.mapbox_clip_seg_len;if(Number.isNaN(r)||Number.isNaN(o)){for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);const t=this.totalDistance/(i.max-i.min);this.totalFeatureLength=Number.isFinite(t)?t:0,this.lineClips.start=i.min,this.lineClips.end=i.max,this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}else this.totalFeatureLength=r,this.totalDistance=o*n,this.lineClips.start=i.min,this.lineClips.end=i.max,this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance);this.lineClipsArray.push(this.lineClips),this.updateScaledDistance()}const d="Polygon"===_d[t.type];let f=e.length;for(;f>=2&&e[f-1].equals(e[f-2]);)f--;let p=0;for(;p<f-1&&e[p].equals(e[p+1]);)p++;if(f<(d?3:2))return;"bevel"===n&&(o=1.05);const m=this.segments.prepareSegment(10*f,this.layoutVertexArray,this.indexArray);let _,g,y,v,x,b,w,T;a&&a.prevDir&&(b=a.prevDir.perp()),a&&a.nextDir&&(w=a.nextDir.perp()),this.e1=this.e2=-1,d&&(_=e[f-2],x=e[p].sub(_)._unit()._perp());for(let t=p;t<f;t++){if(y=t===f-1?d?e[p+1]:void 0:e[t+1],y&&e[t].equals(y))continue;x&&(v=x),_&&(g=_),_=e[t],T=this.evaluateLineProgressFeatures(g?g.dist(_):0),x=y?y.sub(_)._unit()._perp():v,v=v||x;const i=g&&y;let a=i?n:d||c?"butt":r;const l=v.x*x.x+v.y*x.y;if(c){const e=function(e){if(e.patternJoinNone){const t=e.segmentPoints.length/2,i=e.lineSoFar-e.segmentStart;for(let n=0;n<t;++n){const t=e.segmentPoints[2*n+1],r=Math.round(e.segmentPoints[2*n])+.5+.25*t;e.patternVertexArray.emplaceBack(r,i,e.segmentStart),e.patternVertexArray.emplaceBack(r,i,e.segmentStart)}e.segmentPoints.length=0}e.e1=e.e2=-1};if(i&&l<yd){this.updateDistance(g,_),this.addCurrentVertex(_,v,1,1,m,T),e(this),this.addCurrentVertex(_,x,-1,-1,m,T);continue}if(g){if(!y){this.updateDistance(g,_),this.addCurrentVertex(_,v,1,1,m,T),e(this);continue}a="miter"}}let E=v.add(x);0===E.x&&0===E.y||E._unit();const S=E.x*x.x+E.y*x.y,I=0!==S?1/S:1/0,A=2*Math.sqrt(2-2*S),M=S<gd&&g&&y,C=v.x*x.y-v.y*x.x>0,D=this.overscaling<=16?122880/(512*this.overscaling):0;if(i&&"round"===a)if(I<s)a="miter";else if(I<=2){const e=xd(_,-10,8202);a="offset"===this.elevationType&&(e||this.hasCrossSlope)?"miter":"fakeround"}if("miter"===a&&I>o&&(a="bevel"),"bevel"===a&&(I>2&&(a="flipbevel"),I<o&&(a="miter")),g&&!("miter"===a&&M)&&this.updateDistance(g,_),"miter"===a)if(M){const e=_.dist(g);if(e>2*D){const t=_.sub(_.sub(g)._mult(D/e)._round());this.updateDistance(g,t),this.addCurrentVertex(t,v,0,0,m,T),g=t}this.updateDistance(g,_),E._mult(I),this.addCurrentVertex(_,E,0,0,m,T);const t=_.dist(y);if(t>2*D){const e=_.add(y.sub(_)._mult(D/t)._round());this.updateDistance(_,e),this.addCurrentVertex(e,x,0,0,m,T),_=e}}else E._mult(I),this.addCurrentVertex(_,E,0,0,m,T);else if("flipbevel"===a){if(I>100)E=x.mult(-1);else{const e=I*v.add(x).mag()/v.sub(x).mag();E._perp()._mult(e*(C?-1:1))}this.addCurrentVertex(_,E,0,0,m,T),this.addCurrentVertex(_,E.mult(-1),0,0,m,T)}else if("bevel"===a||"fakeround"===a){const e=_.dist(g);let t=1;if("offset"===this.elevationType&&"bevel"===a&&"round"!==this.currentLineJoinType&&!this.patternJoinNone&&null!=T&&g&&y){const i=4*D;e<i&&(t=Math.max(0,e/i))}null!=T&&g&&this.addCurrentVertex(_,w||v,-t,-t,m,T);const i=e<=1*D&&"bevel"!==a,n=i?1:I,r=E.mult(C?1:-1);r._mult(n);const o=x.mult(C?-1:1),s=v.mult(C?-1:1),c=this.evaluateLineProgressFeatures(this.distance);if(null==T&&(this.addHalfVertex(_,r.x,r.y,!1,!C,0,m,c),i||this.addHalfVertex(_,r.x+2*s.x,r.y+2*s.y,!1,C,0,m,c)),"fakeround"===a){const e=Math.round(180*A/Math.PI/20);this.addHalfVertex(_,s.x,s.y,!1,C,0,m,c);for(let t=0;t<e;t++){let i=t/e;if(.5!==i){const e=i-.5;i+=i*e*(i-1)*((1.0904+l*(l*(3.55645-1.43519*l)-3.2452))*e*e+(.848013+l*(.215638*l-1.06021)))}const n=o.sub(s)._mult(i)._add(s)._unit();this.addHalfVertex(_,n.x,n.y,!1,C,0,m,c)}this.addHalfVertex(_,o.x,o.y,!1,C,0,m,c)}i||null!=T||this.addHalfVertex(_,r.x+2*o.x,r.y+2*o.y,!1,C,0,m,c),null!=T&&y&&this.addCurrentVertex(_,b||x,t,t,m,T)}else if("butt"===a)this.addCurrentVertex(_,E,0,0,m,T);else if("square"===a){if(!g){const e=u?0:-1;this.addCurrentVertex(_,E,e,e,m,T)}if(this.addCurrentVertex(_,E,0,0,m,T),g){const e=h?0:1;this.addCurrentVertex(_,E,e,e,m,T)}}else if("round"===a){if(g){const e=!i&&w?w:v;this.addCurrentVertex(_,e,0,0,m,T),!i&&h||this.addCurrentVertex(_,e,1,1,m,T,!0)}if(y){const e=!i&&b?b:x;!i&&u||this.addCurrentVertex(_,e,-1,-1,m,T,!0),this.addCurrentVertex(_,e,0,0,m,T)}}}}addVerticesTo(e,t,i,n,r,o,s,a,l,c){const u=(t.w-e.w)/this.tessellationStep|0;let h=0;const d=this.scaledDistance;if(u>1){this.lineSoFar=e.w;const i=(t.x-e.x)/u,n=(t.y-e.y)/u,r=(t.z-e.z)/u,o=(t.w-e.w)/u,s=t.x-e.x,a=t.y-e.y,d=Math.sqrt(s*s+a*a);if(0===d)return;const f=-a/d,p=s/d,m=f,_=p,g=-f,y=-p;for(let t=1;t<u;++t){e.x+=i,e.y+=n,e.z+=r,this.lineSoFar+=o,h+=o;const t=this.evaluateLineProgressFeatures(this.prevDistance+h);this.scaledDistance=(this.prevDistance+h)/this.totalDistance,this.addHalfVertex(e,m,_,c,!1,0,l,t),this.addHalfVertex(e,g,y,c,!0,0,l,t)}}this.lineSoFar=t.w,this.scaledDistance=d;const f=this.evaluateLineProgressFeatures(this.distance);this.addHalfVertex(t,i,n,c,!1,s,l,f),this.addHalfVertex(t,r,o,c,!0,-a,l,f)}evaluateLineProgressFeatures(e){if(!this.variableWidthValue&&!this.variableEmissiveStrengthValue&&"offset"!==this.elevationType)return null;this.evaluationGlobals.lineProgress=0,this.lineClips?this.evaluationGlobals.lineProgress=Math.min(1,(this.totalFeatureLength*this.lineClips.start+e)/this.totalFeatureLength):gt(`line-progress evaluation for ${this.layerIds[0]} requires enabling 'lineMetrics' for the source.`);let t=0;this.variableWidthValue&&"constant"!==this.variableWidthValue.kind&&(t=this.variableWidthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0,t*=.5);let i=0;this.variableEmissiveStrengthValue&&"constant"!==this.variableEmissiveStrengthValue.kind&&(i=this.variableEmissiveStrengthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0);const n=this.evaluateElevationGroundScale();return"offset"!==this.elevationType?{zOffset:0,variableWidth:t,elevationGroundScale:n,variableEmissiveStrength:i}:"constant"===this.zOffsetValue.kind?{zOffset:this.zOffsetValue.value,variableWidth:t,elevationGroundScale:n,variableEmissiveStrength:i}:{zOffset:this.zOffsetValue.evaluate(this.evaluationGlobals,this.lineFeature)||0,variableWidth:t,elevationGroundScale:n,variableEmissiveStrength:i}}evaluateElevationGroundScale(){return this.elevationGroundScaleValue?"constant"===this.elevationGroundScaleValue.kind?this.elevationGroundScaleValue.value:this.elevationGroundScaleValue.evaluate(this.evaluationGlobals,this.lineFeature)||0:0}addCurrentVertex(e,t,i,n,r,o,s=!1){const a=t.x+t.y*i,l=t.y-t.x*i,c=t.y*n-t.x,u=-t.y-t.x*n;if(null!=o){const t="offset"===this.elevationType,h="offset"===this.elevationType?2:10,d=-h,f=Cr+h,p=o.zOffset,m=new td(e.x,e.y,p,this.lineSoFar),_=!!t&&xd(e,d,f),g=this.lineSoFar,y=this.distance;if(this.currentVertex)if(_){const t=this.currentVertexIsOutside,o=this.currentVertex,h=new td(e.x,e.y,p,this.lineSoFar);if(nd(o,h,d,f),!xd(h,d,f)){if(t){this.e1=this.e2=-1,this.distance-=o.dist(m),this.lineSoFar=o.w;const e=this.evaluateLineProgressFeatures(o.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(o,a,l,s,!1,i,r,e),this.addHalfVertex(o,c,u,s,!0,-n,r,e),this.prevDistance=this.distance}this.distance=this.prevDistance+o.dist(h),this.scaledDistance=this.distance/this.totalDistance,this.addVerticesTo(o,h,a,l,c,u,i,n,r,s),this.distance=y,this.scaledDistance=this.distance/this.totalDistance}}else{const e=this.currentVertex;if(this.currentVertexIsOutside){nd(e,m,d,f),this.e1=this.e2=-1,this.distance-=e.dist(m),this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e.w;const t=this.evaluateLineProgressFeatures(e.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(e,a,l,s,!1,i,r,t),this.addHalfVertex(e,c,u,s,!0,-n,r,t),this.prevDistance=this.distance,this.distance=y,this.scaledDistance=this.distance/this.totalDistance}this.addVerticesTo(e,m,a,l,c,u,i,n,r,s)}else _||(this.addHalfVertex(e,a,l,s,!1,i,r,o),this.addHalfVertex(e,c,u,s,!0,-n,r,o));this.currentVertex=m,this.currentVertexIsOutside=_,this.lineSoFar=g}else this.addHalfVertex(e,a,l,s,!1,i,r,o),this.addHalfVertex(e,c,u,s,!0,-n,r,o)}addHalfVertex({x:e,y:t},i,n,r,o,s,a,l){if(this.patternJoinNone&&(0===this.segmentPoints.length&&(this.segmentStart=this.lineSoFar,this.segmentStartf32=Math.fround(this.lineSoFar)),o||this.segmentPoints.push(this.lineSoFar-this.segmentStart,s)),this.layoutVertexArray.emplaceBack((e<<1)+(r?1:0),(t<<1)+(o?1:0),Math.round(63*i)+128,Math.round(63*n)+128,1+(0===s?0:s<0?-1:1),0,this.lineS
vendor: 8,752 bytes, line 2
2oFar-this.segmentStartf32),this.lineClips){const e=fn(this.lineClips.start,this.lineClips.end,this.scaledDistance);this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,e)}const c=a.vertexLength++;if(this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),a.primitiveLength++),o?this.e2=c:this.e1=c,null!=l&&(this.zOffsetVertexArray.emplaceBack(l.zOffset,l.variableWidth,l.variableWidth,l.variableEmissiveStrength),this.showElevationIdDebug&&this.elevationIdColVertexArray.emplaceBack(0,0,0)),this.elevationGroundScaleValue){const e=l?l.elevationGroundScale:this.evaluateElevationGroundScale();this.elevationGroundScaleVertexArray.emplaceBack(e)}}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(e,t){this.prevDistance=this.distance,this.distance+=e.dist(t),this.updateScaledDistance()}}function xd(e,t,i){return e.x<t||e.x>i||e.y<t||e.y>i}Ys(vd,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const bd=Uc([{name:"a_pos",components:2,type:"Int16"}],4),wd=Uc([{name:"a_circle_z_offset",components:1,type:"Float32"}],4),Td=Uc([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Ed{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Gc,this.indexArray=new hu,this.segments=new Gu,this.programConfigurations=new _h(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,i,n){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(e,t,i,n){const r=this.layers[0],o=[];let s=null;"circle"===r.type&&(s=r.layout.get("circle-sort-key"));for(const{feature:r,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Oc(r,e);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),u,i))continue;const h=s?s.evaluate(u,{},i):void 0,d={id:a,properties:r.properties,type:r.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Fc(r,i,n),patterns:{},sortKey:h};o.push(d)}s&&o.sort((e,t)=>e.sortKey-t.sortKey);let a=null;"globe"===n.projection.name&&(this.globeExtVertexArray=new tu,a=n.projection);for(const n of o){const{geometry:r,index:o,sourceLayerIndex:s}=n,l=e[o].feature;this.addFeature(n,r,o,t.availableImages,i,a,t.brightness,t.elevationFeatures),t.featureIndex.insert(l,r,o,s,this.index)}this.hdExt&&this.hdExt.finalize()}update(e,t,i,n,r,o,s){this.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,this.worldview)}updateExpressions(e){this.programConfigurations.updateExpressions(e)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,bd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Td.members)),this.hdExt&&this.hdExt.upload(e)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.hdExt&&this.hdExt.destroy())}addFeature(e,t,i,n,r,o,s,a){this.hdExt&&this.hdExt.beginFeature(e,a,r);for(const i of t)for(const t of i){const i=t.x,n=t.y;if(i<0||i>=Cr||n<0||n>=Cr)continue;if(o){const e=o.projectTilePoint(i,n,r),t=o.upVector(r,i,n);this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t),this.addGlobeExtVertex(e,t)}const s=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=s.vertexLength;this.addCircleVertex(i,n,-1,-1),this.addCircleVertex(i,n,1,-1),this.addCircleVertex(i,n,1,1),this.addCircleVertex(i,n,-1,1),this.hdExt&&this.hdExt.writeVertexQuad(i,n),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+2,a+3),s.vertexLength+=4,s.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{},n,r,s,void 0,this.worldview)}addCircleVertex(e,t,i,n){this.layoutVertexArray.emplaceBack(2*e+(i+1)/2,2*t+(n+1)/2)}addGlobeExtVertex(e,t){const i=16384;this.globeExtVertexArray.emplaceBack(e.x,e.y,e.z,t[0]*i,t[1]*i,t[2]*i)}}Ys(Ed,"CircleBucket",{omit:["layers"]});const Sd=Uc([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Id=Uc([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Ad=Uc([{name:"a_projected_pos",components:4,type:"Float32"}],4);Uc([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Md=Uc([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),Cd=Uc([{name:"a_feature_index",components:1,type:"Float32"}],4),Dd=Uc([{name:"a_x_axis",components:3,type:"Float32"},{name:"a_y_axis",components:3,type:"Float32"}]),Pd=Uc([{name:"a_texb",components:2,type:"Uint16"}]),Rd=Uc([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),Ld=Uc([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);Uc([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const zd=Uc([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Fd=Uc([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Uc([{name:"triangle",components:3,type:"Uint16"}]),Uc([{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"}]),Uc([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{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"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"},{type:"Uint16",name:"elevationFeatureIndex"}
vendor: 14,867 bytes, line 2
2]),Uc([{type:"Float32",name:"offsetX"}]),Uc([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);const Od=new Float32Array(1),kd=new Uint32Array(Od.buffer);function Bd(e){return Od[0]=e,kd[0]}const Nd=class e{static getBlockIndices(t){let i=e._blockIndicesTemplate;if(!i){i=e._blockIndicesTemplate=new Uint32Array(t);for(let e=0;e<t;e++)i[e]=e}return i}constructor(e,t,i,n){this.batchIndex=t,this.headerBuffer=null,this.propertiesBuffer=null,this.blockIndicesBuffer=null,this.context=e||null,this.propsDwords=i,this.totalBytes=4*this.propsDwords,this.headerData=n,this.propertiesData=new Float32Array(this.propsDwords),this._headerDirty=!0,this._propsDirtyMin=-1,this._propsDirtyMax=-1,this._blockIndicesDirty=!0,e&&this._initBuffers(e)}_initBuffers(t){const i=t.gl;if(this.totalBytes>t.maxUniformBlockSize)throw new Error(`UBO size ${this.totalBytes} exceeds device limit ${t.maxUniformBlockSize}`);i.isContextLost()||(this.headerBuffer=i.createBuffer(),i.bindBuffer(i.UNIFORM_BUFFER,this.headerBuffer),i.bufferData(i.UNIFORM_BUFFER,e.HEADER_BYTES,i.DYNAMIC_DRAW),this.propertiesBuffer=i.createBuffer(),i.bindBuffer(i.UNIFORM_BUFFER,this.propertiesBuffer),i.bufferData(i.UNIFORM_BUFFER,this.totalBytes,i.DYNAMIC_DRAW),this.blockIndicesBuffer=i.createBuffer(),i.bindBuffer(i.UNIFORM_BUFFER,this.blockIndicesBuffer),i.bufferData(i.UNIFORM_BUFFER,this.totalBytes,i.DYNAMIC_DRAW),i.bindBuffer(i.UNIFORM_BUFFER,null))}markHeaderDirty(){this._headerDirty=!0}writeDataDrivenBlock(e,t){const i=this.headerData,n=4*i[2];if(0===n)return;const r=t*n;if(r+n>this.propertiesData.length)throw new Error(`UBO write out of bounds: feature index ${t} exceeds propertiesData capacity`);const o=i[0];for(let t=0;t<9;t++)o&1<<t&&this._copyFromFlat(r+4*i[3+t],t,e);(-1===this._propsDirtyMin||r<this._propsDirtyMin)&&(this._propsDirtyMin=r);const s=r+n;s>this._propsDirtyMax&&(this._propsDirtyMax=s)}rightSizeForTransfer(){const e=-1===this._propsDirtyMax?0:this._propsDirtyMax;e<this.propertiesData.length&&(this.propertiesData=this.propertiesData.slice(0,e))}_copyFromFlat(t,i,n){let r=4;(i<2||8===i)&&(r=this.headerData[1]>>>i&1?8:4);const o=e.EVAL_FLAT_OFFSETS[i];this.propertiesData.set(n.subarray(o,o+r),t)}upload(t){this.context||(this.context=t);const i=t.gl;this.headerBuffer&&this.propertiesBuffer&&this.blockIndicesBuffer||this._initBuffers(t);let n=!1;if(this._headerDirty&&(i.bindBuffer(i.UNIFORM_BUFFER,this.headerBuffer),i.bufferSubData(i.UNIFORM_BUFFER,0,this.headerData),this._headerDirty=!1,n=!0),-1!==this._propsDirtyMin){const e=this._propsDirtyMin,t=this._propsDirtyMax;i.bindBuffer(i.UNIFORM_BUFFER,this.propertiesBuffer),i.bufferSubData(i.UNIFORM_BUFFER,4*e,this.propertiesData,e,t-e),this._propsDirtyMin=-1,this._propsDirtyMax=-1,n=!0}this._blockIndicesDirty&&(i.bindBuffer(i.UNIFORM_BUFFER,this.blockIndicesBuffer),i.bufferSubData(i.UNIFORM_BUFFER,0,e.getBlockIndices(this.propsDwords)),this._blockIndicesDirty=!1,n=!0),n&&i.bindBuffer(i.UNIFORM_BUFFER,null)}bind(e,t){const i=e.gl,n=(e,n,r)=>{if(!n)return;const o=i.getUniformBlockIndex(t,e);o!==i.INVALID_INDEX&&(i.uniformBlockBinding(t,o,r),i.bindBufferBase(i.UNIFORM_BUFFER,r,n))},r=3*this.batchIndex;n("SymbolPaintPropertiesHeaderUniform",this.headerBuffer,r),n("SymbolPaintPropertiesUniform",this.propertiesBuffer,r+1),n("SymbolPaintPropertiesIndexUniform",this.blockIndicesBuffer,r+2)}destroy(){if(this.context){const e=this.context.gl;this.headerBuffer&&(e.deleteBuffer(this.headerBuffer),this.headerBuffer=null),this.propertiesBuffer&&(e.deleteBuffer(this.propertiesBuffer),this.propertiesBuffer=null),this.blockIndicesBuffer&&(e.deleteBuffer(this.blockIndicesBuffer),this.blockIndicesBuffer=null)}}};Nd.HEADER_DWORDS=16,Nd.HEADER_BYTES=64,Nd.EVAL_FLAT_OFFSETS=[0,8,16,20,24,28,32,36,40],Nd.EVAL_FLAT_TOTAL=48,Nd._blockIndicesTemplate=null;let Vd=Nd;function Ud(e,t,i,n,r,o,s,a){return!!e&&("constant"===e.kind?"none"===e.value:"none"===e.evaluate({zoom:0,brightness:o,worldview:a},t,i,r,n,s))}function jd(e){if(!(e instanceof Ka))return!1;const t=e.value;return("source"===t.kind||"composite"===t.kind)&&t.isStateDependent}Ys(Vd,"SymbolPropertiesUBO",{omit:["headerBuffer","propertiesBuffer","blockIndicesBuffer"]});const Gd=["icon","text"].map(e=>[`${e}-color`,`${e}-halo-color`,`${e}-opacity`,`${e}-halo-width`,`${e}-halo-blur`,`${e}-emissive-strength`,`${e}-occlusion-opacity`,"symbol-z-offset",`${e}-translate`]),$d=new Float32Array(Vd.EVAL_FLAT_TOTAL),Hd=[0,0],Zd=new WeakMap;class qd{constructor(e,t,i,n,r="",o,s){this.layer=e,this.zoom=t,this.lut=i,this.isText=n,this.worldview=r,this.maxUniformBufferBindings=o||24,this.uboSizeDwords=s||4096,this.allFeatureVtIndices=[],this.allFeatureIds=[],this.allFormattedSections=[],this.featureVertexRangesFromId=null,this.featureVertexRangesFromVtIndex=null,this.ubos=[],this.featureCount=0,this.cachedConstantUniforms=null,this.cachedConstantRenderZoom=null,this.cachedConstantBrightness=void 0,this.cachedConstantPaint=null,this.activeAppearanceByVtIndex=null,this.zoomDependency=new Uint8Array(9),this.sharedZoomRanges=new Float32Array(18),this._zoomRangeScratch=new Float32Array(2),this._floorZoom=Math.floor(this.zoom),this.header=new Uint32Array(Vd.HEADER_DWORDS),this.updateHeader(),this.isAllConstant=0===this.header[0];const a=4*this.header[2];this.maxFeaturesPerBatch=0===a?Number.MAX_SAFE_INTEGER:Math.floor(this.uboSizeDwords/a)}updateHeader(){const e=this.layer.paint;let t=0,i=0,n=0,r=0,o=!0;const s=this._floorZoom,a=Gd[+this.isText];for(let l=0;l<9;l++){const c=a[l],u=l<2,h=e.get(c),d=!(!h||"function"!=typeof h.isConstant||h.isConstant()),f=this._appearancesHavePaintProperties(c);if(!d&&!f){const e=this._layerUnevaluated(c);e&&e.expression&&"camera"===e.expression.kind&&(n|=1<<l);continue}t|=1<<l;const p=this._collectZoomSignatures(c,s),m=p.hasZoom,_=p.differs,g=8===l;this.zoomDependency[l]=_?2:m?1:0;const y=_||g&&m;y&&(i|=1<<l);const v=h&&h.value;v&&!1===v.isLightConstant&&(o=!1),this.header[3+l]=r,r+=y?2:1,m&&!_&&p.representative&&(this._computeZoomRange(p.representative,s,this.sharedZoomRanges,2*l),u&&(this.header[12+2*l]=Bd(this.sharedZoomRanges[2*l]),this.header[12+2*l+1]=Bd(this.sharedZoomRanges[2*l+1])))}this.header[0]=t,this.header[1]=i,this.header[2]=r,this.isLightConstant=o,this.cameraMask=n}_recomputeSharedRanges(){const e=this._floorZoom,t=Gd[+this.isText];let i=0,n=!1;for(let r=0;r<9;r++){const o=t[r],s=this.zoomDependency[r];if(this.header[0]&1<<r){if(0!==s&&2!==s){const t=this._collectZoomSignatures(o,e);t.representative&&(this._computeZoomRange(t.representative,e,this.sharedZoomRanges,2*r),r<2&&(this.header[12+2*r]=Bd(this.sharedZoomRanges[2*r]),this.header[12+2*r+1]=Bd(this.sharedZoomRanges[2*r+1]),n=!0))}}else{const e=this._layerUnevaluated(o);e&&e.expression&&"camera"===e.expression.kind&&(i|=1<<r)}}if(this.cameraMask=i,n)for(const e of this.ubos)e.markHeaderDirty()}_collectZoomSignatures(e,t){let i=!1,n=!1,r=null,o=0,s=0;const a=e=>{if(!e)return;this._computeZoomRange(e,t,this._zoomRangeScratch,0);const a=this._zoomRangeScratch[0],l=this._zoomRangeScratch[1];i?a===o&&l===s||(n=!0):(i=!0,o=a,s=l,r=e)};a(this._zoomExprOf(this._layerUnevaluated(e)));for(const t of this.layer.getAppearances()||[])t.hasPaintProperty(e)&&a(this._zoomExprOf(t.getUnevaluatedPaintProperty(e)));return{hasZoom:i,differs:n,representative:r}}evaluateAllProperties(e,t,i,n,r,o,s){const a={brightness:r,worldview:this.worldview},l={feature:e,featureState:t,canonical:i,availableImages:n,params:new Ha(this.zoom,a),paramsNext:new Ha(this.zoom+1,a),formattedSection:o,activeAppearance:s},c=Gd[+this.isText];for(let e=0;e<9;e++){const t=c[e],i=e<2,n=8===e,r=this.zoomDependency[e],o=0!==r,s=2===r,a=Vd.EVAL_FLAT_OFFSETS[e],u=a+(i||n?4:2);i?this._evaluateColorValue(t,e,o,s,u,l,a):n?this._evaluateTranslateValue(t,e,o,s,u,l,a):this._evaluateFloatValue(t,e,o,s,u,l,a)}return $d}_resolveProp(e,t,i=!1,n){const r=this.layer.paint,o=r.get(e),s=e,a=!(!t||!t.hasPaintProperty(s)),l=a?n&&o&&o.property.overrides&&o.property.overrides.hasOverride(n)?o:t.paintProperties.get(s):r.get(e);if(i||!l||"function"!=typeof l.isConstant||!l.isConstant())return l;const c=a?t.getUnevaluatedPaintProperty(s):this._layerUnevaluated(e);return this._unbakeCamera(l,c)}_unbakeCamera(e,t){const i=t&&t.expression;if(!i||"camera"!==i.kind)return e;let n=Zd.get(t);return n||(n=new Ka(e.property,i,e.parameters,e.iconImageUseTheme),Zd.set(t,n)),n}_layerUnevaluated(e){const t=this.layer._transitionablePaint._values[e];return t&&t.value}_zoomExprOf(e){const t=e&&e.expression;return!t||"composite"!==t.kind&&"camera"!==t.kind?null:t}_evalAt(e,t,i){return e.property.evaluate(e.value,t,i.feature,i.featureState,i.canonical,i.availableImages,e.iconImageUseTheme,i.formattedSection)}_evaluateColorValue(e,t,i,n,r,o,s){const a=this._resolveProp(e,o.activeAppearance,!1,o.formattedSection);if(this._writePropertyZoomRange(t,i,n,a,r),!a)return $d[s]=0,$d[s+1]=0,$d[s+2]=0,void($d[s+3]=1);const l=this._resolveProp(`${e}-use-theme`,o.activeAppearance,!0),c=Ud(l&&"string"!=typeof l?l.value:void 0,o.feature,o.featureState,o.availableImages,o.canonical,o.params.brightness,o.formattedSection,this.worldview)?null:this.lut,u=(a.isConstant()?a.constantOr(mn.transparent):this._evalAt(a,o.params,o)||mn.transparent).toNonPremultipliedRenderColor(c);if($d[s]=$u(255*u.r,255*u.g),$d[s+1]=$u(255*u.b,255*u.a),i){const e=(this._evalAt(a,o.paramsNext,o)||mn.transparent).toNonPremultipliedRenderColor(c);$d[s+2]=$u(255*e.r,255*e.g),$d[s+3]=$u(255*e.b,255*e.a)}else $d[s+2]=$d[s],$d[s+3]=$d[s+1]}_computeZoomRange(e,t,i,n){let r=0,o=1;const s=!e||"composite"!==e.kind&&"camera"!==e.kind?null:e.zoomStops;if(s&&s.length>0)if(null==e.interpolationType){r=o=1;for(const e of s)if(e>t&&e<t+1){r=o=e-t;break}}else s[0]>t&&s[0]<t+1&&(r=s[0]-t);i[n]=r,i[n+1]=o}_writeZoomRange(e,t){this._computeZoomRange(e&&e.value,this._floorZoom,$d,t)}_writePropertyZoomRange(e,t,i,n,r){i?this._writeZoomRange(n,r):t?($d[r]=this.sharedZoomRanges[2*e],$d[r+1]=this.sharedZoomRanges[2*e+1]):($d[r]=0,$d[r+1]=0)}_evaluateFloatValue(e,t,i,n,r,o,s){const a=e.endsWith("opacity")?1:0,l=this._resolveProp(e,o.activeAppearance);this._writePropertyZoomRange(t,i,n,l,r);const c=(l?l.isConstant()?l.constantOr(a):this._evalAt(l,o.params,o):a)??a;if($d[s]=c,i){const e=this._evalAt(l,o.paramsNext,o);$d[s+1]=e??a}else $d[s+1]=c}_evaluateTranslateValue(e,t,i,n,r,o,s){const a=this._resolveProp(e,o.activeAppearance);this._writePropertyZoomRange(t,i,n,a,r);const l=!!a&&"function"==typeof a.isConstant&&!a.isConstant(),c=a?"function"!=typeof a.isConstant?a:l?this._evalAt(a,o.params,o):a.constantOr(Hd):void 0;if($d[s]=c?c[0]:0,$d[s+1]=c?c[1]:0,i){const e=l?this._evalAt(a,o.paramsNext,o):c;$d[s+2]=e?e[0]:0,$d[s+3]=e?e[1]:0}else $d[s+2]=$d[s],$d[s+3]=$d[s+1]}_appearancesHavePaintProperties(e){return this.layer.getAppearances().some(t=>t.hasPaintProperty(e))}hasStateDependentPaint(e){const t=e.paint,i=Gd[+this.isText];for(const e of i)if(jd(t.get(e)))return!0;for(const t of e.getAppearances()||[])for(const e of i){const i=e;if(t.hasPaintProperty(i)&&jd(t.paintProperties.get(i)))return!0}return!1}hasPerFeatureTranslate(){return!!(256&this.header[0])}getCurrentBatchIndex(){return 0===this.maxFeaturesPerBatch?0:Math.floor(this.featureCount/this.maxFeaturesPerBatch)}_writeFeatureBlock(e,t){const i=this.isAllConstant?0:e;let n=Math.floor(i/this.maxFeaturesPerBatch),r=i%this.maxFeaturesPerBatch;this._batchExceedsDeviceLimit(n)&&(n=0,r=0);const o=this.ubos[n];return!!o&&(o.writeDataDrivenBlock(t,r),!0)}_batchExceedsDeviceLimit(e){return 3*e+2>=this.maxUniformBufferBindings}_reevaluateAt(e,t,i,n,r,o){if(!t)return;const s=this.allFeatureVtIndices[e],a=t.feature(s);if(!a)return;const l=this.allFeatureIds[e],c=null!=l&&r[l]||{},u={type:a.type,id:l,properties:a.properties||{},geometry:[]},h=this.activeAppearanceByVtIndex?this.activeAppearanceByVtIndex.get(s):void 0,d=this.evaluateAllProperties(u,c,i,n,o,(this.allFormattedSections?this.allFormattedSections[e]:void 0)||void 0,h);this._writeFeatureBlock(e,d)}_ensureRangeMaps(){if(!this.featureVertexRangesFromId){this.featureVertexRangesFromId=new Map,this.featureVertexRangesFromVtIndex=new Map;for(let e=0;e<this.allFeatureVtIndices.length;e++){const t=this.allFeatureIds[e];if(null!=t){let i=this.featureVertexRangesFromId.get(t);i||this.featureVertexRangesFromId.set(t,i=[]),i.push(e)}const i=this.allFeatureVtIndices[e];let n=this.featureVertexRangesFromVtIndex.get(i);n||this.featureVertexRangesFromVtIndex.set(i,n=[]),n.push(e)}}}populateUBO(e,t,i,n,r,o){const s=e.id,a=this.header,l=this.evaluateAllProperties(e,{},i,n,r,o);let c,u;this.isAllConstant?(c=0,u=0===this.featureCount,u&&(this.featureCount=1)):(c=this.featureCount++,u=!0);let h=Math.floor(c/this.maxFeaturesPerBatch),d=c%this.maxFeaturesPerBatch;return u&&(this._batchExceedsDeviceLimit(h)?(gt(`Too many symbol features: batch ${h} requires binding points up to ${3*h+2}, device limit ${this.maxUniformBufferBindings}. Some features will render incorrectly.`),h=0,d=0):(this.ubos[h]||(this.ubos[h]=new Vd(null,h,this.uboSizeDwords,a)),this.ubos[h].writeDataDrivenBlock(l,d))),this.allFeatureVtIndices.push(t),this.allFeatureIds.push(s),this.allFormattedSections.push(o||null),d}updateFeatures(e,t,i,n,r,o,s){this.layer=t,this.cachedConstantUniforms=null,this._ensureRangeMaps();for(const t of e){const e=this.featureVertexRangesFromId.get(t);if(e)for(const t of e)this._reevaluateAt(t,i,n,r,o,s)}}updateDynamicExpressions(e,t,i,n,r,o){if(this.layer=e,this.cachedConstantUniforms=null,this._recomputeSharedRanges(),0!==this.header[0])for(let e=0;e<this.allFeatureVtIndices.length;e++)this._reevaluateAt(e,t,i,n,r,o)}updateFeaturePaintForAppearance(e,t,i,n,r,o,s){if(!this.layer)return!1;if(this.activeAppearanceByVtIndex||(this.activeAppearanceByVtIndex=new Map),this.activeAppearanceByVtIndex.set(e,s||null),0===this.header[0])return!1;this._ensureRangeMaps();const a=this.featureVertexRangesFromVtIndex.get(e);if(!a)return!1;let l=!1;for(const e of a){const a=this.evaluateAllProperties(t,i,n,r,o,(this.allFormattedSections?this.allFormattedSections[e]:void 0)||void 0,s);l=this._writeFeatureBlock(e,a)||l}return l}getConstantUniformValues(e,t){const i=!!this.cameraMask;if(this.cachedConstantUniforms&&this.cachedConstantPaint===this.layer.paint&&this.cachedConstantBrightness===t&&(!i||this.cachedConstantRenderZoom===e))return this.cachedConstantUniforms;const n=this.layer.paint,r=i?new Ha(e,{brightness:t,worldview:this.worldview}):null,o={type:1,id:void 0,properties:{},geometry:[]},s=Gd[+this.isText],a=e=>{const i=s[e],a=n.get(i);if(!a)return[0,0,0,1];const l=n.get(`${i}-use-theme`),c=Ud(l&&"string"!=typeof l?l.value:void 0,o,{},[],void 0,t,void 0,this.worldview)?null:this.lut;return(this.cameraMask&1<<e&&r?a.property.evaluate(a.value,r,o,{},void 0,[])||mn.transparent:a.constantOr(mn.transparent)).toNonPremultipliedRenderColor(c).toArray01()},l=(e,t)=>
vendor: 7,434 bytes, line 2
2{const i=n.get(s[e]);return i?this.cameraMask&1<<e&&r?i.property.evaluate(i.value,r,o,{},void 0,[])??t:i.constantOr(t):t},c={fill_np_color:a(0),halo_np_color:a(1),opacity:l(2,1),halo_width:l(3,0),halo_blur:l(4,0),emissive_strength:l(5,0),occlusion_opacity:l(6,1),z_offset:l(7,0)};return this.cachedConstantUniforms=c,this.cachedConstantRenderZoom=e,this.cachedConstantBrightness=t,this.cachedConstantPaint=this.layer.paint,c}finalize(){for(const e of this.ubos)e.rightSizeForTransfer()}upload(e){for(const t of this.ubos)t.upload(e)}bind(e,t,i=0){this.ubos[i]&&this.ubos[i].bind(e,t)}destroy(){for(const e of this.ubos)e.destroy();this.ubos=[],this.featureVertexRangesFromId=null,this.featureVertexRangesFromVtIndex=null,this.allFeatureVtIndices=[],this.allFeatureIds=[],this.featureCount=0,this.maxFeaturesPerBatch=0}}Ys(qd,"SymbolPropertyBinderUBO",{omit:["layer","cachedConstantUniforms","cachedConstantRenderZoom","cachedConstantBrightness","cachedConstantPaint","activeAppearanceByVtIndex","featureVertexRangesFromId","featureVertexRangesFromVtIndex"]});const Wd=24;function Yd(e,t,i){return e.sections.forEach(e=>{e.text=function(e,t,i){const n=t.layout.get("text-transform").evaluate(i,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),$a.applyArabicShaping&&(e=$a.applyArabicShaping(e)),e}(e.text,t,i)}),e}const Xd={horizontal:1,vertical:2,horizontalOnly:3};function Jd(e){let t=.5,i=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:t,verticalAlign:i}}function Kd(e,t,i,n){const{horizontalAlign:r,verticalAlign:o}=Jd(n),s=i[0]-e.displaySize[0]*r,a=i[1]-e.displaySize[1]*o;return{imagePrimary:e,imageSecondary:t,top:a,bottom:a+e.displaySize[1],left:s,right:s+e.displaySize[0]}}function Qd(e,t,i,n,r,o){const s=e.imagePrimary;let a;if(s.content){const e=s.content,t=s.pixelRatio||1;a=[e[0]/t,e[1]/t,s.displaySize[0]-e[2]/t,s.displaySize[1]-e[3]/t]}const l=t.left*o,c=t.right*o;let u,h,d,f;"width"===i||"both"===i?(f=r[0]+l-n[3],h=r[0]+c+n[1]):(f=r[0]+(l+c-s.displaySize[0])/2,h=f+s.displaySize[0]);const p=t.top*o,m=t.bottom*o;return"height"===i||"both"===i?(u=r[1]+p-n[0],d=r[1]+m+n[2]):(u=r[1]+(p+m-s.displaySize[1])/2,d=u+s.displaySize[1]),{imagePrimary:s,imageSecondary:void 0,top:u,right:h,bottom:d,left:f,collisionPadding:a}}const ef={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹"};function tf(e){return"︶"===e||"ï¹"===e||"︸"===e||"ï¹"===e||"ï¹"===e||"︾"===e||"︼"===e||"︺"===e||"ï¸"===e||"ï¹"===e||"ï¸"===e||"ï¸"===e||"ï¸"===e||"ï½"===e||"ï¿£"===e||"ï¸"===e||"ï¸"===e}function nf(e){return"︵"===e||"ï¹"===e||"︷"===e||"ï¹"===e||"ï¹"===e||"︽"===e||"︻"===e||"︹"===e||"ï¸"===e||"︿"===e}const rf=128;function of(e,t,i,n){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Ha(e+1,{worldview:i}),void 0,void 0,void 0,n)};if("source"===r.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:o}=r;let s=0;for(;s<t.length&&t[s]<=e;)s++;s=Math.max(0,s-1);let a=s;for(;a<t.length&&t[a]<e+1;)a++;a=Math.min(t.length-1,a);const l=t[s],c=t[a];return"composite"===r.kind?{kind:"composite",minZoom:l,maxZoom:c,interpolationType:o}:{kind:"camera",minZoom:l,maxZoom:c,minSize:r.evaluate(new Ha(l,{worldview:i}),void 0,void 0,void 0,n),maxSize:r.evaluate(new Ha(c,{worldview:i}),void 0,void 0,void 0,n),interpolationType:o}}}function sf(e,{uSize:t,uSizeT:i},{lowerSize:n,upperSize:r}){return"source"===e.kind?n/rf:"composite"===e.kind?fn(n/rf,r/rf,i):t}function af(e,t,i=1){let n=0,r=0;if("constant"===e.kind)r=e.layoutSize*i;else if("source"!==e.kind){const{interpolationType:o,minZoom:s,maxZoom:a}=e,l=o?it(qo.interpolationFactor(o,t,s,a),0,1):0;"camera"===e.kind?r=fn(e.minSize,e.maxSize,l)*i:n=l*i}return{uSizeT:n,uSize:r}}const lf=Number.POSITIVE_INFINITY,cf=Math.sqrt(2),uf=32640;function hf(e,t,i,n,r,o,s){const a=e.hasLayoutProperty(r)?t.getAppearanceValueAndResolveTokens(e,r,i,n,[]):null;return(Array.isArray(o)?Array.isArray(a):typeof a==typeof o)?s?s(a):a:o}function df(e,t,i,n,r,o,s,a){return{appearanceIconOffset:hf(e,t,i,n,"icon-offset",r),appearanceIconRotate:hf(e,t,i,n,"icon-rotate",o),appearanceIconSize:hf(e,t,i,n,"icon-size",s,e=>e*a)}}function ff(e,t,i,n,r,o,s){const a=hf(e,t,i,n,"text-offset",r,([e,t])=>[e*Wd,t*Wd]);return{appearanceTextOffset:a,appearanceTextRotate:hf(e,t,i,n,"text-rotate",o),appearanceTextSize:hf(e,t,i,n,"text-size",s)}}function pf(e,t,i,n,r,o,s,a,l,c){if(!e)return;const u=function(e,t,i,n,r,o,s){if("camera"===e.kind)return e.maxSize;if("composite"===e.kind){const n=t.possiblyEvaluate(new Ha(e.maxZoom,{worldview:o}),i,s).evaluate(r,{},i,s),a=t.possiblyEvaluate(new Ha(e.minZoom,{worldview:o}),i,s).evaluate(r,{},i,s);return Math.max(n,a)}return t.possiblyEvaluate(new Ha(n,{worldview:o}),i,s).evaluate(r,{},i,s)}(t,i,n,r,o,l,c);return e.scaleSelf(u*a*s)}function mf(e,t,i,n,r,o,s,a,l,c){return{iconPrimary:pf(e.getPrimary(),t,i,n,r,o,s,a,l,c),iconSecondary:pf(e.getSecondary(),t,i,n,r,o,s,a,l,c)}}function _f(e,t){return e*t/24}function gf(e,t,i,n,r,o){let s=null;return"source"===t.kind?(s=[rf*i*n],s[0]>uf&>(`${e}: Value for "text-size" or "icon-size" is >= 255. Reduce your "text-size" or "icon-size".`)):"composite"===t.kind&&(s=[rf*r*n,rf*o*n],(s[0]>uf||s[1]>uf)&>(`${e}: Value for "text-size" or "icon-size" is >= 255. Reduce your "text-size" or "icon-size".`)),s}const yf=Uc([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:vf}=yf,xf=Uc([{name:"a_pos_3",components:3,type:"Int16"}]);var bf=Uc([{name:"a_pos",type:"Int16",components:2}]);class wf{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,i){const n=Me(t,this.dir);if(Math.abs(n)<1e-6)return!1;const r=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1])/n;return i[0]=this.pos[0]+this.dir[0]*r,i[1]=this.pos[1]+this.dir[1]*r,!0}}class Tf{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,i){const n=q(t,this.dir);if(Math.abs(n)<1e-6)return!1;const r=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1]+(e[2]-this.pos[2])*t[2])/n;return i[0]=this.pos[0]+this.dir[0]*r,i[1]=this.pos[1]+this.dir[1]*r,i[2]=this.pos[2]+this.dir[2]*r,!0}closestPointOnSphere(e,t,i){if(function(e,t){var i=e[0],r=e[1],o=e[2],s=t[0],a=t[1],l=t[2];return Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(r-a)<=n*Math.max(1,Math.abs(r),Math.abs(a)
vendor: 24,557 bytes, line 2
2)&&Math.abs(o-l)<=n*Math.max(1,Math.abs(o),Math.abs(l))}(this.pos,e)||0===t)return i[0]=i[1]=i[2]=0,!1;const[r,o,s]=this.dir,a=this.pos[0]-e[0],l=this.pos[1]-e[1],c=this.pos[2]-e[2],u=r*r+o*o+s*s,h=2*(a*r+l*o+c*s),d=h*h-4*u*(a*a+l*l+c*c-t*t);if(d<0){const e=Math.max(-h/2,0),n=a+r*e,u=l+o*e,d=c+s*e,f=Math.hypot(n,u,d);return i[0]=n*t/f,i[1]=u*t/f,i[2]=d*t/f,!1}{const e=(-h-Math.sqrt(d))/(2*u);if(e<0){const e=Math.hypot(a,l,c);return i[0]=a*t/e,i[1]=l*t/e,i[2]=c*t/e,!1}return i[0]=a+r*e,i[1]=l+o*e,i[2]=c+s*e,!0}}}class Ef{constructor(e,t,i,n,r){this.TL=e,this.TR=t,this.BR=i,this.BL=n,this.horizon=r}static fromInvProjectionMatrix(e,t,i){const n=[-1,1,1],r=[1,1,1],o=[1,-1,1],s=[-1,-1,1],a=X(n,n,e),l=X(r,r,e),c=X(o,o,e),u=X(s,s,e);return new Ef(a,l,c,u,t/i)}}function Sf(e,t,i,n){const r=t[0],o=t[1],s=t[2],a=i[0],l=i[1],c=i[2];let u=1/0,h=-1/0;for(let t=0;t<e.length;t++){const i=e[t],n=(i[0]-r)*a+(i[1]-o)*l+(i[2]-s)*c;n<u&&(u=n),n>h&&(h=n)}return n[0]=u,n[1]=h,n}function If(e,t){let i=!0;for(let n=0;n<e.planes.length;n++){const r=e.planes[n];let o=0;for(let e=0;e<t.length;e++)o+=+(q(r,t[e])+r[3]>=0);if(0===o)return 0;o!==t.length&&(i=!1)}return i?2:1}const Af=[0,0];function Mf(e,t){for(const i of e.projections){const n=Sf(t,e.points[0],i.axis,Af);if(i.projection[1]<n[0]||i.projection[0]>n[1])return 0}return 1}function Cf(e,t){const i=t[0],n=t[1],r=t[2],o=t[3];for(let t=0;t<e.length;t++){const s=e[t];if(i*s[0]+n*s[1]+r*s[2]+o>=0)return!0}return!1}class Df{constructor(e,t){this.points=e||new Array(8).fill([0,0,0]),this.planes=t||new Array(6).fill([0,0,0,0]),this.bounds=Pf.fromPoints(this.points),this.projections=[],this.frustumEdges=[te([],this.points[2],this.points[3]),te([],this.points[0],this.points[3]),te([],this.points[4],this.points[0]),te([],this.points[5],this.points[1]),te([],this.points[6],this.points[2]),te([],this.points[7],this.points[3])];for(const e of this.frustumEdges){const t=[0,-e[2],e[1]],i=[e[2],0,-e[0]];this.projections.push({axis:t,projection:Sf(this.points,this.points[0],t,[0,0])}),this.projections.push({axis:i,projection:Sf(this.points,this.points[0],i,[0,0])})}}static fromInvProjectionMatrix(e,t,i,n){const r=Math.pow(2,i),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(i=>{const o=le([],i,e),s=1/o[3]/t*r;return(a=o)[0]=(l=o)[0]*(c=[s,s,n?1/o[3]:s,s])[0],a[1]=l[1]*c[1],a[2]=l[2]*c[2],a[3]=l[3]*c[3],a;var a,l,c}),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(e=>{const t=Z([],W([],te([],o[e[0]],o[e[1]]),te([],o[e[2]],o[e[1]]))),i=-q(t,o[e[1]]);return t.concat(i)}),a=[];for(let e=0;e<o.length;e++)a.push([o[e][0],o[e][1],o[e][2]]);return new Df(a,s)}intersectsPrecise(e,t,i){for(let i=0;i<t.length;i++)if(!Cf(e,t[i]))return 0;for(let t=0;t<this.planes.length;t++)if(!Cf(e,this.planes[t]))return 0;const n=this.points,r=n[0][0],o=n[0][1],s=n[0][2];for(const t of i)for(const i of this.frustumEdges){const a=t[1]*i[2]-t[2]*i[1],l=t[2]*i[0]-t[0]*i[2],c=t[0]*i[1]-t[1]*i[0];if(0===a&&0===l&&0===c)continue;let u=1/0,h=-1/0;for(let e=0;e<n.length;e++){const t=n[e],i=(t[0]-r)*a+(t[1]-o)*l+(t[2]-s)*c;i<u&&(u=i),i>h&&(h=i)}let d=1/0,f=-1/0;for(let t=0;t<e.length;t++){const i=e[t],n=(i[0]-r)*a+(i[1]-o)*l+(i[2]-s)*c;n<d&&(d=n),n>f&&(f=n)}if(u>f||d>h)return 0}return 1}containsPoint(e){for(const t of this.planes){const i=t[3];if(q([t[0],t[1],t[2]],e)+i<0)return!1}return!0}}class Pf{static fromPoints(e){const t=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(const n of e)B(t,t,n),N(i,i,n);return new Pf(t,i)}static fromTileIdAndHeight(e,t,i){const n=1<<e.canonical.z,r=e.canonical.x,o=e.canonical.y;return new Pf([r/n,o/n,t],[(r+1)/n,(o+1)/n,i])}static applyTransform(e,t){const i=e.getCorners();for(let e=0;e<i.length;++e)X(i[e],i[e],t);return Pf.fromPoints(i)}static applyTransformFast(e,t){const i=[t[12],t[13],t[14]],n=[...i];for(let r=0;r<3;r++)for(let o=0;o<3;o++){const s=t[4*o+r],a=s*e.min[o],l=s*e.max[o];i[r]+=Math.min(a,l),n[r]+=Math.max(a,l)}return new Pf(i,n)}static projectAabbCorners(e,t){const i=e.getCorners();for(let e=0;e<i.length;++e)X(i[e],i[e],t);return i}constructor(e,t){this.min=e,this.max=t,this.center=V([],F([],this.min,this.max),.5)}quadrant(e){const t=[e%2==0,e<2],i=P(this.min),n=P(this.max);for(let e=0;e<t.length;e++)i[e]=t[e]?this.min[e]:this.center[e],n[e]=t[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new Pf(i,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?If(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?If(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(e,t){return t||this.intersects(e)?Mf(e,this.getCorners()):0}intersectsPreciseFlat(e,t){return t||this.intersectsFlat(e)?Mf(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(e){for(let t=0;t<3;++t)if(this.min[t]>e.max[t]||e.min[t]>this.max[t])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e.min[t]),this.max[t]=Math.max(this.max[t],e.max[t])}encapsulatePoint(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e[t]),this.max[t]=Math.max(this.max[t],e[t])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}function Rf(e){return e*lc/mc}Ys(Pf,"Aabb");const Lf=[new Pf([hc,hc,hc],[dc,dc,dc]),new Pf([hc,hc,hc],[0,0,dc]),new Pf([0,hc,hc],[dc,0,dc]),new Pf([hc,0,hc],[0,dc,dc]),new Pf([0,0,hc],[dc,dc,dc])];function zf(e,t,i,n=!0){const r=V([],e._camera.position,e.worldSize),o=[t,i,1,1];le(o,o,e.pixelMatrixInverse),se(o,o,1/o[3]);const s=Z([],te([],o,r)),a=e.globeMatrix,l=[a[12],a[13],a[14]],c=te([],l,r),u=R(c),h=Z([],c),d=e.worldSize/(2*Math.PI),f=q(h,s),p=Math.asin(d/u);if(p<Math.acos(f)){if(!n)return null;const e=[],t=[];V(e,s,u/f),Z(t,te(t,e,c)),Z(s,F(s,c,V(s,t,Math.tan(p)*u)))}const m=[];new Tf(r,s).closestPointOnSphere(l,d,m);const _=Z([],St(a,0)),g=Z([],St(a,1)),y=Z([],St(a,2)),v=q(_,m),x=q(g,m),b=q(y,m),w=Ke(Math.asin(-x/d));let T=Ke(Math.atan2(v,b));T=e.center.lng+function(e,t){const i=(t-e+180)%360-180;return i<-180?i+360:i}(e.center.lng,T);const E=dr(T),S=it(fr(w),0,1);return new Ac(E,S)}class Ff{constructor(e,t,i){this.a=te([],e,i),this.b=te([],t,i),this.center=i;const n=Z([],this.a),r=Z([],this.b);this.angle=Math.acos(q(n,r))}}function Of(e,t){if(0===e.angle)return null;let i;return i=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),i<0||i>1?null:function(e,t,i,n){const r=Math.sin(i);return e*(Math.sin((1-n)*i)/r)+t*(Math.sin(n*i)/r)}(e.a[t],e.b[t],e.angle,it(i,0,1))+e.center[t]}function kf(e){if(e.z<=1)return Lf[e.z+2*e.y+e.x];const t=jf(Uf(e));return Pf.fromPoints(t)}function Bf(e,t,i){return V(e,e,1-i),U(e,e,t,i)}function Nf(e,t,i){for(const n of e)X(n,n,t),V(n,n,i)}function Vf(e,t,i,n){const r=t/e.worldSize,o=e.globeMatrix;if(i.z<=1){const e=kf(i).getCorners();return Nf(e,o,r),Pf.fromPoints(e)}const s=Uf(i,n),a=jf(s,lc+Rf(e._tileCoverLift));Nf(a,o,r);const l=Number.MAX_VALUE,c=[-l,-l,-l],u=[l,l,l];if(s.contains(e.center)){for(const e of a)B(u,u,e),N(c,c,e);c[2]=0;const t=e.point,i=[t.x*r,t.y*r,0];return B(u,u,i),N(c,c,i),new Pf(u,c)}if(e._tileCoverLift>0){for(const e of a)B(u,u,e),N(c,c,e);return new Pf(u,c)}const h=[o[12]*r,o[13]*r,o[14]*r],d=s.getCenter(),f=it(e.center.lat,-85.051129,wc),p=it(d.lat,-85.051129,wc),m=dr(e.center.lng),_=fr(f);let g=m-dr(d.lng);const y=_-fr(p);g>.5?g-=1:g<-.5&&(g+=1);let v=0;Math.abs(g)>Math.abs(y)?v=g>=0?1:3:(v=y>=0?0:2,U(h,h,[o[4]*r,o[5]*r,o[6]*r],-Math.sin(Je(y>=0?s.getSouth():s.getNorth()))*lc));const x=a[v],b=a[(v+1)%4],w=new Ff(x,b,h),T=[Of(w,0)||x[0],Of(w,1)||x[1],Of(w,2)||x[2]],E=Jf(e.zoom);if(E>0){const n=function({x:e,y:t,z:i},n,r,o,s){const a=1/(1<<i);let l=e*a,c=l+a,u=t*a,h=u+a,d=0;const f=(l+c)/2-o;return f>.5?d=-1:f<-.5&&(d=1),l=((l+d)*n-(o*=n))*r+o,c=((c+d)*n-o)*r+o,u=(u*n-(s*=n))*r+s,h=(h*n-s)*r+s,[[l,h,0],[c,h,0],[c,u,0],[l,u,0]]}(i,t,e._pixelsPerMercatorPixel,m,_);for(let e=0;e<a.length;e++)Bf(a[e],n[e],E);const r=F([],n[v],n[(v+1)%4]);V(r,r,.5),Bf(T,r,E)}for(const e of a)B(u,u,e),N(c,c,e);return u[2]=Math.min(x[2],b[2]),B(u,u,T),N(c,c,T),new Pf(u,c)}function Uf({x:e,y:t,z:i},n=!1){const r=1/(1<<i),o=new gc(pr(e*r),t===(1<<i)-1&&n?-90:mr((t+1)*r)),s=new gc(pr((e+1)*r),0===t&&n?90:mr(t*r));return new yc(o,s)}function jf(e,t=lc){const i=Je(e.getNorth()),n=Je(e.getSouth()),r=Math.cos(i),o=Math.cos(n),s=Math.sin(i),a=Math.sin(n),l=e.getWest(),c=e.getEast();return[fc(o,a,l,t),fc(o,a,c,t),fc(r,s,c,t),fc(r,s,l,t)]}function Gf(e,t,i,n){const r=1<<i.z,o=(e/Cr+i.x)/r;return pc(mr((t/Cr+i.y)/r),pr(o),n)}function $f({min:e,max:t}){return 16383/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const Hf=new Float64Array(16);function Zf(e){const t=$f(e),i=w(Hf,[t,t,t]);return _(i,i,H([],e.min))}function qf(e){const t=1/$f(e);return b(Hf,e.min),g(Hf,Hf,[t,t,t])}function Wf(e){const t=Cr/(2*Math.PI);return e/(2*Math.PI)/t}function Yf(e,t){return Cr/(512*Math.pow(2,e))*$f(kf(t))}function Xf(e,t,i,n,r){const o=Wf(i),s=[e,t,-i/(2*Math.PI)],a=d(new Float64Array(16));return _(a,a,s),g(a,a,[o,o,o]),y(a,a,Je(-r)),v(a,a,Je(-n)),a}function Jf(e){return nt(5,6,e)}function Kf(e,t){const i=pc(t.lat,t.lng),n=function(e){const t=pc(e._center.lat,e._center.lng);let i=W([],L(0,1,0),t);const n=T([],-e.angle,t);i=X(i,i,n),T(n,-e._pitch,i);const r=Z([],t);return V(r,r,Rf(e.cameraToCenterDistance/e.pixelsPerMeter)),X(r,r,n),F([],t,r)}(e);return s=(r=O([],n,i))[0],a=r[1],l=r[2],c=(o=i)[0],u=o[1],h=o[2],f=(d=Math.sqrt((s*s+a*a+l*l)*(c*c+u*u+h*h)))&&q(r,o)/d,Math.acos(Math.min(Math.max(f,-1),1));var r,o,s,a,l,c,u,h,d,f}function Qf(e,t){return Kf(e,t)>Math.PI/2*1.01}const ep=Je(85),tp=Math.cos(ep),ip=Math.sin(ep);function np(e,t){const i=e.fovAboveCenter,n=e.elevation?e.elevation.getMinElevationBelowMSL()*t:0,r=Math.min(n,e.isOrthographic?-10*t:0),o=(e._camera.position[2]*e.worldSize-r)/Math.cos(e._pitch),s=Math.sin(i)*o/Math.sin(Math.max(Math.PI/2-e._pitch-i,.01));let a=Math.sin(e._pitch)*s+o;const l=o*(1/e._horizonShift);if(!e.elevation||0===e.elevation.exaggeration()){let t=Math.max(e.zoom-17,0);e.isOrthographic&&(t/=10),a*=1+t}return Math.min(1.01*a,l)}class rp{constructor(e,t,i){this.z=e,this.x=t,this.y=i,this.key=ap(0,e,e,t,i)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}isChildOf(e){const t=this.z-e.z;return 0===e.z||e.z<this.z&&e.x===this.x>>t&&e.y===this.y>>t}url(e,t){const i=function(e,t,i){const n=2**i,r=2*Math.PI*6378137,o=r*(e/n-.5),s=r*(.5-(t+1)/n);return`${o},${s},${o+r/n},${s+r/n}`}(this.x,this.y,this.z),n=function(e,t,i){let n,r="";for(let o=e;o>0;o--)n=1<<o-1,r+=(t&n?1:0)+(i&n?2:0);return r}(this.z,this.x,this.y);return e[(this.x+this.y)%e.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("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",i)}toString(){return`${this.z}/${this.x}/${this.y}`}}class op{constructor(e,t){this.wrap=e,this.canonical=t,this.key=ap(e,t.z,t.z,t.x,t.y)}}class sp{constructor(e,t,i,n,r){this.overscaledZ=e,this.wrap=t,this.canonical=new rp(i,+n,+r),this.key=0===t&&e===i?this.canonical.key:ap(t,e,i,n,r)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new sp(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new sp(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return ap(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const i=this.canonical.z-e;return ap(this.wrap*+t,e,e,this.canonical.x>>i,this.canonical.y>>i)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new sp(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new sp(t,this.wrap,t,i,n),new sp(t,this.wrap,t,i+1,n),new sp(t,this.wrap,t,i,n+1),new sp(t,this.wrap,t,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new sp(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new sp(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new op(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function ap(e,t,i,n,r){const o=1<<Math.min(i,22);let s=o*(r%o)+n%o;return e&&i<22&&(s+=o*o*((e<0?-2*e-1:2*e)%(1<<2*(22-i)))),16*(32*s+i)+(t-i)}const lp=[e=>{let t=e.canonical.x-1,i=e.wrap;return t<0&&(t=(1<<e.canonical.z)-1,i--),new sp(e.overscaledZ,i,e.canonical.z,t,e.canonical.y)},e=>{let t=e.canonical.x+1,i=e.wrap;return t===1<<e.canonical.z&&(t=0,i++),new sp(e.overscaledZ,i,e.canonical.z,t,e.canonical.y)},e=>new sp(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new sp(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)];function cp(e,t){if(!t.isReprojectedInTileSpace)return{scale:1<<e.z,x:e.x,y:e.y,x2:e.x+1,y2:e.y+1,projection:t};const i=Math.pow(2,-e.z),n=e.x*i,r=(e.x+1)*i,o=e.y*i,s=(e.y+1)*i,a=pr(n),l=pr(r),c=mr(o),u=mr(s),h=t.project(a,c),d=t.project(l,c),f=t.project(l,u),p=t.project(a,u);let m=Math.min(h.x,d.x,f.x,p.x),_=Math.min(h.y,d.y,f.y,p.y),g=Math.max(h.x,d.x,f.x,p.x),y=Math.max(h.y,d.y,f.y,p.y);const v=i/16;function x(e,i,n,r,o,s){const a=(n+o)/2,l=(r+s)/2,c=t.project(pr(a),mr(l)),u=Math.max(0,m-c.x,_-c.y,c.x-g,c.y-y);m=Math.min(m,c.x),g=Math.max(g,c.x),_=Math.min(_,c.y),y=Math.max(y,c.y),u>v&&(x(e,c,n,r,a,l),x(c,i,a,l,o,s))}x(h,d,n,o,r,o),x(d,f,r,o,r,s),x(f,p,r,s,n,s),x(p,h,n,s,n,o),m-=v,_-=v,g+=v,y+=v;const b=1/Math.max(g-m,y-_);return{scale:b,x:m*b,y:_*b,x2:g*b,y2:y*b,projection:t}}function up(e,t,i,n,r,o,s,a,l){if("globe"===l.name)return Vf(e,t,new rp(i,n,r),!1);const c=cp({z:i,x:n,y:r},l);return new Pf([(o+c.x/c.scale)*t,t*(c.y/c.scale),s],[(o+c.x2/c.scale)*t,t*(c.y2/c.scale),a])}Ys(rp,"CanonicalTileID"),Ys(sp,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const hp=d(new Float32Array(16));class dp{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new gc(0,0)}projectTilePoint(e,t,i){return{x:e,y:t,z:0}}locationPoint(e,t,i,n=!0){return e._coordinatePoint(e.locationCoordinate(t,i),n)}pixelsPerMeter(e,t){return xc(1,e)*t}pixelSpaceConversion(e,t,i){return 1}farthestPixelDistance(e){return np(e,e.pixelsPerMeter)}pointCoordinate(e,t,i,n){const r=e.horizonLineFromTop(!1),o=new Pe(t,Math.max(r,i));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,n))}pointCoordinate3D(e,t,i){const n=new Pe(t,i);if(e.elevation)return e.elevation.pointCoordinate(n);{const t=this.pointCoordinate(e,n.x,n.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation&&e.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(e,t.x,t.y);const i=e.horizonLineFromTop();return t.y<i}createInversionMatrix(e,t){return hp}createTileMatrix(e,t,i){let n,r,o;const s=i.canonical,a=d(new Float64Array(16));if(this.isReprojectedInTileSpace){const l=cp(s,this);n=1,r=l.x+i.wrap*l.scale,o=l.y,g(a,a,[n/l.scale,n/l.scale,e.pixelsPerMeter/t])}else n=t/e.zoomScale(s.z),r=(s.x+Math.pow(2,s.z)*i.wrap)*n,o=s.y*n;return _(a,a,[r,o,0]),g(a,a,[n/Cr,n/Cr,1]),a}upVector(e,t,i){return[0,0,1]}upVectorScale(e,t,i){return{metersToTile:1}}}class fp extends dp{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[t,i]=this.parallels=e.parallels||[29.5,45.5],n=Math.sin(Je(t));this.n=(n+Math.sin(Je(i)))/2,this.c=1+n*(2*this.n-n),this.r0=Math.sqrt(this.c)/this.n}project(e,t){const{n:i,c:n,r0:r}=this,o=Je(e-this.center[0]),s=Je(t),a=Math.sqrt(n-2*i*Math.sin(s))/i;return{x:a*Math.sin(o*i),y:a*Math.cos(o*i)-r,z:0}}unproject(e,t){const{n:i,c:n,r0:r}=this,o=r+t;let s=Math.atan2(e,Math.abs(o))*Math.sign(o);o*i<0&&(s-=Math.PI*Math.sign(e)*Math.sign(o));const a=Je(this.center[0])*i;s=rt(s,-Math.PI-a,Math.PI-a);const l=it(Ke(s/i)+this.center[0],-180,180),c=Math.asin(it((n-(e*e+o*o)*i*i)/(2*i),-1,1)),u=it(Ke(c),-85.051129,wc);return new gc(l,u)}}const pp=1.340264,mp=-.081106,_p=893e-6,gp=.003796,yp=Math.sqrt(3)/2;class vp extends dp{project(e,t){t=t/180*Math.PI,e=e/180*Math.PI;const i=Math.asin(yp*Math.sin(t)),n=i*i,r=n*n*n;return{x:.5*(e*Math.cos(i)/(yp*(pp+3*mp*n+r*(7*_p+9*gp*n)))/Math.PI+.5),y:1-.5*(i*(pp+mp*n+r*(_p+gp*n))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let i=t=(2*(1-t)-1)*Math.PI,n=i*i,r=n*n*n;for(let e,o,s,a=0;a<12&&(o=i*(pp+mp*n+r*(_p+gp*n))-t,s=pp+3*mp*n+r*(7*_p+9*gp*n),e=o/s,i=it(i-e,-Math.PI/3,Math.PI/3),n=i*i,r=n*n*n,!(Math.abs(e)<1e-12));++a);const o=yp*e*(pp+3*mp*n+r*(7*_p+9*gp*n))/Math.cos(i),s=Math.asin(Math.sin(i)/yp),a=it(180*o/Math.PI,-180,180),l=it(180*s/Math.PI,-85.051129,wc);return new gc(a,l)}}class xp extends dp{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){return{x:.5+e/360,y:.5-t/360,z:0}}unproject(e,t){const i=360*(e-.5),n=it(360*(.5-t),-85.051129,wc);return new gc(i,n)}}const bp=Math.PI/2;function wp(e){return Math.tan((bp+e)/2)}class Tp extends dp{constructor(e){super(e),this.center=e.center||[0,30];const[t,i]=this.parallels=e.parallels||[30,30];let n=Je(t),r=Je(i);this.southernCenter=n+r<0,this.southernCenter&&(n=-n,r=-r);const o=Math.cos(n),s=wp(n);this.n=n===r?Math.sin(n):Math.log(o/Math.cos(r))/Math.log(wp(r)/s),this.f=o*Math.pow(wp(n),this.n)/this.n}project(e,t){t=Je(t),this.southernCenter&&(t=-t),e=Je(e-this.center[0]);const i=1e-6,{n:n,f:r}=this;r>0?t<-bp+i&&(t=-bp+i):t>bp-i&&(t=bp-i);const o=r/Math.pow(wp(t),n);let s=o*Math.sin(n*e),a=r-o*Math.cos(n*e);return s=.5*(s/Math.PI+.5),a=.5*(a/Math.PI+.5),{x:s,y:this.southernCenter?a:1-a,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n:i,f:n}=this,r=n-t,o=Math.sign(r),s=Math.sign(i)*Math.sqrt(e*e+r*r);let a=Math.atan2(e,Math.abs(r))*o;r*i<0&&(a-=Math.PI*Math.sign(e)*o);const l=it(Ke(a/i)+this.center[0],-180,180),c=it(Ke(2*Math.atan(Math.pow(n/s,1/i))-bp),-85.051129,wc);return new gc(l,this.southernCenter?-c:c)}}class Ep extends dp{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:dr(e),y:fr(t),z:0}}unproject(e,t){const i=pr(e),n=mr(t);return new gc(i,n)}}const Sp=Je(wc);class Ip extends dp{project(e,t){const i=(t=Je(t))*t,n=i*i;return{x:.5*((e=Je(e))*(.8707-.131979*i+n*(n*(.003971*i-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+i*(.015085+n*(.028874*i-.044475-.005916*n)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let i=t=(2*(1-t)-1)*Math.PI,n=25,r=0,o=i*i;do{o=i*i;const e=o*o;r=(i*(1.007226+o*(.015085+e*(.028874*o-.044475-.005916*e)))-t)/(1.007226+o*(.045255+e*(.259866*o-.311325-.005916*11*e))),i=it(i-r,-Sp,Sp)}while(Math.abs(r)>1e-6&&--n>0);o=i*i;const s=it(Ke(e/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),a=Ke(i);return new gc(s,a)}}const Ap=Je(wc);class Mp extends dp{project(e,t){t=Je(t),e=Je(e);const i=Math.cos(t),n=2/Math.PI,r=Math.acos(i*Math.cos(e/2)),o=Math.sin(r)/r,s=.5*(e*n+2*i*Math.sin(e/2)/o)||0,a=.5*(t+Math.sin(t)/o)||0;return{x:.5*(s/Math.PI+.5),y:1-.5*(a/Math.PI+1),z:0}}unproject(e,t){let i=e=(2*e-.5)*Math.PI,n=t=(2*(1-t)-1)*Math.PI,r=25;const o=1e-6;let s=0,a=0;do{const r=Math.cos(n),o=Math.sin(n),l=2*o*r,c=o*o,u=r*r,h=Math.cos(i/2),d=Math.sin(i/2),f=2*h*d,p=d*d,m=1-u*h*h,_=m?1/m:0,g=m?Math.acos(r*h)*Math.sqrt(1/m):0,y=.5*(2*g*r*d+2*i/Math.PI)-e,v=.5*(g*o+n)-t,x=.5*_*(u*p+g*r*h*c)+1/Math.PI,b=_*(f*l/4-g*o*d),w=.125*_*(l*d-g*o*u*f),T=.5*_*(c*h+g*p*r)+.5,E=b*w-T*x;s=(v*b-y*T)/E,a=(y*w-v*x)/E,i=it(i-s,-Math.PI,Math.PI),n=it(n-a,-Ap,Ap)}while((Math.abs(s)>o||Math.abs(a)>o)&&--r>0);return new gc(Ke(i),Ke(n))}}class Cp extends dp{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Je(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:i,cosPhi:n}=this;return{x:Je(e)*n*i+.5,y:-Math.sin(Je(t))/n*i+.5,z:0}}unproject(e,t){const{scale:i,cosPhi:n}=this,r=-(t-.5)/i,o=it(Ke((e-.5)/i)/n,-180,180),s=Math.asin(it(r*n,-1,1)),a=it(Ke(s),-85.051129,wc);return new gc(o,a)}}class Dp extends Ep{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,t,i){const n=Gf(e,t,i);return X(n,n,Zf(kf(i))),{x:n[0],y:n[1],z:n[2]}}locationPoint(e,t,i){const n=pc(t.lat,t.lng),r=Z([],n),o=i?e._centerAltitude+i:e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(t),e._centerAltitude):e._centerAltitude;U(n,n,r,xc(1,0)*Cr*o);const s=d(new Float64Array(16));return m(s,e.pixelMatrix,e.globeMatrix),X(n,n,s),new Pe(n[0],n[1])}pixelsPerMeter(e,t){return xc(1,0)*t}pixelSpaceConversion(e,t,i){const n=xc(1,e)*t,r=fn(xc(1,45)*t,n,i);return this.pixelsPerMeter(e,t)/r}createTileMatrix(e,t,i){const n=qf(kf(i.canonical));return m(new Float64Array(16),e.globeMatrix,n)}createInversionMatrix(e,t){const{center:i}=e,n=Zf(kf(t));return v(n,n,Je(i.lng)),y(n,n,Je(i.lat)),g(n,n,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(n)}pointCoordinate(e,t,i,n){return zf(e,t,i,!0)||new Ac(0,0)}pointCoordinate3D(e,t,i){const n=this.pointCoordinate(e,t,i,0);return[n.x,n.y,n.z]}isPointAboveHorizon(e,t){return!zf(e,t.x,t.y,!1)}farthestPixelDistance(e){const t=function(e,t){const i=e.cameraToCenterDistance,n=e._centerAltitude*t,r=e._camera,o=e._camera.forward(),s=F([],V([],o,-i),[0,0,n]),a=e.worldSize/(2*Math.PI),l=[0,0,-a],c=e.width/e.height,u=Math.tan(e.fovAboveCenter),h=V([],r.up(),u),d=V([],r.right(),u*c),f=Z([],F([],F([],o,h),d)),p=[];let m;if(new Tf(s,f).closestPointOnSphere(l,a,p)){const t=F([],p,l),i=te([],t,s);m=Math.cos(e.fovAboveCenter)*R(i)}else{const e=te([],s,l),t=te([],l,s);Z(t,t);const i=R(e)-a;m=Math.sqrt(i*(i+2*a));const n=Math.acos(m/(a+i))-Math.acos(q(o,t));m*=Math.cos(n)}return 1.01*m}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),i=Jf(e.zoom);if(i>0){const n=np(e,xc(1,e.center.lat)*e.worldSize),r=e.worldSize/(2*Math.PI),o=Math.max(e.width,e.height)/e.worldSize*Math.PI;return fn(t,n+r*(1-Math.cos(o)),Math.pow(i,10))}return t}upVector(e,t,i){return Gf(t,i,e,1)}upVectorScale(e){return{metersToTile:Rf($f(kf(e)))}}}function Pp(e){const t=e.parallels,i=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new Ep(e);case"equirectangular":return new xp(e);case"naturalEarth":return new Ip(e);case"equalEarth":return new vp(e);case"winkelTripel":return new Mp(e);case"albers":return i?new Cp(e):new fp(e);case"lambertConformalConic":return i?new Cp(e):new Tp(e);case"globe":return new Dp(e)}throw new Error(`Invalid projection name: ${e.name}`)}const Rp=Number.MAX_SAFE_INTEGER,Lp=Rp-1;
vendor: 75,847 bytes, line 2
2function zp(e,t,i,n){return e.order<t||e.order===Rp||!(e.clipMask&i)||function(e,t){if(0===t.length)return!1;let i=e;for(;""!==i;){if(t.includes(i))return!1;i=wl(i)}return!0}(n,e.clipScope)}function Fp(e,t){return e.x-t.x||e.y-t.y}function Op(e,t){return 0===Fp(e.min,t.min)&&0===Fp(e.max,t.max)}function kp(e,t){return!(e.min.x>t.max.x||e.max.x<t.min.x||e.min.y>t.max.y||e.max.y<t.min.y)}function Bp(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i].sourceId!==t[i].sourceId||!Op(e[i],t[i])||e[i].order!==t[i].order||e[i].clipMask!==t[i].clipMask||!Re(e[i].clipScope,t[i].clipScope))return!1;return!0}function Np(e,t,i){const n=1/Cr,r=1/(1<<i.canonical.z),o=(t.x*n+i.canonical.x)*r+i.wrap,s=(t.y*n+i.canonical.y)*r;return{min:new Pe((e.x*n+i.canonical.x)*r+i.wrap,(e.y*n+i.canonical.y)*r),max:new Pe(o,s)}}function Vp(e,t,i){const n=1<<i.canonical.z,r=((t.x-i.wrap)*n-i.canonical.x)*Cr,o=(t.y*n-i.canonical.y)*Cr;return{min:new Pe(((e.x-i.wrap)*n-i.canonical.x)*Cr,(e.y*n-i.canonical.y)*Cr),max:new Pe(r,o)}}function Up(e,t,i,n,r,o,s){const a=e.indices,l=e.vertices,c=[];for(let u=n;u<n+r;u+=3){const n=t[i[u+0]+o],r=t[i[u+1]+o],h=t[i[u+2]+o],d=Math.min(n.x,r.x,h.x),f=Math.max(n.x,r.x,h.x),p=Math.min(n.y,r.y,h.y),m=Math.max(n.y,r.y,h.y);c.length=0,e.grid.query(new Pe(d,p),new Pe(f,m),c);for(let e=0;e<c.length;e++){const t=c[e];if(Qh(l[a[3*t+0]],l[a[3*t+1]],l[a[3*t+2]],n,r,h,s))return!0}}return!1}function jp(e,t,i,n){if(!e||!i)return!1;let r=e.vertices;if(!t.canonical.equals(n.canonical)||t.wrap!==n.wrap){if(i.vertices.length<e.vertices.length)return jp(i,n,e,t);const o=t.canonical,s=n.canonical,a=Math.pow(2,s.z-o.z);r=e.vertices.map(e=>new Pe((e.x+o.x*Cr)*a-s.x*Cr,(e.y+o.y*Cr)*a-s.y*Cr))}return Up(i,r,e.indices,0,e.indices.length,0,0)}function Gp(e,t,i,n){const r=Math.pow(2,n.z-i.z);return new Pe((e+i.x*Cr)*r-n.x*Cr,(t+i.y*Cr)*r-n.y*Cr)}function $p(e,t){const i=[];t.grid.queryPoint(e,i);const n=t.indices,r=t.vertices;for(let t=0;t<i.length;t++){const o=i[t];if(Yh([r[n[3*o+0]],r[n[3*o+1]],r[n[3*o+2]]],e))return!0}return!1}const Hp={None:0,Model:1,Symbol:2,FillExtrusion:4};function Zp(e,t,i){const n=t[0],r=t[1];return e[0]=i[0]*n+i[4]*r+i[12],e[1]=i[1]*n+i[5]*r+i[13],e[3]=i[3]*n+i[7]*r+i[15],e}class qp{isDataAvailableAtPoint(e){const t=this._source();if(this.isUsingMockSource()||!t||e.y<0||e.y>1)return!1;const i=t.getSource().maxzoom,n=1<<i,r=Math.floor(e.x),o=Math.floor((e.x-r)*n),s=Math.floor(e.y*n),a=this.findDEMTileFor(new sp(i,r,i,o,s));return!(!a||!a.dem)}getAtPointOrZero(e,t=0){return this.getAtPoint(e,t)||0}getAtPoint(e,t,i=!0){if(this.isUsingMockSource())return null;t??=null;const n=this._source();if(!n)return t;if(e.y<0||e.y>1)return t;const r=n.getSource().maxzoom,o=1<<r,s=Math.floor(e.x),a=e.x-s,l=new sp(r,s,r,Math.floor(a*o),Math.floor(e.y*o)),c=this.findDEMTileFor(l);if(!c||!c.dem)return t;const u=c.dem,h=1<<c.tileID.canonical.z,d=(a*h-c.tileID.canonical.x)*u.dim,f=(e.y*h-c.tileID.canonical.y)*u.dim,p=Math.floor(d),m=Math.floor(f);return(i?this.exaggeration():1)*fn(fn(u.get(p,m),u.get(p,m+1),f-m),fn(u.get(p+1,m),u.get(p+1,m+1),f-m),d-p)}static getAtTileOffset(e,t,i,n){const r=1<<e.canonical.z;return n?n.pointElevation(t):i?i.getAtPointOrZero(new Ac(e.wrap+(e.canonical.x+t.x/Cr)/r,(e.canonical.y+t.y/Cr)/r)):0}static getAtTileOffsetFunc(e,t,i,n){return(r,o,s)=>{const a=this.getAtTileOffset(e,r,o,s),l=n.upVector(e.canonical,r.x,r.y);return V(l,l,a*n.upVectorScale(e.canonical,t,i).metersToTile),l}}getForTilePoints(e,t,i,n){if(this.isUsingMockSource())return!1;const r=Wp.create(this,e,n);return!!r&&(t.forEach(e=>{e[2]=this.exaggeration()*r.getElevationAt(e[0],e[1],i,!0)}),!0)}getMinMaxForTile(e){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(e);if(!t||!t.dem)return null;const i=t.dem.tree,n=t.tileID,r=1<<e.canonical.z-n.canonical.z;let o=e.canonical.x/r-n.canonical.x,s=e.canonical.y/r-n.canonical.y,a=0;for(let t=0;t<e.canonical.z-n.canonical.z&&!i.leaves[a];t++){o*=2,s*=2;const e=2*Math.floor(s)+Math.floor(o);a=i.childOffsets[a]+e,o%=1,s%=1}return{min:this.exaggeration()*i.minimums[a],max:this.exaggeration()*i.maximums[a]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(e,t,i){throw new Error("Pure virtual method called.")}pointCoordinate(e){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(e){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){const e=this.visibleDemTiles;if(0===e.length)return null;let t=!1,i=Number.MAX_VALUE,n=Number.MIN_VALUE;for(const r of e){const e=this.getMinMaxForTile(r.tileID);e&&(i=Math.min(i,e.min),n=Math.max(n,e.max),t=!0)}return t?{min:i,max:n}:null}}class Wp{constructor(e,t,i){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=i}static create(e,t,i){const n=i||e.findDEMTileFor(t);if(!n||!n.dem)return;const r=n.dem,o=n.tileID,s=1<<t.canonical.z-o.canonical.z;return new Wp(n,r.dim/Cr/s,[(t.canonical.x/s-o.canonical.x)*r.dim,(t.canonical.y/s-o.canonical.y)*r.dim])}tileCoordToPixel(e,t){const i=t*this._scale+this._offset[1];return new Pe(Math.floor(e*this._scale+this._offset[0]),Math.floor(i))}getElevationAt(e,t,i,n){const r=e*this._scale+this._offset[0],o=t*this._scale+this._offset[1],s=Math.floor(r),a=Math.floor(o),l=this._dem;return n=!!n,i?fn(fn(l.get(s,a,n),l.get(s,a+1,n),o-a),fn(l.get(s+1,a,n),l.get(s+1,a+1,n),o-a),r-s):l.get(s,a,n)}getElevationAtPixel(e,t,i){return this._dem.get(e,t,!!i)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*xc(1,e)*this._dem.stride}}const Yp=.05;function Xp(e,t,i){const n=nt(45,65,i),[r,o]=e.range;let s=1-Math.min(1,Math.exp((t-r)/(o-r)*-6));return s*=s*s,s=Math.min(1,1.00747*s),s*n*e.alpha}function Jp(e,t,i,n,r,o){const s=[t,i,n];return X(s,s,o.calculateFogTileMatrix(r)),Xp(e,R(s),o.pitch)}function Kp(e,t,i,n,r){return Xp(e,R(X([],[t,i,n],r.mercatorFogMatrix)),r.pitch)}function Qp(e,t,i){const n=t.createTileMatrix(e,e.worldSize,i.toUnwrapped());return m(new Float32Array(16),e.projMatrix,n)}function em(e,t,i,n){return t.name===n?i.calculateProjMatrix(e.toUnwrapped()):Qp(i,t,e)}const tm={SYMBOL_INVISIBLE:0,VARIANT_VISIBLE:2};function im(e){return 3*e}const nm=4294967296,rm=1/nm,om="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class sm{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,i=this.length){let n;for(;n=this.nextField(i);)e(n,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*nm;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*nm;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf,i=t[this.pos++];if(i<128)return i;let n,r=127&i;return n=t[this.pos++],r|=(127&n)<<7,n<128?r:(n=t[this.pos++],r|=(127&n)<<14,n<128?r:(n=t[this.pos++],r|=(127&n)<<21,n<128?r:(n=t[this.pos],r|=(15&n)<<28,function(e,t,i){const n=i.buf;let r,o;if(o=n[i.pos++],r=(112&o)>>4,o<128)return am(e,r,t);if(o=n[i.pos++],r|=(127&o)<<3,o<128)return am(e,r,t);if(o=n[i.pos++],r|=(127&o)<<10,o<128)return am(e,r,t);if(o=n[i.pos++],r|=(127&o)<<17,o<128)return am(e,r,t);if(o=n[i.pos++],r|=(127&o)<<24,o<128)return am(e,r,t);if(o=n[i.pos++],r|=(1&o)<<31,o<128)return am(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(r,e,this))))}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return Boolean(this.readVarint())}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&om?om.decode(this.buf.subarray(t,e)):function(e,t,i){let n="",r=t;for(;r<i;){const t=e[r];let o,s,a,l=null,c=t>239?4:t>223?3:t>191?2:1;if(r+c>i)break;1===c?t<128&&(l=t):2===c?(o=e[r+1],128==(192&o)&&(l=(31&t)<<6|63&o,l<=127&&(l=null))):3===c?(o=e[r+1],s=e[r+2],128==(192&o)&&128==(192&s)&&(l=(15&t)<<12|(63&o)<<6|63&s,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(o=e[r+1],s=e[r+2],a=e[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&t)<<18|(63&o)<<12|(63&s)<<6|63&a,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),r+=c}return n}(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}nextField(e=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=e)return 0;const t=this.readVarint();return this.type=7&t,this._valueStart=this.pos,t>>>3}skip(e){const t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else{if(1!==t)throw new Error(`Unimplemented type: ${t}`);this.pos+=8}}}function am(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function lm(e,t,i){const n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(n),i.buf.copyWithin(e+n,e,i.pos)}function cm(e,t){const i=e.length;let n=t.buf,r=t.pos,o=t.length;for(let s=0;s<i;s++){let i=e[s];if(i<0||r+10>o)t.pos=r,t.writeVarint(i),n=t.buf,r=t.pos,o=t.length;else{for(;i>127;)n[r++]=i%128|128,i=Math.floor(i/128);n[r++]=i}}t.pos=r}function um(e,t){for(let i=0;i<e.length;i++)t.writeSVarint(e[i])}function hm(e,t){for(let i=0;i<e.length;i++)t.writeFloat(e[i])}function dm(e,t){for(let i=0;i<e.length;i++)t.writeDouble(e[i])}function fm(e,t){for(let i=0;i<e.length;i++)t.writeBoolean(e[i])}function pm(e,t){for(let i=0;i<e.length;i++)t.writeFixed32(e[i])}function mm(e,t){for(let i=0;i<e.length;i++)t.writeSFixed32(e[i])}function _m(e,t){for(let i=0;i<e.length;i++)t.writeFixed64(e[i])}function gm(e,t){for(let i=0;i<e.length;i++)t.writeSFixed64(e[i])}function ym(e,t,i){let n;for(;n=e.nextField(t);)3===n?i.glyphs.push(vm(e,e.readVarint()+e.pos)):4===n?i.ascender=e.readSVarint():5===n&&(i.descender=e.readSVarint())}function vm(e,t){let i,n,r=0,o=0,s=0,a=0,l=0,c=0;for(;n=e.nextField(t);)1===n?r=e.readVarint():2===n?i=e.readBytes():3===n?o=e.readVarint():4===n?s=e.readVarint():5===n?a=e.readSVarint():6===n?l=e.readSVarint():7===n&&(c=e.readVarint());return{id:r,bitmap:new ud({width:o+6,height:s+6},i),metrics:{width:o,height:s,left:a,top:l,advance:c}}}function xm(e){let t=0,i=0;for(const n of e)t+=n.w*n.h,i=Math.max(i,n.w);e.sort((e,t)=>t.h-e.h);const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let r=0,o=0;for(const t of e)for(let e=n.length-1;e>=0;e--){const i=n[e];if(!(t.w>i.w||t.h>i.h)){if(t.x=i.x,t.y=i.y,o=Math.max(o,t.y+t.h),r=Math.max(r,t.x+t.w),t.w===i.w&&t.h===i.h){const t=n.pop();t&&e<n.length&&(n[e]=t)}else t.h===i.h?(i.x+=t.w,i.w-=t.w):t.w===i.w?(i.y+=t.h,i.h-=t.h):(n.push({x:i.x+t.w,y:i.y,w:i.w-t.w,h:t.h}),i.y+=t.h,i.h-=t.h);break}}return{w:r,h:o,fill:t/(r*o)||0}}function bm(e,t){return e.id<t.id?-1:e.id>t.id?1:e.version<t.version?-1:e.version>t.version?1:e.sx<t.sx?-1:e.sx>t.sx?1:e.sy<t.sy?-1:e.sy>t.sy?1:0}function wm(e){let t=0;for(let i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t&=t;return t}function Tm(e,t){return(e<<5)-e+t}function Em(e,t,i,n){for(const[r]of e.entries()){const e=n&&n.get(r)||jn.parse(r),o=e.id.toString(),s=t.get(o)||0;i.push({id:r,version:s,sx:e.sx,sy:e.sy})}}class Sm{constructor(e,t,i,n,r="",o){this.scope=r,this.iconDescriptors=[],this.patternDescriptors=[],this.requiresMipMaps=t.size>0,Em(e,i,this.iconDescriptors,o),Em(t,i,this.patternDescriptors,o),this.iconDescriptors.sort(bm),this.patternDescriptors.sort(bm);let s=0;s=Tm(s,wm(r)),s=Tm(s,1);const a=n?n.data:"";a&&(s=Tm(s,wm(a))),s=Tm(s,1);for(const e of this.iconDescriptors)s=Tm(s,wm(e.id)),s=Tm(s,e.version),s=Tm(s,e.sx),s=Tm(s,e.sy);s=Tm(s,1);for(const e of this.patternDescriptors)s=Tm(s,wm(e.id)),s=Tm(s,e.version),s=Tm(s,e.sx),s=Tm(s,e.sy);this.hash=s}subsetOf(e){return this.scope===e.scope&&this.isSubsetArray(this.iconDescriptors,e.iconDescriptors,bm)&&this.isSubsetArray(this.patternDescriptors,e.patternDescriptors,bm)}isSubsetArray(e,t,i){let n=0,r=0;if(e.length>t.length)return!1;for(;n<e.length&&r<t.length;){const o=i(e[n],t[r]);if(0===o)n++,r++;else{if(o<0)return!1;r++}}return n===e.length}}function Im(e){switch(e){case WebGL2RenderingContext.RGBA8:case WebGL2RenderingContext.RGBA16F:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function Am(e){switch(e){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.RGBA16F:return WebGL2RenderingContext.HALF_FLOAT;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}Ys(Sm,"AtlasContentDescriptor");class Mm{constructor(e,t,i,n){this.context=e,this.format=i,this.useMipmap=n&&n.useMipmap,this.texture=e.gl.createTexture(),this.update(t,{premultiply:n&&n.premultiply})}update(e,t){const i=e&&e instanceof HTMLVideoElement&&0===e.width?e.videoWidth:e.width,n=e&&e instanceof HTMLVideoElement&&0===e.height?e.videoHeight:e.height,{context:r}=this,{gl:o}=r,{x:s,y:a}=t&&t.position?t.position:{x:0,y:0},l=s+i,c=a+n;this.size&&(this.size[0]!==l||this.size[1]!==c)&&(!t||void 0===t.recreateWhenResize||t.recreateWhenResize)&&(o.bindTexture(o.TEXTURE_2D,null),o.deleteTexture(this.texture),this.texture=o.createTexture(),this.size=null),o.bindTexture(o.TEXTURE_2D,this.texture),r.pixelStoreUnpackFlipY.set(!1),r.pixelStoreUnpack.set(1),r.pixelStoreUnpackPremultiplyAlpha.set(this.format===o.RGBA8&&(!t||!1!==t.premultiply));const u=e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap;if(!this.size&&l>0&&c>0){const e=this.useMipmap?Math.floor(Math.log2(Math.max(l,c)))+1:1;o.texStorage2D(o.TEXTURE_2D,e,this.format,l,c),this.size=[l,c]}this.size&&(u?o.texSubImage2D(o.TEXTURE_2D,0,s,a,Im(this.format),Am(this.format),e):"data"in e&&e.data&&o.texSubImage2D(o.TEXTURE_2D,0,s,a,i,n,Im(this.format),Am(this.format),e.data)),this.useMipmap&&o.generateMipmap(o.TEXTURE_2D)}bind(e,t,i=!1){const{context:n}=this,{gl:r}=n;r.bindTexture(r.TEXTURE_2D,this.texture),e!==this.minFilter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.useMipmap&&!i?e===r.NEAREST?r.NEAREST_MIPMAP_NEAREST:r.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),t!==this.wrapS&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,t),this.wrapS=t)}bindExtraParam(e,t,i,n,r){const{context:o}=this,{gl:s}=o;s.bindTexture(s.TEXTURE_2D,this.texture),t!==this.magFilter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,t),this.magFilter=t),e!==this.minFilter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,this.useMipmap?e===s.NEAREST?s.NEAREST_MIPMAP_NEAREST:s.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),i!==this.wrapS&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,i),this.wrapS=i),n!==this.wrapT&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,n),this.wrapT=n),r!==this.compareMode&&(r?(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_COMPARE_FUNC,r)):s.texParameteri(s.TEXTURE_2D,s.TEXTURE_COMPARE_MODE,s.NONE),this.compareMode=r)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class Cm{constructor(e,t,i,n){this.context=e,this.format=n,this.size=i,this.texture=e.gl.createTexture();const[r,o,s]=this.size,{gl:a}=e;a.bindTexture(a.TEXTURE_3D,this.texture),e.pixelStoreUnpackFlipY.set(!1),e.pixelStoreUnpack.set(1),e.pixelStoreUnpackPremultiplyAlpha.set(!1),"data"in t&&t.data&&a.texImage3D(a.TEXTURE_3D,0,this.format,r,o,s,0,Im(this.format),Am(this.format),t.data)}bind(e,t){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_3D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_3D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_3D,n.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_3D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_3D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class Dm{static getImagePositionScale(e,t,i){if(t&&e){const{sx:t,sy:i}=e;return{x:t,y:i}}return{x:i,y:i}}constructor(e,t,i,n){this.paddedRect=e;const{pixelRatio:r,version:o,stretchX:s,stretchY:a,content:l,sdf:c,usvg:u}=t;this.pixelRatio=r,this.stretchX=s,this.stretchY=a,this.content=l,this.version=o,this.padding=i,this.sdf=c,this.usvg=u,this.scale=Dm.getImagePositionScale(n,u,r)}get tl(){return[this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return[this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return[(this.paddedRect.w-2*this.padding)/this.scale.x,(this.paddedRect.h-2*this.padding)/this.scale.y]}}function Pm(e,t,i){const n=jn.parse(e),r=function(e,t,i=[1,1]){return{x:0,y:0,w:(e.data?e.data.width:e.width*i[0])+2*t,h:(e.data?e.data.height:e.height*i[1])+2*t}}(t,i,[n.sx,n.sy]);return{bin:r,imagePosition:new Dm(r,t,i,n),imageVariant:n}}function Rm(e,t){const i=[];for(const[n,r]of e.entries()){const e=jn.parse(n);e&&(i.push({key:n,value:r,variant:e}),t&&t.set(n,e))}i.sort((e,t)=>{const i=e.variant.id.toString().localeCompare(t.variant.id.toString());return 0!==i?i:e.variant.sx!==t.variant.sx?e.variant.sx-t.variant.sx:e.variant.sy!==t.variant.sy?e.variant.sy-t.variant.sy:e.key.localeCompare(t.key)});const n=new Map;for(const e of i)n.set(e.key,e.value);return n}class Lm{constructor(e){this.sourceAtlasHash=e}}class zm{constructor(e,t,i,n,r=""){const o=new Map,s=new Map;this.haveRenderCallbacks=[];const a=[],l=void 0!==n,c=l?new Map:void 0,u=l?Rm(e,c):e,h=l?Rm(t,c):t;this.addImages(u,o,1,a),this.addImages(h,s,2,a);const{w:d,h:f}=xm(a),p=new hd({width:d||1,height:f||1});for(const[e,t]of u.entries()){const i=o.get(e).paddedRect;hd.copy(t.data,p,{x:0,y:0},{x:i.x+1,y:i.y+1},t.data,null,t.sdf)}for(const[e,t]of h.entries()){const n=s.get(e),r=n.paddedRect;let o=n.padding;const a=r.x+o,l=r.y+o,c=t.data.width,u=t.data.height;o=o>1?o-1:o,hd.copy(t.data,p,{x:0,y:0},{x:a,y:l},t.data,i),hd.copy(t.data,p,{x:0,y:u-o},{x:a,y:l-o},{width:c,height:o},i),hd.copy(t.data,p,{x:0,y:0},{x:a,y:l+u},{width:c,height:o},i),hd.copy(t.data,p,{x:c-o,y:0},{x:a-o,y:l},{width:o,height:u},i),hd.copy(t.data,p,{x:0,y:0},{x:a+c,y:l},{width:o,height:u},i),hd.copy(t.data,p,{x:c-o,y:u-o},{x:a-o,y:l-o},{width:o,height:o},i),hd.copy(t.data,p,{x:0,y:u-o},{x:a+c,y:l-o},{width:o,height:o},i),hd.copy(t.data,p,{x:0,y:0},{x:a+c,y:l+u},{width:o,height:o},i),hd.copy(t.data,p,{x:c-o,y:0},{x:a-o,y:l+u},{width:o,height:o},i)}this.lut=i,this.image=p,this.iconPositions=o,this.patternPositions=s,l&&(this.contentDescriptor=new Sm(u,h,n,i,r,c))}addImages(e,t,i,n){for(const[r,o]of e.entries()){const{bin:e,imagePosition:s,imageVariant:a}=Pm(r,o,i);t.set(r,s),n.push(e),o.hasRenderCallback&&this.haveRenderCallbacks.push(a.id)}}patchUpdatedImages(e,t,i,n){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(t=>e.hasImage(t,i)),e.dispatchRenderCallbacks(this.haveRenderCallbacks,i);for(const r of e.getUpdatedImages(i)){for(const n of this.iconPositions.keys()){const o=jn.parse(n);if(cn.isEqual(o.id,r)){const o=e.getImage(r,i);this.patchUpdatedImage(this.iconPositions.get(n),o,t,null)}}for(const o of this.patternPositions.keys()){const s=jn.parse(o);if(cn.isEqual(s.id,r)){const s=e.getImage(r,i);this.patchUpdatedImage(this.patternPositions.get(o),s,t,n||this.lut)}}}}patchUpdatedImage(e,t,i,n=null){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[r,o]=e.tl,s=e.sdf;if(this.lut||s){const e={width:t.data.width,height:t.data.height},a=new hd(e);hd.copy(t.data,a,{x:0,y:0},{x:0,y:0},e,n,s),i.update(a,{position:{x:r,y:o},recreateWhenResize:!1})}else i.update(t.data,{position:{x:r,y:o},recreateWhenResize:!1})}}Ys(Dm,"ImagePosition"),Ys(zm,"ImageAtlas",{omit:["lut"]}),Ys(Lm,"ImageAtlasReference");class Fm{constructor(e){this.pendingRequests=new Map,this.cachedRanges=new Map,this.fontstackCompositing=e&&e.fontstackCompositing||"client"}loadGlyphRange(e,t,i,n,r){if("server"===this.fontstackCompositing)return void Fm.loadGlyphRange(e,t,i,n,r);const o=e.split(",").map(e=>e.trim()).filter(e=>e.length>0);0!==o.length?1!==o.length?this._loadMultipleFonts(o,t,i,n,r):this._loadFont(o[0],t,i,n,r):r(new Error("Empty fontstack"))}_loadMultipleFonts(e,t,i,n,r){const o=e.map(()=>null),s={completed:0,firstError:null,callbackCalled:!1},a=(t,i,n)=>{if(!s.callbackCalled&&(i&&!s.firstError&&(s.firstError=i),n&&(o[t]=n),s.completed++,s.completed===e.length)){s.callbackCalled=!0;const e=o.filter(e=>null!==e);if(0===e.length)return void r(s.firstError||new Error("All fonts failed to load"));const t=this._composeGlyphs(e);r(null,t)}};for(let r=0;r<e.length;r++)this._loadFont(e[r],t,i,n,(e,t)=>{a(r,e,t)})}_loadFont(e,t,i,n,r){const o=`${e}:${t}`;if(this.cachedRanges.has(o)){const e=this.cachedRanges.get(o);return void Vt.frame(()=>r(null,e))}const s=this.pendingRequests.get(o);s?s.push(r):(this.pendingRequests.set(o,[r]),Fm.loadGlyphRange(e,t,i,n,(e,t)=>{e||this.cachedRanges.set(o,t||null);const i=this.pendingRequests.get(o);if(this.pendingRequests.delete(o),i)for(const n of i)n(e,t)}))}_composeGlyphs(e){const t={};let i,n;for(const r of e)if(void 0===i&&void 0!==r.ascender&&(i=r.ascender),void 0===n&&void 0!==r.descender&&(n=r.descender),r.glyphs)for(const e in r.glyphs)void 0===t[e]&&(t[e]=r.glyphs[e]);return{glyphs:t,ascender:i,descender:n}}}Fm.loadGlyphRange=async function(e,t,i,n,r){const o=256*t,s=o+255;let a;try{const t=await n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",`${o}-${s}`),ai.Glyphs),{data:r}=await _i(t),l={},c=function(e){return function(e){const t={glyphs:[]};let i;for(;i=e.nextField();)1===i&&ym(e,e.readVarint()+e.pos,t);return t}(new sm(e))}(r);for(const e of c.glyphs)l[e.id]=e;a={glyphs:l,ascender:c.ascender,descender:c.descender}}catch(e){return r(e)}r(null,a)};const Om=1e20,km=new Float64Array(256);for(let e=0;e<256;e++){const t=.5-Math.pow(e/255,1/2.2);km[e]=t*Math.abs(t)}function Bm(e,t,i,n,r,o,s,a,l){for(let c=t;c<t+n;c++)Nm(e,i*o+c,o,r,s,a,l);for(let c=i;c<i+r;c++)Nm(e,c*o+t,1,n,s,a,l)}function Nm(e,t,i,n,r,o,s){o[0]=0,s[0]=-Om,s[1]=Om,r[0]=e[t];for(let a=1,l=0,c=0;a<n;a++){r[a]=e[t+a*i];const n=a*a;do{const e=o[l];c=(r[a]-r[e]+n-e*e)/(a-e)/2}while(c<=s[l]&&--l>-1);l++,o[l]=a,s[l]=c,s[l+1]=Om}for(let a=0,l=0;a<n;a++){for(;s[l+1]<a;)l++;const n=o[l],c=a-n;e[t+a*i]=r[n]+c*c}}km[255]=-Om;const Vm=/bold/i,Um=/medium/i,jm=/light/i,Gm={none:0,ideographs:1,all:2};class $m{constructor(e,t,i,n){this.requestManager=e,this.localGlyphMode=t,this.localFontFamily=i,this.url="",this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}},this.glyphLoader=new Fm({fontstackCompositing:n})}setURL(e){this.url=e}prefetchRange(e,t){const i=this.url||jt.GLYPHS_URL;if(!i)return;let n=this.entries[e];n||(n=this.entries[e]={glyphs:{},requests:{},ranges:{}}),n.ranges[t]||n.requests[t]||(n.requests[t]=[],this.glyphLoader.loadGlyphRange(e,t,i,this.requestManager,(e,i)=>{if(i){n.ascender=i.ascender,n.descender=i.descender;for(const e in i.glyphs)this._doesCharSupportLocalGlyph(+e)||(n.glyphs[+e]=i.glyphs[+e]);n.ranges[t]=!0}for(const r of n.requests[t]||[])r(e,i);delete n.requests[t]}))}getGlyphs(e,t){const i=[],n=this.url||jt.GLYPHS_URL;for(const t in e)for(const n of e[t])i.push({stack:t,id:n});ot(i,({stack:e,id:t},i)=>{let r=this.entries[e];r||(r=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let o=r.glyphs[t];if(void 0!==o)return void i(null,{stack:e,id:t,glyph:o});if(o=this._tinySDF(r,e,t),o)return r.glyphs[t]=o,void i(null,{stack:e,id:t,glyph:o});const s=Math.floor(t/256);if(256*s>65535)return gt("glyphs > 65535 not supported"),void i(null,{stack:e,id:t,glyph:o});if(r.ranges[s])return void i(null,{stack:e,id:t,glyph:o});let a=r.requests[s];a||(a=r.requests[s]=[],this.glyphLoader.loadGlyphRange(e,s,n,this.requestManager,(e,t)=>{if(t){r.ascender=t.ascender,r.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(r.glyphs[+e]=t.glyphs[+e]);r.ranges[s]=!0}for(const i of a)i(e,t);delete r.requests[s]})),a.push((n,r)=>{n?i(n):r&&i(null,{stack:e,id:t,glyph:r.glyphs[t]||null})})},(e,i)=>{if(e)t(e);else if(i){const e={};for(const{stack:t,id:n,glyph:r}of i)void 0===e[t]&&(e[t]={}),void 0===e[t].glyphs&&(e[t].glyphs={}),e[t].glyphs[n]=r&&{id:r.id,bitmap:r.bitmap.clone(),metrics:r.metrics},e[t].ascender=this.entries[t].ascender,e[t].descender=this.entries[t].descender;t(null,e)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Gm.none&&(this.localGlyphMode===Gm.all?!!this.localFontFamily:!!this.localFontFamily&&(ga(e)||xa(e)||la(e)||ca(e)||aa(e)||_a(e)||(t=e)>=131072&&t<=173791||(e=>e>=66736&&e<=66815)(e)));var t}_tinySDF(e,t,i){const n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(i))return;let r=e.tinySDF;if(!r){let i="400";Vm.test(t)?i="900":Um.test(t)?i="500":jm.test(t)&&(i="200"),r=e.tinySDF=new $m.TinySDF({fontFamily:n,fontWeight:i,fontSize:48,buffer:6,radius:16}),r.fontWeight=i}const o=r.fontWeight;if(this.localGlyphs[o][i])return this.localGlyphs[o][i];const s=String.fromCodePoint(i),{data:a,width:l,height:c,glyphWidth:u,glyphHeight:h,glyphLeft:d,glyphTop:f,glyphAdvance:p}=r.draw(s);return this.localGlyphs[o][i]={id:i,bitmap:new ud({width:l,height:c},a),metrics:{width:u/2,height:h/2,left:d/2,top:f/2-27,advance:p/2,localGlyph:!0}}}}function Hm(e,t){return e+t[1]-t[0]}function Zm(e,t,i,n,r=1){const o=[],s=e.imagePrimary,a=s.pixelRatio,l=s.paddedRect.w-2,c=s.paddedRect.h-2,u=(e.right-e.left)*r,h=(e.bottom-e.top)*r,d=s.stretchX||[[0,l]],f=s.stretchY||[[0,c]],p=d.reduce(Hm,0),m=f.reduce(Hm,0),_=l-p,g=c-m;let y=0,v=p,x=0,b=m,w=0,T=_,E=0,S=g;if(s.content&&n){const e=s.content;y=qm(d,0,e[0]),x=qm(f,0,e[1]),v=qm(d,e[0],e[2]),b=qm(f,e[1],e[3]),w=e[0]-y,E=e[1]-x,T=e[2]-e[0]-v,S=e[3]-e[1]-b}const I=(n,o,l,c)=>{const d=Xm(n.stretch-y,v,u,e.left*r),f=Jm(n.fixed-w,T,n.stretch,p),_=Xm(o.stretch-x,b,h,e.top*r),g=Jm(o.fixed-E,S,o.stretch,m),I=Xm(l.stretch-y,v,u,e.left*r),A=Jm(l.fixed-w,T,l.stretch,p),M=Xm(c.stretch-x,b,h,e.top*r),C=Jm(c.fixed-E,S,c.stretch,m),D=new Pe(d,_),P=new Pe(I,_),R=new Pe(I,M),L=new Pe(d,M),z=new Pe(f/a,g/a),F=new Pe(A/a,C/a),O=t*Math.PI/180;if(O){const e=Math.sin(O),t=Math.cos(O),i=[t,-e,e,t];D._matMult(i),P._matMult(i),L._matMult(i),R._matMult(i)}const k=n.stretch+n.fixed,B=l.stretch+l.fixed,N=o.stretch+o.fixed,V=c.stretch+c.fixed,U=e.imageSecondary;return{tl:D,tr:P,bl:L,br:R,texPrimary:{x:s.paddedRect.x+1+k,y:s.paddedRect.y+1+N,w:B-k,h:V-N},texSecondary:U?{x:U.paddedRect.x+1+k,y:U.paddedRect.y+1+N,w:B-k,h:V-N}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:F,minFontScaleX:T/a/u,minFontScaleY:S/a/h,isSDF:i}};if(s.stretchX||s.stretchY){const e=Wm(d,_,p),t=Wm(f,g,m);for(let i=0;i<e.length-1;i++){const n=e[i],r=e[i+1];for(let e=0;e<t.length-1;e++)o.push(I(n,t[e],r,t[e+1]))}}else o.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return o}function qm(e,t,i){let n=0;for(const r of e)n+=Math.max(t,Math.min(i,r[1]))-Math.max(t,Math.min(i,r[0]));return n}function Wm(e,t,i){const n=[{fixed:-1,stretch:0}];for(const[t,i]of e){const e=n.at(-1);n.push({fixed:t-e.stretch,stretch:e.stretch}),n.push({fixed:t-e.stretch,stretch:e.stretch+(i-t)})}return n.push({fixed:t+1,stretch:i}),n}function Ym(e){return 2*e.length+1}function Xm(e,t,i,n){return e/t*i+n}function Jm(e,t,i,n){return e-t*i/n}function Km(e,t,i,n){const r=t+e.positionedLines[n].lineOffset;return 0===n?i+r/2:i+(r+(t+e.positionedLines[n-1].lineOffset))/2}function Qm(e,t,i,n,r,o,s,a,l,c=1){const u=[];if(0===t.positionedLines.length)return u;const h=(void 0!==l?l:n.layout.get("text-rotate").evaluate(o,{}))*Math.PI/180,d=function(e){const t=e[0],i=e[1],n=t*i;return n>0?[t,-i]:n<0?[-t,i]:0===t?[i,t]:[i,-t]}(i);let f=Math.abs(t.top-t.bottom);for(const e of t.positionedLines)f-=e.lineOffset;const p=t.positionedLines.length,m=f/p;let _=t.top-i[1];for(let e=0;e<p;++e){const n=t.positionedLines[e];_=Km(t,m,_,e);for(const e of n.positionedGlyphs){if(!e.rect)continue;const n=e.rect||{};let o=4,l=!0,f=1,p=0;if(e.image){const t=s.get(e.image.toString());if(!t)continue;l=!1,f=t.pixelRatio,o=1/f,t.usvg||(f/=c)}const m=(r||a)&&e.vertical,g=e.metrics.advance*e.scale/2,y=e.metrics,v=e.rect;if(null===v)continue;a&&t.verticalizable&&(p=e.image?g-e.metrics.width*e.scale/2:0);const x=r?[e.x+g,e.y]:[0,0];let b=[0,0],w=[0,0],T=!1;r||(m?(w=[e.x+g+d[0],e.y+d[1]-p],T=!0):b=[e.x+g+i[0],e.y+i[1]-p]);const E=v.w*e.scale/(f*(e.localGlyph?2:1)),S=v.h*e.scale/(f*(e.localGlyph?2:1));let I,A,M,C;if(m){const t=e.y-_,i=new Pe(-g,g-t),n=-Math.PI/2,r=new Pe(...w);I=new Pe(-g+b[0],b[1]),I._rotateAround(n,i)._add(r),I.x+=-t+g,I.y-=(y.left-o)*e.scale;const s=e.image?y.advance*e.scale:Wd*e.scale,a=String.fromCodePoint(e.glyph);tf(a)?I.x+=(1-o)*e.scale:nf(a)?I.x+=s-y.height*e.scale+(-o-1)*e.scale:I.x+=e.image||y.width+2*o===v.w&&y.height+2*o===v.h?(s-S)/2:(s-(y.height+2*o)*e.scale)/2,A=new Pe(I.x,I.y-E),M=new Pe(I.x+S,I.y),C=new Pe(I.x+S,I.y-E)}else{const t=(y.left-o)*e.scale-g+b[0],i=(-y.top-o)*e.scale+b[1],n=t+E,r=i+S;I=new Pe(t,i),A=new Pe(n,i),M=new Pe(t,r),C=new Pe(n,r)}if(h){let e;e=r?new Pe(0,0):T?new Pe(d[0],d[1]):new Pe(i[0],i[1]),I._rotateAround(h,e),A._rotateAround(h,e),M._rotateAround(h,e),C._rotateAround(h,e)}const D=new Pe(0,0),P=new Pe(0,0);u.push({tl:I,tr:A,bl:M,br:C,texPrimary:n,texSecondary:void 0,writingMode:t.writingMode,glyphOffset:x,sectionIndex:e.sectionIndex,isSDF:l,pixelOffsetTL:D,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}}return u}$m.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:i=8,cutoff:n=.25,fontFamily:r="sans-serif",fontWeight:o="normal",fontStyle:s="normal",lang:a=null}={}){this.buffer=t,this.radius=i,this.cutoff=n,this.lang=a;const l=this.size=e+4*t,c=this._createCanvas(l),u=this.ctx=c.getContext("2d",{willReadFrequently:!0});u.font=`${s} ${o} ${e}px ${r}`,u.textBaseline="alphabetic",u.textAlign="left",u.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(e){if("undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,e);const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:r,actualBoundingBoxRight:o}=this.ctx.measureText(e),s=Math.ceil(i),a=Math.floor(-r),l=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o)-a)),c=Math.max(0,Math.min(this.size-this.buffer,s+Math.ceil(n))),u=l+2*this.buffer,h=c+2*this.buffer,d=Math.max(u*h,0),f=new Uint8ClampedArray(d),p={data:f,width:u,height:h,glyphWidth:l,glyphHeight:c,glyphTop:s,glyphLeft:a,glyphAdvance:t};if(0===l||0===c)return p;const{ctx:m,buffer:_,gridInner:g,gridOuter:y}=this;this.lang&&(m.lang=this.lang),m.clearRect(_,_,l,c),m.fillText(e,_-a,_+s);const v=m.getImageData(_,_,l,c);y.fill(Om,0,d),g.fill(0,0,d);let x=3;for(let e=0;e<c;e++){let t=(e+_)*u+_;for(let e=0;e<l;e++,x+=4,t++){const e=v.data[x];if(0===e)continue;const i=km[e];y[t]=Math.max(0,i),g[t]=Math.max(0,-i)}}Bm(y,0,0,u,h,u,this.f,this.v,this.z);const b=Math.min(_,1);Bm(g,_-b,_-b,l+2*b,c+2*b,u,this.f,this.v,this.z);const w=255/this.radius,T=255*(1-this.cutoff);for(let e=0;e<d;e++){const t=Math.sqrt(y[e])-Math.sqrt(g[e]);f[e]=Math.round(T-w*t)}return p}};class e_{constructor(e,t){this.lastParams=null,this.lastAllFeaturesIndex=-2,this.appearancesVersion=t,this.appearances=e;const i=e.map(e=>function(e){if(!e.condition)return{featureDependent:!1,stateDependent:!1,zoomDependent:!1,pitchDependent:!1,brightnessDependent:!1,worldviewDependent:!1};const t=e.condition.expression;return{featureDependent:!zr(t),stateDependent:!Fr(t),zoomDependent:!kr(t,["zoom"]),pitchDependent:!kr(t,["pitch"]),brightnessDependent:!kr(t,["brightness","measure-light"]),worldviewDependent:!kr(t,["worldview"])}}(e));this.anyFeatureDependent=i.some(e=>e.featureDependent),this.anyStateDependent=i.some(e=>e.stateDependent)}update(e,t){const i=this.lastParams,n=!i||i.zoom!==e.zoom||i.pitch!==(e.pitch||0)||i.brightness!==(e.brightness||0)||i.worldview!==e.worldview;this.lastParams={zoom:e.zoom,pitch:e.pitch||0,brightness:e.brightness||0,worldview:e.worldview};const r=t&&this.anyStateDependent;if(!n&&!r&&-2!==this.lastAllFeaturesIndex)return{kind:"no-changes"};if(!this.anyFeatureDependent&&!r){const t=this.evaluateAllFeatures(e);return t===this.lastAllFeaturesIndex?{kind:"no-changes"}:(this.lastAllFeaturesIndex=t,{kind:"all-features",appearanceIndex:t})}return{kind:"per-feature"}}evaluateAllFeatures(e){for(let t=0;t<this.appearances.length;t++){const i=this.appearances[t];if(i.condition&&i.condition.evaluate(e,void 0,void 0,void 0))return t}return-1}}const t_=Lh.types,i_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function n_(e,t,i,n,r,o,s,a,l,c,u,h,d){const f=a?Math.min(uf,Math.round(a[0])):0,p=a?Math.min(uf,Math.round(a[1])):0;e.emplaceBack(t,i,Math.round(32*n),Math.round(32*r),o,s,(f<<1)+(l?1:0),0+(p<<1),16*c,16*u,256*h,256*d)}function r_(e,t,i){e.emplaceBack(t,i)}function o_(e,t,i,n,r,o,s){e.emplaceBack(t,i,n,r,o,s)}function s_(e,t,i,n,r){const o=5*t+2;e.float32[o+0]=i,e.float32[o+1]=n,e.float32[o+2]=r}function a_(e,t,i,n,r){e.emplaceBack(t,i,n,r),e.emplaceBack(t,i,n,r),e.emplaceBack(t,i,n,r),e.emplaceBack(t,i,n,r)}function l_(e){for(const t of e.sections)if(za(t.text))return!0;return!1}const c_=12,u_={};class h_{constructor(e){this.layoutVertexArray=new iu,this.indexArray=new hu,this.programConfigurations=e,this.segments=new Gu,this.dynamicLayoutVertexArray=new ru,this.opacityVertexArray=new ou,this.placedSymbolArray=new Cu,this.iconTransitioningVertexArray=new su,this.globeExtVertexArray=new nu,this.zOffsetVertexArray=new Zc,this.orientationVertexArray=new pu,this.symbolInstanceIndices=[],this.uboBinder=null,this.featureIdArray=new Zc,this.featureIdBuffer=null,this.cachedBatchIndices=null,this.cachedBatchSegments=null}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}getBatchGrouping(e){const t=e.get().length===this.segments.get().length;if(t&&this.cachedBatchIndices&&this.cachedBatchSegments)return{batchIndices:this.cachedBatchIndices,batchSegments:this.cachedBatchSegments};const i=new Map;for(const t of e.get()){const e=void 0!==t.batchIndex?t.batchIndex:0;i.has(e)||i.set(e,[]),i.get(e).push(t)}const n=Array.from(i.keys()).sort((e,t)=>e-t),r=new Map;for(const e of n){const t=i.get(e);r.set(e,new Gu(t))}return t&&(this.cachedBatchIndices=n,this.cachedBatchSegments=r),{batchIndices:n,batchSegments:r}}snapshotSymbolVertexData(e,t){const i=e*c_;return this.layoutVertexArray.uint16.slice(i,i+t*c_)}restoreSymbolVertexData(e,t){this.layoutVertexArray.uint16.set(t,e*c_)}snapshotIconTransitioningVertexData(e,t){const i=2*e;return this.iconTransitioningVertexArray.uint16.slice(i,i+2*t)}restoreIconTransitioningVertexData(e,t){this.iconTransitioningVertexArray.uint16.set(t,2*e)}updateSymbolVertexData(e,t,i,n,r,o,s,a,l,c,u,h,d){const f=this.layoutVertexArray.uint16,p=e*c_;f[p]=t,f[p+1]=i,f[p+2]=n,f[p+3]=r,f[p+4]=o,f[p+5]=s,f[p+6]=a,f[p+7]=l,f[p+8]=c,f[p+9]=u,f[p+10]=h,f[p+11]=d}upload(e,t,i,n,r,o){this.isEmpty()||(i&&(this.cachedBatchIndices=null,this.cachedBatchSegments=null,this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Sd.members,!!o),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Ad.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,i_,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,Pd.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Id.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||r)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Md.members,!0)),!this.orientationVertexBuffer&&this.orientationVertexArray&&this.orientationVertexArray.length>0&&(this.orientationVertexBuffer=e.createVertexBuffer(this.orientationVertexArray,Dd.members,!0)),this.opacityVertexBuffer.itemSize=1,this.featureIdArray.length>0&&(this.featureIdBuffer=e.createVertexBuffer(this.featureIdArray,Cd.members,!1))),(i||n)&&(this.programConfigurations.upload(e),this.uboBinder&&this.uboBinder.upload(e)))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.orientationVertexBuffer&&this.orientationVertexBuffer.destroy(),this.featureIdBuffer&&this.featureIdBuffer.destroy(),this.uboBinder&&this.uboBinder.destroy())}}Ys(h_,"SymbolBuffers",{omit:["cachedBatchIndices","cachedBatchSegments"]});class d_{constructor(e,t,i){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new i,this.segments=new Gu,this.collisionVertexArray=new uu,this.collisionVertexArrayExt=new ru}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Rd.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Ld.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Ys(d_,"CollisionBuffers");class f_{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.placementIdRangeStart=null,this.placementVariantVisible=[],this.collisionCircleArray=[],this.placementInvProjMatrix=d([]),this.placementViewportMatrix=d([]);const t=this.layers[0]._unevaluatedLayout._values;this.worldview=e.worldview,this.localizable=e.localizable,this.maxUniformBufferBindings=e.maxUniformBufferBindings,this.maxUniformBlockSizeDwords=e.maxUniformBlockSizeDwords,this.textSizeData=of(this.zoom,t["text-size"],this.worldview,e.availableImages),this.iconSizeData=of(this.zoom,t["icon-size"],this.worldview,e.availableImages);const i=this.layers[0].layout,n=i.get("symbol-sort-key"),r=i.get("symbol-z-order");this.lut=e.lut,this.canOverlap=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=i.get("text-writing-mode").map(e=>Xd[e]),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.sourceID=e.sourceID,this.projection=e.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=!1,this.elevationType="none",this.activeReplacements=[],this.replacementUpdateTime=0,this.hasAnySecondaryIcon=!1,this.hasAppearances=null,this.featureAppearances=null,this.featureAppearanceData=new Map}hasAnyAppearanceLayoutProperty(e){const t=this.layers[0].getAppearances();if(!t||0===t.length)return!1;const i=Array.isArray(e)?e:[e];return t.some(e=>i.some(t=>e.hasLayoutProperty(t)))}getAppearanceFeatureData(e){return this.featureAppearanceData.get(e)}createArrays(){this.text=new h_(new _h(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("text")||e.startsWith("symbol"))),this.icon=new h_(new _h(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("icon")||e.startsWith("symbol"))),this.text.uboBinder=new qd(this.layers[0],this.zoom,this.lut,!0,"",this.maxUniformBufferBindings,this.maxUniformBlockSizeDwords),this.icon.uboBinder=new qd(this.layers[0],this.zoom,this.lut,!1,"",this.maxUniformBufferBindings,this.maxUniformBlockSizeDwords),this.glyphOffsetArray=new Ru,this.lineVertexArray=new Lu,this.symbolInstances=new Pu}calculateGlyphDependencies(e,t,i,n,r){for(const i of e){const e=i.codePointAt(0);if(void 0===e)break;if(t[e]=!0,n&&r&&e<=65535){const e=ef[i];e&&(t[e.charCodeAt(0)]=!0)}}}calculateEffectiveAppearanceIconSize(e,t,i,n,r,o,s){if(!e.hasLayoutProperty("icon-size"))return s*o;let a=1;const l=e.getUnevaluatedLayoutProperty("icon-size"),c=of(this.zoom,l,this.worldview,r),u=af(c,t);if("constant"!==c.kind&&"camera"!==c.kind||(a=u.uSize),"composite"===c.kind){const{minZoom:e,maxZoom:t}=c,o=l.possiblyEvaluate(new Ha(e,{worldview:this.worldview}),n),s=l.possiblyEvaluate(new Ha(t,{worldview:this.worldview}),n),h=o.evaluate(i,{},n,r);a=h+(s.evaluate(i,{},n,r)-h)*u.uSizeT}return"source"===c.kind&&(a=l.possiblyEvaluate(new Ha(this.zoom,{worldview:this.worldview}),n).evaluate(i,{},n,r)),a*o}updateFootprints(e,t){}hideSymbolVariant(e,t){this._setSymbolVariantVisibility(e,!1)}showSymbolVariant(e,t){this._setSymbolVariantVisibility(e,!0)}_initPlacementOpacities(){const e=e=>{const t=e.layoutVertexArray.length/4;for(let i=0;i<t;i++)e.opacityVertexArray.emplaceBack(0)};this.hasTextData()&&e(this.text),this.hasIconData()&&e(this.icon)}_setSymbolVariantVisibility(e,t){const i=e.symbolId.symbolId-this.placementIdRangeStart,n=this.symbolInstances.get(i);this.placementVariantVisible[i]=t;const r=t?4294967295:0,o=(e,t)=>{if(t<0)return;const i=e.placedSymbolArray.get(t),n=i.vertexStartIndex/4;for(let t=0;t<i.numGlyphs;t++)e.opacityVertexArray.emplace(n+t,r);e.opacityVertexBuffer&&e.opacityVertexBuffer.updateData(e.opacityVertexArray)};this.hasTextData()&&o(this.text,this.defaultPlacedTextSymbolIndex(n,i)),this.hasIconData()&&o(this.icon,n.placedIconSymbolIndex)}resetPlacementVisibility(){if(null===this.placementIdRangeStart)return;this.placementVariantVisible.fill(!1);const e=e=>{for(let t=0;t<e.opacityVertexArray.length;t++)e.opacityVertexArray.emplace(t,0);e.opacityVertexBuffer&&e.opacityVertexBuffer.updateData(e.opacityVertexArray)};this.hasTextData()&&e(this.text),this.hasIconData()&&e(this.icon)}addToPlacement(e,t,i,n,r,o,s,a,l,c,u,h){if(0===this.symbolInstances.length)return;if(h&&this.updateReplacement(s.tileID,h),!this.collisionArrays){if(!s.collisionBoxArray)return;this.deserializeCollisionBoxes(s.collisionBoxArray)}null===this.placementIdRangeStart&&(this.placementIdRangeStart=t.allocateRange(i,this.symbolInstances.length),this.placementVariantVisible=new Array(this.symbolInstances.length).fill(!1),this._initPlacementOpacities());const d=this.placementIdRangeStart,f=this.layers[0];if(f.appearances&&f.appearances.length>0)return void gt("new placement: symbol appearances are not supported yet; hiding symbols");if("point"!==f.layout.get("symbol-placement"))return void gt("new placement: along-line symbol placement is not supported yet; hiding symbols");const p=!!f.layout.get("text-variable-anchor"),m=this.getProjection(),_="globe"!==m.name;_||gt("new placement: globe projection is not supported yet; hiding symbols");const g=s.tileID.toUnwrapped(),y=r.pitch>0,v={collisionRules:{},insertIntoCollisionGrid:!0},x=r.zoom,b=af(this.iconSizeData,x),w=af(this.textSizeData,x),T=f.paint.get("symbol-z-offset"),E="sea"===f.layout.get("symbol-elevation-reference"),S=!T.isConstant(),I=S?0:T.evaluate(null,{}),A=r.elevation,M=im(c),C=e=>{if(!e)return M;const t=l.get(bl(e,f.scope));return void 0!==t?t:(gt(`global placement: placement-group "${e}" does not match any placement-group layer; using the layer's implicit group`),M)},D=f.paint.get("placement-priority"),P=f.paint.get("placement-group"),R=!D.isConstant(),L=!P.isConstant(),z=R?0:D.evaluate(null,{}),F=L?M:C(P.evaluate(null,{})),O=R||L,k=S||O?s.latestFeatureIndex:null;k&&k.loadVTLayers();const B=k?k.sourceLayerCoder.decode(this.sourceLayerIndex):"",N=(e,t,i)=>{let n;if("road"===this.elevationType)n=E?i:i+qp.getAtTileOffset(s.tileID,new Pe(e.tileAnchorX,e.tileAnchorY),A,null);else{const r=this.hdExt?this.hdExt.elevationFeatures[t.elevationFeatureIndex]:void 0;n=E?i:i+qp.getAtTileOffset(s.tileID,new Pe(e.tileAnchorX,e.tileAnchorY),A,r)}if(n+=t.zOffset,!n)return{x:e.projectedAnchorX,y:e.projectedAnchorY,z:e.projectedAnchorZ,elevated:!1};const[o,a,l]=m.upVector(s.tileID.canonical,e.tileAnchorX,e.tileAnchorY),c=m.upVectorScale(s.tileID.canonical,r.center.lat,r.worldSize).metersToTile;return{x:e.projectedAnchorX+o*n*c,y:e.projectedAnchorY+a*n*c,z:e.projectedAnchorZ+l*n*c,elevated:!0}},V=(t,i,s,l)=>{if(!t)return;const{x:c,y:u,z:h,elevated:d}=N(t,i,s),f=function(e,t,i,n,r,o,s,a,l){const c=[t,i,n,1];let u=!1;n||r.pitch>0?(le(c,c,e),a&&"globe"!==o.name&&(u=Jp(a,t,i,n,l,r)>.9)):Zp(c,c,e);const h=c[3];return{x:(c[0]/h+1)/2*r.width,y:(-c[1]/h+1)/2*r.height,perspectiveRatio:Math.min(.5+r.getCameraToCenterDistance(o)/h*.5,1.5),occluded:s&&c[2]>h||u}}(n,c,u,h,r,m,y||d,a,g);if(f.occluded||f.perspectiveRatio<=.55)return;const p=l(),_=o*f.perspectiveRatio,v=(t.x1*p-t.padding)*_+f.x,x=(t.y1*p-t.padding)*_+f.y,b=(t.x2*p+t.padding)*_+f.x,w=(t.y2*p+t.padding)*_+f.y;v<b&&x<w&&e.addGeometry({kind:"box",left:v,top:x,right:b,bottom:w})};for(let t=0;t<this.symbolInstances.length;t++){const n=this.symbolInstances.get(t);if(n.hasIconTextFit){gt("new placement: icon-text-fit is not supported yet; skipping symbols");continue}if(p&&(n.numHorizontalGlyphVertices>0||n.numVerticalGlyphVertices>0)){gt("new placement: text-variable-anchor is not supported yet; skipping symbols");continue}if(n.numVerticalGlyphVertices>0){gt("new placement: vertical text-writing-mode is not supported yet; skipping symbols");continue}const r=this.collisionArrays[t];if(!r.iconBox&&!r.textBox)continue;let o=!1;for(const e of this.activeReplacements)if(!zp(e,c,Hp.Symbol,f.scope)&&!(e.min.x>n.tileAnchorX||n.tileAnchorX>e.max.x||e.min.y>n.tileAnchorY||n.tileAnchorY>e.max.y)&&(o=$p(Gp(n.tileAnchorX,n.tileAnchorY,s.tileID.canonical,e.footprintTileId.canonical),e.footprint),o))break;const a={symbolId:{styleLayerId:i,symbolIdOrigin:1,symbolId:d+t},variantIdx:0},l=k?k.loadFeature({featureIndex:n.featureIndex,sourceLayerIndex:this.sourceLayerIndex,bucketIndex:this.index,layoutVertexArrayOffset:0}):null,h=O&&l&&k?k.getId(l,B):void 0,m=void 0!==h&&u[String(h)]||u_,g=R&&l?D.evaluate(l,m):z,y=L&&l?C(P.evaluate(l,m)):F;if(e.startSymbolVariantProcessing(a,{placementSubgroupOrder:y,symbolPlacementPriority:g,symbolVariantVisibility:this.placementVariantVisible[t]?tm.VARIANT_VISIBLE:tm.SYMBOL_INVISIBLE,symbolPlacementType:1,styleLayerOrder:c,symbolDisplayOrder:0},v),_&&!o){const e=S&&l?T.evaluate(l,{}):I;V(r.iconBox,n,e,()=>this.getSymbolInstanceIconSize(b,x,n.placedIconSymbolIndex)),V(r.textBox,n,e,()=>this.getSymbolInstanceTextSize(w,n,x,t))}e.finishVariantProcessing()}}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=t.updateTime;const i=t.getReplacementRegionsForTile(e.toUnwrapped(),!0);return!Bp(this.activeReplacements,i)&&(this.activeReplacements=i,!0)}getResolvedImageFromTokens(e){return"string"==typeof e?Gn.build(e):e}populate(e,t,i,n){const r=this.layers[0],o=r.layout,s="globe"===this.projection.name,a=o.get("text-font"),l=o.get("text-field"),c=o.get("icon-image"),[u,h]=o.get("icon-size-scale-range"),d=it(t.scaleFactor||1,u,h),[f,p]=o.get("text-size-scale-range"),m=it(t.scaleFactor||1,f,p),_=("constant"!==l.value.kind||l.value.value instanceof Un&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),g="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,y=this.hasAnyAppearanceLayoutProperty("icon-image"),v=o.get("symbol-sort-key");if(this.features=[],this.featureAppearanceData=new Map,!_&&!g&&!y)return;const x=t.iconDependencies,b=t.glyphDependencies,w=t.availableImages,T=new Ha(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),E=e=>{const t=e.id.toString();x.has(t)?x.get(t).push(e):x.set(t,[e])};for(const t of e){const{feature:e,id:l,index:c,sourceLayerIndex:u}=t,h=r._featureFilter.needGeometry,f=Oc(e,h);if(!r._featureFilter.filter(T,f,i))continue;if(h||(f.geometry=Fc(e,i,n)),s&&1!==e.type&&i.z<=5){const e=f.geometry,t=.98078528056,n=(e,n)=>q(Gf(e.x,e.y,i,1),Gf(n.x,n.y,i,1))<t;for(let t=0;t<e.length;t++)e[t]=Pc(e[t],n)}let p,S;if(_){const e=r.getValueAndResolveTokens("text-field",f,i,w),t=Un.factory(e);l_(t)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===ja()||this.hasRTLText&&$a.isParsed())&&(p=Yd(t,r,f))}if(g){const e=r.getValueAndResolveTokens("icon-image",f,i,w);S=this.getResolvedImageFromTokens(e)}const I=this.layers[0];let A=!1;if(!S&&y){const e=I.getAppearances();for(const t of e)if(t.getLayoutProperty("icon-image")){const e=I.getAppearanceValueAndResolveTokens(t,"icon-image",f,i,w);if(e){S=this.getResolvedImageFromTokens(e),A=!0;break}}}if(!p&&!S)continue;const M=this.sortFeaturesByKey?v.evaluate(f,{},i):void 0,C={id:l,text:p,icon:S,index:c,sourceLayerIndex:u,geometry:f.geometry,properties:e.properties,type:t_[e.type],sortKey:M};if(this.features.push(C),this.featureAppearanceData.set(c,{id:l,properties:e.properties,usesAppearanceIconAsPlaceholder:A}),S){const e=I._unevaluatedLayout._values,{iconPrimary:t,iconSecondary:n}=mf(S,this.iconSizeData,e["icon-size"],i,this.zoom,C,this.pixelRatio,d,this.worldview,w);E(t),n&&(this.hasAnySecondaryIcon=!0,E(n))}const D=I.getAppearances();if(0!==D.length&&D.forEach(e=>{if(!e.getLayoutProperty("icon-image"))return;const{iconPrimary:t,iconSecondary:n}=this.getCombinedIconVariants(e,I,f,i,w,C,d);t&&(E(t),n&&(this.hasAnySecondaryIcon=!0,E(n)))}),p){const e=a.evaluate(f,{},i).join(","),t="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.includes(Xd.vertical);for(const i of p.sections)if(i.image){const e=i.image.getPrimary().scaleSelf(this.pixelRatio*m),t=e.id.toString(),n=x.get(t)||[];n.push(e),x.set(t,n)}else{const n=Ma(p.toString()),r=i.fontStack||e,o=b[r]=b[r]||{};this.calculateGlyphDependencies(i.text,o,t,this.allowVerticalPlacement,n)}}}"line"===o.get("symbol-placement")&&(this.features=function(e){const t={},i={},n=[];let r=0;function o(t){n.push(e[t]),r++}function s(e,t,r){const o=i[e];return delete i[e],i[t]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(r[0]),o}function a(e,i,r){const o=t[i];return delete t[i],t[e]=o,n[o].geometry[0].shift(),n[o].geometry[0]=r[0].concat(n[o].geometry[0]),o}function l(e,t,i){const n=i?t[0].at(-1):t[0][0];return`${e}:${n.x}:${n.y}`}for(let c=0;c<e.length;c++){const u=e[c],h=u.geometry,d=u.text?u.text.toString():null;if(!d||h.length>1){o(c);continue}const f=l(d,h,!1),p=l(d,h,!0);if(f in i&&p in t&&i[f]!==t[p]){const e=a(f,p,h),r=s(f,p,n[e].geometry);delete t[f],delete i[p],i[l(d,n[r].geometry,!0)]=r,n[e].geometry=null}else f in i?s(f,p,h):p in t?a(f,p,h):(o(c),t[f]=r-1,i[p]=r-1)}return n.filter(e=>e.geometry)}(this.features)),"hd-road-markup"===o.get("symbol-elevation-reference")?(this.elevationType="road",this.hdExt&&(this.hdExt.configureCrossSource(i,t.elevationParams,t.crossSourceElevationEnabled,t.terrainEnabled),t.elevationFeatures&&t.elevationFeatures.length>0&&this.hdExt.addElevationFeatures(t.elevationFeatures,i))):o.get("symbol-z-elevate")&&(this.elevationType="offset"),"none"!==this.elevationType&&(this.zOffsetBuffersNeedUpload=!0),this.sortFeaturesByKey&&this.features.sort((e,t)=>e.sortKey-t.sortKey)}getCombinedIconVariants(e,t,i,n,r,o,s){let a;if(e.hasLayoutProperty("icon-image")){const o=t.getAppearanceValueAndResolveTokens(e,"icon-image",i,n,r);a=this.getResolvedImageFromTokens(o)}else{const e=t.getValueAndResolveTokens("icon-image",i,n,r);a=this.getResolvedImageFromTokens(e)}if(a){const i=e.hasLayoutProperty("icon-size")?e.getUnevaluatedLayoutProperty("icon-size"):t._unevaluatedLayout._values["icon-size"],l=of(this.zoom,i,this.worldview,r),{iconPrimary:c,iconSecondary:u}=mf(a,l,i,n,this.zoom,o,this.pixelRatio,s,this.worldview,r);return{iconPrimary:c,iconSecondary:u}}return{iconPrimary:void 0,iconSecondary:void 0}}getCombinedIconPrimary(e,t,i,n,r,o,s){return this.getCombinedIconVariants(e,t,i,n,r,o,s).iconPrimary}updateSymbolInstanceIconVertices(e,t,i,n,r,o){const{canonical:s,availableImages:a,globalProperties:l,layer:c,iconScaleFactor:u,featureState:h,layoutIconOffset:d,layoutIconSize:f,layoutIconRotate:p}=o;if(e.placedIconSymbolIndex<0)return{vertexOffsetDelta:0,hasChanges:!1};if(t.activeAppearanceIndex===i)return{vertexOffsetDelta:e.numIconVertices,hasChanges:!1};const m=i>=0?c.appearances[i]:null;if(m){const i={sortKey:void 0,text:void 0,icon:null,index:e.featureIndex,sourceLayerIndex:e.featureIndex,geometry:[],properties:t.properties,type:"Point",id:t.id},{iconPrimary:o,iconSecondary:_}=this.getCombinedIconVariants(m,c,n,s,a,i,u);if(!o)return{vertexOffsetDelta:0,hasChanges:!1};const g=o.toString(),y=this.iconAtlasPositions&&this.iconAtlasPositions.get(g);if(y){const{appearanceIconOffset:i,appearanceIconRotate:o}=df(m,c,n,s,d,p,f,u),g=c.layout.get("icon-anchor").evaluate(n,h,s);let v=Kd(y,_?this.iconAtlasPositions&&this.iconAtlasPositions.get(_.toString()):void 0,i,g);const x=y.sdf,b=c.layout.get("icon-text-fit").constantOr("none");"none"!==b&&t.textShaping&&t.iconTextFitPadding&&t.fontScale&&(v=Qd(v,t.textShaping,b,t.iconTextFitPadding,i,t.fontScale));const w=this.calculateEffectiveAppearanceIconSize(m,l.zoom,n,s,a,u,f),T=0,E=1+(Math.min(uf,Math.round(w*rf))<<1),S=Zm(v,o,x,"none"!==b,u),I=this.icon.iconTransitioningVertexArray.length>0;t.isUsingAppearanceIconVertexData||(t.isUsingAppearanceIconVertexData=!0,t.layoutBasedIconVertexData=this.icon.snapshotSymbolVertexData(r,e.numIconVertices),I&&(t.layoutBasedIconTransitioningVertexData=this.icon.snapshotIconTransitioningVertexData(r,e.numIconVertices)));const A=Math.floor(e.numIconVertices/4),M=Math.min(S.length,A);let C=r;const D=I?this.icon.iconTransitioningVertexArray.uint16:null;for(let i=0;i<M;++i){const n=S[i],r=t.layoutBasedIconVertexData[0]||e.tileAnchorX,o=t.layoutBasedIconVertexData[1]||e.tileAnchorY,s=16*n.pixelOffsetTL.x,a=16*n.pixelOffsetTL.y,l=16*n.pixelOffsetBR.x,c=16*n.pixelOffsetBR.y,u=16*n.minFontScaleX,h=16*n.minFontScaleY;if(this.icon.updateSymbolVertexData(C,r,o,Math.round(32*n.tl.x),Math.round(32*n.tl.y),n.texPrimary.x,n.texPrimary.y,T,E,s,a,u,h),this.icon.updateSymbolVertexData(C+1,r,o,Math.round(32*n.tr.x),Math.round(32*n.tr.y),n.texPrimary.x+n.texPrimary.w,n.texPrimary.y,T,E,l,a,u,h),this.icon.updateSymbolVertexData(C+2,r,o,Math.round(32*n.bl.x),Math.round(32*n.bl.y),n.texPrimary.x,n.texPrimary.y+n.texPrimary.h,T,E,s,c,u,h),this.icon.updateSymbolVertexData(C+3,r,o,Math.round(32*n.br.x),Math.round(32*n.br.y),n.texPrimary.x+n.texPrimary.w,n.texPrimary.y+n.texPrimary.h,T,E,l,c,u,h),D){const e=n.texSecondary?n.texSecondary:n.texPrimary,t=2*C;D[t]=e.x,D[t+1]=e.y,D[t+2]=e.x+e.w,D[t+3]=e.y,D[t+4]=e.x,D[t+5]=e.y+e.h,D[t+6]=e.x+e.w,D[t+7]=e.y+e.h}C+=4}const P=e.numIconVertices-4*M;for(let e=0;e<P;++e)this.icon.updateSymbolVertexData(C+e,0,0,0,0,0,0,0,0,0,0,0,0);return{vertexOffsetDelta:e.numIconVertices,hasChanges:!0}}}else{if(t.usesAppearanceIconAsPlaceholder)return this.icon.updateSymbolVertexData(r,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(r+1,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(r+2,0,0,0,0,0,0,0,0,0,0,0,0),this.icon.updateSymbolVertexData(r+3,0,0,0,0,0,0,0,0,0,0,0,0),{vertexOffsetDelta:e.numIconVertices,hasChanges:!0};if(t.isUsingAppearanceIconVertexData)return this.icon.restoreSymbolVertexData(r,t.layoutBasedIconVertexData),t.layoutBasedIconTransitioningVertexData&&this.icon.restoreIconTransitioningVertexData(r,t.layoutBasedIconTransitioningVertexData),t.isUsingAppearanceIconVertexData=!1,{vertexOffsetDelta:t.layoutBasedIconVertexData.length/c_,hasChanges:!0}}return{vertexOffsetDelta:e.numIconVertices,hasChanges:!1}}updateSymbolInstanceTextVertices(e,t,i,n,r,o){const{canonical:s,layer:a,textScaleFactor:l,imageMap:c,featureState:u,layoutTextOffset:h,layoutTextSize:d,layoutTextRotate:f,layoutMinZoomSize:p,layoutMaxZoomSize:m,layoutTextSizeMinZoom:_,layoutTextSizeMaxZoom:g,availableImages:y}=o,v=e.numHorizontalGlyphVertices>0||e.numVerticalGlyphVertices>0;if(!v)return{vertexOffsetDelta:v?e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices:0,hasChanges:!1};if(t.activeAppearanceIndex===i)return{vertexOffsetDelta:e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices,hasChanges:!1};const x=i>=0?a.appearances[i]:null;if(x&&t.textShaping){const{appearanceTextOffset:i,appearanceTextRotate:o,appearanceTextSize:v}=ff(x,a,n,s,h,f,d);t.fontScale=_f(v,t.textScaleFactor);const b=x.getUnevaluatedLayoutProperty("text-size");let w=this.textSizeData,T=_,E=g;x.hasLayoutProperty("text-size")&&(w=of(this.zoom,b,this.worldview,y),T="composite"===this.textSizeData.kind?this.textSizeData.minZoom:0,E="composite"===this.textSizeData.kind?this.textSizeData.maxZoom:0);const S=t.textShaping.bottom-h[1],I=t.textShaping.left-h[0],A=t.textShaping.right-h[0];t.textShaping.top=i[1]+(t.textShaping.top-h[1]),t.textShaping.bottom=i[1]+S,t.textShaping.left=i[0]+I,t.textShaping.right=i[0]+A;const M=Qm(0,t.textShaping,i,a,!1,n,c,this.allowVerticalPlacement,o),C=v&&"composite"===w.kind?b.possiblyEvaluate(new Ha(T,{}),s).evaluate(n,u,s):p,D=v&&"composite"===w.kind?b.possiblyEvaluate(new Ha(E,{}),s).evaluate(n,u,s):m,P=gf(x.name,w,v,l,C,D),R=Array.isArray(P)?P[1]:v,L=0,z=1+(Math.min(uf,Math.round(R*rf))<<1);t.isUsingAppearanceTextVertexData||(t.isUsingAppearanceTextVertexData=!0,t.layoutBasedTextVertexData=this.text.snapshotSymbolVertexData(r,e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices));for(let t=0;t<M.length&&t<(e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices)/4;++t){const i=M[t],n=i.glyphOffset[1],o=e.tileAnchorX,s=e.tileAnchorY,a=r+4*t;this.text.updateSymbolVertexData(a,o,s,Math.round(32*i.tl.x),Math.round(32*(n+i.tl.y)),i.texPrimary.x,i.texPrimary.y,L,z,i.pixelOffsetTL.x,i.pixelOffsetTL.y,i.minFontScaleX,i.minFontScaleY),this.text.updateSymbolVertexData(a+1,o,s,Math.round(32*i.tr.x),Math.round(32*(n+i.tr.y)),i.texPrimary.x+i.texPrimary.w,i.texPrimary.y,L,z,i.pixelOffsetBR.x,i.pixelOffsetTL.y,i.minFontScaleX,i.minFontScaleY),this.text.updateSymbolVertexData(a+2,o,s,Math.round(32*i.bl.x),Math.round(32*(n+i.bl.y)),i.texPrimary.x,i.texPrimary.y+i.texPrimary.h,L,z,i.pixelOffsetTL.x,i.pixelOffsetBR.y,i.minFontScaleX,i.minFontScaleY),this.text.updateSymbolVertexData(a+3,o,s,Math.round(32*i.br.x),Math.round(32*(n+i.br.y)),i.texPrimary.x+i.texPrimary.w,i.texPrimary.y+i.texPrimary.h,L,z,i.pixelOffsetBR.x,i.pixelOffsetBR.y,i.minFontScaleX,i.minFontScaleY)}return{vertexOffsetDelta:e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices,hasChanges:!0}}return t.isUsingAppearanceTextVertexData?(this.text.restoreSymbolVertexData(r,t.layoutBasedTextVertexData),t.isUsingAppearanceTextVertexData=!1,{vertexOffsetDelta:t.layoutBasedTextVertexData.length/c_,hasChanges:!0}):{vertexOffsetDelta:e.numHorizontalGlyphVertices+e.numVerticalGlyphVertices,hasChanges:!1}}updateExpressions(e){this.text&&this.text.programConfigurations.updateExpressions(e),this.icon&&this.icon.programConfigurations.updateExpressions(e)}update(e,t,i,n,r,o,s,a){if(this.text.uboBinder||this.text.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,this.worldview),this.icon.uboBinder||this.icon.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,this.worldview),a)if(o)for(const n of[this.text.uboBinder,this.icon.uboBinder])n&&!n.isLightConstant&&n.updateDynamicExpressions(r[0],t,a,i,e,s);else if(Object.keys(e).length>0){const n=r[0],o=[this.text.uboBinder,this.icon.uboBinder].filter(e=>e&&e.hasStateDependentPaint(n));if(o.length>0){const r=new Set(Object.keys(e).map(e=>{const t=Number(e);return!isNaN(t)&&Number.isSafeInteger(t)&&String(t)===e?t:e}));for(const l of o)l.updateFeatures(r,n,t,a,i,e,s)}}}updateZOffset(){const e=(e,t,n)=>{i+=t,i>e.length&&e.resize(i);for(let r=-t;r<0;r++)e.emplace(r+i,n)},t=(e,t,i)=>{n+=t,n>e.length&&e.resize(n);for(let r=-t;r<0;r++)e.emplace(r+n,i)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let i=0,n=0;for(let i=0;i<this.symbolInstances.length;i++){const n=this.symbolInstances.get(i),{numHorizontalGlyphVertices:r,numVerticalGlyphVertices:o,numIconVertices:s}=n,a=n.zOffset,l=s>0;if((r>0||o>0)&&(e(this.text.zOffsetVertexArray,r,a),e(this.text.zOffsetVertexArray,o,a)),l){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:i}=n;e>=0&&t(this.icon.zOffsetVertexArray,s,a),i>=0&&t(this.icon.zOffsetVertexArray,n.numVerticalIconVertices,a)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e,t,i,n,r){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),null===this.hasAppearances&&(this.hasAppearances=this.layers.some(e=>e.appearances&&e.appearances.length>0)),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),this.uploaded=!0}updateAppearances(e,t,i,n,r,o=!1){const s={hasLayoutChanges:!1,hasUboChanges:!1};if(!e||!i||!this.featureAppearanceData)return s;const a=t||{},l=this.icon.layoutVertexArray&&this.icon.layoutVertexArray.length>0&&this.icon.layoutVertexArray.arrayBuffer,c=this.text.layoutVertexArray&&this.text.layoutVertexArray.length>0&&this.text.layoutVertexArray.arrayBuffer;if(!l&&!c)return s;const u=this.layers[0],h=u.layout;this.featureAppearances&&this.featureAppearances.appearancesVersion===u.appearancesVersion||(this.featureAppearances=new e_(u.appearances,u.appearancesVersion));const d=this.featureAppearances.update(n,o);if("no-changes"===d.kind)return s;let f=1,p=0,m=!1,_=!1;if(l){const[e,t]=h.get("icon-size-scale-range");f=it(1,e,t)}let g=1,y=0,v=!1;if(c){const[e,t]=h.get("text-size-scale-range");g=it(1,e,t)}const x=new Map;if(r&&i)for(const e of i){const t=r.getImage(e,u.scope);if(t){const i=new jn(e.toString());x.set(i.toString(),t)}}const b=[this.text.uboBinder,this.icon.uboBinder];for(let t=0;t<this.symbolInstances.length;t++){const r=this.symbolInstances.get(t),o=this.getAppearanceFeatureData(r.featureIndex);if(!o)continue;const s=o.id,w=void 0!==s?a[String(s)]:void 0,T={type:"Point",id:o.id,properties:o.properties,geometry:[]};let E;if("all-features"===d.kind)E=d.appearanceIndex;else{const t=u.appearances?u.appearances.findIndex(t=>t.isActive({globals:n,feature:T,canonical:e,featureState:w})):-1;E=t>=0?t:-1}const S=o.activeAppearanceIndex!==E;if(c){const t=h.get("text-size"),n="composite"===this.textSizeData.kind?this.textSizeData.minZoom:0,s="composite"===this.textSizeData.kind?this.textSizeData.maxZoom:0,a={canonical:e,layer:u,featureState:w,availableImages:i,textScaleFactor:g,imageMap:x,layoutTextOffset:h.get("text-offset").evaluate(T,w,e).map(e=>e*Wd),layoutTextSize:t.evaluate(T,w,e),layoutTextRotate:h.get("text-rotate").evaluate(T,w,e),layoutMinZoomSize:t.evaluate(T,{zoom:n},e),layoutMaxZoomSize:t.evaluate(T,{zoom:s},e),layoutTextSizeMinZoom:n,layoutTextSizeMaxZoom:s},l=this.updateSymbolInstanceTextVertices(r,o,E,T,y,a);y+=l.vertexOffsetDelta,v=v||l.hasChanges}if(l){const t={canonical:e,layer:u,featureState:w,availableImages:i,globalProperties:n,iconScaleFactor:f,layoutIconOffset:h.get("icon-offset").evaluate(T,w,e),layoutIconSize:h.get("icon-size").evaluate(T,w,e,i),layoutIconRotate:h.get("icon-rotate").evaluate(T,w,e)},s=this.updateSymbolInstanceIconVertices(r,o,E,T,p,t);p+=s.vertexOffsetDelta,m=m||s.hasChanges}if(S){const t=r.featureIndex,o=n?n.brightness:null,s=w||{},a=E>=0?u.appearances[E]:null;for(const n of b)n&&(n.layer=u,_=n.updateFeaturePaintForAppearance(t,T,s,e,i,o,a)||_)}o.activeAppearanceIndex=E}return m&&this.icon.layoutVertexBuffer&&null!==this.icon.layoutVertexArray.arrayBuffer&&this.icon.layoutVertexArray.length===this.icon.layoutVertexBuffer.length&&this.icon.layoutVertexBuffer.updateData(this.icon.layoutVertexArray),m&&this.icon.iconTransitioningVertexBuffer&&this.icon.iconTransitioningVertexArray.length>0&&this.icon.iconTransitioningVertexArray.length===this.icon.iconTransitioningVertexBuffer.length&&this.icon.iconTransitioningVertexBuffer.updateData(this.icon.iconTransitioningVertexArray),v&&this.text.layoutVertexBuffer&&null!==this.text.layoutVertexArray.arrayBuffer&&this.text.layoutVertexArray.length===this.text.layoutVertexBuffer.length&&this.text.layoutVertexBuffer.updateData(this.text.layoutVertexArray),{hasLayoutChanges:m||v,hasUboChanges:_}}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Pp(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const i=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:e,y:i}of t)this.lineVertexArray.emplaceBack(e,i);return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g){const y=e.indexArray,v=e.layoutVertexArray,x=e.globeExtVertexArray,b=g,w=e.uboBinder?e.uboBinder.getCurrentBatchIndex():void 0,T=e.segments.prepareSegment(4*b,v,y,this.canOverlap?o.sortKey:void 0,w),E=this.glyphOffsetArray.length,S=T.vertexLength,I=this.allowVerticalPlacement&&s===Xd.vertical?Math.PI/2:0,A=o.text&&o.text.sections;let M=v.length,C=-1;for(let n=0;n<t.length;n++){const{tl:r,tr:s,bl:c,br:u,texPrimary:h,texSecondary:_,pixelOffsetTL:g,pixelOffsetBR:b,minFontScaleX:w,minFontScaleY:E,glyphOffset:S,isSDF:D,sectionIndex:P}=t[n],R=T.vertexLength,L=S[1];if(n_(v,l.x,l.y,r.x,L+r.y,h.x,h.y,i,D,g.x,g.y,w,E),n_(v,l.x,l.y,s.x,L+s.y,h.x+h.w,h.y,i,D,b.x,g.y,w,E),n_(v,l.x,l.y,c.x,L+c.y,h.x,h.y+h.h,i,D,g.x,b.y,w,E),n_(v,l.x,l.y,u.x,L+u.y,h.x+h.w,h.y+h.h,i,D,b.x,b.y,w,E),a){const{x:t,y:i,z:n}=a.anchor,[r,o,s]=a.up;o_(x,t,i,n,r,o,s),o_(x,t,i,n,r,o,s),o_(x,t,i,n,r,o,s),o_(x,t,i,n,r,o,s),a_(e.dynamicLayoutVertexArray,t,i,n,I)}else a_(e.dynamicLayoutVertexArray,l.x,l.y,l.z,I);if(m){const t=_||h;r_(e.iconTransitioningVertexArray,t.x,t.y),r_(e.iconTransitioningVertexArray,t.x+t.w,t.y),r_(e.iconTransitioningVertexArray,t.x,t.y+t.h),r_(e.iconTransitioningVertexArray,t.x+t.w,t.y+t.h)}if(y.emplaceBack(R,R+1,R+2),y.emplaceBack(R+1,R+2,R+3),T.vertexLength+=4,T.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(S[0]),(n===t.length-1||P!==t[n+1].sectionIndex)&&(e.uboBinder||e.programConfigurations.populatePaintArrays(v.length,o,o.index,{},d,f,p,A&&A[P],this.worldview),e.uboBinder)){const t=e.uboBinder.populateUBO(o,o.index,f,d,p,A&&A[P]);C=t;const i=v.length-M;for(let n=0;n<i;n++)e.featureIdArray.emplaceBack(t);M=v.length}}const D=g-t.length;if(0!==D&&(this._addNullVertices(D,v,i,a,x,e,m,T,y),e.uboBinder&&C>=0)){const t=4*D;for(let i=0;i<t;i++)e.featureIdArray.emplaceBack(C)}const P=a?a.anchor:l;e.placedSymbolArray.emplaceBack(P.x,P.y,P.z,l.x,l.y,E,this.glyphOffsetArray.length-E,S,c,u,l.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],s,0,0,0,h,0),e.symbolInstanceIndices.push(_)}_addNullVertices(e,t,i,n,r,o,s,a,l){for(let c=0;c<e;c++){for(let e=0;e<4;e++)n_(t,0,0,0,0,0,0,i,!1,0,0,0,0),n?(o_(r,0,0,0,0,0,0),a_(o.dynamicLayoutVertexArray,0,0,0,0)):a_(o.dynamicLayoutVertexArray,0,0,0,0),s&&r_(o.iconTransitioningVertexArray,0,0);const e=a.vertexLength;l.emplaceBack(e,e+1,e+2),l.emplaceBack(e+1,e+2,e+3),a.vertexLength+=4,a.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(0)}}_commitLayoutVertex(e,t,i,n,r,o,s){e.emplaceBack(t,i,n,r,o,Math.round(s.x),Math.round(s.y))}_addCollisionDebugVertices(e,t,i,n,r,o,s){const a=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=a.vertexLength,c=s.tileAnchorX,u=s.tileAnchorY;for(let e=0;e<4;e++)i.collisionVertexArray.emplaceBack(0,0,0,0,0,0);this._commitDebugCollisionVertexUpdate(i.collisionVertexArrayExt,t,e.padding,s.zOffset),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new Pe(e.x1,e.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new Pe(e.x2,e.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new Pe(e.x2,e.y2)),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new Pe(e.x1,e.y2)),a.vertexLength+=4;const h=i.indexArray;h.emplaceBack(l,l+1),h.emplaceBack(l+1,l+2),h.emplaceBack(l+2,l+3),h.emplaceBack(l+3,l),a.primitiveLength+=4}_addTextDebugCollisionBoxes(e,t,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceTextSize(e,o,t,s);this._addCollisionDebugVertices(n,r,this.textCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}_addIconDebugCollisionBoxes(e,t,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._addCollisionDebugVertices(n,r,this.iconCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}generateCollisionDebugBuffers(e,t,i){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new d_(lu,zd.members,su),this.iconCollisionBox=new d_(lu,zd.members,su);const n=af(this.iconSizeData,e),r=af(this.textSizeData,e,i);for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this._addTextDebugCollisionBoxes(r,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(r,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}defaultPlacedTextSymbolIndex(e,t){return e.rightJustifiedTextSymbolIndex>=0?e.rightJustifiedTextSymbolIndex:e.centerJustifiedTextSymbolIndex>=0?e.centerJustifiedTextSymbolIndex:e.leftJustifiedTextSymbolIndex>=0?e.leftJustifiedTextSymbolIndex:e.verticalPlacedTextSymbolIndex>=0?e.verticalPlacedTextSymbolIndex:t}getSymbolInstanceTextSize(e,t,i,n){const r=this.defaultPlacedTextSymbolIndex(t,n),o=this.text.placedSymbolArray.get(r),s=sf(this.textSizeData,e,o)/Wd;return this.tilePixelRatio*s}getSymbolInstanceIconSize(e,t,i){const n=this.icon.placedSymbolArray.get(i),r=sf(this.iconSizeData,e,n);return this.tilePixelRatio*r}_commitDebugCollisionVertexUpdate(e,t,i,n){e.emplaceBack(t,-i,-i,n),e.emplaceBack(t,i,-i,n),e.emplaceBack(t,i,i,n),e.emplaceBack(t,-i,i,n)}_updateTextDebugCollisionBoxes(e,t,i,n,r,o,s){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceTextSize(e,o,t,s);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,r,n.padding,o.zOffset)}}_updateIconDebugCollisionBoxes(e,t,i,n,r,o,s){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,r,n.padding,o.zOffset)}}updateCollisionDebugBuffers(e,t,i,n){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const r=af(this.iconSizeData,e,n),o=af(this.textSizeData,e,i);for(let s=0;s<this.symbolInstances.length;s++){const a=this.symbolInstances.get(s);this._updateTextDebugCollisionBoxes(o,e,t,a.textBoxStartIndex,a.textBoxEndIndex,a,i),this._updateTextDebugCollisionBoxes(o,e,t,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a,i),this._updateIconDebugCollisionBoxes(r,e,t,a.iconBoxStartIndex,a.iconBoxEndIndex,a,n),this._updateIconDebugCollisionBoxes(r,e,t,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex,a,n)}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(e,t,i,n,r,o,s,a,l){const c={};if(t<i){const{x1:i,y1:n,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(t);c.textBox={x1:i,y1:n,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.textFeatureIndex=f}if(n<r){const{x1:t,y1:i,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(n);c.verticalTextBox={x1:t,y1:i,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalTextFeatureIndex=f}
vendor: 4,759 bytes, line 2
2if(o<s){const{x1:t,y1:i,x2:n,y2:r,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(o);c.iconBox={x1:t,y1:i,x2:n,y2:r,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.iconFeatureIndex=f}if(a<l){const{x1:t,y1:i,x2:n,y2:r,padding:o,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(a);c.verticalIconBox={x1:t,y1:i,x2:n,y2:r,padding:o,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalIconFeatureIndex=f}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const i=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.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}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,t){const i=e.placedSymbolArray.get(t),n=i.vertexStartIndex+4*i.numGlyphs;for(let t=i.vertexStartIndex;t<n;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),i=Math.cos(e),n=[],r=[],o=[];for(let e=0;e<this.symbolInstances.length;++e){o.push(e);const s=this.symbolInstances.get(e);n.push(0|Math.round(t*s.tileAnchorX+i*s.tileAnchorY)),r.push(s.featureIndex)}return o.sort((e,t)=>n[e]-n[t]||r[t]-r[e]),o}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;e<this.symbolInstances.length;++e)this.symbolInstanceIndexesSortedZOffset.push(e)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort((e,t)=>this.symbolInstances.get(t).zOffset-this.symbolInstances.get(e).zOffset)}addToSortKeyRanges(e,t){const i=this.sortKeyRanges.at(-1);i&&i.sortKey===t?i.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e)if(this.text.segments.get().length>1||this.icon.segments.get().length>1)this.sortFeaturesByY=!1;else{this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:i,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:r,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:s,verticalPlacedIconSymbolIndex:a}=t;i>=0&&this.addIndicesForPlacedSymbol(this.text,i),n>=0&&n!==i&&this.addIndicesForPlacedSymbol(this.text,n),r>=0&&r!==n&&r!==i&&this.addIndicesForPlacedSymbol(this.text,r),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Ys(f_,"SymbolBucket",{omit:["layers","collisionBoxArray","compareText","features"]}),f_.addDynamicAttributes=a_;class p_ extends wh{constructor(e,t,i){super(e,t,i),this.elevatedLayoutVertexArray=new Zc}upload(e){const t=this.uploaded;super.upload(e),!t&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=e.createVertexBuffer(this.elevatedLayoutVertexArray,Vu.members))}destroy(){this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),super.destroy()}}Ys(p_,"ElevatedFillBufferData");class m_{constructor(){this.portals=[]}static isOnBorder(e,t){return e<=0&&t<=0||e>=Cr&&t>=Cr}static evaluate(e){if(0===e.length)return new m_;let t=[];for(const i of e)t.push(...i.portals);if(0===t.length)return new m_;for(const e of t){const t=e.va,i=e.vb;(m_.isOnBorder(t.x,i.x)||m_.isOnBorder(t.y,i.y))&&(e.type="border")}const i=t.filter(e=>"unevaluated"!==e.type),n=t.filter(e=>"unevaluated"===e.type);if(0===n.length)return new m_;n.sort((e,t)=>
vendor: 11,963 bytes, line 2
2e.hash===t.hash?e.isTunnel===t.isTunnel?0:e.isTunnel?-1:1:e.hash<t.hash?1:-1),t=i.concat(n);let r=i.length,o=r,s=r;do{if(o++,o===t.length||t[r].hash!==t[o].hash){if(o-r===2){s<r&&(t[s]=t[r],t[r]=null);const e=t[s],i=t[o-1];e.type=e.isTunnel!==i.isTunnel?"tunnel":"polygon",e.connection={a:e.connection.a,b:i.connection.a},s++}r=o}}while(r!==t.length);return t.splice(s),t.sort((e,t)=>e.hash<t.hash?1:-1),{portals:t}}}Ys(m_,"ElevationPortalGraph");class __{constructor(e,t,i){this.outPositions=e,this.outNormals=t,this.outIndices=i,this.vertexLookup=new Map}addVertex(e,t,i){let n=e[2];null!=i&&(n*=i);const r=`${e[0]},${e[1]},${e[2]},${t[0]},${t[1]},${t[2]}`,o=this.vertexLookup.get(r);if(null!=o)return o;const s=this.outPositions.length;this.vertexLookup.set(r,s);const a=Math.trunc(16384*t[0]),l=Math.trunc(16384*t[1]),c=Math.trunc(16384*t[2]);return this.outPositions.emplaceBack(e[0],e[1],n),this.outNormals.emplaceBack(a,l,c),s}addTriangle(e,t,i){this.outIndices.emplaceBack(e,t,i)}addTriangles(e,t,i,n=0){if(0===e.length)return;const r=D(),o=D();for(let s=0;s<e.length;s+=3){const a=t[e[s+0]],l=t[e[s+1]],c=t[e[s+2]],u=i[e[s+1]]+n,h=i[e[s+2]]+n;z(r,a.x,a.y,i[e[s+0]]+n);const d=this.addVertex(r,o);z(r,l.x,l.y,u);const f=this.addVertex(r,o);z(r,c.x,c.y,h);const p=this.addVertex(r,o);this.outIndices.emplaceBack(d,f,p)}}addQuad(e,t,i,n,r,o){const s=this.addVertex(e,r,o),a=this.addVertex(t,r,o),l=this.addVertex(i,r,o),c=this.addVertex(n,r,o);this.addTriangle(s,a,l),this.addTriangle(l,c,s)}getVertexCount(){return this.outPositions.length}clearVertexLookup(){this.vertexLookup.clear()}}class g_{constructor(e,t,i,n){this.unevaluatedPortals=new m_,this.bridgeFeatureSections=[],this.tunnelFeatureSections=[],this.vertexHashLookup=new Map,this.unevalVertices=[],this.unevalHeights=[],this.unevalTriangles=[],this.unevalTunnelTriangles=[],this.unevalEdges=[],this.vertexPositions=new qc,this.vertexNormals=new Wc,this.indexArray=new hu,this.tileToMeters=Ic(e),this.bridgeProgramConfigurations=new _h(t,{zoom:i,lut:n},e=>"fill-tunnel-structure-color"!==e),this.tunnelProgramConfigurations=new _h(t,{zoom:i,lut:n},e=>"fill-bridge-guard-rail-color"!==e)}addVertices(e,t){const i=this.unevalVertices.length;for(let i=0;i<e.length;i++)this.unevalVertices.push(e[i]),this.unevalHeights.push(t[i]);return i}addTriangles(e,t,i){const n=i?this.unevalTunnelTriangles:this.unevalTriangles;for(const i of e)n.push(i+t)}addRenderableRing(e,t,i,n,r,o){const s=[new Pe(r.min.x,r.min.y),new Pe(r.max.x,r.min.y),new Pe(r.max.x,r.max.y),new Pe(r.min.x,r.max.y)];for(let a=0;a<i-1;a++){const i=t+a,l=i+1,c=this.unevalVertices[i],u=this.unevalVertices[l];if(!(c.x>=r.min.x&&c.x<=r.max.x&&c.y>=r.min.y&&c.y<=r.max.y||u.x>=r.min.x&&u.x<=r.max.x&&u.y>=r.min.y&&u.y<=r.max.y||Jh(c,u,s)))continue;if(this.isOnBorder(c.x,u.x)||this.isOnBorder(c.y,u.y))continue;const h=g_.computeEdgeHash(this.unevalVertices[i],this.unevalVertices[l]);let d,f=this.vertexHashLookup.get(g_.computePosHash(c));null!=f?d=f.next:(f=this.vertexHashLookup.get(g_.computePosHash(u)),d=null!=f?f.prev:h),this.unevalEdges.push({polygonIdx:e,a:i,b:l,hash:h,portalHash:d,isTunnel:n,type:"unevaluated",featureInfo:o})}}addPortalCandidates(e,t,i,n,r){if(0!==t.length){this.vertexHashLookup.clear();for(const r of t){if(0===r.length)continue;const t=r[0];let o=g_.computeEdgeHash(t[t.length-2],t.at(-1));for(let r=0;r<t.length-1;r++){const s=t[r+0],a=t[r+1],l=be(a.x-s.x,a.y-s.y),c=Ie(l);if(0===c)continue;let u="unevaluated";const h=n.pointElevation(s),d=n.pointElevation(a);Math.abs(h)<.01&&Math.abs(d)<.01?u="entrance":(this.isOnBorder(s.x,a.x)||this.isOnBorder(s.y,a.y))&&(u="border");const f=g_.computeEdgeHash(s,a);this.unevaluatedPortals.portals.push({connection:{a:e,b:void 0},va:s,vb:a,vab:l,length:c,hash:f,isTunnel:i,type:u});const p=g_.computePosHash(s);this.vertexHashLookup.has(p)||this.vertexHashLookup.set(p,{prev:o,next:f}),o=f}}}}construct(e){if(0===this.unevalVertices.length)return;const t=()=>({vertexOffset:0,primitiveOffset:this.indexArray.length}),i=e=>{e.primitiveLength=this.indexArray.length-e.primitiveOffset},n=new __(this.vertexPositions,this.vertexNormals,this.indexArray);this.prepareEdges(e.portals,this.unevalEdges);const r=t(),o=t(),s=t(),a=(e,t)=>{e.sort((e,i)=>e.type===t&&i.type!==t?-1:e.type!==t&&i.type===t?1:0);const i=e.findIndex(e=>e.type!==t);return i>=0?i:e.length};let l=0;this.unevalEdges.length>0&&(l=a(this.unevalEdges,"none"),this.constructBridgeStructures(n,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:l},this.tileToMeters)),i(s);const c=t(),u=t();if(this.unevalEdges.length>0){const e=this.unevalEdges.splice(l),t=a(e,"tunnel")+l;this.unevalEdges.push(...e),this.constructTunnelStructures(n,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:l},{min:l,max:t})}i(c),n.addTriangles(this.unevalTriangles,this.unevalVertices,this.unevalHeights),i(u),n.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights),i(o),n.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights,4),i(r),this.maskSegments=Gu.simpleSegment(0,u.primitiveOffset,0,u.primitiveLength),this.depthSegments=Gu.simpleSegment(0,o.primitiveOffset,0,o.primitiveLength),this.renderableBridgeSegments=Gu.simpleSegment(0,s.primitiveOffset,0,s.primitiveLength),this.renderableTunnelSegments=Gu.simpleSegment(0,c.primitiveOffset,0,c.primitiveLength),this.shadowCasterSegments=Gu.simpleSegment(0,r.primitiveOffset,0,r.primitiveLength)}update(e,t,i,n,r,o,s,a){this.bridgeProgramConfigurations.updatePaintArrays(e,t,r,i,n,o,s,a),this.tunnelProgramConfigurations.updatePaintArrays(e,t,r,i,n,o,s,a)}upload(e){this.vertexBuffer||0===this.vertexPositions.length||0===this.vertexNormals.length||0===this.indexArray.length||(this.vertexBuffer=e.createVertexBuffer(this.vertexPositions,Uu.members),this.vertexBufferNormal=e.createVertexBuffer(this.vertexNormals,ju.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.bridgeProgramConfigurations.upload(e),this.tunnelProgramConfigurations.upload(e))}destroy(){this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBufferNormal.destroy(),this.indexBuffer.destroy()),this.maskSegments&&(this.maskSegments.destroy(),this.depthSegments.destroy(),this.renderableBridgeSegments.destroy(),this.renderableTunnelSegments.destroy(),this.shadowCasterSegments.destroy()),this.bridgeProgramConfigurations.destroy(),this.tunnelProgramConfigurations.destroy()}populatePaintArrays(e,t,i,n,r){const o=(o,s)=>{for(let a=0;a<s.length-1;a++){const l=s[a].featureIndex,c=s[a+1].vertexStart,u=e.feature(l);o.populatePaintArrays(c,u,l,{},i,t,n,void 0,r)}};o(this.bridgeProgramConfigurations,this.bridgeFeatureSections),o(this.tunnelProgramConfigurations,this.tunnelFeatureSections)}computeVertexConnections(e,t,i,n,r){const o=new Map;for(let s=n;s<r;s++){const n=i[s],r=n.a,a=n.b,l=g_.computePosHash(e[r]),c=g_.computePosHash(e[a]);let u=o.get(l);u||(u={},o.set(l,u));let h=o.get(c);h||(h={},o.set(c,h)),t[r]<=0&&t[a]<=0||(u.to=a,h.from=r)}return o}isTerminalVertex(e,t){const i=g_.computePosHash(this.unevalVertices[e]),n=t.get(i);return!n||!n.from||!n.to}constructBridgeStructures(e,t,i,n,r,o){e.clearVertexLookup();const s=this.computeVertexConnections(t,i,n,r.min,r.max),a=1/o,l=.5*a,c=(e,n)=>z(e,t[n].x,t[n].y,i[n]*a),u=D(),h=D(),d=D(),f=D(),p=D(),m=(e,i)=>{const n=s.get(g_.computePosHash(t[i])),r=n.from,o=n.to;if(!r||!o)return;c(u,r),c(h,i),c(d,o),Q(f),ee(u,h)||(te(p,h,u),Z(f,p)),ee(d,h)||(te(p,d,h),F(f,f,Z(p,p)));const a=ne(f);return a>0?V(e,f,1/a):void 0};let _=Number.POSITIVE_INFINITY;this.sortSubarray(n,r.min,r.max,(e,t)=>e.featureInfo.featureIndex-t.featureInfo.featureIndex);const g=D(),y=D(),v=D(),x=D(),b=D(),w=D(),T=D(),E=D(),S=D(),I=[D(),D(),D(),D()],A=[D(),D(),D(),D()],M=[{coord:new Pe(0,0),height:0},{coord:new Pe(0,0),height:0}],C=(e,t)=>e>t;for(let c=r.min;c<r.max;c++){const r=n[c];if(!r.featureInfo.guardRailEnabled)continue;if(!this.prepareEdgePoints(M,t,i,r,C))continue;const[u,h]=M;if(z(g,u.coord.x,u.coord.y,a*u.height),z(y,h.coord.x,h.coord.y,a*h.height),ee(g,y))continue;te(v,y,g),Z(v,v);const d=m(E,r.a)||v,f=m(S,r.b)||v;z(x,d[1],-d[0],0),Z(x,x),z(b,f[1],-f[0],0),Z(b,b),W(E,x,d),Z(w,E),W(E,b,f),Z(T,E),F(I[0],g,V(E,te(E,x,w),l)),F(I[1],g,V(E,F(E,x,w),l)),F(I[2],g,V(E,w,l)),I[3]=g,F(A[0],y,V(E,te(E,b,T),l)),F(A[1],y,V(E,F(E,b,T),l)),F(A[2],y,V(E,T,l)),A[3]=y,_=this.addFeatureSection(r.featureInfo.featureIndex,_,this.bridgeFeatureSections,e);const p=e.addVertex(I[0],x,o),D=e.addVertex(I[1],x,o),P=e.addVertex(A[0],b,o),R=e.addVertex(A[1],b,o);e.addTriangle(p,D,P),e.addTriangle(D,R,P);const L=e.addVertex(I[1],w,o),O=e.addVertex(I[2],w,o),k=e.addVertex(A[1],T,o),B=e.addVertex(A[2],T,o);e.addTriangle(L,O,k),e.addTriangle(O,B,k),H(x,x),H(b,b);const N=e.addVertex(I[2],x,o),U=e.addVertex(I[3],x,o),j=e.addVertex(A[2],b,o),G=e.addVertex(A[3],b,o);e.addTriangle(N,U,j),e.addTriangle(U,G,j);const $=this.isTerminalVertex(r.a,s),q=this.isTerminalVertex(r.b,s);u.height<.01&&$&&e.addQuad(I[3],I[2],I[1],I[0],H(d,d),o),h.height<.01&&q&&e.addQuad(A[0],A[1],A[2],A[3],f,o)}this.bridgeFeatureSections.push({featureIndex:Number.POSITIVE_INFINITY,vertexStart:e.getVertexCount()})}constructTunnelStructures(e,t,i,n,r,o){e.clearVertexLookup();let s=Number.POSITIVE_INFINITY;const a=(e,t)=>e.featureInfo.featureIndex-t.featureInfo.featureIndex;this.sortSubarray(n,r.min,r.max,a),this.sortSubarray(n,o.min,o.max,a);const l=e=>Z(e,e),c=[{coord:new Pe(0,0),height:0},{coord:new Pe(0,0),height:0}],u=(e,t)=>e<t,h=D(),d=D(),f=D(),p=D(),m=D();for(let o=r.min;o<r.max;o++){if(!this.prepareEdgePoints(c,t,i,n[o],u))continue;const[r,a]=c,_=l(z(m,-(a.coord.y-r.coord.y),a.coord.x-r.coord.x,0));s=this.addFeatureSection(n[o].featureInfo.featureIndex,s,this.tunnelFeatureSections,e),e.addQuad(z(h,r.coord.x,r.coord.y,r.height),z(d,a.coord.x,a.coord.y,a.height),z(f,a.coord.x,a.coord.y,n[o].isTunnel?a.height+4:0),z(p,r.coord.x,r.coord.y,n[o].isTunnel?r.height+4:0),_)}for(let r=o.min;r<o.max;r++){const o=n[r];o.isTunnel&&([o.a,o.b]=[o.b,o.a]);const a=t[o.a],c=t[o.b],u=l(z(m,-(c.y-a.y),c.x-a.x,0));s=this.addFeatureSection(o.featureInfo.featureIndex,s,this.tunnelFeatureSections,e),e.addQuad(z(h,c.x,c.y,0),z(d,a.x,a.y,0),z(f,a.x,a.y,i[o.a]+4),z(p,c.x,c.y,i[o.b]+4),u),e.addQuad(z(h,a.x,a.y,0),z(d,c.x,c.y,0),z(f,c.x,c.y,i[o.b]+4),z(p,a.x,a.y,i[o.a]+4),u)}this.tunnelFeatureSections.push({featureIndex:Number.POSITIVE_INFINITY,vertexStart:e.getVertexCount()})}setElevatedPoint(e,t,i,n){e.coord.x=t,e.coord.y=i,e.height=n}prepareEdgePoints(e,t,i,n,r){let o=t[n.a].x,s=t[n.a].y,a=t[n.b].x,l=t[n.b].y,c=i[n.a],u=i[n.b];const h=r(c,0),d=r(u,0);if(h&&d)return this.setElevatedPoint(e[0],o,s,c),this.setElevatedPoint(e[1],a,l,u),!0;if(!h&&!d)return!1;if(h){if(!d){const e=u/(u-c);a=fn(a,o,e),l=fn(l,s,e),u=fn(u,c,e)}}else{const e=c/(c-u);o=fn(o,a,e),s=fn(s,l,e),c=fn(c,u,e)}return this.setElevatedPoint(e[0],o,s,c),this.setElevatedPoint(e[1],a,l,u),!0}prepareEdges(e,t){if(0===t.length)return;t.sort((e,t)=>e.hash===t.hash?t.polygonIdx-e.polygonIdx:t.hash>e.hash?1:-1);let i=0,n=0,r=0,o=t[i].polygonIdx;do{n++,(n===t.length||t[i].hash!==t[n].hash)&&((1===n-i||t[n-1].polygonIdx!==o)&&(r<i&&(t[r]=t[i],t[i]=null),t[r].type="none",r++),i=n,i!==t.length&&(o=t[i].polygonIdx))}while(i!==t.length);if(t.splice(r),0!==t.length&&0!==e.length){t.sort((e,t)=>e.portalHash<t.portalHash?1:-1);let i=0,n=0;for(;i!==t.length&&n!==e.length;){const r=t[i],o=e[n];r.portalHash>o.hash?i++:o.hash>r.portalHash?n++:(r.type=o.type,i++)}}}isOnBorder(e,t){return e<=0&&t<=0||e>=Cr&&t>=Cr}addFeatureSection(e,t,i,n){return e!==t&&(t=e,i.push({featureIndex:e,vertexStart:n.getVertexCount()}),n.clearVertexLookup()),t}sortSubarray(e,t,i,n){const r=e.slice(t,i);r.sort(n),e.splice(t,r.length,...r)}static computeEdgeHash(e,t){return(e.y===t.y&&e.x>t.x||e.y>t.y)&&([e,t]=[t,e]),BigInt(g_.computePosHash(e))<<32n|BigInt(g_.computePosHash(t))}static computePosHash(e){return((65535&e.x)<<16|65535&e.y)>>>0}}
vendor: 10,352 bytes, line 2
2class y_{constructor(){this._valid=!1}reset(e){return this.feature=e,this._valid=!0,this._geometry=e.loadGeometry(),0!==this._geometry.length&&0!==this._geometry[0].length||(this._valid=!1),this}geometry(e,t){return this._valid&&e(t(this._geometry)),this}require(e,t,i){return this.get(e,!0,t,i)}optional(e,t,i){return this.get(e,!1,t,i)}success(){return this._valid}get(e,t,i,n){const r=Object.hasOwn(this.feature.properties,e)?+this.feature.properties[e]:void 0;return this._valid&&void 0!==r&&!Number.isNaN(r)?i(n?n(r):r):t&&(this._valid=!1),this}}class v_{constructor(e,t){this.featureFunc=e,this.vertexFunc=t}parseFeature(e,t,i){return this.featureFunc(e,t,i)}parseVertex(e,t,i){return this.vertexFunc(e,t,i)}}const x_=new v_((e,t,i)=>e.reset(t).require(pd,e=>{i.id=e}).optional("fixed_height_relative",e=>{i.constantHeight=e},w_.decodeRelativeHeight).geometry(e=>{i.bounds=e},qe).success(),(e,t,i)=>e.reset(t).require(pd,e=>{i.id=e}).require("elevation_idx",e=>{i.idx=e}).require("extent",e=>{i.extent=e}).require("height_relative",e=>{i.height=e},w_.decodeRelativeHeight).geometry(e=>{i.position=e},w_.getPoint).success()),b_=new v_((e,t,i)=>e.reset(t).require(pd,e=>{i.id=e}).optional("fixed_height",e=>{i.constantHeight=e},w_.decodeMetricHeight).geometry(e=>{i.bounds=e},qe).success(),(e,t,i)=>e.reset(t).require(pd,e=>{i.id=e}).require("elevation_idx",e=>{i.idx=e}).require("extent",e=>{i.extent=e}).require("height",e=>{i.height=e},w_.decodeMetricHeight).geometry(e=>{i.position=e},w_.getPoint).success());class w_{static getPoint(e){return be(e[0][0].x,e[0][0].y)}static decodeRelativeHeight(e){return 1e-4*e*5}static decodeMetricHeight(e){return 1e-4*e}static getVersionSchema(e){return e?"1.0.1"===e?b_:void 0:x_}static parse(e){const t=[],i=[],n=e.length,r=new y_;for(let o=0;o<n;o++){const n=e.feature(o),s=n.properties.version,a=w_.getVersionSchema(s);if(void 0===a){gt(`Unknown elevation feature version number ${s||"(unknown)"}`);continue}const l=n.properties.type;if(!l)continue;const c=Lh.types[n.type];if("Point"===c&&"curve_point"===l){const e={};a.parseVertex(r,n,e)&&t.push(e)}else if("Polygon"===c&&"curve_meta"===l){const e={};a.parseFeature(r,n,e)&&i.push(e)}}return{vertices:t,features:i}}}const T_=[xe(),xe(),xe(),xe(),xe(),xe(),xe()],E_=xe(),S_=xe();function I_(e){return[e[0],e[1]]}function A_(e){return be(e[0],e[1])}class M_{constructor(e,t,i=null){this.feature=e,this.metersToTile=t,this.sampler=i,this.index=0}get(){const e=this.feature.vertices[this.index],t=this.feature.vertexProps[this.index].dir,i=t[1],n=-t[0],r=(e.extent+1)*this.metersToTile,o=this.sampler?this.sampler.pointTransform(e.position):e.position;return[new Pe(Math.trunc(o[0]+i*r),Math.trunc(o[1]+n*r)),new Pe(Math.trunc(o[0]-i*r),Math.trunc(o[1]-n*r))]}next(){this.index++}valid(){return this.index<this.feature.vertices.length}}class C_{constructor(e,t,i,n,r,o){if(this.vertices=new Array,this.vertexProps=new Array,this.edges=new Array,this.edgeProps=new Array,this.id=e,this.heightRange={min:i,max:i},this.safeArea=t,this.constantHeight=i,null==this.constantHeight&&(null!=this.constantHeight||0!==n.length)){this.vertices=n,this.edges=r;for(let e=0;e<this.vertices.length;e++)this.vertices[e].index=void 0!==this.vertices[e].index?this.vertices[e].index:e;this.edges=this.edges.filter(e=>{return e.a<this.vertices.length&&e.b<this.vertices.length&&!((t=this.vertices[e.a].position)[0]===(i=this.vertices[e.b].position)[0]&&t[1]===i[1]);var t,i}),this.heightRange={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};for(const e of this.vertices)this.vertexProps.push({dir:be(0,0)}),this.heightRange.min=Math.min(this.heightRange.min,e.height),this.heightRange.max=Math.max(this.heightRange.max,e.height);for(const e of this.edges){const t=this.vertices[e.a].position,i=this.vertices[e.b].position,n=Ee(xe(),i,t),r=Ie(n),o=Se(xe(),n,1/r);this.edgeProps.push({vec:n,dir:o,len:r});const s=this.vertexProps[e.a].dir,a=this.vertexProps[e.b].dir;Te(s,s,o),Te(a,a,o)}for(const e of this.vertexProps)0===e.dir[0]&&0===e.dir[1]||Ae(e.dir,e.dir);this.tessellate(o)}}pointElevation(e){if(null!=this.constantHeight)return this.constantHeight;const t=this.getClosestEdge(e);if(null==t)return 0;const[i,n]=t;return fn(this.vertices[this.edges[i].a].height,this.vertices[this.edges[i].b].height,n)}computeSlopeNormal(e,t){const i=this.getClosestEdge(e);if(!i)return L(0,0,1);const n=i[0],r=this.edges[n],o=this.edgeProps[n].vec,s=L(o[0],o[1],(this.vertices[r.b].height-this.vertices[r.a].height)*t),a=L(s[1],-s[0],0);W(a,a,s);const l=R(a);return l>0?V(a,a,1/l):z(a,0,0,1)}getSafeArea(){return this.safeArea}isTunnel(){return this.heightRange.max<=-5}getClosestEdge(e){if(0===this.edges.length)return;let t=0,i=Number.POSITIVE_INFINITY,n=0;const[r,o,s,a,l,c,u]=T_;we(u,e.x,e.y);const h=new wf(u,null);for(let e=0;e<this.edges.length;e++){const d=this.edges[e],f=this.edgeProps[e].dir;h.dir=f;const p=this.vertices[d.a].position,m=this.vertices[d.b].position,_=h.intersectsPlane(p,this.vertexProps[d.a].dir,r),g=h.intersectsPlane(m,this.vertexProps[d.b].dir,o);if(!_||!g)continue;Ee(s,o,r),Ee(a,u,r);const y=Me(s,s),v=y>0?Me(a,s)/y:0,x=it(v,0,1),b=Math.abs((v-x)*this.edgeProps[e].len);Ee(l,u,p),we(c,f[1],-f[0]);const w=b+Math.abs(Me(l,c));w<i&&(t=e,i=w,n=x)}return[t,n]}tessellate(e){const t=D(),i=D(),n=D(),r=D();for(let o=this.edges.length-1;o>=0;--o){const s=this.edges[o].a,a=this.edges[o].b,{position:l,height:c,extent:u}=this.vertices[s],{position:h,height:d,extent:f}=this.vertices[a],p=this.vertexProps[s].dir,m=this.vertexProps[a].dir;if(z(t,l[0]/e,l[1]/e,c),z(i,h[0]/e,h[1]/e,d),z(n,p[1],-p[0],0),V(n,n,u),z(r,m[1],-m[0],0),V(r,r,f),this.distSqLines(L(t[0]+.5*n[0],t[1]+.5*n[1],t[2]+.5*n[2]),L(i[0]-.5*r[0],i[1]-.5*r[1],i[2]-.5*r[2]),L(t[0]-.5*n[0],t[1]-.5*n[1],t[2]-.5*n[2]),L(i[0]+.5*r[0],i[1]+.5*r[1],i[2]+.5*r[2]))<=.0025000000000000005)continue;const _=this.vertices.length,g=Te(xe(),l,h);this.vertices.push({position:Se(g,g,.5),height:.5*(c+d),extent:.5*(u+f),index:.5*((void 0!==this.vertices[s].index?this.vertices[s].index:s)+(void 0!==this.vertices[a].index?this.vertices[a].index:a))});const y=Te(xe(),p,m);this.vertexProps.push({dir:Ae(y,y)}),this.edges.splice(o,1),this.edgeProps.splice(o,1),this.edges.push({a:s,b:_}),this.edges.push({a:_,b:a});const v=Ee(xe(),this.vertices[_].position,l),x=Ie(v),b={vec:v,dir:Se(xe(),v,1/x),len:x};this.edgeProps.push(b),this.edgeProps.push(b)}}distSqLines(e,t,i,n){const r=O(D(),t,e),o=O(D(),n,i),s=O(D(),e,i),a=q(r,r),l=q(r,o),c=q(r,s),u=q(o,o),h=q(o,s),d=a*u-l*l;if(0===d)return G(Y(r,i,n,q(s,o)/q(o,o)),e);const f=(a*h-l*c)/d;return G(Y(r,e,t,(l*h-c*u)/d),Y(o,i,n,f))}static serialize(e,t){const i={id:e.id,heightRange:{min:e.heightRange.min,max:e.heightRange.max},safeArea:(n=e.safeArea,{min:{x:n.min.x,y:n.min.y},max:{x:n.max.x,y:n.max.y}})};var n;return null!=e.constantHeight?(i.constantHeight=e.constantHeight,i):0===e.vertices.length?(i.vertices=[],i.vertexProps=[],i.edges=[],i.edgeProps=[],i):(i.vertices=e.vertices.map(e=>({position:I_(e.position),height:e.height,extent:e.extent,index:e.index})),i.vertexProps=e.vertexProps.map(e=>({dir:I_(e.dir)})),i.edges=e.edges.map(e=>({a:e.a,b:e.b})),i.edgeProps=e.edgeProps.map(e=>({vec:I_(e.vec),dir:I_(e.dir),len:e.len})),i)}static deserialize(e){const t=function(e){return{min:new Pe(e.min.x,e.min.y),max:new Pe(e.max.x,e.max.y)}}(e.safeArea);if(null!=e.constantHeight)return new C_(e.id,t,e.constantHeight);if(!e.vertices||0===e.vertices.length){const i=Object.create(C_.prototype);return i.id=e.id,i.constantHeight=void 0,i.heightRange={min:e.heightRange.min,max:e.heightRange.max},i.safeArea=t,i.vertices=[],i.vertexProps=[],i.edges=[],i.edgeProps=[],i}const i=Object.create(C_.prototype);return i.id=e.id,i.constantHeight=void 0,i.heightRange={min:e.heightRange.min,max:e.heightRange.max},i.safeArea=t,i.vertices=e.vertices.map(e=>({position:A_(e.position),height:e.height,extent:e.extent,index:e.index})),i.vertexProps=(e.vertexProps||[]).map(e=>({dir:A_(e.dir)})),i.edges=(e.edges||[]).map(e=>({a:e.a,b:e.b})),i.edgeProps=(e.edgeProps||[]).map(e=>({vec:A_(e.vec),dir:A_(e.dir),len:e.len})),i}}class D_{constructor(e,t){this.zScale=1,this.xOffset=0,this.yOffset=0,e.equals(t)||(this.zScale=Math.pow(2,t.z-e.z),this.xOffset=(e.x*this.zScale-t.x)*Cr,this.yOffset=(e.y*this.zScale-t.y)*Cr)}pointTransform(e){return be(e[0]*this.zScale+this.xOffset,e[1]*this.zScale+this.yOffset)}pointTransformInPlace(e){e[0]=e[0]*this.zScale+this.xOffset,e[1]=e[1]*this.zScale+this.yOffset}constantElevation(e,t){if(null!=e.constantHeight)return this.computeBiasedHeight(e.constantHeight,t)}pointElevation(e,t,i){const n=this.constantElevation(t,i);return null!=n?n:(e.x=e.x*this.zScale+this.xOffset,e.y=e.y*this.zScale+this.yOffset,this.computeBiasedHeight(t.pointElevation(e),i))}computeBiasedHeight(e,t){return t<=0?e:e+t*nt(0,t,e>=0?e:Math.abs(.5*e))}}function P_(e){if(0===e)return[0,0,0];const t=ps(e);return[t(),t(),t()]}function R_(e,t){let i=0,n=e.length-1;for(;i<=n;){const r=i+n>>1;e[r].feature.id<t?i=r+1:n=r-1}return i<e.length&&e[i].feature.id===t?i:-1}function L_(e,t,i,n){if(!e.properties)return;const r=+e.properties[pd];if(Number.isNaN(r))return;if(t){const e=t.find(e=>e.id===r);if(e&&n)return{tileId:n,feature:e}}if(!i||0===i.length)return;const o=R_(i,r);if(!(o<0)){if(n)for(let e=o;e<i.length&&i[e].feature.id===r;e++)if(i[e].tileId.key===n.key)return i[e];return i[o]}}function z_(e,t){return e>t?1:e<t?-1:0}Ys(C_,"ElevationFeature");class F_{constructor(e=z_,t=!1){this._compare=e,this._root=null,this._size=0,this._noDuplicates=!!t}rotateLeft(e){var t=e.right;t&&(e.right=t.left,t.left&&(t.left.parent=e),t.parent=e.parent),e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.left=e),e.parent=t}rotateRight(e){var t=e.left;t&&(e.left=t.right,t.right&&(t.right.parent=e),t.parent=e.parent),e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.right=e),e.parent=t}_splay(e){for(;e.parent;){var t=e.parent;t.parent?t.left===e&&t.parent.left===t?(this.rotateRight(t.parent),this.rotateRight(t)):t.right===e&&t.parent.right===t?(this.rotateLeft(t.parent),this.rotateLeft(t)):t.left===e&&t.parent.right===t?(this.rotateRight(t),this.rotateLeft(t)):(this.rotateLeft(t),this.rotateRight(t)):t.left===e?this.rotateRight(t):this.rotateLeft(t)}}splay(e){for(var t,i,n,r,o;e.parent;
vendor: 16,268 bytes, line 2
2)(i=(t=e.parent).parent)&&i.parent?((n=i.parent).left===i?n.left=e:n.right=e,e.parent=n):(e.parent=null,this._root=e),r=e.left,o=e.right,e===t.left?(i&&(i.left===t?(t.right?(i.left=t.right,i.left.parent=i):i.left=null,t.right=i,i.parent=t):(r?(i.right=r,r.parent=i):i.right=null,e.left=i,i.parent=e)),o?(t.left=o,o.parent=t):t.left=null,e.right=t,t.parent=e):(i&&(i.right===t?(t.left?(i.right=t.left,i.right.parent=i):i.right=null,t.left=i,i.parent=t):(o?(i.left=o,o.parent=i):i.left=null,e.right=i,i.parent=e)),r?(t.right=r,r.parent=t):t.right=null,e.left=t,t.parent=e)}replace(e,t){e.parent?e===e.parent.left?e.parent.left=t:e.parent.right=t:this._root=t,t&&(t.parent=e.parent)}minNode(e=this._root){if(e)for(;e.left;)e=e.left;return e}maxNode(e=this._root){if(e)for(;e.right;)e=e.right;return e}insert(e,t){var i=this._root,n=null,r=this._compare;if(this._noDuplicates)for(;i;){if(n=i,0===r(i.key,e))return;i=r(i.key,e)<0?i.right:i.left}else for(;i;)n=i,i=r(i.key,e)<0?i.right:i.left;return i={key:e,data:t,left:null,right:null,parent:n},n?r(n.key,i.key)<0?n.right=i:n.left=i:this._root=i,this.splay(i),this._size++,i}find(e){for(var t=this._root,i=this._compare;t;){var n=i(t.key,e);if(n<0)t=t.right;else{if(!(n>0))return t;t=t.left}}return null}contains(e){for(var t=this._root,i=this._compare;t;){var n=i(e,t.key);if(0===n)return!0;t=n<0?t.left:t.right}return!1}remove(e){var t=this.find(e);if(!t)return!1;if(this.splay(t),t.left)if(t.right){var i=this.minNode(t.right);i.parent!==t&&(this.replace(i,i.right),i.right=t.right,i.right.parent=i),this.replace(t,i),i.left=t.left,i.left.parent=i}else this.replace(t,t.left);else this.replace(t,t.right);return this._size--,!0}removeNode(e){if(!e)return!1;if(this.splay(e),e.left)if(e.right){var t=this.minNode(e.right);t.parent!==e&&(this.replace(t,t.right),t.right=e.right,t.right.parent=t),this.replace(e,t),t.left=e.left,t.left.parent=t}else this.replace(e,e.left);else this.replace(e,e.right);return this._size--,!0}erase(e){var t=this.find(e);if(t){this.splay(t);var i=t.left,n=t.right,r=null;i&&(i.parent=null,r=this.maxNode(i),this.splay(r),this._root=r),n&&(i?r.right=n:this._root=n,n.parent=r),this._size--}}pop(){var e=this._root,t=null;if(e){for(;e.left;)e=e.left;t={key:e.key,data:e.data},this.remove(e.key)}return t}next(e){var t=e;if(t)if(t.right)for(t=t.right;t&&t.left;)t=t.left;else for(t=e.parent;t&&t.right===e;)e=t,t=t.parent;return t}prev(e){var t=e;if(t)if(t.left)for(t=t.left;t&&t.right;)t=t.right;else for(t=e.parent;t&&t.left===e;)e=t,t=t.parent;return t}forEach(e){for(var t=this._root,i=[],n=!1,r=0;!n;)t?(i.push(t),t=t.left):i.length>0?(e(t=i.pop(),r++),t=t.right):n=!0;return this}range(e,t,i,n){const r=[],o=this._compare;let s,a=this._root;for(;0!==r.length||a;)if(a)r.push(a),a=a.left;else{if(a=r.pop(),s=o(a.key,t),s>0)break;if(o(a.key,e)>=0&&i.call(n,a))return this;a=a.right}return this}keys(){for(var e=this._root,t=[],i=[],n=!1;!n;)e?(t.push(e),e=e.left):t.length>0?(e=t.pop(),i.push(e.key),e=e.right):n=!0;return i}values(){for(var e=this._root,t=[],i=[],n=!1;!n;)e?(t.push(e),e=e.left):t.length>0?(e=t.pop(),i.push(e.data),e=e.right):n=!0;return i}at(e){for(var t=this._root,i=[],n=!1,r=0;!n;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right}else n=!0;return null}load(e=[],t=[],i=!1){if(0!==this._size)throw new Error("bulk-load: tree is not empty");const n=e.length;return i&&k_(e,t,0,n-1,this._compare),this._root=O_(null,e,t,0,n),this._size=n,this}min(){var e=this.minNode(this._root);return e?e.key:null}max(){var e=this.maxNode(this._root);return e?e.key:null}isEmpty(){return null===this._root}get size(){return this._size}static createTree(e,t,i,n,r){return new F_(i,r).load(e,t,n)}}function O_(e,t,i,n,r){const o=r-n;if(o>0){const s=n+Math.floor(o/2),a={key:t[s],data:i[s],parent:e};return a.left=O_(a,t,i,n,s),a.right=O_(a,t,i,s+1,r),a}return null}function k_(e,t,i,n,r){if(i>=n)return;const o=e[i+n>>1];let s=i-1,a=n+1;for(;;){do{s++}while(r(e[s],o)<0);do{a--}while(r(e[a],o)>0);if(s>=a)break;let i=e[s];e[s]=e[a],e[a]=i,i=t[s],t[s]=t[a],t[a]=i}k_(e,t,i,a,r),k_(e,t,a+1,n,r)}const B_=11102230246251565e-32,N_=134217729,V_=(3+8*B_)*B_;function U_(e,t,i,n,r){let o,s,a,l,c=t[0],u=n[0],h=0,d=0;u>c==u>-c?(o=c,c=t[++h]):(o=u,u=n[++d]);let f=0;if(h<e&&d<i)for(u>c==u>-c?(s=c+o,a=o-(s-c),c=t[++h]):(s=u+o,a=o-(s-u),u=n[++d]),o=s,0!==a&&(r[f++]=a);h<e&&d<i;)u>c==u>-c?(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=t[++h]):(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=n[++d]),o=s,0!==a&&(r[f++]=a);for(;h<e;)s=o+c,l=s-o,a=o-(s-l)+(c-l),c=t[++h],o=s,0!==a&&(r[f++]=a);for(;d<i;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=n[++d],o=s,0!==a&&(r[f++]=a);return 0===o&&0!==f||(r[f++]=o),f}function j_(e){return new Float64Array(e)}const G_=j_(4),$_=j_(8),H_=j_(12),Z_=j_(16),q_=j_(4);function W_(e,t,i){null===t?(e.inOut=!1,e.otherInOut=!0):(e.isSubject===t.isSubject?(e.inOut=!t.inOut,e.otherInOut=t.otherInOut):(e.inOut=!t.otherInOut,e.otherInOut=t.isVertical()?!t.inOut:t.inOut),t&&(e.prevInResult=!Y_(t,i)||t.isVertical()?t.prevInResult:t)),e.resultTransition=Y_(e,i)?function(e,t){let i,n=!e.inOut,r=!e.otherInOut;switch(t){case 0:i=n&&r;break;case 1:i=n||r;break;case 3:i=n!==r;break;case 2:i=e.isSubject?n&&!r:r&&!n}return i?1:-1}(e,i):0}function Y_(e,t){switch(e.type){case 0:switch(t){case 0:return!e.otherInOut;case 1:return e.otherInOut;case 2:return e.isSubject&&e.otherInOut||!e.isSubject&&!e.otherInOut;case 3:return!0}break;case 2:return 0===t||1===t;case 3:return 2===t;case 1:return!1}return!1}class X_{constructor(e,t,i,n,r){this.left=t,this.point=e,this.otherEvent=i,this.isSubject=n??!1,this.type=r||0,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.resultTransition=0,this.otherPos=-1,this.outputContourId=-1,this.isExteriorRing=!0}isBelow(e){const t=this.point,i=this.otherEvent.point;return this.left?(t[0]-e[0])*(i[1]-e[1])-(i[0]-e[0])*(t[1]-e[1])>0:(i[0]-e[0])*(t[1]-e[1])-(t[0]-e[0])*(i[1]-e[1])>0}isAbove(e){return!this.isBelow(e)}isVertical(){return this.point[0]===this.otherEvent.point[0]}get inResult(){return 0!==this.resultTransition}clone(){const e=new X_(this.point,this.left,this.otherEvent,this.isSubject,this.type);return e.contourId=this.contourId,e.resultTransition=this.resultTransition,e.prevInResult=this.prevInResult,e.isExteriorRing=this.isExteriorRing,e.inOut=this.inOut,e.otherInOut=this.otherInOut,e}}function J_(e,t){return e[0]===t[0]&&e[1]===t[1]}function K_(e,t,i){const n=function(e,t,i,n,r,o){const s=(t-o)*(i-r),a=(e-r)*(n-o),l=s-a;if(0===s||0===a||s>0!=a>0)return l;const c=Math.abs(s+a);return Math.abs(l)>=33306690738754716e-32*c?l:-function(e,t,i,n,r,o,s){let a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,E;const S=e-r,I=i-r,A=t-o,M=n-o;x=S*M,d=N_*S,f=d-(d-S),p=S-f,d=N_*M,m=d-(d-M),_=M-m,b=p*_-(x-f*m-p*m-f*_),w=A*I,d=N_*A,f=d-(d-A),p=A-f,d=N_*I,m=d-(d-I),_=I-m,T=p*_-(w-f*m-p*m-f*_),g=b-T,h=b-g,G_[0]=b-(g+h)+(h-T),y=x+g,h=y-x,v=x-(y-h)+(g-h),g=v-w,h=v-g,G_[1]=v-(g+h)+(h-w),E=y+g,h=E-y,G_[2]=y-(E-h)+(g-h),G_[3]=E;let C=function(e,t){let i=t[0];for(let e=1;e<4;e++)i+=t[e];return i}(0,G_),D=22204460492503146e-32*s;if(C>=D||-C>=D)return C;if(h=e-S,a=e-(S+h)+(h-r),h=i-I,c=i-(I+h)+(h-r),h=t-A,l=t-(A+h)+(h-o),h=n-M,u=n-(M+h)+(h-o),0===a&&0===l&&0===c&&0===u)return C;if(D=11093356479670487e-47*s+V_*Math.abs(C),C+=S*u+M*a-(A*c+I*l),C>=D||-C>=D)return C;x=a*M,d=N_*a,f=d-(d-a),p=a-f,d=N_*M,m=d-(d-M),_=M-m,b=p*_-(x-f*m-p*m-f*_),w=l*I,d=N_*l,f=d-(d-l),p=l-f,d=N_*I,m=d-(d-I),_=I-m,T=p*_-(w-f*m-p*m-f*_),g=b-T,h=b-g,q_[0]=b-(g+h)+(h-T),y=x+g,h=y-x,v=x-(y-h)+(g-h),g=v-w,h=v-g,q_[1]=v-(g+h)+(h-w),E=y+g,h=E-y,q_[2]=y-(E-h)+(g-h),q_[3]=E;const P=U_(4,G_,4,q_,$_);x=S*u,d=N_*S,f=d-(d-S),p=S-f,d=N_*u,m=d-(d-u),_=u-m,b=p*_-(x-f*m-p*m-f*_),w=A*c,d=N_*A,f=d-(d-A),p=A-f,d=N_*c,m=d-(d-c),_=c-m,T=p*_-(w-f*m-p*m-f*_),g=b-T,h=b-g,q_[0]=b-(g+h)+(h-T),y=x+g,h=y-x,v=x-(y-h)+(g-h),g=v-w,h=v-g,q_[1]=v-(g+h)+(h-w),E=y+g,h=E-y,q_[2]=y-(E-h)+(g-h),q_[3]=E;const R=U_(P,$_,4,q_,H_);x=a*u,d=N_*a,f=d-(d-a),p=a-f,d=N_*u,m=d-(d-u),_=u-m,b=p*_-(x-f*m-p*m-f*_),w=l*c,d=N_*l,f=d-(d-l),p=l-f,d=N_*c,m=d-(d-c),_=c-m,T=p*_-(w-f*m-p*m-f*_),g=b-T,h=b-g,q_[0]=b-(g+h)+(h-T),y=x+g,h=y-x,v=x-(y-h)+(g-h),g=v-w,h=v-g,q_[1]=v-(g+h)+(h-w),E=y+g,h=E-y,q_[2]=y-(E-h)+(g-h),q_[3]=E;const L=U_(R,H_,4,q_,Z_);return Z_[L-1]}(e,t,i,n,r,o,c)}(e[0],e[1],t[0],t[1],i[0],i[1]);return n>0?-1:n<0?1:0}function Q_(e,t){const i=e.point,n=t.point;return i[0]>n[0]?1:i[0]<n[0]?-1:i[1]!==n[1]?i[1]>n[1]?1:-1:function(e,t,i){return e.left!==t.left?e.left?1:-1:0!==K_(i,e.otherEvent.point,t.otherEvent.point)?e.isBelow(t.otherEvent.point)?-1:1:!e.isSubject&&t.isSubject?1:-1}(e,t,i)}function eg(e,t,i){const n=new X_(t,!1,e,e.isSubject),r=new X_(t,!0,e.otherEvent,e.isSubject);return J_(e.point,e.otherEvent.point)&&console.warn("what is that, a collapsed segment?",e),n.contourId=r.contourId=e.contourId,Q_(r,e.otherEvent)>0&&(e.otherEvent.left=!0,r.left=!1),e.otherEvent.otherEvent=r,e.otherEvent=n,i.push(r),i.push(n),i}function tg(e,t){return e[0]*t[1]-e[1]*t[0]}function ig(e,t){return e[0]*t[0]+e[1]*t[1]}function ng(e,t,i){const n=function(e,t,i,n){const r=[t[0]-e[0],t[1]-e[1]],o=[n[0]-i[0],n[1]-i[1]];function s(e,t,i){return[e[0]+t*i[0],e[1]+t*i[1]]}const a=[i[0]-e[0],i[1]-e[1]];let l=tg(r,o),c=l*l;const u=ig(r,r);if(c>0){const t=tg(a,o)/l;if(t<0||t>1)return null;const n=tg(a,r)/l;return n<0||n>1?null:0===t||1===t?[s(e,t,r)]:0===n||1===n?[s(i,n,o)]:[s(e,t,r)]}if(l=tg(a,r),c=l*l,c>0)return null;const h=ig(r,a)/u,d=h+ig(r,o)/u,f=Math.min(h,d),p=Math.max(h,d);return f<=1&&p>=0?1===f?[s(e,f>0?f:0,r)]:0===p?[s(e,p<1?p:1,r)]:[s(e,f>0?f:0,r),s(e,p<1?p:1,r)]:null}(e.point,e.otherEvent.point,t.point,t.otherEvent.point),r=n?n.length:0;if(0===r||1===r&&(J_(e.point,t.point)||J_(e.otherEvent.point,t.otherEvent.point))||2===r&&e.isSubject===t.isSubject)return 0;if(1===r)return!J_(e.point,n[0])&&!J_(e.otherEvent.point,n[0])&&eg(e,n[0],i),!J_(t.point,n[0])&&!J_(t.otherEvent.point,n[0])&&eg(t,n[0],i),1;const o=[];let s=!1,a=!1;return J_(e.point,t.point)?s=!0:1===Q_(e,t)?o.push(t,e):o.push(e,t),J_(e.otherEvent.point,t.otherEvent.point)?a=!0:1===Q_(e.otherEvent,t.otherEvent)?o.push(t.otherEvent,e.otherEvent):o.push(e.otherEvent,t.otherEvent),s&&a||s?(t.type=1,e.type=t.inOut===e.inOut?2:3,s&&!a&&eg(o[1].otherEvent,o[0].point,i),2):a?(eg(o[0],o[1].point,i),3):o[0]!==o[3].otherEvent?(eg(o[0],o[1].point,i),eg(o[1],o[2].point,i),3):(eg(o[0],o[1].point,i),eg(o[3].otherEvent,o[2].point,i),3)}function rg(e,t){if(e===t)return 0;if(0!==K_(e.point,e.otherEvent.point,t.point)||0!==K_(e.point,e.otherEvent.point,t.otherEvent.point))return J_(e.point,t.point)?e.isBelow(t.otherEvent.point)?-1:1:e.point[0]===t.point[0]?e.point[1]<t.point[1]?-1:1:1===Q_(e,t)?t.isAbove(e.point)?-1:1:e.isBelow(t.point)?-1:1;if(e.isSubject!==t.isSubject)return e.isSubject?-1:1;{let i=e.point,n=t.point;if(i[0]===n[0]&&i[1]===n[1])return i=e.otherEvent.point,n=t.otherEvent.point,i[0]===n[0]&&i[1]===n[1]?0:(e.contourId??0)>(t.contourId??0)?1:-1}return 1===Q_(e,t)?1:-1}class og{constructor(){this.points=[],this.holeIds=[],this.holeOf=null,this.depth=null}isExterior(){return null==this.holeOf}}function sg(e,t,i,n){let r,o=e+1,s=t[e].point;const a=t.length;for(o<a&&(r=t[o].point);o<a&&r[0]===s[0]&&r[1]===s[1];){if(!i[o])return o;o++,o<a&&(r=t[o].point)}for(o=e-1;i[o]&&o>n;)o--;return o}function ag(e,t,i){const n=new og;if(null!=e.prevInResult){const r=e.prevInResult,o=r.outputContourId;if(r.resultTransition>0){const e=t[o];if(null!=e.holeOf){const r=e.holeOf;t[r].holeIds.push(i),n.holeOf=r,n.depth=t[o].depth}else t[o].holeIds.push(i),n.holeOf=o,n.depth=t[o].depth+1}else n.holeOf=null,n.depth=t[o].depth}else n.holeOf=null,n.depth=0;return n}const lg=Math.max,cg=Math.min;let ug=0;function hg(e,t,i,n,r,o){let s,a,l,c,u,h;for(s=0,a=e.length-1;s<a;s++){if(l=e[s],c=e[s+1],u=new X_(l,!1,void 0,t),h=new X_(c,!1,u,t),u.otherEvent=h,l[0]===c[0]&&l[1]===c[1])continue;u.contourId=h.contourId=i,o||(u.isExteriorRing=!1,h.isExteriorRing=!1),Q_(u,h)>0?h.left=!0:u.left=!0;const a=l[0],d=l[1];r[0]=cg(r[0],a),r[1]=cg(r[1],d),r[2]=lg(r[2],a),r[3]=lg(r[3],d),n.push(u),n.push(h)}}const dg=[];function fg(e,t,i){let n=e,r=t;"number"==typeof e[0][0][0]&&(n=[e]),"number"==typeof t[0][0][0]&&(r=[t]);let o=function(e,t,i){let n=null;return e.length*t.length===0&&(0===i?n=dg:2===i?n=e:(1===i||3===i)&&(n=0===e.length?t:e)),n}(n,r,i);if(o)return o===dg?null:o;const s=[1/0,1/0,-1/0,-1/0],a=[1/0,1/0,-1/0,-1/0],l=function(e,t,i,n,r){const o=new Mr(void 0,Q_);let s,a,l,c,u,h;for(l=0,c=e.length;l<c;l++)for(s=e[l],u=0,h=s.length;u<h;u++)a=0===u,a&&ug++,hg(s[u],!0,ug,o,i,a);for(l=0,c=t.length;l<c;l++)for(s=t[l],u=0,h=s.length;u<h;u++)a=0===u,2===r&&(a=!1),a&&ug++,hg(s[u],!1,ug,o,n,a);return o}(n,r,s,a,i);if(o=function(e,t,i,n,r){let o=null;return(i[0]>n[2]||n[0]>i[2]||i[1]>n[3]||n[1]>i[3])&&(0===r?o=dg:2===r?o=e:(1===r||3===r)&&(o=e.concat(t))),o}(n,r,s,a,i),o)return o===dg?null:o;const c=function(e,t,i,n,r,o){const s=new F_(rg),a=[],l=Math.min(n[2],r[2]);let c,u,h;for(;0!==e.length;){let t=e.pop();if(a.push(t),0===o&&t.point[0]>l||2===o&&t.point[0]>n[2])break;if(t.left){u=c=s.insert(t),h=s.minNode(),c=c!==h?s.prev(c):null,u=s.next(u);const i=c?c.key:null;let n;if(W_(t,i,o),u&&2===ng(t,u.key,e)&&(W_(t,i,o),W_(u.key,t,o)),c&&2===ng(c.key,t,e)){let e=c;e=e!==h?s.prev(e):null,n=e?e.key:null,W_(i,n,o),W_(t,i,o)}}else t=t.otherEvent,u=c=s.find(t),c&&u&&(c=c!==h?s.prev(c):null,u=s.next(u),s.remove(t),u&&c&&ng(c.key,u.key,e))}return a}(l,0,0,s,a,i),u=function(e){let t,i;const n=function(e){let t,i,n,r,o;const s=[];for(i=0,n=e.length;i<n;i++)t=e[i],(t.left&&t.inResult||!t.left&&t.otherEvent.inResult)&&s.push(t);let a=!1;for(;!a;)for(a=!0,i=0,n=s.length;i<n;i++)i+1<n&&1===Q_(s[i],s[i+1])&&(r=s[i],s[i]=s[i+1],s[i+1]=r,a=!1);for(i=0,n=s.length;i<n;i++)t=s[i],t.otherPos=i;for(i=0,n=s.length;i<n;i++)t=s[i],t.left||(o=t.otherPos,t.otherPos=t.otherEvent.otherPos,t.otherEvent.otherPos=o);return s}(e),r={},o=[];for(t=0,i=n.length;t<i;t++){if(r[t])continue;const e=o.length,i=ag(n[t],o,e),s=t=>{r[t]=!0,t<n.length&&n[t]&&(n[t].outputContourId=e)};let a=t,l=t;for(i.points.push(n[t].point);s(a),a=n[a].otherPos,s(a),i.points.push(n[a].point),a=sg(a,n,r,l),!(a==l||a>=n.length)&&n[a];);o.push(i)}return o}(c),h=[];for(let e=0;e<u.length;e++){let t=u[e];if(t.isExterior()){let e=[t.points];for(let i=0;i<t.holeIds.length;i++)e.push(u[t.holeIds[i]].points);h.push(e)}}return h}function pg(e,t){const i=fg(_g(e),_g([t]),0);return null==i?[]:vg(i)}function mg(e,t,i=0){const n=65536;let r=_g(e,n);const o=[];for(;t.valid();t.next()){const[e,r]=t.get();let s=e.x*n,a=e.y*n,l=r.x*n,c=r.y*n;const u=l-s,h=c-a,d=Math.hypot(u,h);if(0===d)continue;s-=u*i,a-=h*i,l+=u*i,c+=h*i;const f=Math.trunc(h/d*3),p=-Math.trunc(u/d*3);o.push([[[s,a],[l,c],[l+f,c+p],[s+f,a+p],[s,a]]])}return o.length>0&&(r=fg(r,o,2)),vg(r,1/n,.001)}function _g(e,t=1){return[e.map(e=>e.map(e=>[e.x*t,e.y*t]))]}function gg(e,t){const i=Math.floor(e)+.5;return Math.abs(e-i)<=t?Math.round(i):Math.round(e)}class yg{constructor(e){this.xs=[],this.ys=[],this.ixs=[],this.iys=[],this.buckets=new Map,this.tolerance=e}canonicalize(e,t){const i=this.tolerance,n=Math.floor(e/i),r=Math.floor(t/i);for(let o=-1;o<=1;o++){const s=this.buckets.get(n+o);if(s)for(let o=-1;o<=1;o++){const a=s.get(r+o);if(a)for(const o of a)if(Math.abs(this.xs[o]-e)<=i&&Math.abs(this.ys[o]-t)<=i){const i=this.ixs[o],s=this.iys[o];return this.xs[o]===e&&this.ys[o]===t||this.store(e,t,i,s,n,r),[i,s]}}}const o=gg(e,i),s=gg(t,i);return this.store(e,t,o,s,n,r),[o,s]}store(e,t,i,n,r,o){const s=this.xs.length;this.xs.push(e),this.ys.push(t),this.ixs.push(i),this.iys.push(n);let a=this.buckets.get(r);a||(a=new Map,this.buckets.set(r,a));let l=a.get(o);l||(l=[],a.set(o,l)),l.push(s)}}function vg(e,t=1,i){const n=null!=i?new yg(i):null;return e.map(e=>e.map((e,i)=>{const r=e.map(e=>{const i=e[0]*t,r=e[1]*t;if(n){const[e,t]=n.canonicalize(i,r);return new Pe(e,t)}return new Pe(Math.round(i),Math.round(r))});return i>0&&r.reverse(),r}))}class xg{constructor(){this.frcCoverage=new Set,this.featureTriSegments=[],this.frcPerLevel=new Map,this.frcNonRoadSegments=new Gu}empty(){return 0===this.frcCoverage.size}}function bg(e,t,i){if(0===e.frcCoverage.size||0===e.featureTriSegments.length)return;const n=i.get(),r=t.uint16,o=[];e.featureTriSegments.sort((e,t)=>
vendor: 16,878 bytes, line 2
2e.segIdx!==t.segIdx?e.segIdx-t.segIdx:null===e.frc&&null===t.frc?0:null===e.frc?-1:null===t.frc?1:t.frc-e.frc);const s=new Map;let a=0,l=e.featureTriSegments[0].frc,c={vertexOffset:n[a].vertexOffset,primitiveOffset:0,vertexLength:n[a].vertexLength,primitiveLength:0,vaos:{},sortKey:void 0};const u=()=>{c.primitiveLength>0&&(s.has(l)||s.set(l,[]),s.get(l).push({...c}))};for(const t of e.featureTriSegments){t.segIdx!==a&&(u(),a=t.segIdx,l=t.frc,c={vertexOffset:n[a].vertexOffset,primitiveOffset:o.length/3,vertexLength:n[a].vertexLength,primitiveLength:0,vaos:{},sortKey:void 0}),t.frc!==l&&(u(),l=t.frc,c={...c,primitiveOffset:o.length/3,primitiveLength:0});for(let e=t.start;e<t.end;e++)o.push(r[e]);c.primitiveLength+=(t.end-t.start)/3}u();for(let e=0;e<o.length;e++)r[e]=o[e];for(const[t,i]of s)null!==t?e.frcPerLevel.set(t,new Gu(i)):e.frcNonRoadSegments=new Gu(i);e.featureTriSegments=[]}Ys(xg,"FrcSegmentData");const wg={motorway:0,motorway_link:0,trunk:1,trunk_link:1,primary:2,primary_link:2,secondary:3,secondary_link:3,tertiary:4,tertiary_link:4,unclassified:5,unclassified_link:5,street:6,street_limited:6,residential:6,service:7,living_street:7,pedestrian:8,track:8,path:8,footway:8,cycleway:8,sidewalk:8,crossing:8};function Tg(e){for(const t of["class","incident_class"]){const i=e[t];if("string"!=typeof i)continue;const n=wg[i];if(void 0!==n)return n}return null}function Eg(e,t,i){for(const n of e)if(n.startsWith("(")){const e=n.indexOf(")");if(-1===e)continue;if(n.slice(1,e)===t&&n.slice(e+1)===i)return!0}else if(n===i)return!0;return!1}class Sg{constructor(e,t,i){this.elevationMode=t,t&&(this.elevationBufferData=new p_(e.layers,e.zoom,e.lut)),i&&(this.frcData=new xg)}isEmpty(){const e=!this.elevationBufferData||this.elevationBufferData.isEmpty(),t=!this.frcData||this.frcData.empty();return e&&t}needsUpload(){return!!this.elevationBufferData&&this.elevationBufferData.needsUpload()}trackFeatureFrc(e){if(!this.frcData)return null;const t=Tg(e||{});return null!==t&&this.frcData.frcCoverage.add(t),t}recordFeatureRange(e,t,i,n){if(!this.frcData||i<=t)return;const r=e.bufferData.triangleSegments.get();this.frcData.featureTriSegments.push({start:3*t,end:3*i,segIdx:r.length>0?r.length-1:0,frc:n})}buildFrcSegments(e){this.frcData&&!this.frcData.empty()&&bg(this.frcData,e.bufferData.indexArray,e.bufferData.triangleSegments)}handleFeature(e,t,i,n,r,o){const s=new Array;if(!this.elevationMode)return!1;const a=L_(e,r,void 0,n);if(!a)return!1;{const e=this.clipPolygonsToTile(t,1);e.length>0&&s.push({polygons:e,elevationFeature:a.feature,elevationTileID:a.tileId})}const l={guardRailEnabled:o.layers[0].layout.get("fill-construct-bridge-guard-rail").evaluate(e,{},n),featureIndex:i};for(const t of s)if(t.elevationFeature){if("hd-road-base"===this.elevationMode){this.elevatedStructures||(this.elevatedStructures=new g_(t.elevationTileID,o.layers,o.zoom,o.lut));const i=t.elevationFeature.isTunnel();let n=0;Object.hasOwn(e.properties,md)&&(n=+e.properties[md]),this.elevatedStructures.addPortalCandidates(t.elevationFeature.id,t.polygons,i,t.elevationFeature,n)}null==t.elevationFeature.constantHeight&&(t.polygons=this.prepareElevatedPolygons(t.polygons,t.elevationFeature,t.elevationTileID));const r=new D_(n,t.elevationTileID);this.addElevatedGeometry(o,t.polygons,r,t.elevationFeature,"hd-road-base"===this.elevationMode?0:.05,i,l)}return!0}populatePaintArrays(e,t,i,n,r,o,s){this.elevationBufferData&&this.elevationBufferData.populatePaintArrays(e,t,i,n,r,o,s)}update(e,t,i,n,r,o,s,a){this.elevationBufferData&&this.elevationBufferData.update(e,t,i,n,r,o,s,a),this.elevatedStructures&&this.elevatedStructures.update(e,t,i,n,r,o,s,a)}updateExpressions(e){this.elevationBufferData&&this.elevationBufferData.programConfigurations.updateExpressions(e),this.elevatedStructures&&(this.elevatedStructures.bridgeProgramConfigurations.updateExpressions(e),this.elevatedStructures.tunnelProgramConfigurations.updateExpressions(e))}upload(e){this.elevationBufferData&&this.elevationBufferData.upload(e),this.elevatedStructures&&this.elevatedStructures.upload(e)}destroy(){this.elevationBufferData&&this.elevationBufferData.destroy(),this.elevatedStructures&&this.elevatedStructures.destroy()}getUnevaluatedPortalGraph(){return this.elevatedStructures?this.elevatedStructures.unevaluatedPortals:void 0}setEvaluatedPortalGraph(e,t,i,n,r,o){this.elevatedStructures&&(this.elevatedStructures.construct(e),this.elevatedStructures.populatePaintArrays(t,i,n,r,o))}addElevatedGeometry(e,t,i,n,r,o,s){const a={elevation:n,elevationSampler:i,bias:r,index:o,featureInfo:s},[l,c]=e.addGeometry(t,this.elevationBufferData,a,this.elevatedStructures);null==this.elevationBufferData.heightRange?this.elevationBufferData.heightRange={min:l,max:c}:(this.elevationBufferData.heightRange.min=Math.min(this.elevationBufferData.heightRange.min,l),this.elevationBufferData.heightRange.max=Math.max(this.elevationBufferData.heightRange.max,c))}prepareElevatedPolygons(e,t,i){const n=1/Ic(i),r=[];for(const i of e){const e=mg(i,new M_(t,n),.1);r.push(...e)}return r}clipPolygonsToTile(e,t){const i=-t,n=-t,r=Cr+t,o=Cr+t;let s=0;const a=[],l=[];for(;s<e.length;s++){const t=e[s],c=qe(t);(c.min.x>=i&&c.max.x<=r&&c.min.y>=n&&c.max.y<=o?a:l).push(t)}if(a.length===e.length)return e;const c=[new Pe(i,n),new Pe(r,n),new Pe(r,o),new Pe(i,o),new Pe(i,n)],u=a;for(const e of l)u.push(...pg(e,c));return u}}function Ig(e,t){return e.nextPoint.sub(t.at(-2)).unit()}function Ag(e,t){return t[1].sub(e.prevPoint).unit()}Ys(Sg,"FillHDExtension"),Ys(g_,"ElevatedStructures");class Mg{constructor(e,t){this.elevationEnabled=e,this.hasDeferredElevationFeatures=!1,t&&(this.frcData=new xg)}isEmpty(){const e=!this.elevationEnabled||void 0===this.heightRange,t=!this.frcData||this.frcData.empty();return e&&t}trackFeatureFrc(e){if(!this.frcData)return null;const t=Tg(e||{});return null!==t&&this.frcData.frcCoverage.add(t),t}recordFeatureRange(e,t,i,n){if(!this.frcData||i<=t)return;const r=e.segments.get();this.frcData.featureTriSegments.push({start:3*t,end:3*i,segIdx:r.length>0?r.length-1:0,frc:n})}buildFrcSegments(e){this.frcData&&!this.frcData.empty()&&bg(this.frcData,e.indexArray,e.segments)}handleFeature(e,t,i,n,r,o,s,a,l,c,u){if(!this.elevationEnabled)return!1;if(!u.terrainEnabled){const h=L_(e,n,r?r.registry:void 0,i),d=null!=e.properties&&Object.hasOwn(e.properties,pd)&&!Number.isNaN(+e.properties[pd]);if(!h&&d&&o&&(!r||!r.allProvidersReady))return this.hasDeferredElevationFeatures=!0,!0;if(h){let n=h.feature,o=h.tileId;if(!h.tileId.equals(i)){const t=this.mergedFeatureCache?this.mergedFeatureCache.get(n.id):void 0;if(t)n=t,o=i;else{const t=function(e,t,i){if(!e.properties||!t||0===t.length)return[];const n=+e.properties[pd];if(Number.isNaN(n))return[];const r=R_(t,n);if(r<0)return[];const o=[];for(let e=r;e<t.length&&t[e].feature.id===n;e++){const n=t[e];(n.tileId.isChildOf(i)||i.isChildOf(n.tileId)||null!=n.feature.constantHeight)&&o.push(n)}return o}(e,r?r.registry:void 0,i);t.length>1&&(n=function(e,t){const i=t.slice().sort((e,t)=>t.tileId.z-e.tileId.z),n=new Pe(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new Pe(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),o=[];for(const t of i){const i=new D_(t.tileId,e);for(const e of t.feature.vertices)o.push({position:i.pointTransform(e.position),height:e.height,extent:e.extent,index:e.index});const s=t.feature.safeArea;E_[0]=s.min.x,E_[1]=s.min.y,S_[0]=s.max.x,S_[1]=s.max.y,i.pointTransformInPlace(E_),i.pointTransformInPlace(S_),n.x=Math.min(n.x,E_[0],S_[0]),n.y=Math.min(n.y,E_[1],S_[1]),r.x=Math.max(r.x,E_[0],S_[0]),r.y=Math.max(r.y,E_[1],S_[1])}const s={min:n,max:r};if(null!=i[0].feature.constantHeight)return new C_(i[0].feature.id,s,i[0].feature.constantHeight);o.sort((e,t)=>e.index-t.index);const a=[];for(const e of o)0!==a.length&&a.at(-1).index===e.index||a.push(e);const l=[];for(let e=1;e<a.length;e++)a[e].index-a[e-1].index<=1&&l.push({a:e-1,b:e});const c=1/Ic(e);return new C_(i[0].feature.id,s,void 0,a,l,c)}(i,t),o=i,this.mergedFeatureCache||(this.mergedFeatureCache=new Map),this.mergedFeatureCache.set(n.id,n))}}const d=rd(t,-1,-1,8193,8193),f=this.prepareElevatedLines(d,n,o,i);for(const t of f){const r=u.layoutVertexArray.length;u.addLine(t,e,i,s,a,l,c);const h=new D_(i,o),d=u.showElevationIdDebug?P_(n.id):null;for(let e=r;e<u.layoutVertexArray.length;e++){const t=new Pe(u.layoutVertexArray.int16[6*e]>>1,u.layoutVertexArray.int16[6*e+1]>>1),i=h.pointElevation(t,n,.05);this.updateHeightRange(i),e<u.zOffsetVertexArray.length?u.zOffsetVertexArray.float32[4*e]=i:u.zOffsetVertexArray.emplaceBack(i,0,0,0),d?e<u.elevationIdColVertexArray.length?(u.elevationIdColVertexArray.float32[3*e]=d[0],u.elevationIdColVertexArray.float32[3*e+1]=d[1],u.elevationIdColVertexArray.float32[3*e+2]=d[2]):u.elevationIdColVertexArray.emplaceBack(d[0],d[1],d[2]):u.showElevationIdDebug&&(e<u.elevationIdColVertexArray.length?(u.elevationIdColVertexArray.float32[3*e]=0,u.elevationIdColVertexArray.float32[3*e+1]=0,u.elevationIdColVertexArray.float32[3*e+2]=0):u.elevationIdColVertexArray.emplaceBack(0,0,0))}}return!0}if(d&&o&&r&&r.allProvidersReady&&r.hasCoveringTile)return!0}const h=!(!e.properties||!Object.hasOwn(e.properties,"mapbox_line_metrics"))&&e.properties.mapbox_line_metrics,d=u.layoutVertexArray.length,f=[],p=rd(t,-1,-1,8193,8193,f);for(let t=0;t<p.length;t++){const n=p[t],r=f[t],o={progress:{min:r.progress.min,max:r.progress.max},nextDir:Ig(r,n),prevDir:Ag(r,n)};u.addLine(n,e,i,s,a,l,c,o,h&&r.parentIndex>0?r.parentIndex:null)}return u.fillNonElevatedRoadSegment(d),!0}prepareElevatedLines(e,t,i,n){if(null!=t.constantHeight)return e;const r=[],o=1/Ic(n),s=i.equals(n)?null:new D_(i,n);for(const i of e)od(i,new M_(t,o,s),0,r);return r}updateHeightRange(e){this.heightRange?(this.heightRange.min=Math.min(this.heightRange.min,e),this.heightRange.max=Math.max(this.heightRange.max,e)):this.heightRange={min:e,max:e}}endPopulate(){this.mergedFeatureCache=void 0}}Ys(Mg,"LineHDExtension");class Cg{constructor(){this.elevatedLayoutVertexArray=new Zc,this.hasElevation=!1}beginFeature(e,t,i){const n=L_(e,t,void 0,i);this.currentFeatureElevation=n?n.feature:void 0}writeVertexQuad(e,t){const i=this.currentFeatureElevation?this.currentFeatureElevation.pointElevation(new Pe(e,t)):0;this.hasElevation=this.hasElevation||0!==i;for(let e=0;e<4;e++)this.elevatedLayoutVertexArray.emplaceBack(i)}finalize(){this.hasElevation||(this.elevatedLayoutVertexArray=void 0)}upload(e){this.elevatedLayoutVertexArray&&!this.elevatedLayoutVertexBuffer&&(this.elevatedLayoutVertexBuffer=e.createVertexBuffer(this.elevatedLayoutVertexArray,wd.members))}destroy(){this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy()}}Ys(Cg,"CircleHDExtension");const Dg=(e,t,i,n)=>{for(let r=0;r<t;r++)e.emplaceBack(i[0],i[1],i[2],n[0],n[1],n[2])};class Pg{constructor(){this.elevationFeatures=[],this.elevationFeatureTileIds=[],this.elevationFeatureIdToIndex=new Map,this.elevationStateComplete=!1,this.hasDeferredElevationFeatures=!1,this.elevationParams=null,this.crossSourceElevationEnabled=!1,this.terrainEnabled=!1}configureCrossSource(e,t,i,n){this.consumerCanonical=e,this.elevationParams=t,this.crossSourceElevationEnabled=i,this.terrainEnabled=n}addElevationFeatures(e,t){for(const i of e)this.elevationFeatureIdToIndex.set(i.id,this.elevationFeatures.length),this.elevationFeatures.push(i),this.elevationFeatureTileIds.push(t)}resolveRoadElevation(e,t){const i=this.elevationFeatureIdToIndex.get(t);if(void 0!==i)return i;if(this.terrainEnabled||!this.crossSourceElevationEnabled)return 65535;const n=L_(e,void 0,this.elevationParams?this.elevationParams.registry:void 0,this.consumerCanonical);if(n){const e=this.elevationFeatures.length;return this.elevationFeatureIdToIndex.set(t,e),this.elevationFeatures.push(n.feature),this.elevationFeatureTileIds.push(n.tileId),e}return this.elevationParams&&this.elevationParams.allProvidersReady?65535:(this.hasDeferredElevationFeatures=!0,"defer")}getElevationFeatureSampler(e,t){if(t.equals(e))return new D_(e,t);this.elevationFeatureSamplerCache||(this.elevationFeatureSamplerCache=new Map);let i=this.elevationFeatureSamplerCache.get(t.key);return i||(i=new D_(e,t),this.elevationFeatureSamplerCache.set(t.key,i)),i}isCrossTileRoadElevation(e,t){if(65535===e||e>=this.elevationFeatures.length)return!1;const i=this.elevationFeatureTileIds[e];return null!=i&&!i.equals(t)}getRoadFeatureHeightAtAnchor(e,t,i){if(65535===e||e>=this.elevationFeatures.length)return null;const n=this.elevationFeatures[e],r=this.elevationFeatureTileIds[e];return r.equals(i)?n.pointElevation(t):this.getElevationFeatureSampler(i,r).pointElevation(new Pe(t.x,t.y),n,0)}sampleRoadFeatureHeight(e,t,i){const n=this.getRoadFeatureHeightAtAnchor(e,t,i);return null===n?void 0:n}clearWorkerState(){this.consumerCanonical=void 0,this.elevationParams=null,this.crossSourceElevationEnabled=!1,this.terrainEnabled=!1,this.elevationFeatureIdToIndex.clear()}updateRoadElevation(e,t){if(this.elevationStateComplete)return;this.elevationStateComplete=!0,e.hasAnyZOffset=!1;let i=!1;const n=Ic(t),r=1/n;let o=!1,s=!1;for(let a=0;a<e.symbolInstances.length;a++){const l=e.symbolInstances.get(a),c=L(1,0,0),u=L(0,1,0),{numHorizontalGlyphVertices:h,numVerticalGlyphVertices:d,numIconVertices:f,numVerticalIconVertices:p}=l,m=h>0||d>0,_=f>0,g=l.elevationFeatureIndex,y=g<this.elevationFeatures.length?this.elevationFeatures[g]:void 0;if(y){const a=new Pe(l.tileAnchorX,l.tileAnchorY),h=this.sampleRoadFeatureHeight(g,a,t),d=void 0!==h?.075+h:.075;l.zOffset!==d&&(i=!0,l.zOffset=d),0!==d&&(e.hasAnyZOffset=!0);const f=y.computeSlopeNormal(a,r),p=ve(ce(),L(0,0,1),f);K(c,c,p),K(u,u,p),c[2]*=n,u[2]*=n,1===c[0]&&0===c[1]&&0===c[2]&&0===u[0]&&1===u[1]&&0===u[2]||(o=o||m,s=s||_)}if(m&&(Dg(e.text.orientationVertexArray,h,c,u),Dg(e.text.orientationVertexArray,d,c,u)),_){const{placedIconSymbolIndex:t,verticalPlacedIconSymbolIndex:i}=l;t>=0&&Dg(e.icon.orientationVertexArray,f,c,u),i>=0&&Dg(e.icon.orientationVertexArray,p,c,u)}}o||(e.text.orientationVertexArray=void 0),s||(e.icon.orientationVertexArray=void 0),i&&(e.zOffsetBuffersNeedUpload=!0,e.zOffsetSortDirty=!0)}getRoadFeatureHeightForPlacedSymbol(e,t,i,n,r){const o=e.symbolInstances.get(t.symbolInstanceIndices[i]);return this.getRoadFeatureHeightAtAnchor(o.elevationFeatureIndex,n,r)}getElevationFeatureForPlacedSymbol(e,t,i){const n=e.symbolInstances.get(t.symbolInstanceIndices[i]).elevationFeatureIndex;if(n<this.elevationFeatures.length)return this.elevationFeatures[n]}makeRoadSymbolElevationParams(e,t,i,n,r,o,s,a,l){const c=this.getElevationFeatureForPlacedSymbol(e,t,i),u=void 0!==c?c:null,h=e.symbolInstances.get(t.symbolInstanceIndices[i]);return this.isCrossTileRoadElevation(h.elevationFeatureIndex,n.canonical)?{getElevation:r=>{const o=this.getRoadFeatureHeightForPlacedSymbol(e,t,i,r,n.canonical);return function(e,t,i,n,r,o){const s=n.upVector(t,i.x,i.y);return V(s,s,e*n.upVectorScale(t,r,o).metersToTile),[s[0],s[1],s[2]]}(null!==o?o:0,n.canonical,r,s,a,l)},elevation:o,elevationFeature:null}:{getElevation:r,elevation:o,elevationFeature:u}}}Ys(Pg,"SymbolHDExtension",{omit:["consumerCanonical","elevationParams","crossSourceElevationEnabled","terrainEnabled","hasDeferredElevationFeatures","elevationFeatureIdToIndex"]});let Rg=null,Lg=null,zg=null,Fg=null;const Og=5120,kg=5121,Bg=5122,Ng=5123,Vg=5125,Ug=5126,jg={[Og]:Int8Array,[kg]:Uint8Array,[Bg]:Int16Array,[Ng]:Uint16Array,[Vg]:Uint32Array,[Ug]:Float32Array},Gg={[Og]:"DT_INT8",[kg]:"DT_UINT8",[Bg]:"DT_INT16",[Ng]:"DT_UINT16",[Vg]:"DT_UINT32",[Ug]:"DT_FLOAT32"},$g={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function Hg(e,t,i){const n=i.json.bufferViews.length,r=i.buffers.length;t.bufferView=n,i.json.bufferViews[n]={buffer:r,byteLength:e.byteLength},i.buffers[r]=e}const Zg="KHR_draco_mesh_compression";function qg(e,t){const i=e.extensions&&e.extensions[Zg];if(!i)return;const n=new Rg.Decoder,r=ey(t,i.bufferView),o=new Rg.Mesh;if(!n.DecodeArrayToMesh(r,r.byteLength,o))throw new Error("Failed to decode Draco mesh");const s=t.json.accessors[e.indices],a=jg[s.componentType],l=s.count*a.BYTES_PER_ELEMENT,c=Rg._malloc(l);a===Uint16Array?n.GetTrianglesUInt16Array(o,l,c):n.GetTrianglesUInt32Array(o,l,c),Hg(Rg.memory.buffer.slice(c,c+l),s,t),Rg._free(c);for(const r of Object.keys(i.attributes)){const s=n.GetAttributeByUniqueId(o,i.attributes[r]),a=t.json.accessors[e.attributes[r]],l=Gg[a.componentType],c=a.count*$g[a.type]*jg[a.componentType].BYTES_PER_ELEMENT,u=Rg._malloc(c);n.GetAttributeDataArrayForAllPoints(o,s,Rg[l],c,u),Hg(Rg.memory.buffer.slice(u,u+c),a,t),Rg._free(u)}n.destroy(),o.destroy(),delete e.extensions[Zg]}const Wg="EXT_meshopt_compression";function Yg(e,t){if(!e.extensions||!e.extensions[Wg])return;const i=e.extensions[Wg],n=new Uint8Array(t.buffers[i.buffer],i.byteOffset||0,i.byteLength||0),r=new
vendor: 26,271 bytes, line 2
2Uint8Array(i.count*i.byteStride);zg.decodeGltfBuffer(r,i.count,i.byteStride,n,i.mode,i.filter),e.buffer=t.buffers.length,e.byteOffset=0,t.buffers[e.buffer]=r.buffer,delete e.extensions[Wg]}const Xg=1179937895,Jg=new TextDecoder("utf8");function Kg(e,t){return new URL(e,t).href}async function Qg(e,t,i,n,r){const o=await fetch(Kg(e.uri,n),{signal:r}),s=await o.arrayBuffer();t.buffers[i]=s}function ey(e,t){const i=e.json.bufferViews[t];return new Uint8Array(e.buffers[i.buffer],i.byteOffset||0,i.byteLength)}async function ty(e,t,i,n,r){if(e.uri){const o=Kg(e.uri,n),s=await fetch(o,{signal:r}),a=await s.blob(),l=await createImageBitmap(a);t.images[i]=l}else if(void 0!==e.bufferView){const n=ey(t,e.bufferView),r=new Blob([n],{type:e.mimeType}),o=await createImageBitmap(r);t.images[i]=o}}async function iy(e,t=0,i,n){const r={json:null,images:[],buffers:[]};if(new Uint32Array(e,t,1)[0]===Xg){const i=new Uint32Array(e,t);let n=2;const o=(i[n++]>>2)-3,s=i[n++]>>2;if(n++,r.json=JSON.parse(Jg.decode(i.subarray(n,n+s))),n+=s,n<o){const o=i[n++];n++;const s=t+(n<<2);r.buffers[0]=e.slice(s,s+o)}}else r.json=JSON.parse(Jg.decode(new Uint8Array(e,t)));const{buffers:o,images:s,meshes:a,extensionsUsed:l,bufferViews:c}=r.json;if(o){const e=[];for(let t=0;t<o.length;t++){const s=o[t];s.uri?e.push(Qg(s,r,t,i,n)):r.buffers[t]||(r.buffers[t]=null)}await Promise.all(e)}n&&n.throwIfAborted();const u=[],h=l&&l.includes(Zg),d=l&&l.includes(Wg);if(h&&u.push(function(){if(!Rg)return null!=Lg||(Lg=function(e){let t,i=null;function n(){t=new Uint8Array(i.buffer)}function r(){throw new Error("Unexpected Draco error.")}return WebAssembly.instantiateStreaming(e,{a:{a:r,d:function(e,i,n){return t.copyWithin(e,i,i+n)},c:function(e){const r=t.length,o=Math.max(e>>>0,Math.ceil(1.2*r)),s=Math.ceil((o-r)/65536);try{return i.grow(s),n(),!0}catch(e){return!1}},b:r}}).then(e=>{const{Rb:r,Qb:o,P:s,T:a,X:l,Ja:c,La:u,Qa:h,Va:d,Wa:f,eb:p,jb:m,f:_,e:g,yb:y,zb:v,Ab:x,Bb:b,Db:w,Gb:T}=e.instance.exports;i=g;const E=(()=>{let e=0,i=0,n=0,s=0;return a=>{n&&(r(s),r(e),i+=n,n=e=0),e||(i+=128,e=o(i));const l=a.length+7&-8;let c=e;l>=i&&(n=l,c=s=o(l));for(let e=0;e<a.length;e++)t[c+e]=a[e];return c}})();return n(),_(),{memory:g,_free:r,_malloc:o,Mesh:class{constructor(){this.ptr=s()}destroy(){a(this.ptr)}},Decoder:class{constructor(){this.ptr=c()}destroy(){m(this.ptr)}DecodeArrayToMesh(e,t,i){const n=E(e),r=u(this.ptr,n,t,i.ptr);return!!l(r)}GetAttributeByUniqueId(e,t){return{ptr:h(this.ptr,e.ptr,t)}}GetTrianglesUInt16Array(e,t,i){d(this.ptr,e.ptr,t,i)}GetTrianglesUInt32Array(e,t,i){f(this.ptr,e.ptr,t,i)}GetAttributeDataArrayForAllPoints(e,t,i,n,r){p(this.ptr,e.ptr,t.ptr,i,n,r)}},DT_INT8:y(),DT_UINT8:v(),DT_INT16:x(),DT_UINT16:b(),DT_UINT32:w(),DT_FLOAT32:T()}})}(fetch(Gt())).then(e=>{Rg=e,Lg=null})),Lg}()),d&&u.push(function(){var e;if(!zg)return null!=Fg||(Fg=(e=fetch($t()),WebAssembly.instantiateStreaming(e,{}).then(e=>{const{sbrk:t,memory:i,meshopt_decodeVertexBuffer:n,meshopt_decodeIndexBuffer:r,meshopt_decodeIndexSequence:o,meshopt_decodeFilterOct:s,meshopt_decodeFilterQuat:a,meshopt_decodeFilterExp:l}=e.instance.exports,c={ATTRIBUTES:n,TRIANGLES:r,INDICES:o},u={OCTAHEDRAL:s,QUATERNION:a,EXPONENTIAL:l};return e.instance.exports.__wasm_call_ctors(),{decodeGltfBuffer(e,n,r,o,s,a){const l=n+3&-4,h=t(l*r),d=t(o.length),f=new Uint8Array(i.buffer);f.set(o,d);const p=c[s](h,n,r,d,o.length);if(0===p&&u[a]&&u[a](h,l,r),e.set(f.subarray(h,h+n*r)),t(h-t(0)),0!==p)throw new Error(`Malformed buffer data: ${p}`)}}})).then(e=>{zg=e,Fg=null})),Fg}()),s)for(let e=0;e<s.length;e++)u.push(ty(s[e],r,e,i,n));if(u.length&&await Promise.all(u),n&&n.throwIfAborted(),h&&a)for(const{primitives:e}of a)for(const t of e)qg(t,r);if(d&&a&&c)for(const e of c)Yg(e,r);return r}async function ny(e,t){const{data:i}=await _i({url:e},t);return iy(i,0,e,t)}class ry{constructor(e,t,i,n){if(this.triangleCount=t.length/3,this.min=new Pe(0,0),this.max=new Pe(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],0===this.triangleCount||0===e.length)return;const[r,o]=[e[0].clone(),e[0].clone()];for(let t=1;t<e.length;++t){const i=e[t];r.x=Math.min(r.x,i.x),r.y=Math.min(r.y,i.y),o.x=Math.max(o.x,i.x),o.y=Math.max(o.y,i.y)}if(n){const e=Math.ceil(Math.max(o.x-r.x,o.y-r.y)/n);i=Math.max(i,e)}if(0===i)return;this.min=r,this.max=o;const s=this.max.sub(this.min);s.x=Math.max(s.x,1),s.y=Math.max(s.y,1);const a=Math.max(s.x,s.y)/i;this.cellsX=Math.max(1,Math.ceil(s.x/a)),this.cellsY=Math.max(1,Math.ceil(s.y/a)),this.xScale=1/a,this.yScale=1/a;const l=[];for(let i=0;i<this.triangleCount;i++){const n=e[t[3*i+0]].sub(this.min),r=e[t[3*i+1]].sub(this.min),o=e[t[3*i+2]].sub(this.min),s=oy(Math.floor(Math.min(n.x,r.x,o.x)),this.xScale,this.cellsX),c=oy(Math.floor(Math.max(n.x,r.x,o.x)),this.xScale,this.cellsX),u=oy(Math.floor(Math.min(n.y,r.y,o.y)),this.yScale,this.cellsY),h=oy(Math.floor(Math.max(n.y,r.y,o.y)),this.yScale,this.cellsY),d=new Pe(0,0),f=new Pe(0,0),p=new Pe(0,0),m=new Pe(0,0);for(let e=u;e<=h;++e){d.y=f.y=e*a,p.y=m.y=(e+1)*a;for(let t=s;t<=c;++t)d.x=p.x=t*a,f.x=m.x=(t+1)*a,(Qh(n,r,o,d,f,m)||Qh(n,r,o,d,m,p))&&l.push({cellIdx:e*this.cellsX+t,triIdx:i})}}if(0===l.length)return;l.sort((e,t)=>e.cellIdx-t.cellIdx||e.triIdx-t.triIdx);let c=0;for(;c<l.length;){const e=l[c].cellIdx,t={start:this.payload.length,len:0};for(;c<l.length&&l[c].cellIdx===e;)++t.len,this.payload.push(l[c++].triIdx);this.cells[e]=t}}_lazyInitLookup(){this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8))),this.lookup.fill(0)}queryPoint(e,t){if(0===this.triangleCount||0===this.cells.length)return;if(e.x>this.max.x||this.min.x>e.x||e.y>this.max.y||this.min.y>e.y)return;const i=oy(e.x-this.min.x,this.xScale,this.cellsX),n=oy(e.y-this.min.y,this.yScale,this.cellsY),r=this.cells[n*this.cellsX+i];if(r){this._lazyInitLookup();for(let e=0;e<r.len;e++){const i=this.payload[r.start+e],n=Math.floor(i/8),o=1<<i%8;if(!(this.lookup[n]&o)&&(this.lookup[n]|=o,t.push(i),t.length===this.triangleCount))return}}}query(e,t,i){if(0===this.triangleCount||0===this.cells.length)return;if(e.x>this.max.x||this.min.x>t.x)return;if(e.y>this.max.y||this.min.y>t.y)return;this._lazyInitLookup();const n=oy(e.x-this.min.x,this.xScale,this.cellsX),r=oy(t.x-this.min.x,this.xScale,this.cellsX),o=oy(e.y-this.min.y,this.yScale,this.cellsY),s=oy(t.y-this.min.y,this.yScale,this.cellsY);for(let e=o;e<=s;e++)for(let t=n;t<=r;t++){const n=this.cells[e*this.cellsX+t];if(n)for(let e=0;e<n.len;e++){const t=this.payload[n.start+e],r=Math.floor(t/8),o=1<<t%8;if(!(this.lookup[r]&o)&&(this.lookup[r]|=o,i.push(t),i.length===this.triangleCount))return}}}}function oy(e,t,i){return Math.max(0,Math.min(i-1,Math.floor(e*t)))}Ys(ry,"TriangleGridIndex");const sy=Uc([{name:"a_pos_3f",components:3,type:"Float32"}]),ay=Uc([{name:"a_color_3f",components:3,type:"Float32"}]),ly=Uc([{name:"a_color_4f",components:4,type:"Float32"}]),cy=Uc([{name:"a_uv_2f",components:2,type:"Float32"}]),uy=Uc([{name:"a_uv_2f",components:2,type:"Uint16",normalized:!0}]),hy=Uc([{name:"a_normal_4n",components:4,type:"Int8",normalized:!0}]),dy=Uc([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),fy=Uc([{name:"a_feature",components:2,type:"Uint16"}]);function py(e,t){const i=_y(e.projection,e.zoom,e.width,e.height),n=function(e,t,i,n,r){const o=new gc(i.lng-180*gy,i.lat),s=new gc(i.lng+180*gy,i.lat),a=e.project(o.lng,o.lat),l=e.project(s.lng,s.lat),c=-Math.atan2(l.y-a.y,l.x-a.x),u=Ac.fromLngLat(i);u.y=it(u.y,-1+gy,1-gy);const h=u.toLngLat(),f=e.project(h.lng,h.lat),p=Ac.fromLngLat(h);p.x+=gy;const _=p.toLngLat(),y=e.project(_.lng,_.lat),v=vy(y.x-f.x,y.y-f.y,c),b=Ac.fromLngLat(h);b.y+=gy;const w=b.toLngLat(),T=e.project(w.lng,w.lat),E=vy(T.x-f.x,T.y-f.y,c),S=Math.abs(v.x)/Math.abs(E.y),I=d([]);x(I,I,-c*(1-(r?0:n)));const A=d([]);return g(A,A,[1,1-(1-S)*n,1]),A[4]=-E.x/E.y*n,x(A,A,c),m(A,I,A),A}(e.projection,0,e.center,i,t),r=my(e);return g(n,n,[r,r,1]),n}function my(e){const t=e.projection,i=_y(e.projection,e.zoom,e.width,e.height),n=yy(t,e.center),r=yy(t,gc.convert(t.center));return Math.pow(2,n*i+(1-i)*r)}function _y(e,t,i,n,r=1/0){const o=e.range;if(!o)return 0;const s=Math.min(r,Math.max(i,n)),a=Math.log2(s/1024);return nt(o[0]+a,o[1]+a,t)}const gy=1/4e4;function yy(e,t){const i=it(t.lat,-85.051129,wc),n=new gc(t.lng-180*gy,i),r=new gc(t.lng+180*gy,i),o=e.project(n.lng,i),s=e.project(r.lng,i),a=Ac.fromLngLat(n),l=Ac.fromLngLat(r),c=s.x-o.x,u=s.y-o.y,h=l.x-a.x,d=l.y-a.y,f=Math.sqrt((h*h+d*d)/(c*c+u*u));return Math.log2(f)}function vy(e,t,i){const n=Math.cos(i),r=Math.sin(i);return{x:e*n-t*r,y:e*r+t*n}}const xy=new Float64Array([1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1]);function by(e,t,i){d(e),x(e,e,Je(t[2])),y(e,e,Je(t[0])),v(e,e,Je(t[1])),g(e,e,i),m(e,e,xy)}function wy(e,t,i,n,r,o,s,a){const l=[i[0]-t[0],i[1]-t[1],0],c=[n[0]-t[0],n[1]-t[1],0];if(R(l)<1e-12||R(c)<1e-12)return ue(e);const u=W([],l,c);Z(u,u),O(c,n,t),l[2]=(o-r)*a,c[2]=(s-r)*a;const h=l;return W(h,l,c),Z(h,h),ve(e,u,h)}function Ty(e,t,i=!1){const n=Jf(t.zoom),r=function(e,t,i){const n=t.worldSize,r=[e[12],e[13],e[14]],o=mr(r[1]/n),s=pr(r[0]/n),a=d([]),l=xc(1,o)*n,c=xc(1,0)*n*Ec(o,t.zoom),u=1/Wf(n);let h=c*u;if(i){const e=_y(t.projection,t.zoom,t.width,t.height,1024);h=u*t.projection.pixelSpaceConversion(t.center.lat,n,e)}const f=pc(o,s);F(f,f,V([],Z([],f),l*h*r[2]));const p=function(e){const t=[e[0],e[1],e[2]];let i=[0,1,0];const n=W([],i,t);return W(i,t,n),0===$(i)&&(i=[0,1,0],W(n,t,i)),Z(n,n),Z(i,i),Z(t,t),[n[0],n[1],n[2],0,i[0],i[1],i[2],0,t[0],t[1],t[2],0,e[0],e[1],e[2],1]}(f);g(a,a,[h,h,h*l]),_(a,a,[-r[0],-r[1],-r[2]]);const y=m([],t.globeMatrix,p);return m(y,y,a),m(y,y,e),y}(e,t,i);if(n>0){const i=function(e,t){const i=t.worldSize,n=xc(1,0)*i*Ec(t.center.lat,t.zoom)/Wf(i),r=xc(1,t.center.lat)*i,o=d([]);v(o,o,Je(t.center.lng)),y(o,o,Je(t.center.lat)),_(o,o,[0,0,lc]),g(o,o,[n,n,n*r]);const s=t.point;return _(o,o,[-s.x,-s.y,0]),m(o,o,e),m(o,t.globeMatrix,o)}(e,t);return function(e,t,i){const n=(e,t,i)=>{const n=R(e),r=R(t),o=Bf(e,t,i);return V(o,o,1/R(o)*fn(n,r,i))},r=n([e[0],e[1],e[2]],[t[0],t[1],t[2]],i),o=n([e[4],e[5],e[6]],[t[4],t[5],t[6]],i),s=n([e[8],e[9],e[10]],[t[8],t[9],t[10]],i),a=Bf([e[12],e[13],e[14]],[t[12],t[13],t[14]],i);return[r[0],r[1],r[2],0,o[0],o[1],o[2],0,s[0],s[1],s[2],0,a[0],a[1],a[2],1]}(r,i,n)}return r}function Ey(e,t,i,n){const r=Pf.projectAabbCorners(n,i);let o=Number.MAX_VALUE;for(let e=0;e<r.length;++e){const i=r[e];i[0]=(.5*i[0]+.5)*t.width,i[1]=(.5-.5*i[1])*t.height,i[2]<o&&(o=i[2])}const s=function(e){const t=[];let i=0;for(let t=1;t<e.length;t++)(e[t][0]<e[i][0]||e[t][0]===e[i][0]&&e[t][1]<e[i][1])&&(i=t);let n,r=i;const o=new Uint8Array(e.length);do{if(o[r])break;t.push(new Pe(e[r][0],e[r][1])),o[r]=1,n=(r+1)%e.length;for(let t=0;t<e.length;t++){if(e[t][0]===e[n][0]&&e[t][1]===e[n][1]||e[t][0]===e[r][0]&&e[t][1]===e[r][1])continue;const i=[e[t][0]-e[r][0],e[t][1]-e[r][1]],o=[e[n][0]-e[r][0],e[n][1]-e[r][1]],s=i[0]*o[1]-i[1]*o[0];(s>0||0===s&&i[0]*o[0]+i[1]*o[1]>=0&&i[0]*i[0]+i[1]*i[1]>o[0]*o[0]+o[1]*o[1])&&(n=t)}r=n}while(r!==i);return t.length>0&&t.push(t[0]),t}(r);if(Bh(e,s))return o}const Sy=64,Iy=["","wall","door","roof","window","lamp","logo"],Ay=[1,1,1];function My(e,t,i,n,r,o,s,a,l,c=!1){const u=i.zoom,h=i.project(n),f=Ec(n.lat,u),p=1/f;d(e),_(e,e,[h.x+s[0]*p,h.y+s[1]*p,s[2]]);let y=1,v=1;const x=i.worldSize;if(c){if("mercator"===i.projection.name){let e=0;i.elevation&&(e=i.elevation.getAtPointOrZero(new Ac(h.x/x,h.y/x),0));const t=le([],[h.x,h.y,e,1],i.projMatrix)[3]/i.cameraToCenterDistance;y=t,v=t*Ec(i.center.lat,u)}else if("globe"===i.projection.name){const t=Ty(e,i),r=[0,0,0,1];le(r,r,m([],i.projMatrix,t));const o=r[3]/i.cameraToCenterDistance,s=Jf(u),a=i.projection.pixelsPerMeter(n.lat,x)*Ec(n.lat,u),l=i.projection.pixelsPerMeter(i.center.lat,x)*Ec(i.center.lat,u);y=o/fn(a,Tc(i.center.lat),s),v=o*f/a,y*=l,v*=l}}else y=p;g(e,e,[y,y,v]);const b=[...e],w=t.orientation,T=[];if(by(T,[w[0]+(r?r[0]:0),w[1]+(r?r[1]:0),w[2]+(r?r[2]:0)],o),m(e,b,T),a&&i.elevation){let r=0;const o=[];if(l&&i.elevation){r=function(e,t,i,n,r){const o=t.elevation;if(!o)return 0;const s=Pf.projectAabbCorners(i,n),a=xc(1,r.lat)*t.worldSize,l=function(e,t){const i=[0,0,1],n=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const r of n){const n=e[r.corners[0]],o=e[r.corners[1]],s=e[r.corners[2]],a=[o[0]-n[0],o[1]-n[1],t*(o[2]-n[2])],l=W(a,a,[s[0]-n[0],s[1]-n[1],t*(s[2]-n[2])]);Z(l,l),r.dotProductWithUp=q(l,i)}return n.sort((e,t)=>e.dotProductWithUp-t.dotProductWithUp),n[0].corners}(s,a),c=s[l[0]],u=s[l[1]],h=s[l[2]],d=s[l[3]],f=o.getAtPointOrZero(new Ac(c[0]/t.worldSize,c[1]/t.worldSize),0),p=o.getAtPointOrZero(new Ac(u[0]/t.worldSize,u[1]/t.worldSize),0),m=o.getAtPointOrZero(new Ac(h[0]/t.worldSize,h[1]/t.worldSize),0),_=o.getAtPointOrZero(new Ac(d[0]/t.worldSize,d[1]/t.worldSize),0),g=(f+_)/2,y=(p+m)/2;return g>y?p<m?wy(e,u,d,c,p,_,f,a):wy(e,h,c,d,m,f,_,a):f<_?wy(e,c,u,h,f,p,m,a):wy(e,d,h,u,_,m,p,a),Math.max(g,y)}(o,i,t.aabb,e,n);const s=m([],I([],o),T);m(e,b,s)}else r=i.elevation.getAtPointOrZero(new Ac(h.x/x,h.y/x),0);0!==r&&(e[14]+=r)}}class Cy{constructor(e,t,i,n,r){this.materialOverrides=new Map,this.nodeOverrides=new Map,this.materialOverrideNames=[],this.nodeOverrideNames=[],this.featureProperties={},this.id=e,this.uri=t,this.position=null!=i?new gc(i[0],i[1]):new gc(0,0),this.orientation=n??[0,0,0],this.nodes=r,this.uploaded=!1,this.aabb=new Pf([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(e,t){m(e.globalMatrix,t,e.localMatrix);const i=this.nodeOverrides.get(e.name);if(void 0!==i){if(i.orientation){const t=[];r=i.orientation,d(n=t),v(n,n,Je(r[1])),x(n,n,Je(r[2])),y(n,n,Je(r[0])),m(e.globalMatrix,e.globalMatrix,t)}i.minZoom&&(e.minZoom=i.minZoom),i.maxZoom&&(e.maxZoom=i.maxZoom)}var n,r;if(e.meshes)for(const t of e.meshes){const i=Pf.applyTransformFast(t.aabb,e.globalMatrix);this.aabb.encapsulate(i)}if(e.children)for(const t of e.children)this._applyTransformations(t,e.globalMatrix)}computeBoundsAndApplyParent(){const e=d([]);this.aabb=new Pf([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const t of this.nodes)this._applyTransformations(t,e)}computeModelMatrix(e,t,i,n,r,o,s=!1){My(this.matrix,this,e.transform,this.position,t,i,n,r,o,s)}upload(e){if(!this.uploaded){for(const t of this.nodes)Ry(t,e);for(const e of this.nodes)zy(e);this.uploaded=!0}}destroy(){for(const e of this.nodes)Oy(e)}}function Dy(e,t,i=!1){e.uploaded||(e.gfxTexture=new Mm(t,e.image,i?t.gl.R8:t.gl.RGBA8,{useMipmap:e.sampler.minFilter>=t.gl.NEAREST_MIPMAP_NEAREST}),e.uploaded=!0,e.image=null)}function Py(e,t,i){e.indexBuffer=t.createIndexBuffer(e.indexArray,!1,!0),e.vertexBuffer=t.createVertexBuffer(e.vertexArray,sy.members,!1,!0),e.normalArray&&(e.normalBuffer=t.createVertexBuffer(e.normalArray,hy.members,!1,!0)),e.texcoordArray&&(e.texcoordBuffer=t.createVertexBuffer(e.texcoordArray,(8===e.texcoordArray.bytesPerElement?cy:uy).members,!1,!0)),e.colorArray&&(e.colorBuffer=t.createVertexBuffer(e.colorArray,(12===e.colorArray.bytesPerElement?ay:ly).members,!1,!0)),e.featureArray&&(e.featureBuffer=t.createVertexBuffer(e.featureArray,fy.members,!1,!0)),e.segments=Gu.simpleSegment(0,0,e.vertexArray.length,e.indexArray.length);const n=e.material;n.pbrMetallicRoughness.baseColorTexture&&Dy(n.pbrMetallicRoughness.baseColorTexture,t),n.pbrMetallicRoughness.metallicRoughnessTexture&&Dy(n.pbrMetallicRoughness.metallicRoughnessTexture,t),n.normalTexture&&Dy(n.normalTexture,t),n.occlusionTexture&&Dy(n.occlusionTexture,t,i),n.emissionTexture&&Dy(n.emissionTexture,t)}function Ry(e,t,i){if(e.meshes)for(const n of e.meshes)Py(n,t,i);if(e.lodMeshes)for(const n of e.lodMeshes)Py(n,t,i);if(e.children)for(const n of e.children)Ry(n,t,i)}function Ly(e){e.indexArray.destroy(),e.vertexArray.destroy(),e.colorArray&&e.colorArray.destroy(),e.normalArray&&e.normalArray.destroy(),e.texcoordArray&&e.texcoordArray.destroy(),e.featureArray&&e.featureArray.destroy()}function zy(e){if(e.meshes)for(const t of e.meshes)Ly(t);if(e.lodMeshes)for(const t of e.lodMeshes)Ly(t);if(e.children)for(const t of e.children)zy(t)}function Fy(e){var t;e.vertexBuffer&&(e.vertexBuffer.destroy(),e.indexBuffer.destroy(),e.normalBuffer&&e.normalBuffer.destroy(),e.texcoordBuffer&&e.texcoordBuffer.destroy(),e.colorBuffer&&e.colorBuffer.destroy(),e.featureBuffer&&e.featureBuffer.destroy(),e.segments.destroy(),e.material&&((t=e.material).pbrMetallicRoughness.baseColorTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),t.pbrMetallicRoughness.metallicRoughnessTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),t.normalTexture&&t.normalTexture.gfxTexture&&t.normalTexture.gfxTexture.destroy(),t.emissionTexture&&t.emissionTexture.gfxTexture&&t.emissionTexture.gfxTexture.destroy(),t.occlusionTexture&&t.occlusionTexture.gfxTexture&&t.occlusionTexture.gfxTexture.destroy()))}function Oy(e){if(e.meshes)for(const t of e.meshes)Fy(t);if(e.lodMeshes)for(const t of e.lodMeshes)Fy(t);if(e.footprintDebugMesh&&(e.footprintDebugMesh.vertexBuffer.destroy(),e.footprintDebugMesh.indexBuffer.destroy(),e.footprintDebugMesh.segments.destroy()),e.children)for(const t of e.children)Oy(t)}function ky(e,t,i,n){return e[0]<=n[0]&&t[0]>=i[0]&&e[1]<=n[1]&&t[1]>=i[1]&&e[2]<=n[2]&&t[2]>=i[2]}function By(e,t,i,n,r,o,s,a,l,c,u){const h=.5*(c[0]+u[0]),d=.5*(c[1]+u[1]),f=.5*(c[2]+u[2]),p=.5*(u[0]-c[0]),m=.5*(u[1]-c[1]),_=.5*(u[2]-c[2]),g=e-h,y=t-d,v=i-f,x=n-h,b=r-d,w=o-f,T=s-h,E=a-d,S=l-f,I=x-g,A=b-y,M=w-v,C=T-x,D=E-b,P=S-w,R=g-T,L=y-E,z=v-S;let F,O,k,B,N,V;if(F=v*A-y*M,O=w*A-b*M,k=S*A-E*M,B=Math.min(F,O,k),N=Math.max(F,O,k),V=Math.abs(M)*m+Math.abs(A)*_,B>V||N<-V)return!1;if(F=v*D-y*P,O=w*D-b*P,k=S*D-E*P,B=Math.min(F,O,k),N=Math.max(F,O,k),V=Math.abs(P)*m+Math.abs(D)*_,B>V||N<-V)return!1;if(F=v*L-y*z,O=w*L-b*z,k=S*L-E*z,B=Math.min(F,O,k),N=Math.max(F,O,k),V=Math.abs(z)*m+Math.abs(L)*_,B>V||N<-V)return!1;if(F=g*M-v*I,O=x*M-w*I,k=T*M-S*I,B=Math.min(F,O,k),N=Math.max(F,O,k),V=Math.abs(M)*p+Math.abs(I)*_,B>V||N<-V)return!1;if(F=g*P-v*C,O=x*P-w*C,k=T*P-S*C,B=Math.min(F,O,k),N=Math.max(F,O,k),V=Math.abs(P)*p+Math.abs(C)*_,B>V||N<-V)return!1;if(F=g*z-v*R,O=x*z-w*R,k=T*z-S*R,B=Math.min(F,O,k),N=Math.max(F,O,k),V=Math.abs(z)*p+Math.abs(R)*_,B>V||N<-V)return!1;if(F=y*I-g*A,O=b*I-x*A,k=E*I-T*A,B=Math.min(F,O,k),N=Math.max(F,O,k),V=Math.abs(A)*p+Math.abs(I)*m,B>V||N<-V)return!1;if(F=y*C-g*D,O=b*C-x*D,k=E*C-T*D,B=Math.min(F,O,k),N=Math.max(F,O,k),V=Math.abs(D)*p+Math.abs(C)*m,B>V||N<-V)return!1;if(F=y*R-g*L,O=b*R-x*L,k=E*R-T*L,B=Math.min(F,O,k),N=Math.max(F,O,k),V=Math.abs(L)*p+Math.abs(R)*m,B>V||N<-V)return!1;if(B=Math.min(g,x,T),N=Math.max(g,x,T),B>p||N<-p)return!1;if(B=Math.min(y,b,E),N=Math.max(y,b,E),B>m||N<-m)return!1;if(B=Math.min(v,w,S),N=Math.max(v,w,S),B>_||N<-_)return!1;const U=A*P-M*D,j=M*C-I*P,G=I*D-A*C,$=-(U*g+j*y+G*v);return V=p*Math.abs(U)+m*Math.abs(j)+_*Math.abs(G),!(Math.abs($)>V)}const Ny=[];class Vy{serializeFromGltf(e,t,i,n){if(e.length<7)return;let r=0;if(109!==e[r++]||98!==e[r++]||120!==e[r++]||98!==e[r++]||118!==e[r++]||104!==e[r++])return;if(43!==e[r++])return;const o=new DataView(e.buffer,e.byteOffset),s=o.getUint16(r,!0);if(r+=2,0===s)return;this._nodes=[];let a=0;for(let e=0;e<s;e++){const e=[t[3*a],t[3*a+1],t[3*a+2]],n=[i[3*a],i[3*a+1],i[3*a+2]];a++;const s=o.getUint16(r,!0);r+=2;let l=0,c=0;65535===s&&(l=o.getUint16(r,!0),r+=2,c=o.getUint32(r,!0),r+=4),this._nodes.push({aabbMin:e,aabbMax:n,backChild:s,indexCount:l,indexOffset:c})}const l=o.getUint32(r,!0);this._indices=n.slice(0,l)}setVertices(e){this._vertices=e}findHighestPoint(e,t){if(!this._nodes||0===this._nodes.length)return null;if(!ky(this._nodes[0].aabbMin,this._nodes[0].aabbMax,e,t))return null;const i=Ny;i.length=0,i.push(0);let n=-1/0;for(;i.length>0;){const r=i.pop(),o=this._nodes[r];if(o.aabbMax[2]<=n)continue;if(65535===o.backChild){for(let i=0;i<o.indexCount;i+=3){const r=3*this._indices[o.indexOffset+i],s=3*this._indices[o.indexOffset+i+1],a=3*this._indices[o.indexOffset+i+2];By(this._vertices[r],this._vertices[r+1],this._vertices[r+2],this._vertices[s],this._vertices[s+1],this._vertices[s+2],this._vertices[a],this._vertices[a+1],this._vertices[a+2],e,t)&&(n=Math.max(n,this._vertices[r+2],this._vertices[s+2],this._vertices[a+2]))}continue}const s=r+1,a=o.backChild,l=this._nodes[s],c=this._nodes[a],u=ky(l.aabbMin,l.aabbMax,e,t),h=ky(c.aabbMin,c.aabbMax,e,t);u&&h?l.aabbMax[2]<c.aabbMax[2]?(i.push(s),i.push(a)):(i.push(a),i.push(s)):u?i.push(s):h&&i.push(a)}return n>=0?n:null}}function Uy(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}function jy(e,t){const i=e.json.bufferViews[t.bufferView],n=jg[t.componentType];return new n(e.buffers[i.buffer],(t.byteOffset||0)+(i.byteOffset||0),t.count*(i.byteStride&&i.byteStride!==$g[t.type]*n.BYTES_PER_ELEMENT?i.byteStride/n.BYTES_PER_ELEMENT:$g[t.type]))}function Gy(e,t,i,n){const r=jy(e,t),o=r instanceof Float32Array?r:new Uint32Array(r.buffer,r.byteOffset,t.count),s=new su;s.reserveExact(t.count);let a=-1;for(let e=0;e<t.count;e++){const t=i?o[e]>>>16|o[e]<<16:o[e],n=65535&t,r=t>>>16;a=a<0&&2==(15&r)?n:a,s.emplaceBack(n,r)}n.featureArray=s,a>=0&&(n.doorVertexColor=a)}function $y(e,t,i,n,r=!0){const o=jg[t.componentType],s=$g[t.type],a=r?Uy(o):1,l=e.json.bufferViews[t.bufferView],c=l.byteStride?l.byteStride/o.BYTES_PER_ELEMENT:s,u=t.count*c;for(let e=0,t=0;e<u;e+=c,t+=s)for(let r=0;r<s;r++)i[t+r]=n[e+r]*a}function Hy(e,t,i){const n=e.indices,r=e.attributes,o={};o.indexArray=new hu;const s=t.json.accessors[n],a=jy(t,s);o.indexArray.resizeExact(s.count/3),o.indexArray.uint16.set(a),o.vertexArray=new Kc;const l=t.json.accessors[r.POSITION],c=jy(t,l);o.vertexArray.resizeExact(l.count),o.vertexArray.float32.set(c),o.aabb=new Pf(l.min,l.max);const[u,h,d]=l.min,[f,p,m]=l.max;if(o.centroid=[.5*(u+f),.5*(h+p),.5*(d+m)],void 0!==r.COLOR_0){const e=t.json.accessors[r.COLOR_0],i=$g[e.type],n=jy(t,e);o.colorArray=3===i?new Kc:new ru,o.colorArray.resizeExact(e.count),$y(t,e,o.colorArray.float32,n)}if(void 0!==r.NORMAL){o.normalArray=new wu;const e=t.json.accessors[r.NORMAL];o.normalArray.resizeExact(e.count);const i=jy(t,e);!function(e,t,i,n){const r=jg[t.componentType],o=Uy(r),s=e.json.bufferViews[t.bufferView],a=$g[t.type],l=i.length/t.count,c=s.byteStride?s.byteStride/r.BYTES_PER_ELEMENT:a,u=t.count*c;for(let e=0,t=0;e<u;e+=c,t+=l)for(let r=0;r<a;r++)i[t+r]=Math.round(127*Math.min(1,Math.max(-1,n[e+r]*o)))}(t,e,o.normalArray.int8,i)}if(void 0!==r.TEXCOORD_0&&i.length>0){const e=t.json.accessors[r.TEXCOORD_0],i=jy(t,e);e.normalized&&jg[e.componentType]===Uint16Array?(o.texcoordArray=new su,o.texcoordArray.resizeExact(e.count),$y(t,e,o.texcoordArray.uint16,i,!1)):(o.texcoordArray=new vu,o.texcoordArray.resizeExact(e.count),$y(t,e,o.texcoordArray.float32,i))}const _=!(!t.json.extensionsUsed||!t.json.extensionsUsed.includes("EXT_meshopt_compression"));void 0!==r._FEATURE_ID_RGBA4444&&_&&Gy(t,t.json.accessors[r._FEATURE_ID_RGBA4444],!1,o),void 0!==r._FEATURE_RGBA4444&&Gy(t,t.json.accessors[r._FEATURE_RGBA4444],!_,o),o.hasFeatureData=!!o.featureArray;const g=e.material;return o.material=function(e,t){const{emissiveFactor:i=[0,0,0],alphaMode:n="OPAQUE",alphaCutoff:r=.5,normalTexture:o,occlusionTexture:s,emissiveTexture:a,doubleSided:l,name:c}=e,{baseColorFactor:u=[1,1,1,1],metallicFactor:h=1,roughnessFactor:d=1,baseColorTexture:f,metallicRoughnessTexture:p}=e.pbrMetallicRoughness||{},m=s?t[s.index]:void 0;if(s&&s.extensions&&s.extensions.KHR_texture_transform&&m){const e=s.extensions.KHR_texture_transform;m.offsetScale=[e.offset[0],e.offset[1],e.scale[0],e.scale[1]]}return{name:c,pbrMetallicRoughness:{baseColorFactor:new mn(...u),metallicFactor:h,roughnessFactor:d,baseColorTexture:f?t[f.index]:void 0,metallicRoughnessTexture:p?t[p.index]:void 0},doubleSided:l,emissiveFactor:new mn(...i),alphaMode:n,alphaCutoff:r,normalTexture:o?t[o.index]:void 0,occlusionTexture:m,emissionTexture:a?t[a.index]:void 0,defined:void 0===e.defined}}(void 0!==g?t.json.materials[g]:{defined:!1},i),o}function Zy(e,t,i){const{matrix:n,rotation:r,translation:o,scale:s,mesh:a,extras:l,children:c,name:h}=e,d={};if(d.name=h,d.localMatrix=n||function(e,t,i,n){var r=t[0],o=t[1],s=t[2],a=t[3],l=r+r,c=o+o,u=s+s,h=r*l,d=r*c,f=r*u,p=o*c,m=o*u,_=s*u,g=a*l,y=a*c,v=a*u,x=n[0],b=n[1],w=n[2];return e[0]=(1-(p+_))*x,e[1]=(d+v)*x,e[2]=(f-y)*x,e[3]=0,e[4]=(d-v)*b,e[5]=(1-(h+_))*b,e[6]=(m+g)*b,e[7]=0,e[8]=(f+y)*w,e[9]=(m-g)*w,e[10]=(1-(h+p))*w,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}([],r||[0,0,0,1],o||[0,0,0],s||[1,1,1]),d.globalMatrix=u(d.localMatrix),void 0!==a){d.meshes=i[a];const e=d.anchor=[0,0];for(const t of d.meshes){const{min:i,max:n}=t.aabb;e[0]+=i[0]+n[0],e[1]+=i[1]+n[1]}e[0]=Math.floor(e[0]/d.meshes.length/2),e[1]=Math.floor(e[1]/d.meshes.length/2)}if(l&&(l.id&&(d.id=l.id),l.lights&&(d.lights=function(e){if(!e.length)return[];const t=function(e){const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.codePointAt(e);return i}(e),i=[],n=t.length/24,r=new Uint16Array(t.buffer),o=new Float32Array(t.buffer);for(let e=0;e<n;e++){const t=r[2*e*6]/30,n=r[2*e*6+1]/30,s=r[2*e*6+10]/100,a=o[6*e+1],l=o[6*e+2],c=o[6*e+3],u=o[6*e+4],h=c-a,d=u-l,f=Math.hypot(h,d);i.push({pos:[a+.5*h,l+.5*d,n],normal:[d/f,-h/f,0],width:f,height:t,depth:s,points:[a,l,c,u]})}return i}(l.lights)),l.MAPBOX_geometry_bloom&&(d.isGeometryBloom=l.MAPBOX_geometry_bloom),l.MAPBOX_zoom_min&&(d.minZoom=l.MAPBOX_zoom_min),l.MAPBOX_zoom_max&&(d.maxZoom=l.MAPBOX_zoom_max)),c){const e=[];for(const n of c)e.push(Zy(t.json.nodes[n],t,i));d.children=e}if(e.extensions&&e.extensions.mbx_bvh&&(d.meshBVH=function(e,t,i){const n=t.binaryAccessor,r=t.positionMinAccessor,o=t.positionMaxAccessor,s=t.
vendor: 4,668 bytes, line 2
2indexAccessor;if(!(Number.isInteger(n)&&Number.isInteger(r)&&Number.isInteger(o)&&Number.isInteger(s)))return null;const a=e.json.accessors;if(n>=a.length||r>=a.length||o>=a.length||s>=a.length)return null;const l=a[n],c=a[r],u=a[o],h=a[s];if(void 0===l.bufferView||void 0===c.bufferView||void 0===u.bufferView||void 0===h.bufferView)return null;const d=e.json.bufferViews;if(l.bufferView>=d.length||c.bufferView>=d.length||u.bufferView>=d.length||h.bufferView>=d.length)return null;const f=d[l.bufferView],p=d[c.bufferView],m=d[u.bufferView],_=d[h.bufferView];if(f.buffer>=e.buffers.length||p.buffer>=e.buffers.length||m.buffer>=e.buffers.length||_.buffer>=e.buffers.length)return null;const g=(e,t,i)=>e>=0&&e<=i&&t<=i-e,y=l.byteOffset||0,v=c.byteOffset||0,x=u.byteOffset||0,b=h.byteOffset||0;if(!(g(y,0,f.byteLength)&&g(v,3*c.count*4,p.byteLength)&&g(x,3*u.count*4,m.byteLength)&&g(b,4*h.count,_.byteLength)))return null;const w=new Uint8Array(e.buffers[f.buffer],(f.byteOffset||0)+y,f.byteLength-y),T=new Float32Array(e.buffers[p.buffer],(p.byteOffset||0)+v,3*c.count),E=new Float32Array(e.buffers[m.buffer],(m.byteOffset||0)+x,3*u.count),S=new Uint32Array(e.buffers[_.buffer],(_.byteOffset||0)+b,h.count),I=new Vy;if(I.serializeFromGltf(w,T,E,S),void 0!==i&&e.json.meshes&&e.json.meshes[i]){const t=e.json.meshes[i].primitives[0];if(t&&void 0!==t.attributes.POSITION&&t.attributes.POSITION<a.length){const i=a[t.attributes.POSITION];if(void 0!==i.bufferView&&i.bufferView<d.length){const t=d[i.bufferView];if(t.buffer<e.buffers.length){const n=i.byteOffset||0,r=t.byteStride?t.byteStride/4:3;if(g(n,i.count*r*4,t.byteLength)){const o=(t.byteOffset||0)+n;if(3===r)I.setVertices(new Float32Array(e.buffers[t.buffer],o,3*i.count));else{const n=new Float32Array(e.buffers[t.buffer],o,i.count*r),s=new Float32Array(3*i.count);for(let e=0;e<i.count;e++)s[3*e]=n[e*r],s[3*e+1]=n[e*r+1],s[3*e+2]=n[e*r+2];I.setVertices(s)}}}}}}return I}(t,e.extensions.mbx_bvh,a)),!d.meshBVH&&d.children)for(const e of d.children)if(e.meshBVH){d.meshBVH=e.meshBVH;break}return d}function qy(e){if(0===e.vertices.length||0===e.indices.length)return null;const t=new ry(e.vertices,e.indices,8,256),[i,n]=[t.min.clone(),t.max.clone()];return{vertices:e.vertices,indices:e.indices,grid:t,min:i,max:n}}function Wy(e){if(!e.extras||!e.extras.ground)return null;const t=e.extras.ground;if(!t||!Array.isArray(t)||0===t.length)return null;const i=t[0];if(!i||!Array.isArray(i)||0===i.length)return null;const n=[];for(const e of i){if(!Array.isArray(e)||2!==e.length)continue;const t=e[0],i=e[1];"number"==typeof t&&"number"==typeof i&&n.push(new Pe(t,i))}if(n.length<3)return null;n.length>1&&n.at(-1).equals(n[0])&&n.pop();let r=0;for(let e=0;e<n.length;e++){const t=n[e],i=n[(e+1)%n.length],o=n[(e+2)%n.length];r+=(t.x-i.x)*(o.y-i.y)-(o.x-i.x)*(t.y-i.y)}r>0&&n.reverse();const o=Ll(n.flatMap(e=>[e.x,e.y]),[]);return 0===o.length?null:{vertices:n,indices:o}}function Yy(e,t){const i=[],n=[];let r=0;const o=[];for(const s of e){r=i.length;const e=s.vertexArray.float32,a=s.indexArray.uint16;for(let n=0;n<s.vertexArray.length;n++)o[0]=e[3*n+0],o[1]=e[3*n+1],o[2]=e[3*n+2],X(o,o,t),i.push(new Pe(o[0],o[1]));for(let e=0;e<3*s.indexArray.length;e++)n.push(a[e]+r)}if(n.length%3!=0)return null;for(let e=0;e<n.length;e+=3){const t=i[n[e+0]],r=i[n[e+1]],o=i[n[e+2]];(t.x-r.x)*(o.y-r.y)-(o.x-r.x)*(t.y-r.y)>0&&([n[e+1],n[e+2]]=[n[e+2],n[e+1]])}return{vertices:i,indices:n}}function Xy(e,t){for(let i=0;i<e.length;i++)if(e[i].name===t)return i;return-1}function Jy(e){const t=function(e,t){const i=[],n=WebGL2RenderingContext;if(e.json.textures)for(const r of e.json.textures){const o={magFilter:n.LINEAR,minFilter:n.NEAREST,wrapS:n.REPEAT,wrapT:n.REPEAT};void 0!==r.sampler&&Object.assign(o,e.json.samplers[r.sampler]),i.push({image:t[r.source],sampler:o,uploaded:!1})}return i}(e,e.images),i=function(e,t){const i=[];if(!e.json.meshes)return i;for(const n of e.json.meshes){const r=[];for(const i of n.primitives)r.push(Hy(i,e,t));i.push(r)}return i}(e,t),{scenes:n,scene:r,nodes:o}=e.json;let s=n?Xy(n,"Default Scene"):-1;s<0&&(s=r||0);const a=n&&n[s]?n[s].nodes||[]:[...o.keys()],l=[];for(const t of a)l.push(Zy(o[t],e,i));!function(e,t,i){const n={},r=new Set;for(let o=0;o<e.length;o++){const e=i[t[o]];if(!e.extras)continue;const s=e.extras["mapbox:footprint:version"],a=e.extras["mapbox:footprint:id"];(s||a)&&r.add(o),"1.0.0"===s&&a&&(n[a]=o)}for(let o=0;o<e.length;o++){if(r.has(o))continue;const s=e[o],a=i[t[o]];if(!a.extras)continue;let l=null;s.id in n&&(l=Yy(e[n[s.id]].meshes,s.localMatrix)),l||(l=Wy(a)),l&&(s.footprint=qy(l))}if(r.size>0){const t=Array.from(r.values()).sort((e,t)=>
vendor: 6,290 bytes, line 2
2e-t);for(let i=t.length-1;i>=0;i--)e.splice(t[i],1)}}(l,a,e.json.nodes);const c=n?Xy(n,"LOD"):-1;if(c>=0){const t=n[c].nodes,r=new Map;for(const n of t){const t=Zy(o[n],e,i);t.id&&r.set(t.id,t)}for(const e of l)if(e.id){const t=r.get(e.id);t&&t.meshes&&(e.lodMeshes=t.meshes,t.meshBVH&&(e.meshBVH=t.meshBVH))}}return l}function Ky(e){e.heightmap=new Float32Array(4096),e.heightmap.fill(-1);const t=e.vertexArray.float32,i=e.aabb.min[0]-1,n=e.aabb.min[1]-1,r=Sy/(e.aabb.max[0]-i+2),o=Sy/(e.aabb.max[1]-n+2);for(let s=0;s<t.length;s+=3){const a=t[s+2],l=(t[s+0]-i)*r|0,c=(t[s+1]-n)*o|0;a>e.heightmap[c*Sy+l]&&(e.heightmap[c*Sy+l]=a)}}function Qy(e,t,i,n,r){i.reserve(i.length+4*e.length),n.reserve(n.length+10*e.length),r.reserve(r.length+10*e.length);let o=n.length;for(const s of e){const e=Math.min(10,Math.max(4,1.3*s.height))*t,a=[-s.normal[1],s.normal[0],0],l=Math.min(.29,.1*s.width/s.depth),c=s.width-2*s.depth*t*(l+.01),u=U([],s.pos,a,c/2),h=U([],s.pos,a,-c/2),d=[u[0],u[1],u[2]+s.height],f=[h[0],h[1],h[2]+s.height],p=U([],s.normal,a,l);V(p,p,e);const m=U([],s.normal,a,-l);V(m,m,e),F(p,u,p),F(m,h,m),u[2]+=.1,h[2]+=.1,n.emplaceBack(p[0],p[1],p[2]),n.emplaceBack(m[0],m[1],m[2]),n.emplaceBack(u[0],u[1],u[2]),n.emplaceBack(h[0],h[1],h[2]),n.emplaceBack(d[0],d[1],d[2]),n.emplaceBack(f[0],f[1],f[2]),n.emplaceBack(u[0],u[1],u[2]),n.emplaceBack(h[0],h[1],h[2]),n.emplaceBack(p[0],p[1],p[2]),n.emplaceBack(m[0],m[1],m[2]);const _=c/e/2;r.emplaceBack(-_-l,-1,_,.8),r.emplaceBack(_+l,-1,_,.8),r.emplaceBack(-_,0,_,1.3),r.emplaceBack(_,0,_,1.3),r.emplaceBack(_+l,-.8,_,.7),r.emplaceBack(_+l,-.8,_,.7),r.emplaceBack(0,0,_,1.3),r.emplaceBack(0,0,_,1.3),r.emplaceBack(_+l,-1.2,_,.8),r.emplaceBack(_+l,-1.2,_,.8),i.emplaceBack(6+o,4+o,8+o),i.emplaceBack(7+o,9+o,5+o),i.emplaceBack(0+o,1+o,2+o),i.emplaceBack(1+o,3+o,2+o),o+=10}}function ev(e,t,i){const n={};n.indexArray=new hu,n.vertexArray=new Kc,n.colorArray=new ru,n.indexArray.reserveExact(4*e.length),n.vertexArray.reserveExact(10*e.length),n.colorArray.reserveExact(10*e.length),Qy(e,t,n.indexArray,n.vertexArray,n.colorArray),n.featureArray=new su,n.featureArray.reserveExact(n.vertexArray.length);for(let e=0;e<n.vertexArray.length;e++)n.featureArray.emplaceBack(i,2);n.hasFeatureData=!0;const r={defined:!0};r.emissiveFactor=mn.black;const o={};return o.baseColorFactor=mn.white,r.pbrMetallicRoughness=o,n.material=r,n.aabb=new Pf([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),n}Ys(Vy,"ModelBVH");const tv=Uc([{name:"a_pos_3f",components:3,type:"Float32"}]),iv=Uc([{name:"a_normal_3",components:3,type:"Int16"}]),nv=Uc([{name:"a_centroid_3",components:3,type:"Int16"}]),rv=Uc([{name:"a_part_color_emissive",components:2,type:"Uint16"}]),ov=Uc([{name:"a_faux_facade_color_emissive",components:2,type:"Uint16"}]),sv=Uc([{name:"a_faux_facade_data",components:4,type:"Uint16"}]),av=Uc([{name:"a_faux_facade_vertical_range",components:2,type:"Uint16"}]),lv=Uc([{name:"a_bloom_attenuation",components:4,type:"Float32"}]),cv=Uc([{name:"a_flood_light_wall_radius_1i16",components:1,type:"Int16"}]),uv=Uc([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),hv=Uc([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),dv=Uc([{name:"a_flood_light_ground_radius",components:1,type:"Float32"}]),fv=Uc([{name:"a_centroid_pos",components:2,type:"Uint16"}]),pv=Uc([{name:"a_join_normal_inside",components:3,type:"Int16"}]),mv=Uc([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),_v=Uc([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:gv}=uv;function yv(e,t,i,n){const r=[],o=0===n?(e,t,i,n,r,o)=>{e.push(new Pe(o,i+(o-t)/(n-t)*(r-i)))}:(e,t,i,n,r,o)=>{e.push(new Pe(t+(o-i)/(r-i)*(n-t),o))};for(const s of e){const e=[];for(const r of s){if(r.length<=2)continue;const s=[];for(let e=0;e<r.length-1;e++){const a=r[e].x,l=r[e].y,c=r[e+1].x,u=r[e+1].y,h=0===n?a:l,d=0===n?c:u;h<t?d>t&&o(s,a,l,c,u,t):h>i?d<i&&o(s,a,l,c,u,i):s.push(r[e]),d<t&&h>=t&&o(s,a,l,c,u,t),d>i&&h<=i&&o(s,a,l,c,u,i)}let a=r.at(-1);const l=0===n?a.x:a.y;l>=t&&l<=i&&s.push(a),s.length&&(a=s.at(-1),s[0].x===a.x&&s[0].y===a.y||s.push(s[0]),e.push(s))}e.length&&r.push(e)}return r}const vv=[new Pe(0,0),new Pe(Cr,0),new Pe(Cr,Cr),new Pe(0,Cr)];function xv(e,t){const i=[];let n=[];if(!t||e.length<2)return[e];if(2===e.length)return Jh(e[0],e[1],vv)?[e]:[];for(let t=0;t<e.length+2;t++){const r=0===t?e.at(-1):e[(t-1)%e.length],o=e[t%e.length],s=e[(t+1)%e.length],a=Jh(r,o,vv),l=Jh(o,s,vv),c=a||l;c&&n.push(o),c&&l||n.length>0&&(n.length>1&&i.push(n),n=[])}return n.length>1&&i.push(n),i}const bv=Lh.types,wv=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],Tv=["fill-extrusion-flood-light-ground-radius"],Ev=Math.pow(2,13),Sv=Math.pow(2,15)-1,Iv=new Pe(0,1),Av=2147483648,Mv=1073741824;function Cv(e,t,i,n,r,o,s,a){e.emplaceBack((t<<1)+s,(i<<1)+o,(Math.floor(n*Ev)<<1)+r,Math.round(a))}function Dv(e,t,i){e.emplaceBack(t.x*Cr,t.y*Cr,i?1:0)}function Pv(e,t,i,n,r,o){e.emplaceBack(t.x,t.y,(i.x<<1)+n,(i.y<<1)+r,o)}function Rv(e,t,i){const n=16384;e.emplaceBack(t.x,t.y,t.z,i[0]*n,i[1]*n,i[2]*n)}class Lv{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class zv{constructor(){this.data=[]}get length(){return this.data.length}push(e){this.data.push(e)}get(e){return this.data[e]}static serialize(e,t){const i=e.data.length,n=new Uint32Array(4*i),r=[];r.length=i;for(let t=0;t<i;t++){const i=e.data[t],o=4*t;n[o]=i.vertexOffset,n[o+1]=i.vertexCount,n[o+2]=i.indexOffset,n[o+3]=i.indexCount,r[t]=i.ringIndices}return t&&t.add(n.buffer),{scalars:n,rings:r}}static deserialize(e){const{scalars:t,rings:i}=e,n=t.length/4,r=new zv,o=[];o.length=n,r.data=o;for(let e=0;e<n;e++){const n=4*e,o=new Lv;o.vertexOffset=t[n],o.vertexCount=t[n+1],o.indexOffset=t[n+2],o.indexCount=t[n+3],o.ringIndices=i[e],r.data[e]=o}return r}}class Fv{constructor(){this.centroidXY=new Pe(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new Pe
vendor: 26,038 bytes, line 2
2(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new Pe(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0,this.buildingId=0,this.groupCentroidPos=new Pe(0,0)}span(){return new Pe(this.max.x-this.min.x,this.max.y-this.min.y)}}class Ov{constructor(){this.data=[],this.buffer=null}get length(){return this.data.length}push(e){this.data.push(e)}get(e){return this.data[e]}find(e){return this.data.find(e)}[Symbol.iterator](){return this.data[Symbol.iterator]()}static serialize(e,t){const i=e.data.length,n=new Float64Array(15*i);for(let t=0;t<i;t++){const i=e.data[t],r=15*t;n[r]=i.centroidXY.x,n[r+1]=i.centroidXY.y,n[r+2]=i.min.x,n[r+3]=i.min.y,n[r+4]=i.max.x,n[r+5]=i.max.y,n[r+6]=i.groupCentroidPos.x,n[r+7]=i.groupCentroidPos.y,n[r+8]=i.vertexArrayOffset,n[r+9]=i.vertexCount,n[r+10]=i.groundVertexArrayOffset,n[r+11]=i.groundVertexCount,n[r+12]=i.footprintSegLen,n[r+13]=i.height,n[r+14]=i.buildingId}return t&&t.add(n.buffer),{buffer:n}}static deserialize(e){const t=e.buffer,i=t.length/15,n=new Ov;n.buffer=t;const r=[];r.length=i,n.data=r;let o=0;for(let e=0;e<i;e++){const i=15*e,r=new Fv;r.centroidXY=new Pe(t[i],t[i+1]),r.min=new Pe(t[i+2],t[i+3]),r.max=new Pe(t[i+4],t[i+5]),r.groupCentroidPos=new Pe(t[i+6],t[i+7]),r.vertexArrayOffset=t[i+8],r.vertexCount=t[i+9],r.groundVertexArrayOffset=t[i+10],r.groundVertexCount=t[i+11],r.footprintSegLen=t[i+12],r.height=t[i+13],r.buildingId=t[i+14],r.footprintSegIdx=o,o+=r.footprintSegLen,n.data[e]=r}return n}}class kv{constructor(){this.acc=new Pe(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,t){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=t.x,e.min.y=e.max.y=t.y)}appendEdge(e,t,i){this.accCount++,this.acc._add(t);let n=!!this.borders;t.x<e.min.x?(e.min.x=t.x,n=!0):t.x>e.max.x&&(e.max.x=t.x,n=!0),t.y<e.min.y?(e.min.y=t.y,n=!0):t.y>e.max.y&&(e.max.y=t.y,n=!0),((0===t.x||t.x===Cr)&&t.x===i.x)!=((0===t.y||t.y===Cr)&&t.y===i.y)&&this.processBorderOverlap(t,i),n&&this.checkBorderIntersection(t,i)}checkBorderIntersection(e,t){t.x<0!=e.x<0&&this.addBorderIntersection(0,fn(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>Cr!=e.x>Cr&&this.addBorderIntersection(1,fn(t.y,e.y,(Cr-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,fn(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>Cr!=e.y>Cr&&this.addBorderIntersection(3,fn(t.x,e.x,(Cr-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const i=this.borders[e];t<i[0]&&(i[0]=t),t>i[1]&&(i[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const i=0===e.x?0:1;this.addBorderIntersection(i,t.y),this.addBorderIntersection(i,e.y)}else{const i=0===e.y?2:3;this.addBorderIntersection(i,t.x),this.addBorderIntersection(i,e.x)}}centroid(){return 0===this.accCount?new Pe(0,0):new Pe(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce((e,t)=>e+ +(t[0]!==Number.MAX_VALUE),0):0}}function Bv(e,t){const i=e.add(t)._unit(),n=it(e.x*i.x+e.y*i.y,-1,1);var r,o,s;return s=Math.acos(n),Math.min(4,Math.max(-4,Math.tan(s)))/4*Sv*((r=e).x*(o=t).y-r.y*o.x<0?-1:1)}const Nv=[e=>e.x<0,e=>e.x>Cr,e=>e.y<0,e=>e.y>Cr];function Vv(e,t,i,n){const r=[4];if(0===n)return r;i._mult(n);const o=e.sub(i),s=t.sub(i),a=[e,t,o,s];for(let e=0;e<4;e++)for(const t of a)if(Nv[e](t)){r.push(e);break}return r}class Uv{constructor(e){this.groundRadiusArray=null,this.groundRadiusBuffer=null,this.vertexArray=new Xc,this.indexArray=new hu,this.programConfigurations=new _h(e.layers,{zoom:e.zoom,lut:e.lut},e=>Tv.includes(e)),this._segments=new Gu,this.hiddenByLandmarkVertexArray=new Su,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new Gu}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,t,i,n=!1){const r=e.length;if(r>2){let o=Math.max(0,this._segments.get().length-1);const s=this._segments._prepareSegment(4*r,this.vertexArray.length,2*this._segmentToGroundQuads[o].length);let a;o!==this._segments.get().length-1&&(o++,this._segmentToGroundQuads[o]=[],this._segmentToRegionTriCounts[o]=[0,0,0,0,0]);{const t=e[0],i=e[1];a=Bv(t.sub(e[r-1])._perp()._unit(),i.sub(t)._perp()._unit())}for(let l=0;l<r;l++){const c=l===r-1?0:l+1,u=e[l],h=e[c],d=e[c===r-1?0:c+1],f=h.sub(u)._perp()._unit(),p=Bv(f,d.sub(h)._perp()._unit()),m=a,_=p;if(Yv(u,h,t)||n&&Xv(u,t)&&Xv(h,t)){a=p;continue}const g=s.vertexLength;Pv(this.vertexArray,u,h,1,1,m),Pv(this.vertexArray,u,h,1,0,m),Pv(this.vertexArray,u,h,0,1,_),Pv(this.vertexArray,u,h,0,0,_),s.vertexLength+=4;const y=Vv(u,h,f,i);for(const e of y)this._segmentToGroundQuads[o].push({id:g,region:e}),this._segmentToRegionTriCounts[o][e]+=2,s.primitiveLength+=2;a=p}}}prepareBorderSegments(){if(!this.hasData())return;const e=this._segments.get(),t=e.length;for(let e=0;e<t;e++)this._segmentToGroundQuads[e].sort((e,t)=>e.region-t.region);for(let i=0;i<t;i++){const t=this._segmentToGroundQuads[i],n=e[i],r=this._segmentToRegionTriCounts[i];r.reduce((e,t)=>e+t,0);let o=0;for(let e=0;e<=4;e++){const t=r[e];if(0!==t){let i=this.regionSegments[e];i||(i=this.regionSegments[e]=new Gu);const r={vertexOffset:n.vertexOffset,primitiveOffset:n.primitiveOffset+o,vertexLength:n.vertexLength,primitiveLength:t};i.get().push(r)}o+=t}for(let e=0;e<t.length;e++){const i=t[e].id;this.indexArray.emplaceBack(i,i+1,i+3),this.indexArray.emplaceBack(i,i+3,i+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,t,i,n,r,o,s){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,t,i,n,r,o,void 0,s)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,hv.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),null!=this.groundRadiusArray&&(this.groundRadiusBuffer=e.createVertexBuffer(this.groundRadiusArray,dv.members)))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,t,i,n,r,o,s,a){this.hasData()&&this.programConfigurations.updatePaintArrays(e,t,i,n,r,o,s,a)}updateHiddenByLandmark(e){this.updateHiddenByLandmarkRange(e.groundVertexArrayOffset,e.groundVertexCount,!!(e.flags&Av||e.flags&Mv))}updateHiddenByLandmarkRange(e,t,i){if(!this.hasData())return;const n=t+e;if(0!==t){for(let t=e;t<n;++t)this.hiddenByLandmarkVertexArray.emplace(t,i?1:0);this._needsHiddenByLandmarkUpdate=!0}}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,mv.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this.groundRadiusBuffer&&this.groundRadiusBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const t=this.regionSegments[e];t&&t.destroy()}}}}class jv{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.pixelRatio=e.pixelRatio,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=new Ov,this.footprintIndices=new hu,this.footprintVertices=new Gc,this.footprintSegments=new zv,this.layoutVertexArray=new Yc,this.centroidVertexArray=new Ou,this.wallVertexArray=new Bu,this.indexArray=new hu,this.programConfigurations=new _h(e.layers,{zoom:e.zoom,lut:e.lut},e=>wv.includes(e)),this.segments=new Gu,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.groundEffect=new Uv(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[],this.buildingGroups=new Map,this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,i,n){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(e,t,i,n){this.features=[],this.hasPattern=sc("fill-extrusion",this.layers,this.pixelRatio,t),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=Ic(i),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=0!==this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1);for(const{feature:r,id:o,index:s,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,l=Oc(r,e);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),l,i))continue;const c={id:o,sourceLayerIndex:a,index:s,geometry:e?l.geometry:Fc(r,i,n),properties:r.properties,type:r.type,patterns:{}},u=this.layoutVertexArray.length,h="Polygon"===bv[c.type];if(this.hasPattern)this.features.push({featureId:r.id,feature:ac("fill-extrusion",this.layers,c,this.zoom,this.pixelRatio,t)});else if(this.wallMode)for(const e of c.geometry)for(const o of xv(e,h))this.addFeature(r.id,c,[o],s,i,{},t.availableImages,n,t.brightness);else this.addFeature(r.id,c,c.geometry,s,i,{},t.availableImages,n,t.brightness);t.featureIndex.insert(r,c.geometry,s,a,this.index,u)}this._finalizeBuildingGroups(),this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,t,i,n,r,o){for(const{featureId:e,feature:s}of this.features){const a="Polygon"===bv[s.type],{geometry:l}=s;if(this.wallMode)for(const c of l)for(const l of xv(c,a))this.addFeature(e,s,[l],s.index,t,i,n,r,o);else this.addFeature(e,s,l,s.index,t,i,n,r,o)}this._finalizeBuildingGroups(),this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,t,i,n,r,o,s){this.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s,this.worldview),this.groundEffect.update(e,t,r,i,n,o,s,this.worldview)}updateExpressions(e){this.programConfigurations.updateExpressions(e),this.groundEffect.programConfigurations.updateExpressions(e)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,gv),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.wallVertexBuffer=e.createVertexBuffer(this.wallVertexArray,pv.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,_v.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,fv.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,i,n,r,o,s,a,l){const c=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(t,{})/this.tileToMeter,u=[new Pe(0,0),new Pe(Cr,Cr)],h=a.projection,d="globe"===h.name,f=this.wallMode||"Polygon"===bv[t.type],p=new kv;p.centroidDataIndex=this.centroidData.length;const m=new Fv;m.buildingId=e,t.properties&&Object.hasOwn(t.properties,"building_id")&&(m.buildingId=Number(t.properties.building_id)),p.buildingId=m.buildingId;const _=this.layers[0].paint.get("fill-extrusion-base").evaluate(t,{},r)<=0,g=this.layers[0].paint.get("fill-extrusion-height").evaluate(t,{},r);let y;if(m.height=g,m.vertexArrayOffset=this.layoutVertexArray.length,m.groundVertexArrayOffset=this.groundEffect.vertexArray.length,d&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new tu),this.wallMode){if(d)return void gt("Non zero fill-extrusion-line-width is not yet supported on globe.");if(1!==i.length)return;y=function(e){const t=e[0].x===e.at(-1).x&&e[0].y===e.at(-1).y,i=function(e){let t=0;const i=e.length;for(let n=0;n<i;n++)t+=(e[(n+1)%i].x-e[n].x)*(e[(n+1)%i].y+e[n].y);return t>=0}(e);i||(e=e.reverse());const n={geometry:[],joinNormals:[],indices:[]},r=[],o=[],s=[];let a=e.length;for(;a>=2&&e[a-1].equals(e[a-2]);)a--;if(a<(t?3:2))return n;let l,c,u,h,d,f=0;for(;f<a-1&&e[f].equals(e[f+1]);)f++;t&&(l=e[a-2],d=e[f].sub(l)._unit()._perp());for(let i=f;i<a;i++){if(u=i===a-1?t?e[f+1]:void 0:e[i+1],u&&e[i].equals(u))continue;d&&(h=d),l&&(c=l),l=e[i],d=u?u.sub(l)._unit()._perp():h,h=h||d;let n=h.add(d);0===n.x&&0===n.y||n._unit();const p=n.x*d.x+n.y*d.y,m=0!==p?1/p:1/0,_=h.x*d.y-h.y*d.x>0;let g="miter";const y=2;"miter"===g&&m>y&&(g="bevel"),"bevel"===g&&(m>100&&(g="flipbevel"),m<y&&(g="miter"));const v=(e,t,i,n)=>{const a=new Pe(e.x,e.y),l=new Pe(e.x,e.y);a.x+=t.x*n,a.y+=t.y*n,l.x-=t.x*Math.max(i,1),l.y-=t.y*Math.max(i,1),s.push(t),r.push(a),o.push(l)};if("miter"===g)n._mult(m),v(l,n,0,0);else if("flipbevel"===g)n=d.mult(-1),v(l,n,0,0),v(l,n.mult(-1),0,0);else{const e=-Math.sqrt(m*m-1),t=_?e:0,i=_?0:e;c&&v(l,h,t,i),u&&v(l,d,t,i)}}n.geometry=[...r,...o.reverse(),r[0]],n.joinNormals=[...s,...s.reverse(),s.at(-1)];const p=n.geometry.length-1;for(let e=0;e<p/2;e++)if(e+1<p/2){let t=e,i=e+1,r=p-1-e,o=p-2-e;t=0===t?p-1:t-1,i=0===i?p-1:i-1,r=0===r?p-1:r-1,o=0===o?p-1:o-1,n.indices.push(r),n.indices.push(i),n.indices.push(t),n.indices.push(r),n.indices.push(o),n.indices.push(i)}return n}(i[0]),i=[y.geometry]}const v=(e,t)=>e<(t.length-1)/2||e===t.length-1,x=this.wallMode?[i]:Ne(i,500);for(let e=x.length-1;e>=0;e--){const t=x[e];(0===t.length||Jv(t[0]))&&x.splice(e,1)}let b;if(d)b=tx(x,u,r);else{b=[];for(const e of x)b.push({polygon:e,bounds:u})}const w=f?this.edgeRadius:0,T=w>0&&this.zoom<17,E=(e,t)=>{if(0===e.length)return!1;const i=e.at(-1);return t.x===i.x&&t.y===i.y};for(const{polygon:e,bounds:t}of b){let i=0,n=0;for(const t of e)f&&!t[0].equals(t.at(-1))&&t.push(t[0]),n+=f?t.length-1:t.length;const o=this.segments.prepareSegment((f?5:4)*n,this.layoutVertexArray,this.indexArray);m.footprintSegIdx<0&&(m.footprintSegIdx=this.footprintSegments.length),m.polygonSegIdx<0&&(m.polygonSegIdx=this.polygonSegments.length);const s={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},a=new Lv;if(a.vertexOffset=this.footprintVertices.length,a.indexOffset=3*this.footprintIndices.length,a.ringIndices=[],f){const n=[],s=[];i=o.vertexLength;for(let i=0;i<e.length;i++){const l=e[i];l.length&&0!==i&&s.push(n.length/2);const u=[];let f,p;f=l[1].sub(l[0])._perp()._unit(),a.ringIndices.push(l.length-1);for(let e=1;e<l.length;e++){const t=l[e],i=l[e===l.length-1?1:e+1],s=t.clone();if(w){p=$v(t,i,f);const e=Hv(f,p),n=Zv(f,p),r=w*Math.min(4,1/n);s.x+=r*e.x,s.y+=r*e.y,s.x=Math.round(s.x),s.y=Math.round(s.y),f=p}if(!_||0!==w&&!T||E(u,s)||u.push(s),Cv(this.layoutVertexArray,s.x,s.y,0,0,1,1,0),this.wallMode){const t=v(e,l);Dv(this.wallVertexArray,y.joinNormals[e],!t)}o.vertexLength++,this.footprintVertices.emplaceBack(t.x,t.y),n.push(t.x,t.y),d&&Rv(this.layoutVertexExtArray,h.projectTilePoint(s.x,s.y,r),h.upVector(r,s.x,s.y))}_&&(0===w||T)&&(0!==u.length&&E(u,u[0])&&u.pop(),this.groundEffect.addData(u,t,c))}const l=this.wallMode?y.indices:Ll(n,s);for(let e=0;e<l.length;e+=3)this.footprintIndices.emplaceBack(a.vertexOffset+l[e+0],a.vertexOffset+l[e+1],a.vertexOffset+l[e+2]),this.indexArray.emplaceBack(i+l[e],i+l[e+2],i+l[e+1]),o.primitiveLength++;a.indexCount+=l.length,a.vertexCount+=this.footprintVertices.length-a.vertexOffset}for(let n=0;n<e.length;n++){const s=e[n];p.startRing(m,s[0]);let a=s.length>4&&Kv(s[s.length-2],s[0],s[1]),l=w?qv(s[s.length-2],s[0],s[1],w):0;const u=[];let g,x,b;x=s[1].sub(s[0])._perp()._unit();let T=!0;for(let e=1,n=0;e<s.length;e++){let c=s[e-1],f=s[e];const S=s[e===s.length-1?1:e+1];if(p.appendEdge(m,f,c),Yv(f,c,t)){w&&(x=S.sub(f)._perp()._unit(),T=!T);continue}const I=f.sub(c)._perp(),A=I.x/(Math.abs(I.x)+Math.abs(I.y)),M=I.y>0?1:0,C=c.dist(f);if(n+C>32768&&(n=0),w){b=$v(f,S,x);let e=Wv(c,f,S,Zv(x,b),w);isNaN(e)&&(e=0);const t=Gv(c,f,new Pe(0,0));c=c.add(t.mult(l))._round(),f=f.add(t.mult(-e))._round(),l=e,x=b,_&&this.zoom>=17&&(E(u,c)||u.push(c),E(u,f)||u.push(f))}const D=o.vertexLength,P=s.length>4&&Kv(c,f,S);let R=Qv(n,a,T);if(Cv(this.layoutVertexArray,c.x,c.y,A,M,0,0,R),Cv(this.layoutVertexArray,c.x,c.y,A,M,0,1,R),this.wallMode){const t=v(e-1,s),i=y.joinNormals[e-1];Dv(this.wallVertexArray,i,t),Dv(this.wallVertexArray,i,t)}if(n+=C,R=Qv(n,P,!T),a=P,Cv(this.layoutVertexArray,f.x,f.y,A,M,0,0,R),Cv(this.layoutVertexArray,f.x,f.y,A,M,0,1,R),this.wallMode){const t=v(e,s),i=y.joinNormals[e];Dv(this.wallVertexArray,i,t),Dv(this.wallVertexArray,i,t)}if(o.vertexLength+=4,this.indexArray.emplaceBack(D+0,D+1,D+2),this.indexArray.emplaceBack(D+1,D+3,D+2),o.primitiveLength+=2,w){const n=i+(1===e?s.length-2:e-2),r=1===e?i:n+1;if(this.indexArray.emplaceBack(D+1,n,D+3),this.indexArray.emplaceBack(n,r,D+3),o.primitiveLength+=2,void 0===g&&(g=D),!Yv(S,s[e],t)){const t=e===s.length-1?g:o.vertexLength;this.indexArray.emplaceBack(D+2,D+3,t),this.indexArray.emplaceBack(D+3,t+1,t),this.indexArray.emplaceBack(D+3,r,t+1),o.primitiveLength+=3}T=!T}if(d){const e=this.layoutVertexExtArray,t=h.projectTilePoint(c.x,c.y,r),i=h.projectTilePoint(f.x,f.y,r),n=h.upVector(r,c.x,c.y),o=h.upVector(r,f.x,f.y);Rv(e,t,n),Rv(e,t,n),Rv(e,i,o),Rv(e,i,o)}}f&&(i+=s.length-1),_&&w&&this.zoom>=17&&(0!==u.length&&E(u,u[0])&&u.pop(),this.groundEffect.addData(u,t,c,w>0))}this.footprintSegments.push(a),s.triangleCount=this.indexArray.length-s.triangleArrayOffset,this.polygonSegments.push(s),++m.footprintSegLen,++m.polygonSegLen}if(m.vertexCount=this.layoutVertexArray.length-m.vertexArrayOffset,m.groundVertexCount=this.groundEffect.vertexArray.length-m.groundVertexArrayOffset,0!==m.vertexCount){if(m.centroidXY=p.borders?Iv:this.encodeCentroid(p,m),t.properties&&Object.hasOwn(t.properties,"building_id")){const e=m.buildingId;let t=this.buildingGroups.get(e);t||(t={accX:0,accY:0,accCount:0,mergedMin:new Pe(Number.MAX_VALUE,Number.MAX_VALUE),mergedMax:new Pe(-Number.MAX_VALUE,-Number.MAX_VALUE),partIndices:[]},this.buildingGroups.set(e,t)),t.accX+=p.acc.x,t.accY+=p.acc.y,t.accCount+=p.accCount,t.mergedMin.x=Math.min(t.mergedMin.x,m.min.x),t.mergedMin.y=Math.min(t.mergedMin.y,m.min.y),t.mergedMax.x=Math.max(t.mergedMax.x,m.max.x),t.mergedMax.y=Math.max(t.mergedMax.y,m.max.y),t.partIndices.push(this.centroidData.length)}if(this.centroidData.push(m),p.borders){this.featuresOnBorder.push(p);const e=this.featuresOnBorder.length-1;for(let t=0;t<p.borders.length;t++)p.borders[t][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[t].push(e)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,o,s,r,l,void 0,this.worldview),this.groundEffect.addPaintPropertiesData(t,n,o,s,r,l,this.worldview),this.maxHeight=Math.max(this.maxHeight,g)}}_finalizeBuildingGroups(){for(const[,e]of this.buildingGroups){if(0===e.partIndices.length)continue;const t=new kv;t.acc=new Pe(e.accX,e.accY),t.accCount=e.accCount;const i=new Fv;i.min=e.mergedMin,i.max=e.mergedMax;const n=this.encodeCentroid(t,i),r=t.centroid();for(const t of e.partIndices){const i=this.centroidData.get(t);i.centroidXY.x===Iv.x&&i.centroidXY.y===Iv.y||(i.centroidXY=n),i.min=e.mergedMin,i.max=e.mergedMax,i.groupCentroidPos=r}}this.buildingGroups.clear()}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort((t,i)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[i].borders[e][0])}splitToSubtiles(){const e=[];for(let t=0;t<this.centroidData.length;t++){const i=this.centroidData.get(t),n=+(i.min.y+i.max.y>Cr),r=2*n+(+(i.min.x+i.max.x>Cr)^n);for(let n=0;n<i.polygonSegLen;n++){const o=i.polygonSegIdx+n;e.push({centroidIdx:t,subtile:r,polygonSegmentIdx:o,triangleSegmentIdx:this.polygonSegments[o].triangleSegIdx})}}const t=new hu;e.sort((e,t)=>e.triangleSegmentIdx===t.triangleSegmentIdx?e.subtile-t.subtile:e.triangleSegmentIdx-t.triangleSegmentIdx);let i=0,n=0,r=0;for(const t of e){if(t.triangleSegmentIdx!==i)break;r++}const o=e.length;for(;n!==e.length;){i=e[n].triangleSegmentIdx;let s=0,a=n,l=n;for(let t=a;t<r&&e[t].subtile===s;t++)l++;for(;a!==r;){const n=e[a];s=n.subtile;const o=this.centroidData.get(n.centroidIdx).min.clone(),c=this.centroidData.get(n.centroidIdx).max.clone(),u={vertexOffset:this.segments.segments[i].vertexOffset,primitiveOffset:t.length,vertexLength:this.segments.segments[i].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let i=a;i<l;i++){const n=e[i],r=this.polygonSegments[n.polygonSegmentIdx],s=this.centroidData.get(n.centroidIdx).min,a=this.centroidData.get(n.centroidIdx).max,l=this.indexArray.uint16;for(let e=r.triangleArrayOffset;e<r.triangleArrayOffset+r.triangleCount;e++)t.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);u.primitiveLength+=r.triangleCount,o.x=Math.min(o.x,s.x),o.y=Math.min(o.y,s.y),c.x=Math.max(c.x,a.x),c.y=Math.max(c.y,a.y)}u.primitiveLength>0&&this.triangleSubSegments.push({segment:u,min:o,max:c}),a=l;for(let t=a;t<r&&e[t].subtile===e[a].subtile;t++)l++}n=r;for(let t=n;t<o&&e[t].triangleSegmentIdx===e[n].triangleSegmentIdx;t++)r++}t._trim(),this.indexArray=t}getVisibleSegments(e,t,i){const n=new Gu;if(this.wallMode){for(const e of this.triangleSubSegments)n.segments.push(e.segment);return n}let r=0,o=0;const s=1<<e.canonical.z;if(t){const i=t.getMinMaxForTile(e);i&&(r=i.min,o=i.max)}o+=this.maxHeight;const a=e.toUnwrapped();let l;const c=[a.canonical.x/s+a.wrap,a.canonical.y/s],u=[(a.canonical.x+1)/s+a.wrap,(a.canonical.y+1)/s],h=(e,t,i)=>[fn(e[0],t[0],i[0]),fn(e[1],t[1],i[1])],d=[],f=[];for(const e of this.triangleSubSegments){d[0]=e.min.x/Cr,d[1]=e.min.y/Cr,f[0]=e.max.x/Cr,f[1]=e.max.y/Cr;const t=h(c,u,d),s=h(c,u,f);if(0===new Pf([t[0],t[1],r],[s[0],s[1],o]).intersectsPrecise(i)){l&&(n.segments.push(l),l=void 0);continue}const a=e.segment;l&&l.vertexOffset!==a.vertexOffset&&(n.segments.push(l),l=void 0),l?(l.vertexLength+=a.vertexLength,l.primitiveLength+=a.primitiveLength):l={vertexOffset:a.vertexOffset,primitiveLength:a.primitiveLength,vertexLength:a.vertexLength,primitiveOffset:a.primitiveOffset,sortKey:void 0,vaos:{}}}return l&&n.segments.push(l),n}encodeCentroid(e,t){const i=e.centroid(),n=t.span(),r=Math.min(7,Math.round(n.x*this.tileToMeter/10)),o=Math.min(6,Math.round(n.y*this.tileToMeter/10));return new Pe(it(i.x,1,8191)<<3|r,it(i.y,1,8191)<<3|o)}encodeBorderCentroid(e){if(!e.borders)return new Pe(0,0);const t=e.borders,i=Number.MAX_VALUE;if(t[0][0]!==i||t[1][0]!==i){const e=t[0][0]!==i?0:1;return new Pe(6|(t[0][0]!==i?0:65528),(t[e][0]+t[e][1])/2<<3|6)}{const e=t[2][0]!==i?2:3;return new Pe((t[e][0]+t[e][1])/2<<3|6,6|(t[2][0]!==i?0:65528))}}showCentroid(e,t){const i=this.centroidData.get(e.centroidDataIndex);if(i.flags&=Av,"keep"!==t||7&~i.centroidXY.y){if(0!==i.groupCentroidPos.x||0!==i.groupCentroidPos.y){const e=i.span(),t=Math.min(7,Math.round(e.x*this.tileToMeter/10)),n=Math.min(6,Math.round(e.y*this.tileToMeter/10));i.centroidXY=new Pe(it(i.groupCentroidPos.x,1,8191)<<3|t,it(i.groupCentroidPos.y,1,8191)<<3|n)}else i.centroidXY=new Pe(0,0);this.writeCentroidToBuffer(i)}else this.writeCentroidToBuffer(i)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const t=e.vertexArrayOffset,i=e.vertexCount+e.vertexArrayOffset,n=-1073741824&e.flags?Iv:e.centroidXY,r=this.centroidVertexArray.geta_centroid_pos0(t);if(this.centroidVertexArray.geta_centroid_pos1(t)!==n.y||r!==n.x){for(let e=t;e<i;++e)this.centroidVertexArray.emplace(e,n.x,n.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.centroidData)this.writeCentroidToBuffer(e)}updateReplacement(e,t,i){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const n=t.getReplacementRegionsForTile(e.toUnwrapped());if(Bp(this.activeReplacements,n))return;if(this.activeReplacements=n,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(const e of this.centroidData)e.flags&=1073741823;const r=[];for(const t of this.activeReplacements){if(t.order<i)continue;const n=Math.max(1,Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z));if(t.footprint.buildingIds)for(const e of this.centroidData)e.flags&Av||e.flags&Mv||t.min.x>e.max.x||e.min.x>t.max.x||t.min.y>e.max.y||e.min.y>t.max.y||t.footprint.buildingIds.has(e.buildingId)&&(e.flags|=t.clipMask!==Hp.None?-1073741824:Av);else for(const i of this.centroidData)if(!(i.flags&Av||i.flags&Mv||t.min.x>i.max.x||i.min.x>t.max.x||t.min.y>i.max.y||i.min.y>t.max.y))for(let o=0;o<i.footprintSegLen;o++){const s=this.footprintSegments.get(i.footprintSegIdx+o);if(r.length=0,ix(this.footprintVertices,s.vertexOffset,s.vertexCount,t.footprintTileId.canonical,e.canonical,r),Up(t.footprint,r,this.footprintIndices.uint16,s.indexOffset,s.indexCount,-s.vertexOffset,
vendor: 5,856 bytes, line 2
2-n)){i.flags|=t.clipMask!==Hp.None?-1073741824:Av;break}}}for(const e of this.centroidData)this.writeCentroidToBuffer(e);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,t,i){let n=!1;for(let r=0;r<i.footprintSegLen;r++){const o=this.footprintSegments.get(i.footprintSegIdx+r);let s=0;for(const i of o.ringIndices){for(let r=s,a=i+s-1;r<i+s;a=r++){const i=this.footprintVertices.int16[2*(r+o.vertexOffset)+0],s=this.footprintVertices.int16[2*(r+o.vertexOffset)+1],l=this.footprintVertices.int16[2*(a+o.vertexOffset)+1];s>t!=l>t&&e<(this.footprintVertices.int16[2*(a+o.vertexOffset)+0]-i)*(t-s)/(l-s)+i&&(n=!n)}s=i}}return n}getHeightAtTileCoord(e,t){let i=Number.NEGATIVE_INFINITY,n=!0;const r=4*(e+Cr)*Cr+(t+Cr);if(Object.hasOwn(this.partLookup,r)){const e=this.partLookup[r];return e?{height:e.height,hidden:!!(e.flags&Av)}:void 0}const o=this.centroidData.buffer,s=this.centroidData.length;for(let a=0;a<s;a++){const s=15*a;if(e>o[s+4]||o[s+2]>e||t>o[s+5]||o[s+3]>t)continue;const l=o[s+13];if(l<=i)continue;const c=this.centroidData.get(a);this.footprintContainsPoint(e,t,c)&&(i=l,this.partLookup[r]=c,n=!!(c.flags&Av))}if(i!==Number.NEGATIVE_INFINITY)return{height:i,hidden:n};this.partLookup[r]=void 0}}function Gv(e,t,i){return e.equals(t)?i:t.sub(e)._unit()}function $v(e,t,i){return e.equals(t)?i:t.sub(e)._perp()._unit()}function Hv(e,t){const i=e.add(t),n=i.mag();return 0===n?e:i.div(n)}function Zv(e,t){const i=Hv(e,t);return e.x*i.x+e.y*i.y}function qv(e,t,i,n){let r,o;return e.equals(t)?(o=$v(t,i,new Pe(0,0)),r=o):(r=t.sub(e)._perp()._unit(),o=$v(t,i,r)),Wv(e,t,i,Zv(r,o),n)}function Wv(e,t,i,n,r){const o=Math.sqrt(1-n*n);return Math.min(e.dist(t)/3,t.dist(i)/3,r*o/n)}function Yv(e,t,i){return e.x<i[0].x&&t.x<i[0].x||e.x>i[1].x&&t.x>i[1].x||e.y<i[0].y&&t.y<i[0].y||e.y>i[1].y&&t.y>i[1].y}function Xv(e,t){return e.x<t[0].x||e.x>t[1].x||e.y<t[0].y||e.y>t[1].y}function Jv(e){return e.every(e=>e.x<=0)||e.every(e=>e.x>=Cr)||e.every(e=>e.y<=0)||e.every(e=>e.y>=Cr)}function Kv(e,t,i){if(e.x<0||e.x>=Cr||t.x<0||t.x>=Cr||i.x<0||i.x>=Cr)return!1;const n=i.sub(t),r=n.perp(),o=e.sub(t);return(n.x*o.x+n.y*o.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(o.x*o.x+o.y*o.y))>-.866&&r.x*o.x+r.y*o.y<0}function Qv(e,t,i){const n=t?2|e:-3&e;return i?1|n:-2&n}function ex(){const e=Math.PI/32,t=Math.tan(e),i=mc;return i*Math.sqrt(1+2*t*t)-i}function tx(e,t,i){const n=1<<i.z,r=pr(i.x/n),o=pr((i.x+1)/n),s=mr(i.y/n),a=mr((i.y+1)/n);return function(e,t,i,n,r=0,o){const s=[];if(!e.length||!i||!n)return s;const a=(e,t)=>{for(const i of e)s.push({polygon:i,bounds:t})},l=Math.ceil(Math.log2(i)),c=Math.ceil(Math.log2(n)),u=l-c,h=[];for(let e=0;e<Math.abs(u);e++)h.push(u>0?0:1);for(let e=0;e<Math.min(l,c);e++)h.push(0),h.push(1);let d=e;if(d=yv(d,t[0].y-r,t[1].y+r,1),d=yv(d,t[0].x-r,t[1].x+r,0),!d.length)return s;const f=[];for(h.length?f.push({polygons:d,bounds:t,depth:0}):a(d,t);f.length;){const e=f.pop(),t=e.depth,i=h[t],n=e.bounds[0],s=e.bounds[1],l=0===i?n.x:n.y,c=0===i?s.x:s.y,u=o?o(i,l,c):.5*(l+c),d=yv(e.polygons,l-r,u+r,i),p=yv(e.polygons,u-r,c+r,i);if(d.length){const e=[n,new Pe(0===i?u:s.x,1===i?u:s.y)];h.length>t+1?f.push({polygons:d,bounds:e,depth:t+1}):a(d,e)}if(p.length){const e=[new Pe(0===i?u:n.x,1===i?u:n.y),s];h.length>t+1?f.push({polygons:p,bounds:e,depth:t+1}):a(p,e)}}return s}(e,t,Math.ceil((o-r)/11.25),Math.ceil((s-a)/11.25),1,(e,t,r)=>{if(0===e)return.5*(t+r);{const e=mr((i.y+t/Cr)/n);return(fr(.5*(mr((i.y+r/Cr)/n)+e))*n-i.y)*Cr}})}function ix(e,t,i,n,r,o){const s=Math.pow(2,n.z-r.z);for(let a=0;a<i;a++){let i=e.int16[2*(a+t)+0],l=e.int16[2*(a+t)+1];i=(i+r.x*Cr)*s-n.x*Cr,l=(l+r.y*Cr)*s-n.y*Cr,o.push(new Pe(i,l))}}Ys(jv,"FillExtrusionBucket",{omit:["layers","features"]}),Ys(Fv,"PartData"),Ys(Ov,"PartDataArray"),Ys(zv,"FootprintSegmentArray"),Ys(kv,"BorderCentroidData"),Ys(Uv,"GroundEffect");const nx=4096;class rx{constructor(e){this.module=e,this.memoryStack=this.module.malloc(nx),this.memoryStackNextFree=this.memoryStack}createIntArray(e){const t=this.memoryStackNextFree;return this.memoryStackNextFree+=e.length*Int32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>nx?-1:(new Int32Array(this.module.heap32.buffer,t,e.length).set(e),t)}createFloatArray(e){const t=this.memoryStackNextFree;return this.memoryStackNextFree+=e.length*Float32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>nx?-1:(new Float32Array(this.module.heapF32.buffer,t,e.length).set(e),t)}readStringBuffer(e){let t="";for(;0!==this.module.heapU8[e];)t+=String.fromCharCode(this.module.heapU8[e]),++e;return t}setStyle(e){const t=e.normalScale;this.module.setStyle(t[0],t[1],t[2],e.tileToMeters)}setAOOptions(e,t){this.module.setAOOptions(e?1:0,t)}setMetricOptions(e,t){this.module.setMetricOptions(e?1:0,t)}setStructuralOptions(e){this.module.setStructuralOptions(e?1:0)}setFacadeOptions(e,t){this.module.setFacadeOptions(e,t?1:0)}setFauxFacadeOptions(e,t,i){this.module.setFauxFacadeOptions(e?1:0,t?1:0,i)}setFacadeClassifierOptions(e){this.module.setFacadeClassifierOptions(e)}generateMesh(e,t){this.memoryStackNextFree=this.memoryStack;for(const t of e){const e=this.createIntArray(t.ringIndices),i=this.createFloatArray(t.coordinates);if(-1===e||-1===i)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFeature(t.id,t.sourceId,t.minHeight,t.height,t.roofType,i,e,t.ringIndices.length-1)}for(const e of t){let t;t=e.entrances?JSON.parse(e.entrances):[];const i=this.createFloatArray(t),n=this.createFloatArray(e.coordinates);if(-1===i||-1===n)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFacade(e.sourceId,e.crossPerc,e.distanceToRoad,i,t.length,n,e.coordinates.length)}if(!this.module.generateMesh()){const e=this.module.getLastError();return this.readStringBuffer(e)}
vendor: 21,424 bytes, line 2
2const i=this.module.getMeshCount(),n=new Array(i);for(let e=0;e<i;e++){const t=this.module.getPositionsPtr(e),i=this.module.getPositionsLength(e),r=new Float32Array(this.module.heapF32.buffer,t,i),o=this.module.getNormalsPtr(e),s=this.module.getNormalsLength(e),a=new Float32Array(this.module.heapF32.buffer,o,s),l=this.module.getAOPtr(e),c=this.module.getAOLength(e),u=new Float32Array(this.module.heapF32.buffer,l,c),h=this.module.getUVPtr(e),d=this.module.getUVLength(e),f=new Float32Array(this.module.heapF32.buffer,h,d),p=this.module.getFauxFacadePtr(e),m=this.module.getFauxFacadeLength(e),_=new Uint8Array(this.module.heapU8.buffer,p,m),g=this.module.getIndicesPtr(e),y=this.module.getIndicesLength(e),v=new Int16Array(this.module.heap16.buffer,g,y),x=this.module.getBuildingPart(e);n[e]={positions:r,normals:a,ao:u,uv:f,isFauxFacade:_,indices:v,buildingPart:x}}const r=this.module.getRingCount(),o=[];for(let e=0;e<r;e++){const t=this.module.getRingPtr(e),i=this.module.getRingLength(e),n=new Float32Array(this.module.heapF32.buffer,t,i);o.push(n)}return{meshes:n,outerRingLength:this.module.getOuterRingLength(),modifiedPolygonRings:o}}}const ox=Lh.types,sx=32767;function ax(e,t){const i=Cr+t;for(const n of e)for(const e of n)if(e.x<-t||e.x>i||e.y<-t||e.y>i)return!1;return!0}function lx(e){switch(e){case"flat":return 3;case"hipped":return 1;case"gabled":return 2;case"parapet":return 0;case"mansard":return 4;case"skillion":return 5;case"pyramidal":return 6;default:throw new Error(`Unknown roof shape: ${e}`)}}let cx,ux,hx=null,dx=null,fx=null;class px{constructor(){this.layoutVertexArray=new Kc,this.layoutAttenuationArray=new ru,this.layoutColorArray=new su,this.indexArray=new hu,this.indexArrayForConflation=new hu,this.segmentsBucket=new Gu}}class mx{constructor(e){this.layoutFacadePaintArray=null,this.layoutFacadeDataArray=null,this.layoutFacadeVerticalRangeArray=null,this.segmentsBucket=new Gu,this.entranceBloom=new px;const t=66560;this.layoutVertexArray=new Kc,this.layoutVertexArray.reserve(t),this.layoutNormalArray=new $c,this.layoutNormalArray.reserve(t),this.layoutCentroidArray=new $c,this.layoutCentroidArray.reserve(t),this.layoutColorArray=new su,this.layoutColorArray.reserve(t),this.layoutFloodLightDataArray=new Eu,this.layoutFloodLightDataArray.reserve(t),this.layoutAOArray=new Su,this.layoutAOArray.reserve(t),this.indexArray=new hu,this.indexArray.reserve(66560),this.indexArrayForConflation=new hu,this.segmentsBucket=new Gu,this.entranceBloom=new px,e&&(this.layoutFacadePaintArray=new su,this.layoutFacadeDataArray=new eu,this.layoutFacadeVerticalRangeArray=new su)}reserve(e,t,i){this.layoutVertexArray.reserveForAdditional(e),this.layoutCentroidArray.reserveForAdditional(e),this.layoutFloodLightDataArray.reserveForAdditional(e),this.layoutNormalArray.reserveForAdditional(e),this.layoutAOArray.reserveForAdditional(e),this.layoutColorArray.reserveForAdditional(e),this.indexArray.reserveForAdditional(t),i&&(this.layoutFacadePaintArray.reserveForAdditional(e),this.layoutFacadeDataArray.reserveForAdditional(e),this.layoutFacadeVerticalRangeArray.reserveForAdditional(e))}}class _x{constructor(e){this.requiresHDRuntime=!0,this.colorBufferUploaded=!1,this.maxHeight=0,this.replacementUpdateTime=0,this.activeReplacements=[],this.footprints=[],this.footprintsVertices=new vu,this.footprintsIndices=new bu,this.footprintsMin=new Pe(1/0,1/0),this.footprintsMax=new Pe(-1/0,-1/0),this.featuresOnBorder=[],this.buildingWithoutFacade=new mx(!1),this.buildingWithFacade=new mx(!0),this.indexArrayForConflationUploaded=!1,this.featureFootprintLookup=new Map,this.buildingIds=new Set,this.footprintLookup={},this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.worldview=e.worldview,this.lut=e.lut,this.programConfigurations=new _h(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.projection=e.projection,this.groundEffect=new Uv(e),this.groundEffect.groundRadiusArray=new Zc,this.hasAppearances=null}updateFootprints(e,t){const i=new ry([],[],1),n={vertices:[],indices:new Uint32Array(0),grid:i,min:this.footprintsMin,max:this.footprintsMax,buildingIds:this.buildingIds};t.push({footprint:n,id:e})}updateAppearances(e,t,i,n){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(e,t,i,n){if(!fx)return;const r=Ic(i);this.tileToMeter=r,this.brightness=t.brightness,fx.setStyle({normalScale:[1,-1,r],tileToMeters:r}),fx.setAOOptions(!1,.3),fx.setMetricOptions(!1,16),fx.setStructuralOptions(!0),fx.setFacadeClassifierOptions(3);const o=new Map,s=new Map;let a=0;for(const{feature:t}of e){if("LineString"!==ox[t.type]){o.set(t.id,t.properties.source_id);continue}const e=this.layers[0]._featureFilter.needGeometry;if(e&&!this.layers[0]._featureFilter.filter(new Ha(this.zoom),t,i))continue;const r=Oc(t,e);if(!e&&!this.layers[0]._featureFilter.filter(new Ha(this.zoom),r,i))continue;const l=e?r.geometry:Fc(t,i,n),c=[];for(const e of l)for(const t of e)c.push(t.x),c.push(t.y);const u={coordinates:c,crossPerc:t.properties.cross_perc,distanceToRoad:t.properties.distance_to_road,entrances:t.properties.entrances,sourceId:0},h=t.properties.source_id;let d=s.get(h);d||(d=[],s.set(h,d)),d.push(u),++a}this.maxHeight=0;const l=new Array,c=new Set,u=e=>{null!=e&&c.add(e)},h=(e,t)=>{null!=e&&l.push({buildingId:e,footprintIndex:t})},d=64*(e.length-a),f=d/2;this.buildingWithFacade.reserve(d,f,!0),this.buildingWithoutFacade.reserve(2*d,2*f,!1),this.footprintsIndices.reserve(16*(e.length-a)),this.footprintsVertices.reserve(8*(e.length-a));for(const{feature:a,id:l,index:d,sourceLayerIndex:f}of e){if("LineString"===ox[a.type])continue;const e=this.layers[0]._featureFilter.needGeometry;if(e&&!this.layers[0]._featureFilter.filter(new Ha(this.zoom),a,i))continue;let p=null;if(a.properties&&Object.hasOwn(a.properties,"building_id")&&(p=Number(a.properties.building_id),c.has(p)))continue;const m=Oc(a,e);if(!e&&!this.layers[0]._featureFilter.filter(new Ha(this.zoom),m,i))continue;const _=e?m.geometry:Fc(a,i,n),g=Ne(_,500);let y=!1;for(const e of g)if(1!==e.length){y=!0;break}if(y){u(p);continue}if(!ax(_,163)){u(p);continue}const v=this.layers[0],x=lx(v.layout.get("building-roof-shape").evaluate(a,{},i)),b=v.layout.get("building-base").evaluate(a,{},i),w=v.layout.get("building-height").evaluate(a,{},i),T=v.layout.get("building-flood-light-ground-radius").evaluate(a,{},i),E=v.paint.get("building-ambient-occlusion-intensity"),S=T/this.tileToMeter;a.properties["building-part"]="roof";const I=v.paint.get("building-color").evaluate(a,{},this.canonical).toPremultipliedRenderColor(this.lut),A=v.paint.get("building-emissive-strength").evaluate(a,{},this.canonical);a.properties["building-part"]="wall";const M=v.paint.get("building-color").evaluate(a,{},this.canonical).toPremultipliedRenderColor(this.lut),C=v.paint.get("building-emissive-strength").evaluate(a,{},this.canonical);a.properties["building-part"]="window";const D=v.paint.get("building-color").evaluate(a,{},this.canonical).toPremultipliedRenderColor(this.lut),P=v.paint.get("building-emissive-strength").evaluate(a,{},this.canonical);a.properties["building-part"]="door";const R=v.paint.get("building-color").evaluate(a,{},this.canonical).toPremultipliedRenderColor(this.lut),L=v.paint.get("building-emissive-strength").evaluate(a,{},this.canonical);let z=v.layout.get("building-flood-light-wall-radius").evaluate(a,{},i);z=it(z,0,2048);const F=z/2048*sx,O=o.get(l),k=s.get(O)||[],B=0!==k.length&&v.layout.get("building-facade").evaluate(a,{},i);fx.setFacadeOptions(4,!0),fx.setFauxFacadeOptions(B,!1,1);let N=0,V=0,U=0,j=0,G=0,$=0,H=0,Z=0,q=0,W=0,Y=0;if(B){let e=Math.round(v.layout.get("building-facade-floors").evaluate(a,{},i));if(0===b){e=Math.max(1,e-(k.length>0?1:0));let t=4;if(w>100){const e=[10,13,15];t=e[a.id?a.id%e.length:0]}else w<=10&&(t=3);fx.setFacadeOptions(t,!0),G=(w<15?1.3:1.61803)*t/r}else G=b/r;$=w/r,G=Math.min(G,$),U=v.layout.get("building-facade-unit-width").evaluate(a,{},i)/r,j=($-G)/e,fx.setFauxFacadeOptions(!0,!0,U);const t=v.layout.get("building-facade-window").evaluate(a,{},i);N=t[0],V=t[1],H=Math.floor(65535*Math.min(1,G/Cr)),Z=Math.floor(65535*Math.min(1,$/Cr)),q=Math.floor(255*N)<<8|Math.floor(255*V),W=Math.floor(65535*Math.min(1,U/Cr)),Y=Math.floor(65535*Math.min(1,j/Cr))}const X=Array(g.length),J={x:1/0,y:1/0},K={x:-1/0,y:-1/0},Q={x:0,y:0};let ee=0;for(let e=0;e<g.length;e++){const t=g[e];if(t.length>0){const i=[],n=Array(t.length+1);n[0]=0;for(let e=0;e<t.length;e++){const r=t[e];for(let e=0;e<r.length;e++){const t=r[r.length-e-1];J.x=Math.min(J.x,t.x),J.y=Math.min(J.y,t.y),K.x=Math.max(K.x,t.x),K.y=Math.max(K.y,t.y),Q.x+=t.x,Q.y+=t.y,ee++,i.push(t.x),i.push(t.y)}n[e+1]=i.length}X[e]={id:a.id?a.id:0,height:w,minHeight:b,sourceId:0,roofType:x,coordinates:i,ringIndices:n}}}Q.x/=ee||1,Q.y/=ee||1;const te=fx.generateMesh(X,k);if("string"==typeof te){gt(`Unable to generate building ${a.id}: ${te}`),u(p);continue}if(0===te.meshes.length||0===te.modifiedPolygonRings.length){u(p);continue}const ie=B?this.buildingWithFacade:this.buildingWithoutFacade;let ne=0;for(const e of te.meshes)ne+=e.positions.length/3;const re=ie.segmentsBucket.prepareSegment(ne,ie.layoutVertexArray,ie.indexArray),oe=[];let se=null,ae=0,le=-1;const ce=ie.layoutVertexArray.length,ue=ce+ne;ie.layoutVertexArray.resize(ue),ie.layoutCentroidArray.resize(ue),ie.layoutNormalArray.resize(ue),ie.layoutAOArray.resize(ue),ie.layoutColorArray.resize(ue),ie.layoutFloodLightDataArray.resize(ue),B&&(ie.layoutFacadePaintArray.resize(ue),ie.layoutFacadeDataArray.resize(ue),ie.layoutFacadeVerticalRangeArray.resize(ue));const he=ie.indexArray.length;let de=0,fe=ce;for(const e of te.meshes){let t,i;if(1===e.buildingPart)t=I,i=A;else if(0===e.buildingPart)t=M,i=C;else if(2===e.buildingPart)t=D,i=P;else{if(3!==e.buildingPart)continue;t=R,i=L}if(i=it(i,0,1),3===e.buildingPart){const t=new Array;for(let i=0;i<e.positions.length;i+=12){const n=e.positions[i+0],r=e.positions[i+1],o=e.positions[i+3],s=e.positions[i+4],a=e.positions[i+2],l=e.positions[i+8]-a,c=1,u=o-n,h=s-r,d=Math.hypot(u,h);t.push({pos:[n+.5*u,r+.5*h,a],normal:[h/d,-u/d,0],width:d,height:l,depth:c,points:[n,r,o,s]})}const i=ie.entranceBloom.segmentsBucket.prepareSegment(10*t.length,ie.entranceBloom.layoutVertexArray,ie.entranceBloom.indexArray),n=ie.entranceBloom.layoutVertexArray.length;ae=ie.entranceBloom.indexArray.length,Qy(t,.5/this.tileToMeter,ie.entranceBloom.indexArray,ie.entranceBloom.layoutVertexArray,ie.entranceBloom.layoutAttenuationArray);const r=ie.entranceBloom.layoutVertexArray.length-n;le=ie.entranceBloom.indexArray.length-ae;for(let e=0;e<r;e++)ie.entranceBloom.layoutColorArray.emplaceBack(255*R.r<<8|255*R.g,255*R.b<<8|51*L);i.vertexLength+=r,i.primitiveLength+=le,se={part:e.buildingPart,vertexOffset:n,vertexLength:r}}ie.layoutVertexArray.float32.set(e.positions,3*fe);const n=e.positions.length/3;for(let r=0;r<n;++r){const n=3*r;de=Math.max(de,e.positions[n+2]);const o=e.normals[n+1]*sx,s=e.normals[n+2]*sx,a=3*(fe+r);ie.layoutNormalArray.int16[a]=e.normals[n]*sx,ie.layoutNormalArray.int16[a+1]=o,ie.layoutNormalArray.int16[a+2]=s;const l=e.ao[r];ie.layoutAOArray.uint8[fe+r]=255*l;const c=1+(l-1)*E,u=255*t.b*c<<8|255*i;ie.layoutColorArray.uint16[2*(fe+r)]=255*t.r*c<<8|255*t.g*c,ie.layoutColorArray.uint16[2*(fe+r)+1]=u}const r=Math.min(8191,Math.max(0,Math.floor(Q.x))),o=Math.min(8191,Math.max(0,Math.floor(Q.y))),s=Math.floor(w),a=20,l=4*r+Math.min(3,Math.round((K.x-J.x)*this.tileToMeter/a)),c=4*o+Math.min(3,Math.round((K.y-J.y)*this.tileToMeter/a));for(let e=0;e<n;++e){const t=3*(fe+e);ie.layoutCentroidArray.int16[t]=l,ie.layoutCentroidArray.int16[t+1]=c,ie.layoutCentroidArray.int16[t+2]=s}if(ie.layoutFloodLightDataArray.int16.fill(0===e.buildingPart?F:0,fe,fe+n),B){const t=255*D.r<<8|255*D.g,i=255*D.b<<8|255*P;for(let e=0;e<n;++e){const n=2*(fe+e);ie.layoutFacadePaintArray.uint16[n]=t,ie.layoutFacadePaintArray.uint16[n+1]=i}for(let t=0;t<n;++t)if(e.isFauxFacade[t]){const i=Math.min(65535,Math.floor(e.uv[2*t]*te.outerRingLength));ie.layoutFacadeDataArray.emplace(fe+t,1|i,q,W,Y),ie.layoutFacadeVerticalRangeArray.emplace(fe+t,H,Z)}else ie.layoutFacadeDataArray.emplace(fe+t,0,0,0,0),ie.layoutFacadeVerticalRangeArray.emplace(fe+t,0,0)}const u=re.vertexLength,h=e.indices.length/3,d=ie.indexArray.length;ie.indexArray.resize(d+h);for(let t=0;t<h;++t){const i=3*t,n=3*d+i;ie.indexArray.uint16[n]=u+e.indices[i],ie.indexArray.uint16[n+1]=u+e.indices[i+1],ie.indexArray.uint16[n+2]=u+e.indices[i+2]}1!==e.buildingPart&&0!==e.buildingPart&&2!==e.buildingPart&&3!==e.buildingPart||oe.push({part:e.buildingPart,vertexOffset:fe,vertexLength:e.positions.length/3}),fe+=n,re.vertexLength+=n,re.primitiveLength+=e.indices.length/3}this.maxHeight=Math.max(this.maxHeight,de);const pe=ie.indexArray.length-he,me=this.footprintsIndices.length,_e=this.footprintsVertices.length,ge=[],ye=new Pe(1/0,1/0),ve=new Pe(-1/0,-1/0),xe=b<=0,be=this.groundEffect.vertexArray.length;for(const e of te.modifiedPolygonRings){const t=[],i=new Pe(1/0,1/0),n=new Pe(-1/0,-1/0);for(let r=0;r<e.length;r+=2){const o=e.length-r-2;i.x=Math.min(i.x,e[o]),i.y=Math.min(i.y,e[o+1]),n.x=Math.max(n.x,e[o]),n.y=Math.max(n.y,e[o+1]);const s=new Pe(e[o],e[o+1]);xe&&t.push(s),ge.push(s.x,s.y),this.footprintsVertices.emplaceBack(s.x,s.y)}ye.x=Math.min(ye.x,i.x),ye.y=Math.min(ye.y,i.y),ve.x=Math.max(ve.x,n.x),ve.y=Math.max(ve.y,n.y),xe&&this.groundEffect.addData(t,[i,n],S)}const we=this.groundEffect.vertexArray.length-be;this.groundEffect.groundRadiusArray.reserveForAdditional(we);for(let e=0;e<we;e++)this.groundEffect.groundRadiusArray.emplaceBack(T);(J.x<0||K.x>Cr||J.y<0||K.y>Cr)&&this.featuresOnBorder.push({featureId:a.id,footprintIndex:this.footprints.length});{const e=Ll(ge,null,2);this.footprintsIndices.resize(this.footprintsIndices.length+e.length),this.footprintsIndices.uint16.set(e,me),this.buildingIds.add(p??a.id),this.footprintsMin.x=Math.min(this.footprintsMin.x,ye.x),this.footprintsMin.y=Math.min(this.footprintsMin.y,ye.y),this.footprintsMax.x=Math.max(this.footprintsMax.x,ve.x),this.footprintsMax.y=Math.max(this.footprintsMax.y,ve.y);const t={footprintVertexOffset:_e,footprintVertexLength:this.footprintsVertices.length-_e,footprintIndexOffset:me,footprintIndexLength:this.footprintsIndices.length-me,min:ye,max:ve,hiddenFlags:0,indicesOffset:he,indicesLength:pe,bloomIndicesOffset:ae,bloomIndicesLength:le,groundEffectVertexOffset:be,groundEffectVertexLength:we,hasFauxFacade:B,height:de,promoteId:l,feature:m,parts:oe,buildingBloom:se},i=this.footprints.length;void 0!==a.id&&this.featureFootprintLookup.set(a.id,i),h(p,i),this.footprints.push(t)}this.programConfigurations.populatePaintArrays(ie.layoutVertexArray.length,a,d,{},t.availableImages,i,t.brightness),this.groundEffect.addPaintPropertiesData(a,d,{},t.availableImages,i,t.brightness),t.featureIndex.insert(a,_,d,f,this.index,ce)}l.forEach(({buildingId:e,footprintIndex:t})=>{c.has(e)&&(this.footprints[t].hiddenFlags|=4)});const p=new Set;this.buildingIds.forEach((e,t,i)=>{c.has(e)||p.add(e)}),this.buildingIds=p,this.groundEffect.prepareBorderSegments()}update(e,t,i,n,r,o,s){this.programConfigurations.updatePaintArrays(e,t,r,i,n,o,s),this.groundEffect.update(e,t,r,i,n,o,s),this.evaluate(this.layers[0],e),this.colorBufferUploaded=!1}updateExpressions(e){this.programConfigurations.updateExpressions(e),this.groundEffect.programConfigurations.updateExpressions(e)}isEmpty(){return 0===this.buildingWithoutFacade.layoutVertexArray.length&&0===this.buildingWithFacade.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){const t=t=>{t.layoutVertexBuffer=e.createVertexBuffer(t.layoutVertexArray,tv.members),t.layoutNormalBuffer=e.createVertexBuffer(t.layoutNormalArray,iv.members),t.layoutCentroidBuffer=e.createVertexBuffer(t.layoutCentroidArray,nv.members),t.layoutFloodLightDataBuffer=e.createVertexBuffer(t.layoutFloodLightDataArray,cv.members),t.layoutFacadeDataArray&&t.layoutFacadeDataArray.length&&(t.layoutFacadeDataBuffer=e.createVertexBuffer(t.layoutFacadeDataArray,sv.members)),t.layoutFacadeVerticalRangeArray&&t.layoutFacadeVerticalRangeArray.length&&(t.layoutFacadeVerticalRangeBuffer=e.createVertexBuffer(t.layoutFacadeVerticalRangeArray,av.members)),t.entranceBloom.layoutVertexArray.length&&(t.entranceBloom.layoutVertexBuffer=e.createVertexBuffer(t.entranceBloom.layoutVertexArray,tv.members),t.entranceBloom.layoutAttenuationBuffer=e.createVertexBuffer(t.entranceBloom.layoutAttenuationArray,lv.members)),this.uploadUpdatedColorBuffer(e),this.uploadUpdatedIndexBuffer(e)};this.uploaded||(t(this.buildingWithoutFacade),t(this.buildingWithFacade),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){const e=e=>{e.layoutVertexBuffer&&(e.layoutVertexBuffer.destroy(),e.layoutNormalBuffer.destroy(),e.layoutColorBuffer.destroy(),e.segmentsBucket.destroy(),e.indexBuffer&&e.indexBuffer.destroy(),e.entranceBloom.layoutVertexBuffer&&(e.entranceBloom.layoutVertexBuffer.destroy(),e.entranceBloom.layoutColorBuffer.destroy(),e.entranceBloom.layoutAttenuationBuffer.destroy(),e.entranceBloom.indexBuffer.destroy(),e.entranceBloom.segmentsBucket.destroy()))};e(this.buildingWithoutFacade),e(this.buildingWithFacade),this.groundEffect.destroy(),this.programConfigurations.destroy()}updateFootprintHiddenFlags(e,t,i=!0){let n=!1;const r=i?t:0,o=0|(i?-1:~t);0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const t of e){const e=this.footprints[t],i=e.hiddenFlags&o|r;e.hiddenFlags!==i&&(e.hiddenFlags=i,n=!0,this.groundEffect.updateHiddenByLandmarkRange(e.groundEffectVertexOffset,e.groundEffectVertexLength,0!==e.hiddenFlags))}return n&&(this.indexArrayForConflationUploaded=!1),n}uploadUpdatedIndexBuffer(e){if(this.groundEffect.uploadHiddenByLandmark(e),this.indexArrayForConflationUploaded)return;const t=e=>{0!==e.indexArray.length&&(e.indexArrayForConflation.resize(e.indexArray.length),e.indexArrayForConflation.uint16.set(e.indexArray.uint16),e.entranceBloom.indexArrayForConflation.resize(e.entranceBloom.indexArray.length),e.entranceBloom.indexArrayForConflation.uint16.set(e.entranceBloom.indexArray.uint16))};t(this.buildingWithoutFacade),t(this.buildingWithFacade);for(const e of this.footprints){const t=e.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade,i=e.indicesOffset+e.indicesLength;if(0!==e.hiddenFlags){for(let n=e.indicesOffset;n<i;n++)t.indexArrayForConflation.uint16[3*n+0]=0,t.indexArrayForConflation.uint16[3*n+1]=0,t.indexArrayForConflation.uint16[3*n+2]=0;const n=e.bloomIndicesOffset+e.bloomIndicesLength;for(let i=e.bloomIndicesOffset;i<n;i++)t.entranceBloom.indexArrayForConflation.uint16[3*i+0]=0,t.entranceBloom.indexArrayForConflation.uint16[3*i+1]=0,t.entranceBloom.indexArrayForConflation.uint16[3*i+2]=0}}const i=t=>{0!==t.indexArray.length&&(t.indexBuffer?t.indexBuffer.updateData(t.indexArrayForConflation):t.indexBuffer=e.createIndexBuffer(t.indexArrayForConflation,!0),t.entranceBloom.indexBuffer?t.entranceBloom.indexBuffer.updateData(t.entranceBloom.indexArrayForConflation):t.entranceBloom.indexBuffer=e.createIndexBuffer(t.entranceBloom.indexArrayForConflation,!0))};i(this.buildingWithoutFacade),i(this.buildingWithFacade),this.indexArrayForConflationUploaded=!0}uploadUpdatedColorBuffer(e){const t=t=>{t.layoutColorBuffer?t.layoutColorBuffer.updateData(t.layoutColorArray):t.layoutColorBuffer=e.createVertexBuffer(t.layoutColorArray,rv.members,!0),t.layoutFacadePaintArray&&(t.layoutFacadePaintBuffer?t.layoutFacadePaintBuffer.updateData(t.layoutFacadePaintArray):t.layoutFacadePaintBuffer=e.createVertexBuffer(t.layoutFacadePaintArray,ov.members,!0)),t.entranceBloom.layoutColorBuffer?t.entranceBloom.layoutColorBuffer.updateData(t.entranceBloom.layoutColorArray):t.entranceBloom.layoutColorBuffer=e.createVertexBuffer(t.entranceBloom.layoutColorArray,rv.members,!0)};t(this.buildingWithoutFacade),t(this.buildingWithFacade),this.colorBufferUploaded=!0}evaluate(e,t){const i=e.paint.get("building-ambient-occlusion-intensity");for(const n of this.footprints){if(4&n.hiddenFlags)continue;const r=t[n.promoteId],o=n.feature;o.properties["building-part"]="roof";const s=e.paint.get("building-color").evaluate(o,r,this.canonical).toPremultipliedRenderColor(this.lut),a=e.paint.get("building-emissive-strength").evaluate(o,r,this.canonical);o.properties["building-part"]="wall";const l=e.paint.get("building-color").evaluate(o,r,this.canonical).toPremultipliedRenderColor(this.lut),c=e.paint.get("building-emissive-strength").evaluate(o,r,this.canonical);o.properties["building-part"]="window";const u=e.paint.get("building-color").evaluate(o,r,this.canonical).toPremultipliedRenderColor(this.lut),h=e.paint.get("building-emissive-strength").evaluate(o,r,this.canonical);o.properties["building-part"]="door";const d=e.paint.get("building-color").evaluate(o,r,this.canonical).toPremultipliedRenderColor(this.lut),f=e.paint.get("building-emissive-strength").evaluate(o,r,this.canonical),p=n.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade;for(const e of n.parts){let t,r=s;
vendor: 20,832 bytes, line 2
21===e.part?(r=s,t=a):0===e.part?(r=l,t=c):2===e.part?(r=u,t=h):3===e.part&&(r=d,t=f),t=it(t,0,1);for(let o=0;o<e.vertexLength;o++){const s=e.vertexOffset+o,a=1+(p.layoutAOArray.uint8[s]/255-1)*i;p.layoutColorArray.emplace(s,r.r*a*255<<8|r.g*a*255,r.b*a*255<<8|255*t),n.hasFauxFacade&&p.layoutFacadePaintArray.emplace(s,255*u.r<<8|255*u.g,255*u.b<<8|255*h)}}const m=n.buildingBloom;if(m)for(let e=0;e<m.vertexLength;e++)p.entranceBloom.layoutColorArray.emplace(m.vertexOffset+e,255*d.r<<8|255*d.g,255*d.b<<8|51*f)}}needsEvaluation(){return!this.colorBufferUploaded}updateReplacement(e,t,i){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const n=t.getReplacementRegionsForTile(e.toUnwrapped());if(Bp(this.activeReplacements,n))return;this.activeReplacements=n;for(const e of this.footprints)e.hiddenFlags&=-2;const r=[];for(const t of this.activeReplacements){if(t.order<i)continue;const n=Math.max(1,Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z));for(const i of this.footprints)i.min.x>t.max.x||i.max.x<t.min.x||i.min.y>t.max.y||i.max.y<t.min.y||(r.length=0,yx(this.footprintsVertices,i.footprintVertexOffset,i.footprintVertexLength,t.footprintTileId.canonical,e.canonical,r),Up(t.footprint,r,this.footprintsIndices.uint16,i.footprintIndexOffset,i.footprintIndexLength,0,-n)&&(i.hiddenFlags|=1))}0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.footprints)this.groundEffect.updateHiddenByLandmarkRange(e.groundEffectVertexOffset,e.groundEffectVertexLength,0!==e.hiddenFlags);this.indexArrayForConflationUploaded=!1}getFootprint(e){if(void 0!==e.id){const t=this.featureFootprintLookup.get(e.id);return this.footprints[t]}return null}getHeightAtTileCoord(e,t){let i=Number.NEGATIVE_INFINITY,n=!0;const r=4*(e+Cr)*Cr+(t+Cr);if(Object.hasOwn(this.footprintLookup,r)){const e=this.footprintLookup[r];return e?{height:e.height,hidden:0!==e.hiddenFlags}:void 0}const o=new Pe(e,t);for(const s of this.footprints)e>s.max.x||s.min.x>e||t>s.max.y||s.min.y>t||s.height<=i||gx(o,this.footprintsVertices.float32.subarray(2*s.footprintVertexOffset,2*(s.footprintVertexOffset+s.footprintVertexLength)),this.footprintsIndices.uint16.subarray(s.footprintIndexOffset,s.footprintIndexOffset+s.footprintIndexLength))&&(i=s.height,this.footprintLookup[r]=s,n=0!==s.hiddenFlags);if(i!==Number.NEGATIVE_INFINITY)return{height:i,hidden:n};this.footprintLookup[r]=void 0}}function gx(e,t,i){for(let n=0;n<i.length;n+=3){const r=i[n],o=i[n+1],s=i[n+2],a=t[2*r+0],l=t[2*r+1],c=t[2*o+0],u=t[2*o+1],h=t[2*s+0],d=t[2*s+1],f=(a-h)*(e.y-d)-(l-d)*(e.x-h),p=(c-a)*(e.y-l)-(u-l)*(e.x-a);if(f<0!=p<0&&0!==f&&0!==p)continue;const m=(h-c)*(e.y-u)-(d-u)*(e.x-c);if(0===m||m<0==f+p<=0)return!0}return!1}function yx(e,t,i,n,r,o){const s=Math.pow(2,n.z-r.z);for(let a=0;a<i;a++){let i=e.float32[2*(a+t)+0],l=e.float32[2*(a+t)+1];i=(i+r.x*Cr)*s-n.x*Cr,l=(l+r.y*Cr)*s-n.y*Cr,o.push(new Pe(i,l))}}Ys(_x,"BuildingBucket",{omit:["layers"]}),Ys(mx,"BuildingGeometry"),Ys(px,"BuildingBloomGeometry");class vx{constructor(e=0,t=[]){this.frcMask=e,this.rings=t}hasGeometry(){return this.rings.length>0&&this.rings[0].length>0}}async function xx(){}function bx(e,t,i){const n=t.paint.get(e).value;return"constant"===n.kind?n.value:i.programConfigurations.get(t.id).getMaxValue(e)}function wx(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Tx(e,t,i,n,r){if(!t[0]&&!t[1])return e;const o=Pe.convert(t)._mult(r);"viewport"===i&&o._rotate(-n);const s=[];for(let t=0;t<e.length;t++)s.push(e[t].sub(o));return s}function Ex(e,t,i,n){const r=Pe.convert(e)._mult(n);return"viewport"===t&&r._rotate(-i),r}Ys(vx,"FrcCoveragePolygon");const Sx=c(),Ix=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t};function Ax(e,t,i,n,r,o,s,a,l){if(o&&e.queryGeometry.isAboveHorizon)return!1;o&&(l*=e.pixelToTileUnitsFactor);const c=e.tileID.canonical,u=i.projection.upVectorScale(c,i.center.lat,i.worldSize).metersToTile;for(const h of t)for(const t of h){const h=t.add(a),d=r&&i.elevation?i.elevation.exaggeration()*r.getElevationAt(h.x,h.y,!0):0,f=i.projection.projectTilePoint(h.x,h.y,c);if(d>0){const e=i.projection.upVector(c,h.x,h.y);f.x+=e[0]*u*d,f.y+=e[1]*u*d,f.z+=e[2]*u*d}const p=o?h:Mx(f.x,f.y,f.z,n),m=o?e.tilespaceRays.map(e=>Px(e,d)):e.queryGeometry.screenGeometry,_=le([],[f.x,f.y,f.z,1],n);if(!s&&o?l*=_[3]/i.cameraToCenterDistance:s&&!o&&(l*=i.cameraToCenterDistance/_[3]),o){const e=mr((t.y/Cr+c.y)/(1<<c.z));l/=i.projection.pixelsPerMeter(e,1)/xc(1,e)}if(Nh(m,p,l))return!0}return!1}function Mx(e,t,i,n){const r=le([],[e,t,i,1],n);return new Pe(r[0]/r[3],r[1]/r[3])}const Cx=L(0,0,0),Dx=L(0,0,1);function Px(e,t){const i=D();return Cx[2]=t,e.intersectsPlane(Cx,Dx,i),new Pe(i[0],i[1])}class Rx extends Ed{}let Lx,zx;Ys(Rx,"HeatmapBucket",{omit:["layers"]});const Fx=(e,t,i,n)=>fn(t,i,"log"===n?(Math.pow(10,e)-1)/9:e);function Ox(e){const{expression:t,evaluationKey:i,resolution:n=256,clips:r,scale:o="linear",lut:s=null}=e,a=r?r.length:1,l=e.image||new hd({width:n,height:a}),c={},u=(e,n,r)=>{c[i]=r;const o=t.evaluate(c),a=o?.toNonPremultipliedRenderColor(s)??null;a&&(l.data[e+n+0]=Math.floor(255*a.r),l.data[e+n+1]=Math.floor(255*a.g),l.data[e+n+2]=Math.floor(255*a.b),l.data[e+n+3]=Math.floor(255*a.a))};for(let e=0,t=0;e<a;++e,t+=4*n){const i=r?.[e].start??0,s=r?.[e].end??1;for(let e=0,r=0;e<n;e++,r+=4)u(t,r,Fx(e/(n-1),i,s,o))}return l}let kx,Bx,Nx,Vx,Ux,jx,Gx,$x,Hx,Zx,qx,Wx;class Yx{constructor(e){this.zoom=e.zoom,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.index=e.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.footprints=[],this.worldview=e.worldview,this.hasAppearances=null}updateFootprints(e,t){for(const i of this.footprints)t.push({footprint:i,id:e})}updateAppearances(e,t,i,n){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(e,t,i,n){const r=[];for(const{feature:o,id:s,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Oc(o,e);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),c,i))continue;const u={id:s,properties:o.properties,type:o.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Fc(o,i,n),patterns:{}};r.push(u)}for(const n of r){const{geometry:r,index:o,sourceLayerIndex:s}=n;this.addFeature(n,r,o,i,{},t.availableImages,t.brightness),t.featureIndex.insert(e[o].feature,r,o,s,this.index)}}isEmpty(){return 0===this.footprints.length}uploadPending(){return!1}upload(e){}update(e,t,i,n,r,o,s){}destroy(){}addFeature(e,t,i,n,r,o=[],s){for(const e of Ne(t,2)){const t=[],i=[],n=[],r=new Pe(1/0,1/0),o=new Pe(-1/0,-1/0);for(const s of e)if(0!==s.length){s!==e[0]&&n.push(i.length/2);for(let e=0;e<s.length;e++)i.push(s[e].x),i.push(s[e].y),t.push(s[e]),r.x=Math.min(r.x,s[e].x),r.y=Math.min(r.y,s[e].y),o.x=Math.max(o.x,s[e].x),o.y=Math.max(o.y,s[e].y)}const s=Ll(i,n),a=new ry(t,s,8,256);this.footprints.push({vertices:t,indices:s,grid:a,min:r,max:o})}}}function Xx(e,t){return e.x*t.x+e.y*t.y}function Jx(e,t){if(1===e.length){let i=0;const n=t[i++];let r;for(;!r||n.equals(r);)if(r=t[i++],!r)return 1/0;for(;i<t.length;i++){const o=t[i],s=e[0],a=r.sub(n),l=o.sub(n),c=s.sub(n),u=Xx(a,a),h=Xx(a,l),d=Xx(l,l),f=Xx(c,a),p=Xx(c,l),m=u*d-h*h,_=(d*f-h*p)/m,g=(u*p-h*f)/m,y=n.z*(1-_-g)+r.z*_+o.z*g;if(isFinite(y))return y}return 1/0}{let e=1/0;for(const i of t)e=Math.min(e,i.z);return e}}function Kx(e,t,i){let n=1/0;Vh(i,t)&&(n=Jx(i,t[0]));for(let r=0;r<t.length;r++){const o=t[r],s=e[r];for(let e=0;e<o.length-1;e++){const t=o[e],r=[t,o[e+1],s[e+1],s[e],t];Bh(i,r)&&(n=Math.min(n,Jx(i,r)))}}return n!==1/0&&n}function Qx(e,t,i,n,r,o,s,a,l,c,u){return"globe"===e.projection.name?function(e,t,i,n,r,o,s,a,l,c,u){const h=[],d=[],f=e.projection.upVectorScale(u,e.center.lat,e.worldSize).metersToTile,p=[0,0,0,1],m=[0,0,0,1],_=(e,t,i,n)=>{e[0]=t,e[1]=i,e[2]=n,e[3]=1},g=ex();i>0&&(i+=g),n+=g;for(const g of t){const t=[],y=[];for(const h of g){const d=h.x+r.x,g=h.y+r.y,v=e.projection.projectTilePoint(d,g,u),x=e.projection.upVector(u,h.x,h.y);let b=i,w=n;if(s){const e=eb(d,g,i,n,s,a,l,c);b+=e.base,w+=e.top}0!==i?_(p,v.x+x[0]*f*b,v.y+x[1]*f*b,v.z+x[2]*f*b):_(p,v.x,v.y,v.z),_(m,v.x+x[0]*f*w,v.y+x[1]*f*w,v.z+x[2]*f*w),X(p,p,o),X(m,m,o),t.push(new ed(p[0],p[1],p[2])),y.push(new ed(m[0],m[1],m[2]))}h.push(t),d.push(y)}return[h,d]}(e,t,i,n,r,o,s,a,l,c,u):s?function(e,t,i,n,r,o,s,a,l){const c=[],u=[],h=[0,0,0,1];for(const d of e){const e=[],f=[];for(const c of d){const u=c.x+n.x,d=c.y+n.y,p=eb(u,d,t,i,o,s,a,l);h[0]=u,h[1]=d,h[2]=p.base,h[3]=1,le(h,h,r),h[3]=Math.max(h[3],1e-5);const m=new ed(h[0]/h[3],h[1]/h[3],h[2]/h[3]);h[0]=u,h[1]=d,h[2]=p.top,h[3]=1,le(h,h,r),h[3]=Math.max(h[3],1e-5);const _=new ed(h[0]/h[3],h[1]/h[3],h[2]/h[3]);e.push(m),f.push(_)}c.push(e),u.push(f)}return[c,u]}(t,i,n,r,o,s,a,l,c):function(e,t,i,n,r){const o=[],s=[],a=r[8]*t,l=r[9]*t,c=r[10]*t,u=r[11]*t,h=r[8]*i,d=r[9]*i,f=r[10]*i,p=r[11]*i;for(const t of e){const e=[],i=[];for(const o of t){const t=o.x+n.x,s=o.y+n.y,m=r[0]*t+r[4]*s+r[12],_=r[1]*t+r[5]*s+r[13],g=r[2]*t+r[6]*s+r[14],y=r[3]*t+r[7]*s+r[15],v=m+a,x=_+l,b=g+c,w=Math.max(y+u,1e-5),T=m+h,E=_+d,S=g+f,I=Math.max(y+p,1e-5);e.push(new ed(v/w,x/w,b/w)),i.push(new ed(T/I,E/I,S/I))}o.push(e),s.push(i)}return[o,s]}(t,i,n,r,o)}function eb(e,t,i,n,r,o,s,a){const l=s*r.getElevationAt(e,t,!0,!0),c=0!==o[0],u=c?0===o[1]?s*(o[0]/7-450):s*function(e,t,i){const n=Math.floor(t[0]/8),r=Math.floor(t[1]/8),o=10*(t[0]-8*n),s=10*(t[1]-8*r),a=e.getElevationAt(n,r,!0,!0),l=e.getMeterToDEM(i),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(s*l-1)),h=e.tileCoordToPixel(n,r),d=2*c+1,f=2*u+1,p=function(e,t,i,n,r){return[e.getElevationAtPixel(t,i,!0),e.getElevationAtPixel(t+r,i,!0),e.getElevationAtPixel(t,i+r,!0),e.getElevationAtPixel(t+n,i+r,!0)]}(e,h.x-c,h.y-u,d,f),m=Math.abs(p[0]-p[1]),_=Math.abs(p[2]-p[3]),g=Math.abs(p[0]-p[2])+Math.abs(p[1]-p[3]),y=Math.min(.25,.5*l*(m+_)/d),v=Math.min(.25,.5*l*g/f);return a+Math.max(y*o,v*s)}(r,o,a):l;return{base:l+(0===i?-1:i),top:c?Math.max(u+n,l+i+2):l+n}}function tb(e,t,i){return t*(Cr/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}function ib(e,t){return 1/tb(e,1,t.tileZoom)}function nb(e,t,i,n){return e.translatePosMatrix(n||t.tileID.projMatrix,t,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}Ys(Yx,"ClipBucket",{omit:["layers"]});const rb=e=>{const t=[];ob(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT"),"multiply"===e.paint.get("line-blend-mode")&&t.push("LINE_BLEND_MULTIPLY"),"additive"===e.paint.get("line-blend-mode")&&t.push("LINE_BLEND_ADDITIVE");const i=e.paint.get("line-trim-offset");0===i[0]&&0===i[1]||t.push("RENDER_LINE_TRIM_OFFSET");const n=0!==e.paint.get("line-border-width").constantOr(1);n&&t.push("RENDER_LINE_BORDER"),n&&e.paint.get("line-border-gradient")&&t.push("RENDER_LINE_BORDER_GRADIENT");const r="none"===e.layout.get("line-join").constantOr("miter"),o=!!e.paint.get("line-pattern").constantOr(1);return r&&o&&t.push("LINE_JOIN_NONE"),t};function ob(e){const t=e.paint.get("line-dasharray").value;return"constant"!==t.kind||t.value}let sb;const ab=()=>sb||(sb={layout:qx||(qx=new nl({"line-cap":new tl(rl.layout_line["line-cap"]),"line-join":new tl(rl.layout_line["line-join"]),"line-miter-limit":new el(rl.layout_line["line-miter-limit"]),"line-round-limit":new el(rl.layout_line["line-round-limit"]),"line-sort-key":new tl(rl.layout_line["line-sort-key"]),"line-z-offset":new tl(rl.layout_line["line-z-offset"]),"line-elevation-reference":new el(rl.layout_line["line-elevation-reference"]),"line-cross-slope":new el(rl.layout_line["line-cross-slope"]),visibility:new el(rl.layout_line.visibility),"line-width-unit":new el(rl.layout_line["line-width-unit"]),"line-elevation-ground-scale":new tl(rl.layout_line["line-elevation-ground-scale"])})),paint:Wx||(Wx=new nl({"line-opacity":new tl(rl.paint_line["line-opacity"]),"line-color":new tl(rl.paint_line["line-color"]),"line-translate":new el(rl.paint_line["line-translate"]),"line-translate-anchor":new el(rl.paint_line["line-translate-anchor"]),"line-width":new tl(rl.paint_line["line-width"]),"line-gap-width":new tl(rl.paint_line["line-gap-width"]),"line-offset":new tl(rl.paint_line["line-offset"]),"line-blur":new tl(rl.paint_line["line-blur"]),"line-dasharray":new tl(rl.paint_line["line-dasharray"]),"line-pattern":new tl(rl.paint_line["line-pattern"]),"line-pattern-cross-fade":new el(rl.paint_line["line-pattern-cross-fade"]),"line-gradient":new il(rl.paint_line["line-gradient"]),"line-trim-offset":new el(rl.paint_line["line-trim-offset"]),"line-trim-fade-range":new el(rl.paint_line["line-trim-fade-range"]),"line-trim-color":new el(rl.paint_line["line-trim-color"]),"line-emissive-strength":new tl(rl.paint_line["line-emissive-strength"]),"line-border-width":new tl(rl.paint_line["line-border-width"]),"line-border-color":new tl(rl.paint_line["line-border-color"]),"line-border-gradient":new il(rl.paint_line["line-border-gradient"]),"line-occlusion-opacity":new el(rl.paint_line["line-occlusion-opacity"]),"line-blend-mode":new el(rl.paint_line["line-blend-mode"]),"line-blend-additive-clamp":new el(rl.paint_line["line-blend-additive-clamp"]),"line-cutout-depth":new el(rl.paint_line["line-cutout-depth"]),"line-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"line-gradient-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"line-border-gradient-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},sb);class lb extends tl{possiblyEvaluate(e,t){return t=new Ha(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition,worldview:t.worldview}),super.possiblyEvaluate(e,t)}evaluate(e,t,i,n){return t={...t,zoom:Math.floor(t.zoom)},super.evaluate(e,t,i,n)}}let cb,ub,hb,db;function fb(e,t){return t>0?t+2*e:e}function pb(e,t){return t.replace(/{([^{}]+)}/g,(t,i)=>i in e?String(e[i]):"")}class mb{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Tn,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ys(mb,"FormatSectionOverride",{omit:["defaultValue"]});const _b={};function gb(e){return"constant"!==e.value.kind&&e.value.isStateDependent}const yb=()=>db||(db={layout:ub||(ub=new nl({"symbol-placement":new el(rl.layout_symbol["symbol-placement"]),"symbol-spacing":new el(rl.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new el(rl.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new tl(rl.layout_symbol["symbol-sort-key"]),"symbol-z-order":new el(rl.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new el(rl.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new el(rl.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new el(rl.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new el(rl.layout_symbol["icon-ignore-placement"]),"icon-optional":new el(rl.layout_symbol["icon-optional"]),"icon-rotation-alignment":new el(rl.layout_symbol["icon-rotation-alignment"]),"icon-size":new tl(rl.layout_symbol["icon-size"]),"icon-size-scale-range":new el(rl.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new tl(rl.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new tl(rl.layout_symbol["icon-text-fit-padding"]),"icon-image":new tl(rl.layout_symbol["icon-image"]),"icon-image-use-theme":new el({type:"string",default:"default","property-type":"data-constant"}),"icon-rotate":new tl(rl.layout_symbol["icon-rotate"]),"icon-padding":new el(rl.layout_symbol["icon-padding"]),"icon-keep-upright":new el(rl.layout_symbol["icon-keep-upright"]),"icon-offset":new tl(rl.layout_symbol["icon-offset"]),"icon-anchor":new tl(rl.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new el(rl.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new el(rl.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new el(rl.layout_symbol["text-rotation-alignment"]),"text-field":new tl(rl.layout_symbol["text-field"]),"text-font":new tl(rl.layout_symbol["text-font"]),"text-size":new tl(rl.layout_symbol["text-size"]),"text-size-scale-range":new el(rl.layout_symbol["text-size-scale-range"]),"text-max-width":new tl(rl.layout_symbol["text-max-width"]),"text-line-height":new tl(rl.layout_symbol["text-line-height"]),"text-letter-spacing":new tl(rl.layout_symbol["text-letter-spacing"]),"text-justify":new tl(rl.layout_symbol["text-justify"]),"text-radial-offset":new tl(rl.layout_symbol["text-radial-offset"]),"text-variable-anchor":new el(rl.layout_symbol["text-variable-anchor"]),"text-anchor":new tl(rl.layout_symbol["text-anchor"]),"text-max-angle":new el(rl.layout_symbol["text-max-angle"]),"text-writing-mode":new el(rl.layout_symbol["text-writing-mode"]),"text-rotate":new tl(rl.layout_symbol["text-rotate"]),"text-padding":new el(rl.layout_symbol["text-padding"]),"text-keep-upright":new el(rl.layout_symbol["text-keep-upright"]),"text-transform":new tl(rl.layout_symbol["text-transform"]),"text-offset":new tl(rl.layout_symbol["text-offset"]),"text-allow-overlap":new el(rl.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new el(rl.layout_symbol["text-ignore-placement"]),"text-optional":new el(rl.layout_symbol["text-optional"]),visibility:new el(rl.layout_symbol.visibility)})),paint:hb||(hb=new nl({"icon-opacity":new tl(rl.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new tl(rl.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new tl(rl.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new tl(rl.paint_symbol["text-emissive-strength"]),"icon-color":new tl(rl.paint_symbol["icon-color"]),"icon-halo-color":new tl(rl.paint_symbol["icon-halo-color"]),"icon-halo-width":new tl(rl.paint_symbol["icon-halo-width"]),"icon-halo-blur":new tl(rl.paint_symbol["icon-halo-blur"]),"icon-translate":new el(rl.paint_symbol["icon-translate"]),"icon-translate-anchor":new el(rl.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new el(rl.paint_symbol["icon-image-cross-fade"]),"text-opacity":new tl(rl.paint_symbol["text-opacity"]),"text-occlusion-opacity":new tl(rl.paint_symbol["text-occlusion-opacity"]),"text-color":new tl(rl.paint_symbol["text-color"],{runtimeType:An,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new tl(rl.paint_symbol["text-halo-color"]),"text-halo-width":new tl(rl.paint_symbol["text-halo-width"]),"text-halo-blur":new tl(rl.paint_symbol["text-halo-blur"]),"text-translate":new el(rl.paint_symbol["text-translate"]),"text-translate-anchor":new el(rl.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new el(rl.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new el(rl.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new el(rl.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new el(rl.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new tl(rl.paint_symbol["symbol-z-offset"]),"placement-priority":new tl(rl.paint_symbol["placement-priority"]),"placement-group":new tl(rl.paint_symbol["placement-group"]),"icon-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},db);class vb extends Pl{constructor(e,t,i,n){super(e,yb(),t,i,n,e.layout?e.layout["icon-image-use-theme"]:null),this._colorAdjustmentMatrix=d([]),this.hasOcclusionOpacityProperties=void 0!==e.paint&&("icon-occlusion-opacity"in e.paint||"text-occlusion-opacity"in e.paint)}_handleSpecialPaintPropertyUpdate(e){"icon-occlusion-opacity"!==e&&"text-occlusion-opacity"!==e||(this.hasOcclusionOpacityProperties=!0)}recalculate(e,t){super.recalculate(e,t),this.appearances&&this.appearances.forEac
vendor: 4,585 bytes, line 2
2h(i=>{i.recalculate(e,t,this.iconImageUseTheme)}),0!==this.appearances.length&&delete this.layout._values["text-variable-anchor"],"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const i=this.layout.get("text-writing-mode");if(i){const e=[];for(const t of i)e.includes(t)||e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(e,t,i,n){return this._saturation===e&&this._contrast===t&&this._brightnessMin===i&&this._brightnessMax===n||(this._colorAdjustmentMatrix=function(e,t,i,n){e=Ct(e),t=Mt(t);const r=c(),o=e/3,s=1-2*o,a=[s,o,o,0,o,s,o,0,o,o,s,0,0,0,0,1],l=.5-.5*t,u=n-i;return m(r,[u,0,0,0,0,u,0,0,0,0,u,0,i,i,i,1],[t,0,0,0,0,t,0,0,0,0,t,0,l,l,l,1]),m(r,r,a),r}(e,t,i,n),this._saturation=e,this._contrast=t,this._brightnessMin=i,this._brightnessMax=n),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,t,i,n){const r=this.layout.get(e).evaluate(t,{},i,n),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||Vs(o.value)||!r?r:pb(t.properties,r)}getAppearanceValueAndResolveTokens(e,t,i,n,r){const o=e.getLayoutProperty(t);if(!o)return;const s=o.evaluate(i,{},n,r),a=e.getUnevaluatedLayoutProperties()._values[t];return a.isDataDriven()||Vs(a.value)||!s||"string"!=typeof s?s:pb(i.properties,s)}createBucket(e){return new f_(e)}placeSymbols(e,t,i,n,r){const{globalPlacement:o,idRangeAllocator:s,transform:a,buildingIndex:l,fogState:c,groupOrders:u,replacementSource:h}=e,d=this.runtimeLayerUID,f=gb(this.paint.get("placement-group"))||gb(this.paint.get("placement-priority"))?n._state.getState(this.sourceLayer||"_geojsonTileLayer"):_b;for(const e of t){const t=e.getBucket(this);if(!t||this.fqid!==t.layerIds[0])continue;"offset"===t.elevationType&&l?l.updateZOffset(t,e.tileID):"road"===t.elevationType&&t.hdExt&&t.hdExt.updateRoadElevation(t,e.tileID.canonical),t.updateZOffset(),o.startSymbolSourceProcessing(t);const n=em(e.tileID,t.getProjection(),a,a.projection.name);t.addToPlacement(o,s,d,n,a,e.tileSize/Cr,e,c,u,i,f,r?h:null),o.finishSourceProcessing()}}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of yb().paint.overridableProperties){if(!vb.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),i=new mb(t),n=new Ns(i,t.property.specification,this.scope,this.options,this.layout.get("icon-image-use-theme"));let r=null;r="constant"===t.value.kind||"source"===t.value.kind?new js("source",n):new Gs("composite",n,t.value.zoomStops,t.value.interpolationType),this.paint._values[e]=new Ka(t.property,r,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,i){return!(!this.layout||t.isDataDriven()||i.isDataDriven())&&vb.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const i=e.get("text-field"),n=yb().paint.properties[t];let r=!1;const o=e=>{for(const t of e)if(n.overrides&&n.overrides.hasOverride(t))return void(r=!0)};if("constant"===i.value.kind&&i.value.value instanceof Un)o(i.value.value.sections);else if("source"===i.value.kind){const e=t=>{r||(t instanceof Wn&&Zn(t.value)===Pn?o(t.value.sections):t instanceof Kn?o(t.sections):t.eachChild(e))},t=i.value;t._styleExpression&&e(t._styleExpression.expression)}return r}getProgramIds(){return["symbol"]}getDefaultProgramParams(e,t,i){return{config:new mh(this,{zoom:t,lut:i}),overrideFog:!1}}hasElevation(){return this.layout&&"hd-road-markup"===this.layout.get("symbol-elevation-reference")}mayUse(e){return"HD"===e&&Rl(this,"symbol-elevation-reference",e=>"hd-road-markup"===e)}prepare(){return this.mayUse("HD")?xx():Promise.resolve()}}let xb,bb,wb,Tb;const Eb=1024,Sb=(Math.pow(Eb,2)-1)/268170240;class Ib extends Pl{constructor(e,t,i,n){super(e,{layout:wb||(wb=new nl({visibility:new el(rl.layout_raster.visibility)})),paint:Tb||(Tb=new nl({"raster-opacity":new el(rl.paint_raster["raster-opacity"]),"raster-color":new il(rl.paint_raster["raster-color"]),"raster-color-mix":ne
vendor: 14,076 bytes, line 2
2w el(rl.paint_raster["raster-color-mix"]),"raster-color-range":new el(rl.paint_raster["raster-color-range"]),"raster-color-scale":new el(rl.paint_raster["raster-color-scale"]),"raster-hue-rotate":new el(rl.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new el(rl.paint_raster["raster-brightness-min"]),"raster-brightness-max":new el(rl.paint_raster["raster-brightness-max"]),"raster-saturation":new el(rl.paint_raster["raster-saturation"]),"raster-contrast":new el(rl.paint_raster["raster-contrast"]),"raster-resampling":new el(rl.paint_raster["raster-resampling"]),"raster-fade-duration":new el(rl.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new el(rl.paint_raster["raster-emissive-strength"]),"raster-array-band":new el(rl.paint_raster["raster-array-band"]),"raster-elevation":new el(rl.paint_raster["raster-elevation"]),"raster-elevation-reference":new el(rl.paint_raster["raster-elevation-reference"]),"raster-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(e){const t=e?e._source:null;return(!t||"image"!==t.type&&"video"!==t.type&&"canvas"!==t.type||!t.onNorthPole&&!t.onSouthPole)&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(e){"raster-color"!==e&&"raster-color-range"!==e&&"raster-color-scale"!==e||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}updateColorRamp(e){if(!this.hasColorMap())return;if(!this._curRampRange)return;const t=this._transitionablePaint._values["raster-color"].value.expression,[i,n]=e||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];if(isNaN(i)&&isNaN(n))return;if(i===this._curRampRange[0]&&n===this._curRampRange[1])return;const r=this._transitionablePaint._values["raster-color-scale"].value.expression.evaluate({zoom:0});this.colorRamp=Ox({expression:t,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:i,end:n}],resolution:Eb,scale:r}),this.colorRampTexture=null,this._curRampRange=[i,n]}is3D(e){return this.paint.get("raster-elevation")>0}}let Ab,Mb,Cb,Db,Pb,Rb,Lb,zb;class Fb extends Pl{constructor(e,t,i,n){super(e,{layout:Ab||(Ab=new nl({visibility:new el(rl["layout_raster-particle"].visibility)})),paint:Mb||(Mb=new nl({"raster-particle-array-band":new el(rl["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new el(rl["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new il(rl["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new el(rl["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new el(rl["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new el(rl["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new el(rl["paint_raster-particle"]["raster-particle-reset-rate-factor"]),"raster-particle-elevation":new el(rl["paint_raster-particle"]["raster-particle-elevation"]),"raster-particle-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._updateColorRamp(),this.lastInvalidatedAt=Vt.now()}mayUse(e){return"HD"===e}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this.tileFramebuffer&&(this.tileFramebuffer.destroy(),this.tileFramebuffer=null),this.particleFramebuffer&&(this.particleFramebuffer.destroy(),this.particleFramebuffer=null)}onRemove(e){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return"none"!==this.visibility}isDraped(e){return!1}_handleSpecialPaintPropertyUpdate(e){"raster-particle-color"!==e&&"raster-particle-max-speed"!==e||(this._updateColorRamp(),this._invalidateAnimationState()),"raster-particle-count"===e&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;const e=this._transitionablePaint._values["raster-particle-color"].value.expression,t=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=Ox({expression:e,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:t}],resolution:256}),this.colorRampTexture=null}_invalidateAnimationState(){this.lastInvalidatedAt=Vt.now()}tileCoverLift(){return this.paint.get("raster-particle-elevation")}}class Ob extends Pl{constructor(e,t){super(e,{},t,null),this.implementation=e,e.slot&&(this.slot=e.slot)}is3D(e){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isDraped(e){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}function kb(e,t,i){const n=[0,0,1],r=ue([]);return fe(r,r,i?-Je(e)+Math.PI:Je(e)),de(r,r,-Je(t)),K(n,n,r),Z(n,n)}class Bb{constructor(e,t){this.feature=e,this.instancedDataOffset=t,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class Nb{constructor(){this.maxScale=1,this.maxXYTranslationDistance=0,this.instancedDataArray=new Tu,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}colorForInstance(e){const t=16*e,i=this.instancedDataArray.float32;let n=Math.floor(i[t+2]);const r=1.05*(i[t+2]-n);return n/=100,[i[t]%1*1.05,i[t+1]%1*1.05,r,n]}tileCoordinatesForInstance(e){const t=16*e,i=this.instancedDataArray.float32;let n=i[t+0];return n=n>Cr?n-Cr:n,new Pe(Math.trunc(n),Math.trunc(i[t+1]))}translationForInstance(e){const t=16*e,i=this.instancedDataArray.float32;return[i[t+4],i[t+5],i[t+6]]}rotationScaleForInstance(e){const t=16*e,i=this.instancedDataArray.float32;return[i[t+7],i[t+8],i[t+9],i[t+10],i[t+11],i[t+12],i[t+13],i[t+14],i[t+15]]}transformForInstance(e){const t=16*e,i=this.instancedDataArray.float32;return[i[t+7],i[t+8],i[t+9],i[t+4],i[t+10],i[t+11],i[t+12],i[t+5],i[t+13],i[t+14],i[t+15],i[t+6],0,0,0,1]}}class Vb{constructor(e){this.requiresStandardRuntime=!0,this.zoom=e.zoom,this.canonical=e.canonical,this.overscaledZ=this.canonical.z+Math.log2(e.overscaling),this.layers=e.layers,this.layerIds=this.layers.map(e=>e.fqid),this.projection=e.projection,this.index=e.index,this.worldview=e.worldview,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z+1?0:this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0,this.styleDefinedModelURLs=e.styleDefinedModelURLs,this.hasAppearances=null}updateFootprints(e,t){}updateAppearances(e,t,i,n){return{hasLayoutChanges:!1,hasUboChanges:!1}}populate(e,t,i,n){this.tileToMeter=Ic(i);const r=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);const o="hd-road-markup"===this.layers[0].paint.get("model-elevation-reference")?t.elevationFeatures:void 0;for(const{feature:s,id:a,index:l,sourceLayerIndex:c}of e){const e=a??(s.properties&&Object.hasOwn(s.properties,"id")?s.properties.id:void 0),u=Oc(s,r);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom,{worldview:this.worldview,activeFloors:t.activeFloors}),u,i))continue;const h={id:e,sourceLayerIndex:c,index:l,geometry:r?u.geometry:Fc(s,i,n),properties:s.properties,type:s.type,patterns:{}},d=this.addFeature(h,h.geometry,u,o,i);d&&t.featureIndex.insert(s,h.geometry,l,c,this.index,this.instancesPerModel[d].instancedDataArray.length,256)}this.lookup=null}evaluateQueryRenderedFeaturePadding(){const e=this.layers[0].modelManager,t=this.layers[0].scope;let i=0;for(const n of this.modelUris){const r=e.getModel(n,t);if(!r)continue;const o=this.instancesPerModel[n];if(o){const e=.5*j(r.aabb.max,r.aabb.min)*o.maxScale+o.maxXYTranslationDistance,t=Math.min(Cr,Math.max(e/this.tileToMeter,256));i=Math.max(t,i)}}return i}update(e,t,i,n){for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];for(const t in e)Object.hasOwn(i.idToFeaturesIndex,t)&&(this.evaluate(i.features[i.idToFeaturesIndex[t]],e[t],i,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let e=!1;for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];for(const t of i.features){const n=this.layers[0],r=t.feature,o=this.canonical,s=n.paint.get("model-rotation").evaluate(r,{},o),a=n.paint.get("model-scale").evaluate(r,{},o),l=n.paint.get("model-translation").evaluate(r,{},o);ee(t.rotation,s)&&ee(t.scale,a)&&ee(t.translation,l)||(this.evaluate(t,t.featureStates,i,!0),e=!0)}}return e}updateReplacement(e,t,i,n){if(t.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped(),!0);if(Bp(this.activeReplacements,r))return!1;this.activeReplacements=r;let o=!1;for(const t in this.instancesPerModel){const r=this.instancesPerModel[t],s=r.instancedDataArray;for(const t of r.features){const r=t.instancedDataOffset,a=t.instancedDataCount;for(let t=0;t<a;t++){const a=16*(t+r);let l=s.float32[a+0];const c=l>Cr;l=c?l-Cr:l;const u=Math.floor(l),h=Math.floor(s.float32[a+1]);let d=!1;for(const t of this.activeReplacements)if(!zp(t,i,Hp.Model,n)&&!(t.min.x>u||u>t.max.x||t.min.y>h||h>t.max.y)&&(d=$p(Gp(u,h,e.canonical,t.footprintTileId.canonical),t.footprint),d))break;s.float32[a]=d?l+Cr:l,o=o||d!==c}}}return o}isEmpty(){for(const e in this.instancesPerModel)if(0!==this.instancesPerModel[e].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];i.instancedDataArray.length<0||0===i.instancedDataArray.length||(i.instancedDataBuffer?i.instancedDataBuffer.updateData(i.instancedDataArray):i.instancedDataBuffer=e.createVertexBuffer(i.instancedDataArray,dy.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(e){for(const e in this.instancesPerModel){const t=this.instancesPerModel[e];0!==t.instancedDataArray.length&&t.instancedDataBuffer&&t.instancedDataBuffer.destroy()}const t=this.layers[0].modelManager;if(e&&t&&this.modelUris&&this.modelsRequested)for(const e of this.modelUris)t.removeModel(e,"",!0)}addFeature(e,t,i,n,r){const o=this.layers[0],s=o.layout.get("model-id"),a=o.layout.get("model-allow-density-reduction"),l=s.evaluate(i,{},this.canonical);if(!l)return gt(`modelId is not evaluated for layer ${o.id} and it is not going to get rendered.`),l;!l.includes("://")&&!this.styleDefinedModelURLs[l]||this.modelUris.includes(l)||this.modelUris.push(l),this.instancesPerModel[l]||(this.instancesPerModel[l]=new Nb);const c=this.instancesPerModel[l],u=c.instancedDataArray,h=new Bb(i,u.length);let d;if(n){const t=L_(e,n,void 0,r);d=t?t.feature:void 0}for(const e of t)for(const t of e){if(t.x<0||t.x>=Cr||t.y<0||t.y>=Cr)continue;if(0!==this.lookupDim&&a){const e=(this.lookupDim-1)/Cr,i=this.lookupDim*(t.y*e|0)+t.x*e|0;if(this.lookup){if(0!==this.lookup[i])continue;this.lookup[i]=1}}this.instanceCount++;const e=u.length;if(u.resize(e+1),n){c.instancesRoadElevation||(c.instancesRoadElevation=[]);const e=d?d.pointElevation(new Pe(t.x,t.y)):0;c.instancesRoadElevation.push(e)}c.instancesEvaluatedElevation.push(0),u.float32[16*e]=t.x,u.float32[16*e+1]=t.y}return h.instancedDataCount=c.instancedDataArray.length-h.instancedDataOffset,h.instancedDataCount>0&&(e.id&&(c.idToFeaturesIndex[e.id]=c.features.length),c.features.push(h),this.evaluate(h,{},c,!1)),l}getModelUris(){return this.modelUris}evaluate(e,t,i,n){const r=this.layers[0],o=e.feature,s=this.canonical,a=e.rotation=r.paint.get("model-rotation").evaluate(o,t,s),l=e.scale=r.paint.get("model-scale").evaluate(o,t,s),c=e.translation=r.paint.get("model-translation").evaluate(o,t,s),{r:u,g:h,b:d}=r.paint.get("model-color").evaluate(o,t,s),f=r.paint.get("model-color-mix-intensity").evaluate(o,t,s),p=[];this.maxVerticalOffset<c[2]&&(this.maxVerticalOffset=c[2]);const m=c[0]*c[0]+c[1]*c[1],_=m>0?Math.sqrt(m):0;i.maxScale=Math.max(Math.max(i.maxScale,l[0]),Math.max(l[1],l[2])),i.maxXYTranslationDistance=Math.max(i.maxXYTranslationDistance,_),this.maxScale=Math.max(Math.max(this.maxScale,l[0]),Math.max(l[1],l[2])),by(p,a,l);const g=Math.round(100*f)+d/1.05;for(let t=0;t<e.instancedDataCount;++t){const r=e.instancedDataOffset+t,o=16*r,a=i.instancedDataArray.float32;let l=0;n&&(l=a[o+6]-i.instancesEvaluatedElevation[r]);const d=0|a[o+1];a[o]=(0|a[o])+u/1.05,a[o+1]=d+h/1.05,a[o+2]=g,a[o+3]=1/(s.z>10?this.tileToMeter:Ic(s,d)),a[o+4]=c[0],a[o+5]=c[1],a[o+6]=c[2]+(i.instancesRoadElevation?i.instancesRoadElevation[r]:0)+l,a[o+7]=p[0],a[o+8]=p[1],a[o+9]=p[2],a[o+10]=p[4],a[o+11]=p[5],a[o+12]=p[6],a[o+13]=p[8],a[o+14]=p[9],a[o+15]=p[10],i.instancesEvaluatedElevation[r]=c[2]}}}Ys(Vb,"ModelBucket",{omit:["layers"]}),Ys(Nb,"PerModelAttributes"),Ys(Bb,"ModelFeature");const Ub=new WeakMap;
vendor: 6,071 bytes, line 2
2class jb{constructor(e,t){const i=e.gl;if(this.context=e,this.buffer=i.createBuffer(),!this.buffer)throw new Error("Failed to create model part style UBO buffer");i.bindBuffer(i.UNIFORM_BUFFER,this.buffer),i.bufferData(i.UNIFORM_BUFFER,t,i.DYNAMIC_DRAW),i.bindBuffer(i.UNIFORM_BUFFER,null)}update(e){const t=this.context.gl;t.bindBuffer(t.UNIFORM_BUFFER,this.buffer),t.bufferSubData(t.UNIFORM_BUFFER,0,e),t.bindBuffer(t.UNIFORM_BUFFER,null)}bind(e,t){let i=Ub.get(t);if(void 0===i){const n=e.gl,r=n.getUniformBlockIndex(t,"ModelPartStyleUniform");i=r!==n.INVALID_INDEX,i&&n.uniformBlockBinding(t,r,0),Ub.set(t,i)}if(!i)return;const n=e.gl;n.bindBufferBase(n.UNIFORM_BUFFER,0,this.buffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),this.buffer=null)}}const Gb=new Float32Array(262144),$b=new Uint8Array(262144),Hb=[0,0,0],Zb=[0,0,0];function qb(e){let t=0;if(e.meshes)for(const i of e.meshes)t=Math.max(t,i.aabb.max[2]);if(e.children)for(const i of e.children)t=Math.max(t,qb(i));return t}function Wb(e,t,i){if(e.meshes)for(const n of e.meshes){if(n.aabb.min[0]===1/0)continue;const r=Pf.applyTransform(n.aabb,e.globalMatrix);i.insert(t,r.min[0],r.min[1],r.max[0],r.max[1])}if(e.children)for(const n of e.children)Wb(n,t,i)}class Yb{constructor(e){this.node=e,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedTranslation=[0,0,0],this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.partStyle=new Float32Array(112),this.partStyleUBO=null,this.needsPartStyleUBO=!1,this.cameraCollisionOpacity=1,this.targetLod=-1,this.feature={type:"Point",id:e.id,geometry:[],properties:{height:qb(e)}},this.aabb=this._getLocalBounds(),this.state=null}_getLocalBounds(){if(!this.node.meshes)return new Pf([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let e=0;const t=new Pf([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const i of this.node.meshes)this.node.lightMeshIndex!==e&&(i.transformedAabb=Pf.applyTransformFast(i.aabb,this.node.globalMatrix),t.encapsulate(i.transformedAabb)),e++;this.aabb=t}return this.aabb}}class Xb{constructor(e,t,i,n,r,o,s,a){this.requiresStandardRuntime=!0,this.isTiled3dModelBucket=!0,this.id=i,this.layers=e,this.layerIds=this.layers.map(e=>e.fqid),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.modelTraits|=1,this.uploaded=!1,this.hasPattern=!1,n&&(this.modelTraits|=4),r&&(this.modelTraits|=8),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=o,this.worldview=a,this.dirty=!0,this.needsPartStyleUBOs=!1,this.filter=null,this.nodesInfo=[];for(const e of t)this.nodesInfo.push(new Yb(e)),Wb(e,s.featureIndexArray.length,s.grid),s.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,s.bucketLayerIDs.length-1,0);this.states={},this.hasAppearances=null}updateFootprints(e,t){for(const i of this.getNodesInfo()){const n=i.node;n.footprint&&t.push({footprint:n.footprint,id:e})}}updateAppearances(e,t,i,n){return{hasLayoutChanges:!1,hasUboChanges:!1}}update(e){const t=0!==Object.keys(e).length;if(t&&!this.stateDependentLayers.length)return;const i=t?this.stateDependentLayers:this.layers;if(!Re(e,this.states))for(const t of i)this.evaluate(t,e);this.states=structuredClone(e)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsPartStyleUBOs}upload(e){if(this.needsPartStyleUBOs&&(this.createPartStyleUBOs(e),this.needsPartStyleUBOs=!1),!this.uploaded){const t=this.getNodesInfo();for(const i of t)Ry(i.node,e,!0);for(const e of t)zy(e.node);this.uploaded=!0}}createPartStyleUBOs(e){for(const t of this.getNodesInfo())t.needsPartStyleUBO&&(t.partStyleUBO=new jb(e,t.partStyle),t.needsPartStyleUBO=!1)}needsReEvaluation(e,t,i){const n=e.transform.projectionOptions,r=e.style.getBrightness(),o=this.brightness!==r;if(!this.uploaded||this.dirty||n.name!==this.projection.name||Jb(i.paint.get("model-color").value,o)||Jb(i.paint.get("model-color-mix-intensity").value,o)||Jb(i.paint.get("model-roughness").value,o)||Jb(i.paint.get("model-emissive-strength").value,o)||Jb(i.paint.get("model-height-based-emissive-strength-multiplier").value,o)){this.projection=n,this.brightness=r;const e=this.getNodesInfo();for(const t of e)t.state=null;return!0}return!1}evaluateTransform(e,t){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;const i=this.getNodesInfo(),n=this.id.canonical;for(const e of i){const i=e.feature;e.evaluatedTranslation=t.paint.get("model-translation").evaluate(i,{},n),e.evaluatedScale=t.paint.get("model-scale").evaluate(i,{},n)}}evaluate(e,t){const i=this.getNodesInfo();for(const n of i){if(!n.node.meshes)continue;const i=n.feature,r=t&&t[i.id];if(Re(r,n.state))continue;n.state=structuredClone(r);const o=n.node.meshes&&n.node.meshes[0].hasFeatureData,s=this.id.canonical;if(n.hasTranslucentParts=!1,o){for(let t=0;t<Iy.length;t++){const o=Iy[t];o.length&&(i.properties.part=o);const a=e.paint.get("model-color").evaluate(i,r,s).toPremultipliedRenderColor(null),l=e.paint.get("model-color-mix-intensity").evaluate(i,r,s);n.evaluatedColor[t]=[a.r,a.g,a.b,l],n.evaluatedRMEA[t][0]=e.paint.get("model-roughness").evaluate(i,r,s),n.evaluatedRMEA[t][2]=e.paint.get("model-emissive-strength").evaluate(i,r,s),n.evaluatedRMEA[t][3]=a.a,n.emissionHeightBasedParams[t]=e.paint.get("model-height-based-emissive-strength-multiplier").evaluate(i,r,s),!n.hasTranslucentParts&&a.a<1&&(n.hasTranslucentParts=!0)}delete i.properties.part}else n.evaluatedRMEA[0][2]=e.paint.get("model-emissive-strength").evaluate(i,r,s);n.evaluatedTranslation=e.paint.get("model-translation").evaluate(i,r,s),n.evaluatedScale=e.paint.get("model-scale").evaluate(i,r,s),o&&(Qb(n),n.partStyleUBO?n.partStyleUBO.update(n.partStyle):(n.needsPartStyleUBO=!0,this.needsPartStyleUBOs=!0))}this.dirty=!1}elevationUpdate(e,t,i,n){const r=e.findDEMTileFor(i);if(r&&(r.tileID.canonical!==this.terrainTile||t!==this.terrainExaggeration)){if
vendor: 18,109 bytes, line 2
2(r.dem&&r.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=r.tileID.overscaledZ;const t=Wp.create(e,i,r);if(!t)return;4&this.modelTraits&&this.updateDEM(e,t,i,n);for(const e of this.getNodesInfo()){const i=e.node;if(!i.footprint||!i.footprint.vertices||!i.footprint.vertices.length)continue;const n=i.footprint.vertices;let r=t.getElevationAt(n[0].x,n[0].y,!0,!0);for(let e=1;e<n.length;e++)r=Math.min(r,t.getElevationAt(n[e].x,n[e].y,!0,!0));i.elevation=r}}this.terrainTile=r.tileID.canonical,this.terrainExaggeration=t}}updateDEM(e,t,i,n){let r=t._dem._modifiedForSources[n];if(void 0===r&&(t._dem._modifiedForSources[n]=[],r=t._dem._modifiedForSources[n]),r.includes(i.canonical))return;const o=t._dem.dim;r.push(i.canonical);let s=!1;for(const e of this.getNodesInfo()){const i=e.node;if(!i.footprint||!i.footprint.grid)continue;const n=i.footprint.grid,r=t.tileCoordToPixel(n.min.x,n.min.y),a=t.tileCoordToPixel(n.max.x,n.max.y),l=Math.min(Math.min(o-a.y,r.x),Math.min(r.y,o-a.x));if(l<0)continue;const c=it(l,2,5);let u=Math.max(0,r.x-c),h=Math.max(0,r.y-c),d=Math.min(a.x+c,o-1),f=Math.min(a.y+c,o-1);for(let e=h;e<=f;++e)for(let t=u;t<=d;++t)$b[e*o+t]=255;let p=0,m=0;for(let e=0;e<n.cellsY;++e)for(let i=0;i<n.cellsX;++i){if(!n.cells[e*n.cellsX+i])continue;const r=t.tileCoordToPixel(n.min.x+i/n.xScale,n.min.y+e/n.yScale),s=t.tileCoordToPixel(n.min.x+(i+1)/n.xScale,n.min.y+(e+1)/n.yScale);for(let e=r.y;e<=Math.min(s.y+1,o-1);++e)for(let i=r.x;i<=Math.min(s.x+1,o-1);++i)255===$b[e*o+i]&&($b[e*o+i]=0,p+=t.getElevationAtPixel(i,e),m++)}const _=p/m;u=Math.max(1,r.x-c),h=Math.max(1,r.y-c),d=Math.min(a.x+c,o-2),f=Math.min(a.y+c,o-2),s=!0;for(let e=h;e<=f;++e)for(let i=u;i<=d;++i)0===$b[e*o+i]&&(Gb[e*o+i]=t._dem.set(i,e,_));for(let e=1;e<c;++e){u=Math.max(1,r.x-e),h=Math.max(1,r.y-e),d=Math.min(a.x+e,o-2),f=Math.min(a.y+e,o-2);for(let i=h;i<=f;++i)for(let n=u;n<=d;++n){const r=i*o+n;if(255===$b[r]){let s=0,a=0,l=-1,u=-1;for(let t=-1;t<=1;++t)for(let r=-1;r<=1;++r){const c=(i+t)*o+n+r;if($b[c]>=e)continue;const h=Gb[c],d=Math.abs(h);d>a&&(s=h,a=d,l=r,u=t)}if(a>.1){const o=1-(e+.5*Math.abs(l*u))/c;let a=t._dem.get(n,i)+s*o;const h=t._dem.get(n+l,i+u),d=t._dem.get(n-l,i-u,!0);(a-h)*(a-d)>0&&(a=(h+d)/2),Gb[r]=t._dem.set(n,i,a),$b[r]=e}}}}}s&&(t._demTile.needsDEMTextureUpload=!0,t._dem._timestamp=Vt.now())}setFilter(e){this.filter=e?ll(e):null}getNodesInfo(){return this.filter?this.nodesInfo.filter(e=>this.filter.filter(new Ha(this.id.overscaledZ,{worldview:this.worldview}),e.feature,this.id.canonical)):this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const t of e)zy(t.node),Oy(t.node),t.partStyleUBO&&(t.partStyleUBO.destroy(),t.partStyleUBO=null)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const i=t.getReplacementRegionsForTile(e.toUnwrapped());for(const e of this.getNodesInfo()){const t=e.node.footprint;e.hiddenByReplacement=!!t&&!i.some(e=>e.footprint===t)}}getHeightAtTileCoord(e,t){const i=[0,0,0],n=d([]);for(const r of this.getNodesInfo()){const o=r.node.meshes[0],s=o.transformedAabb;if(e<s.min[0]||t<s.min[1]||e>s.max[0]||t>s.max[1])continue;if(!0===r.node.hidden)return{height:1/0,maxHeight:r.feature.properties.height,hidden:!1,verticalScale:r.evaluatedScale[2]};if(p(n,r.node.globalMatrix),i[0]=e,i[1]=t,i[2]=0,X(i,i,n),r.node.meshBVH){const e=i[0],t=i[1];Hb[0]=e-1,Hb[1]=t-1,Hb[2]=-1e3,Zb[0]=e+1,Zb[1]=t+1,Zb[2]=1e3;const n=r.node.meshBVH.findHighestPoint(Hb,Zb);if(null!==n)return{height:n,maxHeight:r.feature.properties.height,hidden:r.hiddenByReplacement,verticalScale:r.evaluatedScale[2]};continue}if(!o.heightmap)continue;const a=(i[0]-o.aabb.min[0])/(o.aabb.max[0]-o.aabb.min[0])*Sy|0,l=Math.min(63,(i[1]-o.aabb.min[1])/(o.aabb.max[1]-o.aabb.min[1])*Sy|0)*Sy+Math.min(63,a),c=o.heightmap[l];if(c<0&&r.node.footprint){const i=[];if(r.node.footprint.grid.query(new Pe(e,t),new Pe(e,t),i),i.length>0)return{height:void 0,maxHeight:r.feature.properties.height,hidden:r.hiddenByReplacement,verticalScale:r.evaluatedScale[2]};continue}if(r.hiddenByReplacement)return;return{height:c,maxHeight:r.feature.properties.height,hidden:!1,verticalScale:r.evaluatedScale[2]}}}}function Jb(e,t){return e instanceof js&&!e.isLightConstant&&t}function Kb(e,t){e[t+4]=16*Math.floor(15*e[t+4])/255,e[t+5]=16*Math.floor(15*e[t+5])/255,e[t+6]=Math.min(Math.floor(127.5*e[t+6]+.5),255)/255*2,e[t+7]=Math.floor(255*e[t+7])/255;const i=Math.floor(255*e[t+10])/256,n=Math.floor(255*(e[t+10]+e[t+11]))/256;e[t+10]=i,e[t+11]=n-i}function Qb(e){const t=e.partStyle;for(let i=0;i<Iy.length;i++){const n=e.evaluatedColor[i],r=e.evaluatedRMEA[i],o=e.emissionHeightBasedParams[i],s=it(o[0],0,1),a=it(o[1],0,1),l=16*i;t[l]=n[0],t[l+1]=n[1],t[l+2]=n[2],t[l+3]=it(n[3],0,1),t[l+4]=r[0],t[l+5]=r[1],t[l+6]=it(r[2],0,2),t[l+7]=r[3],s!==a?(t[l+8]=s,t[l+9]=a,t[l+10]=it(o[2],0,1),t[l+11]=it(o[3],0,1)-t[l+10],t[l+12]=Math.pow(10,it(o[4],-1,1))):(t[l+8]=0,t[l+9]=1,t[l+10]=1,t[l+11]=0,t[l+12]=1),Kb(t,l)}}Ys(Xb,"Tiled3dModelBucket",{omit:["layers"]}),Ys(Yb,"Tiled3dModelFeature",{omit:["partStyleUBO"]});class ew{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const i=e[t];this._stringToNumber[i]=t,this._numberToString[t]=i}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const tw=["id","tile","layer","source","sourceLayer","state"];class iw{constructor(e,t,i,n,r){this.type="Feature",this._vectorTileFeature=e,this._z=t,this._x=i,this._y=n,this.properties=e?e.properties:{},this.id=r}clone(){const e=new iw(this._vectorTileFeature,this._z,this._x,this._y,this.id);return this.state&&(e.state={...this.state}),this.layer&&(e.layer={...this.layer}),this.source&&(e.source=this.source),this.sourceLayer&&(e.sourceLayer=this.sourceLayer),e}get geometry(){return void 0===this._geometry&&this._vectorTileFeature&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};for(const t of tw)void 0!==this[t]&&(e[t]=this[t]);return e}}const nw={BaseColor:5,MetallicRoughness:6,Normal:7,Occlusion:8,Emission:9,LUT:10,ShadowMap0:11},rw=new Float32Array(d([])),ow=[0,0,0],sw=(e,t,i,n,r,o,a,c,u,h,d,f,p,m=[0,0,0],_,g,y,v=1,x=!1)=>{let b=ow,w=0,T=ow;if(!x){const e=r.style.light,t=e.properties.get("position");if(b=[-t.x,-t.y,t.z],"viewport"===e.properties.get("anchor")){const e=s();l(e,-r.transform.angle),J(b,b,e)}const i=e.properties.get("color").toNonPremultipliedRenderColor(null);w=e.properties.get("intensity"),T=[i.r,i.g,i.b]}const E="MASK"===d.alphaMode,S=p.paint.get("model-ambient-occlusion-intensity"),I=p.paint.get("model-color").constantOr(mn.white).toNonPremultipliedRenderColor(null);return I.a=p.paint.get("model-color-mix-intensity").constantOr(0),y&&(I.r=y[0],I.g=y[1],I.b=y[2],I.a=y[3]),g&&(I.r=g.color.r,I.g=g.color.g,I.b=g.color.b,I.a=g.colorMix,f=g.emissionStrength,o*=g.opacity),{u_matrix:e,u_lighting_matrix:t,u_normal_matrix:i,u_node_matrix:n||rw,u_lightpos:b,u_lightintensity:w,u_lightcolor:T,u_camera_pos:m,u_opacity:o,u_baseTextureIsAlpha:0,u_alphaMask:+E,u_alphaCutoff:d.alphaCutoff,u_baseColorFactor:a.toNonPremultipliedRenderColor(null).toArray01(),u_emissiveFactor:c.toNonPremultipliedRenderColor(null).toArray01(),u_metallicFactor:u,u_roughnessFactor:h,u_baseColorTexture:nw.BaseColor,u_metallicRoughnessTexture:nw.MetallicRoughness,u_normalTexture:nw.Normal,u_occlusionTexture:nw.Occlusion,u_emissionTexture:nw.Emission,u_lutTexture:nw.LUT,u_color_mix:I.toArray01(),u_aoIntensity:S,u_emissive_strength:f,u_occlusionTextureTransform:_||[0,0,0,0],u_dithered_discard_threshold:v,u_model_mesh_params:[0,1,0,0]}},aw=(e,t=rw,i=rw)=>({u_matrix:e,u_instance:t,u_node_matrix:i}),lw=7680;class cw{constructor(e,t,i,n,r,o){this.test=e,this.ref=t,this.mask=i,this.fail=n,this.depthFail=r,this.pass=o}}cw.disabled=new cw({func:519,mask:0},0,0,lw,lw,lw);const uw=770,hw=771;class dw{constructor(e,t,i,n){this.blendFunction=e,this.blendColor=t.toNonPremultipliedRenderColor(null),this.mask=i,this.blendEquation=n}}dw.Replace=[1,0,1,0],dw.disabled=new dw(dw.Replace,mn.transparent,[!1,!1,!1,!1]),dw.unblended=new dw(dw.Replace,mn.transparent,[!0,!0,!0,!0]),dw.alphaBlended=new dw([1,hw,1,hw],mn.transparent,[!0,!0,!0,!0]),dw.alphaBlendedNonPremultiplied=new dw([uw,hw,uw,hw],mn.transparent,[!0,!0,!0,!0]),dw.multiply=new dw([774,0,774,0],mn.transparent,[!0,!0,!0,!0]),dw.multiplyAccumulateAlpha=new dw([774,0,1,hw],mn.transparent,[!0,!0,!0,!0]),dw.additive=new dw([1,1,1,1],mn.transparent,[!0,!0,!0,!0]),dw.additiveAlphaWeighted=new dw([uw,1,773,1],mn.transparent,[!0,!0,!0,!0]),dw.additiveAlphaWeightedUnboundedAlpha=new dw([uw,1,1,1],mn.transparent,[!0,!0,!0,!0]);class fw{constructor(e,t,i){this.func=e,this.mask=t,this.range=i}}fw.ReadOnly=!1,fw.ReadWrite=!0,fw.disabled=new fw(519,fw.ReadOnly,[0,1]);const pw=1029,mw=2305;class _w{constructor(e,t,i){this.enable=e,this.mode=t,this.frontFace=i}}_w.disabled=new _w(!1,pw,mw),_w.backCCW=new _w(!0,pw,mw),_w.backCW=new _w(!0,pw,2304),_w.frontCW=new _w(!0,1028,2304),_w.frontCCW=new _w(!0,1028,mw);class gw{constructor(e=0,t=0,i=0,n=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(i)||i<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=i,this.right=n}interpolate(e,t,i){return null!=t.top&&null!=e.top&&(this.top=fn(e.top,t.top,i)),null!=t.bottom&&null!=e.bottom&&(this.bottom=fn(e.bottom,t.bottom,i)),null!=t.left&&null!=e.left&&(this.left=fn(e.left,t.left,i)),null!=t.right&&null!=e.right&&(this.right=fn(e.right,t.right,i)),this}getCenter(e,t){return new Pe(it((this.left+e-this.right)/2,0,e),it((this.top+t-this.bottom)/2,0,t))}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new gw(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function yw(e,t){const i=St(e,3);I(e,t),It(e,3,i)}function vw(e,t){const i=ue([]);return pe(i,i,-t),de(i,i,-e),i}function xw(e,t){const i=[e[0],e[1],0],n=[t[0],t[1],0];if(R(i)>=1e-15){const e=Z([],i);V(n,e,q(n,e)),t[0]=n[0],t[1]=n[1]}const r=W([],t,e);if(ne(r)<1e-15)return null;const o=Math.atan2(-r[1],r[0]);return vw(Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2]),o)}class bw{constructor(e,t){this.position=e,this.orientation=t}get position(){return this._position}set position(e){if(e){const t=e instanceof Ac?e:new Ac(e[0],e[1],e[2]);this._renderWorldCopies&&(t.x=rt(t.x,0,1)),this._position=t}else this._position=null}lookAtPoint(e,t,i){if(this.orientation=null,!this.position)return;const n=this.position,r=i||(this._elevation?this._elevation.getAtPointOrZero(Ac.fromLngLat(e)):0),o=Ac.fromLngLat(e,r),s=[o.x-n.x,o.y-n.y,o.z-n.z];t||(t=[0,0,1]),t[2]=Math.abs(t[2]),this.orientation=xw(s,t)}setPitchBearing(e,t){this.orientation=vw(Je(e),Je(-t))}}class ww{constructor(e,t){this._transform=d([]),this.orientation=t,this.position=e}get mercatorPosition(){const e=this.position;return new Ac(e[0],e[1],e[2])}get position(){const e=St(this._transform,3);return[e[0],e[1],e[2]]}set position(e){var t;e&&It(this._transform,3,[(t=e)[0],t[1],t[2],1])}get orientation(){return this._orientation}set orientation(e){this._orientation=e||ue([]),e&&yw(this._transform,this._orientation)}getPitchBearing(){const e=this.forward(),t=this.right();return{bearing:Math.atan2(-t[1],t[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}setPitchBearing(e,t){this._orientation=vw(e,t),yw(this._transform,this._orientation)}forward(){const e=St(this._transform,2);return[-e[0],-e[1],-e[2]]}up(){const e=St(this._transform,1);return[-e[0],-e[1],-e[2]]}right(){const e=St(this._transform,0);return[e[0],e[1],e[2]]}getCameraToWorld(e,t){const i=new Float64Array(16);return p(i,this.getWorldToCamera(e,t)),i}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(e,t,i){const n=this.position;V(n,n,-e);const r=new Float64Array(16);return w(r,[i,i,i]),_(r,r,n),r[10]*=t,r}getWorldToCamera(e,t){const i=new Float64Array(16),n=new Float64Array(4),r=this.position;var o,s;return(o=n)[0]=-(s=this._orientation)[0],o[1]=-s[1],o[2]=-s[2],o[3]=s[3],V(r,r,-e),I(i,n),_(i,i,r),i[1]*=-1,i[5]*=-1,i[9]*=-1,i[13]*=-1,i[8]*=t,i[9]*=t,i[10]*=t,i[11]*=t,i}getCameraToClipPerspective(e,t,i,n){const r=new Float64Array(16);return A(r,e,t,i,n),r}getCameraToClipOrthographic(e,t,i,n,r,o){const s=new Float64Array(16);return M(s,e,t,i,n,r,o),s}getDistanceToElevation(e,t=!1){const i=0===e?0:xc(e,t?mr(this.position[1]):this.position[1]),n=this.forward();return(i-this.position[2])/n[2]}clone(){return new ww([...this.position],[...this.orientation])}}const Tw=Math.tan(85*Math.PI/180);function Ew(e,t,i,n,r,s,a){const l=c();if(i)if("globe"===s.name){const e=function(e,t){const{x:i,y:n}=e.point,r=Xf(i,n,e.worldSize/e._pixelsPerMercatorPixel,0,0);return m(r,r,qf(kf(t)))}(r,t);m(l,l,e)}else{const e=o([],a);l[0]=e[0],l[1]=e[1],l[4]=e[2],l[5]=e[3],n||x(l,l,r.angle)}else m(l,r.labelPlaneMatrix,e);return l}function Sw(e,t,i,n){const r=[e,t,i,1];i?le(r,r,n):Zp(r,r,n);const o=r[3];return r[0]/=o,r[1]/=o,r[2]/=o,r}function Iw(e,t){return Math.min(.5+e/t*.5,1.5)}function Aw(e,t){const i=e[0]/e[3],n=e[1]/e[3];return i>=-t[0]&&i<=t[0]&&n>=-t[1]&&n<=t[1]}function Mw(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g){const{lineStartIndex:y,glyphStartIndex:v,segment:x}=a,b=v+a.numGlyphs,w=y+a.lineLength,T=t.getoffsetX(v),E=t.getoffsetX(b-1),S=zw(e*T,i,n,r,o,s,x,y,w,l,c,u,h,d,!0,f,p,m,_,g);if(!S)return null;const I=zw(e*E,i,n,r,o,s,x,y,w,l,c,u,h,d,!0,f,p,m,_,g);return I?{first:S,last:I}:null}function Cw(e,t,i,n){return e===Xd.horizontal&&Math.abs(n)>Math.abs(i)?{useVertical:!0}:e===Xd.vertical?n>0?{needsFlipping:!0}:null:0!==t&&function(e,t){return 0===e||Math.abs(t/e)>Tw}(i,n)?1===t?{needsFlipping:!0}:null:i<0?{needsFlipping:!0}:null}function Dw(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x){const b=t/24,w=e.lineOffsetX*b,T=e.lineOffsetY*b,{lineStartIndex:E,glyphStartIndex:S,numGlyphs:I,segment:A,writingMode:M,flipState:C}=e,D=E+e.lineLength,P=e=>{if(u){const[t,i,n]=e.up,r=c.length;s_(u,r+0,t,i,n),s_(u,r+1,t,i,n),s_(u,r+2,t,i,n),s_(u,r+3,t,i,n)}const[t,i,n]=e.point;a_(c,t,i,n,e.angle)};if(I>1){const t=Mw(b,a,w,T,i,h,d,e,l,o,f,m,!1,_,g,y,v,x);if(!t)return{notEnoughRoom:!0};if(n&&!i){let[i,n,r]=t.first.point,[o,a,l]=t.last.point;[i,n]=Sw(i,n,r,s),[o,a]=Sw(o,a,l,s);const c=Cw(M,C,(o-i)*p,a-n);if(e.flipState=c&&c.needsFlipping?1:2,c)return c}P(t.first);for(let e=S+1;e<S+I-1;e++){const t=zw(b*a.getoffsetX(e),w,T,i,h,d,A,E,D,l,o,f,m,!1,!1,_,g,y,v,x);if(!t)return c.length-=4*(e-S),{notEnoughRoom:!0};P(t)}P(t.last)}else{if(n&&!i){const t=Sw(d.x,d.y,0,r),i=E+A+1,n=new Pe(l.getx(i),l.gety(i)),o=Sw(n.x,n.y,0,r),s=o[3]>0?o:Lw(d,n,t,1,r,void 0,_,g.canonical),a=Cw(M,C,(s[0]-t[0])*p,s[1]-t[1]);if(e.flipState=a&&a.needsFlipping?1:2,a)return a}const t=zw(b*a.getoffsetX(S),w,T,i,h,d,A,E,D,l,o,f,m,!1,!1,_,g,y,v,x);if(!t)return{notEnoughRoom:!0};P(t)}return{}}function Pw(e,t,i){const n=1<<t.z;let r=(e.x/Cr+t.x)/n-i.mercCenter[0];const o=(e.y/Cr+t.y)/n-i.mercCenter[1];r-=Math.round(r);const s=[r*Cr,o*Cr,Cr/(2*Math.PI),1];return le(s,s,i.invMatrix),[s[0],s[1],s[2]]}function Rw(e,t,i,n,r,o){let{x:s,y:a,z:l}=n.projectTilePoint(e.x,e.y,t);if(o){const[i,n,r]=Pw(e,t,o);s+=(i-s)*o.t,a+=(n-a)*o.t,l+=(r-l)*o.t}if(!r)return Sw(s,a,l,i);const[c,u,h]=r.getElevation(e,r.elevation,r.elevationFeature);return Sw(s+c,a+u,l+h,i)}function Lw(e,t,i,n,r,o,s,a,l){const c=Rw(e.sub(t)._unit()._add(e),a,r,s,o,l);return te(c,i,c),Z(c,c),U(c,i,c,n)}function zw(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v){const x=n?e-t:e+t;let b=x>0?1:-1,w=0;n&&(b*=-1,w=Math.PI),b<0&&(w+=Math.PI);let T=a+s+(b>0?0:1)|0,E=r,S=r,I=0,A=0;const M=Math.abs(x),C=[],D=[];let P=o,R=P,L=Q([]);const z=()=>Lw(R,P,S,M-I+1,u,d,m,_.canonical,v);for(;I+A<=M;){if(T+=b,T<a||T>=l)return null;if(S=E,R=P,C.push(S),f&&D.push(R),P=new Pe(c.getx(T),c.gety(T)),E=h[T],!E){const e=Rw(P,_.canonical,u,m,d,v);E=e[3]>0?h[T]=e:z()}I+=A;const e=te([],E,S),t=j(S,E);if(i&&t>0&&A>0&&q(L,e)/(A*t)<y)return null;A=t,L=e}p&&d&&(h[T]&&(E=z(),A=j(S,E),L=te([],E,S)),h[T]=E);const F=(M-I)/A,O=P.sub(R)._mult(F)._add(R),k=U([],S,L,F);let B=[0,0,1],N=L[0],V=L[1];if(g&&(B=m.upVector(_.canonical,O.x,O.y),0!==B[0]||0!==B[1]||1!==B[2])){const e=[B[2],0,-B[0]],t=W([],B,e);Z(e,e),Z(t,t),N=q(L,e),V=q(L,t)}if(i){const e=W([],B,L);Z(e,e),U(k,k,e,i*b)}const G=w+Math.atan2(V,N);return C.push(k),f&&D.push(O),{point:k,angle:G,path:C,tilePath:D,up:B}}function Fw(e,t){const i=t.length,n=i+4*e;t.resize(n),t.float32.fill(-1/0,4*i,4*n)}const Ow=15;class kw{constructor(e,t,i,n,r,o,s){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=e||0,this._maxZoom=t||22,this._minPitch=i??0,this._maxPitch=n??60,this.setProjection(o),this.setMaxBounds(s),this.width=0,this.height=0,this._center=new gc(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._nearClipOffset=0,this._unmodified=!0,this._edgeInsets=new gw,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new ww,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1,this._allowWorldUnderZoom=!1,this.mercatorMatrix=new Float64Array(16),this.mercatorFogMatrix=new Float32Array(16),this.invProjMatrix=new Float64Array(16),this._expandedFarZProjMatrixBuf=new Float64Array(16),this.expandedFarZProjMatrix=this._expandedFarZProjMatrixBuf,this.starsProjMatrix=new Float32Array(16),this.skyboxMatrix=new Float32Array(16),this._mat4Scratch=new Float64Array(16),this.alignedProjMatrix=new Float64Array(16),this.labelPlaneMatr
vendor: 1,790 bytes, line 2
2ix=new Float32Array(16),this.glCoordMatrix=new Float32Array(16),this.pixelMatrix=new Float64Array(16),this.pixelMatrixInverse=new Float64Array(16)}clone(){const e=new kw(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection(),this.maxBounds);return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._nearClipOffset=this._nearClipOffset,e._averageElevation=this._averageElevation,e._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e._allowWorldUnderZoom=this._allowWorldUnderZoom,e}get isOrthographic(){return"globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<Ow}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}get nearClipOffset(){return this._nearClipOffset}set nearClipOffset(e){this._nearClipOffset=e,this._calcMatrices()}get depthOcclusionForSymbolsAndCircles(){return"globe"!==this.projection.name&&!this.isOrthographic}updateElevation(e,t=!1){const i=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForE
vendor: 41,383 bytes, line 2
2xaggeration;(null==this._seaLevelZoom||i)&&this._updateCameraOnTerrain(),(e||i)&&this._constrainCamera(t),this._calcMatrices()}getProjection(){return st(this.projection,["name","center","parallels"])}setProjection(e){this.projectionOptions=e||{name:"mercator"};const t=this.projection?this.getProjection():void 0;this.projection=Pp(this.projectionOptions);const i=!Re(t,this.getProjection());return i&&this._calcMatrices(),this.mercatorFromTransition=!1,i}setOrthographicProjectionAtLowPitch(e){return this._orthographicProjectionAtLowPitch!==e&&(this._orthographicProjectionAtLowPitch=e,this._calcMatrices(),!0)}setMercatorFromTransition(){const e=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=Pp({name:"mercator"});const t=e!==this.projection.name;return t&&this._calcMatrices(),t}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get cameraWorldSize(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return xc(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new Pe(this.width,this.height)}get bearing(){return rt(this.rotation,-180,180)}set bearing(e){this.rotation=e}get rotation(){return-this.angle/Math.PI*180}set rotation(e){const t=-e*Math.PI/180;if(this.angle===t)return;this._unmodified=!1,this.angle=t,this._calcMatrices();const i=Math.sin(this.angle),n=Math.cos(this.angle);this.rotationMatrix=[n,i,-i,n]}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const t=it(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==t&&(this._unmodified=!1,this._pitch=t,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=Je(e),this._calcMatrices())}get fovX(){return this._fov}get fovY(){const e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}get horizontalFov(){return Ke(2*Math.atan(Math.tan(.5*this._fov)*this.aspect))}get averageElevation(){return this._averageElevation}set averageElevation(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._setZoom(t),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(e){this._tileCoverLift!==e&&(this._tileCoverLift=e)}_updateCameraOnTerrain(){const e=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,t=this.elevation&&e===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>0&&this._centerAltitudeValidForExaggeration;if(!this._elevation||e===Number.NEGATIVE_INFINITY&&(!t||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const i=this._elevation;t||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&i.exaggeration()&&this._centerAltitudeValidForExaggeration!==i.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*i.exaggeration(),this._centerAltitudeValidForExaggeration=i.exaggeration()):(this._centerAltitude=e||0,this._centerAltitudeValidForExaggeration=i.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){if(void 0===this._centerAltitudeValidForExaggeration)return;const e=Math.max(0,(this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize);this._seaLevelZoom=this._zoomFromMercatorZ(e)}sampleAverageElevation(){if(!this._elevation)return 0;const e=this._elevation,t=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],i=this.horizonLineFromTop();let n=0,r=0;for(let o=0;o<t.length;o++){const s=new Pe(t[o][0]*this.width,i+t[o][1]*(this.height-i)),a=e.pointCoordinate(s);if(!a)continue;const l=1/Math.hypot(a[0]-this._camera.position[0],a[1]-this._camera.position[1]);n+=a[3]*l,r+=l}return 0===r?NaN:n/r}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;const e=this._seaLevelZoom,t=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),i=this.pixelsPerMeter/this.worldSize*t,n=this._mercatorZfromZoom(e),r=this._mercatorZfromZoom(this._maxZoom),o=Math.max(n-i,r);this._setZoom(this._zoomFromMercatorZ(o))}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}equals(e){const t=this.elevation,i=e.elevation,n=null!=t!=(null!=i)||t&&i&&t.exaggeration()!==i.exaggeration();return this.width===e.width&&this.height===e.height&&this.center.lng===e.center.lng&&this.center.lat===e.center.lat&&this.zoom===e.zoom&&this.bearing===e.bearing&&this.pitch===e.pitch&&this.fov===e.fov&&this.projection.name===e.projection.name&&this._edgeInsets.equals(e.padding)&&!n}computeZoomRelativeTo(e){const t=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,e.toAltitude()));let i;i=e.z<this._camera.position[2]?[t.x,t.y,t.z]:[e.x,e.y,e.z];const n=R(te([],this._camera.position,i));return it(this._zoomFromMercatorZ(n),this._minZoom,this._maxZoom)}setFreeCameraOptions(e){if(!this.height)return;if(!e.position&&!e.orientation)return;this._updateCameraState();let t=!1;if(e.orientation&&!((i=e.orientation)[0]===(n=this._camera.orientation)[0]&&i[1]===n[1]&&i[2]===n[2]&&i[3]===n[3])&&(t=this._setCameraOrientation(e.orientation)),e.position){const i=[e.position.x,e.position.y,e.position.z];ee(i,this._camera.position)||(this._setCameraPosition(i),t=!0)}var i,n;t&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const e=this._camera.position,t=new bw;return t.position=new Ac(e[0],e[1],e[2]),t.orientation=this._camera.orientation,t._elevation=this.elevation,t._renderWorldCopies=this.renderWorldCopies,t}_setCameraOrientation(e){if(!function(e){var t=e[0],i=e[1],n=e[2],r=e[3];return Math.sqrt(t*t+i*i+n*n+r*r)}(e))return!1;ye(e,e);const t=K([],[0,0,-1],e),i=K([],[0,-1,0],e);if(i[2]<0)return!1;const n=xw(t,i);return!!n&&(this._camera.orientation=n,!0)}_setCameraPosition(e){const t=this.zoomScale(this.minZoom)*this.tileSize,i=this.zoomScale(this.maxZoom)*this.tileSize,n=this.cameraToCenterDistance;e[2]=it(e[2],n/i,n/t),this._camera.position=e}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,i){this._unmodified=!1,this._edgeInsets.interpolate(e,t,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(e){const t=[new op(0,e)];if(this.renderWorldCopies){const i=this.pointCoordinate(new Pe(0,0)),n=this.pointCoordinate(new Pe(this.width,0)),r=this.pointCoordinate(new Pe(this.width,this.height)),o=this.pointCoordinate(new Pe(0,this.height)),s=Math.floor(Math.min(i.x,n.x,r.x,o.x)),a=Math.floor(Math.max(i.x,n.x,r.x,o.x)),l=1;for(let i=s-l;i<=a+l;i++)0!==i&&t.push(new op(i,e))}return t}isLODDisabled(e){return(!e||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}extendTileCover(e,t,i,n){let r=[];const o=null!=i,s=!o;if(s&&this.zoom<t)return r;if(o&&0===i[0]&&0===i[1])return r;const a=new Set,l=(e,t,i,n,o)=>{const s=ap(t,e,i,n,o);a.has(s)||(r.push(new sp(e,t,i,n,o)),a.add(s))};for(let r=0;r<e.length;r++){const a=e[r];if(s&&a.canonical.z!==t)continue;if(o&&void 0!==n&&n>a.canonical.z)continue;const c=a.canonical,u=a.overscaledZ,h=a.wrap,d=1<<c.z,f=c.x+1<d,p=c.x>0,m=c.y+1<d,_=c.y>0,g=a.wrap-(p?0:1),y=a.wrap+(f?0:1),v=p?c.x-1:d-1,x=f?c.x+1:0;if(o)i[0]<0?(l(u,y,c.z,x,c.y),i[1]<0&&m&&(l(u,h,c.z,c.x,c.y+1),l(u,y,c.z,x,c.y+1)),i[1]>0&&_&&(l(u,h,c.z,c.x,c.y-1),l(u,y,c.z,x,c.y-1))):i[0]>0?(l(u,g,c.z,v,c.y),i[1]<0&&m&&(l(u,h,c.z,c.x,c.y+1),l(u,g,c.z,v,c.y+1)),i[1]>0&&_&&(l(u,h,c.z,c.x,c.y-1),l(u,g,c.z,v,c.y-1))):i[1]<0&&m?l(u,h,c.z,c.x,c.y+1):_&&l(u,h,c.z,c.x,c.y-1);else{const e=a.visibleQuadrants;1&e&&(l(u,g,c.z,v,c.y),_&&(l(u,h,c.z,c.x,c.y-1),l(u,g,c.z,v,c.y-1))),2&e&&(l(u,y,c.z,x,c.y),_&&(l(u,h,c.z,c.x,c.y-1),l(u,y,c.z,x,c.y-1))),4&e&&(l(u,g,c.z,v,c.y),m&&(l(u,h,c.z,c.x,c.y+1),l(u,g,c.z,v,c.y+1))),8&e&&(l(u,y,c.z,x,c.y),m&&(l(u,h,c.z,c.x,c.y+1),l(u,y,c.z,x,c.y+1)))}}const c=[];for(const e of r)r.some(t=>e.isChildOf(t))||c.push(e);if(r=c.filter(i=>!e.some(e=>!!(i.overscaledZ<t&&e.isChildOf(i))||i.equals(e)||i.isChildOf(e))),s){const e=1<<t,i="globe"===this.projection.name?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),n=[e*i.x,e*i.y],o=4,s=o*o;r=r.filter(e=>{const t=e.canonical.x+.5-n[0],i=e.canonical.y+.5-n[1];return t*t+i*i<s})}return r}extendTileCoverToNearPlane(e,t,i){const n=[],r=new Set;for(const t of e)r.add(t.key);const o=(e,t,i,o,s)=>{const a=ap(t,e,i,o,s);r.has(a)||(n.push(new sp(e,t,i,o,s)),r.add(a))},s=e.reduce((e,t)=>Math.max(e,t.overscaledZ),i),a=1<<i,l=[new Pe(0,0),new Pe(Cr,0),new Pe(Cr,Cr),new Pe(0,Cr)],c=new Pe(0,0),u=new Pe(0,0),h=(e,t)=>{const n=Math.floor(e[0]),r=Math.floor(e[1]),h=(e[0]-n)*Cr,d=(e[1]-r)*Cr,f=Math.floor(t[0]),p=Math.floor(t[1]),m=(t[0]-f)*Cr,_=(t[1]-p)*Cr;for(let e=-1;e<=1;e++){const t=n+e;if(!(t<0||t>=a)){c.x=h-e*Cr,u.x=m-(t-f)*Cr;for(let e=-1;e<=1;e++){const n=r+e;c.y=d-e*Cr,u.y=_-(n-p)*Cr,Jh(c,u,l)&&o(s,0,i,t,n)}}}},d=t.points,f=d[3],p=d[2],m=this._projectToGround(f,d[7]),_=this._projectToGround(p,d[6]);return h(f,m),h(p,_),n}_projectToGround(e,t){return Y(D(),e,t,e[2]/(e[2]-t[2]))}_projectToZ(e,t,i){const n=e[2]-t[2];return Math.abs(n)<1e-6?P(e):Y(D(),e,t,(e[2]-i)/n)}extendTileCoverForTunnels(e,t,i,n){if(i<18)return[];const r=t.points,o=r[0],s=r[1],a=r[4],l=r[5];if(a[2]>=0&&l[2]>=0||o[2]<=0||s[2]<=0)return[];const c=a[2]<0?this._projectToZ(o,a,0):a,u=l[2]<0?this._projectToZ(s,l,0):l,h=-n,d=a[2]<h?this._projectToZ(o,a,h):a,f=l[2]<h?this._projectToZ(s,l,h):l,p=this._findExtensionTilesInQuad(e,i,[f,d,u,c],[.5*(c[0]+u[0]),.5*(c[1]+u[1])]);return p.length>3&&(p.length=3),p}_findExtensionTilesInQuad(e,t,i,n){const r=[],o=new Set;for(const t of e)o.add(t.key);const s=e.reduce((e,t)=>Math.max(e,t.overscaledZ),t),a=1<<t,l=[new Pe(i[0][0],i[0][1]),new Pe(i[1][0],i[1][1]),new Pe(i[3][0],i[3][1]),new Pe(i[2][0],i[2][1]),new Pe(i[0][0],i[0][1])],c=i[0][0],u=i[1][0],h=i[2][0],d=i[3][0],f=i[0][1],p=i[1][1],m=i[2][1],_=i[3][1],g=Math.max(0,Math.floor(Math.min(c,u,h,d))),y=Math.min(a-1,Math.ceil(Math.max(c,u,h,d))-1),v=Math.max(0,Math.floor(Math.min(f,p,m,_))),x=Math.min(a-1,Math.ceil(Math.max(f,p,m,_))-1);for(let e=v;e<=x;e++)for(let i=g;i<=y;i++){if(!Xh(l,i,e,i+1,e+1))continue;const n=ap(0,s,t,i,e);o.has(n)||(r.push(new sp(s,0,t,i,e)),o.add(n))}const b=n[0],w=n[1];return r.sort((e,t)=>{const i=e.canonical.x+.5-b,n=e.canonical.y+.5-w,r=t.canonical.x+.5-b,o=t.canonical.y+.5-w;return i*i+n*n-(r*r+o*o)||e.canonical.x-t.canonical.x||e.canonical.y-t.canonical.y}),r}coveringTiles(e){let t=this.coveringZoomLevel(e);const i=t,n=this.elevation&&this.elevation.exaggeration(),r=n&&!e.isTerrainDEM,o="mercator"===this.projection.name;if(void 0!==e.minzoom&&t<e.minzoom)return[];void 0!==e.maxzoom&&t>e.maxzoom&&(t=e.maxzoom);const s=this.locationCoordinate(this.center),a=this.center.lat,l=1<<t,c=[l*s.x,l*s.y,0],u="globe"===this.projection.name,h=!u,d=Df.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t,h),f=u?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),p=l*xc(1,this.center.lat),m=this._camera.position[2]/xc(1,this.center.lat),_=[l*f.x,l*f.y,m*(h?1:p)],g=u||n,y=this.cameraToCenterDistance/e.tileSize*(e.roundZoom?1:.502),v=this.isLODDisabled(!0)?t:0;let x;if(this._elevation&&e.isTerrainDEM)x=1e4*this._elevation.exaggeration();else if(this._elevation){const e=this._elevation.getMinMaxForVisibleTiles();x=e?e.max:this._centerAltitude}else x=this._centerAltitude;const b=e.isTerrainDEM?-x:this._elevation?this._elevation.getMinElevationBelowMSL():0,w=this.projection.isReprojectedInTileSpace?my(this):1,T=e=>{const t=1/4e4,i=new Ac(e.x+t,e.y,e.z),n=new Ac(e.x,e.y+t,e.z),r=e.toLngLat(),o=i.toLngLat(),s=n.toLngLat(),a=this.locationCoordinate(r),l=this.locationCoordinate(o),c=this.locationCoordinate(s),u=Math.hypot(l.x-a.x,l.y-a.y),h=Math.hypot(c.x-a.x,c.y-a.y);return Math.sqrt(u*h)*w/t},E=e=>{const t=x,i=b;return{aabb:up(this,l,0,0,0,e,i,t,this.projection),zoom:0,x:0,y:0,minZ:i,maxZ:t,wrap:e,fullyVisible:!1}},S=[];let I=[];const A=t,M=e.reparseOverscaled?i:t,C=(m-this._centerAltitude)*p,D=e=>{if(!this._elevation||!e.tileID||!o)return;const t=this._elevation.getMinMaxForTile(e.tileID),i=e.aabb;t?(i.min[2]=t.min,i.max[2]=t.max,i.center[2]=(i.min[2]+i.max[2])/2):(e.shouldSplit=R(e),e.shouldSplit||(i.min[2]=i.max[2]=i.center[2]=this._centerAltitude))},P=(e,t)=>{if(.707*t<e)return 1;const i=t/e;return i/(1.4144271570014144+(Math.pow(1.1,i-1.4144271570014144+1)-1)/(1.1-1)-1)},R=e=>{if(e.zoom<v)return!0;if(e.zoom===A)return!1;if(null!=e.shouldSplit)return e.shouldSplit;const t=e.aabb.distanceX(_),n=e.aabb.distanceY(_);let s=C,l=1;if(u){s=e.aabb.distanceZ(_);const t=Math.pow(2,e.zoom),i=mr((e.y+1)/t),n=mr(e.y/t),r=Math.min(Math.max(a,i),n),o=vc(r)/vc(a);if(l=r===a?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,o/this._mercatorScaleRatio),this.zoom<=5&&e.zoom===A-1&&o>=.9)return!0}else if(r&&(s=e.aabb.distanceZ(_)*p),this.projection.isReprojectedInTileSpace&&i<=5){const t=Math.pow(2,e.zoom),i=T(new Ac((e.x+.5)/t,(e.y+.5)/t));l=i>.85?1:i}if(!o&&!u){const i=Math.sqrt(t*t+n*n+s*s);let r=(1<<A-e.zoom)*y*l;return r*=P(Math.max(s,C),i),i<r}let h=Number.MAX_VALUE,d=0;const f=e.aabb.getCorners(),m=[0,0,0];for(const e of f){te(m,e,_),u||(r?m[2]*=p:m[2]=C);const t=q(m,this._camera.forward());t<h&&(h=t,d=Math.abs(m[2]))}let g=(1<<A-e.zoom)*y*l;if(g*=P(Math.max(d,C),h),h<g)return!0;const x=e.aabb.closestPoint(c);return x[0]===c[0]&&x[1]===c[1]};if(this.renderWorldCopies)for(let e=1;e<=3;e++)S.push(E(-e)),S.push(E(e));for(S.push(E(0));S.length>0;){const i=S.pop(),n=i.x,s=i.y;let a=i.fullyVisible;const h=()=>"globe"===this.projection.name&&(0===i.y||i.y===(1<<i.zoom)-1);if(!a){let e=g?i.aabb.intersects(d):i.aabb.intersectsFlat(d);if(0===e&&h()){const t=new rp(i.zoom,n,s);e=Vf(this,l,t,!0).intersects(d)}if(0===e)continue;a=2===e}if(i.zoom===A||!R(i)){const r=i.zoom===A?M:i.zoom;if(e.minzoom&&e.minzoom>r)continue;let o=0;if(!a){let t=g?i.aabb.intersectsPrecise(d):i.aabb.intersectsPreciseFlat(d);if(0===t&&h()){const e=new rp(i.zoom,n,s);t=Vf(this,l,e,!0).intersectsPrecise(d)}if(0===t)continue;if(e.calculateQuadrantVisibility)if(d.containsPoint(i.aabb.center))o=15;else for(let e=0;e<4;e++)0!==i.aabb.quadrant(e).intersects(d)&&(o|=1<<e)}const u=c[0]-(.5+n+(i.wrap<<i.zoom))*(1<<t-i.zoom),f=c[1]-.5-s,p=i.tileID?i.tileID:new sp(r,i.wrap,i.zoom,n,s);e.calculateQuadrantVisibility&&(p.visibleQuadrants=o),I.push({tileID:p,distanceSq:u*u+f*f});continue}for(let e=0;e<4;e++){const t=(n<<1)+e%2,c=(s<<1)+(e>>1),h={aabb:o?i.aabb.quadrant(e):up(this,l,i.zoom+1,t,c,i.wrap,i.minZ,i.maxZ,this.projection),zoom:i.zoom+1,x:t,y:c,wrap:i.wrap,fullyVisible:a,tileID:void 0,shouldSplit:void 0,minZ:i.minZ,maxZ:i.maxZ};r&&!u&&(h.tileID=new sp(i.zoom+1===A?M:i.zoom+1,i.wrap,i.zoom+1,t,c),D(h)),S.push(h)}}if(this.fogCullDistSq){const t=this.fogCullDistSq,i=this.horizonLineFromTop();I=I.filter(n=>{const r=[0,0,0,1],o=[Cr,Cr,0,1],s=this.calculateFogTileMatrix(n.tileID.toUnwrapped());le(r,r,s),le(o,o,s);const a=(h=r,d=o,(u=[])[0]=Math.min(h[0],d[0]),u[1]=Math.min(h[1],d[1]),u[2]=Math.min(h[2],d[2]),u[3]=Math.min(h[3],d[3]),u),l=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e[3]=Math.max(t[3],i[3]),e}([],r,o),c=function(e,t){let i=0;for(let n=0;n<2;++n){const r=0;e[n]>r&&(i+=(e[n]-r)*(e[n]-r)),t[n]<r&&(i+=(r-t[n])*(r-t[n]))}return i}(a,l);var u,h,d;if(0===c)return!0;let f=!1;const p=this._elevation;if(p&&c>t&&0!==i){const t=this.calculateProjMatrix(n.tileID.toUnwrapped());let r;e.isTerrainDEM||(r=p.getMinMaxForTile(n.tileID)),r||(r={min:b,max:x});const o=function(e){const t=Math.round((e+45+360)%360/90)%4;return Qe[t]}(this.rotation),s=[o[0]*Cr,o[1]*Cr,r.max];X(s,s,t),f=(1-s[1])*this.height*.5<i}return c<t||f})}return I.sort((e,t)=>e.distanceSq-t.distanceSq).map(e=>e.tileID)}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log2(e)}project(e){const t=it(e.lat,-85.051129,wc),i=this.projection.project(e.lng,t);return new Pe(i.x*this.worldSize,i.y*this.worldSize)}unproject(e){return this.projection.unproject(e.x/this.worldSize,e.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/xc(1,this.center.lat)/this.worldSize}setLocationAtPoint(e,t){let i,n;const r=this.centerPoint;if("globe"===this.projection.name){const e=this.worldSize;i=(t.x-r.x)/e,n=(t.y-r.y)/e}else{const e=this.pointCoordinate(t),o=this.pointCoordinate(r);i=e.x-o.x,n=e.y-o.y}const o=this.locationCoordinate(e);this.setLocation(new Ac(o.x-i,o.y-n))}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(e,t){return this.projection.locationPoint(this,e,t)}locationPoint3D(e,t){return this.projection.locationPoint(this,e,t,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e,t){return this.coordinateLocation(this.pointCoordinate3D(e,t))}locationCoordinate(e,t){const i=t?xc(t,e.lat):void 0,n=this.projection.project(e.lng,e.lat);return new Ac(n.x,n.y,i)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(e,t){const i=t??this._centerAltitude,n=[e.x,e.y,0,1],r=[e.x,e.y,1,1];le(n,n,this.pixelMatrixInverse),le(r,r,this.pixelMatrixInverse);const o=r[3];se(n,n,1/n[3]),se(r,r,1/o);const s=n[2],a=r[2];return{p0:n,p1:r,t:s===a?0:(i-s)/(a-s)}}screenPointToMercatorRay(e){const t=[e.x,e.y,0,1],i=[e.x,e.y,1,1];return le(t,t,this.pixelMatrixInverse),le(i,i,this.pixelMatrixInverse),se(t,t,1/t[3]),se(i,i,1/i[3]),t[2]=xc(t[2],this._center.lat)*this.worldSize,i[2]=xc(i[2],this._center.lat)*this.worldSize,se(t,t,1/this.worldSize),se(i,i,1/this.worldSize),new Tf([t[0],t[1],t[2]],Z([],te([],i,t)))}rayIntersectionCoordinate(e){const{p0:t,p1:i,t:n}=e,r=xc(t[2],this._center.lat),o=xc(i[2],this._center.lat);return new Ac(fn(t[0],i[0],n)/this.worldSize,fn(t[1],i[1],n)/this.worldSize,fn(r,o,n))}pointCoordinate(e,t=this._centerAltitude){return this.projection.pointCoordinate(this,e.x,e.y,t)}pointCoordinate3D(e,t){if(!this.elevation)return this.pointCoordinate(e,t);let i=this.projection.pointCoordinate3D(this,e.x,e.y);if(i)return new Ac(i[0],i[1],i[2]);let n=0,r=this.horizonLineFromTop();if(e.y>r)return this.pointCoordinate(e,t);const o=.02*r,s=e.clone();for(let e=0;e<10&&r-n>o;e++){s.y=fn(n,r,.66);const e=this.projection.pointCoordinate3D(this,s.x,s.y);e?(r=s.y,i=e):n=s.y}return i?new Ac(i[0],i[1],i[2]):this.pointCoordinate(e)}isPointAboveHorizon(e){return this.projection.isPointAboveHorizon(this,e)}isPointOnSurface(e){if(e.y<0||e.y>this.height||e.x<0||e.x>this.width)return!1;if(this.elevation||this.zoom>=6)return!this.isPointAboveHorizon(e);const t=this.pointCoordinate(e);return t.y>=0&&t.y<=1}_coordinatePoint(e,t){const i=t&&this.elevation?this.elevation.getAtPointOrZero(e,this._centerAltitude):this._centerAltitude,n=[e.x*this.worldSize,e.y*this.worldSize,i+e.toAltitude(),1];return le(n,n,this.pixelMatrix),n[3]>0?new Pe(n[0]/n[3],n[1]/n[3]):new Pe(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:e,left:t}=this._edgeInsets,i=this.height-this._edgeInsets.bottom,n=this.width-this._edgeInsets.right,r=this.pointLocation3D(new Pe(t,e)),o=this.pointLocation3D(new Pe(n,e)),s=this.pointLocation3D(new Pe(n,i)),a=this.pointLocation3D(new Pe(t,i));let l=Math.min(r.lng,o.lng,s.lng,a.lng),c=Math.max(r.lng,o.lng,s.lng,a.lng),u=Math.min(r.lat,o.lat,s.lat,a.lat),h=Math.max(r.lat,o.lat,s.lat,a.lat);const f=Math.pow(2,-this.zoom)/16*270,p="globe"===this.projection.name?1:4,_=(e,t,i,n,r)=>{const o=(e+i)/2,s=(t+n)/2,a=new Pe(o,s),{lng:d,lat:m}=this.pointLocation3D(a),g=Math.max(0,l-d,u-m,d-c,m-h);l=Math.min(l,d),c=Math.max(c,d),u=Math.min(u,m),h=Math.max(h,m),(r<p||g>f)&&(_(e,t,o,s,r+1),_(o,s,i,n,r+1))};if(_(t,e,n,e,1),_(n,e,n,i,1),_(n,i,t,i,1),_(t,i,t,e,1),"globe"===this.projection.name){const[e,t]=function(e){const t=d(new Float64Array(16));m(t,e.pixelMatrix,e.globeMatrix);const i=[0,hc,0],n=[0,dc,0];return X(i,i,t),X(n,n,t),[i[0]>0&&i[0]<=e.width&&i[1]>0&&i[1]<=e.height&&!Qf(e,new gc(e.center.lat,90)),n[0]>0&&n[0]<=e.width&&n[1]>0&&n[1]<=e.height&&!Qf(e,new gc(e.center.lat,-90))]}(this);e?(h=90,c=180,l=-180):t&&(u=-90,c=180,l=-180)}return new yc(new gc(l,u),new gc(c,h))}_getBoundsRectangular(e,t){const{top:i,left:n}=this._edgeInsets,r=this.height-this._edgeInsets.bottom,o=this.width-this._edgeInsets.right,s=new Pe(n,i),a=new Pe(o,i),l=new Pe(o,r),c=new Pe(n,r);let u=this.pointCoordinate(s,e),h=this.pointCoordinate(a,e);const d=this.pointCoordinate(l,t),f=this.pointCoordinate(c,t),p=(e,t)=>(t.y-e.y)/(t.x-e.x);return u.y>1&&h.y>=0?u=new Ac((1-f.y)/p(f,u)+f.x,1):u.y<0&&h.y<=1&&(u=new Ac(-f.y/p(f,u)+f.x,0)),h.y>1&&u.y>=0?h=new Ac((1-d.y)/p(d,h)+d.x,1):h.y<0&&u.y<=1&&(h=new Ac(-d.y/p(d,h)+d.x,0)),(new yc).extend(this.coordinateLocation(u)).extend(this.coordinateLocation(h)).extend(this.coordinateLocation(f)).extend(this.coordinateLocation(d))}_getBoundsRectangularTerrain(){const e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBoundsRectangular(0,0);const t=e.visibleDemTiles.reduce((e,t)=>{if(t.dem){const i=t.dem.tree;e.min=Math.min(e.min,i.minimums[0]),e.max=Math.max(e.max,i.maximums[0])}return e},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(t.min*e.exaggeration(),t.max*e.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(e=!0){const t=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,i=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,i):i}getMaxBounds(){return this.maxBounds}setMaxBounds(e){this.maxBounds=e,this.minLat=-85.051129,this.maxLat=wc,this.minLng=-180,this.maxLng=180,e&&(this.minLat=e.getSouth(),this.maxLat=e.getNorth(),this.minLng=e.getWest(),this.maxLng=e.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=dr(this.minLng)*this.tileSize,this.worldMaxX=dr(this.maxLng)*this.tileSize,this.worldMinY=fr(this.maxLat)*this.tileSize,this.worldMaxY=fr(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(e,t){return this.projection.createTileMatrix(this,t,e)}calculateDistanceTileData(e){const t=e.key,i=this._distanceTileDataCache;if(i[t])return i[t];const n=e.canonical,r=1/this.height,o=this.cameraWorldSize,s=o/this.zoomScale(n.z),a=(n.x+Math.pow(2,n.z)*e.wrap)*s,l=n.y*s,c=this.point;c.x*=o/this.worldSize,c.y*=o/this.worldSize;const u=this.angle,h=Math.sin(-u),d=-Math.cos(-u);return i[t]={bearing:[h,d],center:[(c.x-a)*r,(c.y-l)*r],scale:s/Cr*r},i[t]}calculateFogTileMatrix(e){const t=e.key,i=this._fogTileMatrixCache;if(i[t])return i[t];const n=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,e);return m(n,this.worldToFogMatrix,n),i[t]=new Float32Array(n),i[t]}calculateProjMatrix(e,t=!1,i=!1){const n=e.key;let r;if(r=i?this._expandedProjMatrixCache:t?this._alignedProjMatrixCache:this._projMatrixCache,r[n])return r[n];const o=this.calculatePosMatrix(e,this.worldSize);let s;return s=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:i?this.expandedFarZProjMatrix:t?this.alignedProjMatrix:this.projMatrix,m(o,s,o),r[n]=new Float32Array(o),r[n]}calculatePixelsToTileUnitsMatrix(e){const t=e.tileID.key,i=this._pixelsToTileUnitsCache;if(i[t])return i[t];const n=function(e,t){const{scale:i}=e.tileTransform,n=i*Cr/(e.tileSize*Math.pow(2,t.zoom-e.tileID.overscaledZ+e.tileID.canonical.z)),r=t.inverseAdjustmentMatrix;return new Float32Array([r[0]*n,r[1]*n,r[2]*n,r[3]*n])}(e,this);return i[t]=n,i[t]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const e=1/this.worldSize,t=w([],[e,e,e]);return m(t,t,this.globeMatrix),t}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const e=this._elevation;this._updateCameraState();const t=xc(1,this._center.lat)*this.worldSize,i=this._computeCameraPosition(t),n=this._camera.forward(),r=xc(1,this._center.lat);i[2]/=r,n[2]/=r,Z(n,n);const o=e.raycast(i,n,e.exaggeration());if(o){const e=U([],i,n,o),t=new Ac(e[0],e[1],xc(e[2],mr(e[1]))),s=(t.z+R([t.x-i[0],t.y-i[1],t.z-i[2]*r]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(s),this._centerAltitude=t.toAltitude(),this._center=this.coordinateLocation(t),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(e=!1){if(!this._elevation)return;const t=this._elevation,i=xc(1,this._center.lat)*this.worldSize,n=this._computeCameraPosition(i),r=t.getAtPointOrZero(new Ac(...n)),o=this.pixelsPerMeter/this.worldSize*r,s=this._minimumHeightOverTerrain(),a=n[2]-o;if(a<=s)if(a<0||e){const e=this.locationCoordinate(this._center,this._centerAltitude),t=[n[0],n[1],e.z-n[2]],i=R(t);t[2]-=(s-a)/this._pixelsPerMercatorPixel;const r=R(t);if(0===r)return;V(t,t,i/r*this._pixelsPerMercatorPixel),this._camera.position=[n[0],n[1],e.z*this._pixelsPerMercatorPixel-t[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||e){const t=this.center;return t.lat=it(t.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!e)&&(t.lng=it(t.lng,this.minLng,this.maxLng)),this.center=t,void(this._constraining=!1)}const t=this._unmodified,{x:i,y:n}=this.point;let r=0,o=i,s=n;const a=this.width/2,l=this.height/2,c=this.worldMinY*this.scale,u=this.worldMaxY*this.scale;if(n-l<c&&(s=c+l),n+l>u&&(s=u-l),u-c<this.height&&(r=Math.max(r,this.height/(u-c)),s=(u+c)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const e=this.worldMinX*this.scale,t=this.worldMaxX*this.scale,n=this.worldSize/2-(e+t)/2;o=(i+n+this.worldSize)%this.worldSize-n,o-a<e&&(o=e+a),o+a>t&&(o=t-a),t-e<this.width&&(r=Math.max(r,this.width/(t-e)),o=(t+e)/2)}o===i&&s===n||this._allowWorldUnderZoom||(this.center=this.unproject(new Pe(o,s))),r&&!this._allowWorldUnderZoom&&(this.zoom+=this.scaleZoom(r)),this._constrainCamera(),this._unmodified=t,this._constraining=!1}_minZoomForBounds(){let e=Math.max(0,this.scaleZoom(Math.max(0,this.height)/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(e=Math.max(e,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),e}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,t="globe"===this.projection.name,i=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=xc(1,this.center.lat)/xc(1,45));const n=_y(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,n),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;const r="meters"===this.projection.zAxisUnit?i:1,s=this._camera.getWorldToCamera(this.worldSize,r);let a;const l=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(l[8]=2*-e.x/this.width,l[9]=2*e.y/this.height,this.isOrthographic){let t=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),i=t*this.aspect,n=-i,r=-t;i-=e.x,n-=e.x,t+=e.y,r+=e.y,a=this._camera.getCameraToClipOrthographic(n,i,r,t,this._nearZ+this._nearClipOffset,this._farZ),((e,t,i,n)=>{for(let r=0;r<16;r++)e[r]=fn(t[r],i[r],n)})(a,a,l,Pt(this.pitch>=Ow?1:this.pitch/Ow))}else a=l;const c=C([],l,s),u=C([],a,s);if(this.projection.isReprojectedInTileSpace){const e=this.locationCoordinate(this.center);d(this._mat4Scratch);const t=this._mat4Scratch;_(t,t,[e.x*this.worldSize,e.y*this.worldSize,0]),m(t,t,py(this)),_(t,t,[-e.x*this.worldSize,-e.y*this.worldSize,0]),m(u,u,t),m(c,c,t),this.inverseAdjustmentMatrix=function(e){const t=py(e,!0);return o([],[t[0],t[1],t[4],t[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(g(this.mercatorMatrix,u,[this.worldSize,this.worldSize,this.worldSize/r,1]),this.projMatrix=u,p(this.invProjMatrix,this.projMatrix),t){const t=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);t[8]=2*-e.x/this.width,t[9]=2*e.y/this.height,C(this._expandedFarZProjMatrixBuf,t,s),this.expandedFarZProjMatrix=this._expandedFarZProjMatrixBuf}else this.expandedFarZProjMatrix=this.projMatrix;p(this._mat4Scratch,a),this.frustumCorners=Ef.fromInvProjectionMatrix(this._mat4Scratch,this.horizonLineFromTop(),this.height),this.cameraFrustum=Df.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!t),w(this.skyboxMatrix,[1,-1,1]),y(this.skyboxMatrix,this.skyboxMatrix,this._pitch),x(this.skyboxMatrix,this.skyboxMatrix,this.angle),A(this.starsProjMatrix,this._fov,this.width/this.height,this._nearZ,this._farZ);const f=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;h(this._mat4Scratch,this.starsProjMatrix),this._mat4Scratch[8]=2*-e.x/this.width,this._mat4Scratch[9]=2*(e.y+f)/this.height,m(this.skyboxMatrix,this._mat4Scratch,this.skyboxMatrix);const v=this.point,b=v.x,T=v.y,E=this.width%2/2,S=this.height%2/2,I=Math.cos(this.angle),M=Math.sin(this.angle),D=b-Math.round(b)+I*E+M*S,P=T-Math.round(T)+I*S+M*E;if(h(this.alignedProjMatrix,u),_(this.alignedProjMatrix,this.alignedProjMatrix,[D>.5?D-1:D,P>.5?P-1:P,0]),w(this.labelPlaneMatrix,[this.width/2,-this.height/2,1]),_(this.labelPlaneMatrix,this.labelPlaneMatrix,[1,-1,0]),w(this.glCoordMatrix,[1,-1,1]),_(this.glCoordMatrix,this.glCoordMatrix,[-1,-1,0]),g(this.glCoordMatrix,this.glCoordMatrix,[2/this.width,2/this.height,1]),m(this.pixelMatrix,this.labelPlaneMatrix,c),this._calcFogMatrices(),this._distanceTileDataCache={},!p(this.pixelMatrixInverse,this.pixelMatrix))throw new Error("failed to invert matrix");if("globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=function(e){const{x:t,y:i}=e.point,{lng:n,lat:r}=e._center;return Xf(t,i,e.worldSize,n,r)}(this);const e=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=X(e,e,s),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=this.pixelMatrixInverse;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const e=this.cameraWorldSizeForFog,t=this.cameraPixelsPerMeter,i=this._camera.position,n=1/this.height/this._pixelsPerMercatorPixel,r=[e,e,t];V(r,r,n),V(i,i,-1),k(i,i,r),b(this.mercatorFogMatrix,i),g(this.mercatorFogMatrix,this.mercatorFogMatrix,r),this.worldToFogMatrix=this._camera.getWorldToCameraPosition(e,t,n)}_computeCameraPosition(e){const t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,i=this._camera.forward(),n=this.point,r=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return[n.x/this.worldSize-i[0]*r,n.y/this.worldSize-i[1]*r,e/this.worldSize*this._centerAltitude-i[2]*r]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(e){const t=this._maxCameraBoundsDistance()*Math.cos(this._pitch),i=this._camera.position[2],n=e[2];let r=1;this.projection.wrap&&(this.center=this.center.wrap()),n>0&&(r=Math.min((t-i)/n,1)),this._camera.position=U([],this._camera.position,e,r),this._updateStateFromCamera()}_updateStateFromCamera(){const e=this._camera.position,t=this._camera.forward(),{pitch:i,bearing:n}=this._camera.getPitchBearing(),r=xc(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,o=this._mercatorZfromZoom(this._maxZoom)*Math.cos(Je(this._maxPitch)),s=Math.max((e[2]-r)/Math.cos(i),o),a=this._zoomFromMercatorZ(s);U(e,e,t,s),this._pitch=it(i,Je(this.minPitch),Je(this.maxPitch)),this.angle=rt(n,-Math.PI,Math.PI),this._setZoom(it(a,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new Ac(e[0],e[1],e[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(e){return Math.pow(2,e)*this.tileSize}_mercatorZfromZoom(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}_minimumHeightOverTerrain(){const e=Math.min(this._seaLevelZoom??this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(Math.max(0,e)*this.tileSize))}zoomFromMercatorZAdjusted(e){let t=0,i=6,n=0,r=1/0;for(;i-t>1e-6&&i>t;){const o=t+.5*(i-t),s=this.tileSize*Math.pow(2,o),a=this.getCameraToCenterDistance(this.projection,o,s),l=this.scaleZoom(a/(Math.max(0,e)*this.tileSize)),c=Math.abs(o-l);c<r&&(r=c,n=o),o<l?t=o:i=o}return n}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(gt("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(e,t){const i=Math.min(e.x,t.x),n=Math.max(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.y,t.y);if(r<this.horizonLineFromTop(!1))return!0;if("mercator"!==this.projection.name)return!1;const s=[new Pe(i,r),new Pe(n,o),new Pe(i,o),new Pe(n,r)],a=this.renderWorldCopies?-3:0,l=this.renderWorldCopies?4:1;for(const e of s){const t=this.pointRayIntersection(e);if(t.t<0)return!0;const i=this.rayIntersectionCoordinate(t);if(i.x<a||i.y<0||i.x>l||i.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+Ke(this.fovAboveCenter)>88||this.anyCornerOffEdge(new Pe(0,0),new Pe(this.width,this.height))}zoomDeltaToMovement(e,t){const i=R(te([],this._camera.position,e)),n=this._zoomFromMercatorZ(i)+t;return i-this._mercatorZfromZoom(n)}getCameraPoint(){if("globe"===this.projection.name){const e=function([e,t,i],n){const r=[e,t,i,1];le(r,r,n);const o=r[3]=Math.max(r[3],1e-6);return r[0]/=o,r[1]/=o,r[2]/=o,r}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new Pe(e[0],e[1])}{const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new Pe(0,e))}}getCameraToCenterDistance(e,t=this.zoom,i=this.worldSize){const n=_y(e,t,this.width,this.height,1024),r=e.pixelSpaceConversion(this.center.lat,i,n);let o=.5/Math.tan(.5*this._fov)*this.height*r;return this.isOrthographic&&(o=fn(1,o,Pt(this.pitch>=Ow?1:this.pitch/Ow))),o}getWorldToCameraMatrix(){const e=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&m(e,e,this.globeMatrix),e}getFrustum(e){return Df.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,e,"meters"===this.projection.zAxisUnit)}}const Bw=(e,t)=>{if(t<=0||e.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const i=e.transform,n=i.pitch,r=i.isLODDisabled(!1)?60:30;if(n<r-15)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const o=i._farZ-i._nearZ,s=t*i.height*1.3,a=Math.pow(2,.85*Math.max(i._zoom-e.minCutoffZoom,0)),l=1.4*i.cameraToCenterDistance*a,c=nt(r-15,r,n),u=fn(i._farZ+s,l,c),h=Math.min(s,u-i._nearZ);return{shouldRenderCutoff:c>0,uniformValues:{u_cutoff_params:[i._nearZ,i._farZ,(u-i._nearZ)/o,(u-h-i._nearZ)/o]}}};function Nw(e,t,i,n){const r=1<<e.z;t.lat=mr((n/Cr+e.y)/r),t.lng=pr((i/Cr+e.x)/r)}const Vw=(e,t,i=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:i}),Uw=new Float64Array(16),jw=new Float64Array(16),Gw=new Float64Array(16),$w=new Float64Array(16),Hw=new Float64Array(16),Zw=new Float64Array(16),qw=new Float64Array(16),Ww=[0,0,0],Yw=new Float32Array(16),Xw=[0,0,0],Jw=[0,0,0],Kw=[];function Qw(e,t,i){const n=i.cameraWorldSizeForFog/i.worldSize;return g(e,i.worldToFogMatrix,[n,n,1]),m(e,e,t),e}function eT(e,t,i,n){return _(e,t,i),ee(n,Ay)||g(e,e,n),e}function tT(e,t,i,n){const r=i?t.lightsStyleAabb:e.aabb,o=r?r.min[2]:1/0,s=(r?r.max[2]:-1/0)-o;return[isFinite(o)?o:0,s>0&&isFinite(s)?s:1,n?1:0,0]}function iT(e,t){return t.featureBuffer?e.partStyleUBO:null}function nT(e,t,i,n,r,o=null){const s=i.material,a=n.context,{baseColorTexture:l,metallicRoughnessTexture:c}=s.pbrMetallicRoughness,{normalTexture:u,occlusionTexture:h,emissionTexture:d}=s;function f(t,i,n){if(t&&(e.push(i),a.activeTexture.set(a.gl.TEXTURE0+n),t.gfxTexture)){const{minFilter:e,magFilter:i,wrapS:n,wrapT:r}=t.sampler;t.gfxTexture.bindExtraParam(e,i,n,r)}}f(l,"HAS_TEXTURE_u_baseColorTexture",nw.BaseColor),f(c,"HAS_TEXTURE_u_metallicRoughnessTexture",nw.MetallicRoughness),f(u,"HAS_TEXTURE_u_normalTexture",nw.Normal),f(h,"HAS_TEXTURE_u_occlusionTexture",nw.Occlusion),f(d,"HAS_TEXTURE_u_emissionTexture",nw.Emission),r&&(r.texture||(r.texture=new Cm(n.context,r.image,[r.image.height,r.image.height,r.image.height],a.gl.RGBA8)),a.activeTexture.set(a.gl.TEXTURE0+nw.LUT),r.texture&&r.texture.bind(a.gl.LINEAR,a.gl.CLAMP_TO_EDGE),e.push("APPLY_LUT_ON_GPU")),i.texcoordBuffer&&(e.push("HAS_ATTRIBUTE_a_uv_2f"),t.push(i.texcoordBuffer)),i.colorBuffer&&(e.push(12===i.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),t.push(i.colorBuffer)),i.normalBuffer&&(e.push("HAS_ATTRIBUTE_a_normal_4n"),t.push(i.normalBuffer)),o&&(e.push("HAS_ATTRIBUTE_a_feature"),t.push(i.featureBuffer)),"OPAQUE"!==s.alphaMode&&"MASK"!==s.alphaMode||e.push("UNPREMULT_TEXTURE_IN_SHADER"),s.defined||e.push("DIFFUSE_SHADED");const p=n.shadowRenderer;p&&(e.push("RENDER_SHADOWS"),p.useNormalOffset&&e.push("NORMAL_OFFSET"))}function rT(e,t,i,n,r,o){const s=e.modelOpacity,a=t.context,l=new fw(t.context.gl.LEQUAL,e.isLightMesh?fw.ReadOnly:fw.ReadWrite,t.depthRangeFor3D),c=t.transform,u=e.mesh,h=u.material,d=h.pbrMetallicRoughness,_=t.style.fog;"pixels"===t.transform.projection.zAxisUnit?Uw.set(e.nodeModelMatrix):m(Uw,n.zScaleMatrix,e.nodeModelMatrix),m(Uw,n.negCameraPosMatrix,Uw),p(jw,Uw),f(jw,jw);const g="none"===i.paint.get("model-color-use-theme").constantOr("default"),y=i.paint.get("model-emissive-strength").constantOr(0),v={defines:[]},x=[],b=t.shadowRenderer;b&&(b.useNormalOffset=!1),nT(v.defines,x,u,t,g?null:i.lut);let w=null;if(_&&(w=Qw(Gw,e.nodeModelMatrix,t.transform),"globe"!==c.projection.name)){const e=u.aabb.min,t=u.aabb.max,[i,n]=_.getOpacityForBounds(w,e[0],e[1],t[0],t[1]);v.overrideFog=i>=Yp||n>=Yp}const T=Bw(t,i.paint.get("model-cutoff-fade-range"));T.shouldRenderCutoff&&v.defines.push("RENDER_CUTOFF");const E=t.getOrCreateProgram("model",v),S=sw(e.worldViewProjection,Uw,jw,null,t,s,d.baseColorFactor,h.emissiveFactor,d.metallicFactor,d.roughnessFactor,h,y,i,void 0,void 0,e.materialOverride,e.modelColor,1,E.fixedDefines.includes("LIGHTING_3D_MODE"));t.uploadCommonUniforms(a,E,null,w,T,e.lightOverrides),"shadow"!==t.renderPass&&b&&b.setupShadowsFromMatr
vendor: 5,824 bytes, line 2
2ix(e.nodeModelMatrix,E),E.draw(t,a.gl.TRIANGLES,l,r,o,u.material.doubleSided?_w.disabled:_w.backCCW,S,i.id,u.vertexBuffer,u.indexBuffer,u.segments,i.paint,t.transform.zoom,void 0,x)}function oT(e,t){return e.style._importedAsBasemap?"basemap":t.scope}function sT(e,t,i,n,r,o,s,a,l,c,u){const h=e.transform,d=!!t.isGeometryBloom&&t.isGeometryBloom;if(void 0!==t.minZoom&&e.transform.zoom<t.minZoom)return;if(void 0!==t.maxZoom&&e.transform.zoom>t.maxZoom)return;if(d&&"shadow"===e.renderPass)return;const f="globe"===h.projection.name?Ty(i,h):[...i];m(f,f,t.globalMatrix);const p=m([],n,f);if(t.meshes)for(const e of t.meshes){const n=a.get(e.material.name);if(n&&n.opacity<=0)continue;if("BLEND"!==e.material.alphaMode){s.push({mesh:e,depth:0,modelIndex:r,worldViewProjection:p,nodeModelMatrix:f,isLightMesh:d,materialOverride:n,modelOpacity:l,modelColor:c,lightOverrides:u,node:t,modelMatrix:i});continue}const m=X([],e.centroid,p);!h.isOrthographic&&m[2]<=0||o.push({mesh:e,depth:m[2],modelIndex:r,worldViewProjection:p,nodeModelMatrix:f,isLightMesh:d,materialOverride:n,modelOpacity:l,modelColor:c,lightOverrides:u,node:t,modelMatrix:i})}if(t.children)for(const h of t.children)sT(e,h,i,n,r,o,s,a,l,c,u)}function aT(e,t,i,n,r){const o=i.shadowRenderer;if(!o)return;const s=o.getShadowPassDepthMode(),a=r||o.calculateShadowPassMatrixFromMatrix(t),l=aw(a);i.getOrCreateProgram("modelDepth").draw(i,i.context.gl.TRIANGLES,s,cw.disabled,dw.disabled,_w.disabled,l,n.id,e.vertexBuffer,e.indexBuffer,e.segments,n.paint,i.transform.zoom,void 0,void 0)}function lT(e,t,i,n){const r=function(e,t){if(t.footprintDebugMesh)return t.footprintDebugMesh;if(!t.footprint)return null;const i=e.context,n=t.footprint.vertices,r=t.footprint.indices,o=new Gc;o.reserve(n.length);for(const e of n)o.emplaceBack(e.x,e.y);const s=new hu;s.reserve(r.length);for(let e=0;e<r.length;e+=3)s.emplaceBack(r[e],r[e+1],r[e+2]);const a=i.createVertexBuffer(o,bf.members),l=i.createIndexBuffer(s),c=Gu.simpleSegment(0,0,n.length,r.length),u=t.id||t.name||"footprint";let h;const d=parseInt(u,10);h=isNaN(d)?function(e){let t=0;for(let i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i)|0;return t}(u):d;const f=Rt(h),p=Rt(h+1),m=Rt(h+2);return t.footprintDebugMesh={vertexBuffer:a,indexBuffer:l,segments:c,color:new mn(f,p,m,.5)},t.footprintDebugMesh}(e,i);if(!r)return;const o=e.context,s=o.gl,a=e.getOrCreateProgram("debug"),l=r.color,c=fw.disabled;o.activeTexture.set(s.TEXTURE0),e.emptyTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),a.draw(e,s.TRIANGLES,c,cw.disabled,dw.alphaBlended,_w.disabled,Vw(n,l.toPremultipliedRenderColor(null)),"$debug",r.vertexBuffer,r.indexBuffer,r.segments)}function cT(e,t,i,n,r,o){for(const s of r){const r={...n};r.part=s;const a={type:"Unknown",id:t,properties:r},l={orientation:e.paint.get("model-rotation").evaluate(a,i)};o.set(s,l)}}function uT(e,t,i,n,r,o){for(const s of r){const r={...n};r.part=s;const a={type:"Unknown",id:t,properties:r},l={color:e.paint.get("model-color").evaluate(a,i),colorMix:e.paint.get("model-color-mix-intensity").evaluate(a,i),opacity:e.paint.get("model-opacity").evaluate(a,i),emissionStrength:e.paint.get("model-emissive-strength").evaluate(a,i)};o.set(s,l)}}function hT(e,t,i,n,r){let o=!1;for(const i of n)1!==i.modelOpacity&&(rT(i,e,t,r[i.modelIndex],cw.disabled,dw.disabled),o=!0);for(const i of n)rT(i,e,t,r[i.modelIndex],1!==i.modelOpacity?e.stencilModeFor3D():cw.disabled,e.colorModeForRenderPass());o&&e.resetStencilClippingMasks();const s=dw.additive;for(const n of i)rT(n,e,t,r[n.modelIndex],cw.disabled,n.isLightMesh?s:e.colorModeForRenderPass())}function dT(e,t,i){const n=t.updateZoomBasedPaintProperties(),r=function(e,t,i){let n,r,o,s=e.terrain?e.terrain.exaggeration():0;if(e.terrain&&s>0){const t=e.terrain,r=t.findDEMTileFor(i);r&&r.dem?n=Wp.create(t,i,r):s=0}if(0===s&&(t.terrainElevationMin=0,t.terrainElevationMax=0),s===t.validForExaggeration&&(0===s||n&&n._demTile&&n._demTile.tileID===t.validForDEMTile.id&&n._dem._timestamp===t.validForDEMTile.timestamp))return!1;for(const e in t.instancesPerModel){const i=t.instancesPerModel[e];for(let e=0;e<i.instancedDataArray.length;++e){const a=(n?s*n.getElevationAt(0|i.instancedDataArray.float32[16*e],0|i.instancedDataArray.float32[16*e+1],!0,!0):0)+i.instancesEvaluatedElevation[e];i.instancedDataArray.float32[16*e+6]=a,r=r?Math.min(t.terrainElevationMin,a):a,o=o?Math.max(t.terrainElevationMax,a):a}}return t.terrainElevationMin=r||0,t.terrainElevationMax=o||0,t.validForExaggeration=s,t.validForDEMTile=n&&n._demTile?{id:n._demTile.tileID,timestamp:n._dem._timestamp}:{id:void 0,timestamp:0},!0}(e,t,i);(n||r)&&(t.uploaded=!1,t.upload(e.context))}const fT={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new Pf([0,0,0],[Cr,Cr,0])};function pT(e,t){const i=1<<e.canonical.z,n=t.getFreeCameraOptions().position,r=t.elevation,o=e.canonical.x/i,s=(e.canonical.x+1)/i,a=e.canonical.y/i,l=(e.canonical.y+1)/i;let c=t._centerAltitude;if(r){const t=r.getMinMaxForTile(e);t&&t.max>c&&(c=t.max)}const u=it(n.x,o,s)-n.x,h=it(n.y,a,l)-n.y,d=xc(c,t.center.lat)-n.z;return t._zoomFromMercatorZ(Math.sqrt(u*u+h*h+d*d))}function mT(e,t,i,n,r,o,s){const a=e.context,l="shadow"===e.renderPass,c=e.shadowRenderer,u=l&&c?c.getShadowPassDepthMode():new fw(a.gl.LEQUAL,fw.ReadWrite,e.depthRangeFor3D),h=e.isTileAffectedByFog(o),d="globe"===e.transform.projection.name;if(i.meshes)for(const f of i.meshes){const p=d?[]:["MODEL_POSITION_ON_GPU"],m=[];let _,g,y;const v=!d&&n.instancedDataArray.length>20;v&&p.push("INSTANCED_ARRAYS");const x=Bw(e,t.paint.get("model-cutoff-fade-range"));if(x.shouldRenderCutoff&&p.push("RENDER_CUTOFF"),l&&c)_=e.getOrCreateProgram("modelDepth",{defines:p}),g=aw(s.shadowTileMatrix,s.shadowTileMatrix,i.globalMatrix),y=dw.disabled;
vendor: 4,563 bytes, line 2
2else{nT(p,m,f,e,"none"===t.paint.get("model-color-use-theme").constantOr("default")?null:t.lut),_=e.getOrCreateProgram("model",{defines:p,overrideFog:h});const n=f.material,l=n.pbrMetallicRoughness,u=t.paint.get("model-opacity").constantOr(1),d=t.paint.get("model-emissive-strength").constantOr(0);g=sw(o.expandedProjMatrix,i.globalMatrix,Yw,null,e,u,l.baseColorFactor,n.emissiveFactor,l.metallicFactor,l.roughnessFactor,n,d,t,r,void 0,void 0,void 0,1,_.fixedDefines.includes("LIGHTING_3D_MODE")),c&&(s.shadowUniformsInitialized?_.setShadowUniformValues(a,c.getShadowUniformValues()):(c.setupShadows(o.toUnwrapped(),_,"model-tile"),s.shadowUniformsInitialized=!0)),y=x.shouldRenderCutoff||u<1||"OPAQUE"!==n.alphaMode?dw.alphaBlended:dw.unblended}e.uploadCommonUniforms(a,_,o.toUnwrapped(),null,x);const b=f.material.doubleSided?_w.disabled:_w.backCCW;if(v)m.push(n.instancedDataBuffer),_.draw(e,a.gl.TRIANGLES,u,cw.disabled,y,b,g,t.id,f.vertexBuffer,f.indexBuffer,f.segments,t.paint,e.transform.zoom,void 0,m,n.instancedDataArray.length);else{const i=l?"u_instance":"u_normal_matrix";for(let r=0;r<n.instancedDataArray.length;++r)g[i]=new Float32Array(n.instancedDataArray.arrayBuffer,64*r,16),_.draw(e,a.gl.TRIANGLES,u,cw.disabled,y,b,g,t.id,f.vertexBuffer,f.indexBuffer,f.segments,t.paint,e.transform.zoom,void 0,m)}}if(i.children)for(const a of i.children)mT(e,t,a,n,r,o,s)}function _T(e,t,i,n,r){const o=e.node;if(o.lodMeshes&&o.lodMeshes.length>0)if(e.targetLod<0)e.targetLod=t>n?1:0;else{const o=r>0?i/1e3/r:1;e.targetLod=it(t>n?e.targetLod+o:e.targetLod-o,0,1)}else e.targetLod=0}function gT(e,t,i,n){if(!i.modelManager)return!0;const r=i.modelManager;if(!i.shadowRenderer)return!0;const o=i.shadowRenderer,s=t.aabb;let a=!0,l=e.maxHeight;if(0===l){let t=0;for(const i in e.instancesPerModel){const e=r.getModel(i,n);e?t=Math.max(t,Math.max(Math.max(e.aabb.max[0],e.aabb.max[1]),e.aabb.max[2])):a=!1}l=e.maxScale*t*1.41+e.maxVerticalOffset,a&&(e.maxHeight=l)}s.max[2]=l,s.min[2]+=e.terrainElevationMin,s.max[2]+=e.terrainElevationMax,X(s.min,s.min,t.tileMatrix),X(s.max,s.max,t.tileMatrix);const c=s.intersects(o.getCurrentCascadeFrustum());return 0===i.currentShadowCascade&&(e.isInsideFirstShadowMapFrustum=2===c),0===c}function yT(e,t){const i=e.uniformValues.u_cutoff_params[0],n=e.uniformValues.u_cutoff_params[1],r=e.uniformValues.u_cutoff_params[2],o=e.uniformValues.u_cutoff_params[3];return n===i||o===r?1:it(((t-i)/(n-i)-r)/(o-r),0,1)}function vT(e,t,i,n){if(t.pitch<20)return 1;const r=t.getWorldToCameraMatrix();m(r,r,e);const o=oe(i.min[0],i.min[1],i.min[2],1);let s=le(re(),o,r),a=s,l=s;o[1]=i.max[1],s=le(re(),o,r),a=s[1]<a[1]?s:a,l=s[1]>l[1]?s:l,o[0]=i.max[0],s=le(re(),o,r),a=s[1]<a[1]?s:a,l=s[1]>l[1]?s:l,o[1]=i.min[1],s=le(re(),o,r),a=s[1]<a[1]?s:a,l=s[1]>l[1]?s:l;const c=it(n[0],0,1),u=100*t.pixelsPerMeter*it(n[1],0,1),h=it(n[2],0,1),d=(_=re(),b=(g=a)[1],w=g[2],T=g[3],_[0]=(x=g[0])+(v=c)*((y=l)[0]-x),_[1]=b+v*(y[1]-b),_[2]=w+v*(y[2]-w),_[3]=T+v*(y[3]-T),_),f=Math.tan(.5*t.fovX),p=-d[2]*f;var _,g,y,v,x,b,w,T;if(0===u)return d[1]<-Math.abs(p)?h:1;const E=it(fn(1,h,(-Math.abs(p)-d[1])/u),h,1);return fn(1,E,it((t.pitch-20)/20,0,1))}var xT="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",bT="\n#define FLIP_VIEWPORT_UV_Y(uv)\n#ifdef DUAL_SOURCE_BLENDING\nlayout(location=0,index=0) out vec4 glFragColor;layout(location=0,index=1) out vec4 glFragColorSrc1;\n#elif defined(FLOAT_RENDER_TARGET)\nlayout(location=0) out highp vec4 glFragColor;\n#else\nlayout(location=0) out vec4 glFragColor;\n#endif\n#ifdef USE_MRT1\nlayout(location=1) out vec4 out_Target1;\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}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;}const float DITHER_THRESHOLDS[16]=float[16](\n1.0/17.0, 9.0/17.0, 3.0/17.0,11.0/17.0,13.0/17.0, 5.0/17.0,15.0/17.0, 7.0/17.0,4.0/17.0,12.0/17.0, 2.0/17.0,10.0/17.0,16.0
2/17.0, 8.0/17.0,14.0/17.0, 6.0/17.0\n);int viewport_dither_index(vec2 fragCoordXY) {return (int(fragCoordXY.x) % 4)*4+(int(fragCoordXY.y) % 4);}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 premultiplyColor(vec3 nonPremultipliedColor,float a) {return vec4(nonPremultipliedColor*a,a);}vec3 unpremultiplyColor(vec4 premultipliedColor) {if (premultipliedColor.a > 0.0) {return premultipliedColor.rgb/premultipliedColor.a;}return premultipliedColor.rgb;}vec3 applyLUT(highp sampler3D lut,vec3 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return texture(lut,uvw).rgb;}vec4 applyLUT(highp sampler3D lut,vec4 premultipliedColor) {return premultiplyColor(applyLUT(lut,unpremultiplyColor(premultipliedColor)),premultipliedColor.a);}void storeEmissiveColor(vec4 color,float emissiveStrength) {\n#ifdef DUAL_SOURCE_BLENDING\nglFragColorSrc1=vec4(vec3(0.0),emissiveStrength);\n#else\n#ifdef USE_MRT1 \n#ifdef USE_MRT1_RGBA\nout_Target1=vec4(color.rgb*emissiveStrength,color.a);\n#else\nout_Target1=vec4(emissiveStrength*color.a,0.0,0.0,glFragColor.a);\n#endif\n#endif\n#endif\n}",wT="\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const vec2 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 (units_to_pixels*pos+offset)/pattern_size;}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) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+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);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(ivec2 posWithComposedSkirt)\n{float skirt=float(float(posWithComposedSkirt.x) >=skirtOffset);vec2 pos=vec2(posWithComposedSkirt)-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_id) attrib\n#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_id) attrib\n#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_id) attrib\n#define DECLARE_MATERIAL_TABLE_INFO\n",TT="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;
2void 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;}",ET="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;\n#endif\nvec3 elevationVector(vec2 pos) {\n#ifdef PROJECTION_GLOBE_VIEW\nvec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;\n#else\nreturn vec3(0,0,1);\n#endif\n}\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;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;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 currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}vec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#endif\nfloat elevation(vec2 apos) {\n#ifdef TERRAIN\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);\n#else\nreturn currentElevation(apos);\n#endif\n#else\nreturn 0.0;\n#endif\n}\n#ifdef DEPTH_OCCLUSION\nuniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);}\n#else\nhighp float unpack_depth_rgba(vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;\n#ifdef DEPTH_D24\nfloat depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);\n#else\nfloat depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));\n#endif\nreturn coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_
2size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef DEPTH_D24\nhighp vec4 depth=vec4(\ntexture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r\n);depth=unpack_depth4(depth);\n#else\nhighp vec4 depth=vec4(\nunpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy))\n);\n#endif\nreturn depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;int NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) {\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));\n#endif\nres+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));}\n#else\nbool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }\n#endif",ST="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",IT="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in 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;FLIP_VIEWPORT_UV_Y(uv);highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {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,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}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;}
2vec3 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;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",AT="\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif",MT="#ifdef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}
2vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",CT="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif",DT="#ifdef RENDER_SHADOWS\nprecision highp sampler2DShadow;uniform sampler2DShadow u_shadowmap_0;uniform sampler2DShadow u_shadowmap_1;uniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;highp vec2 shadow_map_ndc_to_uv(highp vec2 ndc_xy) {return ndc_xy*0.5+0.5;}highp vec3 shadow_map_ndc_to_sample_space(highp vec3 ndc) {return vec3(shadow_map_ndc_to_uv(ndc.xy),ndc.z*0.5+0.5);}float shadow_sample(sampler2DShadow shadowmap,highp vec3 pos,highp float bias) {highp vec3 coord=vec3(shadow_map_ndc_to_uv(pos.xy),pos.z*0.5+0.5-bias);return texture(shadowmap,coord);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {light_view_pos0.xyz/=light_view_pos0.w;\n#ifdef SHADOWS_SINGLE_CASCADE\nvec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);\n#else\nlight_view_pos1.xyz/=light_view_pos1.w;vec4 abs_bounds=abs(vec4(light_view_pos0.xy,light_view_pos1.xy));if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}float occlusion1=shadow_sample(u_shadowmap_1,light_view_pos1.xyz,bias);return clamp(mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth)),0.0,1.0);\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy)\n{highp vec2 biasUV=vec2(\npos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=shadow_map_ndc_to_sample_space(light_view_pos0.xyz/light_view_pos0.w);highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";const PT=/^#include\s+"([^"]+)"\s*\r?\n/gm,RT=/#pragma mapbox: ([\
2w\-]+) ([\w]+) ([\w]+) ([\w]+)/g,LT=/\b[A-Za-z_][A-Za-z0-9_]*\b/g,zT=new Set(["ifdef","ifndef","elif","if","defined"]),FT=new Set;HT(xT,FT),HT(wT,FT),HT(bT,FT);const OT={"_prelude_fog.vertex.glsl":ST,"_prelude_terrain.vertex.glsl":ET,"_prelude_shadow.vertex.glsl":CT,"_prelude_material_table.vertex.glsl":"","_prelude_fog.fragment.glsl":IT,"_prelude_shadow.fragment.glsl":DT,"_prelude_lighting.glsl":AT,"_prelude_raster_array.glsl":MT,"_prelude_indicator_cutout.fragment.glsl":"\nvec4 applyCutout(vec4 color,float height) {return color;}","_prelude_feature_cutout.fragment.glsl":"// feature cutout (gl-native only)\n","_prelude_feature_cutout.vertex.glsl":"// feature cutout (gl-native only)\n"},kT={},BT="precision highp float;",NT="precision mediump float;",VT="\n#if defined(GL_EXT_blend_func_extended) && defined(DUAL_SOURCE_BLENDING)\n#extension GL_EXT_blend_func_extended : require\n#endif",UT={preludeTerrain:qT("",ET),preludeFog:qT(IT,ST),preludeShadow:qT(DT,CT),preludeRasterArray:qT(MT,""),preludeLighting:qT(AT,AT),preludePrecisionQualifiers:qT(NT,BT),prelude:qT(bT,wT),preludeExtensions:qT(VT,"")},jT=[VT,NT,xT,UT.prelude.fragmentSource].join("\n"),GT=[BT,xT,UT.prelude.vertexSource].join("\n");var $T={background:qT('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nuniform vec4 u_color;uniform float u_opacity;uniform mediump float u_emissive_strength;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;storeEmissiveColor(glFragColor,u_emissive_strength);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin ivec2 a_pos;uniform mat4 u_matrix;uniform mediump float u_emissive_strength;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),backgroundPattern:qT('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;storeEmissiveColor(glFragColor,u_emissive_strength);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in ivec2 a_pos;out highp vec2 v_pos;void main() {vec2 pos=vec2(a_pos);gl_Position=u_matrix*vec4(pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,pos);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),circle:qT
vendor: 7,338 bytes, line 2
2('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? \nsmoothstep(0.0,-antialiased_blur,1.0-extrude_length) : \nsmoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in ivec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\n#ifdef ELEVATED_ROADS\nin float a_circle_z_offset;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1.0,-1.0),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1.0,-1.0),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1.0,1.0),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1.0,1.0),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 pos2=vec2(a_pos);vec2 extrude=vec2(mod(pos2,2.0)*2.0-1.0);vec2 circle_center=floor(pos2*0.5);float height=circle_elevation(circle_center);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nsurface_vectors=globe_mercator_surface_vectors(vec3(a_pos_normal_3)/16384.0,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)*height;vec3 globe_pos=vec3(a_pos_3)+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*height;vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);world_center=vec4(circle_center,height,1);\n#endif\n#ifdef ELEVATED_ROADS\nworld_center.z+=a_circle_z_offset+ELEVATION_BIAS;\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:
2qT("void main() {glFragColor=vec4(1.0);}","in ivec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:qT('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_intensity;in ivec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(vec2(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(vec2(a_pos)*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=vec3(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=vec3(a_pos_3)+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:qT("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),collisionBox:qT("in float v_placed;in 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);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin ivec4 a_pos;in ivec2 a_anchor_pos;in ivec2 a_extrude;in uvec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform float u_zoom_transition;\n#endif\nout float v_placed;out float v_notUsed;void main() {vec2 anchor_pos=vec2(a_anchor_pos);float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(anchor_pos));vec3 proj_pos=vec3(a_pos)+elevationVector(anchor_pos)*(feature_elevation+terrain_elevation);\n#ifdef PROJECTION_GLOBE_VIEW\n#ifndef PROJECTED_POS_ON_VIEWPORT\nvec3 globe_pos=proj_pos;vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,anchor_pos,u_tile_id,u_merc_center);proj_pos=mix_globe_mercator(globe_pos,mercator_pos,u_zoom_transition);\n#endif\n#endif\nvec4 projectedPoint=u_matrix*vec4(proj_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(vec2(a_extrude)*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=float(a_placed.x);v_notUsed=float(a_placed.y);}'),collisionCircle:qT("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in 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);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in ivec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out 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;int vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2)),mix(-1.0,1.0,float(vertexIdx >=1 && vertexIdx <=2)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=float(a_flags.x);gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:qT("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin ivec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {vec2 pos=vec2(a_pos);float h=elevation(pos);v_uv=pos/8192.0;
2\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(vec3(a_pos_3)+elevationVector(pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(pos*u_overlay_scale,h,1);\n#endif\n}'),fill:qT('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec2 cutout_factors=vec2(0.0);vec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(opacity*u_opacity_multiplier);glFragColor=out_color;storeEmissiveColor(glFragColor,u_emissive_strength);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nuniform mat4 u_matrix;uniform lowp float u_opacity_multiplier;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),fillOutline:qT('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;vec2 cutout_factors=vec2(0.0);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity*u_opacity_multiplier);storeEmissiveColor(glFragColor,u_emissive_strength);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nuniform mat4 u_matrix;uniform vec2 u_world;uniform lowp float u_opacity_multiplier;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),fillOutlinePattern:qT('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nuniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\nin highp vec2 v_pos;in highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity*u_opacity_multiplier);storeEmissiveColor(glFragColor,u_emissive_strength);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform lowp float u_opacity_multiplier;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;out highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);vec2 pos=vec2(a_pos);gl_Position=mix(u_matrix*vec4(pos,z_offset,1),AWAY,hidden);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,pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(pos,z_offset);vec3 shd_pos1=vec3(pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillPattern:qT('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin highp vec2 v_pos;uniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(opacity*u_opacity_multiplier);storeEmissiveColor(glFragColor,u_emissive_strength);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform lowp float u_opacity_multiplier;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);vec2 pos=vec2(a_pos);gl_Position=mix(u_matrix*vec4(pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(pos,z_offset);vec3 shd_pos1=vec3(pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),lineBlendComposite:qT("uniform highp sampler2D u_image;uniform float u_opacity;uniform int u_blend_mode;uniform highp float u_max_density;in vec2 v_pos;\n#define ADDITIVE 1\nvoid main() {vec4 color=texture(u_image,v_pos);if (u_blend_mode==ADDITIVE) {if (color.a <=0.0) {discard;}highp float density=color.a;vec3 avgColor=color.rgb/max(density,0.001);highp float n=density/max(u_max_density,0.001);highp float t=sqrt(n/(n+1.0));glFragColor=vec4(avgColor*t,t);} else {vec3 multiplyFactor=color.rgb*u_opacity+(1.0-u_opacity);glFragColor=vec4(multiplyFactor,1.0);}\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),lineBlendReduce:qT("uniform highp sampler2D u_image;uniform vec2 u_texel_size;uniform bool u_first_pass;in vec2 v_pos;void main() {vec2 o=u_texel_size*0.5;vec4 s0=texture(u_image,v_pos+vec2(-o.x,-o.y));vec4 s1=texture(u_image,v_pos+vec2( o.x,-o.y));vec4 s2=texture(u_image,v_pos+vec2(-o.x, o.y));vec4 s3=texture(u_image,v_pos+vec2( o.x, o.y));float r0; float g0;float r1; float g1;float r2; float g2;float r3; float g3;if (u_first_pass) {float a0=s0.a;float a1=s1.a;float a2=s2.a;float a3=s3.a;r0=a0; g0=a0 > 0.0 ? 1.0 : 0.0;r1=a1; g1=a1 > 0.0 ? 1.0 : 0.0;r2=a2; g2=a2 > 0.0 ? 1.0 : 0.0;r3=a3; g3=a3 > 0.0 ? 1.0 : 0.0;} else {r0=s0.r; g0=s0.g;r1=s1.r; g1=s1.g;r2=s2.r; g2=s2.g;r3=s3.r; g3=s3.g;}glFragColor=vec4((r0+r1+r2+r3)*0.25,(g0+g1+g2+g3)*0.25,0.0,0.0);}","in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),fillExtrusion:qT
vendor: 13,578 bytes, line 2
2('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nin vec4 v_color;in vec4 v_flat;\n#if defined(RENDER_FRONT_CUTOFF) || defined(ROUTE_CORRIDOR)\nin float v_dither_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nin float v_height;\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float emissive_strength\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor;\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\ncolor.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#if defined(RENDER_FRONT_CUTOFF) || defined(ROUTE_CORRIDOR)\nif (v_dither_opacity < 1.0) {int index=viewport_dither_index(gl_FragCoord.xy);if (v_dither_opacity < DITHER_THRESHOLDS[index]) {discard;}}\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_material_table.vertex.glsl"\n#include "_prelude_feature_cutout.vertex.glsl"\nuniform mat4 u_matrix;\n#ifndef LIGHTING_3D_MODE\nuniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;\n#endif\nuniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_width_scale;in ivec4 a_pos_normal_ed;\n#if defined(HAS_CENTROID) || defined(TERRAIN)\nin uvec2 a_centroid_pos;\n#endif\n#ifdef RENDER_WALL_MODE\nin ivec4 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nuniform highp float u_vertical_scale;\n#if defined(RENDER_FRONT_CUTOFF) || defined(ROUTE_CORRIDOR)\n#ifdef RENDER_FRONT_CUTOFF\nuniform vec3 u_front_cutoff_params;\n#endif\nout float v_dither_opacity;\n#endif\nout vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp float emissive_strength\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp float emissive_strength\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 top_up_ny_start=vec4(a_pos_normal_ed & 1);vec4 pos_nx=vec4(a_pos_normal_ed >> 1);float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny_start.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny_start.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny_start.y==0.0 && top_up_ny_start.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny_start.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=vec2(a_centroid_pos);\n#endif\nfloat ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && (int(centroid_pos.y) & 7)==7);c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;\n#else\nh=t > 0.0 ? height : base;\n#endif\npos=vec3(pos_nx.xy,h);\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=vec3(a_pos_3)+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat cutoff=1.0;vec3 scaled_pos=pos;\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF) || defined(ROUTE_CORRIDOR)\nvec2 centroid_decoded=pos.xy;bool isBorderCentroid=false;if (centroid_pos.x > 0.0 && centroid_pos.y > 0.0) {int iy=int(centroid_pos.y);int spanYbits=iy & 7;if (spanYbits==7) {isBorderCentroid=true;int borderID=(iy >> 3) & 3;float coordAlongBorder=float(iy >> 5)*4.0;if (borderID==0) centroid_decoded=vec2(0.0,coordAlongBorder);else if (borderID==1) centroid_decoded=vec2(EXTENT,coordAlongBorder);else if (borderID==2) centroid_decoded=vec2(coordAlongBorder,0.0);else centroid_decoded=vec2(coordAlongBorder,EXTENT);} else {centroid_decoded=floor(centroid_pos/8.0);}}\n#endif\n#if defined(RENDER_FRONT_CUTOFF) || defined(ROUTE_CORRIDOR)\nfloat frontCutoffOpacity=1.0;float routeFade=0.0;\n#endif\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nvec4 ground=u_matrix*vec4(centroid_decoded,ele,1.0);\n#endif\n#ifdef RENDER_CUTOFF\ncutoff=cutoff_opacity(u_cutoff_params,ground.z);if (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_random/8.0;vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0));\n#ifdef RENDER_FRONT_CUTOFF\nif (centroid_pos.x > 0.0 && centroid_pos.y > 0.0) {hidden=max(hidden,float(ground.w <=0.0));float ndc_y=ground.y/max(ground.w,0.001);float threshold=u_front_cutoff_params.x*2.0-1.0;float range_ndc=u_front_cutoff_params.y*2.0;if (!isBorderCentroid) {hidden=max(hidden,float(ndc_y < threshold-range_ndc));}float t=clamp((ndc_y-(threshold-range_ndc))/max(range_ndc,0.001),0.0,1.0);frontCutoffOpacity=mix(u_front_cutoff_params.z,1.0,t);}\n#endif\n#if defined(RENDER_FRONT_CUTOFF) || defined(ROUTE_CORRIDOR)\nv_dither_opacity=1.0;\n#ifdef RENDER_FRONT_CUTOFF\nv_dither_opacity=min(v_dither_opacity,frontCutoffOpacity);\n#endif\n#endif\n#ifdef RENDER_WALL_MODE\nvec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=join_normal_inside.z*wall_offset*0.5;\n#endif\ngl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny_start.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny_start.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillExtrusionPattern:
2qT
vendor: 8,299 bytes, line 2
2('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\nin highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform 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 float u_width_scale;\n#ifndef LIGHTING_3D_MODE\nuniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;\n#endif\nin ivec4 a_pos_normal_ed;\n#if defined(HAS_CENTROID) || defined(TERRAIN)\nin uvec2 a_centroid_pos;\n#endif\n#ifdef RENDER_WALL_MODE\nin ivec4 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nout highp vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\n#pragma mapbox: define highp float line_width\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\n#pragma mapbox: initialize highp float line_width\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec4 top_up_ny_start=vec4(a_pos_normal_ed & 1);vec4 pos_nx=vec4(a_pos_normal_ed >> 1);float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny_start.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny_start.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=float(a_pos_normal_ed.w);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny_start.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=vec2(a_centroid_pos);\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && int(centroid_pos.y)-(int(centroid_pos.y)/8)*8==7);c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=vec3(a_pos_3)+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\n#ifdef RENDER_WALL_MODE\nvec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);p.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;p.xy-=join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny_start.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),hillshadePrepare:
2qT("precision highp float;uniform highp sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","uniform mat4 u_matrix;uniform vec2 u_dimension;in ivec2 a_pos;in uvec2 a_texture_pos;out 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=(vec2(a_texture_pos)/8192.0)*scale+epsilon;}"),hillshade:qT('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(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);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\nstoreEmissiveColor(glFragColor,u_emissive_strength);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in ivec2 a_pos;in uvec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=vec2(a_texture_pos)/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),line:qT
vendor: 19,061 bytes, line 2
2('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nuniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform float u_alpha_discard_threshold;uniform lowp float u_opacity_multiplier;uniform bool u_clip_to_tile_borders;in vec4 v_width2_dilute;in vec2 v_normal;in float v_gamma_scale;in vec2 v_tile_pos;\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nin float stub_side;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;uniform highp float u_floor_width_scale;in highp vec2 v_tex;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nin vec3 v_elevation_id_col;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec3 v_uv;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\n#ifdef RENDER_LINE_BORDER_GRADIENT\nuniform sampler2D u_border_gradient_image;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nuniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform highp vec2 u_trim_gradient_mix_range;uniform lowp vec4 u_trim_color;\n#endif\n#ifdef RENDER_SHADOWS\nuniform bool u_emissive_in_shadows;uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump uvec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float side_z_offset\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\n#pragma mapbox: define lowp float emissive_strength\nfloat linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump uvec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float side_z_offset\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\n#pragma mapbox: initialize lowp float emissive_strength\nfloat dist=length(v_normal)*v_width2_dilute.x;float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\nANTIALIASING*=8.0;\n#endif\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nblur=mix(blur,0.0,stub_side);\n#endif\nfloat diluted_opacity=opacity*v_width2_dilute.z;float blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2_dilute.y-blur2),v_width2_dilute.x-dist)/blur2,0.0,1.0);float pxStep;float delta;\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\npxStep=fwidth(dist);float out_edge=v_width2_dilute.x-dist;float in_edge=dist-(v_width2_dilute.y-2.0*ANTIALIASING);delta=v_width2_dilute.y > 0.0 ? min(in_edge,out_edge) : out_edge;float edge=ANTIALIASING;alpha=delta > 0.0 ? smoothstep(edge-pxStep,u_width_scale*blur+edge+pxStep,delta) : 0.0;\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nhighp float dash_w=float(dash.w);highp float dash_len=float(dash.z)+dash_w/65535.0;float sdfgamma=ANTIALIASING/float(dash_len);float scaled_floorwidth=(floorwidth*u_floor_width_scale);float periods_per_pixel=fwidth(v_tex.x);float dash_coverage=float(dash.y >> 4u)/4095.0;float fade=linearstep(0.25,0.5,periods_per_pixel);float gamma=max(sdfgamma/scaled_floorwidth,0.5*periods_per_pixel);if (fade >=1.0) {alpha*=dash_coverage;} else if (periods_per_pixel < 0.1) {float sdfdist=texture(u_dash_image,v_tex).r;alpha*=linearstep(0.5-gamma,0.5+gamma,sdfdist);} else {float span=min(periods_per_pixel,1.0);float tap_offset=span*0.25;float sdf0=texture(u_dash_image,vec2(v_tex.x-tap_offset,v_tex.y)).r;float sdf1=texture(u_dash_image,vec2(v_tex.x+tap_offset,v_tex.y)).r;alpha*=mix(0.5*(\nlinearstep(0.5-gamma,0.5+gamma,sdf0)+linearstep(0.5-gamma,0.5+gamma,sdf1)\n),dash_coverage,fade);}\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trim_alpha=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);highp float gradient_trim_color_mix_factor=0.0;\n#ifdef RENDER_LINE_GRADIENT\ngradient_trim_color_mix_factor=smoothstep(u_trim_gradient_mix_range.x,u_trim_gradient_mix_range.y,line_progress);\n#endif\nhighp vec4 trim_color=mix(u_trim_color,out_color,gradient_trim_color_mix_factor);out_color=mix(u_trim_gradient_mix_range.x < 1.0 ? color : out_color,trim_color,transition_factor);trim_alpha=1.0-transition_factor;}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\nfloat edge2=border_width*u_width_scale+ANTIALIASING;float alpha2=smoothstep(edge2-pxStep,edge2+pxStep,delta);if (alpha2 < 1.) {\n#ifdef RENDER_LINE_BORDER_GRADIENT\nvec4 border_gradient_color=texture(u_border_gradient_image,v_uv.xy);out_color=mix(border_gradient_color*trim_alpha,out_color,alpha2);\n#else\nif (border_color.a==0.0) {\n#ifndef RENDER_LINE_GRADIENT\nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-alpha2));} else {out_color.rgb*=(0.6+0.4*alpha2);}\n#else\nout_color.rgb*=(0.6+0.4*alpha2);\n#endif\n} else {out_color=mix(border_color*trim_alpha,out_color,alpha2);}\n#endif\nout_color*=v_width2_dilute.w;}\n#endif\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);light=u_emissive_in_shadows ? mix(light,1.0,emissive_strength) : light;\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*diluted_opacity*u_opacity_multiplier);\n#ifdef LINE_BLEND_ADDITIVE\n{float cov=alpha*diluted_opacity;glFragColor=vec4(cov > 0.0 ? out_color.rgb/cov : vec3(0.0),cov);}\n#else\n#ifdef LINE_BLEND_MULTIPLY\nglFragColor=vec4(out_color.rgb+(1.0-out_color.a),1.0);\n#else\nglFragColor=out_color;\n#endif\n#endif\nstoreEmissiveColor(glFragColor,emissive_strength);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n#ifdef DEBUG_ELEVATION_ID\nglFragColor=vec4(v_elevation_id_col,1.0);\n#endif\nif (u_clip_to_tile_borders) {if (v_tile_pos.x > 1.0 || v_tile_pos.y > 1.0 || v_tile_pos.x < 0.0 || v_tile_pos.y < 0.0) {discard;}}HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin ivec2 a_pos_normal;in uvec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH) || defined(VARIABLE_LINE_EMISSIVE_STRENGTH)\nin vec4 a_z_offset_width;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nin vec3 a_elevation_id_col;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nout vec3 v_elevation_id_col;\n#endif\n#ifdef ELEVATION_GROUND_SCALE\nin float a_elevation_ground_scale;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) || defined(RENDER_LINE_CURVE)\nin highp vec3 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_z_offset;uniform highp float u_road_view_depth_bias;uniform highp vec4 u_road_clip_to_view;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec4 v_width2_dilute;out float v_gamma_scale;out vec2 v_tile_pos;\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nout float stub_side;uniform float u_width_addition;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform highp float u_floor_width_scale;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out highp vec2 v_tex;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nout highp vec3 v_uv;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT)\nuniform float u_image_height;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump uvec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float side_z_offset\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump uvec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float side_z_offset\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\n#pragma mapbox: initialize lowp float emissive_strength\n#ifdef VARIABLE_LINE_EMISSIVE_STRENGTH\nemissive_strength=a_z_offset_width.w;\n#endif\nfloat a_z_offset=u_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset+=a_z_offset_width.x;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nv_elevation_id_col=a_elevation_id_col;\n#endif\nhighp float line_progress=0.0;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) || defined(RENDER_LINE_CURVE)\nline_progress=a_packed[2];\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\nANTIALIASING*=8.0;\n#endif\n#endif\nvec2 a_extrude=vec2(a_data.xy)-128.0;float a_direction=float(a_data.z & 3u)-1.0;vec2 pos_normal=vec2(a_pos_normal);vec2 pos=floor(pos_normal*0.5);mediump vec2 normal=pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;offset=-1.0*offset*u_width_scale;bool left=normal.y==1.0;gapwidth=gapwidth/2.0;float halfwidth;float dilute_scale=1.0;float dilute_border_scale=1.0;float symmetric_outset=0.0;\n#ifdef VARIABLE_LINE_WIDTH\nfloat left_width=a_z_offset_width.y;float right_width=a_z_offset_width.z;bool zero_right_width=border_width==0.0 && right_width==0.0;halfwidth=left ? left_width : right_width;halfwidth+=u_width_addition*(zero_right_width ? (left ? 1.0 : 0.0) : 0.5); \nhalfwidth*=u_width_scale;if (side_z_offset !=0.0) {float left_f=step(1.0,normal.y);float is_negative=step(side_z_offset,0.0);float apply=mix(1.0-left_f,left_f,is_negative);a_extrude*=apply;a_z_offset+=abs(side_z_offset)*apply;v_normal*=apply;}offset=border_width > 0.0 ? (left_width+right_width+u_width_addition)*u_width_scale : offset;halfwidth=border_width > 0.0 ? border_width*u_width_scale*0.5 : halfwidth;symmetric_outset=zero_right_width ? u_width_scale*(left_width+u_width_addition) : halfwidth;stub_side=zero_right_width ?-normal.y : 0.0;v_normal=!left && zero_right_width ? vec2(0.0) : v_normal;ANTIALIASING=!left && zero_right_width ? 0.0 : ANTIALIASING;\n#else\nhalfwidth=(u_width_scale*width)/2.0;\n#endif\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth > 0.0 ? ANTIALIASING : 0.0);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);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;v_tile_pos=pos+offset2*u_pixels_to_tile_units;gl_Position=u_matrix*vec4(v_tile_pos,a_z_offset,1.0);\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;float scaled_z_offset=a_z_offset;\n#ifdef ELEVATION_GROUND_SCALE\nscaled_z_offset=a_z_offset*mix(1.0,u_exaggeration,a_elevation_ground_scale);\n#endif\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=pos_normal.y-2.0*floor(pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+scaled_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+scaled_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+scaled_z_offset;\n#endif\n#endif\nv_tile_pos=offset_pos;gl_Position=u_matrix*vec4(v_tile_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\nv_tile_pos=pos+offset2*u_pixels_to_tile_units;gl_Position=u_matrix*vec4(v_tile_pos,0.0,1.0);\n#endif\n#endif\n#ifndef ELEVATED\n#ifndef VARIABLE_LINE_WIDTH\n#ifndef RENDER_TO_TEXTURE\nfloat base_w=gl_Position.w;vec2 screen_width=abs(projected_extrude.xy/base_w*u_units_to_pixels);float max_extrude_component=max(screen_width.x,screen_width.y);if (width >=1.0 && base_w > 0.0 && max_extrude_component > 0.0001) {float min_pixel=1.05;if (max_extrude_component < min_pixel) {vec2 abs_pos=abs(gl_Position.xy);float is_out=max(abs_pos.x,abs_pos.y)/base_w;dilute_scale=mix(max_extrude_component/min_pixel,1.0,smoothstep(2.5,4.5,is_out));projected_extrude/=dilute_scale;}else if (gapwidth > 0.0) {float visible_ratio=(halfwidth+ANTIALIASING)/outset;vec2 visible_screen_width=screen_width*visible_ratio;float max_visible_component=max(visible_screen_width.x,visible_screen_width.y);dilute_scale=min(1.0,max_visible_component/min_pixel);}else\n{\n#ifdef RENDER_LINE_BORDER\nfloat border_ratio=(border_width*u_width_scale+ANTIALIASING)/outset;screen_width*=border_ratio;float max_border_component=max(screen_width.x,screen_width.y);dilute_border_scale=min(1.0,max_border_component/min_pixel);\n#endif\n}}\n#endif\n#endif\nv_tile_pos=(v_tile_pos+extrude)/EXTENT;\n#ifdef ELEVATED_ROADS\ngl_Position=gl_Position+projected_extrude;\n#ifdef VARIABLE_LINE_WIDTH\n#ifndef ELEVATED\nhighp float road_view_depth_bias=u_road_view_depth_bias*smoothstep(-0.5,0.0,a_z_offset);if (road_view_depth_bias > 0.0) {highp float z_in=gl_Position.z/gl_Position.w*0.5+0.5;highp float a=u_road_clip_to_view.x;highp float b=u_road_clip_to_view.y;highp float c=u_road_clip_to_view.z;highp float d=u_road_clip_to_view.w;highp float view=(a*z_in+b)/(c*z_in+d);highp float view_new=view+road_view_depth_bias;highp float z_new=(view_new*d-b)/(a-view_new*c);z_new=clamp(z_new,0.0,1.0);gl_Position.z=(z_new*2.0-1.0)*gl_Position.w;}\n#endif\n#endif\n#else\ngl_Position=mix(gl_Position+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat epsilon=0.0001;float extrude_length_without_perspective=max(length(dist),epsilon);float extrude_length_with_perspective=max(length(projected_extrude_xy/gl_Position.w*u_units_to_pixels),epsilon);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nhighp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT)\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress);\n#else\nv_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nvec4 dashf=vec4(dash);highp float dash_w=float(dash.w);highp float totalLength=float(dash.z)+dash_w/65535.0;float scale=totalLength==0.0 ? 0.0 : u_tile_units_to_pixels/totalLength;float dash_half_height=float(dash.y & 15u);v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*dash_half_height+dashf.x+0.5)/u_texsize.y);\n#endif\nv_width2_dilute=vec4(outset,inset,dilute_scale,dilute_border_scale);\n#ifdef VARIABLE_LINE_WIDTH\nv_width2_dilute.x=symmetric_outset;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),linePattern:
2qT
vendor: 11,858 bytes, line 2
2('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\nuniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_alpha_discard_threshold;uniform lowp float u_opacity_multiplier;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image;\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef LINE_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\n#ifdef LINE_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl*texel_size-texel_size,pattern_b_br*texel_size+texel_size,vec2(x,y));vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);color=color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);}\n#endif\n#ifdef LINE_JOIN_NONE\nhighp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_with_emission_ground(color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\ncolor.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\ncolor.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity*u_opacity_multiplier);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}glFragColor=color;storeEmissiveColor(glFragColor,emissive_strength);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define scale 0.015873016\nin ivec2 a_pos_normal;in uvec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\nin vec4 a_z_offset_width;\n#endif\n#ifdef ELEVATION_GROUND_SCALE\nin float a_elevation_ground_scale;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 a_packed;\n#endif\nin highp float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin highp vec3 a_pattern_data;out vec2 v_pattern_data;\n#endif\nuniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define mediump float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float floorwidth\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize mediump float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float floorwidth\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize lowp float emissive_strength\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(a_data.xy)-128.0;float a_direction=float(a_data.z & 3u)-1.0;vec2 pos_normal=vec2(a_pos_normal);vec2 pos=floor(pos_normal*0.5);vec2 normal=pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;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);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;float scaled_z_offset=a_z_offset;\n#ifdef ELEVATION_GROUND_SCALE\nscaled_z_offset=a_z_offset*mix(1.0,u_exaggeration,a_elevation_ground_scale);\n#endif\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=pos_normal.y-2.0*floor(pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+scaled_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+scaled_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+scaled_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude_xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale);\n#ifdef LINE_JOIN_NONE\nv_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/(float(pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=float(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),raster:
2qT('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;uniform highp float u_color_ramp_size;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#ifdef RASTER_COLOR_SCALE_LOG\nfloat N=u_color_ramp_size;float vNorm=max((value.x-0.5/N)*N/(N-1.0),0.0);vNorm=log(vNorm*(10.0-1.0)+1.0)/log(10.0);value.x=0.5/N+vNorm*(N-1.0)/N;\n#endif\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nstoreEmissiveColor(glFragColor,u_emissive_strength);HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;\n#endif\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin ivec2 a_pos;in uvec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;uv=a_uv;float ele=u_raster_elevation;\n#ifdef ELEVATION_REFERENCE_GROUND\nele+=elevation(uv*EXTENT);\n#endif\nglobe_pos+=normalize(globe_pos)*ele*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos,1.0);\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nvec4 world_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec2 texture_pos=vec2(a_texture_pos);uv=texture_pos/8192.0;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 mercatorX=mercatorXfromLng(latLng[1]); \nfloat tiles=u_grid_matrix[0][2];
2if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}float ele=u_raster_elevation;\n#ifdef ELEVATION_REFERENCE_GROUND\nele+=elevation(uv*EXTENT)-decomposed_pos_and_skirt.z;\n#endif\nvec4 merc_world_pos=vec4(0.0); \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,ele,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;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*ele*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);world_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nfloat ele=0.0;vec2 decodedPos=vec2(a_pos);\n#ifdef ELEVATION_REFERENCE_GROUND\nvec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;decodedPos=decomposedPosAndSkirt.xy;uv=decodedPos/8192.0;ele=elevation(decodedPos)-skirt;\n#else\nuv=vec2(a_texture_pos)/8192.0;\n#endif\nworld_pos=vec4(decodedPos,(u_raster_elevation+ele),1.0);\n#ifdef FOG\nv_fog_pos=fog_position(decodedPos);\n#endif\n#endif\nfloat w=1.0+dot(uv*EXTENT,u_perspective_transform);gl_Position=u_matrix*world_pos*w;\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef ELEVATED\nfloat z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor);gl_Position.z-=(gl_Position.w*zbias);\n#endif\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),symbol:qT
vendor: 7,646 bytes, line 2
2('#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;\n#ifdef RENDER_TEXT_AND_SYMBOL\nuniform sampler2D u_texture_icon;\n#endif\nuniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_sdf;uniform lowp float u_scale_factor;uniform lowp float u_opacity_multiplier;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\n#ifdef RENDER_SHADOWS\nin highp float v_z_offset;\n#endif\nin vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\nin float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nin float is_sdf;in vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\nin lowp float v_opacity;in lowp vec4 v_fill_np_color;in lowp vec4 v_halo_np_color;in lowp float v_halo_width;in lowp float v_halo_blur;\n#ifdef LIGHTING_3D_MODE\nin lowp float v_emissive_strength;\n#endif\nvoid main() {lowp float opacity=v_opacity;lowp vec4 fill_color=vec4(0.0);lowp vec4 halo_color=vec4(0.0);lowp float halo_width=0.0;lowp float halo_blur=0.0;if (u_is_sdf) {fill_color=vec4(v_fill_np_color.rgb*v_fill_np_color.a,v_fill_np_color.a);halo_color=vec4(v_halo_np_color.rgb*v_halo_np_color.a,v_halo_np_color.a);halo_width=v_halo_width;halo_blur=v_halo_blur;}lowp float emissive_strength=0.0;\n#ifdef LIGHTING_3D_MODE\nemissive_strength=v_emissive_strength;\n#endif\nvec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2];\n#ifdef RENDER_TEXT_AND_SYMBOL\nif (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity*u_opacity_multiplier;glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}\n#endif\nvec2 cutout_factors=vec2(0.0);if (u_is_sdf) {float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha;} else {\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\n}out_color*=opacity*fade_opacity*u_opacity_multiplier;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);\n#ifdef TERRAIN\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#else\nout_color.rgb*=mix(v_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#endif\n#endif\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#define USING_APPEARANCE 1.0\nin ivec4 a_pos_offset;in uvec4 a_tex_size;in ivec4 a_pixeloffset;in vec4 a_projected_pos;in uint a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_auto_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin uvec2 a_texb;\n#endif\n#ifdef ELEVATED_ROADS\nin vec3 a_x_axis;in vec3 a_y_axis;uniform float u_normal_scale;\n#endif\n#ifdef RENDER_SHADOWS\nout highp float v_z_offset;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_inv_matrix;\n#endif\nuniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_elevation_from_sea;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;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_up_vector;\n#endif\n#ifdef RENDER_TEXT_AND_SYMBOL\nuniform vec2 u_texsize_icon;\n#endif\nuniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nout float is_sdf;out vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#ifndef MAX_UBO_SIZE_VEC4\n#define MAX_UBO_SIZE_VEC4 1024u\n#endif\n#define SPP_HEADER_SIZE_VEC4 4u\nstruct SymbolPaintProperties {vec4 fill_np_color;vec4 halo_np_color;float opacity;float halo_width;float halo_blur;float emissive_strength;float occlusion_opacity;float z_offset;vec2 translate;};uniform lowp vec4 u_spp_fill_np_color;uniform lowp vec4 u_spp_halo_np_color;uniform lowp float u_spp_opacity;uniform lowp float u_spp_halo_width;uniform lowp float u_spp_halo_blur;uniform lowp float u_spp_emissive_strength;uniform lowp float u_spp_occlusion_opacity;uniform highp float u_spp_z_offset;uniform lowp vec2 u_spp_translate_rotation;uniform highp float u_spp_zoom_fraction;in float a_feature_index;layout(std140) uniform SymbolPaintPropertiesHeaderUniform {uvec4 header[SPP_HEADER_SIZE_VEC4];} u_spp_header;layout(std140) uniform SymbolPaintPropertiesUniform {vec4 properties[MAX_UBO_SIZE_VEC4];} u_spp_properties;layout(std140) uniform SymbolPaintPropertiesIndexUniform {uvec4 block_indices[MAX_UBO_SIZE_VEC4];} u_spp_index;out lowp float v_opacity;out lowp vec4 v_fill_np_color;out lowp vec4 v_halo_np_color;out lowp float v_halo_width;out lowp float v_halo_blur;\n#ifdef LIGHTING_3D_MODE\nout lowp float v_emissive_strength;\n#endif\nfloat zoomFactor(float zm,float zM) {if (zm==zM) return u_spp_zoom_fraction-zm >=0.0 ? 1.0 : 0.0;return clamp((u_spp_zoom_fraction-zm)/(zM-zm),0.0,1.0);}vec4 readColor(uint base,bool isDataDriven,uint offsetVec4,uint dzr,vec2 headerZoom,vec4 fallbackValue) {if (!isDataDriven) return fallbackValue;vec4 value=u_spp_properties.properties[base+offsetVec4];vec2 blockZoom=u_spp_properties.properties[base+offsetVec4+dzr].xy;vec2 zr=mix(headerZoom,blockZoom,float(dzr));return unpack_mix_color(value,zoomFactor(zr.x,zr.y));}uint uvec4At(uvec4 v,uint index) {return (index==0u) ? v.x :\n(index==1u) ? v.y :\n(index==2u) ? v.z : v.w;}
vendor: 6,858 bytes, line 2
2float readScalar(uint base,bool isDataDriven,uint offsetVec4,float fallbackValue) {if (!isDataDriven) return fallbackValue;vec4 slot=u_spp_properties.properties[base+offsetVec4];return unpack_mix_vec2(slot.xy,zoomFactor(slot.z,slot.w));}vec2 readTranslate(uint base,bool isDataDriven,uint offsetVec4,uint dzr) {if (!isDataDriven) return vec2(0.0);vec4 value=u_spp_properties.properties[base+offsetVec4];vec2 blockZoom=u_spp_properties.properties[base+offsetVec4+dzr].xy;float t=zoomFactor(blockZoom.x,blockZoom.y)*float(dzr);return mix(value.xy,value.zw,t);}SymbolPaintProperties readSymbolPaintProperties() {uint dataDrivenMask=u_spp_header.header[0][0];uint dzrMask =u_spp_header.header[0][1];uint blockSizeVec4 =u_spp_header.header[0][2];uint fillColorDzr=dzrMask & 1u;uint haloColorDzr=(dzrMask >> 1u) & 1u;vec2 fillColorHeaderZoom=uintBitsToFloat(u_spp_header.header[3].xy);vec2 haloColorHeaderZoom=uintBitsToFloat(u_spp_header.header[3].zw);uint featureIndex=uint(a_feature_index);uvec4 indexSlot=u_spp_index.block_indices[featureIndex/4u];uint base=uvec4At(indexSlot,featureIndex % 4u)*blockSizeVec4;SymbolPaintProperties props;props.fill_np_color =readColor(base,(dataDrivenMask & (1u << 0u)) !=0u,u_spp_header.header[0][3],fillColorDzr,fillColorHeaderZoom,u_spp_fill_np_color);props.halo_np_color =readColor(base,(dataDrivenMask & (1u << 1u)) !=0u,u_spp_header.header[1][0],haloColorDzr,haloColorHeaderZoom,u_spp_halo_np_color);props.opacity =readScalar(base,(dataDrivenMask & (1u << 2u)) !=0u,u_spp_header.header[1][1],u_spp_opacity);props.halo_width =readScalar(base,(dataDrivenMask & (1u << 3u)) !=0u,u_spp_header.header[1][2],u_spp_halo_width);props.halo_blur =readScalar(base,(dataDrivenMask & (1u << 4u)) !=0u,u_spp_header.header[1][3],u_spp_halo_blur);props.emissive_strength=readScalar(base,(dataDrivenMask & (1u << 5u)) !=0u,u_spp_header.header[2][0],u_spp_emissive_strength);props.occlusion_opacity=readScalar(base,(dataDrivenMask & (1u << 6u)) !=0u,u_spp_header.header[2][1],u_spp_occlusion_opacity);props.z_offset =readScalar(base,(dataDrivenMask & (1u << 7u)) !=0u,u_spp_header.header[2][2],u_spp_z_offset);uint translateDzr=(dzrMask >> 8u) & 1u;props.translate =readTranslate(base,(dataDrivenMask & (1u << 8u)) !=0u,u_spp_header.header[2][3],translateDzr);return props;}vec2 unpack_opacity(uint packedOpacity) {return vec2(float(packedOpacity/2u)/127.0,float(packedOpacity & 1u));}void main() {SymbolPaintProperties paint_properties=readSymbolPaintProperties();lowp float opacity=paint_properties.opacity;v_opacity=opacity;v_fill_np_color=paint_properties.fill_np_color;v_halo_np_color=paint_properties.halo_np_color;v_halo_width=paint_properties.halo_width;v_halo_blur=paint_properties.halo_blur;\n#ifdef LIGHTING_3D_MODE\nv_emissive_strength=paint_properties.emissive_strength;\n#endif\nlowp float occlusion_opacity=paint_properties.occlusion_opacity;highp float z_offset=paint_properties.z_offset;vec2 a_pos=vec2(a_pos_offset.xy);vec2 a_offset=vec2(a_pos_offset.zw);vec2 a_tex=vec2(a_tex_size.xy);vec2 a_size=vec2(a_tex_size.zw);float a_size_min=floor(a_size[0]*0.5);float a_size_max= floor(a_size[1]*0.5);float a_apperance=a_size[1]-2.0*a_size_max;vec2 a_pxoffset=vec2(a_pixeloffset.xy);vec2 a_min_font_scale=vec2(a_pixeloffset.zw)/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (a_apperance==USING_APPEARANCE) {size=a_size_max/128.0;} else if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size_max,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;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_auto_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=vec3(a_globe_anchor)+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(vec3(a_globe_anchor)+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\n#ifdef PROJECTED_POS_ON_VIEWPORT\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0);\n#else\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#endif\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\n#ifdef Z_OFFSET\nz+=u_pitch_with_map ? a_auto_z_offset+z_offset : 0.0;\n#else\nz+=u_pitch_with_map ? z_offset : 0.0;\n#endif\nfloat occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\n#ifdef DEPTH_OCCLUSION\nfloat depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier;\n#endif\n
2float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\n#ifdef ELEVATED_ROADS\nvec3 xAxis=vec3(a_x_axis.xy,a_x_axis.z*u_normal_scale);vec3 yAxis=vec3(a_y_axis.xy,a_y_axis.z*u_normal_scale);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\npos=vec3(projected_pos.xy/projected_pos.w+offset,z);\n#endif\n#endif\ngl_Position=mix(u_coord_matrix*vec4(pos,1.0),AWAY,hidden);{vec2 tr=paint_properties.translate;vec2 rotated_tr=vec2(\nu_spp_translate_rotation.x*tr.x-u_spp_translate_rotation.y*tr.y,u_spp_translate_rotation.y*tr.x+u_spp_translate_rotation.x*tr.y\n);gl_Position.xy+=(u_coord_matrix*vec4(rotated_tr,0.0,0.0)).xy;}float gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize;\n#ifdef RENDER_TEXT_AND_SYMBOL\nis_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon;\n#endif\n#ifdef ICON_TRANSITION\nv_tex_b=vec2(a_texb)/u_texsize;\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shd_pos=u_inv_matrix*vec4(pos,1.0);vec3 shd_pos0=shd_pos.xyz;vec3 shd_pos1=shd_pos.xyz;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef RENDER_SHADOWS\nv_z_offset=e;\n#endif\n}'),skybox:qT('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
2nd-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=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',TT),skyboxGradient:qT('#include "_prelude_fog.fragment.glsl"\nin 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=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',TT),skyboxCapture:qT
vendor: 3,689 bytes, line 2
2("\nin 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;precision highp float;\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;
2v_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);}"),globeAtmosphere:qT('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_atmosphere_fog_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\nglFragColor=vec4(0,0,0,1);return;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_atmosphere_fog_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_atmosphere_fog_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat 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);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 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=c2;glFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in 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;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),stars:qT("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}"),occlusion:qT("uniform vec4 u_color;void main() {glFragColor=u_color;}",'#include "_prelude_terrain.vertex.glsl"\nin highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos;\n#ifdef TERRAIN\nfloat e=elevation(world_pos.xy);world_pos.z+=e;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}')};function HT(e,t){const i=e.split("\n");for(let e of i){if(e=e.trimStart(),"#"!==e[0])continue;if(!e.includes("if"))continue;if(e.startsWith("#endif"))continue;const i=e.match(LT);if(i)for(const e of i)zT.has(e)||t.add(e)}}function ZT(e){return new Set(["uint","int","uvec2","ivec2","uvec3","ivec3","uvec4","ivec4"]).has(e)}function qT(e,t){const i=new Set,n=[],r=[];e=e.replace(PT,(e,t)=>(r.push(t),"")),t=t.replace(PT,(e,t)=>(n.push(t),""));let o=new Set(FT);HT(e,o),HT(t,o);for(const e of[...n,...r])kT[e]||(kT[e]=new Set,HT(OT[e],kT[e])),o=new Set([...o,...kT[e]]);return{fragmentSource:e=e.replace(RT,(e,t,n,r,o)=>(i.add(o),"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\n${ZT(r)?"flat ":""}in ${n} ${r} ${o};\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:"initialize"===t?`\n#ifdef HAS_UNIFORM_u_${o}\n ${n} ${r} ${o} = u_${o};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n in ${n} ${r} ${o};\n#endif\n`:"initialize-attribute"===t?"":void 0)),vertexSource:t=t.replace(RT,(e,t,n,r,o)=>{const s=`MATERIAL_ATTRIBUTE_OFFSET_${o}`,a="float"===r?"vec2":r,l=`GET_ATTRIBUTE_${a}(a_${o}, materialInfo, ${s})`,c=o.includes("color")?"color":a;return"define-attribute-vertex-shader-only"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\nin ${n} ${r} a_${o};\n#endif\n`:i.has(o)?"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\n #if !defined(${s})\n in ${n} ${a} a_${o};\n #endif\n${ZT(r)?"flat ":""}out ${n} ${r} ${o};\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:"initialize"===t?"vec4"===c||"uvec4"===c?`\n#ifndef HAS_UNIFORM_u_${o}\n ${o} = a_${o};\n#else\n ${n} ${r} ${o} = u_${o};\n#endif\n`:`\n#if !defined(HAS_UNIFORM_u_${o})\n #ifdef ${s}\n ${o} = unpack_mix_${c}(${l}, u_${o}_t);\n #else\n ${o} = unpack_mix_${c}(a_${o}, u_${o}_t);\n #endif\n#else\n ${n} ${r} ${o} = u_${o};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n in ${n} ${r} a_${o};\n out ${n} ${r} ${o};\n#endif\n`:"initialize-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n ${o} = a_${o};\n#endif\n`:void 0:"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\n #if !defined(${s})\n in ${n} ${a} a_${o};\n #endif\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:"define-instanced"===t?"mat4"===c?`\n#ifdef INSTANCED_ARRAYS\nin vec4 a_${o}0;\nin vec4 a_${o}1;\nin vec4 a_${o}2;\nin vec4 a_${o}3;\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:`\n#ifdef INSTANCED_ARRAYS\nin ${n} ${a} a_${o};\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:"initialize-attribute-custom"===t?`\n#ifdef HAS_ATTRIBUTE_a_${o}\n ${n} ${r} ${o} = a_${o};\n#endif\n`:"vec4"===c||"uvec4"===c?`\n#ifndef HAS_UNIFORM_u_${o}\n #ifdef ${s}\n ${n} ${r} ${o} = ${l};\n #else\n ${n} ${r} ${o} = a_${o};\n #endif\n#else\n ${n} ${r} ${o} = u_${o};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${o}\n #ifdef ${s}\n ${n} ${r} ${o} = unpack_mix_${c}(${l}, u_${o}_t);\n #else\n ${n} ${r} ${o} = unpack_mix_${c}(a_${o}, u_${o}_t);\n #endif\n#else\n ${n} ${r} ${o} = u_${o};\n#endif\n`}),usedDefines:o,vertexIncludes:n,fragmentIncludes:r}}var WT={model:qT
vendor: 6,840 bytes, line 2
2('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nuniform float u_opacity;\n#ifdef DITHERED_DISCARD\nuniform float u_dithered_discard_threshold;\n#endif\n#ifndef LIGHTING_3D_MODE\nuniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;\n#endif\nuniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec4 normal_4n\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec4 normal_4n\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_feature\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-lightColor),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_feature\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\ntexColor=vec4(unpremultiplyColor(texColor),1.0);\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nvec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\nreturn color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;highp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_4n\nn=normalize(normal_4n.xyz);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));n=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_feature\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);
vendor: 2,676 bytes, line 2
2float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*light
vendor: 9,447 bytes, line 2
2Color;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {vec3 lightDir;vec3 lightColor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#else\nlightDir=u_lightpos;lightColor=u_lightcolor;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nfloat emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_feature\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb;\n#ifdef APPLY_LUT_ON_GPU\ncolor_mix=applyLUT(u_lutTexture,color_mix);\n#endif\ncolor=mix(color,color_mix,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef DITHERED_DISCARD\nif (abs(u_dithered_discard_threshold) < 1.0) {float ditherValue=fract(52.9829189*fract(0.06711056*gl_FragCoord.x+0.00583715*gl_FragCoord.y));float compareValue=mix(1.0-ditherValue,ditherValue,step(0.0,u_dithered_discard_threshold));if (abs(u_dithered_discard_threshold) < compareValue) {discard;}}\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_feature_cutout.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec4 normal_4n\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 feature\n#define MODEL_PART_COUNT 7u\n#define MODEL_PART_STYLE_SIZE_VEC4 28u\n#ifdef HAS_ATTRIBUTE_a_feature\nstruct ModelPartStyle {vec4 color_mix;vec4 rmea;vec4 gradient;float gradient_power;};layout(std140) uniform ModelPartStyleUniform {vec4 part_style[MODEL_PART_STYLE_SIZE_VEC4];} u_model_part_style;uniform vec4 u_model_mesh_params;\n#endif\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef HAS_ATTRIBUTE_a_feature\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#ifdef HAS_ATTRIBUTE_a_feature\nuint decodeModelPartId(uvec2 feature) {uint partId=feature.y & 0xFu;return partId < MODEL_PART_COUNT ? partId : 0u;}vec4 decodeModelVertexColor(uvec2 feature) {uvec4 nibbles=uvec4(feature.x >> 12u,feature.x >> 8u,feature.x >> 4u,feature.x) & 0xFu;return vec4(nibbles*17u)/255.0;}ModelPartStyle readModelPartStyle(uint partId) {uint base=partId*4u;ModelPartStyle style;style.color_mix=u_model_part_style.part_style[base];style.rmea=u_model_part_style.part_style[base+1u];style.gradient=u_model_part_style.part_style[base+2u];style.gradient_power=u_model_part_style.part_style[base+3u].x;return style;}vec3 modelAlbedo(ModelPartStyle style,vec4 vertexColor) {float ambientOcclusion=mix(1.0,vertexColor.a,u_model_mesh_params.z);return ambientOcclusion*mix(vertexColor.rgb,style.color_mix.rgb,style.color_mix.a);}vec4 resolveModelEmissiveGradient(ModelPartStyle style,float height) {float begin=u_model_mesh_params.x+u_model_mesh_params.y*style.gradient.x;float span=u_model_mesh_params.y*(style.gradient.y-style.gradient.x);return vec4((height-begin)/span,style.gradient_power,style.gradient.z,style.gradient.w);}\n#endif\nvoid main() {\n#pragma mapbox: initialize-attribute highp vec4 normal_4n\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp uvec2 feature\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_feature\nModelPartStyle part_style=readModelPartStyle(decodeModelPartId(feature));v_color_mix=vec4(modelAlbedo(part_style,decodeModelVertexColor(feature)),1.0);v_roughness_metallic_emissive_alpha=part_style.rmea;v_height_based_emission_params=resolveModelEmissiveGradient(part_style,a_pos_3f.z);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_4n\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_4n=vec4(rs*((u_lighting_matrix*vec4(normal_4n.xyz,0.0)).xyz/squared_scale),0.0);normal_4n=normalize(normal_4n);\n#else\nnormal_4n=vec4((normal_matrix*vec4(normal_4n.xyz,0)).xyz,0.0);\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_feature\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_4n\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_4n.xy,normal_4n.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normal_4n.xyz);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:
2qT("void main() {}","in vec3 a_pos_3f;uniform mat4 u_matrix;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden);\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\n}"),fillExtrusionDepth:qT("void main() {}",'#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale;\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nin ivec4 a_pos_normal_ed;\n#if defined(HAS_CENTROID) || defined(TERRAIN)\nin uvec2 a_centroid_pos;\n#endif\n#ifdef RENDER_WALL_MODE\nin ivec4 a_join_normal_inside;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp vec4 color\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp vec4 color\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 top_up_ny=vec3(a_pos_normal_ed.xyz & 1);vec3 pos_nx=vec3(a_pos_normal_ed.xyz >> 1);base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=vec2(a_centroid_pos);\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && int(centroid_pos.y)-(int(centroid_pos.y)/8)*8==7);float c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef RENDER_WALL_MODE\nvec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);pos.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;pos.xy-=join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);}'),fillExtrusionGroundEffect:qT
vendor: 3,847 bytes, line 2
2("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(1.0-texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size)).a,0.0,0.0,0.0);\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp ivec4 a_pos_end;in highp int a_angular_offset_factor;in highp uint a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao;\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec4 pos_end=vec4(a_pos_end);vec2 p=pos_end.xy;vec2 q=floor(pos_end.zw*0.5);vec2 start_bottom=pos_end.zw-q*2.0;float fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=float(a_angular_offset_factor)/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=float(a_hidden_by_landmark);\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),groundShadow:
2qT('#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in ivec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));v_fog_opacity=fog(v_fog_pos);\n#endif\n}')};const YT=(e,t)=>
vendor: 28,763 bytes, line 2
2({u_matrix:e,u_ground_shadow_factor:t});function XT(e,t,i=0){const n=Math.pow(2,t.tileID.overscaledZ),r=t.tileSize*Math.pow(2,e.transform.tileZoom)/n,o=r*(t.tileID.canonical.x+t.tileID.wrap*n),s=r*t.tileID.canonical.y;return{u_image:0,u_texsize:t.imageAtlasTexture?t.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/tb(t,1,e.transform.tileZoom),u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s],u_pattern_transition:i}}const JT={terrain:0,flat:1},KT=c(),QT=[0,0,0],eE=(e,t,i,n,r,o,a,c,u,h,d,f,p,m,_,g,y,v,x=[0,0,1],b=!1)=>{let w=QT,T=0,E=QT;if(!b){const e=t.style.light,i=e.properties.get("position");if(w=[i.x,i.y,i.z],"viewport"===e.properties.get("anchor")){const e=s();l(e,-t.transform.angle),J(w,w,e)}const n=e.properties.get("color").toPremultipliedRenderColor(null);T=e.properties.get("intensity"),E=[n.r,n.g,n.b]}const S=t.transform,I={u_matrix:e,u_lightpos:w,u_lightintensity:T,u_lightcolor:E,u_vertical_gradient:+i,u_opacity:n,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:KT,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:JT[h],u_base_type:JT[d],u_ao:r,u_edge_radius:o,u_width_scale:a,u_flood_light_color:_,u_vertical_scale:g,u_flood_light_intensity:y,u_ground_shadow_factor:v,u_front_cutoff_params:x};return"globe"===S.projection.name&&(I.u_tile_id=[c.canonical.x,c.canonical.y,1<<c.canonical.z],I.u_zoom_transition=f,I.u_inv_rot_matrix=m,I.u_merc_center=p,I.u_up_dir=S.projection.upVector(new rp(0,0,0),p[0]*Cr,p[1]*Cr),I.u_height_lift=u),I},tE=new Float32Array(16);function iE(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,g,y,v,x,b){const w=t.context,T=w.gl,E=t.transform,S=t.transform.zoom,I=[],A=e.translate,M=e.translateAnchor,C=e.edgeRadius,D=Bw(t,e.cutoffFadeRange);"clear"===u?(I.push("CLEAR_SUBPASS"),x&&(I.push("CLEAR_FROM_TEXTURE"),w.activeTexture.set(T.TEXTURE0),x.bind(T.LINEAR,T.CLAMP_TO_EDGE))):"sdf"===u?I.push("SDF_SUBPASS"):"emissive"===u&&(I.push("USE_MRT1"),w.activeTexture.set(T.TEXTURE0),x.bind(T.LINEAR,T.CLAMP_TO_EDGE)),y&&I.push("HAS_CENTROID"),D.shouldRenderCutoff&&I.push("RENDER_CUTOFF");const P=(e,i,r,u,_)=>{let v=I;null!=i.groundRadiusBuffer&&(v=I.concat("HAS_ATTRIBUTE_a_flood_light_ground_radius"));const b=i.programConfigurations.get(n.id),T=t.isTileAffectedByFog(e),E=t.getOrCreateProgram("fillExtrusionGroundEffect",{config:b,defines:v,overrideFog:T}),A=((e,t,i,n,r,o,s,a,l,c)=>({u_matrix:e,u_opacity:t,u_ao_pass:i?1:0,u_meter_to_tile:n,u_ao:r,u_flood_light_intensity:o,u_flood_light_color:s,u_attenuation:a,u_edge_radius:l,u_fb:0,u_fb_size:c,u_dynamic_offset:1}))(u,h,c,_,[d,f*_],p,m,g,S>=17?0:C*_,x?x.size[0]:0),M=[];y&&M.push(i.hiddenByLandmarkVertexBuffer),null!=i.groundRadiusBuffer&&M.push(i.groundRadiusBuffer),t.uploadCommonUniforms(w,E,e.toUnwrapped(),null,D),E.draw(t,w.gl.TRIANGLES,o,s,a,l,A,n.id,i.vertexBuffer,i.indexBuffer,r,n.paint,S,b,M)};for(const e of r){const r=i.getTile(e),o=r.getBucket(n);if(!o||o.projection.name!==E.projection.name||!o.groundEffect||o.groundEffect&&!o.groundEffect.hasData())continue;const s=o.groundEffect,a=1/o.tileToMeter;{const i=t.translatePosMatrix(e.projMatrix,r,A,M),n=s.getDefaultSegment();P(e,s,n,i,a)}if(v)for(let o=0;o<4;o++){const s=lp[o](e),l=i.getTile(s);if(!l)continue;const c=l.getBucket(n);if(!c||c.projection.name!==E.projection.name||!c.groundEffect||c.groundEffect&&!c.groundEffect.hasData())continue;const u=c.groundEffect;let h,d;0===o?(h=[-8192,0,0],d=1):1===o?(h=[Cr,0,0],d=0):2===o?(h=[0,-8192,0],d=3):(h=[0,Cr,0],d=2);const f=u.regionSegments[d];f&&(_(tE,e.projMatrix,h),P(e,u,f,t.translatePosMatrix(tE,r,A,M),a))}}}const nE={model:e=>({u_matrix:new sh(e),u_lighting_matrix:new sh(e),u_normal_matrix:new sh(e),u_node_matrix:new sh(e),u_lightpos:new ih(e),u_lightintensity:new eh(e),u_lightcolor:new ih(e),u_camera_pos:new ih(e),u_opacity:new eh(e),u_baseColorFactor:new rh(e),u_emissiveFactor:new rh(e),u_metallicFactor:new eh(e),u_roughnessFactor:new eh(e),u_baseTextureIsAlpha:new Qu(e),u_alphaMask:new Qu(e),u_alphaCutoff:new eh(e),u_baseColorTexture:new Qu(e),u_metallicRoughnessTexture:new Qu(e),u_normalTexture:new Qu(e),u_occlusionTexture:new Qu(e),u_emissionTexture:new Qu(e),u_lutTexture:new Qu(e),u_color_mix:new rh(e),u_aoIntensity:new eh(e),u_emissive_strength:new eh(e),u_occlusionTextureTransform:new rh(e),u_dithered_discard_threshold:new eh(e),u_model_mesh_params:new rh(e)}),modelDepth:e=>({u_matrix:new sh(e),u_instance:new sh(e),u_node_matrix:new sh(e)}),groundShadow:e=>({u_matrix:new sh(e),u_ground_shadow_factor:new ih(e)}),fillExtrusionDepth:e=>({u_matrix:new sh(e),u_edge_radius:new eh(e),u_width_scale:new eh(e),u_vertical_scale:new eh(e),u_height_type:new Qu(e),u_base_type:new Qu(e)}),fillExtrusionGroundEffect:e=>({u_matrix:new sh(e),u_opacity:new eh(e),u_ao_pass:new eh(e),u_meter_to_tile:new eh(e),u_ao:new th(e),u_flood_light_intensity:new eh(e),u_flood_light_color:new ih(e),u_attenuation:new eh(e),u_edge_radius:new eh(e),u_fb:new Qu(e),u_fb_size:new eh(e),u_dynamic_offset:new eh(e)})};function rE(e){const t=e.properties.get("direction"),i=xt(t.x,t.y,t.z);i[2]=it(i[2],0,75);const n=vt([i[0],i[1],i[2]]);return L(n.x,n.y,n.z)}function oE(e,t,i){const n="none"===t.properties.get("color-use-theme"),r=t.properties.get("color"),o=t.properties.get("intensity"),s=t.properties.get("direction"),a=[s.x,s.y,s.z],l="none"===i.properties.get("color-use-theme"),c=i.properties.get("color"),u=i.properties.get("intensity"),h=Math.max(q([0,0,1],a),0),d=[0,0,0];V(d,c.toPremultipliedRenderColor(l?null:e.getLut(t.scope)).toArray01Linear().slice(0,3),u);const f=[0,0,0];return V(f,r.toPremultipliedRenderColor(n?null:e.getLut(i.scope)).toArray01Linear().slice(0,3),h*o),At([d[0]>0?d[0]/(d[0]+f[0]):0,d[1]>0?d[1]/(d[1]+f[1]):0,d[2]>0?d[2]/(d[2]+f[2]):0])}const sE=[];function aE(e){return sE[e]=sE[e]||new Float64Array(16)}const lE=[],cE=new Float32Array(16);class uE{constructor(e,t){this.aabb=e,this.lastCascade=t}}class hE{add(e,t){const i=this.receivers[e.key];void 0!==i?(i.aabb.min[0]=Math.min(i.aabb.min[0],t.min[0]),i.aabb.min[1]=Math.min(i.aabb.min[1],t.min[1]),i.aabb.min[2]=Math.min(i.aabb.min[2],t.min[2]),i.aabb.max[0]=Math.max(i.aabb.max[0],t.max[0]),i.aabb.max[1]=Math.max(i.aabb.max[1],t.max[1]),i.aabb.max[2]=Math.max(i.aabb.max[2],t.max[2])):this.receivers[e.key]=new uE(t,null)}clear(){this.receivers={}}get(e){return this.receivers[e.key]}computeRequiredCascades(e,t,i){const n=Pf.fromPoints(e.points);let r=0;for(const e in this.receivers){const o=this.receivers[e];if(!o)continue;if(!n.intersectsAabb(o.aabb))continue;o.aabb.min=n.closestPoint(o.aabb.min),o.aabb.max=n.closestPoint(o.aabb.max);const s=o.aabb.getCorners();for(let e=0;e<i.length;e++){let n=!0;for(const r of s){const o=[r[0]*t,r[1]*t,r[2]];if(X(o,o,i[e].matrix),o[0]<-1||o[0]>1||o[1]<-1||o[1]>1){n=!1;break}}if(o.lastCascade=e,r=Math.max(r,e),n)break}}return r+1}}function dE(e,t,i){const n=W([],te([],i,t),te([],e,t)),r=R(n);return 0===r?[0,0,1,0]:(V(n,n,1/r),[n[0],n[1],n[2],-q(n,t)])}function fE(e,t,i,n,r,o){const s=e.zoom,a=e.scale,l=e.worldSize,c=1/l,u=e.aspect,h=Math.sqrt(1+u*u)*Math.tan(.5*e.fovX),f=h*h,g=n-i,y=n+i;let v,x;f>g/y?(v=n,x=n*h):(v=.5*y*(1+f),x=.5*Math.sqrt(g*g+2*(n*n+i*i)*f+y*y*f*f));const b=e.projection.pixelsPerMeter(e.center.lat,l),w=[0,0,-v*c];X(w,w,e._camera.getCameraToWorldMercator());let T=x*c;const E=function(t){return t[0]/=a,t[1]/=a,t[2]=xc(t[2],e._center.lat),t},S=e._edgeInsets;if(!(0===S.left&&0===S.top&&0===S.right&&0===S.bottom||S.left===S.right&&S.top===S.bottom)){const t=e._camera.getWorldToCamera(e.worldSize,"meters"===e.projection.zAxisUnit?b:1),r=e._camera.getCameraToClipPerspective(e._fov,e.width/e.height,i,n);r[8]=2*-e.centerOffset.x/e.width,r[9]=2*e.centerOffset.y/e.height;const o=new Float64Array(16);C(o,r,t);const a=new Float64Array(16);p(a,o);const c=Df.fromInvProjectionMatrix(a,l,s,!0);for(const e of c.points){const t=E(e);T=Math.max(T,ne(O([],w,t)))}}T*=r/(r-1);const I=Math.acos(t[2]),A=Math.atan2(-t[0],-t[1]),M=new ww;M.position=w,M.setPitchBearing(I,A);const D=M.getWorldToCamera(l,b),P=T*l,R=Math.min(e._mercatorZfromZoom(17)*l*-2,-2*P),z=M.getCameraToClipOrthographic(-P,P,-P,P,R,(P+o*b)/t[2]),F=new Float64Array(16);m(F,z,D);const k=.5*r,B=[0,0,0];X(B,L(Math.floor(1e6*w[0])/1e6*l,Math.floor(1e6*w[1])/1e6*l,0),F),V(B,B,k);const N=[Math.floor(B[0]),Math.floor(B[1]),Math.floor(B[2])],U=[0,0,0];te(U,B,N),V(U,U,-1/k);const j=new Float64Array(16);return d(j),_(j,j,U),m(F,j,F),[F,P]}class pE extends ln{constructor(e,t,i,n){super(),this.id=e,this.type="model",this.models=[],this._options=t,this._modelsInfo=new Map,this._abortController=null}cancelModelRequests(){this._abortController&&(this._abortController.abort(),this._abortController=null)}async loadGLTFFromURI(e,t){return ny((await this.map._requestManager.transformRequest(e,ai.Model,t)).url,t)}async loadModel(e,t,i){try{const n=await this.loadGLTFFromURI(t.uri,i);if(i.aborted)return;const r=this._modelsInfo.get(e);if(!r)return;const o=Jy(n),s=r.modelSpec,a=new Cy(e,s.uri,s.position,s.orientation,o);pE.applyModelSpecification(a,s),a.computeBoundsAndApplyParent(),this.models.push(a),r.model=a}catch(n){if(i.aborted)return;this.fire(new on(new Error(`Could not load model ${e} from ${t.uri}`,{cause:n})))}}async load(){this._abortController||(this._abortController=new AbortController);const e=this._abortController.signal,t=[];for(const i in this._options.models){const n=this._options.models[i],r=this._modelsInfo.get(i);if(r&&r.model){r.modelSpec=n;const e=r.model;e.position=null!=n.position?new gc(n.position[0],n.position[1]):new gc(0,0),e.orientation=n.orientation??[0,0,0],pE.applyModelSpecification(e,n),e.computeBoundsAndApplyParent(),this.models.push(e)}else r?r.modelSpec=n:(this._modelsInfo.set(i,{modelSpec:n,model:null}),t.push(this.loadModel(i,n,e)))}0!==t.length?(await Promise.allSettled(t),e.aborted||this.fire(new rn("data",{dataType:"source",sourceDataType:"metadata"}))):this.loaded()&&this.fire(new rn("data",{dataType:"source",sourceDataType:"metadata"}))}static arrayFromColorSpecification(e){const t=e;if(void 0===t)return;if(Array.isArray(t))return[t[0],t[1],t[2]];const i=mn.parse(t);return i?[i.r,i.g,i.b]:void 0}static applyModelSpecification(e,t){if(t.nodeOverrides&&pE.convertNodeOverrides(e,t.nodeOverrides),t.materialOverrides&&pE.convertMaterialOverrides(e,t.materialOverrides),t.nodeOverrideNames&&(e.nodeOverrideNames=[...t.nodeOverrideNames]),t.materialOverrideNames&&(e.materialOverrideNames=[...t.materialOverrideNames]),t.featureProperties&&(e.featureProperties=t.featureProperties),t.lightOverrides){const i=t.lightOverrides,n=pE.arrayFromColorSpecification(i["light-ambient-color"]),r=pE.arrayFromColorSpecification(i["light-directional-color"]);e.lightOverrides={ambientIntensity:i["light-ambient-intensity"],ambientColor:n,directionalIntensity:i["light-directional-intensity"],directionalColor:r}}else e.lightOverrides=void 0}static convertNodeOverrides(e,t){if(Array.isArray(t)&&t.every(e=>"string"==typeof e)){e.nodeOverrideNames=[];for(const i of t)e.nodeOverrideNames.push(i)}else Object.entries(t).forEach(([t,i])=>{const n={orientation:[0,0,0],minZoom:void 0,maxZoom:void 0};if(Object.hasOwn(i,"orientation")){const e=i.orientation;e&&(n.orientation=e)}Object.hasOwn(i,"minzoom")&&(n.minZoom=i.minzoom),Object.hasOwn(i,"maxzoom")&&(n.maxZoom=i.maxzoom),e.nodeOverrides.set(t,n)})}static convertMaterialOverrides(e,t){if(Array.isArray(t)&&t.every(e=>"string"==typeof e)){e.materialOverrideNames=[];for(const i of t)e.materialOverrideNames.push(i)}else Object.entries(t).forEach(([t,i])=>{const n=pE.arrayFromColorSpecification(i["model-color"]),r={color:void 0!==n?new mn(n[0],n[1],n[2]):new mn(1,1,1),colorMix:0,emissionStrength:0,opacity:1},o=i["model-color-mix-intensity"];void 0!==o&&(r.colorMix=o);const s=i["model-emissive-strength"];void 0!==s&&(r.emissionStrength=s);const a=i["model-opacity"];void 0!==a&&(r.opacity=a),e.materialOverrides.set(t,r)})}onAdd(e){this.map=e,this.load()}hasTransition(){return!1}loaded(){if(0===this._modelsInfo.size)return!0;for(const e of this._modelsInfo.values())if(null==e.model)return!1;return!0}getModels(){return this.models}loadTile(e,t){}serialize(){return this._options}setProperty(e,t){return!1}reload(){this.cancelModelRequests();const e=bl(this.id,this.scope);this.map.style.clearSource(e),this.models=[],this._modelsInfo.clear(),this.load()}onRemove(e){this.cancelModelRequests()}setModels(e){this.models=[];const t=new Map;for(const i in e){const n=e[i],r=this._modelsInfo.get(i);r&&r.modelSpec.uri===n.uri&&t.set(i,r)}if(this._modelsInfo.size!==t.size){this.cancelModelRequests();for(const[e,i]of t)i.model||t.delete(e)}this._modelsInfo=t,this._options.models=e,this.load()}}function mE(e,t,i){try{t=function(e){if(!e.variants)return e;if(!Array.isArray(e.variants))throw new Error("variants must be an array");let t=null,i=null;for(const n of e.variants){if(null==n||"object"!=typeof n||n.constructor!==Object)throw new Error("variant must be an object");if(!Array.isArray(n.capabilities))throw new Error("capabilities must be an array");1===n.capabilities.length&&("meshopt-v2+lod"===n.capabilities[0]?i=n:"meshopt"===n.capabilities[0]&&(t=n))}const n=null!==i?i:t;return null!==n?Object.assign(e,n):e}(t)}catch(e){return new Error("Failed to process TileJSON variants",{cause:e})}const n=st({...t,...e},["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","extra_bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);return e.url&&t.tiles&&e.tiles&&(n.tiles=t.tiles),n.tiles=i.canonicalizeTileset(n,e.url),n}function _E(e,t,i,n,r){const o=function(i,n){if(i)return r(i);if(n){e.url&&n.tiles&&e.tiles&&delete e.tiles;const i=mE(e,n,t);if(i instanceof Error)return r(i);r(null,i)}},s=function(e,t,i){if(!e)return null;if(!t&&!i)return e;i=i||e.worldview_default;const n=Object.values(e.language||{});if(0===n.length)return null;const r=Object.values(e.worldview||{});if(0===r.length)return null;const o=n.every(e=>e===t),s=r.every(e=>e===i);return o&&s?e:t in(e.language_options||{})||i in(e.worldview_options||{})?null:e.language_options&&e.worldview_options?e:null}(e.data,i,n);if(s)return Vt.frame(()=>o(null,s));if(e.url){const r=new AbortController;return(async()=>{const s=await t.transformRequest(t.normalizeSourceURL(e.url,null,i,n),ai.Source,r.signal),{data:a}=await mi(s,r.signal);o(null,a)})().catch(e=>{r.signal.aborted||o(e)}),{cancel:()=>r.abort()}}return Vt.frame(()=>{const{data:t,...i}=e;o(null,i)})}function gE(e,t){const i=Math.pow(2,t.z),n=Math.floor(dr(e.getWest())*i),r=Math.floor(fr(e.getNorth())*i),o=Math.ceil(dr(e.getEast())*i),s=Math.ceil(fr(e.getSouth())*i);return t.x>=n&&t.x<o&&t.y>=r&&t.y<s}class yE{constructor(e,t,i){this.bounds=e?yc.convert(this.validateBounds(e)):null,this.minzoom=t||0,this.maxzoom=i||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}addExtraBounds(e){if(e){this.extraBounds||(this.extraBounds=[]);for(const t of e)this.extraBounds.push(yc.convert(this.validateBounds(t)))}}contains(e){if(e.z>this.maxzoom||e.z<this.minzoom)return!1;if(this.bounds&&!gE(this.bounds,e))return!1;if(!this.extraBounds)return!0;for(const t of this.extraBounds)if(gE(t,e))return!0;return!1}static fromTileJSON(e){if(!e.bounds&&!e.extra_bounds)return null;const t=new yE(e.bounds,e.minzoom,e.maxzoom);return t.addExtraBounds(e.extra_bounds),t}}const vE={loaded:!0,drawModels:function(e,t,i,n){if("opaque"===e.renderPass)return;const r=i.paint.get("model-opacity").constantOr(1),o=i.paint.get("model-elevation-reference"),s="ground"===o,a="ground"===o;if(0===r)return;const l=i.paint.get("model-cast-shadows");if("shadow"===e.renderPass){if(!l)return;if(e.terrain&&r<.65&&i._transitionablePaint._values["model-opacity"].value.expression instanceof Gs)return}const u=e.shadowRenderer,h=i.paint.get("model-receive-shadows");u&&(u.useNormalOffset=!0,h||(u.enabled=!1));const d=()=>{u&&(u.useNormalOffset=!0,h||(u.enabled=!0))},_=t.getSource();if("light-beam"===e.renderPass&&"batched-model"!==_.type)return;if("vector"===_.type||"geojson"===_.type)return function(e,t,i,n,r){const o=e.transform,s="globe"===o.projection.name,a=o.getFreeCameraOptions().position;if(!e.modelManager)return;const l=e.modelManager;i.modelManager=l;const u=e.shadowRenderer;if(!Object.hasOwn(i._unevaluatedLayout._values,"model-id"))return;const h=i._unevaluatedLayout._values["model-id"],d={...i.layout.get("model-id").parameters},f=e.style.order.indexOf(i.fqid),p=i.paint.get("model-opacity").constantOr(1);for(const m of n){const n=t.getTile(m).getBucket(i);if(!n||n.projection.name!==o.projection.name)continue;const _=n.getModelUris();if(_&&!n.modelsRequested&&(l.addModelsFromBucket(_,r),n.modelsRequested=!0),s)d.zoom=m.overscaledZ;else{const e=pT(m,o);d.zoom=e}const g=h.possiblyEvaluate(d);if(dT(e,n,m),fT.shadowUniformsInitialized=!1,fT.useSingleShadowCascade=!!u&&0===u.getMaxCascadeForTile(m.toUnwrapped()),"shadow"===e.renderPass&&u){if(1===e.currentShadowCascade&&n.isInsideFirstShadowMapFrustum)continue;const t=o.calculatePosMatrix(m.toUnwrapped(),o.worldSize);if(fT.tileMatrix.set(t),fT.shadowTileMatrix.set(u.calculateShadowPassMatrixFromMatrix(t)),fT.aabb.min=[0,0,0],fT.aabb.max[0]=fT.aabb.max[1]=Cr,fT.aabb.max[2]=0,gT(n,fT,e,i.scope))continue}const y=1<<m.canonical.z,v=[((a.x-m.wrap)*y-m.canonical.x)*Cr,(a.y*y-m.canonical.y)*Cr,a.z*y*Cr];e.conflationActive&&Object.keys(n.instancesPerModel).length>0&&e.style.isLayerClipped(i,t.getSource())&&n.updateReplacement(m,e.replacementSource,f,i.scope)&&(n.uploaded=!1,n.upload(e.context));let x=0;const T=new Array,I=new Array,A=new Array;for(let t in n.instancesPerModel){const o=n.instancesPerModel[t];o.features.length>0&&!s&&(t=g.evaluate(o.features[0].feature,{}));const u=l.getModel(t,r);if(u||l.hasURLBeenRequested(t)||n.modelUris.includes(t)||(n.modelUris.push(t),n.modelsRequested=!1),u&&u.uploaded)if(s){const t=V([],[a.x,a.y,a.z],e.transform.worldSize);H(t,t);for(let i=0;i<o.instancedDataArray.length;++i){const r=[0,0,0],s=[1,1,1],a=ce(),l=o.tileCoordinatesForInstance(i),h=o.transformForInstance(i);E(s,h),S(a,h),he(r,a);const d=o.translationForInstance(i),f=new gc(0,0);Nw(n.canonical,f,l.x,l.y);const m=c();My(m,u,e.transform,f,r,s,d,!0,!1,!1);const _=o.colorForInstance(i),g=b([],t),y=w([],[1,1,1/Ec(f.lat,e.transform.zoom)]);A.push({zScaleMatrix:y,negCameraPosMatrix:g});for(const t of u.nodes)sT(e,t,m,e.transform.expandedFarZProjMatrix,x,T,I,u.materialOverrides,p,_);++x}}else for(const t of u.nodes)mT(e,i,t,o,v,m,fT)}if(s)if("shadow"===e.renderPass){for(const t of I)aT(t.mesh,t.nodeModelMatrix,e,i);for(const t of T)aT(t.mesh,t.nodeModelMatrix,e,i)}else hT(e,i,T,I,A)}}(e,t,i,n,oT(e,i)),void d();if(!_.loaded())return;if("batched-model"===_.type)return function(e,t,i,n){i.resetLayerRenderingStats(e);const r=e.context,o=e.transform,s=e.style.fog,a=e.shadowRenderer;if("mercator"!==o.projection.name)return void gt(`Drawing 3D landmark models for ${o.projection.name} projection is not yet implemented`);const l=e.transform.getFreeCameraOptions().position,c=V([],[l.x,l.y,l.z],e.transform.worldSize),u=b([],H([],c)),h=Ec(o.center.lat,o.zoom),d=m([],u,w([],[1,1,1/h])),_=i.paint.get("model-opacity").constantOr(1),y=new fw(r.gl.LEQUAL,fw.ReadWrite,e.depthRangeFor3D),v=new fw(r.gl.LEQUAL,fw.ReadOnly,e.depthRangeFor3D),x=new Pf([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),T="shadow"===e.renderPass,E="light-beam"===e.renderPass,S="none"===i.paint.get("model-color-use-theme").constantOr("default"),I=T&&a?a.getCurrentCascadeFrustum():o.getFrustum(o.scaleZoom(o.worldSize)),A=i.paint.get("model-front-cutoff"),M=A[2]<1,C=Bw(e,i.paint.get("model-cutoff-fade-range")),P=i.getLayerRenderingStats();(function(e,t,i,n){const r=e.terrain?e.terrain.exaggeration():0,o=e.transform.zoom;for(const s of n){const n=t.getTile(s).getBucket(i);n&&(n.setFilter(i.filter),e.conflationActive&&n.updateReplacement(s,e.replacementSource),n.evaluateTransform(e,i),e.terrain&&r>0&&n.elevationUpdate(e.terrain,r,s,i.source),n.needsReEvaluation(e,o,i)&&n.evaluate(i))}})(e,t,i,n),function(){const l=new Map;let u,b,w;M?(u=n.length-1,b=-1,w=-1):(u=0,b=n.length,w=1);const R=D(),L=new Pe(0,0);for(let D=u;D!==b;D+=w){const u=n[D],b=t.getTile(u).getBucket(i);if(!b||!b.uploaded)continue;let w=!1;a&&(w=0===a.getMaxCascadeForTile(u.toUnwrapped()));const z=o.calculatePosMatrix(u.toUnwrapped(),o.worldSize),F=!!(4&b.modelTraits);m($w,d,z),m(Hw,o.expandedFarZProjMatrix,z),p(Zw,$w),f(Zw,Zw);const O=!T&&a&&a.enabled?a.computeCascadeTileMatrices(z):null;!T&&M&&(p(jw,z),X(R,c,jw),L.x=R[0],L.y=R[1]);const k=[];b.setFilter(i.filter);for(const t of b.getNodesInfo()){if(t.hiddenByReplacement)continue;if(!t.node.meshes)continue;const i=t.node;let n=0;e.terrain&&i.elevation&&(n=i.elevation*e.terrain.exaggeration());const r=()=>{const e=t.aabb,i=x.min,r=x.max;return i[0]=e.min[0],i[1]=e.min[1],i[2]=e.min[2]+n,r[0]=e.max[0],r[1]=e.max[1],r[2]=e.max[2]+n,X(i,i,z),X(r,r,z),x},s=r(),a=t.evaluatedScale;if(a[0]<=1&&a[1]<=1&&a[2]<=1&&0===s.intersects(I))continue;if(!T){const i=s.min,n=s.max;Xw[0]=.5*(i[0]+n[0]),Xw[1]=.5*(i[1]+n[1]),Xw[2]=.5*(i[2]+n[2]);const r=j(c,Xw)*h,o=e._debugParams.lodSwitchDistance,l=o>=0;if(l&&o>=9999)t.targetLod=0;else{let s;if(l)s=o;else{const e=(n[2]-i[2])*h*a[2],t=Math.max(n[0]-i[0],n[1]-i[1])*h*Math.max(a[0],a[1]);let r;r=e>=30?1:t>=80?.5:Math.max(e,t)>=20?.25:0,s=2e3+3e3*r}_T(t,r,Math.min(e.frameTimeDelta,1e3/30),s,e._debugParams.lodSwitchFadeDuration)}}if(!T&&M){const e=1/6;t.cameraCollisionOpacity=c[0]>s.min[0]&&c[0]<s.max[0]&&c[1]>s.min[1]&&c[1]<s.max[1]&&c[2]*h<s.max[2]&&i.footprint&&$p(L,i.footprint)?Math.max(t.cameraCollisionOpacity-e,0):Math.min(1,t.cameraCollisionOpacity+e)}const l=1/Ic(u.canonical),d=i.anchor?i.anchor[0]:0,f=i.anchor?i.anchor[1]:0,p=[d*(a[0]-1)+t.evaluatedTranslation[0]*l,f*(a[1]-1)+t.evaluatedTranslation[1]*l,n+t.evaluatedTranslation[2]],g=eT(new Float64Array(16),z,p,a),y=m([],g,i.globalMatrix),v=m([],o.expandedFarZProjMatrix,y),b=v[2]*d+v[6]*f+v[10]*n+v[14];i.hidden=!1;let w=_;T||(M&&(w*=t.cameraCollisionOpacity,w*=vT(g,o,t.aabb,A)),w*=yT(C,b)),0!==w?k.push({nodeInfo:t,depth:b,opacity:w,wvpForNode:v,nodeModelMatrix:y,tileModelMatrix:g,tileTranslation:p}):i.hidden=!0}T||k.sort((e,t)=>!M||1===e.opacity&&1===t.opacity?e.depth<t.depth?-1:1:1===e.opacity?-1:1===t.opacity?1:e.depth>t.depth?-1:1);for(const t of k){const n=t.nodeInfo,c=n.node;let u=null;if(e._debugParams.show3DModelFootprints&&c.footprint){const e=c.id||c.name||"footprint";if(!l.has(e)){const i=eT(new Float64Array(16),Hw,t.tileTranslation,t.nodeInfo.evaluatedScale);l.set(e,{node:c,mvp:i})}}const h=t.nodeInfo.evaluatedScale;eT(Uw,$w,t.tileTranslation,h),Ww[0]=1/h[0],Ww[1]=-1/h[1],Ww[2]=1/h[2],g(jw,Zw,Ww),m(Uw,Uw,c.globalMatrix);const d=F?0:n.evaluatedRMEA[0][2],f=n.targetLod,p=c.lodMeshes&&c.lodMeshes.length>0,_=p&&f>0&&f<1;if(T&&p&&1===Math.round(f))continue;const x=!T&&s?Qw(Gw,t.nodeModelMatrix,e.transform):null,b=T&&a?a.calculateShadowPassMatrixFromMatrix(t.nodeModelMatrix):null,I=_?2:1,A=p&&1===Math.round(f);for(let l=0;l<I;++l){const h=_?1===l:A,p=h?c.lodMeshes:c.meshes,m=_?h?-f:1-f:1;for(let l=0;l<p.length;++l){const f=p[l],g=!h&&l===c.lightMeshIndex;let I=t.wvpForNode;if(g){if(!E&&!e.terrain&&e.shadowRenderer){e.currentLayer<e.firstLightBeamLayer&&(e.firstLightBeamLayer=e.currentLayer);continue}I=eT(qw,Hw,t.tileTranslation,t.nodeInfo.evaluatedScale)}else if(E)continue;const A={defines:[]},M=[],C=!!f.normalBuffer;!T&&a&&(a.useNormalOffset=C);const D=iT(n,f);if(nT(A.defines,M,f,e,S?null:i.lut,D),F||A.defines.push("DIFFUSE_SHADED"),w&&A.defines.push("SHADOWS_SINGLE_CASCADE"),P&&(T?P.numRenderedVerticesInShadowPass+=f.vertexArray.length:P.numRenderedVerticesInTransparentPass+=f.vertexArray.length),T){aT(f,t.nodeModelMatrix,e,i,b);continue}if(s&&"globe"!==o.projection.name){const e=f.aabb.min,t=f.aabb.max,[i,n]=s.getOpacityForBounds(x,e[0],e[1],t[0],t[1]);A.overrideFog=i>=Yp||n>=Yp}const R=f.material;let L;R.occlusionTexture&&R.occlusionTexture.offsetScale&&(L=R.occlusionTexture.offsetScale,A.defines.push("OCCLUSION_TEXTURE_TRANSFORM")),_&&A.defines.push("DITHERED_DISCARD");const z=e.getOrCreateProgram("model",A);if(!T&&a&&a.enabled)if(u!==C){for(let e=0;e<O.length;e++)eT(Kw[e]=Kw[e]||new Float64Array(16),O[e],t.tileTranslation,t.nodeInfo.evaluatedScale);a.setupShadowsFromCascadeMatrices(Kw,z,C),u=C}else z.setShadowUniformValues(r,a.getShadowUniformValues());e.uploadCommonUniforms(r,z,null,x);const k=R.pbrMetallicRoughness;k.metallicFactor=.9,k.roughnessFactor=.5;const B=sw(I,Uw,jw,c.globalMatrix,e,t.opacity,k.baseColorFactor,R.emissiveFactor,k.metallicFactor,k.roughnessFactor,R,d,i,Jw,L,void 0,void 0,m,z.fixedDefines.includes("LIGHTING_3D_MODE"));B.u_model_mesh_params=tT(f,c,g,h),D&&D.bind(r,z.program),!g&&(n.hasTranslucentParts||t.opacity<1)&&z.draw(e,r.gl.TRIANGLES,y,cw.disabled,dw.disabled,_w.backCCW,B,i.id,f.vertexBuffer,f.indexBuffer,f.segments,i.paint,e.transform.zoom,void 0,M),z.draw(e,r.gl.TRIANGLES,g?v:y,cw.disabled,g||t.opacity<1||n.hasTranslucentParts?dw.alphaBlended:dw.unblended,_w.backCCW,B,i.id,f.vertexBuffer,f.indexBuffer,f.segments,i.paint,e.transform.zoom,void 0,M)}}}}if(e._debugParams.show3DModelFootprints&&l.size>0){const t=Array.from(l.keys()).sort();for(const i of t){const{node:t,mvp:n}=l.get(i);lT(e,0,t,n)}}}()}(e,t,i,n),void d();if("model"!==_.type)return;const y=_.getModels(),v=[],x=e.transform.getFreeCameraOptions().position,T=V([],[x.x,x.y,x.z],e.transform.worldSize);H(T,T);const I=[],A=[];let M=0;for(const n of y){const r=t.getFeatureState("",n.id),o={type:"Unknown",id:n.id,properties:n.featureProperties},l=i.paint.get("model-rotation").evaluate(o,r),c=i.paint.get("model-scale").evaluate(o,r),u=i.paint.get("model-translation").evaluate(o,r),h=i.paint.get("model-opacity").evaluate(o,r);cT(i,n.id,r,n.featureProperties,n.nodeOverrideNames,n.nodeOverrides),uT(i,n.id,r,n.featureProperties,n.materialOverrideNames,n.materialOverrides),n.nodeOverrides.size>0&&n.computeBoundsAndApplyParent(),n.computeModelMatrix(e,l,c,u,a,s,!1);const d=b([],T),f=w([],[1,1,1/Ec(n.position.lat,e.transform.zoom)]);v.push({zScaleMatrix:f,negCameraPosMatrix:d});for(const t of n.nodes)sT(e,t,n.matrix,e.transform.expandedFarZProjMatrix,M,I,A,n.materialOverrides,h,void 0,n.lightOverrides);M++}if(I.sort((e,t)=>t.depth-e.depth),"shadow"!==e.renderPass){if(e._debugParams.show3DModelFootprints){const t=e.transform.projMatrix,i=new Map,n=(e,n)=>{if(e.footprint){const r=e.id||e.name||"footprint";if(!i.has(r)){const o=m([],t,n);i.set(r,{node:e,mvp:o})}}};for(const e of A)n(e.node,e.modelMatrix);for(const e of I)n(e.node,e.modelMatrix);const r=Array.from(i.keys()).sort();for(const t of r){const{node:n,mvp:r}=i.get(t);lT(e,0,n,r)}}hT(e,i,I,A,v),d()}else{for(const t of A)aT(t.mesh,t.nodeModelMatrix,e,i);for(const t of I)aT(t.mesh,t.nodeModelMatrix,e,i);d()}},prepare:function(e,t,i){const n=t.getSource();if(!n.loaded())return;if("vector"===n.type||"geojson"===n.type)return void(i.modelManager&&i.modelManager.upload(i,oT(i,e)));if("batched-model"===n.type)return;if("model"!==n.type)return;const r=n.getModels();for(const e of r)e.upload(i.context)},shaders:WT,programUniforms:nE,ShadowRenderer:class{constructor(e){this.painter=e,this._enabled=!1,this._drawShadowAfterLayer=-1,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new hE,this._depthMode=new fw(e.context.gl.LEQUAL,fw.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this._devtoolsFolder=null,this.useNormalOffset=!1,this._shadowParameters={cascadeCount:2,normalOffset:3,shadowMapResolution:2048}}destroy(){for(const e of this._cascades)e.texture.destroy(),e.framebuffer.destroy();this._cascades=[]}_hasCasterGeometry(e,t){const i=this.painter.style.getLayerSourceCache(e);if(!i)return!1;const n=i.getSource();if("model"===n.type)return n.getModels().length>0;const r=t[i.id];if(!r)return!1;for(const t of r){const n=i.getTile(t);if(n&&n.getBucket(e))return!0}return!1}updateShadowParameters(e,t,i){const n=this.painter;if(this._enabled=!1,this._drawShadowAfterLayer=-1,this._receivers.clear(),!t||!t.properties)return;const r=t.properties.get("shadow-intensity"),o=t.properties.get("shadow-draw-before-layer");if(!t.shadowsEnabled()||r<=0)return;let s=-1,a=0;for(const t of n.style.order){const r=n.style._mergedLayers[t];r.hasShadowPass()&&!r.isHidden(e.zoom)&&this._hasCasterGeometry(r,i)&&
vendor: 4,221 bytes, line 2
2(s=a),!o||o!==t&&o!==r.slot||(this._drawShadowAfterLayer=a>0?a-1:0),a+=1}if(this._enabled=s>=0,!this.enabled)return;this._drawShadowAfterLayer<0&&(this._drawShadowAfterLayer=s);const l=n.context,c=this._shadowParameters.shadowMapResolution,u=this._shadowParameters.shadowMapResolution;if(0===this._cascades.length||this._shadowParameters.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let e=0;e<this._shadowParameters.cascadeCount;++e){const e=l.gl,t=l.createFramebuffer(c,u,0,"texture"),i=new Mm(l,{width:c,height:u,data:null},e.DEPTH_COMPONENT16);t.depthAttachment.set(i.texture),this._cascades.push({framebuffer:t,texture:i,matrix:[],far:0,boundingSphereRadius:0,frustum:new Df,scale:0})}}this.shadowDirection=rE(t);let h=0;if(e.elevation){const t=e.elevation,i=[1e4,-1e4];t.visibleDemTiles.filter(e=>e.dem).forEach(e=>{const t=e.dem.tree;i[0]=Math.min(i[0],t.minimums[0]),i[1]=Math.max(i[1],t.maximums[0])}),1e4!==i[0]&&(h=(i[1]-i[0])*t.exaggeration())}const d=1.5*e.cameraToCenterDistance,f=3*d,m=new Float64Array(16);for(let t=0;t<this._cascades.length;++t){const i=this._cascades[t];let n=e.height/50,r=1;1===this._shadowParameters.cascadeCount?r=f:0===t?r=d:(n=d,r=f);const[o,s]=fE(e,this.shadowDirection,n,r,this._shadowParameters.shadowMapResolution,h);i.scale=e.scale,i.matrix=o,i.boundingSphereRadius=s,p(m,i.matrix),i.frustum=Df.fromInvProjectionMatrix(m,1,0,!0),i.far=r}const _=this._cascades.length-1;this._uniformValues.u_fade_range=[.75*this._cascades[_].far,this._cascades[_].far],this._uniformValues.u_shadow_intensity=r,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=1/this._shadowParameters.shadowMapResolution,this._uniformValues.u_shadow_map_resolution=this._shadowParameters.shadowMapResolution,this._uniformValues.u_shadowmap_0=nw.ShadowMap0,this._uniformValues.u_shadowmap_1=nw.ShadowMap0+1,this._groundShadowTiles=n.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});const g=n.transform.elevation;for(const e of this._groundShadowTiles){let t={min:0,max:0};if(g){const i=g.getMinMaxForTile(e);i&&(t=i)}this.addShadowReceiver(e.toUnwrapped(),t.min,t.max)}}get enabled(){return this._enabled&&!this._forceDisable}set enabled(e){this._enabled=e}drawShadowPass(e,t){if(!this.enabled)return;const i=this.painter,n=i.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(i.transform.getFrustum(0),i.transform.worldSize,this._cascades),n.viewport.set([0,0,this._shadowParameters.shadowMapResolution,this._shadowParameters.shadowMapResolution]);for(let r=0;r<this._numCascadesToRender;++r){i.currentShadowCascade=r,n.bindFramebuffer.set(this._cascades[r].framebuffer.framebuffer),n.clear({color:mn.white,depth:1});for(const n of e.order){const r=e._mergedLayers[n];if(!r.hasShadowPass()||r.isHidden(i.transform.zoom))continue;const o=e.getLayerSourceCache(r),s=o?t[o.id]:void 0;("model"===r.type||s&&s.length)&&i.renderLayer(i,o,r,s)}}i.currentShadowCascade=0}drawGroundShadows(){if(!this.enabled)return;const e=this.painter,t=e.style,i=e.context,n=i.gl,r=t.directionalLight,o=t.ambientLight;if(!r||!o)return;const s=[],a=Bw(e,e.longestCutoffRange);a.shouldRenderCutoff&&s.push("RENDER_CUTOFF"),s.push("RENDER_SHADOWS"),this.useNormalOffset&&s.push("NORMAL_OFFSET");const l=oE(t,r,o),c=new fw(n.LEQUAL,fw.ReadOnly,e.depthRangeFor3D),u=new cw({func:n.EQUAL,mask:255},0,255,n.KEEP,n.KEEP,n.KEEP);for(const t of this._groundShadowTiles){const r=t.toUnwrapped(),o=e.isTileAffectedByFog(t),h=e.getOrCreateProgram("groundShadow",{defines:s,overrideFog:o});this.setupShadows(r,h),e.uploadCommonUniforms(i,h,r,null,a);const d=YT(e.transform.calculateProjMatrix(r),l);h.draw(e,n.TRIANGLES,c,u,dw.multiply,_w.disabled,d,"ground_shadow",e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments,null,e.transform.zoom,null,null)}}getShadowPassDepthMode(){return this._depthMode}getGroundShadowLayerIndex(){return this._drawShadowAfterLayer}calculateShadowPassMatrixFromTile(e){const t=this.painter.transform,i=t.calculatePosMatrix(e,t.worldSize);return m(i,this._cascades[this.painter.currentShadowCascade].matrix,i),Float32Array.from(i)}
vendor: 4,764 bytes, line 2
2calculateShadowPassMatrixFromMatrix(e){return m(cE,this._cascades[this.painter.currentShadowCascade].matrix,e)}setupShadows(e,t,i){if(!this.enabled)return;const n=this.painter.transform,r=this.painter.context,o=r.gl,s=this._uniformValues,a=n.calculatePosMatrix(e,n.worldSize);for(let e=0;e<this._cascades.length;e++){const t=aE(e);m(t,this._cascades[e].matrix,a),s[0===e?"u_light_matrix_0":"u_light_matrix_1"]=t,r.activeTexture.set(o.TEXTURE0+nw.ShadowMap0+e),this._cascades[e].texture.bindExtraParam(o.LINEAR,o.LINEAR,o.CLAMP_TO_EDGE,o.CLAMP_TO_EDGE,o.GREATER)}if(this.useNormalOffset=!!i,this.useNormalOffset){const t=Ic(e.canonical),r=2/n.tileSize*Cr/this._shadowParameters.shadowMapResolution,o=r*this._cascades[0].boundingSphereRadius,a=r*this._cascades.at(-1).boundingSphereRadius,l=("vector-tile"===i?1:3)*function(e){const t=it((e-22)/-22,0,1);return.125*(1-t)+4*t}(n.zoom);s.u_shadow_normal_offset=[t,o*l,a*l],s.u_shadow_bias=[1e-4,.0012,.012]}else s.u_shadow_bias=[36e-5,.0012,.012];t.setShadowUniformValues(r,s)}computeCascadeTileMatrices(e){const t=this._shadowParameters.cascadeCount;for(let i=0;i<t;i++)m(lE[i]=lE[i]||new Float64Array(16),this._cascades[i].matrix,e);return lE.length=t,lE}setupShadowsFromMatrix(e,t,i=!1){if(!this.enabled)return;const n=this._shadowParameters.cascadeCount;for(let t=0;t<n;t++)m(aE(t),this._cascades[t].matrix,e);sE.length=n,this.setupShadowsFromCascadeMatrices(sE,t,i)}setupShadowsFromCascadeMatrices(e,t,i=!1){if(!this.enabled)return;const n=this.painter.context,r=n.gl,o=this._uniformValues;for(let t=0;t<this._shadowParameters.cascadeCount;t++)o[0===t?"u_light_matrix_0":"u_light_matrix_1"]=e[t],n.activeTexture.set(r.TEXTURE0+nw.ShadowMap0+t),this._cascades[t].texture.bindExtraParam(r.LINEAR,r.LINEAR,r.CLAMP_TO_EDGE,r.CLAMP_TO_EDGE,r.GREATER);if(this.useNormalOffset=i,i){const e=this._shadowParameters.normalOffset;o.u_shadow_normal_offset=[1,e,e],o.u_shadow_bias=[6e-5,.0012,.012]}else o.u_shadow_bias=[36e-5,.0012,.012];t.setShadowUniformValues(n,o)}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(e,t,i,n){if(n[2]>=0)return{};const r=function(e,t,i){const n=i/(1<<e.canonical.z);return new Pf([e.canonical.x*n+e.wrap*i,e.canonical.y*n+e.wrap*i,0],[(e.canonical.x+1)*n+e.wrap*i,(e.canonical.y+1)*n+e.wrap*i,t])}(e,t,i).getCorners(),o=t/-n[2];n[0]<0?(F(r[0],r[0],[n[0]*o,0,0]),F(r[3],r[3],[n[0]*o,0,0])):n[0]>0&&(F(r[1],r[1],[n[0]*o,0,0]),F(r[2],r[2],[n[0]*o,0,0])),n[1]<0?(F(r[0],r[0],[0,n[1]*o,0]),F(r[1],r[1],[0,n[1]*o,0])):n[1]>0&&(F(r[2],r[2],[0,n[1]*o,0]),F(r[3],r[3],[0,n[1]*o,0]));const s={};return s.vertices=r,s.planes=[dE(r[1],r[0],r[4]),dE(r[2],r[1],r[5]),dE(r[3],r[2],r[6]),dE(r[0],r[3],r[7])],s}addShadowReceiver(e,t,i){this._receivers.add(e,Pf.fromTileIdAndHeight(e,t,i))}getMaxCascadeForTile(e){const t=this._receivers.get(e);return t&&t.lastCascade?t.lastCascade:0}},drawGroundEffect:iE,queryModelLayerRendered:function(e,t,i,n){const r=i.getSource();if(!r||"model"!==r.type)return{};const o=r,s={};s[e.id]=[];const a=s[e.id];let l=0;for(const r of o.models){const o=i.getFeatureState(e.sourceLayer,r.id),s={type:"Unknown",id:r.id,properties:r.featureProperties},c=e.paint.get("model-rotation").evaluate(s,o),u=e.paint.get("model-scale").evaluate(s,o),h=e.paint.get("model-translation").evaluate(s,o),d=e.paint.get("model-elevation-reference");let f=[];My(f,r,n,r.position,c,u,h,"ground"===d,"ground"===d,!1),"globe"===n.projection.name&&(f=Ty(f,n));const p=m([],n.projMatrix,f),_=Ey(t.isPointQuery()?t.screenBounds:t.screenGeometry,n,p,r.aabb);if(null!=_){const t=new iw(void 0,0,0,0,r.id);t.layer=e.layer,t.properties=structuredClone(r.featureProperties),t.properties.layer=e.id,t.properties.uri=r.uri,t.properties.orientation=r.orientation,t.sourceLayer=e.sourceLayer,t.geometry={type:"Point",coordinates:[r.position.lng,r.position.lat]},t.state=o,t.source=e.source,a.push({featureIndex:l,feature:t,intersectionZ:_})}++l}return s},queryModelLayerIntersectsFeature:function(e,t,i,n,r,o){if(!e.modelManager)return!1;const s=e.modelManager,a=t.tile.getBucket(e);if(!(a&&a instanceof Vb))return!1;for(const n in a.instancesPerModel){const l=a.instancesPerModel[n],c=void 0!==i.id?i.id:i.properties&&Object.hasOwn(i.properties,"id")?i.properties.id:void 0;if(Object.hasOwn(l.idToFeaturesIndex,c)){const i=l.features[l.idToFeaturesIndex[c]],u=s.getModel(n,o||e.scope);if(!u)return!1;let h=[];const d=new gc(0,0),f=a.canonical;let p=Number.MAX_VALUE;for(let e=0;e<i.instancedDataCount;++e){const n=16*(i.instancedDataOffset+e),o=l.instancedDataArray.float32,s=[o[n+4],o[n+5],o[n+6]];Nw(f,d,Math.floor(o[n]),Math.floor(o[n+1])),My(h,u,r,d,i.rotation,i.scale,s,!1,!1,
vendor: 3,751 bytes, line 2
2!1),"globe"===r.projection.name&&(h=Ty(h,r));const a=m([],r.projMatrix,h),c=t.queryGeometry,_=Ey(c.isPointQuery()?c.screenBounds:c.screenGeometry,r,a,u.aabb);null!=_&&(p=Math.min(_,p))}return p!==Number.MAX_VALUE&&p}}return!1},loadMatchingModelFeature:function(e,t,i,n){const r=e.getNodesInfo()[t];if(!r||r.hiddenByReplacement||!r.node.meshes)return;let o=Number.MAX_VALUE;const s=r.node,a=i.tile,l=n.calculatePosMatrix(a.tileID.toUnwrapped(),n.worldSize),c=r.evaluatedScale;let u=0;n.elevation&&s.elevation&&(u=s.elevation*n.elevation.exaggeration()),_(l,l,[(s.anchor?s.anchor[0]:0)*(c[0]-1),(s.anchor?s.anchor[1]:0)*(c[1]-1),u]),g(l,l,c);const h=i.queryGeometry,d=h.isPointQuery()?h.screenBounds:h.screenGeometry,f=function(e){const t=m([],l,e.globalMatrix);m(t,n.expandedFarZProjMatrix,t);for(let i=0;i<e.meshes.length;++i){const r=e.meshes[i];if(i===e.lightMeshIndex)continue;const s=Ey(d,n,t,r.aabb);null!=s&&(o=Math.min(s,o))}if(e.children)for(const t of e.children)f(t)};if(f(s),o===Number.MAX_VALUE)return;const p=new gc(0,0);return Nw(a.tileID.canonical,p,r.node.anchor[0],r.node.anchor[1]),{intersectionZ:o,position:p,feature:r.feature}},ModelSource:pE,Tiled3dModelSource:class extends ln{constructor(e,t,i,n){super(),this.type="batched-model",this.id=e,this.tileSize=512,this._options=t,this.tiles=this._options.tiles,this.maxzoom=t.maxzoom||19,this.minzoom=t.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=i,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(n)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const e=bl(this.id,this.scope);this.load(()=>this.map.style.clearSource(e))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(e){this._loaded=!1,this.fire(new rn("dataloading",{dataType:"source"}));const t=Array.isArray(this.map._language)?this.map._language.join():this.map._language,i=this.map.getWorldview();this._tileJSONRequest=_E(this._options,this.map._requestManager,t,i,(n,r)=>{this._tileJSONRequest=null,this._loaded=!0,n?(t&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${t}`),i&&2!==i.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${i}`),this.fire(new on(n))):r&&(Object.assign(this,r),r.bounds&&(this.tileBounds=new yE(r.bounds,this.minzoom,this.maxzoom)),ji(r.tiles,this.map._requestManager._customAccessToken),this.fire(new rn("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new rn("data",{dataType:"source",sourceDataType:"content"}))),e&&e(n)})}hasTransition(){return!1}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loaded(){return this._loaded}async loadTile(e,t){const i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),n=!e.actor||"expired"===e.state;if(n)e.actor=this.dispatcher.getActor();else{if("loading"===e.state)return void(e.reloadCallback=t);if(e.buckets){const t=Object.values(e.buckets);for(const e of t)e.dirty=!0;return void(e.state="loaded")}}const r=n?"loadTile":"reloadTile",o=new AbortController;e.request=o;const s=(i,n)=>(delete e.request,e.aborted?t(null):i&&!ci(i)?t(i):(this.map._refreshExpiredTiles&&n&&e.setExpiryData(Tt(n.headers)),e.loadModelData(n,this.map.painter),e.state="loaded",t(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null))));try{const n=await this.map._requestManager.transformRequest(i,ai.Tile,o.signal);if(o.signal.aborted)return t(null);const a={request:n,data:void 0,uid:e.uid,tileID:e.tileID,tileZoom:e.tileZoom,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.t
vendor: 1,284 bytes, line 2
2ype,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,renderSourceType:e.renderSourceType,brightness:this.map.style&&this.map.style.getBrightness()||0,pixelRatio:Vt.devicePixelRatio,promoteId:this.promoteId};e.request=e.actor.sendCancelable(r,a,{},s)}catch(e){if(o.signal.aborted)return t(null);t(e)}}abortTile(e){e.request&&(e.request.abort(),delete e.request),e.actor&&e.actor.notify("abortTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope})}serialize(){return{...this._options}}},loadModel:async function(e,t,i){const n=await ny(e),r=new Cy(t,i,void 0,void 0,Jy(n));return r.computeBoundsAndApplyParent(),r}};class xE{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new qs(Cr,Cr,512),this.featureIndexArray=new Fu,this.promoteId=t,this.is3DTile=!1,this.serializedLayersCache=new Map}insert(e,t,i,n,r,o=0,s=0){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,r,o);const l=this.grid;for(let e=0;e<t.length;e++){const i=t[e],n=[1/0,1/0,-1/0,-1/0];for(let e=0;e<i.length;e++){const t=i[e];n[0]=Math.min(n[0],t.x),n[1]=Math.min(n[1],t.y),n[2]=Math.max(n[2],t.x),n[3]=Math.max(n[3],t.y)}0!==s&&(n[0]-=s,n[1]-=s,n[2]+=s,n[3]+=s),n[0]<Cr&&n[1]<Cr&&n[2]>=0&&n[3]>
vendor: 13,255 bytes, line 2
2=0&&l.insert(a,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new kh(new sm(this.rawTileData)).layers,this.sourceLayerCoder=new ew(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t){const{tilespaceGeometry:i,transform:n,tileTransform:r,pixelPosMatrix:o,availableImages:s,worldview:a}=t;this.loadVTLayers(),this.serializedLayersCache.clear();const l=t.queryRadius?t.queryRadius:0,c=i.bufferedTilespaceBounds,u=this.grid.queryKeys(c.min.x,c.min.y,c.max.x,c.max.y,(e,t,n,r)=>Xh(i.bufferedTilespaceGeometry,e-l,t-l,n+l,r+l));u.sort(wE);let h=null;n.elevation&&u.length>0&&(h=Wp.create(n.elevation,this.tileID));const d={};let f;for(let l=0;l<u.length;l++){const c=u[l];if(c===f)continue;f=c;const p=this.featureIndexArray.get(c);let m=null;this.is3DTile?this.loadMatchingModelFeature(d,p,e,i,n,a):this.loadMatchingFeature(d,p,e,s,a,(e,s,a,l=0)=>(m||(m=Fc(e,this.tileID.canonical,r)),s.queryIntersectsFeature(i,e,a,m,this.z,n,o,h,l,t.scope)))}return d}loadMatchingFeature(e,t,i,n,r,o){const{featureIndex:s,bucketIndex:a,sourceLayerIndex:l,layoutVertexArrayOffset:c}=t,u=this.bucketLayerIDs[a],h=i.layers,d=Object.keys(h);if(d.length&&!mt(d,u))return;const f=i.sourceCache,p=this.sourceLayerCoder.decode(l),m=this.vtLayers[p].feature(s),_=this.getId(m,p);for(let t=0;t<u.length;t++){const i=u[t];if(!h[i])continue;const{styleLayer:a,targets:l}=h[i];let d={};void 0!==_&&(d=f.getFeatureState(a.sourceLayer,_));const p=!o||o(m,a,d,c);if(!p)continue;const g=new iw(m,this.z,this.x,this.y,_);g.tile=this.tileID.canonical,g.state=d;let y=this.serializedLayersCache.get(i);y||(y=a.serialize(),y.id=i,this.serializedLayersCache.set(i,y)),g.source=y.source,g.sourceLayer=y["source-layer"],g.layer={...y},g.layer.paint=bE(y.paint,a.paint,m,d,n),g.layer.layout=bE(y.layout,a.layout,m,d,n);const v=new Ha(this.tileID.overscaledZ,{worldview:r});let x=!1;for(const e of l){this.updateFeatureProperties(g,e);const{filter:t}=e;if(t)if(m.properties=g.properties,t.needGeometry){const e=Oc(m,!0);if(!t.filter(v,e,this.tileID.canonical))continue}else if(!t.filter(v,m))continue;x=!0,e.targetId&&this.addFeatureVariant(g,e)}x&&this.appendToResult(e,i,s,g,p)}}loadMatchingModelFeature(e,t,i,n,r,o){const{featureIndex:s,bucketIndex:a}=t,l=this.bucketLayerIDs[a],c=i.layers,u=Object.keys(c);if(!u.length||mt(u,l))for(let t=0;t<l.length;t++){const a=l[t],{styleLayer:u,targets:h}=c[a];if("model"!==u.type)continue;const d=n.tile,f=d.getBucket(u);if(!f||!f.isTiled3dModelBucket)continue;if(!vE.loadMatchingModelFeature)continue;const p=vE.loadMatchingModelFeature(f,s,n,r);if(!p)continue;const{z:m,x:_,y:g}=d.tileID.canonical,{feature:y,intersectionZ:v,position:x}=p;let b={};void 0!==y.id&&(b=i.sourceCache.getFeatureState(u.sourceLayer,y.id));const w=new iw({},m,_,g,y.id);w.tile=this.tileID.canonical,w.state=b,w.properties=y.properties,w.geometry={type:"Point",coordinates:[x.lng,x.lat]};let T=this.serializedLayersCache.get(a);T||(T=u.serialize(),T.id=a,this.serializedLayersCache.set(a,T)),w.source=T.source,w.sourceLayer=T["source-layer"],w.layer={...T};const E=new Ha(this.tileID.overscaledZ,{worldview:o});let S=!1;for(const e of h){this.updateFeatureProperties(w,e);const{filter:t}=e;if(t)if(y.properties=w.properties,t.needGeometry){if(!t.filter(E,y,this.tileID.canonical))continue}else if(!t.filter(E,y))continue;S=!0,e.targetId&&this.addFeatureVariant(w,e)}S&&this.appendToResult(e,a,s,w,v)}}updateFeatureProperties(e,t,i){if(t.properties){const n={};for(const r in t.properties){const o=t.properties[r].evaluate({zoom:this.z},e._vectorTileFeature,e.state,e.tile,i);null!=o&&(n[r]=o)}e.properties=n}}addFeatureVariant(e,t,i){const n={target:t.target,namespace:t.namespace,uniqueFeatureID:t.uniqueFeatureID};t.properties&&(n.properties=e.properties),e.variants=e.variants||{},e.variants[t.targetId]=e.variants[t.targetId]||[],e.variants[t.targetId].push(n)}appendToResult(e,t,i,n,r){let o=e[t];void 0===o&&(o=e[t]=[]),o.push({featureIndex:i,feature:n,intersectionZ:r})}lookupSymbolFeatures(e,t,i,n,r,o){const s={};this.loadVTLayers();for(const a of e)this.loadMatchingFeature(s,{bucketIndex:t,sourceLayerIndex:i,featureIndex:a,layoutVertexArrayOffset:0},n,r,o);return s}loadFeature(e){const{featureIndex:t,sourceLayerIndex:i}=e;this.loadVTLayers();const n=this.sourceLayerCoder.decode(i),r=this.vtFeatures[n];if(r[t])return r[t];const o=this.vtLayers[n].feature(t);return r[t]=o,o}hasLayer(e){for(const t of this.bucketLayerIDs)for(const i of t)if(e===i)return!0;return!1}getId(e,t){let i=e.id;if(this.promoteId){const n=Array.isArray(this.promoteId)||"object"!=typeof this.promoteId?this.promoteId:this.promoteId[t];if(null!=n)if(Array.isArray(n)){if(!this.promoteIdExpression){const e=Us(n);if("success"!==e.result)return void gt(`Failed to create expression for promoteId: ${e.value.map(e=>`${e.key}: ${e.message}`).join(", ")}`);this.promoteIdExpression=e.value}i=this.promoteIdExpression.evaluate({zoom:0},e)}else i=e.properties[n];"boolean"==typeof i&&(i=Number(i))}return i}}function bE(e,t,i,n,r){return dt(e,(e,o)=>{const s=t instanceof Qa?t.get(o):null;return s&&s.evaluate?s.evaluate(i,n,void 0,r):s})}function wE(e,t){return t-e}async function TE(){return Promise.resolve()}Ys(xE,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const EE={circle:class extends Pl{constructor(e,t,i,n){super(e,{layout:cx||(cx=new nl({"circle-sort-key":new tl(rl.layout_circle["circle-sort-key"]),"circle-elevation-reference":new el(rl.layout_circle["circle-elevation-reference"]),visibility:new el(rl.layout_circle.visibility)})),paint:ux||(ux=new nl({"circle-radius":new tl(rl.paint_circle["circle-radius"]),"circle-color":new tl(rl.paint_circle["circle-color"]),"circle-blur":new tl(rl.paint_circle["circle-blur"]),"circle-opacity":new tl(rl.paint_circle["circle-opacity"]),"circle-translate":new el(rl.paint_circle["circle-translate"]),"circle-translate-anchor":new el(rl.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new el(rl.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new el(rl.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new tl(rl.paint_circle["circle-stroke-width"]),"circle-stroke-color":new tl(rl.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new tl(rl.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new el(rl.paint_circle["circle-emissive-strength"]),"circle-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"circle-stroke-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}createBucket(e){return new Ed(e)}queryRadius(e){const t=e;return bx("circle-radius",this,t)+bx("circle-stroke-width",this,t)+wx(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,i,n,r,o,s,a){const l=Ex(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(t,i)+this.paint.get("circle-stroke-width").evaluate(t,i);return Ax(e,n,o,s,a,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getDefaultProgramParams(e,t,i){const n=Ix(this);return{config:new mh(this,{zoom:t,lut:i}),defines:n,overrideFog:!1}}is3D(e){return!e&&!!this.layout&&"none"!==this.layout.get("circle-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("circle-elevation-reference")}mayUse(e){return"HD"===e&&Rl(this,"circle-elevation-reference",e=>"hd-road-markup"===e)}prepare(){return this.mayUse("HD")?xx():Promise.resolve()}},heatmap:class extends Pl{createBucket(e){return new Rx(e)}constructor(e,t,i,n){super(e,{layout:Lx||(Lx=new nl({visibility:new el(rl.layout_heatmap.visibility)})),paint:zx||(zx=new nl({"heatmap-radius":new tl(rl.paint_heatmap["heatmap-radius"]),"heatmap-weight":new tl(rl.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new el(rl.paint_heatmap["heatmap-intensity"]),"heatmap-color":new il(rl.paint_heatmap["heatmap-color"]),"heatmap-opacity":new el(rl.paint_heatmap["heatmap-opacity"]),"heatmap-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Ox({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)}_clear(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}queryRadius(e){return bx("heatmap-radius",this,e)}queryIntersectsFeature(e,t,i,n,r,o,s,a){const l=this.paint.get("heatmap-radius").evaluate(t,i);return Ax(e,n,o,s,a,!0,!0,new Pe(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(e,t,i){return"heatmap"===e?{config:new mh(this,{zoom:t,lut:i}),overrideFog:!1}:{}}},hillshade:class extends Pl{constructor(e,t,i,n){super(e,{layout:kx||(kx=new nl({visibility:new el(rl.layout_hillshade.visibility)})),paint:Bx||(Bx=new nl({"hillshade-illumination-direction":new el(rl.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new el(rl.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new el(rl.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new el(rl.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new el(rl.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new el(rl.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new el(rl.paint_hillshade["hillshade-emissive-strength"]),"hillshade-shadow-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"hillshade-highlight-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"hillshade-accent-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}shouldRedrape(){return this.hasOffscreenPass()&&"viewport"===this.paint.get("hillshade-illumination-anchor")}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(e,t,i){return{overrideFog:!1}}},fill:class extends Pl{constructor(e,t,i,n){super(e,{layout:Nx||(Nx=new nl({"fill-sort-key":new tl(rl.layout_fill["fill-sort-key"]),visibility:new el(rl.layout_fill.visibility),"fill-elevation-reference":new el(rl.layout_fill["fill-elevation-reference"]),"fill-construct-bridge-guard-rail":new tl(rl.layout_fill["fill-construct-bridge-guard-rail"])})),paint:Vx||(Vx=new nl({"fill-antialias":new el(rl.paint_fill["fill-antialias"]),"fill-opacity":new tl(rl.paint_fill["fill-opacity"]),"fill-color":new tl(rl.paint_fill["fill-color"]),"fill-outline-color":new tl(rl.paint_fill["fill-outline-color"]),"fill-translate":new el(rl.paint_fill["fill-translate"]),"fill-translate-anchor":new el(rl.paint_fill["fill-translate-anchor"]),"fill-pattern":new tl(rl.paint_fill["fill-pattern"]),"fill-pattern-cross-fade":new el(rl.paint_fill["fill-pattern-cross-fade"]),"fill-emissive-strength":new el(rl.paint_fill["fill-emissive-strength"]),"fill-z-offset":new tl(rl.paint_fill["fill-z-offset"]),"fill-bridge-guard-rail-color":new tl(rl.paint_fill["fill-bridge-guard-rail-color"]),"fill-tunnel-structure-color":new tl(rl.paint_fill["fill-tunnel-structure-color"]),"fill-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"fill-outline-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"fill-bridge-guard-rail-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"fill-tunnel-structure-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}getProgramIds(){const e=this.paint.get("fill-pattern"),t=e&&e.constantOr(1),i=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getDefaultProgramParams(e,t,i){return{config:new mh(this,{zoom:t,lut:i}),overrideFog:!1}}recalculate(e,t){super.recalculate(e,t);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Th(e)}queryRadius(){return wx(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,i,n,r,o){return!e.queryGeometry.isAboveHorizon&&Vh(Tx(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),n)}isTileClipped(){return 0===this.paint.get("fill-z-offset").constantOr(1)}is3D(e){if(0!==this.paint.get("fill-z-offset").constantOr(1))return!0;
vendor: 10,011 bytes, line 2
2const t=this.layout&&"none"!==this.layout.get("fill-elevation-reference");return null!=e?t&&!e:t}hasElevation(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}mayUse(e){return"HD"===e&&Rl(this,"fill-elevation-reference",e=>"none"!==e)}prepare(){return this.mayUse("HD")?xx():Promise.resolve()}hasShadowPass(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}},"fill-extrusion":class extends Pl{constructor(e,t,i,n){super(e,{layout:Gx||(Gx=new nl({visibility:new el(rl["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new el(rl["layout_fill-extrusion"]["fill-extrusion-edge-radius"]),"source-max-zoom":new el(rl["layout_fill-extrusion"]["source-max-zoom"])})),paint:$x||($x=new nl({"fill-extrusion-opacity":new el(rl["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new tl(rl["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new el(rl["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new el(rl["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new tl(rl["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-pattern-cross-fade":new el(rl["paint_fill-extrusion"]["fill-extrusion-pattern-cross-fade"]),"fill-extrusion-height":new tl(rl["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new tl(rl["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-height-alignment":new el(rl["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),"fill-extrusion-base-alignment":new el(rl["paint_fill-extrusion"]["fill-extrusion-base-alignment"]),"fill-extrusion-vertical-gradient":new el(rl["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new el(rl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new el(rl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new el(rl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new el(rl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new el(rl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new el(rl["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new el(rl["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new tl(rl["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new tl(rl["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new el(rl["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new el(rl["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new el(rl["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new el(rl["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-front-cutoff":new el(rl["paint_fill-extrusion"]["fill-extrusion-front-cutoff"]),"fill-extrusion-emissive-strength":new tl(rl["paint_fill-extrusion"]["fill-extrusion-emissive-strength"]),"fill-extrusion-line-width":new tl(rl["paint_fill-extrusion"]["fill-extrusion-line-width"]),"fill-extrusion-cast-shadows":new el(rl["paint_fill-extrusion"]["fill-extrusion-cast-shadows"]),"fill-extrusion-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"fill-extrusion-flood-light-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new jv(e)}queryRadius(){return wx(this.paint.get("fill-extrusion-translate"))}is3D(e){return!0}hasShadowPass(){return this.paint.get("fill-extrusion-cast-shadows")}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(e,t,i,n,r,o,s,a,l){const c=Ex(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),u=this.paint.get("fill-extrusion-height").evaluate(t,i),h=this.paint.get("fill-extrusion-base").evaluate(t,i),d=[0,0],f=a&&o.elevation,p=o.elevation?o.elevation.exaggeration():1,m=e.tile.getBucket(this);if(m instanceof jv){const e=m.centroidData.find(e=>l>=e.vertexArrayOffset&&l<e.vertexArrayOffset+e.vertexCount);if(e&&e.flags&Mv)return!1;if(f){const e=m.centroidVertexArray,t=l+1;t<e.length&&(d[0]=e.geta_centroid_pos0(t),d[1]=e.geta_centroid_pos1(t))}}if(0===d[0]&&1===d[1])return!1;"globe"===o.projection.name&&(n=tx([n],[new Pe(0,0),new Pe(Cr,Cr)],e.tileID.canonical).map(e=>e.polygon).flat());const _=f?a:null,[g,y]=Qx(o,n,h,u,c,s,_,d,p,o.center.lat,e.tileID.canonical),v=e.queryGeometry;return Kx(g,y,v.isPointQuery()?v.screenBounds:v.screenGeometry)}},building:class extends Pl{constructor(e,t,i,n){super(e,{layout:Hx||(Hx=new nl({visibility:new el(rl.layout_building.visibility),"building-facade":new tl(rl.layout_building["building-facade"]),"building-facade-floors":new tl(rl.layout_building["building-facade-floors"]),"building-facade-unit-width":new tl(rl.layout_building["building-facade-unit-width"]),"building-facade-window":new tl(rl.layout_building["building-facade-window"]),"building-roof-shape":new tl(rl.layout_building["building-roof-shape"]),"building-height":new tl(rl.layout_building["building-height"]),"building-base":new tl(rl.layout_building["building-base"]),"building-flood-light-wall-radius":new tl(rl.layout_building["building-flood-light-wall-radius"]),"building-flood-light-ground-radius":new tl(rl.layout_building["building-flood-light-ground-radius"]),"building-flip-roof-orientation":new tl(rl.layout_building["building-flip-roof-orientation"])})),paint:Zx||(Zx=new nl({"building-opacity":new el(rl.paint_building["building-opacity"]),"building-ambient-occlusion-intensity":new el(rl.paint_building["building-ambient-occlusion-intensity"]),"building-ambient-occlusion-ground-intensity":new el(rl.paint_building["building-ambient-occlusion-ground-intensity"]),"building-ambient-occlusion-ground-radius":new el(rl.paint_building["building-ambient-occlusion-ground-radius"]),"building-ambient-occlusion-ground-attenuation":new el(rl.paint_building["building-ambient-occlusion-ground-attenuation"]),"building-vertical-scale":new el(rl.paint_building["building-vertical-scale"]),"building-cast-shadows":new el(rl.paint_building["building-cast-shadows"]),"building-color":new tl(rl.paint_building["building-color"]),"building-emissive-strength":new tl(rl.paint_building["building-emissive-strength"]),"building-facade-emissive-chance":new el(rl.paint_building["building-facade-emissive-chance"]),"building-cutoff-fade-range":new el(rl.paint_building["building-cutoff-fade-range"]),"building-front-cutoff":new el(rl.paint_building["building-front-cutoff"]),"building-flood-light-color":new el(rl.paint_building["building-flood-light-color"]),"building-flood-light-intensity":new el(rl.paint_building["building-flood-light-intensity"]),"building-flood-light-ground-attenuation":new el(rl.paint_building["building-flood-light-ground-attenuation"]),"building-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"building-flood-light-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}mayUse(e){return"HD"===e}prepare(){return async function(){return function(){if(!bt(self))return null;if(null!=fx||null!=dx)return null;if(null!=hx)return hx;const e=fetch(Ht());return hx=function(e){let t,i,n,r,o;function s(){t=new Uint8Array(o.buffer),i=new Int16Array(o.buffer),n=new Int32Array(o.buffer),r=new Float32Array(o.buffer)}function a(){throw new Error("Unexpected BuildingGen error.")}const l=()=>{},c={a:{a:a,f:function(e){const i=t.length,n=Math.max(e>>>0,Math.ceil(1.2*i)),r=Math.ceil((n-i)/65536);try{return o.grow(r),s(),!0}catch(e){return!1}},g:a,b:l,c:l,d:l,e:l}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,c):e.then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,c))).then(e=>{const a=e.instance.exports;return(0,a.g)(),o=a.f,s(),new rx({setStyle:a.h,setAOOptions:a.i,setMetricOptions:a.j,setStructuralOptions:a.k,setFacadeOptions:a.l,setFauxFacadeOptions:a.m,setFacadeClassifierOptions:a.n,addFeature:a.o,addFacade:a.p,generateMesh:a.q,getLastError:a.r,getOuterRingLength:a.s,getMeshCount:a.t,getPositionsPtr:a.u,getPositionsLength:a.v,getNormalsPtr:a.w,getNormalsLength:a.x,getAOPtr:a.y,getAOLength:a.z,getUVPtr:a.A,getUVLength:a.B,getFauxFacadePtr:a.C,getFauxFacadeLength:a.D,getIndicesPtr:a.E,getIndicesLength:a.F,getBuildingPart:a.G,getRingCount:a.H,getRingPtr:a.I,getRingLength:a.J,malloc:a.K,free:a.L,heapU8:t,heap16:i,heap32:n,heapF32:r})})}(e).then(e=>{hx=null,fx=e}).catch(e=>{gt("Could not load building-gen"),hx=null,dx=e}),hx}()}()}createBucket(e){return new _x(e)}cutoffRange(){return this.paint.get("building-cutoff-fade-range")}hasShadowPass(){return this.paint.get("building-cast-shadows")}hasLightBeamPass(){return!0}canCastShadows(){return!0}is3D(e){return!0}queryRadius(e){return 0}queryIntersectsFeature(e,t,i,n,r,o,s,a,l,c){let u=this.layout.get("building-height").evaluate(t,i);const h=this.layout.get("building-base").evaluate(t,i),d=e.tile.getBucket(this).getFootprint(t);if(d){if(0!==d.hiddenFlags)return!1;u=d.height}
vendor: 6,311 bytes, line 2
2const[f,p]=Qx(o,n,h,u,new Pe(0,0),s,null,[0,0],1,o.center.lat,e.tileID.canonical),m=e.queryGeometry;return Kx(f,p,m.isPointQuery()?m.screenBounds:m.screenGeometry)}},line:class extends Pl{constructor(e,t,i,n){const r=ab();super(e,r,t,i,n),r.layout&&(this.layout=new Qa(r.layout)),this.gradientVersion=0,this.borderGradientVersion=0,this.hasElevatedBuckets=!1,this.hasNonElevatedBuckets=!1,this.lineBlendFbos=null,this.lineBlendDensityReadback=null}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof Mo,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}else if("line-gradient-use-theme"===e)this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER;else if("line-border-gradient"===e){const e=this._transitionablePaint._values["line-border-gradient"].value.expression;this.borderStepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof Mo,this.borderGradientVersion=(this.borderGradientVersion+1)%Number.MAX_SAFE_INTEGER}else"line-border-gradient-use-theme"===e&&(this.borderGradientVersion=(this.borderGradientVersion+1)%Number.MAX_SAFE_INTEGER)}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}borderGradientExpression(){return this._transitionablePaint._values["line-border-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}emissiveStrengthExpression(){return this._transitionablePaint._values["line-emissive-strength"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=(()=>{if(cb)return cb;const e=ab();return cb=new lb(e.paint.properties["line-width"].specification),cb.useIntegerZoom=!0,cb})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new vd(e)}getProgramIds(){const e=[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"];return"default"!==this.paint.get("line-blend-mode")&&e.push("lineBlendComposite"),e}getDefaultProgramParams(e,t,i){if("lineBlendComposite"===e)return{};const n=rb(this);return{config:new mh(this,{zoom:t,lut:i}),defines:n,overrideFog:!1}}queryRadius(e){const t=e,i=fb(bx("line-width",this,t),bx("line-gap-width",this,t)),n=bx("line-offset",this,t);return i/2+Math.abs(n)+wx(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,i,n,r,o){if(e.queryGeometry.isAboveHorizon)return!1;const s=Tx(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),a=e.pixelToTileUnitsFactor/2*fb(this.paint.get("line-width").evaluate(t,i),this.paint.get("line-gap-width").evaluate(t,i)),l=this.paint.get("line-offset").evaluate(t,i);return l&&(n=function(e,t){const i=[],n=new Pe(0,0);for(let r=0;r<e.length;r++){const o=e[r],s=[];for(let e=0;e<o.length;e++){const i=o[e],r=o[e+1],a=0===e?n:i.sub(o[e-1])._unit()._perp(),l=e===o.length-1?n:r.sub(i)._unit()._perp(),c=a._add(l)._unit();c._mult(1/(c.x*l.x+c.y*l.y)),s.push(c._mult(t)._add(i))}i.push(s)}return i}(n,l*e.pixelToTileUnitsFactor)),function(e,t,i){for(let n=0;n<t.length;n++){const r=t[n];if(e.length>=3)for(let t=0;t<r.length;t++)if(Yh(e,r[t]))return!0;if(Uh(e,r,i))return!0}return!1}(s,n,a)}isTileClipped(){return this.hasNonElevatedBuckets}isDraped(e){return!this.hasElevatedBuckets||this.layout&&"hd-road-markup"===this.layout.get("line-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("line-elevation-reference")}mayUse(e){return"HD"===e?Rl(this,"line-elevation-reference",e=>"hd-road-markup"===e):"Lite"===e&&function(e){if(!e._unevaluatedLayout)return!1;const t=e._unevaluatedLayout.getValue("line-elevation-reference");if(void 0!==t&&("string"!=typeof t||"none"!==t))return!0;const i=e._unevaluatedLayout.getValue("line-z-offset");return void 0!==i&&("number"!=typeof i||0!==i)}(this)}prepare(){return this.mayUse("HD")?xx():Promise.resolve()}hasOffscreenPass(){return"default"!==this.paint.get("line-blend-mode")&&0!==this.paint.get("line-opacity").constantOr(1)&&0!==this.paint.get("line-width").constantOr(1)&&"none"!==this.visibility}resize(){this._destroyLineBlendFbo()}onRemove(e){this._destroyLineBlendFbo(e.painter&&e.painter.context&&e.painter.context.gl||void 0)}_clear(){this._destroyLineBlendFbo()}_destroyLineBlendFbo(e){this.lineBlendFbos&&(this.lineBlendFbos.destroy(),this.lineBlendFbos=null),e&&this.lineBlendDensityReadback&&this.lineBlendDensityReadback.destroy(e),this.lineBlendDensityReadback=null}},symbol:vb,background:class extends Pl{constructor(e,t,i,n){super(e,{layout:xb||(xb=new nl({visibility:new el(rl.layout_background.visibility)})),paint:bb||(bb=new nl({"background-pitch-alignment":new el(rl.paint_background["background-pitch-alignment"]),"background-color":new el(rl.paint_background["background-color"]),"background-pattern":new el(rl.paint_background["background-pattern"]),"background-opacity":new el(rl.paint_background["background-opacity"]),"background-emissive-strength":new el(rl.paint_background["background-emissive-strength"]),"background-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(e,t,i){return{overrideFog:!1}}is3D(e){return"viewport"===this.paint.get("background-pitch-alignment")}},raster:Ib,"raster-particle":Fb,sky:class extends Pl{constructor(e,t,i,n){super(e,{layout:Cb||(Cb=new nl({visibility:new el(rl.layout_sky.visibility)})),paint:Db||(Db=new nl({"sky-type":new el(rl.paint_sky["sky-type"]),"sky-atmosphere-sun":new el(rl.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new el(rl.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new el(rl.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new el(rl.paint_sky["sky-gradient-radius"]),"sky-gradient":new il(rl.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new el(rl.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new el(rl.paint_sky["sky-atmosphere-color"]),"sky-opacity":new el(rl.paint_sky["sky-opacity"]),"sky-gradient-use
2-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-halo-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this._updateColorRamp()}_clear(){this.skyboxFbo&&(this.skyboxFbo.destroy(),this.skyboxFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this._skyboxInvalidated=!0}_handleSpecialPaintPropertyUpdate(e){"sky-gradient"===e?this._updateColorRamp():"sky-atmosphere-sun"!==e&&"sky-atmosphere-halo-color"!==e&&"sky-atmosphere-color"!==e&&"sky-atmosphere-sun-intensity"!==e||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=Ox({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(e){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const t=e.style.light.properties.get("position");return this._lightPosition.azimuthal!==t.azimuthal||this._lightPosition.polar!==t.polar}return!1}getCenter(e,t){if("atmosphere"===this.paint.get("sky-type")){const i=this.paint.get("sky-atmosphere-sun"),n=!i,r=e.style.light,o=r.properties.get("position");return n&&"viewport"===r.properties.get("anchor")&>("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),n?kb(o.azimuthal,90-o.polar,t):kb(i[0],90-i[1],t)}const i=this.paint.get("sky-gradient-center");return kb(i[0],90-i[1],t)}isSky(){return!0}markSkyboxValid(e){this._skyboxInvalidated=!1,this._lightPosition=e.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const e=this.paint.get("sky-type");return"atmosphere"===e?["skyboxCapture","skybox"]:"gradient"===e?["skyboxGradient"]:null}},slot:class extends Pl{constructor(e,t,i,n){super(e,{paint:Pb||(Pb=new nl({}))},t,null)}},"placement-group":class extends Pl{constructor(e,t,i,n){super(e,{paint:Rb||(Rb=new nl({}))},t,i,n)}},model:class extends Pl{constructor(e,t,i,n){super(e,{layout:Lb||(Lb=new nl({visibility:new el(rl.layout_model.visibility),"model-id":new tl(rl.layout_model["model-id"]),"model-allow-density-reduction":new el(rl.layout_model["model-allow-density-reduction"])})),paint:zb||(zb=new nl({"model-opacity":new tl(rl.paint_model["model-opacity"]),"model-rotation":new tl(rl.paint_model["model-rotation"]),"model-scale":new tl(rl.paint_model["model-scale"]),"model-translation":new tl(rl.paint_model["model-translation"]),"model-color":new tl(rl.paint_model["model-color"]),"model-color-mix-intensity":new tl(rl.paint_model["model-color-mix-intensity"]),"model-type":new el(rl.paint_model["model-type"]),"model-cast-shadows":new el(rl.paint_model["model-cast-shadows"]),"model-receive-shadows":new el(rl.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new el(rl.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new tl(rl.paint_model["model-emissive-strength"]),"model-roughness":new tl(rl.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new tl(rl.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new el(rl.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new el(rl.paint_model["model-front-cutoff"]),"model-elevation-reference":new el(rl.paint_model["model-elevation-reference"]),"model-line-cutout-mode":new el(rl.paint_model["model-line-cutout-mode"]),"model-color-use-theme":new tl({type:"string",default:"default","property-type":"data-driven"})}))},t,i,n),this.layer=e,this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}mayUse(e){return"Standard"===e}prepare(){return TE()}createBucket(e){return new Vb(e)}getProgramIds(){return["model"]}is3D(e){return!0}hasShadowPass(){return this.paint.get("model-cast-shadows")}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(e){return e.isTiled3dModelBucket?8191:0}
vendor: 6,908 bytes, line 2
2queryRenderedFeatures(e,t,i){return vE.queryModelLayerRendered?vE.queryModelLayerRendered(this,e,t,i):{}}queryIntersectsFeature(e,t,i,n,r,o,s,a,l,c){return!!vE.queryModelLayerIntersectsFeature&&vE.queryModelLayerIntersectsFeature(this,e,t,i,o,c)}_handleOverridablePaintPropertyUpdate(e,t,i){return!(!this.layout||t.isDataDriven()||i.isDataDriven()||"model-color"!==e&&"model-color-mix-intensity"!==e&&"model-rotation"!==e&&"model-scale"!==e&&"model-translation"!==e&&"model-emissive-strength"!==e)}_isPropertyZoomDependent(e){const t=this._transitionablePaint._values[e];return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof Gs}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}},clip:class extends Pl{constructor(e,t,i,n){super(e,{layout:Ux||(Ux=new nl({"clip-layer-types":new el(rl.layout_clip["clip-layer-types"]),"clip-layer-scope":new el(rl.layout_clip["clip-layer-scope"]),visibility:new el(rl.layout_clip.visibility)})),paint:jx||(jx=new nl({}))},t,i,n)}recalculate(e,t){super.recalculate(e,t)}createBucket(e){return new Yx(e)}is3D(e){return!0}}};class SE{constructor(e){this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}put(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size===this.capacity&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}delete(e){this.cache.delete(e)}}Ys(SE,"LRUCache");class IE{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(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&&(this._channel.port1.close(),this._channel.port2.close()),this._callback=()=>{}}}const AE={Other:0,Symbol:1,FillExtrusion:2,HdRoadCoverage:3};class ME{constructor(){this.tasks=new Map,ht(["process"],this),this.invoker=new IE(this.process),this.nextId=0}add(e,t){const i=this.nextId++,n=function({type:e,renderSourceType:t,zoom:i}){i=i||0;const n=t===AE.Symbol;return"message"===e?0:"maybePrepare"!==e||n?"parseTile"!==e||n?"parseTile"===e&&n?300-i:"maybePrepare"===e&&n?400-i:500:200-i:100-i}(t);if(0===n){try{e()}finally{}return null}return this.tasks.set(i,{fn:e,metadata:t,priority:n,id:i}),this.invoker.trigger(),{cancel:()=>{this.tasks.delete(i)}}}process(){try{const e=this.pick();if(!e)return;this.tasks.delete(e.id),this.tasks.size>0&&this.invoker.trigger(),e.fn()}finally{}}pick(){let e=null,t=1/0;for(const i of this.tasks.values())i.priority<t&&(t=i.priority,e=i);return e}remove(){this.tasks.clear(),this.invoker.remove()}}const CE={type:"message"},DE=new Map,PE=new Map;class RE{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const i=this.toIdx(e,t);return{min:this.minimums[i],max:this.maximums[i]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function LE(e,t,i,n){let r=0,o=Number.MAX_VALUE;for(let s=0;s<3;s++)if(Math.abs(n[s])<1e-15){if(i[s]<e[s]||i[s]>t[s])return null}else{const a=1/n[s];let l=(e[s]-i[s])*a,c=(t[s]-i[s])*a;if(l>c){const e=l;l=c,c=e}if(l>r&&(r=l),c<o&&(o=c),r>o)return null}return r}function zE(e,t,i,n,r,o,s,a,l,c,u){const h=n-e,d=r-t,f=o-i,p=s-e,m=a-t,_=l-i,g=u[1]*_-u[2]*m,y=u[2]*p-u[0]*_,v=u[0]*m-u[1]*p,x=h*g+d*y+f*v;if(Math.abs(x)<1e-15)return null;const b=1/x,w=c[0]-e,T=c[1]-t,E=c[2]-i,S=(w*g+T*y+E*v)*b;if(S<0||S>1)return null;const I=T*f-E*d,A=E*h-w*f,M=w*d-T*h,C=(u[0]*I+u[1]*A+u[2]*M)*b;return C<0||S+C>1?null:(p*I+m*A+_*M)*b}function FE(e,t,i,n,r,o,s,a,l){const c=1<<i,u=o-n,h=s-r,d=(e+1)/c*u+n,f=(t+0)/c*h+r,p=(t+1)/c*h+r;a[0]=(e+0)/c*u+n,a[1]=f,l[0]=d,l[1]=p}class OE{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=e.dim,i=Math.ceil(Math.log2(t/8)),n=[];let r=Math.ceil(Math.pow(2,i));const o=(e,t,i,n,r)=>{const o=n?1:0,s=(e+1)*i-o,a=t*i,l=(t+1)*i-o;r[0]=e*i,r[1]=a,r[2]=s,r[3]=l};let s=new RE(r);const a=1/r,{floatView:l,stride:c}=e,u=[];for(let i=0;i<r*r;i++){const n=Math.floor(i/r),h=i%r;o(h,n,a,!1,u);const d=BE(u[0],u[1],e),f=BE(u[2],u[1],e),p=BE(u[2],u[3],e),m=BE(u[0],u[3],e),_=Math.min(d,f,p,m),g=Math.max(0,8*h-1),y=Math.min(t-1,8*(h+1)),v=Math.max(0,8*n-1),x=Math.min(t-1,8*(n+1));let b=-1/0;for(let e=v;e<=x;e++){const t=(e+1)*c;for(let e=g;e<=y;e++){const i=l[t+e+1];i>b&&(b=i)}}s.minimums.push(_),s.maximums.push(b),s.leaves.push(1)}for(n.push(s),r/=2;r>=1;r/=2){const e=n.at(-1);s=new RE(r);for(let t=0;t<r*r;t++){o(t%r,Math.floor(t/r),2,!0,u);const i=e.getElevation(u[0],u[1]),n=e.getElevation(u[2],u[1]),a=e.getElevation(u[2],u[3]),l=e.getElevation(u[0],u[3]),c=e.isLeaf(u[0],u[1]),h=e.isLeaf(u[2],u[1]),d=e.isLeaf(u[2],u[3]),f=e.isLeaf(u[0],u[3]),p=Math.min(i.min,n.min,a.min,l.min),m=Math.max(i.max,n.max,a.max,l.max),_=c&&h&&d&&f;s.maximums.push(m),s.minimums.push(p),s.leaves.push(m-p<=5&&_?1:0)}n.push(s)}return n}(this.dem),i=t.length-1,n=t[i];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(t,0,0,i,0)}raycastRoot(e,t,i,n,r,o,s=1){return LE([e,t,-100],[i,n,this.maximums[0]*s],r,o)}raycast(e,t,i,n,r,o,s=1){if(!this.nodeCount)return null;const a=this.raycastRoot(e,t,i,n,r,o,s);if(null==a)return null;const l=[],c=[],u=[],h=[],d=[{idx:0,t:a,nodex:0,nodey:0,depth:0}];for(;d.length>0;){const{idx:a,t:f,nodex:p,nodey:m,depth:_}=d.pop();if(this.leaves[a]){FE(p,m,_,e,t,i,n,u,h);const a=1<<_,l=p/a,c=(p+1)/a,d=m/a,g=(m+1)/a,{dim:y,floatView:v,stride:x}=this.dem,b=Math.floor(l*y),w=Math.ceil(c*y),T=Math.floor(d*y),E=w-b,S=Math.ceil(g*y)-T;if(E<=0||S<=0)continue;const I=u[0],A=u[1],M=(h[0]-I)/E,C=(h[1]-A)/S,D=Math.max(0,f),P=r[0]+o[0]*D,R=r[1]+o[1]*D,L=Math.abs(o[0])>1e-10,z=Math.abs(o[1])>1e-10,F=o[0]>=0?1:-1,O=o[1]>=0?1:-1;let k=Math.max(0,Math.min(E-1,Math.floor((P-I)/M))),B=Math.max(0,Math.min(S-1,Math.floor((R-A)/C)));const N=L?Math.abs(M/o[0]):Number.MAX_VALUE,V=z?Math.abs(C/o[1]):Number.MAX_VALUE;let j=L?D+(I+(o[0]>=0?k+1:k)*M-P)/o[0]:Number.MAX_VALUE,G=z?D+(A+(o[1]>=0?B+1:B)*C-R)/o[1]:Number.MAX_VALUE;const $=(e,t)=>v[(t+1)*x+e+1]*s;let H=$(b+k,T+B),Z=$(b+k+1,T+B),q=$(b+k,T+B+1),W=$(b+k+1,T+B+1),Y=null;for(let e=0;e<E+S;e++){const e=Math.min(j,G);if(o[2]>=0||r[2]+o[2]*e<=Math.max(H,Z,q,W)){const e=I+k*M,t=e+M,i=A+B*C,n=i+C,s=zE(t,i,Z,e,i,H,e,n,q,r,o),a=zE(e,n,q,t,n,W,t,i,Z,r,o);null!=s&&s>=0&&(null===Y||s<Y)&&(Y=s),null!=a&&a>=0&&(null===Y||a<Y)&&(Y=a)}const t=j<G;if(t?(k+=F,j+=N):(B+=O,G+=V),k<0||k>=E||B<0||B>=S)break;if(null!==Y&&e>Y)break;t?F>0?(H=Z,q=W,Z=$(b+k+1,T+B),W=$(b+k+1,T
vendor: 8,259 bytes, line 2
2+B+1)):(Z=H,W=q,H=$(b+k,T+B),q=$(b+k,T+B+1)):O>0?(H=q,Z=W,q=$(b+k,T+B+1),W=$(b+k+1,T+B+1)):(q=H,W=Z,H=$(b+k,T+B),Z=$(b+k+1,T+B))}if(null!==Y)return Y||0;const X=U([],r,o,f),J=(X[0]-u[0])/(h[0]-u[0]),K=(X[1]-u[1])/(h[1]-u[1]),Q=BE(l,d,this.dem)*s,ee=BE(c,d,this.dem)*s,te=BE(c,g,this.dem)*s;if(kE(Q,ee,BE(l,g,this.dem)*s,te,J,K)>=X[2])return f;continue}let g=0;for(let d=0;d<this._siblingOffset.length;d++){FE((p<<1)+this._siblingOffset[d][0],(m<<1)+this._siblingOffset[d][1],_+1,e,t,i,n,u,h),u[2]=-100,h[2]=this.maximums[this.childOffsets[a]+d]*s;const f=LE(u,h,r,o);if(null!=f){const e=f;l[d]=e;let t=!1;for(let i=0;i<g&&!t;i++)e>=l[c[i]]&&(c.splice(i,0,d),t=!0);t||(c[g]=d),g++}}for(let e=0;e<g;e++){const t=c[e];d.push({idx:this.childOffsets[a]+t,t:l[t],nodex:(p<<1)+this._siblingOffset[t][0],nodey:(m<<1)+this._siblingOffset[t][1],depth:_+1})}}return null}_addNode(e,t,i){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(i),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,i,n,r){if(1===e[n].isLeaf(t,i))return;this.childOffsets[r]||(this.childOffsets[r]=this.nodeCount);const o=n-1,s=e[o];let a=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const n=2*t+this._siblingOffset[e][0],r=2*i+this._siblingOffset[e][1],o=s.getElevation(n,r),c=s.isLeaf(n,r),u=this._addNode(o.min,o.max,c);c&&(a|=1<<e),l||(l=u)}for(let n=0;n<this._siblingOffset.length;n++)a&1<<n||this._construct(e,2*t+this._siblingOffset[n][0],2*i+this._siblingOffset[n][1],o,l+n)}}function kE(e,t,i,n,r,o){return fn(fn(e,i,o),fn(t,n,o),r)}function BE(e,t,i){const n=i.dim,r=it(e*n-.5,0,n-1),o=it(t*n-.5,0,n-1),s=Math.floor(r),a=Math.floor(o),l=Math.min(s+1,n-1),c=Math.min(a+1,n-1);return kE(i.get(s,a),i.get(l,a),i.get(s,c),i.get(l,c),r-s,o-a)}const NE={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function VE(e,t,i){return(256*e*256+256*t+i)/10-1e4}function UE(e,t,i){return 256*e+t+i/256-32768}class jE{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,i,n=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return void gt(`"${i}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const r=this.dim=t.height-2,o=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.floatView=new Float32Array(t.data.buffer),this.borderReady=n,this._modifiedForSources={},!n){for(let e=0;e<r;e++)o[this._idx(-1,e)]=o[this._idx(0,e)],o[this._idx(r,e)]=o[this._idx(r-1,e)],o[this._idx(e,-1)]=o[this._idx(e,0)],o[this._idx(e,r)]=o[this._idx(e,r-1)];o[this._idx(-1,-1)]=o[this._idx(0,0)],o[this._idx(r,-1)]=o[this._idx(r-1,0)],o[this._idx(-1,r)]=o[this._idx(0,r-1)],o[this._idx(r,r)]=o[this._idx(r-1,r-1)]}const s="terrarium"===i?UE:VE;for(let e=0;e<o.length;++e){const t=4*e;this.floatView[e]=s(this.pixels[t],this.pixels[t+1],this.pixels[t+2])}this._timestamp=Vt.now()}_buildQuadTree(){this._tree=new OE(this)}get(e,t,i=!1){i&&(e=it(e,-1,this.dim),t=it(t,-1,this.dim));const n=this._idx(e,t);return this.floatView[n]}set(e,t,i){const n=this._idx(e,t),r=this.floatView[n];return this.floatView[n]=i,i-r}static getUnpackVector(e){return NE[e]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const i=[0,0,0,0],n=jE.getUnpackVector(t);let r=Math.floor((e+n[3])/n[2]);return i[2]=r%256,r=Math.floor(r/256),i[1]=r%256,r=Math.floor(r/256),i[0]=r,i}getPixels(){return new dd({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,i){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,r=t*this.dim+this.dim,o=i*this.dim,s=i*this.dim+this.dim;switch(t){case-1:n=r-1;break;case 1:r=n+1}switch(i){case-1:o=s-1;break;case 1:s=o+1}const a=-t*this.dim,l=-i*this.dim;for(let t=o;t<s;t++)for(let i=n;i<r;i++){const n=4*this._idx(i,t),r=4*this._idx(i+a,t+l);this.pixels[n+0]=e.pixels[r+0],this.pixels[n+1]=e.pixels[r+1],this.pixels[n+2]=e.pixels[r+2],this.pixels[n+3]=e.pixels[r+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}function GE(e,t){const i={};let n;for(;n=e.nextField(t);)1===n?(i.delta_filter=$E(e,e.readVarint()+e.pos),i.filter="delta_filter"):2===n?(e.readVarint(),i.filter="zigzag_filter"):3===n?(e.readVarint(),i.filter="bitshuffle_filter"):4===n&&(e.readVarint(),i.filter="byteshuffle_filter");return i}function $E(e,t){const i={blockSize:0};let n;for(;n=e.nextField(t);)1===n&&(i.blockSize=e.readVarint());return i}function HE(e,t){const i={};let n;for(;n=e.nextField(t);)1===n?(e.readVarint(),i.codec="gzip_data"):2===n?(e.readVarint(),i.codec="jpeg_image"):3===n?(e.readVarint(),i.codec="webp_image"):4===n&&(e.readVarint(),i.codec="png_image");return i}function ZE(e,t){const i={firstByte:0,lastByte:0,filters:[],codec:null,offset:0,scale:0,bands:[]};let n,r=0,o=0;for(;n=e.nextField(t);)1===n?i.firstByte=e.readFixed64():2===n?i.lastByte=e.readFixed64():3===n?i.filters.push(GE(e,e.readVarint()+e.pos)):4===n?i.codec=HE(e,e.readVarint()+e.pos):5===n?o=e.readFloat():6===n?r=e.readFloat():7===n?i.bands.push(e.readString()):8===n?i.offset=e.readDouble():9===n&&(i.scale=e.readDouble());return 0===i.offset&&(i.offset=o),0===i.scale&&(i.scale=r),i}function qE(e,t){const i={version:0,name:"",units:"",tileSize:0,buffer:0,pixelFormat:0,dataIndex:[]};let n;for(;n=e.nextField(t);)1===n?i.version=e.readVarint():2===n?i.name=e.readString():3===n?i.units=e.readString():4===n?i.tileSize=e.readVarint():5===n?i.buffer=e.readVarint():6===n?i.pixelFormat=e.readVarint():7===n&&i.dataIndex.push(ZE(e,e.readVarint()+e.pos));return i}function WE(e,t,i){let n;for(;n=e.nextField(t);)if(1===n){let t=0;const n=e.readVarint()+e.pos;for(;e.pos<n;)i[t++]=e.readVarint()}return i}function YE(e,t){if(4!==t.length)throw new Error(`Expected data of dimension 4 but got ${t.length}.`);let i=t[3];for(let n=2;n>=1;n--){const r=1===n?1:0,o=2===n?1:0;for(let n=0;n<t[0];n++){const s=t[1]*n;for(let n=r;n<t[1];n++){const r=t[2]*(n+s);for(let n=o;n<t[2];n++){const o=t[3]*(n+r);for(let n=0;n<t[3];n++){const t=o+n;e[t]+=e[t-i]}}}}i*=t[n]}return e}function XE(e){for(let t=0,i=e.length;t<i;t++)e[t]=e[t]>>>1^-(1&e[t]);return e}function JE(e,t){switch(t){case"uint32":return e;case"uint16":for(let t=0;t<e.length;t+=2){const i=e[t],n=e[t+1];e[t]=(240&i)>>4|(61440&i)>>8|(240&n)<<4|61440&n,e[t+1]=15&i|(3840&i)>>4|(15&n)<<8|(3840&n)<<4}return e;case"uint8":for(let t=0;t<e.length;t+=4){const i=e[t],n=e[t+1],r=e[t+2],o=e[t+3];e[t+0]=(192&i)>>6|(192&n)>>4|(192&r)>>2|192&o,e[t+1]=(48&i)>>4|(48&n)>>2|48&r|(48&o)<<2,e[t+2]=(12&i)>>2|12&n|(12&r)<<2|(12&o)<<4,e[t+3]=3&i|(3&n)<<2|(3&r)<<4|(3&o)<<6}return e;default:throw new Error(`Invalid pixel format, "${t}"`)}}Ys(jE,"DEMData"),Ys(OE,"DemMinMaxQuadTree",{omit:["dem"]});var KE=Uint8Array,QE=Uint16Array,eS=Int32Array,tS=new KE([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),iS=new KE([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),nS=new KE([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rS=function(e,t){for(var i=new QE(31),n=0;n<31;++n)i[n]=t+=1<<e[n-1];var r=new eS(i[30]);for(n=1;n<30;++n)for(var o=i[n];o<i[n+1];++o)r[o]=o-i[n]<<5|n;return{b:i,r:r}},oS=rS(tS,2),sS=oS.b,aS=oS.r;sS[28]=258,aS[258]=28;for(var lS=rS(iS,0).b,cS=new QE(32768),uS=0;uS<32768;++uS){var hS=(43690&uS)>>1|(21845&uS)<<1;cS[uS]=((65280&(hS=(61680&(hS=(52428&hS)>>2|(13107&hS)<<2))>>4|(3855&hS)<<4))>>8|(255&hS)<<8)>>1}var dS=function(e,t,i){for(var n=e.length,r=0,o=new QE(t);r<n;++r)e[r]&&++o[e[r]-1];var s,a=new QE(t);for(r=1;r<t;++r)a[r]=a[r-1]+o[r-1]<<1;s=new QE(1<<t);var l=15-t;for(r=0;r<n;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],h=a[e[r]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)s[cS[h]>>l]=c;return s},fS=new KE(288);for(uS=0;uS<144;++uS)fS[uS]=8;for(uS=144;uS<256;++uS)fS[uS]=9;for(uS=256;uS<280;++uS)fS[uS]=7;for(uS=280;uS<288;++uS)fS[uS]=8;var pS=new KE(32);for(uS=0;uS<32;++uS)pS[uS]=5;var mS=dS(fS,9),_S=dS(pS,5),gS=function(e){for(var t=e[0],i=1;i<e.length;++i)e[i]>t&&(t=e[i]);return t},yS=function(e,t,i){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&i},vS=function(e,t){var i=t/8|0;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&t)},xS=function(e){return(e+7)/8|0}
vendor: 4,713 bytes, line 2
2,bS=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],wS=function(e,t,i){var n=new Error(t||bS[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,wS),!i)throw n;return n},TS=new KE(0),ES="undefined"!=typeof TextDecoder&&new TextDecoder;try{ES.decode(TS,{stream:!0})}catch(e){}const SS={gzip_data:"gzip"};class IS extends Error{constructor(e){super(e),this.name="MRTError"}}const AS={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},MS={uint32:1,uint16:2,uint8:4},CS={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let DS;class PS{constructor(e=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=e}getLayer(e){const t=this.layers[e];if(!t)throw new IS(`Layer '${e}' not found`);return t}getHeaderLength(e){const t=new Uint8Array(e),i=new DataView(e);if(13!==t[0])throw new IS("File is not a valid MRT.");return i.getUint32(1,!0)}parseHeader(e){const t=new Uint8Array(e),i=this.getHeaderLength(e);if(t.length<i)throw new IS(`Expected header with length >= ${i} but got buffer of length ${t.length}`);const n=function(e){const t={headerLength:0,x:0,y:0,z:0,layers:[]};let i;for(;i=e.nextField(void 0);)1===i?t.headerLength=e.readFixed32():2===i?t.x=e.readVarint():3===i?t.y=e.readVarint():4===i?t.z=e.readVarint():5===i&&t.layers.push(qE(e,e.readVarint()+e.pos));return t}(new DS(t.subarray(0,i)));if(!isNaN(this.x)&&(this.x!==n.x||this.y!==n.y||this.z!==n.z))throw new IS(`Invalid attempt to parse header ${n.z}/${n.x}/${n.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=n.x,this.y=n.y,this.z=n.z;for(const e of n.layers)this.layers[e.name]=new RS(e,{cacheSize:this._cacheSize});return this}createDecodingTask(e){const t=[],i=this.getLayer(e.layerName);for(let n of e.blockIndices){const r=i.dataIndex[n],o=r.firstByte-e.firstByte,s=r.lastByte-e.firstByte;if(i._blocksInProgress.has(n))continue;const a={layerName:i.name,firstByte:o,lastByte:s,pixelFormat:i.pixelFormat,blockIndex:n,blockShape:[r.bands.length].concat(i.bandShape),buffer:i.buffer,codec:r.codec.codec,filters:r.filters.map(e=>e.filter)};i._blocksInProgress.add(n),t.push(a)}return new LS(t,()=>{t.forEach(e=>i._blocksInProgress.delete(e.blockIndex))},(e,n)=>{if(t.forEach(e=>i._blocksInProgress.delete(e.blockIndex)),e)throw e;n.forEach(e=>{this.getLayer(e.layerName).processDecodedData(e)})})}}class RS{constructor({version:e,name:t,units:i,tileSize:n,pixelFormat:r,buffer:o,dataIndex:s},a){if(this.version=e,1!==this.version)throw new IS(`Cannot parse raster layer encoded with MRT version ${e}`);this.name=t,this.units=i,this.tileSize=n,this.buffer=o,this.pixelFormat=AS[r],this.dataIndex=s,this.bandShape=[n+2*o,n+2*o,MS[this.pixelFormat]],this._decodedBlocks=new SE(a?a.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return MS[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map(({bands:e})=>e).flat()}processDecodedData(e){const t=e.blockIndex.toString();this._decodedBlocks.get(t)||this._decodedBlocks.put(t,e.data)}getBlockForBand(e){let t=0;switch(typeof e){case"string":for(const[i,n]of this.dataIndex.entries()){for(const[r,o]of n.bands.entries())if(o===e)return{bandIndex:t+r,blockIndex:i,blockBandIndex:r};t+=n.bands.length}break;case"number":for(const[i,n]of this.dataIndex.entries()){if(e>=t&&e<t+n.bands.length)return{bandIndex:e,blockIndex:i,blockBandIndex:e-t};t+=n.bands.length}break;default:throw new IS(`Invalid band \`${JSON.stringify(e)}\`. Expected string or integer.`)}return{blockIndex:-1,blockBandIndex:-1}}getDataRange(e){let t=1/0,i=-1/0;const n=[],r=new Set;for(const o of e){const{blockIndex:e}=this.getBlockForBand(o);if(e<0)throw new IS(`Invalid band: ${JSON.stringify(o)}`);const s=this.dataIndex[e];n.includes(e)||n.push(e),r.add(e),t=Math.min(t,s.firstByte),i=Math.max(i,s.lastByte)}if(r.size>this.cacheSize)throw new IS(`Number of blocks to decode (${r.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:t,lastByte:i,blockIndices:n}}hasBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0}hasDataForBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0&&!!this._decodedBlocks.get(t.toString())}getBandView(e){const{blockIndex:t,blockBandIndex:i}=this.getBlockForBand(e);if(t<0)throw new IS(`Band not found: ${JSON.stringify(e)}`);const n=this._decodedBlocks.get(t.toString());if(!n)throw new IS(`Data for band ${JSON.stringify(e)} of layer "${this.name}" not decoded.`);const r=this.dataIndex[t],o=this.bandShape.reduce((e,t)=>
vendor: 6,917 bytes, line 2
2e*t,1),s=i*o,a=n.subarray(s,s+o);return{data:a,bytes:new Uint8Array(a.buffer).subarray(a.byteOffset,a.byteOffset+a.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:r.offset,scale:r.scale}}}PS.setPbf=function(e){DS=e};class LS{constructor(e,t,i){this.tasks=e,this._onCancel=t,this._onComplete=i,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(e,t){this._finalized||(this._onComplete(e,t),this._finalized=!0)}}PS.performDecoding=function(e,t){const i=new Uint8Array(e);return Promise.all(t.tasks.map(e=>{const{layerName:t,firstByte:n,lastByte:r,pixelFormat:o,blockShape:s,blockIndex:a,filters:l,codec:c}=e,u=i.subarray(n,r+1),h=new Uint32Array(s[0]*s[1]*s[2]);let d;if("gzip_data"!==c)throw new IS(`Unhandled codec: ${c}`);return d=function(e,t){if(!globalThis.DecompressionStream&&"gzip_data"===t)return Promise.resolve((s=function(e){31==e[0]&&139==e[1]&&8==e[2]||wS(6,"invalid gzip data");var t=e[3],i=10;4&t&&(i+=2+(e[10]|e[11]<<8));for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[i++]);return i+(2&t)}(i=e),s+8>i.length&&wS(6,"invalid gzip data"),function(e,t,i,n){var r=e.length;if(!r||t.f&&!t.l)return i||new KE(0);var o=!i,s=o||2!=t.i,a=t.i;o&&(i=new KE(3*r));var l=function(e){var t=i.length;if(e>t){var n=new KE(Math.max(2*t,e));n.set(i),i=n}},c=t.f||0,u=t.p||0,h=t.b||0,d=t.l,f=t.d,p=t.m,m=t.n,_=8*r;do{if(!d){c=yS(e,u,1);var g=yS(e,u+1,3);if(u+=3,!g){var y=e[(C=xS(u)+4)-4]|e[C-3]<<8,v=C+y;if(v>r){a&&wS(0);break}s&&l(h+y),i.set(e.subarray(C,v),h),t.b=h+=y,t.p=u=8*v,t.f=c;continue}if(1==g)d=mS,f=_S,p=9,m=5;else if(2==g){var x=yS(e,u,31)+257,b=yS(e,u+10,15)+4,w=x+yS(e,u+5,31)+1;u+=14;for(var T=new KE(w),E=new KE(19),S=0;S<b;++S)E[nS[S]]=yS(e,u+3*S,7);u+=3*b;var I=gS(E),A=(1<<I)-1,M=dS(E,I);for(S=0;S<w;){var C,D=M[yS(e,u,A)];if(u+=15&D,(C=D>>4)<16)T[S++]=C;else{var P=0,R=0;for(16==C?(R=3+yS(e,u,3),u+=2,P=T[S-1]):17==C?(R=3+yS(e,u,7),u+=3):18==C&&(R=11+yS(e,u,127),u+=7);R--;)T[S++]=P}}var L=T.subarray(0,x),z=T.subarray(x);p=gS(L),m=gS(z),d=dS(L,p),f=dS(z,m)}else wS(1);if(u>_){a&&wS(0);break}}s&&l(h+131072);for(var F=(1<<p)-1,O=(1<<m)-1,k=u;;k=u){var B=(P=d[vS(e,u)&F])>>4;if((u+=15&P)>_){a&&wS(0);break}if(P||wS(2),B<256)i[h++]=B;else{if(256==B){k=u,d=null;break}var N=B-254;B>264&&(N=yS(e,u,(1<<(j=tS[S=B-257]))-1)+sS[S],u+=j);var V=f[vS(e,u)&O],U=V>>4;if(V||wS(3),u+=15&V,z=lS[U],U>3){var j=iS[U];z+=vS(e,u)&(1<<j)-1,u+=j}if(u>_){a&&wS(0);break}s&&l(h+131072);var G=h+N;if(h<z){var $=0-z,H=Math.min(z,G);for($+h<0&&wS(3);h<H;++h)i[h]=n[$+h]}for(;h<G;++h)i[h]=i[h-z]}}t.l=d,t.p=k,t.b=h,t.f=c,d&&(c=1,t.m=p,t.d=f,t.n=m)}while(!c);return h!=i.length&&o?function(e,t,i){return(null==i||i>e.length)&&(i=e.length),new KE(e.subarray(0,i))}(i,0,h):i.subarray(0,h)}(i.subarray(s,-8),{i:2},new KE(((r=i)[(o=r.length)-4]|r[o-3]<<8|r[o-2]<<16|r[o-1]<<24)>>>0),n)));var i,n,r,o,s;const a=SS[t];if(!a)throw new Error(`Unhandled codec: ${t}`);const l=new globalThis.DecompressionStream(a);return new Response(new Blob([e]).stream().pipeThrough(l)).arrayBuffer().then(e=>new Uint8Array(e))}(u,c).then(e=>(function(e,t){let i;for(;i=e.nextField();)if(2===i)WE(e,e.readVarint()+e.pos,t);else if(3===i)throw new Error("Not implemented")}(new DS(e),h),new(0,CS[o])(h.buffer))),d.then(e=>{for(let t=l.length-1;t>=0;t--)switch(l[t]){case"delta_filter":YE(e,s);break;case"zigzag_filter":XE(e);break;case"bitshuffle_filter":JE(e,o);break;default:throw new IS(`Unhandled filter "${l[t]}"`)}return{layerName:t,blockIndex:a,data:e}}).catch(e=>{throw e})}))},Ys(LS,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]}),Ys(PS,"MapboxRasterTile"),Ys(RS,"MapboxRasterLayer",{omit:["_blocksInProgress"]});const zS=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],FS=new Uint32Array(96);class OS{static from(e){if(!e||void 0===e.byteLength||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[t,i]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");const n=i>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const r=zS[15&i];if(!r)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new OS(s,o,r,void 0,e)}constructor(e,t=64,i=Float64Array,n=ArrayBuffer,r){if(isNaN(e)||e<0)throw new Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=zS.indexOf(this.ArrayType),s=2*e*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${i}.`);if(r)this.data=r,this.ids=new this.IndexArrayType(r,8,e),this.coords=new i(r,8+a+l,2*e),this._pos=2*e,this._finished=!0;else{const r=this.data=new n(8+s+a+l);this.ids=new this.IndexArrayType(r,8,e),this.coords=new i(r,8+a+l,2*e),this._pos=0,this._finished=!1,new Uint8Array(r,0,2).set([219,16+o]),new Uint16Array(r,2,1)[0]=t,new Uint32Array(r,4,1)[0]=e}}add(e,t){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=t,i}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return kS(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:o,nodeSize:s}=this;FS[0]=0,FS[1]=r.length-1,FS[2]=0;let a=3;const l=[];for(;a>0;){const c=FS[--a],u=FS[--a],h=FS[--a];if(u-h<=s){for(let s=h;s<=u;s++){const a=o[2*s],c=o[2*s+1];a>=e&&a<=i&&c>=t&&c<=n&&l.push(r[s])}continue}const d=h+u>>1,f=o[2*d],p=o[2*d+1];f>=e&&f<=i&&p>=t&&p<=n&&l.push(r[d]),(0===c?e<=f:t<=p)&&(FS[a++]=h,FS[a++]=d-1,FS[a++]=1-c),(0===c?i>=f:n>=p)&&(FS[a++]=d+1,FS[a++]=u,FS[a++]=1-c)}return l}within(e,t,i){const n=[];return this.withinInto(e,t,i,n),n}withinInto(e,t,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:o,nodeSize:s}=this;FS[0]=0,FS[1]=r.length-1,FS[2]=0;let a=3,l=0;const c=i*i;for(;a>0;){const u=FS[--a],h=FS[--a],d=FS[--a];if(h-d<=s){for(let i=d;i<=h;i++)US(o[2*i],o[2*i+1],e,t)<=c&&(n[l++]=r[i]);continue}const f=d+h>>1,p=o[2*f],m=o[2*f+1];US(p,m,e,t)<=c&&(n[l++]=r[f]),(0===u?e-i<=p:t-i<=m)&&(FS[a++]=d,FS[a++]=f-1,FS[a++]=1-u),(0===u?e+i>=p:t+i>=m)&&(FS[a++]=f+1,FS[a++]=h,FS[a++]=1-u)}return l}}function kS(e,t,i,n,r,o){if(r-n<=i)return;const s=n+r>>1;BS(e,t,s,n,r,o),kS(e,t,i,n,s-1,1-o),kS(e,t,i,s+1,r,1-o)}function BS(e,t,i,n,r,o){for(;r>n;){if(r-n>600){const s=r-n+1,a=i-n+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(a-s/2<0?-1:1);BS(e,t,i,Math.max(n,Math.floor(i-a*c/s+u)),Math.min(r,Math.floor(i+(s-a)*c/s+u)),o)}const s=t[2*i+o];let a=n,l=r;
vendor: 4,275 bytes, line 2
2for(NS(e,t,n,i),t[2*r+o]>s&&NS(e,t,n,r);a<l;){for(NS(e,t,a,l),a++,l--;t[2*a+o]<s;)a++;for(;t[2*l+o]>s;)l--}t[2*n+o]===s?NS(e,t,n,l):(l++,NS(e,t,l,r)),l<=i&&(n=l+1),i<=l&&(r=l-1)}}function NS(e,t,i,n){VS(e,i,n),VS(t,2*i,2*n),VS(t,2*i+1,2*n+1)}function VS(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function US(e,t,i,n){const r=e-i,o=t-n;return r*r+o*o}t.$=_w,t.A=Fr,t.B=kr,t.C=mn,t.D=zr,t.E=ln,t.F=cr,t.G=rr,t.H=ir,t.I=cn,t.J=al,t.K=/^(.*)-transition$/,t.L=SE,t.M=Ps,t.N=Ms,t.O=Re,t.P=Pe,t.Q=u,t.R=ai,t.S=Jf,t.T=Mm,t.U=/^(.*)-use-theme$/,t.V=function(e,t){const i=Jf(t.zoom);if(0===i)return kf(e);const n=Uf(e),r=jf(n),o=dr(n.getWest())*t.worldSize,s=dr(n.getEast())*t.worldSize,a=fr(n.getNorth())*t.worldSize,l=fr(n.getSouth())*t.worldSize,c=[o,a,0],u=[s,a,0],h=[o,l,0],d=[s,l,0],f=p([],t.globeMatrix);return X(c,c,f),X(u,u,f),X(h,h,f),X(d,d,f),r[0]=Bf(r[0],h,i),r[1]=Bf(r[1],d,i),r[2]=Bf(r[2],u,i),r[3]=Bf(r[3],c,i),Pf.fromPoints(r)},t.W=qf,t.X=m,t.Y=c,t.Z=fw,t._=cw,t.a=async function(e,t){e.headers||(e.headers={}),e.headers.accept="image/webp,*/*";const i=await function(e){return new Promise((t,i)=>{if(e&&e.aborted)return void i(e.reason);const n=()=>{const e=yi.shift();e?e():vi--};if(vi<jt.MAX_PARALLEL_IMAGE_REQUESTS)return vi++,void t(n);const r=()=>{e&&e.removeEventListener("abort",o),t(n)},o=()=>{const t=yi.indexOf(r);-1!==t&&yi.splice(t,1),i(e.reason)};e&&e.addEventListener("abort",o),yi.push(r)})}(t);try{const{data:i,headers:n}=await _i(e,t);let r;try{r=await createImageBitmap(new Blob([new Uint8Array(i)],{type:"image/png"}))}catch(e){throw new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`,{cause:e})}return t&&t.throwIfAborted(),{data:r,headers:n}}finally{i()}},t.a$=Uc,t.a0=Vw,t.a1=dw,t.a2=th,t.a3=eh,t.a4=sh,t.a5=ih,t.a6=Cr,t.a7=dr,t.a8=fr,t.a9=function(e,t,i){if(t.projection.name===i.projection.name)return e.projMatrix;const n=i.clone();return n.setProjection(t.projection),Qp(n,t.getProjection(),e)},t.aA=Df,t.aB=Ec,t.aC=lp,t.aD=jv,t.aE=ex,t.aF=Bw,t.aG=oE,t.aH=Gn,t.aI=(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y=!1)=>{const v=eE(e,t,i,n,r,o,s,a,c,u,h,d,f,p,m,_,1,[0,0,0],[0,0,1],y),x={u_height_factor:-Math.pow(2,a.overscaledZ)/l.tileSize/8};return Object.assign(v,XT(t,l,g),x)},t.aJ=eE,t.aK=Av,t.aL=450,t.aM=7,t.aN=(e,t,i,n,r,o)=>({u_matrix:e,u_edge_radius:t,u_width_scale:i,u_vertical_scale:n,u_height_type:JT[r],u_base_type:JT[o]}),t.aO=g,t.aP=p,t.aQ=f,t.aR=iE,t.aS=4,t.aT=2,t.aU=Bh,t.aV=Vh,t.aW=ht,t.aX=class{static calculate(e,t,i){const n=new Set,r=new Map,o=new Set,s=new Set;for(const i of Object.values(e))for(const[e,a]of Object.entries(i.floors)){o.add(e),a.isDefault&&s.add(e),a.conflicts&&r.set(e,a.conflicts);const i=e===t,l=a.connections&&t&&a.connections.has(t);(i||l)&&n.add(e)}const a=e=>{const t=r.get(e)||new Set;for(const i of n)if((r.get(i)||new Set).has(e)||t.has(i))return!0;return!1};if(i)for(const e of i)o.has(e)&&(a(e)||n.add(e));for(const e of s)n.has(e)||a(e)||n.add(e);return n}},t.aY=Qu,t.aZ=rh,t.a_=class extends Ku{constructor(e){super(e),this.current=new Float32Array(9)}set(e,t,i){if(!this.fetchUniformLocation(e,t))return;const n=this.current;for(let e=0;e<9;e++)if(i[e]!==n[e]){n.set(i),this.gl.uniformMatrix3fv(this.location,!1,n);break}}},t.aa=C,t.ab=cu,t.ac=Fd,t.ad=Gu,t.ae=hu,t.af=Wa,t.ag=nl,t.ah=el,t.ai=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return vt(e.expression.evaluate(t))}interpolate(e,t,i){return{x:fn(e.x,t.x,i),y:fn(e.y,t.y,i),z:fn(e.z,t.z,i),azimuthal:fn(e.azimuthal,t.azimuthal,i),polar:fn(e.polar,t.polar,i)}}},t.aj=Ha,t.ak=Gs,t.al=Qa,t.am=fn,t.an=nt,t.ao=65,t.ap=45,t.aq=function(e,t,i){const n=Ac.fromLngLat(t),r=i.elevation?i.elevation.getAtPointOrZero(n):0;return Kp(e,n.x,n.y,r,i)},t.ar=function(e,t,i,n,r,o,s){const a=[[i,n,0],[r,n,0],[r,o,0],[i,o,0]];let l=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(const e of a){const i=R(X([],e,t));l=Math.min(l,i),c=Math.max(c,i)}return[Xp(e,l,s.pitch),Xp(e,c,s.pitch)]},t.as=vn,t.at=Kp,t.au=Yp,t.av=Je,t.aw=function(){return at++},t.ax=class{constructor(e,t,i){this.target=e,this.parent=t,this.mapId=i,this.pendingResponses=new Map,ht(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler
vendor: 4,180 bytes, line 2
2=new ME}send(e,t,i){const{signal:n,targetMapId:r,metadata:o}=i||{},s=Math.round(1e18*Math.random()).toString(36).substring(0,10),a=new Set;return n&&n.aborted?Promise.reject(n.reason):(this.target.postMessage({id:s,type:e,targetMapId:r,sourceMapId:this.mapId,data:Qs(t,a)},[...a]),new Promise((e,t)=>{const i={resolve:e,reject:t,metadata:o||CE};if(n){const e=()=>{this.pendingResponses.delete(s),t(n.reason)};n.addEventListener("abort",e,{once:!0}),i.detach=()=>n.removeEventListener("abort",e)}this.pendingResponses.set(s,i)}))}notify(e,t,i){const{targetMapId:n}=i||{},r=new Set;this.target.postMessage({type:e,targetMapId:n,sourceMapId:this.mapId,data:Qs(t,r)},[...r])}sendCancelable(e,t,i,n){const r=new AbortController;return this.send(e,t,{...i,signal:r.signal}).then(e=>n(null,e)).catch(e=>{"AbortError"!==e.name&&n(e)}),r}getWorkerSourceActor(e){return{scheduler:this.scheduler,send:(t,i,n)=>this.send(t,i,{...n,targetMapId:e}),notify:(t,i)=>{this.notify(t,i,{targetMapId:e})},sendCancelable:(t,i,n,r)=>this.sendCancelable(t,i,{...n,targetMapId:e},r)}}receive(e){const t=e.data;if(!t)return;const i=t.id;if(!t.targetMapId||this.mapId===t.targetMapId)if(bt(self)){const e=this.pendingResponses.get(i);this.scheduler.add(()=>{this.processTask(i,t)},e&&e.metadata||CE)}else this.processTask(i,t)}async processTask(e,t){if("<response>"===t.type){const i=this.pendingResponses.get(e);if(this.pendingResponses.delete(e),i){i.detach&&i.detach();try{t.error?i.reject(ea(t.error)):i.resolve(ea(t.data))}catch(e){i.reject(e)}}return}const i=new Set,n=ea(t.data);try{let r;if(this.parent[t.type])r=await this.parent[t.type](t.sourceMapId,n);else{if(!this.parent.getWorkerSource)throw new Error(`Could not find function ${t.type}`);{const e=t.type.split("."),{source:i,scope:o}=n,s=this.parent.getWorkerSource(t.sourceMapId,{type:e[0],source:i,scope:o});r=await s[e[1]](n)}}if(!e)return;this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:null,data:Qs(r,i)},[...i])}catch(t){this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:Qs(t),data:null},[])}}remove(){for(const e of this.pendingResponses.values())e.detach&&e.detach(),e.reject(new DOMException("Actor removed","AbortError"));this.pendingResponses.clear(),this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},t.ay=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return function([e,t]){const i=vt([1,e,t]);return{x:i.x,y:i.y,z:i.z}}(e.expression.evaluate(t))}interpolate(e,t,i){return{x:fn(e.x,t.x,i),y:fn(e.y,t.y,i),z:fn(e.z,t.z,i)}}},t.az=vE,t.b=hd,t.b$=et,t.b0=Eu,t.b1=it,t.b2=6,t.b3=Uf,t.b4=function(e){const t=80.051129;e=it(e,-80.051129,t)/t*90;const i=Math.pow(Math.abs(Math.sin(Je(e))),3);return Math.round(i*(uc.length-1))},t.b5=Zf,t.b6=kf,t.b7=function(e){const t=e.pixelsPerMeter,i=t/xc(1,e.center.lat),n=d(new Float64Array(16));return _(n,n,[e.point.x,e.point.y,0]),g(n,n,[i,i,t]),Float32Array.from(n)},t.b8=function(e,t,i,n){const r=t.getNorth(),o=t.getSouth(),s=t.getWest(),l=t.getEast(),c=1<<e.z,u=l-s,h=r-o,d=u/cc,f=-h/uc[i],p=[0,d,0,f,0,0,r,s,0];if(e.z>0){const e=180/n;a(p,p,[e/u+1,0,0,0,e/h+1,0,-.5*e/d,.5*e/f,1])}return p[2]=c,p[5]=e.x,p[8]=e.y,p},t.b9=Rt,t.bA=vd,t.bB=Th,t.bC=Fc,t.bD=Gc,t.bE=bu,t.bF=bf,t.bG=Ll,t.bH=Gf,t.bI=X,t.bJ=Bf,t.bK=$c,t.bL=xf,t.bM=w,t.bN=_,t.bO=function(){$a.isLoading()||$a.isLoaded()||"deferred"!==ja()||Ga()},t.bP=ci,t.bQ=sp,t.bR=function(e,t){const i=[];for(const n in e)n in t||i.push(n);return i},t.bS=AE,t.bT=Ac,t.bU=ot,t.bV="hd_road_coverage",t.bW=rp,t.bX=op,t.bY=oh,t.bZ=M,t.b_=xt,t.ba=256,t.bb=OT,t.bc=qT,t.bd=vu,t.be=ue,t.bf=de,t.bg=pe,t.bh=I,t.bi=L,t.bj=ps,t.bk=mc,t.bl=yu,t.bm=gu,t.bn=bc,t.bo=Ow,t.bp=Pt,t.bq=cp,t.br=pr,t.bs=mr,t.bt=Hc,t.bu=Au,t.bv=f_,t.bw=ll,t.bx=Oc,t.by=iw,t.bz=wt,t.c=Us,t.c$=sm,t.c0=function(e,t,i){const n=Jf(i.zoom),r=e.style.map._antialias,o=e.terrain&&e.terrain.exaggeration()>0;return 0===n&&!r&&!o},t.c1=function(e,t,i){const n=d(new Float64Array(16)),r=(t/(1<<e)-.5)*Math.PI*2;return v(n,i.globeMatrix,r),Float32Array.from(n)},t.c2=qp,t.c3=dd,t.c4=xc,t.c5=Rf,t.c6=le,t.c7=se,t.c8=O,t.c9=Z,t.cA=Cc,t.cB=st,t.cC=class{constructor(e){this.entries={}
vendor: 7,693 bytes, line 2
2,this.scheduler=e}request(e,t,i,n){const r=this.entries[e]=this.entries[e]||{callbacks:[]};if(r.result){const[e,i]=r.result;return this.scheduler?this.scheduler.add(()=>{n(e,i)},t):n(e,i),()=>{}}return r.callbacks.push(n),r.cancel||(r.cancel=i((i,n)=>{r.result=[i,n];for(const e of r.callbacks)this.scheduler?this.scheduler.add(()=>{e(i,n)},t):e(i,n);setTimeout(()=>delete this.entries[e],3e3)})),()=>{r.result||(r.callbacks=r.callbacks.filter(e=>e!==n),r.callbacks.length||(r.cancel(),delete this.entries[e]))}}},t.cD=function(e){if("provider"in e&&!e.provider)return null;let t=e.provider;if(!t&&"url"in e&&e.url&&(t=function(e){try{const t=new URL(e).pathname.split("/").pop()||"",i=t.lastIndexOf(".");return i>=0?t.slice(i+1):""}catch{return""}}(e.url)),!t)return null;const i=jt.TILE_PROVIDER_URLS[t];if(!i)return null;let n;try{n=new URL(i,jt.API_URL).href}catch(e){return new Error(`TileProvider "${t}" has an invalid URL: "${i}"`)}return{name:t,url:n}},t.cE=_E,t.cF=yE,t.cG=ni,t.cH=function(e,t,i){const n=JSON.stringify(e.request);return e.data&&(this.deduped.entries[n]={result:[null,e.data]}),this.deduped.request(n,{type:"parseTile",renderSourceType:e.renderSourceType,zoom:e.tileZoom},t=>{const n=new AbortController;return _i(e.request,n.signal).then(({data:e,headers:n})=>{t(null,{rawData:e,vectorTile:i?void 0:new kh(new sm(e)),headers:n})}).catch(e=>{n.signal.aborted||(ci(e)?t(null,null):t(e))}),()=>{n.abort(),t(null,null)}},t)},t.cI=Tt,t.cJ=function(e){ti++,ti>Xt&&(e.getActor().notify("enforceCacheSizeLimit",Yt),ti=0)},t.cK=ji,t.cL=async function(e,t,i){const n=e.url&&!e.tiles?await t.transformRequest(e.url,ai.Source,i):void 0;return{request:n,options:n?{...e,url:n.url}:e}},t.cM=function(e,t,i){return t?mE(e,t,i):e.tiles&&e.tiles.length>0?{tiles:e.tiles}:new Error('TileJSON is missing required "tiles" property')},t.cN=async function(e,t){const i=PE.get(e);if(i)return i;const n=DE.get(e);if(void 0!==n)return n;const r=self.__mapboxImport(t).catch(t=>{throw new Error(`TileProvider "${e}" failed to load: ${t instanceof Error?t.message:String(t)}`)}).then(t=>{const i=t.default;if("function"!=typeof i)throw new Error(`TileProvider "${e}" module must default-export a class`);if("function"!=typeof i.prototype.loadTile)throw new Error(`TileProvider "${e}" class must have a loadTile method`);return PE.set(e,i),i}).finally(()=>{DE.delete(e)});return DE.set(e,r),r},t.cO=class{constructor(e,t){this.context=e,this.texture=t}bind(e,t){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_2D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}},t.cP=wc,t.cQ=function(e,t,i,n){for(;t<i;){const r=t+i>>1;e[r]<=n?t=r+1:i=r}return t},t.cR=function(e,t,i,n){for(;t<i;){const r=t+i>>1;e[r]<n?t=r+1:i=r}return t},t.cS=cc,t.cT=J,t.cU=function(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e[0]=s*u-a*c,e[1]=r*c-n*u,e[2]=n*a-r*s,e[3]=a*l-o*u,e[4]=i*u-r*l,e[5]=r*o-i*a,e[6]=o*c-s*l,e[7]=n*l-i*c,e[8]=i*s-n*o,e},t.cV=a,t.cW=async function(e){const t=document.createElement("video");t.muted=!0;for(const i of e){const e=document.createElement("source");gi(i)||(t.crossOrigin="Anonymous"),e.src=i,t.appendChild(e)}return await new Promise((i,n)=>{t.onloadstart=()=>i(),t.onerror=()=>n(new Error(`Could not load video: ${e.join(", ")}`))}),t},t.cX=Ib,t.cY=Fb,t.cZ=gc,t.c_=PS,t.ca=U,t.cb=XT,t.cc=Yf,t.cd=tb,t.ce=Eb,t.cf=Mt,t.cg=Ct,t.ch=function(e,t){const i=[0,0,0];return X(i,i,Zf(kf(t.canonical))),X(i,i,e),i},t.ci=nw,t.cj=function(e,t,i,n,r,o){const{width:s,height:a}=n.imageManager.getPixelSize(t),l=Math.pow(2,o.tileID.overscaledZ),c=o.tileSize*Math.pow(2,n.transform.tileZoom)/l,u=c*(o.tileID.canonical.x+o.tileID.wrap*l),h=c*o.tileID.canonical.y;return{u_image:0,u_pattern_tl:i.tl,u_pattern_br:i.br,u_texsize:[s,a],u_pattern_size:i.displaySize,u_pattern_units_to_pixels:r?[n.transform.width,-1*n.transform.height]:[1/tb(o,1,n.transform.tileZoom),1/tb(o,1,n.transform.tileZoom)],u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}},t.ck=e=>({u_matrix:new sh(e),u_texsize:new th(e),u_pixels_to_tile_units:new ah(e),u_device_pixel_ratio:new eh(e),u_width_scale:new eh(e),u_floor_width_scale:new eh(e),u_image:new Qu(e),u_units_to_pixels:new th(e),u_tile_units_to_pixels:new eh(e),u_alpha_discard_threshold:new eh(e),u_trim_offset:new th(e),u_trim_fade_range:new th(e),u_trim_gradient_mix_range:new th(e),u_trim_color:new rh(e),u_zbias_factor:new eh(e),u_tile_to_meter:new eh(e),u_ground_shadow_factor:new ih(e),u_pattern_transition:new eh(e),u_opacity_multiplier:new eh(e)}),t.cl=e=>({u_matrix:new sh(e),u_pixels_to_tile_units:new ah(e),u_device_pixel_ratio:new eh(e),u_width_scale:new eh(e),u_floor_width_scale:new eh(e),u_units_to_pixels:new th(e),u_dash_image:new Qu(e),u_gradient_image:new Qu(e),u_border_gradient_image:new Qu(e),u_image_height:new eh(e),u_texsize:new th(e),u_tile_units_to_pixels:new eh(e),u_alpha_discard_threshold:new eh(e),u_trim_offset:new th(e),u_trim_fade_range:new th(e),u_trim_gradient_mix_range:new th(e),u_trim_color:new rh(e),u_zbias_factor:new eh(e),u_road_view_depth_bias:new eh(e),u_road_clip_to_view:new rh(e),u_tile_to_meter:new eh(e),u_ground_shadow_factor:new ih(e),u_opacity_multiplier:new eh(e)}),t.cm=e=>({u_color:new oh(e),u_matrix:new sh(e),u_overlay:new Qu(e),u_overlay_scale:new eh(e)}),t.cn=e=>({u_camera_to_center_distance:new eh(e),u_extrude_scale:new ah(e),u_device_pixel_ratio:new eh(e),u_matrix:new sh(e),u_inv_rot_matrix:new sh(e),u_merc_center:new th(e),u_tile_id:new ih(e),u_zoom_transition:new eh(e),u_up_dir:new ih(e),u_emissive_strength:new eh(e)}),t.co=e=>({u_matrix:new sh(e),u_lightpos:new ih(e),u_lightintensity:new eh(e),u_lightcolor:new ih(e),u_vertical_gradient:new eh(e),u_height_factor:new eh(e),u_edge_radius:new eh(e),u_width_scale:new eh(e),u_ao:new th(e),u_height_type:new Qu(e),u_base_type:new Qu(e),u_tile_id:new ih(e),u_zoom_transition:new eh(e),u_inv_rot_matrix:new sh(e),u_merc_center:new th(e),u_up_dir:new ih(e),u_height_lift:new eh(e),u_image:new Qu(e),u_texsize:new th(e),u_pixel_coord_upper:new th(e),u_pixel_coord_lower:new th(e),u_tile_units_to_pixels:new eh(e),u_opacity:new eh(e),u_pattern_transition:new eh(e)}),t.cp=e=>({u_matrix:new sh(e),u_lightpos:new ih(e),u_lightintensity:new eh(e),u_lightcolor:new ih(e),u_vertical_gradient:new eh(e),u_opacity:new eh(e),u_edge_radius:new eh(e),u_width_scale:new eh(e),u_ao:new th(e),u_height_type:new Qu(e),u_base_type:new Qu(e),u_tile_id:new ih(e),u_zoom_transition:new eh(e),u_inv_rot_matrix:new sh(e),u_merc_center:new th(e),u_up_dir:new ih(e),u_height_lift:new eh(e),u_flood_light_color:new ih(e),u_vertical_scale:new eh(e),u_flood_light_intensity:new eh(e),u_ground_shadow_factor:new ih(e),u_front_cutoff_params:new ih(e)}),t.cq=function(e,t,i=0,n=!0){const r=new Pe(i,i),o=e.sub(r),s=t.add(r),a=[o,new Pe(s.x,o.y),s,new Pe(o.x,s.y)];return n&&a.push(o.clone()),a},t.cr=function(e,t){const i=[];for(let n=0;n<e.length;n++){const r=rt(n-1,-1,e.length-1),o=rt(n+1,-1,e.length-1),s=e[n],a=e[o],l=e[r].sub(s).unit(),c=a.sub(s).unit(),u=c.angleWithSep(l.x,l.y),h=l.add(c).unit().mult(-1*t/Math.sin(u/2));i.push(s.add(h))}return i},t.cs=function(e,{x:t,y:i},n=0){return new Pe(((t-n)*e.scale-e.x)*Cr,(i*e.scale-e.y)*Cr)},t.ct=Xh,t.cu=function(e,t,i=0){return L(((t.x-i)*e.scale-e.x)*Cr,(t.y*e.scale-e.y)*Cr,bc(t.z,t.y))},t.cv=te,t.cw=Tf,t.cx=function(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;for(const o of e)t=Math.min(t,o.x),i=Math.min(i,o.y),n=Math.max(n,o.x),r=M
vendor: 14,296 bytes, line 2
2ath.max(r,o.y);return{min:new Pe(t,i),max:new Pe(n,r)}},t.cy=lc,t.cz=Yh,t.d=class{constructor(e){this.cache=new Map,this.textures=new Map,this.textureAccessTimes=new Map,this.textureMemoryUsed=0,this.maxTextureMemory=1024*(e&&e.maxTextureMemoryMB?e.maxTextureMemoryMB:256)*1024,this.currentFrameAtlases=new Set,this.finalizationRegistry=new FinalizationRegistry(e=>{this.cache.delete(e),this.clearExpiredTextures()})}beginFrame(){this.currentFrameAtlases.clear()}calculateTextureMemory(e){return e.image?Math.ceil(e.image.width*e.image.height*4*(e.patternPositions.size>0?1.33:1)):0}evictTexture(e){const t=this.textures.get(e);if(t){const i=this.calculateTextureMemory(e);t.destroy(),this.textures.delete(e),this.textureAccessTimes.delete(e),this.textureMemoryUsed-=i,e.uploaded=!1}}evictTexturesIfNeeded(e){for(;this.textureMemoryUsed+e>this.maxTextureMemory&&this.textures.size>0;){let e=null,t=1/0;for(const[i]of this.textures.entries()){if(this.currentFrameAtlases.has(i))continue;const n=this.textureAccessTimes.get(i)||0;n<t&&(t=n,e=i)}if(!e)break;this.evictTexture(e)}}findCachedAtlas(e){const t=this.cache.get(e.hash);if(t){const i=t.deref();if(i&&i.contentDescriptor&&this.isMipmapCompatible(e,i.contentDescriptor))return i}for(const[,t]of this.cache.entries()){const i=t.deref();if(i&&i.contentDescriptor){const t=e.subsetOf(i.contentDescriptor),n=this.isMipmapCompatible(e,i.contentDescriptor);if(t&&n)return i}}}getTextureForAtlas(e,t,i){this.textureAccessTimes.set(e,performance.now()),this.currentFrameAtlases.add(e);let n=this.textures.get(e);if(n)return n;if(e.image){const r=this.calculateTextureMemory(e);return this.evictTexturesIfNeeded(r),n=new Mm(t,e.image,i,{useMipmap:!!e.patternPositions.size}),this.textures.set(e,n),this.textureMemoryUsed+=r,n}return null}clearExpiredTextures(){for(const[e]of this.textures.entries())if(!this.isAtlasCached(e)){const t=this.textures.get(e);if(t){const i=this.calculateTextureMemory(e);t.destroy(),this.textureMemoryUsed-=i}this.textures.delete(e),this.textureAccessTimes.delete(e)}}isAtlasCached(e){if(!e.contentDescriptor)return!1;const t=this.cache.get(e.contentDescriptor.hash);return!!t&&t.deref()===e}getOrCache(e){if(!("image"in e)){const t=this.cache.get(e.sourceAtlasHash);if(t){const e=t.deref();if(e)return e}return gt("ImageAtlasReference points to GC'd atlas - atlas may have been evicted"),null}if(!e.contentDescriptor)return e;const t=e.contentDescriptor,i=t.hash,n=this.cache.get(i);if(n){const e=n.deref();if(e&&e.contentDescriptor&&this.isMipmapCompatible(t,e.contentDescriptor))return e}return this.cache.set(i,new WeakRef(e)),this.finalizationRegistry.register(e,i,e),e}isMipmapCompatible(e,t){return!e.requiresMipMaps||t.requiresMipMaps}destroyTextures(){for(const e of this.textures.values())e&&e.destroy();this.textures.clear(),this.textureAccessTimes.clear(),this.textureMemoryUsed=0}clear(){for(const e of this.textures.values())e&&e.destroy();this.cache.clear(),this.textures.clear(),this.textureAccessTimes.clear(),this.textureMemoryUsed=0}},t.d$=e=>({u_cutoff_params:new rh(e)}),t.d0=_i,t.d1=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.d2=qs,t.d3=be,t.d4=Se,t.d5=Te,t.d6=Ce,t.d7=rt,t.d8=oe,t.d9=.55,t.dA=ui,t.dB=$m,t.dC=Gm,t.dD=Na,t.dE=qt,t.dF=nn,t.dG=pt,t.dH=function(e){const t=e.indexOf(xl);return t>=0?e.slice(0,t):e},t.dI=function(e){return e.includes(xl)},t.dJ=function(e){const t=e.lastIndexOf(xl);return t>=0?e.slice(t+1):""},t.dK=function(e,t={}){const i=t.type&&!t.array&&Array.isArray(e)?{type:t.type,"property-type":"data-constant"}:void 0;return Us(null===e||"object"!=typeof e||Array.isArray(e)?e:["literal",e],i)},t.dL=function(e){const t=[],i=e.id;return void 0===i&&t.push({message:`layers.${i}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${i}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},t.dM=function(e,t,i,n){return"custom"===e.type?new Ob(e,t):new EE[e.type](e,t,i,n)},t.dN=ft,t.dO=wl,t.dP=class extends iw{constructor(e,t){super(e._vectorTileFeature,e._z,e._x,e._y,e.id),e.state&&(this.state={...e.state}),this.target=t.target,this.namespace=t.namespace,t.properties&&(this.properties=t.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=e.source,this.sourceLayer=e.sourceLayer,this.layer=e.layer)}toJSON(){const e=super.toJSON();return e.target=this.target,e.namespace=this.namespace,e}},t.dQ=Ua,t.dR=rE,t.dS=im,t.dT=function(){return{API_URL:jt.API_URL,DRACO_URL:jt.DRACO_URL,MESHOPT_URL:jt.MESHOPT_URL,MESHOPT_SIMD_URL:jt.MESHOPT_SIMD_URL,BUILDING_GEN_URL:jt.BUILDING_GEN_URL}},t.dU=function(e,t){return[Math.pow(e[0],2.2)*t,Math.pow(e[1],2.2)*t,Math.pow(e[2],2.2)*t]},t.dV=V,t.dW=F,t.dX=At,t.dY=q,t.dZ=jT,t.d_=GT,t.da=Sw,t.db=Mw,t.dc=rd,t.dd=Jp,t.de=Zp,t.df=d,t.dg=Wd,t.dh=.9,t.di=em,t.dj=function(e,t,i,n,r,o,s){const a=Ew(e,t,i,n,r,o,s);return"globe"===o.name&&i||(a[2]=a[6]=a[10]=a[14]=0),a},t.dk=function(e,t,i,n,r,o,s){if(i){if("globe"===o.name){const a=Ew(e,t,i,n,r,o,s);return p(a,a),m(a,e,a),a}{const t=u(e),[i,o,a,l]=s,[c,h,d,f,p,m,_,g]=t;return t[0]=i*c+o*p,t[1]=i*h+o*m,t[2]=i*d+o*_,t[3]=i*f+o*g,t[4]=a*c+l*p,t[5]=a*h+l*m,t[6]=a*d+l*_,t[7]=a*f+l*g,n||x(t,t,-r.angle),t}}return r.glCoordMatrix},t.dl=af,t.dm=zp,t.dn=Hp,t.dp=Gp,t.dq=$p,t.dr=re,t.ds=sf,t.dt=Xd,t.du=Jd,t.dv=function(e,[t,i]){let n=0,r=0;if(i===lf){t<0&&(t=0);const i=t/cf;switch(e){case"top-right":case"top-left":r=i-7;break;case"bottom-right":case"bottom-left":r=7-i;break;case"bottom":r=7-t;break;case"top":r=t-7}switch(e){case"top-right":case"bottom-right":n=-i;break;case"top-left":case"bottom-left":n=i;break;case"left":n=t;break;case"right":n=-t}}else{switch(t=Math.abs(t),i=Math.abs(i),e){case"top-right":case"top-left":case"top":r=i-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-i}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}}return[n,r]},t.dw=function(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"},t.dx=OS,t.dy=tm,t.dz=function(e){return e({pluginStatus:ka,pluginURL:Ba}),Ua.on("pluginStateChange",e),e},t.e=Vt,t.e$=Ci,t.e0=e=>({u_light_matrix_0:new sh(e),u_light_matrix_1:new sh(e),u_fade_range:new th(e),u_shadow_normal_offset:new ih(e),u_shadow_intensity:new eh(e),u_shadow_texel_size:new eh(e),u_shadow_map_resolution:new eh(e),u_shadow_direction:new ih(e),u_shadow_bias:new ih(e),u_shadowmap_0:new Qu(e),u_shadowmap_1:new Qu(e)}),t.e1=function(e,t,i){return t.name===i.projection.name?e.projMatrix:Qp(i,t,e)},t.e2=Ew,t.e3=Fw,t.e4=Iw,t.e5=a_,t.e6=function(e,t,i,n,r,o,s,a,l,c,u=1){const h=i.transform,d=n?e.textSizeData:e.iconSizeData,f=af(d,i.transform.zoom,u),p="globe"===h.projection.name,m=(()=>{if(!p)return null;const e=Jf(h.zoom);return 0===e?null:{t:e,invMatrix:h.projection.createInversionMatrix(h,c.canonical),mercCenter:[dr(h.center.lng),fr(h.center.lat)]}})(),_=[256/i.width*2+1,256/i.height*2+1],g=n?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;g.clear();let y=null;p&&(y=n?e.text.globeExtVertexArray:e.icon.globeExtVertexArray);const v=e.lineVertexArray,x=n?e.text.placedSymbolArray:e.icon.placedSymbolArray,b=i.transform.width/i.transform.height;let w,T=!1;for(let u=0;u<x.length;u++){const p=x.get(u),{numGlyphs:E,writingMode:S}=p;if(S!==Xd.vertical||T||w===Xd.horizontal||(T=!0),w=S,(p.hidden||S===Xd.vertical)&&!T){Fw(E,g);continue}T=!1;const I=new Pe(p.tileAnchorX,p.tileAnchorY),A="road"===e.elevationType,M=!!h.elevation||A;let{x:C,y:D,z:P}=h.projection.projectTilePoint(I.x,I.y,c.canonical);if(m){const[e,t,i]=Pw(I,c.canonical,m);C+=(e-C)*m.t,D+=(t-D)*m.t,P+=(i-P)*m.t}let R=null;if(M){R=A&&e.hdExt?e.hdExt.makeRoadSymbolElevationParams(e,n?e.text:e.icon,u,c,l,h.elevation,h.projection,h.center.lat,h.worldSize):{getElevation:l,elevation:h.elevation,elevationFeature:null};const[t,i,r]=R.getElevation(I,h.elevation,R.elevationFeature);C+=t,D+=i,P+=r}const L=[C,D,P,1];if(le(L,L,t),!Aw(L,_)){Fw(E,g);continue}const z=L[3],F=Iw(i.transform.getCameraToCenterDistance(h.projection),z),O=sf(d,f,p),k=s?O/F:O*F,B=Sw(C,D,P,r);if(B[3]<=0){Fw(E,g);continue}let N={};const V=Je(e.layers[0].layout.get("text-max-angle")),U=Math.cos(V),j=s?null:R,G=Dw(p,k,!1,a,t,r,o,e.glyphOffsetArray,v,g,y,B,I,N,b,j,h.projection,c,s,U,m);T=G.useVertical,j&&G.needsFlipping&&(N={}),(G.notEnoughRoom||T||G.needsFlipping&&Dw(p,k,!0,a,t,r,o,e.glyphOffsetArray,v,g,y,B,I,N,b,j,h.projection,c,s,U,m).notEnoughRoom)&&Fw(E,g)}n?(e.text.dynamicLayoutVertexBuffer.updateData(g),y&&e.text.globeExtVertexBuffer&&e.text.globeExtVertexBuffer.updateData(y)):(e.icon.dynamicLayoutVertexBuffer.updateData(g),y&&e.icon.globeExtVertexBuffer&&e.icon.globeExtVertexBuffer.updateData(y))},t.e7=Cm,t.e8=Ix,t.e9=(e,t,i,n,r,o)=>{const s=e.transform,a="globe"===s.projection.name;let l;if("map"===o.paint.get("circle-pitch-alignment"))if(a){const e=Yf(s.zoom,t.canonical)*s._pixelsPerMercatorPixel;l=Float32Array.from([e,0,0,e])}else l=s.calculatePixelsToTileUnitsMatrix(i);else l=new Float32Array([s.pixelsToGLUnits[0],0,0,s.pixelsToGLUnits[1]]);const c={u_camera_to_center_distance:e.transform.getCameraToCenterDistance(s.projection),u_matrix:e.translatePosMatrix(t.projMatrix,i,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_device_pixel_ratio:Vt.devicePixelRatio,u_extrude_scale:l,u_inv_rot_matrix:Sx,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:o.paint.get("circle-emissive-strength")};if(a){c.u_inv_rot_matrix=n,c.u_merc_center=r,c.u_tile_id=[t.canonical.x,t.canonical.y,1<<t.canonical.z],c.u_zoom_transition=Jf(s.zoom);const e=r[0]*Cr,i=r[1]*Cr;c.u_up_dir=s.projection.upVector(new rp(0,0,0),e,i)}return c},t.eA=$T,t.eB=Lp,t.eC=De,t.eD=function(){return!!document.fullscreenElement||!!document.webkitFullscreenElement},t.eE=tt,t.eF=Sc,t.eG=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e},t.eH=ie,t.eI=yc,t.eJ=pc,t.eK=W,t.eL=Pf,t.eM=$,t.eN=z,t.eO=function([e,t,i]){const n=Math.hypot(e,t,i),r=Math.atan2(e,i),o=.5*Math.PI-Math.acos(-t/n);return new gc(Ke(r),Ke(o))},t.eP=j,t.eQ=ae,t.eR=yy,t.eS=jt,t.eT=wi,t.eU=bi,t.eV=kw,t.eW=class{constructor(e,t,i){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const e=function(){let e="";for(let t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",xi,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}async transformRequest(e,t,i){if(!this._transformRequestFn)return{url:e};const n=i?{signal:i}:{};return await this._transformRequestFn(e,t,n)||{url:e}}normalizeStyleURL(e,t){if(!ni(e))return e;const n=Pi(e);return n.params.push(`sdk=js-${i}`),n.path=`/styles/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||t)}normalizeGlyphsURL(e,t){if(!ni(e))return e;const i=Pi(e);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeModelURL(e,t){if(!ni(e))return e;const i=Pi(e);return i.path=`/models/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeSourceURL(e,t,i,n){if(!ni(e))return e;const r=Pi(e);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),i&&r.params.push(`language=${i}`),n&&r.params.push(`worldview=${n}`),this._makeAPIURL(r,this._customAccessToken||t)}normalizeIconsetURL(e,t){const i=Pi(e);return ni(e)?(i.path=`/styles/v1${i.path}/iconset.pbf`,this._makeAPIURL(i,this._customAccessToken||t)):Ri(i)}normalizeSpriteURL(e,t,i,n){const r=Pi(e);return ni(e)?(r.path=`/styles/v1${r.path}/sprite${t}${i}`,this._makeAPIURL(r,this._customAccessToken||n)):(r.path+=`${t}${i}`,Ri(r))}normalizeTileURL(e,t,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!ni(e))return e;const n=Pi(e);n.path=n.path.replace(Ei,(t||i&&"raster"!==n.authority&&512===i?"@2x":"")+".webp"),"raster"===n.authority?n.path=`/${jt.RASTER_URL_PREFIX}${n.path}`:"rasterarrays"===n.authority?n.path=`/${jt.RASTERARRAYS_URL_PREFIX}${n.path}`:"3dtiles"===n.authority?n.path=`/${jt.TILES3D_URL_PREFIX}${n.path}`:(n.path=n.path.replace(Si,"/"),n.path=`/${jt.TILE_URL_VERSION}${n.path}`);const r=this._customAccessToken||function(e){for(const t of e){const e=t.match(Mi);if(e)return e[1]}return null}(n.params)||jt.ACCESS_TOKEN;return jt.REQUIRE_ACCESS_TOKEN&&r&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,r)}canonicalizeTileURL(e,t){const i=Pi(e);if(!Ai.test(i.path)||!Ii.test(i.path))return e;let n="mapbox://";i.path.startsWith("/raster/v1/")?n+=`raster/${i.path.replace(`/${jt.RASTER_URL_PREFIX}/`,"")}`:i.path.startsWith("/rasterarrays/v1/")?n+=`rasterarrays/${i.path.replace(`/${jt.RASTERARRAYS_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${jt.TILE_URL_VERSION}/`,"")}`;let r=i.params;return t&&(r=r.filter(e=>!e.match(Mi))),r.length&&(n+=`?${r.join("&")}`),n}canonicalizeTileset(e,t){const i=!!t&&ni(t),n=[];for(const t of e.tiles||[])ii(t)?n.push(this.canonicalizeTileURL(t,i)):n.push(t);return n}_makeAPIURL(e,t){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",n=Pi(jt.API_URL);if(e.protocol=n.protocol,e.authority=n.authority,"http"===e.protocol){const t=e.params.indexOf("secure");t>=0&&e.params.splice(t,1)}if("/"!==n.path&&(e.path=`${n.path}${e.path}`),!jt.REQUIRE_ACCESS_TOKEN)return Ri(e);if(t=t||jt.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===t[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return e.params=e.params.filter(e=>!e.includes("access_token")),e.params.push(`access_token=${t||""}`),Ri(e)}},t.eX=zi,t.eY=function(e,t){t?tn.add(e):tn.delete(e)},t.eZ=Ki,t.e_=en,t.ea=rb,t.eb=(e,t,i,n,r,o,s,a,l,c)=>{const u=e.transform,h=u.pitch<15?fn(.07,.7,it((14-u.zoom)/5,0,1)):.07,d="none"===i.paint.get("line-trim-color-use-theme").
vendor: 13,709 bytes, line 2
2constantOr("default");return{u_matrix:nb(e,t,i,n),u_texsize:t.imageAtlasTexture?t.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:u.calculatePixelsToTileUnitsMatrix(t),u_device_pixel_ratio:r,u_width_scale:o,u_floor_width_scale:s,u_image:0,u_tile_units_to_pixels:ib(t,u),u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:a,u_trim_fade_range:i.paint.get("line-trim-fade-range"),u_trim_gradient_mix_range:[1,1],u_trim_color:i.paint.get("line-trim-color").toPremultipliedRenderColor(d?null:i.lut).toArray01(),u_zbias_factor:h,u_tile_to_meter:Ic(t.tileID.canonical,0),u_ground_shadow_factor:l,u_pattern_transition:c,u_opacity_multiplier:1}},t.ec=(e,t,i,n,r,o,s,a,l,c)=>{const u=e.transform,h=u.calculatePixelsToTileUnitsMatrix(t),d="none"===i.paint.get("line-trim-color-use-theme").constantOr("default"),f=u.pitch<15?fn(.07,.7,it((14-u.zoom)/5,0,1)):.07;return{u_matrix:nb(e,t,i,n),u_pixels_to_tile_units:h,u_device_pixel_ratio:o,u_width_scale:s,u_floor_width_scale:a,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_border_gradient_image:2,u_image_height:r,u_texsize:ob(i)&&t.lineAtlasTexture?t.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:ib(t,e.transform),u_alpha_discard_threshold:0,u_trim_offset:l,u_trim_fade_range:i.paint.get("line-trim-fade-range"),u_trim_gradient_mix_range:[1,1],u_trim_color:i.paint.get("line-trim-color").toPremultipliedRenderColor(d?null:i.lut).toArray01(),u_zbias_factor:f,u_road_view_depth_bias:0,u_road_clip_to_view:[0,0,0,0],u_tile_to_meter:Ic(t.tileID.canonical,0),u_ground_shadow_factor:c,u_opacity_multiplier:1}},t.ed=ct,t.ee=Ox,t.ef=5,t.eg=Sb,t.eh=Kc,t.ei=function(e,t){var i=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=i,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},t.ej=function(e,t){var i=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=i,e[7]=0,e[8]=0,e[9]=-i,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},t.ek=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},t.el=s,t.em=mu,t.en=1,t.eo=hw,t.ep=0,t.eq=_u,t.er=function(e,t,i,n,r){return it((e-t)/(i-t)*(r-n)+n,n,r)},t.es=R,t.et=fe,t.eu=function(e,t){var i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*s-a*c,d=-u*o+a*l,f=c*o-s*l,p=i*h+n*d+r*f;return p?(e[0]=h*(p=1/p),e[1]=(-u*n+r*c)*p,e[2]=(a*n-r*s)*p,e[3]=d*p,e[4]=(u*i-r*l)*p,e[5]=(-a*i+r*o)*p,e[6]=f*p,e[7]=(-c*i+n*l)*p,e[8]=(s*i-n*o)*p,e):null},t.ev=su,t.ew=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new Pe(1/0,1/0),max:new Pe(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(e,t=!1){const i=Np(new Pe(0,0),new Pe(Cr,Cr),e),n=[];if(t&&!kp(i,this._globalClipBounds))return n;for(const t of this._activeRegions){if(t.hiddenByOverlap)continue;if(!kp(i,t))continue;const r=Vp(t.min,t.max,e);n.push({min:r.min,max:r.max,sourceId:this._sourceIds[t.priority],footprint:t.footprint,footprintTileId:t.tileId,order:t.order,clipMask:t.clipMask,clipScope:t.clipScope})}return n}setSources(e){this._setSources(e.map(e=>({getSourceId:()=>e.cache.id,getFootprints:()=>{const t=[];for(const i of e.cache.getVisibleCoordinates()){const n=e.cache.getTile(i).buckets[e.layer];n&&n.updateFootprints(i.toUnwrapped(),t)}return t},getOrder:()=>e.order,getClipMask:()=>e.clipMask,getClipScope:()=>e.clipScope})))}_addSource(e){const t=e.getFootprints();if(0===t.length)return;const i=e.getOrder(),n=e.getClipMask(),r=e.getClipScope();for(const e of t){if(!e.footprint)continue;const t=Np(e.footprint.min,e.footprint.max,e.id);this._activeRegions.push({min:t.min,max:t.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:e.id,footprint:e.footprint,order:i,clipMask:n,clipScope:r})}this._sourceIds.push(e.getSourceId())}_computeReplacement(){this._activeRegions.sort((e,t)=>e.priority-t.priority||Fp(e.min,t.min)||Fp(e.max,t.max)||e.order-t.order||e.clipMask-t.clipMask||function(e,t){const i=(e,t)=>e+t;return e.length-t.length||e.reduce(i,"").localeCompare(t.reduce(i,""))}(e.clipScope,t.clipScope));let e=this._activeRegions.length!==this._prevRegions.length;if(!e){let t=0;for(;!e&&t!==this._activeRegions.length;){const i=this._activeRegions[t],n=this._prevRegions[t];e=i.priority!==n.priority||!Op(i,n)||i.order!==n.order||i.clipMask!==n.clipMask||!Re(i.clipScope,n.clipScope),this._activeRegions[t].hiddenByOverlap=n.hiddenByOverlap,++t}}if(e){++this._updateTime;for(const e of this._activeRegions)e.order!==Rp&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,e.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,e.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,e.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,e.max.y));const e=e=>{const t=this._activeRegions;if(e>=t.length)return e;const i=t[e].priority;for(;e<t.length&&t[e].priority===i;)++e;return e};if(this._sourceIds.length>1){let t=0,i=e(t);for(;t!==i;){let n=t;const r=t;for(;n!==i;){const e=this._activeRegions[n];e.hiddenByOverlap=!1;for(let t=0;t<r;t++){const i=this._activeRegions[t];if(!i.hiddenByOverlap&&e.order===Rp&&kp(e,i)&&(e.hiddenByOverlap=jp(e.footprint,e.tileId,i.footprint,i.tileId),e.hiddenByOverlap))break}++n}t=i,i=e(t)}}}}_setSources(e){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let t=e.length-1;t>=0;t--)this._addSource(e[t]);this._computeReplacement()}},t.ex=Rp,t.ey=class{constructor(e){this._createGrid(e),this._createPoles(e)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const e of this._poleSegments)e.destroy();for(const e of this._gridSegments)e.withSkirts.destroy(),e.withoutSkirts.destroy()}_fillGridMeshWithLods(e,t){const i=new Gc,n=new hu,r=[],o=e+1+2,s=t[0]+1,a=t[0]+1+(1+t.length),l=(e,t,i)=>{let n=e===o-1?e-2:0===e?e:e-1;return n+=i?24575:0,[n,t]};for(let e=0;e<o;++e)i.emplaceBack(...l(e,0,!0));for(let e=0;e<s;++e)for(let t=0;t<o;++t)i.emplaceBack(...l(t,e,(0===t||t===o-1)&&!0));for(let e=0;e<t.length;++e){const n=t[e];for(let e=0;e<o;++e)i.emplaceBack(...l(e,n,!0))}for(let e=0;e<t.length;++e){const s=n.length,l=t[e]+1+2,c=new hu;for(let i=0;i<l-1;i++){const r=i===l-2,s=r?o*(a-t.length+e-i):o;for(let e=0;e<o-1;e++){const t=i*o+e;0===i||r||0===e||e===o-2?(c.emplaceBack(t+1,t,t+s),c.emplaceBack(t+s,t+s+1,t+1)):(n.emplaceBack(t+1,t,t+s),n.emplaceBack(t+s,t+s+1,t+1))}}const u=Gu.simpleSegment(0,s,i.length,n.length-s);for(let e=0;e<c.uint16.length;e+=3)n.emplaceBack(c.uint16[e],c.uint16[e+1],c.uint16[e+2]);const h=Gu.simpleSegment(0,s,i.length,n.length-s);r.push({withoutSkirts:u,withSkirts:h})}return{vertices:i,indices:n,segments:r}}_createGrid(e){const t=this._fillGridMeshWithLods(cc,uc);this._gridSegments=t.segments,this._gridBuffer=e.createVertexBuffer(t.vertices,bf.members),this._gridIndexBuffer=e.createIndexBuffer(t.indices,!0)}_createPoles(e){const t=new hu;for(let e=0;e<=cc;e++)t.emplaceBack(0,e+1,e+2);this._poleIndexBuffer=e.createIndexBuffer(t,!0);const i=new mu,n=new mu,r=new mu,o=new mu;this._poleSegments=[];for(let e=0,t=0;e<6;e++){const s=360/(1<<e);i.emplaceBack(0,-lc,0,.5,0),n.emplaceBack(0,-lc,0,.5,1),r.emplaceBack(0,-lc,0,.5,.5),o.emplaceBack(0,-lc,0,.5,.5);for(let e=0;e<=cc;e++){let t=e/cc,a=0;const l=fn(0,s,t),[c,u,h]=fc(tp,ip,l,lc);i.emplaceBack(c,u,h,t,a),n.emplaceBack(c,u,h,t,1-a);const d=Je(l);t=.5+.5*Math.sin(d),a=.5+.5*Math.cos(d),r.emplaceBack(c,u,h,t,a),o.emplaceBack(c,u,h,t,1-a)}this._poleSegments.push(Gu.simpleSegment(t,0,66,64)),t+=66}this._poleNorthVertexBuffer=e.createVertexBuffer(i,vf,!1),this._poleSouthVertexBuffer=e.createVertexBuffer(n,vf,!1),this._texturedPoleNorthVertexBuffer=e.createVertexBuffer(r,vf,!1),this._texturedPoleSouthVertexBuffer=e.createVertexBuffer(o,vf,!1)}getGridBuffers(e,t){return[this._gridBuffer,this._gridIndexBuffer,t?this._gridSegments[e].withSkirts:this._gridSegments[e].withoutSkirts]}getPoleBuffers(e,t){return[t?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,t?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[e]]}},t.ez=function(e){return tn.has(e)},t.f=on,t.f$=Qd,t.f0=$i,t.f1=Zi,t.f2=Wi,t.f3=Xi,t.f4=function(e){tn.delete(e)},t.f5=Qi,t.f6=Gi,t.f7=function(e,t){Yt=e,Xt=t},t.f8=i,t.f9=Qf,t.fA=Qr,t.fB=function(e,t){const i=e.layers[0].layout.get("fill-elevation-reference"),n="hd-road-base"===i||"hd-road-markup"===i?i:null,r=!!t&&t.length>0&&Eg(t,e.layers[0].source,e.sourceLayerName);(n||r)&&(e.hdExt=new Sg(e,n,r))},t.fC=function(e,t){const i="hd-road-markup"===e.layers[0].layout.get("line-elevation-reference"),n=!!t&&t.length>0&&Eg(t,e.layers[0].source,e.sourceLayerName);(i||n)&&(e.hdExt=new Mg(i,n))},t.fD=Ed,t.fE=function(e){const t=e.layers[0];"circle"===t.type&&"hd-road-markup"===t.layout.get("circle-elevation-reference")&&(e.hdExt=new Cg)},t.fF=function(e){"hd-road-markup"===e.layers[0].layout.get("symbol-elevation-reference")&&(e.hdExt=new Pg)},t.fG=xE,t.fH=function(e){let t=0;if(new Uint32Array(e,0,1)[0]!==Xg){const i=new Uint32Array(e,0,7),[,,n,r,o,s]=i;t=i.byteLength+r+o+s+o,(n!==e.byteLength||t>=e.byteLength)&>("Invalid b3dm header information.")}return iy(e,t)},t.fI=function(e,t){const i=Jy(e);for(const e of i){if(!e.meshBVH)for(const t of e.meshes)Ky(t);if(e.lights){let i=65535;for(const t of e.meshes)void 0!==t.doorVertexColor&&(i=t.doorVertexColor,e.lightsStyleAabb=t.aabb);e.lightMeshIndex=e.meshes.length,e.meshes.push(ev(e.lights,t,i))}}return i},t.fJ=Ic,t.fK=Xb,t.fL=Ys,t.fM=function(e,t){let i="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n+1)||null,o=e.charCodeAt(n-1)||null;i+=!t&&(r&&Pa(r)&&!ef[e[n+1]]||o&&Pa(o)&&!ef[e[n-1]])||!ef[e[n]]?e[n]:ef[e[n]]}return i},t.fN=$a,t.fO=function(e){return!(e<11904||!(ha(e)||ua(e)||Ea(e)||ba(e)||ma(e)||ra(e)||da(e)||aa(e)||_a(e)||ga(e)||pa(e)||Aa(e)||la(e)||sa(e)||oa(e)||fa(e)||ca(e)||Ta(e)||va(e)||ya(e)))},t.fP=Da,t.fQ=function(e){return ta(e)||ia(e)||na(e)||wa(e)||Ia(e)},t.fR=function(e){return 12307===e||12312===e||12313===e||12316===e||12448===e||12540===e||e>=8592&&e<=8595||8208===e||8229===e||8741===e||e>=9472&&e<=9547||65294===e||65309===e||65374===e||65507===e},t.fS=3,t.fT=Mr,t.fU=qh,t.fV=pd,t.fW=function(e){for(const t of e)if(!Ca(t.charCodeAt(0)))return!1;return!0},t.fX=Ma,t.fY=mf,t.fZ=Kd,t.f_=_f,t.fa=Ke,t.fb=Kf,t.fc=function(e){const t=[0,0,0],i=d(new Float64Array(16));return m(i,e.pixelMatrix,e.globeMatrix),X(t,t,i),new Pe(t[0],t[1])},t.fd=function(e){Bi=e},t.fe=ri,t.ff=bw,t.fg=function(e,t){if(!e||!t)throw new Error("TileProvider name and URL are required");jt.TILE_PROVIDER_URLS[e]=Vt.resolveURL(t)},t.fh=function(e){"string"!=typeof e||e.length>64||!ki.test(e)?gt(`Invalid SDK info "${e}"; expected a "Name/version" string. Ignoring.`):Oi=e},t.fi=ja,t.fj=function(e,t,i=!1){if(ka===Fa.deferred||ka===Fa.loading||ka===Fa.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ba=Vt.resolveURL(e),ka=Fa.deferred,Oa=t,Va(),i||Ga()},t.fk=function(e){jt.BUILDING_GEN_URL=Vt.resolveURL(e)},t.fl=Ht,t.fm=function(e){const t=Vt.resolveURL(e);jt.MESHOPT_URL=t,jt.MESHOPT_SIMD_URL=t},t.fn=$t,t.fo=function(e){jt.DRACO_URL=Vt.resolveURL(e)},t.fp=Gt,t.fq=function(e){const t=Qt();if(!t)return;const i=t.delete(Wt);e&&i.then(()=>e()).catch(e)},t.fr=function(e){jt.MAX_PARALLEL_IMAGE_REQUESTS=e},t.fs=function(e){jt.API_URL=e},t.ft=function(e){jt.ACCESS_TOKEN=e},t.fu="hd_road_elevation",t.fv=class{static parseFrom(e,t){const i=w_.parse(e);if(!i)return[];let{vertices:n,features:r}=i;const o=1/Ic(t);r.sort((e,t)=>e.id-t.id),n.sort((e,t)=>e.id-t.id||e.idx-t.idx),n=n.filter((e,t,i)=>t===i.findIndex(t=>t.id===e.id&&t.idx===e.idx));const s=new Array;let a=0;const l=n.length;for(const e of r){if(e.constantHeight){s.push(new C_(e.id,e.bounds,e.constantHeight));continue}for(;a!==l&&n[a].id<e.id;)a++;if(a===l||n[a].id!==e.id)continue;const t=new Array,i=new Array,r=a;for(;a!==l&&n[a].id===e.id;){const e=n[a];if(t.push({position:e.position,height:e.height,extent:e.extent,index:e.idx}),a!==r&&n[a-1].idx===e.idx-1){const e=a-r;i.push({a:e-1,b:e})}a++}s.push(new C_(e.id,e.bounds,void 0,t,i,o))}return s}},t.fw=m_,t.fx=vx,t.fy=Tg,t.fz=$e,t.g=mi,t.g0=Pm,t.g1=1,t.g2=df,t.g3=ff,t.g4=Ne,t.g5=of,t.g6=Zm,t.g7=gf,t.g8=function(e,t){const i=e.stretchY||[[0,e.paddedRect.h-2]];return e.stretchX||e.stretchY?Ym(e.stretchX||[[0,e.paddedRect.w-2]])*Ym(i):1},t.g9=Qm,t.ga=ud,t.gb=2,t.gc=ew,t.gd=fd,t.ge=Eg,t.gf=function(e,t){const i=Tg(e);return null!==i&&!!(t&1<<i)},t.gg=dt,t.gh=Rm,t.gi=Sm,t.gj=Lm,t.gk=zm,t.gl=kh,t.gm=function(e){return e<=1?1:Math.pow(2,Math.floor(Math.log2(e)))},t.gn=jE,t.go=Lh,t.gp=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){const e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}
vendor: 4,405 bytes, line 2
2writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*rm),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*rm),!0),this.pos+=8}writeVarint(e){if((e=+e||0)>=0&&e<128)return this.pos>=this.length&&this.realloc(1),void(this.buf[this.pos++]=e);e>268435455||e<0?function(e,t){let i,n;if(e>=0?(i=e%4294967296|0,n=e/4294967296|0):(i=~(-e%4294967296),n=~(-e/4294967296),4294967295^i?i=i+1|0:(i=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,i.buf[i.pos]=127&(e>>>=7)}(i,0,t),function(e,t){const i=(7&e)<<4;t.buf[t.pos++]|=i|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;const t=this.pos;this.pos=function(e,t,i){for(let n,r,o=0;o<t.length;o++){if(n=t.charCodeAt(o),n>55295&&n<57344){if(!r){n>56319||o+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):r=n;continue}if(n<56320){e[i++]=239,e[i++]=191,e[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(e[i++]=239,e[i++]=191,e[i++]=189,r=null);n<128?e[i++]=n:(n<2048?e[i++]=n>>6|192:(n<65536?e[i++]=n>>12|224:(e[i++]=n>>18|240,e[i++]=n>>12&63|128),e[i++]=n>>6&63|128),e[i++]=63&n|128)}return i}(this.buf,e,this.pos);const i=this.pos-t;i>=128&&lm(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t),this.buf.set(e,this.pos),this.pos+=t}writeRawMessage(e,t){this.pos++;const i=this.pos;e(t,this);const n=this.pos-i;n>=128&&lm(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n}writeMessage(e,t,i){this.writeTag(e,2),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,cm,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,um,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,fm,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,hm,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,dm,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,pm,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,mm,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,_m,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,gm,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}},t.gq=bt,t.gr=Pp,t.gs=Fa,t.gt=TE,t.gu=function(e){ei(),null!=Kt&&Kt.then(t=>{t.keys().then(i=>{for(let n=0;n<i.length-e;n++)t.delete(i[n]).catch(e=>gt(e.message))}).catch(e=>gt(e.message))}).catch(e=>gt(e.message))},t.h=rn,t.i=jn,t.j=2,t.k=Dm,t.l=tr,t.m=bl,t.n=er,t.o=Nt,t.p=xm,t.q=nr,t.r=Ds,t.s=rl,t.t=As,t.u=ol,t.v=Cs,t.w=gt,t.x=Vs,t.y=sl,t.z=$s}),n(["require","./shared"],function(e,t){function i(e){const t=e?e.url.toString():void 0;return t?performance.getEntriesByName(t):[]}function n(e,i){if(Object.hasOwn(e.layers,t.fu))return t.fv.parseFrom(e.layers[t.fu],i)}function r({buckets:e,data:i,sourceLayerCoder:n,canonical:r,options:o}
vendor: 4,318 bytes, line 2
2){if(!o.elevationFeatures||0===o.elevationFeatures.length)return;const s=[];for(const i of Object.values(e))if(i instanceof t.bB&&i.hdExt){const e=i.hdExt.getUnevaluatedPortalGraph();e&&s.push(e)}const a=t.fw.evaluate(s);for(const s of Object.values(e))if(s instanceof t.bB&&s.hdExt){const e=i.layers[n.decode(s.sourceLayerIndex)];s.hdExt.setEvaluatedPortalGraph(a,e,r,o.availableImages,o.brightness,s.worldview)}}function o(e){const i=[];for(let n=0;n<e.length;n++){const r=e.feature(n),o=r.properties.frc_mask;if(null==o)continue;const s=Number(o);if(!s)continue;const a=r.loadGeometry();if(a.length>0){let e=!1;for(const i of a[0])if(i.x<0||i.x>t.a6||i.y<0||i.y>t.a6){e=!0;break}if(e)continue}const l=1===a.length&&5===a[0].length&&a[0].some(e=>e.x<=0&&e.y<=0)&&a[0].some(e=>e.x>=t.a6&&e.y<=0)&&a[0].some(e=>e.x>=t.a6&&e.y>=t.a6)&&a[0].some(e=>e.x<=0&&e.y>=t.a6);i.push(new t.fx(s,l?[]:a))}return i}function s(e,i,n,r,o){const s=t.fy(i);if(null===s)return!1;let a=n.x,l=n.y;const c=o??r.z;if(r.z!==c){const e=1<<r.z-c,i=t.a6/e;a=r.x%e*i+n.x/e,l=r.y%e*i+n.y/e}for(const i of e){if(!(i.hasGeometry()&&i.frcMask&1<<s))continue;const e=i.rings.map(e=>e.map(e=>[e.x,e.y]));if(t.fz([a,l],e))return!0}return!1}function a(e,i,n,r){const o=i.indoorState.activeFloorsVisible;if(!i.sourceLayers)return o?i.indoorState.activeFloors:void 0;const s=function(e,i){if(!e)return t.w("No source layers defined in indoor specification"),i;if(0===e.size)return i;const n=e.difference(i);for(const e of n)t.w(`Missing source layer required in indoor specification: ${e}`);return i.intersection(i)}(i.sourceLayers,new Set(Object.keys(e.layers))),a=i.indoorState,d=function(e,i,n,r,o){const s={};for(const n of i){const i=e.layers[n];if(i)for(let e=0;e<i.length;e++){const t=i.feature(e);if(f(t)){const{id:e,center:i}=u(t);l(s,e,i);continue}if(p(t)){const e=h(t,o);c(s,e.buildings,e.id,e)}}else t.w(`indoor source layer not found: ${n}`)}return{buildings:s,activeFloors:t.aX.calculate(s,r,n)}}(e,s,a.activeFloors,a.selectedFloorId,r);return n.notify("setIndoorData",d),o?d.activeFloors:void 0}function l(e,t,i){e[t]?i&&(e[t].center=i):e[t]={floorIds:new Set,center:i||[0,0],floors:{}}}function c(e,t,i,n){for(const r of t)l(e,r),e[r].floors[i]=n,e[r].floorIds.add(i)}function u(e){return{id:e.properties.id.toString(),center:[e.properties.center_lon||0,e.properties.center_lat||0]}}function h(e,i){const n=e.properties.id.toString(),r=!!e.properties.is_default&&e.properties.is_default,o=e.properties.connected_floor_ids?new Set(e.properties.connected_floor_ids.toString().split(";")):new Set,s=e.properties.conflicted_floor_ids?new Set(e.properties.conflicted_floor_ids.toString().split(";")):new Set,a=e.properties.structure_ids?new Set(e.properties.structure_ids.toString().split(";")):new Set,l=e.properties.name.toString(),c=e.properties.z_index,u=function(e,i){const n=e.loadGeometry();if(!n||0===n.length)return;const r=n.map(n=>n.map(n=>t.fA(n,i,e.extent)));return 0===r.length?void 0:{type:"Polygon",coordinates:[r[0]]}}(e,i);return{id:n,isDefault:r,connections:o,conflicts:s,buildings:a,name:l,zIndex:c,geometry:u}}function d(e,t){return t.every(t=>e.properties&&null!=e.properties[t])}function f(e){return d(e,["type","id","name"])&&"structure"===e.properties.type}function p(e){return d(e,["type","id","name","z_index"])&&"floor"===e.properties.type}function m(e,i){e instanceof t.bB?t.fB(e,i):e instanceof t.bA?t.fC(e,i):e instanceof t.fD?t.fE(e):e instanceof t.bv&&t.fF(e)}function _(e){for(const i in e){const n=e[i];if(n instanceof t.bA&&n.hdExt&&n.hdExt.hasDeferredElevationFeatures)return!0;if(n instanceof t.bv&&n.hdExt&&n.hdExt.hasDeferredElevationFeatures)return!0}return!1}class g{constructor(e,i,n){this.tileID=new t.bQ(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.tileZoom=e.tileZoom,this.uid=e.uid,this.zoom=e.zoom,this.canonical=e.tileID.canonical,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=e.projection,this.brightness=i,this.worldview=n}async parse(e,i,n){this.status="parsing";const r=new t.bQ(n.tileID.overscaledZ,n.tileID.wrap,n.tileID.canonical.z,n.tileID.canonical.x,n.tileID.canonical.y),o=[],s=i.familiesBySource[n.source],a=new t.fG(r,n.promoteId);
2a.bucketLayerIDs=[],a.is3DTile=!0;const l=await t.fH(e),c=l.json.extensionsUsed&&l.json.extensionsUsed.includes("MAPBOX_mesh_features")||l.json.asset.extras&&l.json.asset.extras.MAPBOX_mesh_features,u=l.json.extensionsUsed&&l.json.extensionsUsed.includes("EXT_meshopt_compression"),h=new t.aj(this.zoom,{brightness:this.brightness,worldview:this.worldview});for(const e in s)for(const i of s[e]){const e=i[0];a.bucketLayerIDs.push(i.map(e=>t.m(e.id,e.scope))),e.recalculate(h,[]);const s=t.fI(l,1/t.fJ(n.tileID.canonical)),d=new t.fK(i,s,r,c,u,this.brightness,a,this.worldview);o.push(d),d.evaluate(e)}return this.status="done",{buckets:o,featureIndex:a,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null}}}class y{constructor({actor:e,layerIndex:t,availableImages:i,availableModels:n,brightness:r,worldview:o}){this.actor=e,this.layerIndex=t,this.availableImages=i,this.availableModels=n,this.brightness=r,this.loading={},this.loaded={},this.worldview=o}async loadTile(e){const i=e.uid,n=new AbortController,r=this.loading[i]=new g(e,this.brightness,this.worldview);r.abort=()=>n.abort();const o=(e,t)=>{const i=r.reloadCallback;i&&(delete r.reloadCallback,i(e,t))};let s;try{s=(await t.d0(e.request,n.signal)).data}catch(e){if(delete this.loading[i],r.status="done",this.loaded[i]=r,n.signal.aborted)return null;throw e}if(delete this.loading[i],!s||0===s.byteLength)return r.status="done",this.loaded[i]=r,null;try{const t=await r.parse(s,this.layerIndex,e);return this.loaded[i]=r,o(null,t),t}catch(e){throw this.loaded[i]=r,o(e),e}}async reloadTile(e){const t=this.loaded&&this.loaded[e.uid];if(t)return t.projection=e.projection,t.brightness=e.brightness,"parsing"===t.status&&await new Promise((e,i)=>{t.reloadCallback=t=>{t?i(t):e()}}),this.loadTile(e)}abortTile(e){const t=e.uid,i=this.loading[t];i&&(i.abort&&i.abort(),delete this.loading[t])}removeTile(e){const t=this.loaded,i=e.uid;t&&t[i]&&delete t[i]}}function v(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(const i of e)t+=`${v(i)},`;return`${t}]`}let t="{";for(const i of Object.keys(e).sort())t+=`${i}:${v(e[i])},`;return`${t}}`}function x(e){let i="";for(const n of t.d1)i+=`/${v(e[n])}`;return i}function b(e,t){return function e(i){return"string"==typeof i&&i===t||(Array.isArray(i)?i.some(e):!(!i||"object"!=typeof i)&&Object.values(i).some(e))}(e)}class w{constructor(e){this.keyCache=Object.create(null),this._layers=Object.create(null),this._layerConfigs=Object.create(null),e&&this.replace(e)}replace(e,t){this._layerConfigs=Object.create(null),this._layers=Object.create(null),this.update(e,[],t)}update(e,i,n){this._options=n;for(const i of e)this._layerConfigs[i.id]=i,(this._layers[i.id]=t.dM(i,this.scope,null,this._options)).compileFilter(n),this.keyCache[i.id]&&delete this.keyCache[i.id];for(const e of i)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource=Object.create(null);const r=function(e,t){const i=Object.create(null);for(let n=0;n<e.length;n++){const r=e[n];let o=t&&t[r.id];
vendor: 11,240 bytes, line 2
2o||("symbol"===r.type?o=r.id:(o=x(r),"line"===r.type&&r.paint&&(b(r.paint["line-width"],"line-progress")&&(o+=`/${v(r.paint["line-width"])}`),b(r.paint["line-emissive-strength"],"line-progress")&&(o+=`/${v(r.paint["line-emissive-strength"])}`)))),t&&(t[r.id]=o);let s=i[o];s||(s=i[o]=[]),s.push(r)}const n=[];for(const e in i)n.push(i[e]);return n}(Object.values(this._layerConfigs),this.keyCache);for(const e of r){const t=e.map(e=>this._layers[e.id]),i=t[0];if("none"===i.visibility)continue;const n=i.source||"";let r=this.familiesBySource[n];r||(r=this.familiesBySource[n]=Object.create(null));const o=i.sourceLayer||"_geojsonTileLayer";let s=r[o];s||(s=r[o]=[]),s.push(t)}}}class T extends t.P{constructor(e,t,i,n,r){super(e,t),this.angle=n,this.z=i,void 0!==r&&(this.segment=r)}clone(){return new T(this.x,this.y,this.z,this.angle,this.segment)}}function E(e,t,i,n,r){if(void 0===t.segment)return!0;let o=t,s=t.segment+1,a=0;for(;a>-i/2;){if(s--,s<0)return!1;a-=e[s].dist(o),o=e[s]}a+=e[s].dist(e[s+1]),s++;const l=[];let c=0;for(;a<i/2;){const t=e[s],i=e[s+1];if(!i)return!1;let o=e[s-1].angleTo(t)-t.angleTo(i);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:o}),c+=o;a-l[0].distance>n;)c-=l.shift().angleDelta;if(c>r)return!1;s++,a+=t.dist(i)}return!0}function S(e){let t=0;for(let i=0;i<e.length-1;i++)t+=e[i].dist(e[i+1]);return t}function I(e,t,i){return e?.6*t*i:0}function A(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function M(e,i,n,r,o,s){const a=I(n,o,s),l=A(n,r)*s;let c=0;const u=S(e)/2;for(let n=0;n<e.length-1;n++){const r=e[n],o=e[n+1],s=r.dist(o);if(c+s>u){const h=(u-c)/s,d=t.am(r.x,o.x,h),f=t.am(r.y,o.y,h),p=new T(d,f,0,o.angleTo(r),n);return!a||E(e,p,l,a,i)?p:void 0}c+=s}}function C(e,t,i,n,r,o,s,a,l){const c=I(n,o,s),u=A(n,r),h=u*s,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),D(e,d?t/2*a%t:(u/2+2*o)*s*a%t,t,c,i,h,d,!1,l)}function D(e,i,n,r,o,s,a,l,c){const u=s/2,h=S(e);let d=0,f=i-n,p=[];for(let i=0;i<e.length-1;i++){const a=e[i],l=e[i+1],m=a.dist(l),_=l.angleTo(a);for(;f+n<d+m;){f+=n;const g=(f-d)/m,y=t.am(a.x,l.x,g),v=t.am(a.y,l.y,g);if(y>=0&&y<c&&v>=0&&v<c&&f-u>=0&&f+u<=h){const t=new T(y,v,0,_,i);r&&!E(e,t,s,r,o)||p.push(t)}}d+=m}return l||p.length||a||(p=D(e,d/2,n,r,o,s,a,!0,c)),p}t.fL(T,"Anchor");class P{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(e,t){const i=new P;return i.scale=e||1,i.fontStack=t,i}static forImage(e){const t=new P;return t.image=e,t}}class R{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t,i,n=1){const r=new R;for(let o=0;o<e.sections.length;o++){const s=e.sections[o];s.image?r.addImageSection(s,i,n):r.addTextSection(s,t)}return r}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCodePoint(e){return this.text.codePointAt(e)}verticalizePunctuation(e){this.text=t.fM(this.text,e)}trim(){let e=0;for(let t=0;t<this.text.length&&F[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let i=this.text.length-1;i>=0&&i>=e&&F[this.text.charCodeAt(i)];i--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const i=new R;return i.text=this.text.substring(e,t),i.sectionIndex=this.sectionIndex.slice(e,t),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,t)=>Math.max(e,this.sections[t].scale),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(P.forText(e.scale,e.fontStack||t));const i=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(i)}addImageSection(e,i,n=1){const r=e.image?e.image.getPrimary():null;if(!r)return void t.w("Can't add FormattedSection with an empty image.");r.scaleSelf(i*n);const o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCodePoint(o),this.sections.push(P.forImage(r)),this.sectionIndex.push(this.sections.length-1)):t.w("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function L(e,t){if(!e.image)return!1;const i=t.get(e.image.toString());return!!i&&i.sdf}function z(e,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_=1,g=1){const y=R.fromFeature(e,o,_,g);d===t.dt.vertical&&y.verticalizePunctuation(f);const v=y.toString();if(function(e,i){const n=e.sections.findIndex(e=>L(e,i));if(-1===n)return;t.w(`SDF image ${e.sections[n].image.id.name} is not supported in text-field`);const r=e.sections.map(e=>L(e,i));let o="";const s=[];for(let t=0;t<e.length();t++){const i=e.sectionIndex[t];r[i]||(o+=e.text[t],s.push(i))}e.text=o,e.sectionIndex=s}(y,r),0===y.length())return;let x=[];const b=function(e,i,n,r,o,s,a){if(!e)return[];const l=[],c=function(e,t,i,n,r,o,s){let a=0;for(let i=0;i<e.length();i++){const l=e.getSection(i);a+=k(e.getCodePoint(i),l,n,r,t,o,s)}return a/Math.max(1,Math.ceil(a/i))}(e,i,n,r,o,s,a),u=e.text.includes("â");let h=0;for(let n=0;n<e.length();n++){const d=e.getSection(n),f=e.getCodePoint(n);if(F[f]||(h+=k(f,d,r,o,i,s,a)),n<e.length()-1){const i=t.fO(f);(O[f]||i||d.image)&&l.push(V(n+1,h,c,l,N(f,e.getCodePoint(n+1),i&&u),!1))}}return U(V(e.length(),h,c,l,0,!0))}(y,u,s,i,r,p,g),{processBidirectionalText:w,processStyledBidirectionalText:T}=t.fN;if(w&&1===y.sections.length){const e=w(y.toString(),b);for(const t of e){const e=new R;e.text=t,e.sections=y.sections;for(let i=0;i<t.length;i++)e.sectionIndex.push(0);x.push(e)}}else if(T){const e=T(y.text,y.sectionIndex,b);for(const t of e){const e=new R;e.text=t[0],e.sectionIndex=t[1],e.sections=y.sections,x.push(e)}}else x=function(e,t){const i=[],n=e.text;let r=0;for(const n of t)i.push(e.substring(r,n)),r=n;return r<n.length&&i.push(e.substring(r,n.length)),i}(y,b);const E=[],S={positionedLines:E,text:v,top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:d,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(e,i,n,r,o,s,a,l,c,u,h,d,f){let p=0,m=0,_=0;const g="right"===l?1:"left"===l?0:.5;let y=!1;for(const e of o){const t=e.getSections();for(const e of t){if(e.image)continue;const t=i[e.fontStack];if(t&&(y=void 0!==t.ascender&&void 0!==t.descender,!y))break}if(!y)break}let v=0;for(const a of o){a.trim();const o=a.getMaxScale(),l=(o-1)*t.dg,x={positionedGlyphs:[],lineOffset:0};e.positionedLines[v]=x;const b=x.positionedGlyphs;let w=0;if(!a.length()){m+=s,++v;continue}let T=0,E=0;for(let s=0;s<a.length();s++){const l=a.getSection(s),_=a.getSectionIndex(s),g=a.getCodePoint(s);let v=l.scale,x=null,S=null,I=null,A=t.dg,M=0,C=c;C===t.dt.vertical&&t.fR(g)&&(C=t.dt.horizontal);const D=!(C===t.dt.horizontal||!h&&!t.fP(g)||h&&(F[g]||t.fQ(g)));if(l.image){const i=r.get(l.image.toString());if(!i)continue;I=l.image,e.iconsInText=!0,S=i.paddedRect;const n=i.displaySize,s=n[0]*f,a=n[1]*f;v=v*t.dg/d,x={width:s,height:a,left:0,top:-t.fS,advance:D?a:s,localGlyph:!1},M=y?-x.height*v:o*t.dg-17-a*v,A=x.advance;const c=(D?s:a)*v-t.dg*o;c>0&&c>w&&(w=c)}else{const e=n[l.fontStack];if(!e)continue;e[g]&&(S=e[g]);const r=i[l.fontStack];if(!r)continue;const s=r.glyphs[g];if(!s)continue;if(x=s.metrics,A=8203!==g?t.dg:0,y){const e=void 0!==r.ascender?Math.abs(r.ascender):0,t=void 0!==r.descender?Math.abs(r.descender):0,i=(e+t)*v;T<i&&(T=i,E=(e-t)/2*v),M=-e*v}else M=(o-v)*t.dg-17}b.push({glyph:g,image:I,x:p,y:m+M,vertical:D,scale:v,localGlyph:x.localGlyph,fontStack:l.fontStack,sectionIndex:_,metrics:x,rect:S}),D?(e.verticalizable=!0,p+=A*v+u):p+=x.advance*v+u}0!==b.length&&(_=Math.max(p-u,_),y?j(b,g,w,E,s*o/2):j(b,g,w,0,s/2)),p=0;const S=s*o+w;x.lineOffset=Math.max(w,l),m+=S,++v}const x=m,{horizontalAlign:b,verticalAlign:w}=t.du(a);(function(e,t,i,n,r,o){const s=(t-i)*r,a=-o*n;for(const t of e)for(const e of t.positionedGlyphs)e.x+=s,e.y+=a})(e.positionedLines,g,b,w,_,x),e.top+=-w*x,e.bottom=e.top+x,e.left+=-b*_,e.right=e.left+_,e.hasBaseline=y}(S,i,n,r,x,a,l,c,d,u,f,m,g),function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(E)?void 0:S}const F={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},O={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 k(e,i,n,r,o,s,a){if(i.image){const e=r.get(i.image.toString());return e?e.displaySize[0]*a*i.scale*t.dg/s+o:0}{const t=n[i.fontStack],r=t&&t.glyphs[e];return r?r.metrics.advance*i.scale+o:0}}function B(e,t,i,n){const r=Math.pow(e-t,2);return n?e<t?r/2:2*r:r+Math.abs(i)*i}function N(e,t,i){let n=0;return 10===e&&(n-=1e4),i&&(n+=150),40!==e&&65288!==e||(n+=50),41!==t&&65289!==t||(n+=50),n}function V(e,t,i,n,r,o){let s=null,a=B(t,i,r,o);for(const e of n){const n=B(t-e.x,i,r,o)+e.badness;n<=a&&(s=e,a=n)}return{index:e,x:t,priorBreak:s,badness:a}}function U(e){return e?U(e.priorBreak).concat(e.index):[]}function j(e,t,i,n,r){if(!(t||i||n||r))return;const o=e.length-1,s=e[o],a=(s.x+s.metrics.advance*s.scale)*t;for(let t=0;t<=o;t++)e[t].x-=a,e[t].y+=i+n+r}function G(e,i=1,n=!1){let r=1/0,o=1/0,s=-1/0,a=-1/0;const l=e[0];for(let e=0;e<l.length;e++){const t=l[e];(!e||t.x<r)&&(r=t.x),(!e||t.y<o)&&(o=t.y),(!e||t.x>s)&&(s=t.x),(!e||t.y>a)&&(a=t.y)}const c=Math.min(s-r,a-o);let u=c/2;const h=new t.fT([],$);if(0===c)return new t.P(r,o);for(let t=r;t<s;t+=c)for(let i=o;i<a;i+=c)h.push(new H(t+u,i+u,u,e));let d=function(e){let t=0,i=0,n=0;const r=e[0];for(let e=0,o=r.length,s=o-1;e<o;s=e++){const o=r[e],a=r[s],l=o.x*a.y-a.x*o.y;i+=(o.x+a.x)*l,n+=(o.y+a.y)*l,t+=3*l}return new H(i/t,n/t,0,e)}(e),f=h.length;for(;h.length;){const t=h.pop();(t.d>d.d||!d.d)&&(d=t,n&&console.log("found best %d after %d probes",Math.round(1e4*t.d)/1e4,f)),t.max-d.d<=i||(u=t.h/2,h.push(new H(t.p.x-u,t.p.y-u,u,e)),h.push(new H(t.p.x+u,t.p.y-u,u,e)),h.push(new H(t.p.x-u,t.p.y+u,u,e)),h.push(new H(t.p.x+u,t.p.y+u,u,e)),f+=4)}return n&&(console.log(`num probes: ${f}`),console.log(`best distance: ${d.d}`)),d.p}function $(e,t){return t.max-e.max}class H{constructor(e,i,n,r){this.p=new t.P(e,i),this.h=n,this.d=function(e,i){let n=!1,r=1/0;for(let o=0;o<i.length;o++){const s=i[o];for(let i=0,o=s.length,a=o-1;i<o;a=i++){const o=s[i],l=s[a];o.y>e.y!=l.y>e.y&&e.x<(l.x-o.x)*(e.y-o.y)/(l.y-o.y)+o.x&&(n=!n),r=Math.min(r,t.fU(e,o,l))}}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}}const Z=Object.keys;function q(e){return void 0!==e.imagePrimary&&void 0!==e.top&&void 0!==e.bottom&&void 0!==e.left&&void 0!==e.right}function W(e){return!e.imagePrimary.stretchX}function Y(e){return!e.imagePrimary.stretchY}function X(e){return{width:e.right-e.left,height:e.bottom-e.top}}const J=Number.POSITIVE_INFINITY;function K(e,i,n,r,o,s){const a=q(e)&&e.collisionPadding?e.collisionPadding:[0,0,0,0],l={top:e.top-a[1],bottom:e.bottom+a[3],left:e.left-a[0],right:e.right+a[2],scaled:!1};return void 0!==r&&function(e,t){e.top*=t,e.bottom*=t,e.left*=t,e.right*=t,e.scaled=!0}(l,r),s&&(l.left+=s[0],l.right+=s[0],l.top+=s[1],l.bottom+=s[1]),n&&function(e,i,n){if(!i)return;const r=t.av(i),o=new t.P(n?n[0]:0,n?n[1]:0),s=new t.P(e.left,e.top),a=new t.P(e.right,e.top),l=new t.P(e.left,e.bottom),c=new t.P(e.right,e.bottom);
vendor: 22,517 bytes, line 2
2s._rotateAround(r,o),a._rotateAround(r,o),l._rotateAround(r,o),c._rotateAround(r,o),e.left=Math.min(s.x,a.x,l.x,c.x),e.right=Math.max(s.x,a.x,l.x,c.x),e.top=Math.min(s.y,a.y,l.y,c.y),e.bottom=Math.max(s.y,a.y,l.y,c.y)}(l,n,o),i?{top:Math.min(i.top,l.top),bottom:Math.max(i.bottom,l.bottom),left:Math.min(i.left,l.left),right:Math.max(i.right,l.right),scaled:i.scaled||l.scaled}:l}function Q(e,i,n,r,o,s,a,l=1,c,u,h,d,f,p,m,_,g){e.createArrays(),e.tilePixelRatio=t.a6/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;const y=e.layers[0].layout,v=e.layers[0]._unevaluatedLayout._values,x={};x.scaleFactor=l,x.textSizeScaleRange=y.get("text-size-scale-range"),x.iconSizeScaleRange=y.get("icon-size-scale-range");const[b,w]=x.textSizeScaleRange,[T,E]=x.iconSizeScaleRange;x.textScaleFactor=t.b1(x.scaleFactor,b,w),x.iconScaleFactor=t.b1(x.scaleFactor,T,E);const S=v["text-size"],I=v["icon-size"];if("composite"===e.textSizeData.kind){const{minZoom:i,maxZoom:n}=e.textSizeData;x.compositeTextSizes=[S.possiblyEvaluate(new t.aj(i,{worldview:h}),s),S.possiblyEvaluate(new t.aj(n,{worldview:h}),s)]}if("composite"===e.iconSizeData.kind){const{minZoom:i,maxZoom:n}=e.iconSizeData;x.compositeIconSizes=[I.possiblyEvaluate(new t.aj(i,{worldview:h}),s,d),I.possiblyEvaluate(new t.aj(n,{worldview:h}),s,d)]}x.layoutTextSize=S.possiblyEvaluate(new t.aj(a+1,{worldview:h}),s),x.layoutIconSize=I.possiblyEvaluate(new t.aj(a+1,{worldview:h}),s,d),x.textMaxSize=S.possiblyEvaluate(new t.aj(18,{worldview:h}),s);const A=y.get("symbol-placement"),M="map"===y.get("text-rotation-alignment")&&"point"!==A,C=y.get("text-size");let D=!1;const P=[],R=null!=f&&0!==f;for(const a of e.features){if(R&&a.properties&&_&&_(a.properties,f))continue;let l=65535;if(e.hdExt&&a.properties&&Object.hasOwn(a.properties,t.fV)){const i=+a.properties[t.fV];if(!Number.isNaN(i)){const t=e.hdExt.resolveRoadElevation(a,i);if("defer"===t)continue;l=t}}const p=y.get("text-font").evaluate(a,{},s).join(","),m=C.evaluate(a,{},s)*x.textScaleFactor,g=x.layoutTextSize.evaluate(a,{},s)*x.textScaleFactor,b=x.layoutIconSize.evaluate(a,{},s,d)*x.iconScaleFactor,w={horizontal:{},vertical:void 0},T=a.text;let E,S=[0,0];if(T){const r=T.toString(),l=y.get("text-letter-spacing").evaluate(a,{},s)*t.dg,u=y.get("text-line-height").evaluate(a,{},s)*t.dg,h=t.fW(r)?l:0,d=y.get("text-anchor").evaluate(a,{},s),f=y.get("text-variable-anchor");if(!f){const e=y.get("text-radial-offset").evaluate(a,{},s);if(e)S=t.dv(d,[e*t.dg,J]);else{const e=y.get("text-offset").evaluate(a,{},s);S=[e[0]*t.dg,e[1]*t.dg]}}let _=M?"center":y.get("text-justify").evaluate(a,{},s);const v="point"===A,b=v?y.get("text-max-width").evaluate(a,{},s)*t.dg:1/0,E=s=>{e.allowVerticalPlacement&&t.fX(r)&&(w.vertical=z(T,i,n,o,p,b,u,d,s,h,S,t.dt.vertical,!0,g,m,c,x.textScaleFactor))};if(!M&&f){const e="auto"===_?f.map(e=>t.dw(e)):[_];let r=!1;for(let s=0;s<e.length;s++){const a=e[s];if(!w.horizontal[a])if(r)w.horizontal[a]=w.horizontal[0];else{const e=z(T,i,n,o,p,b,u,"center",a,h,S,t.dt.horizontal,!1,g,m,c,x.textScaleFactor);e&&(w.horizontal[a]=e,r=1===e.positionedLines.length)}}E("left")}else{if("auto"===_&&(_=t.dw(d)),v||y.get("text-writing-mode").includes("horizontal")||!t.fX(r)){const e=z(T,i,n,o,p,b,u,d,_,h,S,t.dt.horizontal,!1,g,m,c,x.textScaleFactor);e&&(w.horizontal[_]=e)}E(v?"left":_)}}let I,L,F,O,k,B,N=!1;const V=y.get("icon-text-fit").evaluate(a,{},s);if(a.icon&&a.icon.hasPrimary()){const i=t.fY(a.icon,e.iconSizeData,v["icon-size"],s,e.zoom,a,c,x.iconScaleFactor,h,d);I=i.iconPrimary,F=i.iconSecondary;const n=I.toString();if(L=r.get(n),L&&(k=y.get("icon-offset").evaluate(a,{},s),B=y.get("icon-anchor").evaluate(a,{},s),E=t.fZ(o.get(n),F?o.get(F.toString()):void 0,k,B),N=L.sdf,void 0===e.sdfIcons?e.sdfIcons=L.sdf:e.sdfIcons!==L.sdf&&t.w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(L.pixelRatio!==e.pixelRatio||0!==y.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0)),F){const e=F.toString();O=r.get(e)}}D=D||!(!a.icon||!a.icon.hasSecondary());const U=fe(w.horizontal)||w.vertical;e.iconsInText||(e.iconsInText=!!U&&U.iconsInText);const j=t.f_(g,x.textScaleFactor),{defaultShapedIcon:G,verticallyShapedIcon:$}=ue(e,E,y,a,s,w,j,k,V);"none"!==V&&E&&(W(E)||Y(E))&&(re(L,I,E,G,V,u,r,o),re(O,F,E,G,V,u,r,o),$&&(re(L,I,E,$,V,u,r,o),re(O,F,E,$,V,u,r,o))),E=G;const{iconBBox:H,iconVerticalBBox:Z,textBBox:q,textVerticalBBox:X}=ee(e,E,$,y,a,s,b,k,x,o,B,w,g,S,d);P.push({feature:a,shapedTextOrientations:w,shapedText:U,shapedIcon:E,iconPrimary:I,iconSecondary:F,iconOffset:k,iconAnchor:B,verticallyShapedIcon:$,layoutTextSize:g,layoutIconSize:b,textOffset:S,isSDFIcon:N,iconTextFit:V,iconCollisionBounds:H,iconVerticalCollisionBounds:Z,textCollisionBounds:q,textVerticalCollisionBounds:X,elevationFeatureIndex:l})}return e.hdExt&&e.hdExt.clearWorkerState(),{featureData:P,sizes:x,hasAnySecondaryIcon:D,textAlongLine:M,symbolPlacement:A,coverageFrcMask:f,coveragePolygons:p,coverageTileZoom:m,isFeatureCoveredByFrcMask:_,symbolAnchorInFrcCoverage:g}}function ee(e,i,n,r,o,s,a,l,c,u,h,d,f,p,m){const _=e.layers[0],g=_.appearances;if(0===g.length)return{iconBBox:null,iconVerticalBBox:null,textBBox:null,textVerticalBBox:null};const y={iconBBox:null,iconVerticalBBox:null},v={textBBox:null,textVerticalBBox:null},{baseIconRotate:x,baseTextRotate:b,iconScaleFactor:w}=function(e,i,n){const r=e.get("icon-rotate").evaluate(i,{},n),o=e.get("text-rotate").evaluate(i,{},n),[s,a]=e.get("icon-size-scale-range");return{baseIconRotate:r,baseTextRotate:o,iconScaleFactor:t.b1(1,s,a)}}(r,o,s);i&&(y.iconBBox=K(i,y.iconBBox,x),n)&&(y.iconVerticalBBox=K(n,y.iconVerticalBBox,x+90));const T=fe(d.horizontal);T&&(v.textBBox=K(T,v.textBBox,b,1,p)),d.vertical&&(v.textVerticalBBox=K(d.vertical,v.textVerticalBBox,b+90,1,p));for(const t of g)t.hasIconLayoutProperties()&&te(y,e,_,t,o,s,l,x,a,c,i,u,w,h,m),t.hasTextLayoutProperties()&&ne(v,_,t,o,s,p,b,f,T,d.vertical);return{iconBBox:y.iconBBox,iconVerticalBBox:y.iconVerticalBBox,textBBox:v.textBBox,textVerticalBBox:v.textVerticalBBox}}function te(e,i,n,r,o,s,a,l,c,u,h,d,f,p,m){const{appearanceIconOffset:_,appearanceIconRotate:g,appearanceIconSize:y}=t.g2(r,n,o,s,a,l,c,u.iconScaleFactor);let v=null,x=null,b=null;r.hasLayoutProperty("icon-image")?b=ie(i,n,r,o,s,d,f,m):h&&(b=h.imagePrimary),b&&(v=t.fZ(b,null,_,p),i.allowVerticalPlacement&&(x=v));const w=c>0?y/c:1;v&&(e.iconBBox=K(v,e.iconBBox,g,1!==w?w:void 0)),x&&(e.iconVerticalBBox=K(x,e.iconVerticalBBox,g+90,1!==w?w:void 0))}function ie(e,i,n,r,o,s,a,l){let c=null;const u=i.getAppearanceValueAndResolveTokens(n,"icon-image",r,o,l);if(u){const h=e.getResolvedImageFromTokens(u),d=n.hasLayoutProperty("icon-size")?n.getUnevaluatedLayoutProperty("icon-size"):i._unevaluatedLayout._values["icon-size"],f=t.g5(e.zoom,d,e.worldview,l),p=t.fY(h,f,d,o,e.zoom,r,e.pixelRatio,a,e.worldview,l);c=s.get(p.iconPrimary.toString())}return c}function ne(e,i,n,r,o,s,a,l,c,u){const{appearanceTextOffset:h,appearanceTextRotate:d,appearanceTextSize:f}=t.g3(n,i,r,o,s,a,l),p=f/l,m=[(h[0]-s[0])*p,(h[1]-s[1])*p],_=0!==m[0]||0!==m[1];c&&(e.textBBox=K(c,e.textBBox,d,p,h,_?m:void 0)),u&&(e.textVerticalBBox=K(u,e.textVerticalBBox,d+90,p,h,_?m:void 0))}function re(e,i,n,r,o,s,a,l){if(!e||!e.usvg)return;const c=X(n),u=X(r),h="both"!==o&&"width"!==o||!W(n)?1:u.width/c.width,d="both"!==o&&"height"!==o||!Y(n)?1:u.height/c.height;i.scaleSelf(h,d);const f=i.toString();s.set(f,i),a.set(f,e);const{imagePosition:p}=t.g0(f,e,t.g1);l.set(f,p)}function oe(e,i,n){if(!i)return;const r=n.get(e.toString()),o=n.get(i.toString());r&&o&&(r.paddedRect.w===o.paddedRect.w&&r.paddedRect.h===o.paddedRect.h||t.w(`Mismatch in icon variant sizes: ${e.toString()} and ${i.toString()}`),r.usvg!==o.usvg&&t.w(`Mismatch in icon variant image types: ${e.id} and ${i.id}`))}function se(e,t,i,n,r,o,s,a,l,c){e.iconAtlasPositions=c.iconPositions;const{featureData:u,sizes:h,textAlongLine:d,symbolPlacement:f,coveragePolygons:p,coverageTileZoom:m,symbolAnchorInFrcCoverage:_}=t,g=t.hasAnySecondaryIcon||e.hasAnySecondaryIcon;for(const t of u){const{shapedIcon:i,verticallyShapedIcon:o,feature:u,shapedTextOrientations:y,shapedText:v,layoutTextSize:x,textOffset:b,isSDFIcon:w,iconPrimary:T,iconSecondary:E,iconTextFit:S,iconOffset:I,iconCollisionBounds:A,iconVerticalCollisionBounds:M,textCollisionBounds:C,elevationFeatureIndex:D}=t;ae(i,c.iconPositions,T,E),ae(o,c.iconPositions,T,E),le(y,c.iconPositions),oe(T,E,c.iconPositions),(v||i)&&he(e,u,y,i,o,l,h,x,0,b,w,n,r,s,a,g,S,I,d,f,A,M,C,0,0,p,m,_,D)}i&&e.generateCollisionDebugBuffers(o,e.collisionBoxArray,h.textScaleFactor),e.text.uboBinder&&e.text.uboBinder.finalize(),e.icon.uboBinder&&e.icon.uboBinder.finalize()}function ae(e,t,i,n){if(!e)return;const r=t.get(i.toString());if(r&&(e.imagePrimary=r),n){const i=t.get(n.toString());e.imageSecondary=i}}function le(e,t){for(const i in e.horizontal)ce(e.horizontal[i],t);ce(e.vertical,t)}function ce(e,t){if(e)for(const i of e.positionedLines)for(const e of i.positionedGlyphs)if(null!==e.image){const i=e.image.toString();e.rect=t.get(i).paddedRect}}function ue(e,i,n,r,o,s,a,l,c){const u=fe(s.horizontal)||s.vertical,h=n.get("icon-text-fit-padding").evaluate(r,{},o);let d,f=i;return i&&"none"!==c&&(e.allowVerticalPlacement&&s.vertical&&(d=t.f$(i,s.vertical,c,h,l,a)),u&&(f=t.f$(i,u,c,h,l,a))),{defaultShapedIcon:f,verticallyShapedIcon:d}}function he(e,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,E,S,I,A,D,P,R=65535){let L=a.textMaxSize.evaluate(i,{},f);void 0===L?L=l*a.textScaleFactor:L*=a.textScaleFactor;const z=e.layers[0].layout,F=t.dg,O=t.f_(l,a.textScaleFactor),k=fe(n.horizontal)||n.vertical,B=e.hasAnyAppearanceLayoutProperty(["text-size","text-offset","text-rotate"]),N=e.getAppearanceFeatureData(i.index);("none"!==g||B)&&N&&(N.textShaping=k,N.iconTextFitPadding=z.get("icon-text-fit-padding").evaluate(i,{},f),N.fontScale=O,N.textScaleFactor=a.textScaleFactor);const V="globe"===p.name,U=e.tilePixelRatio*L/F,j=(X=e.overscaling,e.zoom>18&&X>2&&(X>>=1),Math.max(t.a6/(512*X),1)*z.get("symbol-spacing")),$=z.get("text-padding")*e.tilePixelRatio,H=z.get("icon-padding")*e.tilePixelRatio,q=t.av(z.get("text-max-angle")),W="map"===z.get("icon-rotation-alignment")&&"point"!==x,Y=j/2;var X;!1===e.hasAnyIconTextFit&&"none"!==g&&(e.hasAnyIconTextFit=!0);const K=(l,c,x)=>{if(c.x<0||c.x>=t.a6||c.y<0||c.y>=t.a6)return;if(A&&A.length>0&&i.properties&&P&&P(A,i.properties,c,f,D))return;let S=null;if(V){const{x:e,y:t,z:i}=p.projectTilePoint(c.x,c.y,x);S={anchor:new T(e,t,i,0,void 0),up:p.upVector(x,c.x,c.y)}}!function(e,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,E,S,I,A,M,C,D,P,R){const L=e.addToLineVertexArray(i,r);let z,F,O,k,B,N,V,U=0,j=0,G=0,$=0,H=-1,q=-1;const W={};let Y=t.dF("");const X=n?n.anchor:i,K="none"!==M;let Q=0,ee=0;if(void 0===c._unevaluatedLayout.getValue("text-radial-offset")){const e=c.layout.get("text-offset").evaluate(b,{},S);Q=e[0]*t.dg,ee=e[1]*t.dg}else Q=c.layout.get("text-radial-offset").evaluate(b,{},S)*t.dg,ee=J;if(e.allowVerticalPlacement&&o.vertical){const e=o.vertical;if(m)N=me(e),l&&(V=me(l));else{const t=c.layout.get("text-rotate").evaluate(b,{},S)+90;O=pe(u,X,i,h,d,f,e,p,t,_,R),l&&(k=pe(u,X,i,h,d,f,l,y,t,null,P))}}if(s){const r=c.layout.get("icon-rotate").evaluate(b,{},S),o=t.g6(s,r,T,K,w.iconScaleFactor),a=l?t.g6(l,r,T,K,w.iconScaleFactor):void 0;F=pe(u,X,i,h,d,f,s,y,r,null,D);const p=function(e,i,n,r,o,s,a,l,c){const u=e.layers[0],h=u.appearances;let d=i.length;if(n&&(d=Math.max(d,n.length)),0===h.length)return d;const[f,p]=r.get("icon-size-scale-range"),m=t.b1(1,f,p);for(const i of h)if(i.hasLayoutProperty("icon-image")){const n=ie(e,u,i,o,s,a,m,c);n&&(d=Math.max(d,t.g8(n)))}return d}(e,o,a,c.layout,b,S,e.iconAtlasPositions,0,E);U=4*p;const m=c.layout.get("icon-size").evaluate(b,{},S,E),_=w.compositeIconSizes?w.compositeIconSizes[0].evaluate(b,{},S,E):0,g=w.compositeIconSizes?w.compositeIconSizes[1].evaluate(b,{},S,E):0,M=t.g7(e.layerIds[0],e.iconSizeData,m,s.imagePrimary.usvg?1:w.iconScaleFactor,_,g);e.addSymbols(e.icon,o,M,x,v,b,void 0,n,i,L.lineStartIndex,L.lineLength,-1,E,S,I,A,e.symbolInstances.length,p),H=e.icon.placedSymbolArray.length-1,a&&(j=4*p,e.addSymbols(e.icon,a,M,x,v,b,t.dt.vertical,n,i,L.lineStartIndex,L.lineLength,-1,E,S,I,A,e.symbolInstances.length,p),q=e.icon.placedSymbolArray.length-1)}for(const r in o.horizontal){const s=r,l=o.horizontal[s];z||(Y=t.dF(l.text),m?B=me(l):z=pe(u,X,i,h,d,f,l,p,c.layout.get("text-rotate").evaluate(b,{},S),_,R));const g=1===l.positionedLines.length;if(G+=de(e,n,i,l,a,c,m,b,_,L,o.vertical?t.dt.horizontal:t.dt.horizontalOnly,g?Z(o.horizontal):[s],W,H,w,E,S,e.symbolInstances.length,I),g)break}o.vertical&&($+=de(e,n,i,o.vertical,a,c,m,b,_,L,t.dt.vertical,["vertical"],W,q,w,E,S,e.symbolInstances.length,I));let te=-1;const ne=(e,t)=>e?Math.max(e,t):t;te=ne(B,te),te=ne(N,te),te=ne(V,te);const re=te>-1?1:0;e.glyphOffsetArray.length>=65535&&t.w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey),e.symbolInstances.emplaceBack(i.x,i.y,X.x,X.y,X.z,W.right>=0?W.right:-1,W.center>=0?W.center:-1,W.left>=0?W.left:-1,W.vertical>=0?W.vertical:-1,H,q,Y,void 0!==z?z:e.collisionBoxArray.length,void 0!==z?z+1:e.collisionBoxArray.length,void 0!==O?O:e.collisionBoxArray.length,void 0!==O?O+1:e.collisionBoxArray.length,void 0!==F?F:e.collisionBoxArray.length,void 0!==F?F+1:e.collisionBoxArray.length,k||e.collisionBoxArray.length,k?k+1:e.collisionBoxArray.length,h,G,$,U,j,re,0,Q,ee,te,0,K?1:0,C)}(e,c,S,l,n,r,s,o,e.layers[0],e.collisionBoxArray,i.index,i.sourceLayerIndex,e.index,$,v,u,0,H,W,y,i,a,h,d,f,m,_,g,R,b,w,E)};if("line"===x)for(const o of t.dc(i.geometry,0,0,t.a6,t.a6)){const i=C(o,j,q,n.vertical||k,r,F,U,e.overscaling,t.a6);for(const t of i)k&&_e(e,k.text,Y,t)||K(o,t,f)}else if("line-center"===x){for(const e of i.geometry)if(e.length>1){const t=M(e,q,n.vertical||k,r,F,U);t&&K(e,t,f)}}else if("Polygon"===i.type)for(const e of t.g4(i.geometry,0)){const t=G(e,16);K(e[0],new T(t.x,t.y,0,0,void 0),f)}else if("LineString"===i.type)for(const e of i.geometry)K(e,new T(e[0].x,e[0].y,0,0,void 0),f);else if("Point"===i.type)for(const e of i.geometry)for(const t of e)K([t],new T(t.x,t.y,0,0,void 0),f)}function de(e,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v){const x=t.g9(n,r,c,s,a,l,o,e.allowVerticalPlacement,void 0,m.textScaleFactor),b=s.layout.get("text-size").evaluate(l,{},g),w=m.compositeTextSizes?m.compositeTextSizes[0].evaluate(l,{},g):0,T=m.compositeTextSizes?m.compositeTextSizes[1].evaluate(l,{},g):0,E=t.g7(e.layerIds[0],e.textSizeData,b,m.textScaleFactor,w,T);e.addSymbols(e.text,x,E,c,a,l,h,i,n,u.lineStartIndex,u.lineLength,p,_,g,v,!1,y,x.length);for(const t of d)f[t]=e.text.placedSymbolArray.length-1;return 4*x.length}function fe(e){for(const t in e)return e[t];return null}function pe(e,i,n,r,o,s,a,l,c,u,h){let d,f,p,m;if(d=h?h.top:a.top,f=h?h.bottom:a.bottom,p=h?h.left:a.left,m=h?h.right:a.right,q(a)&&a.collisionPadding){const e=a.collisionPadding;p-=e[0],d-=e[1],m+=e[2],f+=e[3]}if(c){const e=new t.P(p,d),i=new t.P(m,d),n=new t.P(p,f),r=new t.P(m,f),o=t.av(c);let s=new t.P(0,0);u&&(s=new t.P(u[0],u[1])),e._rotateAround(o,s),i._rotateAround(o,s),n._rotateAround(o,s),r._rotateAround(o,s),p=Math.min(e.x,i.x,n.x,r.x),m=Math.max(e.x,i.x,n.x,r.x),d=Math.min(e.y,i.y,n.y,r.y),f=Math.max(e.y,i.y,n.y,r.y)}return e.emplaceBack(i.x,i.y,i.z,n.x,n.y,p,d,m,f,l,r,o,s),e.length-1}function me(e){q(e)&&e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function _e(e,t,i,n){const r=e.compareText;if(t in r){const e=r[t];for(let t=e.length-1;t>=0;t--)if(n.dist(e[t])<i)return!0}else r[t]=[];return r[t].push(n),!1}const ge=1*t.gb;class ye{constructor(e){const i={},n=[];for(const t in e){const r=e[t],o=i[t]={};for(const e in r.glyphs){const t=r.glyphs[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const i=t.metrics.localGlyph?ge:1,s={x:0,y:0,w:t.bitmap.width+2*i,h:t.bitmap.height+2*i};n.push(s),o[e]=s}}const{w:r,h:o}=t.p(n),s=new t.ga({width:r||1,height:o||1});for(const n in e){const r=e[n];for(const e in r.glyphs){const o=r.glyphs[+e];if(!o||0===o.bitmap.width||0===o.bitmap.height)continue;const a=i[n][e],l=o.metrics.localGlyph?ge:1;t.ga.copy(o.bitmap,s,{x:0,y:0},{x:a.x+l,y:a.y+l},o.bitmap)}}this.image=s,this.positions=i}}function ve(e){for(const t of e){if(null!=t.hdExt)return!0;if(t.requiresHDRuntime)return!0}return!1}function xe(e){for(const t of e)if(t.requiresStandardRuntime)return!0;return!1}function be(e,i,n){const r=null!=e&&!!t.ge&&t.ge(e.sourceLayers,i,n);return{applies:r,frcMask:r&&e?e.frcMask:null,polygons:r&&e?e.polygons:null,tileZoom:r&&e?e.tileZoom:null}}t.fL(ye,"GlyphAtlas");class we{constructor(e){this.tileID=new t.bQ(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.tileZoom=e.tileZoom,this.uid=e.uid,this.zoom=e.zoom,this.lut=e.lut,this.canonical=e.tileID.canonical,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.scope=e.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.showElevationIdDebug=e.showElevationIdDebug,this.collectResourceTiming=!!e.request&&e.request.collectResourceTiming,this.promoteId=e.promoteId,this.renderSourceType=e.renderSourceType,this.frcCoverage=e.frcCoverage||null,this.elevation=e.elevation||null,this.crossSourceElevationEnabled=!!e.crossSourceElevationEnabled,this.terrainEnabled=!!e.terrainEnabled,this.deferRoadStructure=!1,this.tileTransform=t.bq(e.tileID.canonical,e.projection),this.projection=e.projection,this.worldview=e.worldview,this.localizableLayerIds=e.localizableLayerIds,this.brightness=e.brightness,this.extraShadowCaster=!!e.extraShadowCaster,this.tessellationStep=e.tessellationStep,this.scaleFactor=e.scaleFactor,this.worldview=e.worldview,this.indoor=e.indoor}isLayerActiveForTile(e){return!(this.renderSourceType===t.bS.Symbol&&"symbol"!==e.type||this.renderSourceType===t.bS.FillExtrusion&&"fill-extrusion"!==e.type||this.renderSourceType===t.bS.Other&&("symbol"===e.type||"fill-extrusion"===e.type)||e.minzoom&&this.zoom<Math.floor(e.minzoom)||e.maxzoom&&this.zoom>=e.maxzoom||"none"===e.visibility)}parse(e,t,i,n,r,o){this._parseAfterHD(e,t,i,n,r,o)}_parseAfterHD(e,i,l,c,u,h){let d;if(this.status="parsing",this.data=e,this.renderSourceType===t.bS.HdRoadCoverage){const i=e.layers[t.bV];d=i&&o?o(i):[]}this.collisionBoxArray=new t.bu;const f=new t.gc(Object.keys(e.layers).sort()),p=new t.fG(this.tileID,this.promoteId);p.bucketLayerIDs=[];const g={},y=new t.gd(256,256),v={featureIndex:p,iconDependencies:new Map,patternDependencies:new Map,glyphDependencies:{},lineAtlas:y,availableImages:l,brightness:this.brightness,scaleFactor:this.scaleFactor,showElevationIdDebug:this.showElevationIdDebug,elevationFeatures:void 0,elevationParams:this.elevation,crossSourceElevationEnabled:this.crossSourceElevationEnabled,terrainEnabled:this.terrainEnabled,activeFloors:void 0};this.indoor&&a&&(v.activeFloors=a(e,this.indoor,u,this.canonical));const x=[],b=i.familiesBySource[this.source];if(this.deferRoadStructure=!1,this.renderSourceType!==t.bS.HdRoadCoverage&&null!=this.frcCoverage&&!this.frcCoverage.resolved&&null===this.frcCoverage.frcMask)for(const e in b)if(t.ge&&t.ge(this.frcCoverage.sourceLayers,this.source,e)){this.deferRoadStructure=!0;break}for(const i in b){const r=e.layers[i];if(!r)continue;let o=!1,s=!1,a=!1,u=!1;for(const e of b[i])"symbol"===e[0].type?o=!0:"fill-extrusion"===e[0].type?s=!0:a=!0,e[0].is3D()&&"model"!==e[0].type&&(u=!0);if(this.extraShadowCaster&&!u)continue;if(this.renderSourceType===t.bS.Symbol&&!o)continue;if(this.renderSourceType===t.bS.FillExtrusion&&!s)continue;if((this.renderSourceType===t.bS.Other||this.renderSourceType===t.bS.HdRoadCoverage)&&!a)continue;const h=null!=this.frcCoverage&&!!t.ge&&t.ge(this.frcCoverage.sourceLayers,this.source,i);if(this.deferRoadStructure&&h)continue;1===r.version&&t.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const d=f.encode(i),_=[],y=this.localizableLayerIds&&this.localizableLayerIds.has(i);let w=!1;for(let e=0,n=0;e<r.length;e++){const o=r.feature(e),s=p.getId(o,i),a=o.properties?o.properties.worldview:null;if(y&&this.worldview&&"string"==typeof a)if("all"===a)o.properties.$localized=!0;else{if(!a.split(",").includes(this.worldview))continue;o.properties.$localized=!0,o.properties.worldview=this.worldview}!w&&o.properties&&Object.hasOwn(o.properties,t.fV)&&(w=!0),h&&this.frcCoverage&&this.frcCoverage.frcMask&&o.properties&&t.gf&&t.gf(o.properties,this.frcCoverage.frcMask)||(_.push({feature:o,id:s,index:n,sourceLayerIndex:d}),n++)}w&&!v.elevationFeatures&&n&&(v.elevationFeatures=n(e,this.canonical));for(const e of b[i]){const n=e[0];if(this.extraShadowCaster&&(!n.is3D()||"model"===n.type))continue;if(this.renderSourceType===t.bS.Symbol&&"symbol"!==n.type)continue;if(this.renderSourceType===t.bS.FillExtrusion&&"fill-extrusion"!==n.type)continue;if(!(this.renderSourceType!==t.bS.Other&&this.renderSourceType!==t.bS.HdRoadCoverage||"symbol"!==n.type&&"fill-extrusion"!==n.type))continue;if(!this.isLayerActiveForTile(n))continue;const r=p.bucketLayerIDs.length;p.bucketLayerIDs.push(e.map(e=>t.m(e.id,e.scope)));const o=()=>{Te(e,this.zoom,v.brightness,l,this.worldview,v.activeFloors);const t=g[n.id]=n.createBucket({index:r,layers:e,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:d,sourceLayerName:i,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep,styleDefinedModelURLs:c,worldview:this.worldview,localizable:y,availableImages:l,maxUniformBufferBindings:this.maxUniformBufferBindings,maxUniformBlockSizeDwords:this.maxUniformBlockSizeDwords});m&&m(t,this.frcCoverage?this.frcCoverage.sourceLayers:null),t.populate(_,v,this.tileID.canonical,this.tileTransform)};n.mayUse("HD")||n.mayUse("Standard")?x.push(n.prepare().then(()=>o())):o()}}const w=()=>{y.trim();const i=!(!v.elevationFeatures||!v.elevationFeatures.some(e=>e.heightRange.min<0));let o,a,c,m,x,b,w,T=v.elevationFeatures;this.crossSourceElevationEnabled&&n&&(T=T||n(e,this.canonical)||[]);const E={type:"maybePrepare",renderSourceType:this.renderSourceType,zoom:this.zoom},S=()=>
vendor: 5,412 bytes, line 2
2{if(o)return this.status="done",h(o);if(this.extraShadowCaster){this.status="done";const e=Object.values(g).filter(e=>!e.isEmpty());h(null,{buckets:e,containsHdExt:ve(e),containsStandardExt:xe(e),featureIndex:p,collisionBoxArray:null,hasTunnelGeometry:i,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:v.brightness,hasDeferredElevationFeatures:!!_&&_(g),parsedElevationFeatures:T,glyphMap:null,iconMap:null,glyphPositions:null})}else if(a&&c&&m&&w){const e=void 0,i=new ye(a),n=new Map;for(const[e,i]of c.entries()){const{imagePosition:r}=t.g0(e,i,t.g1);n.set(e,r)}const r={};for(const e in g){const o=g[e];if(o instanceof t.bv){Te(o.layers,this.zoom,v.brightness,l,this.worldview,v.activeFloors);const u=be(this.frcCoverage,this.source,o.layers[0].sourceLayer);r[e]=Q(o,a,i.positions,c,n,this.tileID.canonical,this.tileZoom,this.scaleFactor,this.pixelRatio,x,this.worldview,l,u.frcMask,u.polygons,u.tileZoom,t.gf||null,s||null)}}x.size||b.size?this.rasterizeTask=u.sendCancelable("rasterizeImages",{scope:this.scope,iconTasks:x,patternTasks:b},{},(t,n)=>{if(!t)for(const[e,t]of n.entries())c.has(e)&&c.set(e,Object.assign(c.get(e),{data:t})),m.has(e)&&m.set(e,Object.assign(m.get(e),{data:t}));I(r,i,e,w)}):I(r,i,e,w)}},I=(e,n,r,o)=>{const s=c.size>0||m.size>0,a=Object.keys(e).length>0;if(!s&&!a){this.status="done";const e=Object.values(g).filter(e=>!e.isEmpty());return void h(null,{buckets:e,containsHdExt:ve(e),containsStandardExt:xe(e),featureIndex:p,collisionBoxArray:this.collisionBoxArray,hasTunnelGeometry:i,glyphAtlasImage:n.image,lineAtlas:y,imageAtlas:null,brightness:v.brightness,hasDeferredRoadStructure:this.deferRoadStructure,frcCoveragePolygons:d,hasDeferredElevationFeatures:!!_&&_(g),parsedElevationFeatures:T})}const f=(r,o)=>{for(const i in g){const n=g[i];if(i in e)se(n,e[i],this.showCollisionBoxes,l,this.tileID.canonical,this.tileZoom,this.projection,this.brightness,c,o);else if(n.hasPattern&&(n instanceof t.bA||n instanceof t.bB||n instanceof t.aD)){Te(n.layers,this.zoom,v.brightness,l,this.worldview,v.activeFloors);const e=Object.fromEntries(o.patternPositions);n.addFeatures(v,this.tileID.canonical,e,l,this.tileTransform,this.brightness)}}this.status="done";const s=Object.values(g).filter(e=>!e.isEmpty());h(null,{buckets:s,containsHdExt:ve(s),containsStandardExt:xe(s),featureIndex:p,collisionBoxArray:this.collisionBoxArray,hasTunnelGeometry:i,glyphAtlasImage:n.image,lineAtlas:y,imageAtlas:r,brightness:v.brightness,hasDeferredRoadStructure:this.deferRoadStructure,frcCoveragePolygons:d,hasDeferredElevationFeatures:!!_&&_(g),parsedElevationFeatures:T})};if(s){const e=new Map,i=t.gh(c,e),n=t.gh(m,e),r=new t.gi(i,n,o,this.lut,this.scope,e);u.send("checkAtlasCache",{descriptor:r,scope:this.scope}).then(e=>{let i,n;if(e)i=new t.gj(e.sourceHash),n=e;else{const e=new t.gk(c,m,this.lut,o,this.scope);i=e,n=e}f(i,n)}).catch(e=>{"AbortError"!==e.name&&t.w(`[Worker] Error checking atlas cache: ${e.message}`);const i=new t.gk(c,m,this.lut,o,this.scope);f(i,i)})}else f(null,{iconPositions:new Map,patternPositions:new Map})};if(!this.extraShadowCaster){const e=t.gg(v.glyphDependencies,e=>Object.keys(e).map(Number));Object.keys(e).length?u.send("getGlyphs",{uid:this.uid,stacks:e},{metadata:E}).then(e=>{o||(a=e,S())}).catch(e=>{o||(o=e,S())}):a={},w=new Map;const i=Array.from(v.iconDependencies.keys()).map(e=>t.I.parse(e)),n=Array.from(v.patternDependencies.keys()).map(e=>t.I.parse(e));i.length||n.length?u.send("getImages",{icons:i,patterns:n,source:this.source,scope:this.scope,tileID:this.tileID},{metadata:E}).then(e=>{if(!o){c=new Map,m=new Map,x=this.updateImageMapAndGetImageTaskQueue(c,e.images,v.iconDependencies),b=this.updateImageMapAndGetImageTaskQueue(m,e.images,v.patternDependencies);for(const[t,i]of e.versions.entries())w.set(t,i);S()}}).catch(e=>{o||(o=e,S())}):(c=new Map,m=new Map,x=new Map,b=new Map)}r&&r({buckets:g,data:e,sourceLayerCoder:f,canonical:this.tileID.canonical,options:v}),S()};x.length>0?Promise.allSettled(x).then(w).catch(h):w()}updateParameters(e){this.scaleFactor=e.scaleFactor,this.showCollisionBoxes=e.showCollisionBoxes,this.showElevationIdDebug=e.showElevationIdDebug,this.projection=e.projection,this.brightness=e.brightness,this.tileTransform=t.bq(e.tileID.canonical,e.projection),this.extraShadowCaster=e.extraShadowCaster,this.lut=e.lut,this.worldview=e.worldview,this.indoor=e.indoor,this.frcCoverage=e.frcCoverage||null,this.elevation=e.elevation||null,this.crossSourceElevationEnabled=!!e.crossSourceElevationEnabled,this.terrainEnabled=!!e.terrainEnabled}updateImageMapAndGetImageTaskQueue(e,t,i){const n=new Map;for(const r of t.keys()){const o=i.get(r)||[];for(const i of o){const r=i.toString(),o=t.get(i.id.toString());o.usvg?n.has(r)||(n.set(r,i),e.set(r,{...o})):e.set(r,o)}}return n}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.abort()}}function Te(e,i,n,r,o,s){const a=new t.aj(i,{brightness:n,worldview:o,activeFloors:s});for(const t of e)t.recalculate(a,r)}class Ee extends t.E{constructor({actor:e,layerIndex:i,availableImages:n,availableModels:r,isSpriteLoaded:o,tileProvider:s,brightness:a,maxUniformBufferBindings:l,maxUniformBlockSizeDwords:c}){super(),this.actor=e,this.layerIndex=i,this.availableImages=n,this.availableModels=r,this.loadVectorData=t.cH,this.tileProvider=s,this.loading={},this.loaded={},this.deduped=new t.cC(e.scheduler),this.isSpriteLoaded=o,this.scheduler
vendor: 5,047 bytes, line 2
2=e.scheduler,this.brightness=a,this.maxUniformBufferBindings=l,this.maxUniformBlockSizeDwords=c}loadTileData(e,t){if(!this.tileProvider)return this.loadVectorData(e,t);const i=new AbortController;return this.loadTileWithProvider(this.tileProvider,e,i,t),()=>i.abort()}async loadTileWithProvider(e,t,i,n){const{z:r,x:o,y:s}=t.tileID.canonical;try{const a=await e.loadTile({z:r,x:o,y:s},{request:t.request,signal:i.signal});if(i.signal.aborted)return;if(null==a){const e=new Error("Tile not found");return e.status=404,n(e)}if(null==a.data)return n(null,null);if(a.data instanceof ImageBitmap)return n(new Error("Vector tiles require ArrayBuffer data"));const l=new Headers;a.expires&&l.set("expires",a.expires),a.cacheControl&&l.set("cache-control",a.cacheControl),n(null,{rawData:a.data,headers:l})}catch(e){if(i.signal.aborted)return;n(e instanceof Error?e:new Error(String(e)))}}_fetchTileData(e,t){return new Promise((i,n)=>{e.abort=this.loadTileData(t,(e,t)=>{e?n(e):i(t)})})}async _parse(e,t){const i=!this.isSpriteLoaded;return i&&await this.once("isSpriteLoaded"),new Promise((n,r)=>{const o=()=>e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,(e,t)=>{e?r(e):n(t)});i&&this.scheduler?this.scheduler.add(o,{type:"parseTile",renderSourceType:t.renderSourceType,zoom:t.tileZoom}):o()})}async loadTile(e){const n=e.uid,r=e&&e.request,o=r&&r.collectResourceTiming,s=this.loading[n]=new we(e);s.maxUniformBufferBindings=this.maxUniformBufferBindings,s.maxUniformBlockSizeDwords=this.maxUniformBlockSizeDwords;const a=(e,t)=>{const i=s.reloadCallback;i&&(delete s.reloadCallback,e||!t?i(e,null):s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,i))};let l,c;try{l=await this._fetchTileData(s,e)}catch(e){c=e}const u=!this.loading[n];if(delete this.loading[n],s.cancelRasterize(),c||u||!l){if(s.status="done",u||(this.loaded[n]=s),c)throw c;return null}const h=l.rawData;let d;s.vectorTile=l.vectorTile||new t.gl(new t.c$(h)),this.loaded=this.loaded||{},this.loaded[n]=s;try{d=await this._parse(s,e)}catch(e){throw a(e),e}if(!d)return a(null,null),null;const f={};if(o){const e=i(r);e.length>0&&(f.resourceTiming=JSON.parse(JSON.stringify(e)))}const p={rawTileData:h.slice(0),headers:l.headers,...d,...f};return a(null,d),p}async reloadTile(e){const t=this.loaded,i=e.uid;if(t&&t[i])return new Promise((n,r)=>{const o=t[i];o.updateParameters(e);const s=(e,t)=>{const i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,i)),e?r(e):n(t)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status?o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,s):s():n(void 0)})}abortTile(e){const t=e.uid,i=this.loading[t];i&&(i.abort&&i.abort(),delete this.loading[t])}removeTile(e){const t=this.loaded,i=e.uid;t&&t[i]&&delete t[i]}}class Se{constructor(e){this.tileProvider=e.tileProvider,this.loading={}}async loadTile(e){const i=e.uid,n=new AbortController;if(this.loading[i]={cancel:()=>n.abort()},this.tileProvider)return this.loadTileWithProvider(this.tileProvider,i,e,n);try{const{data:r,headers:o}=await t.d0(e.request,n.signal);if(!r)return null;const s=await this.decodeTile(i,r,e.encoding);return s.headers=o,s}catch(e){if(n.signal.aborted)return null;throw e}finally{delete this.loading[i]}}async decodeTile(e,i,n){const r=i instanceof ImageBitmap?i:await createImageBitmap(new Blob([new Uint8Array(i)],{type:"image/png"})),o=1-(r.width-t.gm(r.width))/2,s=o<1,a=this.getImageData(r,o);return r.close(),{dem:new t.gn(e,a,n,s),borderReady:s}}async loadTileWithProvider(e,t,i,n){const{z:r,x:o,y:s}=i.tileID.canonical;try{const a=await e.loadTile({z:r,x:o,y:s},{request:i.request,signal:n.signal});if(n.signal.aborted)return null;if(null==a){const e=new Error("Tile not found");throw e.status=404,e}if(null==a.data)return null;const l=await this.decodeTile(t,a.data,i.encoding);if(n.signal.aborted)return null;const c=new Headers;return a.expires&&c.set("expires",a.expires),a.cacheControl&&c.set("cache-control",a.cacheControl),l.headers=c,l}catch(e){if(n.signal.aborted)return null;throw e}finally{delete this.loading[t]}}async reloadTile(e){}abortTile(e){const t=e.uid,i=this.loading[t];i&&(i.cancel(),delete this.loading[t])}removeTile(e){}getImageData(e,t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const i=this.offscreenCanvasContext.getImageData(-t,-t,e.width+2*t,e.height+2*t);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),i}}const Ie=t.go.prototype.toGeoJSON;class Ae{constructor(e){this._feature=e,this.extent=t.a6,this.type=4===e.type?1:e.type,this.properties=e.tags||{}
vendor: 2,019 bytes, line 2
2,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){const e=this._feature,i=[];if(4===e.type)i.push([new t.P(e.x,e.y)]);else if(1===e.type)for(let n=0;n<e.geometry.length;n+=2)i.push([new t.P(e.geometry[n],e.geometry[n+1])]);else for(const n of e.geometry){const e=[];for(let i=0;i<n.length;i+=2)e.push(new t.P(n[i],n[i+1]));i.push(e)}return i}toGeoJSON(e,t,i){return Ie.call(this,e,t,i)}}class Me{constructor(e,i){this.name=e,this.extent=t.a6,this.length=i.length,this._jsonFeatures=i}feature(e){return new Ae(this._jsonFeatures[e])}}class Ce{constructor(e){this.layers={},this.extent=t.a6;for(const t of Object.keys(e))this.layers[t]=new Me(t,e[t])}}const De=64/4096;class Pe{constructor(){this.features=new Map}clear(){this.features.clear()}load(e=[],t){for(const i of e){const e=i.id;if(null==e)continue;const n=this.features.get(e);if(n&&this.updateCache(n,t),i.geometry){const n=Le(i);this.updateCache(n,t),this.features.set(e,n)}else this.features.delete(e)}}updateCache(e,t){for(const{canonical:i,uid:n}of Object.values(t)){const{z:r,x:o,y:s}=i;Re(e,Math.pow(2,r),o,s)&&delete t[n]}}getTileRaw(e,t,i){const n=Math.pow(2,e),r=[];for(const e of this.features.values())Re(e,n,t,i)&&r.push(Be(e,n,t,i));return{features:r}}getFeatures(){return[...this.features.values()]}}function Re({minX:e,minY:t,maxX:i,maxY:n},r,o,s){return e<(o+1+De)/r&&t<(s+1+De)/r&&i>(o-De)/r&&n>(s-De)/r}function Le(e){const{id:t,geometry:i,properties:n}=e;if("GeometryCollection"===i.type)throw new Error("GeometryCollection not supported in dynamic mode.");const{type:r,coordinates:o}=i,s={id:t,type:1,geometry:[],tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},a=s.geometry;if("Point"===r)ze(o,a,s);else if("MultiPoint"===r)for(const e of o)ze(e,a,s);else if("LineString"===r)s.type=2,Fe(o,a,s);else if("MultiLineString"===r)s.type=2,Oe(o,a,s);else if("Polygon"===r)s.type=3,Oe(o,a,s,!0);else{if("MultiPolygon"!==r)throw new Error("Input data is not a valid GeoJSON object.");s.type=3;for(const e of o)Oe(e,a,s,!0)}return s}
vendor: 24,312 bytes, line 2
2function ze([e,i],n,r){const o=t.a7(e);let s=t.a8(i);s=s<0?0:s>1?1:s,n.push(o,s),r.minX=Math.min(r.minX,o),r.minY=Math.min(r.minY,s),r.maxX=Math.max(r.maxX,o),r.maxY=Math.max(r.maxY,s)}function Fe(e,t,i,n=!1,r=!1){const o=[];for(const t of e)ze(t,o,i);t.push(o),n&&function(e,t){let i=0;for(let t=0,n=e.length,r=n-2;t<n;r=t,t+=2)i+=(e[t]-e[r])*(e[t+1]+e[r+1]);if(i>0===t)for(let t=0,i=e.length;t<i/2;t+=2){const n=e[t],r=e[t+1];e[t]=e[i-2-t],e[t+1]=e[i-1-t],e[i-2-t]=n,e[i-1-t]=r}}(o,r)}function Oe(e,t,i,n=!1){for(let r=0;r<e.length;r++)Fe(e[r],t,i,n,0===r)}function ke(e,i,n){return Math.round(t.a6*(e*i-n))}function Be(e,t,i,n){const{id:r,type:o,geometry:s,tags:a}=e;if(1===o){const e=s;if(2===e.length)return{id:r,type:4,x:ke(e[0],t,i),y:ke(e[1],t,n),tags:a};const o=new Int32Array(e.length);for(let r=0;r<e.length;r+=2)o[r]=ke(e[r],t,i),o[r+1]=ke(e[r+1],t,n);return{id:r,type:1,geometry:o,tags:a}}const l=[];if(2===o){const e=[];for(const r of s)Ne(r,t,i,n,e);for(const t of e)l.push(new Int32Array(t))}else for(const e of s)Ve(e,t,i,n,l);return{id:r,type:o,geometry:l,tags:a}}function Ne(e,i,n,r,o){const s=-128,a=t.a6+128;let l;for(let t=0;t<e.length-2;t+=2){let c=ke(e[t+0],i,n),u=ke(e[t+1],i,r),h=ke(e[t+2],i,n),d=ke(e[t+3],i,r);const f=h-c,p=d-u;c<s&&h<s||(c<s?(u+=Math.round(p*((s-c)/f)),c=s):h<s&&(d=u+Math.round(p*((s-c)/f)),h=s),u<s&&d<s||(u<s?(c+=Math.round(f*((s-u)/p)),u=s):d<s&&(h=c+Math.round(f*((s-u)/p)),d=s),c>=a&&h>=a||(c>=a?(u+=Math.round(p*((a-c)/f)),c=a):h>=a&&(d=u+Math.round(p*((a-c)/f)),h=a),u>=a&&d>=a||(u>=a?(c+=Math.round(f*((a-u)/p)),u=a):d>=a&&(h=c+Math.round(f*((a-u)/p)),d=a),l&&c===l.at(-2)&&u===l.at(-1)||(l=[c,u],o.push(l)),l.push(h,d)))))}}function Ve(e,t,i,n,r){const o=(i-De)/t,s=(n-De)/t,a=(i+1+De)/t,l=(n+1+De)/t;function c(e,t){let i=0;return e<o?i|=1:e>a&&(i|=2),t<s?i|=4:t>l&&(i|=8),i}let u=[];for(let t=1;t<=8;t*=2){let i=e.at(-2),n=e.at(-1),r=!(c(i,n)&t);for(let h=0;h<e.length;h+=2){const d=e[h],f=e[h+1],p=!(c(d,f)&t);p!==r&&(8&t?u.push(i+(d-i)*(l-n)/(f-n),l):4&t?u.push(i+(d-i)*(s-n)/(f-n),s):2&t?u.push(a,n+(f-n)*(a-i)/(d-i)):1&t&&u.push(o,n+(f-n)*(o-i)/(d-i))),p&&u.push(d,f),i=d,n=f,r=p}if(!(e=u).length||8===t)break;u=[]}if(!u.length)return;const h=new Int32Array(u.length);for(let e=0;e<u.length;e+=2)h[e]=ke(u[e],t,i),h[e+1]=ke(u[e+1],t,n);r.push(h)}function Ue({name:e,features:i},n){n.writeStringField(1,e),n.writeVarintField(5,t.a6);const r=new Map,o=new Map,s={keys:r,values:o,feature:null};for(const e of i)s.feature=e,n.writeMessage(2,je,s);for(const e of r.keys())n.writeStringField(3,e);for(const e of o.keys())n.writeMessage(4,qe,e)}function je(e,t){const i=e.feature;void 0!==i.id&&Number.isSafeInteger(+i.id)&&t.writeVarintField(1,+i.id),i.tags&&t.writeMessage(2,Ge,e),t.writeVarintField(3,4===i.type?1:i.type),t.writeMessage(4,Ze,i)}function Ge({keys:e,values:t,feature:i},n){const r=i.tags;for(const i of Object.keys(r)){let o=r[i];if(null===o)continue;let s=e.get(i);void 0===s&&(s=e.size,e.set(i,s)),n.writeVarint(s);const a=typeof o;"string"!==a&&"boolean"!==a&&"number"!==a&&(o=JSON.stringify(o));let l=t.get(o);void 0===l&&(l=t.size,t.set(o,l)),n.writeVarint(l)}}function $e(e,t){return(t<<3)+(7&e)}function He(e){return e<<1^e>>31}function Ze(e,t){if(4===e.type)return t.writeVarint($e(1,1)),t.writeVarint(He(e.x)),void t.writeVarint(He(e.y));let i=0,n=0;if(1===e.type){const{geometry:r}=e;t.writeVarint($e(1,r.length>>1));for(let e=0;e<r.length;e+=2){const o=r[e]-i,s=r[e+1]-n;t.writeVarint(He(o)),t.writeVarint(He(s)),i+=o,n+=s}}else{const r=3===e.type;for(const o of e.geometry){if(0===o.length)continue;t.writeVarint($e(1,1));const e=(o.length>>1)-(r?1:0);for(let r=0;r<e;r++){1===r&&t.writeVarint($e(2,e-1));const s=o[2*r]-i,a=o[2*r+1]-n;t.writeVarint(He(s)),t.writeVarint(He(a)),i+=s,n+=a}r&&t.writeVarint($e(7,1))}}}function qe(e,t){const i=typeof e;"string"===i?t.writeStringField(1,e):"boolean"===i?t.writeBooleanField(7,e):"number"===i&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}const We={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},Ye=1073741824,Xe=1/Ye,Je=e=>(e-.5)*Ye,Ke=e=>e*Xe+.5;class Qe{constructor(e){const t=this.options=Object.assign(Object.create(We),e);t.maxZoom=Math.min(t.maxZoom,30),t.minZoom=Math.min(t.minZoom,t.maxZoom),this.trees=new Array(t.maxZoom+1),this.stride=t.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:i,maxZoom:n}=this.options;t&&console.time("total time");const r=n+1,o=`z${r}: ${e.length} points`;t&&console.time(o);const s=this.stride;let a=e.length;for(const t of e){const e=t.geometry;e&&"MultiPoint"===e.type&&(a+=e.coordinates.length-1)}this.numPoints=a;const l=this.props=new Array(a),c=this.coords=new Float64Array(2*a);let u=null;const h=new Int32Array(a*s);let d=0,f=0;for(const t of e){const e=t.geometry;if(!e){f++;continue}const i=e.coordinates,n="MultiPoint"===e.type;for(let e=0,o=n?i.length:1;e<o;e++,f++){const[o,p]=n?i[e]:i,m=tt(o),_=it(p);c[2*f]=m,c[2*f+1]=_,h[d]=Je(m),h[d+1]=Je(_),h[d+2]=r,h[d+3]=f,h[d+4]=-1,h[d+5]=1,l[f]=t.properties,void 0!==t.id&&(u||(u=new Array(a)),u[f]=t.id),d+=s}}this.ids=u;let p=d===h.length?h:h.subarray(0,d),m=d/s;this.trees[n+1]=this._createTree(p,m),t&&console.timeEnd(o);let _=null;for(let e=n;e>=i;e--){const i=performance.now(),n=_||new Int32Array(m*s);_=null;const r=this._cluster(p,m,e,n);r===m?(this.trees[e]=this.trees[e+1],_=n):(this.trees[e]=this._createTree(n,r),p=n,m=r),t&&console.log(`z${e}: ${this.trees[e].numItems} clusters in ${(performance.now()-i).toFixed(2)}ms`)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let i=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let r=180===e[2]?180:((e[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)i=-180,r=180;else if(i>r){const e=this.getClusters([i,n,180,o],t),s=this.getClusters([-180,n,r,o],t);return e.concat(s)}const s=this.trees[this._limitZoom(t)],a=s.range(Je(tt(i)),Je(it(o)),Je(tt(r)),Je(it(n))),l=s.data,c=[];for(const e of a)c.push(this._featureJSON(l,this.stride*e));return c}getChildren(e){const t=this._getOriginId(e),i=this._getOriginZoom(e),n="No cluster with the specified id.",r=this.trees[i];if(!r)throw new Error(n);const o=r.data;if(t>=r.numItems)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=r.within(o[t*this.stride],o[t*this.stride+1],s*Ye),l=[];for(const t of a){const i=t*this.stride;o[i+4]===e&&l.push(this._featureJSON(o,i))}if(0===l.length)throw new Error(n);return l}getLeaves(e,t,i){const n=[];return this._appendLeaves(n,e,t=t||10,i=i||0,0),n}getTile(e,t,i){return this._getTile(e,t,i,!1)}getTileRaw(e,t,i){return this._getTile(e,t,i,!0)}_getTile(e,t,i,n){const r=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:s,radius:a}=this.options,l=a/s,c=Je((i-l)/o),u=Je((i+1+l)/o),h={features:[]};return this._addTileFeatures(r.range(Je((t-l)/o),c,Je((t+1+l)/o),u),r.data,t,i,o,h,n),0===t&&this._addTileFeatures(r.range(Je(1-l/o),c,Je(1),u),r.data,o,i,o,h,n),t===o-1&&this._addTileFeatures(r.range(Je(0),c,Je(l/o),u),r.data,-1,i,o,h,n),h.features.length?h:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const i=this.getChildren(e);if(t++,1!==i.length)break;e=i[0].properties.cluster_id}return t}_appendLeaves(e,t,i,n,r){const o=this.getChildren(t);for(const t of o){const o=t.properties;if(o&&o.cluster?r+o.point_count<=n?r+=o.point_count:r=this._appendLeaves(e,o.cluster_id,i,n,r):r<n?r++:e.push(t),e.length===i)break}return r}_createTree(e,i){const n=new t.dx(i,this.options.nodeSize,Int32Array),r=this.stride;for(let t=0;t<i;t++)n.add(e[t*r],e[t*r+1]);return n.finish(),n.data=e,n}_addTileFeatures(e,t,i,n,r,o,s){for(const a of e){const e=a*this.stride,l=t[e+5]>1;let c,u,h;if(l)c=et(t,e,this.clusterProps),u=Ke(t[e]),h=Ke(t[e+1]);else{const i=t[e+3];c=this.props[i],u=this.coords[2*i],h=this.coords[2*i+1]}const d=Math.round(this.options.extent*(u*r-i)),f=Math.round(this.options.extent*(h*r-n)),p=s?{type:4,x:d,y:f,tags:c}:{type:1,geometry:[[d,f]],tags:c},m=t[e+3],_=l||this.options.generateId?m:this.ids?this.ids[m]:void 0;void 0!==_&&(p.id=_),o.features.push(p)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t,i,n){const{radius:r,extent:o,reduce:s,minPoints:a,maxZoom:l}=this.options,c=r/(o*(1<<i))*Ye,u=l+1,h=this.trees[i+1],d=this.stride,f=t*d,p=new Uint32Array(t);let m=0;for(let t=0;t<f;t+=d){if(e[t+2]<=i)continue;e[t+2]=i;const r=e[t],o=e[t+1],l=h.withinInto(r,o,c,p),f=e[t+5];let _=f;for(let t=0;t<l;t++){const n=p[t]*d;e[n+2]>i&&(_+=e[n+5])}if(_>f&&_>=a){let a,c=r*f,h=o*f,g=-1;const y=(t/d<<5)+(i+1)+this.numPoints;for(let n=0;n<l;n++){const r=p[n]*d;if(e[r+2]<=i)continue;e[r+2]=i;const o=e[r+5];c+=e[r]*o,h+=e[r+1]*o,e[r+4]=y,s&&(a||(a=this._map(e,t,!0),g=this.clusterProps.length,this.clusterProps.push(a)),s(a,this._map(e,r)))}e[t+4]=y,n[m]=c/_,n[m+1]=h/_,n[m+2]=u,n[m+3]=y,n[m+4]=-1,n[m+5]=_,s&&(n[m+6]=g),m+=d}else{for(let i=0;i<d;i++)n[m+i]=e[t+i];if(m+=d,_>1)for(let t=0;t<l;t++){const r=p[t]*d;if(!(e[r+2]<=i)){e[r+2]=i;for(let t=0;t<d;t++)n[m+t]=e[r+t];m+=d}}}}return m/d}_getOriginId(e){return e-this.numPoints>>5}_getOriginZoom(e){return(e-this.numPoints)%32}_featureJSON(e,t){const i=e[t+3],n=e[t+5]>1,r=n?i:this.ids?this.ids[i]:void 0,o={type:"Feature",properties:n?et(e,t,this.clusterProps):this.props[i],geometry:{type:"Point",coordinates:n?[nt(Ke(e[t])),rt(Ke(e[t+1]))]:[nt(this.coords[2*i]),rt(this.coords[2*i+1])]}};return void 0!==r&&(o.id=r),o}_map(e,t,i){if(e[t+5]>1){const n=this.clusterProps[e[t+6]];return i?Object.assign({},n):n}const n=this.props[e[t+3]],r=this.options.map(n);return i&&r===n?Object.assign({},r):r}}function et(e,t,i){const n=e[t+5],r=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=e[t+6],s=-1===o?{}:Object.assign({},i[o]);return Object.assign(s,{cluster:!0,cluster_id:e[t+3],point_count:n,point_count_abbreviated:r})}function tt(e){return e/360+.5}function it(e){const t=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return i<0?0:i>1?1:i}function nt(e){return 360*(e-.5)}function rt(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}const ot=2147483647;function st(e,t,i,n){return{id:e,type:4,x:t,y:i,tags:n}}function at(e,t,i,n){const r={id:e,type:t,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(1===t)lt(r,i,0,i.length);else{const e=3===t;for(let t=0;t<i.length;){const n=t+2,o=n+3*i[t];(!e||i[t+1]>=0)&<(r,i,n,o),t=o}}return r}function lt(e,t,i,n){for(let r=i;r<n;r+=3){const i=t[r],n=t[r+1];i<e.minX&&(e.minX=i),n<e.minY&&(e.minY=n),i>e.maxX&&(e.maxX=i),n>e.maxY&&(e.maxY=n)}}function ct(e,t,i,n){let r=n;const o=t+(i-t>>1);let s,a=i-t;const l=e[t],c=e[t+1],u=e[i],h=e[i+1];for(let n=t+3;n<i;n+=3){const t=ut(e[n],e[n+1],l,c,u,h);if(t>r)s=n,r=t;else if(t===r){const e=Math.abs(n-o);e<a&&(s=n,a=e)}}if(r>n){const o=s;o-t>3&&ct(e,t,o,n),e[o+2]=Math.min(Math.sqrt(r),ot),i-o>3&&ct(e,o,i,n)}}function ut(e,t,i,n,r,o){let s=r-i,a=o-n;if(0!==s||0!==a){const l=((e-i)*s+(t-n)*a)/(s*s+a*a);l>1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return s=e-i,a=t-n,s*s+a*a}const ht="Input data is not a valid GeoJSON object.";function dt(e,t,i,n){const r=t.geometry;if(!r)return;const o="GeometryCollection"===r.type?r.geometries:r.coordinates;if(!o)throw new Error(ht);if(!o.length)return;const s=i.tolerance*i.worldScale/((1<<i.maxZoom)*i.extent),a=s*s,l=t.properties,c=i.CoordArray,u=i.worldScale,h=i.originShift,d=i.useInt32;let f=t.id;if(i.promoteId?f=t.properties?.[i.promoteId]:i.generateId&&(f=n||0),"Point"===r.type)e.push(st(f,vt(r.coordinates[0],u,h),xt(r.coordinates[1],u,h),l));else if("MultiPoint"===r.type){const t=r.coordinates,n=new c(3*t.length);for(let e=0;e<t.length;e++)n[3*e]=yt(vt(t[e][0],u,h),d),n[3*e+1]=yt(xt(t[e][1],u,h),d);mt(e,f,1,n,l,i)}else if("LineString"===r.type)_t(e,f,r.coordinates,l,a,i);else if("MultiLineString"===r.type&&i.lineMetrics)for(const t of r.coordinates)_t(e,f,t,l,a,i);else if("MultiLineString"===r.type||"Polygon"===r.type||"MultiPolygon"===r.type){const t="MultiLineString"!==r.type,n="MultiPolygon"===r.type?r.coordinates:[r.coordinates];let o=0;for(const e of n)o+=ft(e);const s=new c(o);let p=0;for(const e of n)for(let i=0;i<e.length;i++)p=gt(s,p,e[i],a,t,t&&0===i,u,h,d);mt(e,f,t?3:2,s,l,i)}else{if("GeometryCollection"!==r.type)throw new Error(ht);for(const o of r.geometries)dt(e,{id:f,geometry:o,properties:t.properties},i,n)}}function ft(e){let t=0;for(const i of e)i.length>0&&(t+=2+3*i.length);return t}let pt=0;function mt(e,t,i,n,r,o,s){const a=at(t,i,n,r);2===i&&o.lineMetrics&&(a.start=0,a.end=a.size=s),e.push(a)}function _t(e,t,i,n,r,o){const s=new o.CoordArray(2+3*i.length);gt(s,0,i,r,!1,!1,o.worldScale,o.originShift,o.useInt32),mt(e,t,2,s,n,o,pt)}function gt(e,t,i,n,r,o,s,a,l){if(0===i.length)return t;const c=t,u=t+=2;let h=0,d=0,f=0;for(let n=0;n<i.length;n++){const o=yt(vt(i[n][0],s,a),l),c=yt(xt(i[n][1],s,a),l);if(e[t]=o,e[t+1]=c,t+=3,n>0)if(r)f+=(h*c-o*d)/2;else{const e=o-h,t=c-d;f+=Math.sqrt(e*e+t*t)}h=o,d=c}const p=t;if(r&&(o&&f<0||!o&&f>=0)){const t=p-u;for(let i=0;i<t/2;i+=3){const t=u+i,n=p-3-i,r=e[t],o=e[t+1],s=e[t+2];e[t]=e[n],e[t+1]=e[n+1],e[t+2]=e[n+2],e[n]=r,e[n+1]=o,e[n+2]=s}f=-f}const m=p-3;return e[u+2]=ot,ct(e,u,m,n),e[m+2]=ot,e[c]=(p-u)/3,r?e[c+1]=Math.sign(f)*Math.sqrt(Math.abs(f)):(pt=f,e[c+1]=Math.min(f,ot)),t}function yt(e,t){return t?Math.floor(e+.5):e}function vt(e,t,i){return(e/360+.5-i)*t}function xt(e,t,i){const n=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+n)/(1-n))/Math.PI;return((r<0?0:r>1?1:r)-i)*t}function bt(e,t,i,n,r,o,s){if(r>=t&&o<i)return e;if(o<t||r>=i)return null;const a=s.lineMetrics,l=s.CoordArray;let c=null;for(let r=0;r<e.length;r++){const o=e[r],s=o.type;if(4===s){const s=0===n?o.x:o.y;s>=t&&s<i?null!==c&&c.push(o):null===c&&(c=e.slice(0,r));continue}const u=o.geometry,h=0===n?o.minX:o.minY,d=0===n?o.maxX:o.maxY;h>=t&&d<i?null!==c&&c.push(o):d<t||h>=i?null===c&&(c=e.slice(0,r)):(null===c&&(c=e.slice(0,r)),1!==s?Tt(u,s,t,i,n,o,c,a,l):wt(u,t,i,n,o,c,l))}return null===c?e:c.length?c:null}function wt(e,t,i,n,r,o,s){let a=0;for(let r=0;r<e.length;r+=3)e[r+n]>=t&&e[r+n]<i&&(a+=3);if(0===a)return;const l=new s(a);let c=0;for(let r=0;r<e.length;r+=3)e[r+n]>=t&&e[r+n]<i&&(l[c]=e[r],l[c+1]=e[r+1],l[c+2]=e[r+2],c+=3);o.push(at(r.id,1,l,r.tags))}function Tt(e,t,i,n,r,o,s,a,l){const c=3===t;let u=0;for(let t=0;t<e.length;){const o=t+2+3*e[t];u+=Et(e,t+2,o,i,n,r,c),t=o}if(0===u)return;let h=new l(u);const d=l===Int32Array,f=a&&2===t?[]:null;let p=0;for(let t=0;t<e.length;){const s=t+2+3*e[t];p=St(e,t+2,s,e[t+1],h,p,i,n,r,c,d,f,o.start||0),t=s}if(p<u&&(h=h.subarray(0,p)),null!==f)for(let e=0,t=0;e<h.length;t+=2){const i=e+2+3*h[e],n=at(o.id,2,h.slice(e,i),o.tags);n.start=f[t],n.end=f[t+1],n.size=o.size,s.push(n),e=i}else s.push(at(o.id,t,h,o.tags))}function Et(e,t,i,n,r,o,s){let a=0,l=0,c=0,u=0;for(let h=t;h<i-3;h+=3){const t=e[h+o],i=e[h+3+o];let d=!1;t<n?i>=n&&(c++,u++):t>r?i<=r&&(c++,u++):c++,i<n&&t>=n&&(c++,u++,d=!0),i>r&&t<=r&&(c++,u++,d=!0),!s&&d&&(c>0&&(l+=c,a++),c=0)}const h=e[i-3+o];return h>=n&&h<=r&&c++,s&&c>=2&&u>=1&&c++,c>0&&(l+=c,a++),3*l+2*a}function St(e,t,i,n,r,o,s,a,l,c,u,h,d){const f=null!==h;let p=o;r[o]=0,r[o+1]=n;let m=o+=2,_=d,g=_,y=0,v=0;for(let d=t;d<i-3;d+=3){const t=e[d],i=e[d+1],x=e[d+2],b=e[d+3],w=e[d+4],T=0===l?t:i,E=0===l?b:w;let S=!1;if(f&&(y=Math.sqrt((t-b)*(t-b)+(i-w)*(i-w))),T<s?E>=s&&(v=It(r,o,t,i,b,w,s,l,u),o+=3,f&&(g=_+y*v)):T>a?E<=a&&(v=It(r,o,t,i,b,w,a,l,u),o+=3,f&&(g=_+y*v)):(r[o]=t,r[o+1]=i,r[o+2]=x,o+=3),E<s&&T>=s&&(v=It(r,o,t,i,b,w,s,l,u),o+=3,S=!0),E>a&&T<=a&&(v=It(r,o,t,i,b,w,a,l,u),o+=3,S=!0),!c&&S){const e=(o-m)/3;e>0&&(r[p]=e,f&&h.push(g,_+y*v),p=o,r[o]=0,r[o+1]=n,m=o+=2)}f&&(_+=y)}const x=i-3,b=e[x],w=e[x+1],T=e[x+2],E=0===l?b:w;E>=s&&E<=a&&(r[o]=b,r[o+1]=w,r[o+2]=T,o+=3),c&&o-m>=6&&(r[o-3]!==r[m]||r[o-2]!==r[m+1])&&(r[o]=r[m],r[o+1]=r[m+1],r[o+2]=r[m+2],o+=3);const S=(o-m)/3;return S>0?(r[p]=S,f&&h.push(g,_)):o=p,o}function It(e,t,i,n,r,o,s,a,l){let c;if(0===a){c=(s-i)/(r-i);const a=n+(o-n)*c;e[t]=s,e[t+1]=l?Math.floor(a+.5):a}else{c=(s-n)/(o-n);const a=i+(r-i)*c;e[t]=l?Math.floor(a+.5):a,e[t+1]=s}return e[t+2]=ot,c}function At(e,t){const i=[];for(const n of e){if(4===n.type){i.push(st(n.id,n.x+t,n.y,n.tags));continue}const e=Mt(n.geometry,n.type,t),r=at(n.id,n.type,e,n.tags);void 0!==n.start&&(r.start=n.start,r.end=n.end,r.size=n.size),i.push(r)}return i}function Mt(e,t,i){const n=e.slice();if(1===t)for(let e=0;e<n.length;e+=3)n[e]+=i;else for(let e=0;e<n.length;){const t=e+2+3*n[e];for(let r=e+2;r<t;r+=3)n[r]+=i;e=t}return n}function Ct(e,t,i,n,r){const o=r.extent,s=r.worldScale,a=r.originShift,l=t===r.maxZoom?0:r.tolerance*s/((1<<t)*o),c=1<<t,u=o+r.buffer<=32767?Int16Array:Int32Array,h={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:i,y:n,z:t,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(const t of e)Pt(h,t,l,r,c,i,n,o,u,s,a);return h}function Dt(e,t,i,n,r,o){return Math.round(n*((e/r+o)*t-i))}function Pt(e,t,i,n,r,o,s,a,l,c,u){const h=t.type;if(4===h){const i=t.x,n=t.y;i<e.minX&&(e.minX=i),n<e.minY&&(e.minY=n),i>e.maxX&&(e.maxX=i),n>e.maxY&&(e.maxY=n),e.numPoints++,e.numSimplified++;const l={x:Dt(i,r,o,a,c,u),y:Dt(n,r,s,a,c,u),type:4,tags:t.tags||null};return void 0!==t.id&&(l.id=t.id),void e.features.push(l)}const d=t.geometry;let f;if(t.minX<e.minX&&(e.minX=t.minX),t.minY<e.minY&&(e.minY=t.minY),t.maxX>e.maxX&&(e.maxX=t.maxX),t.maxY>e.maxY&&(e.maxY=t.maxY),1===h){const t=d.length/3;f=new l(2*t);for(let e=0,t=0;e<d.length;e+=3,t+=2)f[t]=Dt(d[e],r,o,a,c,u),f[t+1]=Dt(d[e+1],r,s,a,c,u);if(e.numPoints+=t,e.numSimplified+=t,!f.length)return}else{f=[];for(let t=0;t<d.length;){const n=t+2,h=n+3*d[t];Rt(f,d,n,h,d[t+1],e,i,0,r,o,s,a,l,c,u),t=h}if(!f.length)return}let p=t.tags||null;if(2===h&&n.lineMetrics){p={};for(const e in t.tags)p[e]=t.tags[e];const e=t.start,i=t.end,n=t.size,o=a*r/c;p.mapbox_clip_feature_len=n*o,p.mapbox_clip_seg_len=(i-e)*o,p.mapbox_clip_start=n>0?Math.max(0,e/n):0,p.mapbox_clip_end=i>=n?1:i/n}const m={geometry:f,type:h,tags:p};void 0!==t.id&&(m.id=t.id),e.features.push(m)}function Rt(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p){const m=(n-i)/3;if(Math.abs(r)<s)return void(o.numPoints+=m);let _=0;if(0===s)_=m;else for(let e=i;e<n;e+=3)t[e+2]>s&&_++;o.numPoints+=m,o.numSimplified+=_;const g=new d(2*_);let y=0;for(let e=i;e<n;e+=3)(0===s||t[e+2]>s)&&(g[y++]=Dt(t[e],l,c,h,f,p),g[y++]=Dt(t[e+1],l,u,h,f,p));e.push(g)}const Lt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class zt{constructor(e,t){const i=this.options=Object.assign(Object.create(Lt),t),n=i.debug;if(n&&console.time("preprocess data"),i.maxZoom<0||i.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(i.promoteId&&i.generateId)throw new Error("promoteId and generateId cannot be used together.");const r=(i.extent+2*i.buffer)*(1<<i.maxZoom)<4294967296;i.useInt32=r,i.CoordArray=r?Int32Array:Float64Array,i.worldScale=r?i.extent*(1<<i.maxZoom):1,i.originShift=r?.5:0;let o=function(e,t){const i=[];if("FeatureCollection"===e.type)for(let n=0;n<e.features.length;n++)dt(i,e.features[n],t,n);else dt(i,"Feature"===e.type?e:{geometry:e,properties:null},t);return i}(e,i);if(this.tiles={},this.tileCoords=[],this.stats={},this.total=0,n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",i.indexMaxZoom,i.indexMaxPoints),console.time("generate tiles")),o=function(e,t){const i=t.worldScale,n=t.originShift,r=t.buffer*i/t.extent,o=-n*i,s=(1-n)*i;let a=e;const l=bt(e,o-i-r,o+r,0,o-i,s+i,t),c=bt(e,s-r,s+i+r,0,o-i,s+i,t);return(l||c)&&(a=bt(e,o-r,s+r,0,o-i,s+i,t)||[],l&&(a=At(l,i).concat(a)),c&&(a=a.concat(At(c,-i)))),a}(o,i),o.length&&this.splitTile(o,0,0,0),n){const e=this.tiles[0];e&&console.log(`features: ${e.numFeatures}, points: ${e.numPoints}`),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats))}}splitTile(e,t,i,n,r,o,s){const a=[e],l=[t,i,n],c=this.options,u=c.debug;for(;a.length;){n=l.pop(),i=l.pop(),t=l.pop(),e=a.pop();const h=1<<t,d=Ot(t,i,n);let f=this.tiles[d];if(f||(u>1&&console.time("creation"),f=this.tiles[d]=Ct(e,t,i,n,c),this.tileCoords.push({z:t,x:i,y:n}),this.stats[t]=(this.stats[t]||0)+1,this.total++,u>1&&(console.log(`tile z${t}-${i}-${n} (features: ${f.numFeatures}, points: ${f.numPoints}, simplified: ${f.numSimplified})`),console.timeEnd("creation"))),f.source=e,null==r){if(t===c.indexMaxZoom||f.numPoints<=c.indexMaxPoints)continue}else{if(t===c.maxZoom||t===r)continue;{const e=r-t;if(i!==o>>e||n!==s>>e)continue}}if(f.source=null,0===e.length)continue;u>1&&console.time("clipping");const p=c.worldScale,m=c.originShift,_=p/h,g=.5*c.buffer*p/(h*c.extent),y=(i/h-m)*p,v=(n/h-m)*p;let x=null,b=null,w=null,T=null;const E=bt(e,y-g,y+_/2+g,0,f.minX,f.maxX,c),S=bt(e,y+_/2-g,y+_+g,0,f.minX,f.maxX,c);E&&(x=bt(E,v-g,v+_/2+g,1,f.minY,f.maxY,c),b=bt(E,v+_/2-g,v+_+g,1,f.minY,f.maxY,c)),S&&(w=bt(S,v-g,v+_/2+g,1,f.minY,f.maxY,c),T=bt(S,v+_/2-g,v+_+g,1,f.minY,f.maxY,c)),u>1&&console.timeEnd("clipping"),a.push(x||[],b||[],w||[],T||[]),l.push(t+1,2*i,2*n,t+1,2*i,2*n+1,t+1,2*i+1,2*n,t+1,2*i+1,2*n+1)}}getTile(e,t,i){const n=this.findTile(e,t,i);return n?function(e){const t=[];for(const i of e.features){let e;e=4===i.type?{type:1,geometry:[[i.x,i.y]],tags:i.tags??null}:1===i.type?{type:1,geometry:Ft(i.geometry),tags:i.tags??null}:{type:i.type,geometry:i.geometry.map(Ft),tags:i.tags??null},null!=i.id&&(e.id=i.id),t.push(e)}return{features:t}}(n):null}getTileRaw(e,t,i){const n=this.findTile(e,t,i);return n?{features:n.features}:null}findTile(e,t,i){const n=this.options.debug;if((e=+e)<0||e>24)return null;const r=1<<e,o=Ot(e,t=(t=+t)+r&r-1,i=+i);if(this.tiles[o])return this.tiles[o];n>1&&console.log("drilling down to z%d-%d-%d",e,t,i);let s,a=e,l=t,c=i;for(;!s&&a>0;)a--,l>>=1,c>>=1,s=this.tiles[Ot(a,l,c)];return s&&s.source?(n>1&&(console.log("found parent tile z%d-%d-%d",a,l,c),console.time("drilling down")),this.splitTile(s.source,a,l,c,e,t,i),n>1&&console.timeEnd("drilling down"),this.tiles[o]??null):null}}function Ft(e){const t=[];for(let i=0;i<e.length;i+=2)t.push([e[i],e[i+1]]);return t}function Ot(e,t,i){return 32*((1<<e)*i+t)+e}function kt(e,i){const n=e.tileID.canonical;if(!this._geoJSONIndex)return void i(null,null);const r=this._geoJSONIndex.getTileRaw(n.z,n.x,n.y);if(!r)return void i(null,null);const o=e=>e.tags&&"3d_elevation_id"in e.tags&&"source"in e.tags&&"elevation"===e.tags.source,s=r.features.filter(o);let a={_geojsonTileLayer:r.features};s.length>0&&(a={_geojsonTileLayer:r.features.filter(e=>!o(e)),hd_road_elevation:s});const l=new Ce(a),c=function(e){const i=new t.gp;for(const t of Object.keys(e))i.writeMessage(3,Ue,{name:t,features:e[t]});return i.finish()}(a).buffer;i(null,{vectorTile:l,rawData:c,headers:new Headers})}class Bt extends Ee{constructor(e){super(e),this.loadVectorData=kt,this._dynamicIndex=new Pe}async loadData(e){const n=e&&e.request,r=n&&n.collectResourceTiming;this._geoJSONIndex=null;let o=await new Promise((t,i)=>{this.loadGeoJSON(e,(e,n)=>{e?i(e):t(n)})});if(!o)return{};if("object"!=typeof o)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(e.filter){const i=t.c(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===i.result)throw new Error(i.value.map(e=>`${e.key}: ${e.message}`).join(", "));o.features=o.features.filter(e=>i.value.evaluate({zoom:0},e))}e.dynamic?("Feature"===o.type&&(o={type:"FeatureCollection",features:[o]}),e.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(o.features,this.loaded),e.cluster&&(o.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=e.cluster?new Qe(function({superclusterOptions:e,clusterProperties:i}){if(!i||!e)return e;const n={},r={},o={accumulated:null,zoom:0},s={properties:null},a=Object.keys(i);for(const e of a){const[o,s]=i[e],a=t.c(s),l=t.c("string"==typeof o?[o,["accumulated"],["get",e]]:o);n[e]=a.value,r[e]=l.value}return e.map=e=>{s.properties=e;const t={};for(const e of a)t[e]=n[e].evaluate(o,s);return t},e.reduce=(e,t)=>{s.properties=t;
vendor: 12,045 bytes, line 2
2for(const t of a)o.accumulated=e[t],e[t]=r[t].evaluate(o,s)},e}(e)).load(o.features):e.dynamic?this._dynamicIndex:new zt(o,e.geojsonVtOptions);const s={};if(r){const t=i(n);t&&(s.resourceTiming={},s.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}return s}async reloadTile(e){const t=this.loaded;if(t&&t[e.uid]){if(e.partial)return;return super.reloadTile(e)}return this.loadTile(e)}loadGeoJSON(e,i){if(e.request)t.g(e.request).then(({data:e})=>i(null,e)).catch(e=>i(e));else{if("string"!=typeof e.data)return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`));setTimeout(()=>{try{return i(null,JSON.parse(e.data))}catch(t){return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`))}},0)}}getClusterExpansionZoom(e){return this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)}getClusterChildren(e){return this._geoJSONIndex.getChildren(e.clusterId)}getClusterLeaves(e){return this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset)}}t.c_.setPbf(t.c$);class Nt{constructor(e){this._mrt=new t.c_(e.partial?30:1/0),this._isHeaderLoaded=!1,this.uid=e.uid,this.tileID=e.tileID,this.source=e.source}async parse(e){const i=this._mrt;this.status="parsing",this._entireBuffer=e,i.parseHeader(e),this._isHeaderLoaded=!0;const n=[];for(const r in i.layers){const o=i.getLayer(r),s=o.getDataRange(o.getBandList()),a=i.createDecodingTask(s),l=e.slice(s.firstByte,s.lastByte+1);n.push(t.c_.performDecoding(l,a).then(e=>a.complete(null,e)).catch(e=>a.complete(e,null)))}return await Promise.allSettled(n),i}}class Vt{constructor({actor:e}){this.actor=e,this.loading={},this.loaded={}}async loadTile(e){const i=e.uid,n=new AbortController,r=this.loading[i]=new Nt(e);r.abort=()=>n.abort();try{const{data:o,headers:s}=await t.d0(e.request,n.signal);return o?(this.loaded[i]=r,{mrt:await r.parse(o),headers:s}):(r.status="done",this.loaded[i]=r,null)}catch(e){if(n.signal.aborted)return null;throw r.status="done",this.loaded[i]=r,e}finally{delete this.loading[i]}}async reloadTile(e){}abortTile(e){const t=e.uid,i=this.loading[t];i&&(i.abort&&i.abort(),delete this.loading[t])}removeTile(e){const t=e.uid;this.loaded[t]&&delete this.loaded[t]}async decodeRasterArray(e){return t.c_.performDecoding(e.buffer,e.task)}}class Ut{constructor(e){this.self=e,this.actor=new t.ax(e,this),this.layerIndexes={},this.availableImages={},this.availableModels={},this.isSpriteLoaded={},this.rtlPluginParsingListeners=[],this.projections={},this.defaultProjection=t.gr({name:"mercator"}),this.workerSourceTypes={vector:Ee,geojson:Bt,"raster-dem":Se},this.workerSources={},this.self.registerRTLTextPlugin=e=>{if(t.fN.isParsed())throw new Error("RTL text plugin already registered.");t.fN.setState({pluginStatus:t.gs.parsed,pluginURL:t.fN.getPluginURL()}),t.fN.applyArabicShaping=e.applyArabicShaping,t.fN.processBidirectionalText=e.processBidirectionalText,t.fN.processStyledBidirectionalText=e.processStyledBidirectionalText;for(const{resolve:e}of this.rtlPluginParsingListeners)e(!0);this.rtlPluginParsingListeners=[]}}clearCaches(e,t){delete this.layerIndexes[e],delete this.availableImages[e],delete this.availableModels[e],delete this.workerSources[e],delete this.isSpriteLoaded[e]}checkIfReady(e,t){}spriteLoaded(e,i){const{scope:n}=i;if(this.isSpriteLoaded[e]||(this.isSpriteLoaded[e]={}),this.isSpriteLoaded[e][n]=!0,this.workerSources[e]&&this.workerSources[e][n])for(const i in this.workerSources[e][n]){const r=this.workerSources[e][n][i];for(const e in r){const i=r[e];i instanceof Ee&&(i.isSpriteLoaded=!0,i.fire(new t.h("isSpriteLoaded")))}}}setImages(e,t){this.availableImages[e]||(this.availableImages[e]={});const{scope:i,images:n}=t;if(this.availableImages[e][i]=n,t.isSpriteLoaded&&this.spriteLoaded(e,{scope:i}),this.workerSources[e]&&this.workerSources[e][i])for(const t in this.workerSources[e][i]){const r=this.workerSources[e][i][t];for(const e in r)r[e].availableImages=n}}setModels(e,{scope:t,models:i}){if(this.availableModels[e]||(this.availableModels[e]={}),this.availableModels[e][t]=i,this.workerSources[e]&&this.workerSources[e][t])for(const n in this.workerSources[e][t]){const r=this.workerSources[e][t][n];for(const e in r)r[e].availableModels=i}}setProjection(e,i){this.projections[e]=t.gr(i)}setGlobalParams(e,i){if(this.referrer=i.referrer,Object.assign(t.eS,i.config),i.contextOptions){const{maxBindingPoints:e,maxUniformBlockSizeDwords:t}=i.contextOptions;this.maxUniformBufferBindings=e,this.maxUniformBlockSizeDwords=t}}upsertRenderParams(e,t){void 0!==t.brightness&&(this.brightness=t.brightness),void 0!==t.worldview&&(this.worldview=t.worldview)}setLayers(e,t){this.getLayerIndex(e,t.scope).replace(t.layers,t.options)}updateLayers(e,t){this.getLayerIndex(e,t.scope).update(t.layers,t.removedIds,t.options)}async loadTile(e,i){if(i.projection=this.projections[e]||this.defaultProjection,"batched-model"===i.type&&!this.workerSourceTypes["batched-model"]){if(await t.gt(),!y)throw new Error('Could not load Standard module for "batched-model" source.');this.workerSourceTypes["batched-model"]=y}return"raster-array"===i.type&&await this.ensureRasterArrayWorkerSource(),this.getWorkerSource(e,i).loadTile(i)}async ensureRasterArraySource(e,t){await this.ensureRasterArrayWorkerSource()}async ensureRasterArrayWorkerSource(){if(!this.workerSourceTypes["raster-array"]){if(await async function(){return Promise.resolve()}(),!Vt)throw new Error('Could not load raster-array module for "raster-array" source.');this.workerSourceTypes["raster-array"]=Vt}}async decodeRasterArray(e,t){return await this.ensureRasterArrayWorkerSource(),this.getWorkerSource(e,t).decodeRasterArray(t)}reloadTile(e,t){return t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t).reloadTile(t)}abortTile(e,t){const i=this.getExistingWorkerSource(e,t);return i?i.abortTile(t):void 0}removeTile(e,t){const i=this.getExistingWorkerSource(e,t);return i?i.removeTile(t):void 0}getExistingWorkerSource(e,t){const{type:i,source:n,scope:r}=t,o=this.workerSources[e];if(o&&o[r]&&o[r][i])return o[r][i][n]}async removeSource(e,t){const{type:i,source:n,scope:r}=t,o=this.workerSources[e]&&this.workerSources[e][r]&&this.workerSources[e][r][i],s=o&&o[n];s&&(delete o[n],s.removeSource&&await s.removeSource({source:n}))}async loadTileProvider(e,i){const n=new(await t.cN(i.name,i.url))(i.options);return this.getWorkerSource(e,{type:i.type,source:i.source,scope:i.scope},n),n.load&&i.request?n.load({request:i.request}):null}async syncRTLPluginState(e,i){if(t.fN.isParsed())return!0;if(t.fN.isParsing())return new Promise((e,t)=>{this.rtlPluginParsingListeners.push({resolve:e,reject:t})});t.fN.setState(i);const n=t.fN.getPluginURL();if(!t.fN.isLoaded()||t.fN.isParsed()||t.fN.isParsing())return!1;t.fN.setState({pluginStatus:t.gs.parsing,pluginURL:n});try{return await self.__mapboxImport(n),!!t.fN.isParsed()||new Promise((e,t)=>{this.rtlPluginParsingListeners.push({resolve:e,reject:t})})}catch(e){t.fN.setState({pluginStatus:t.gs.error,pluginURL:n});for(const{reject:t}of this.rtlPluginParsingListeners)t(e);throw this.rtlPluginParsingListeners=[],e}}getAvailableImages(e,t){this.availableImages[e]||(this.availableImages[e]={});let i=this.availableImages[e][t];return i||(i=[]),i}getAvailableModels(e,t){this.availableModels[e]||(this.availableModels[e]={});let i=this.availableModels[e][t];return i||(i={}),i}getLayerIndex(e,t){this.layerIndexes[e]||(this.layerIndexes[e]={});let i=this.layerIndexes[e][t];return i||(i=this.layerIndexes[e][t]=new w,i.scope=t),i}getWorkerSource(e,t,i){const{type:n,source:r,scope:o}=t,s=this.workerSources;if(s[e]||(s[e]={}),s[e][o]||(s[e][o]={}),s[e][o][n]||(s[e][o][n]={}),this.isSpriteLoaded[e]||(this.isSpriteLoaded[e]={}),this.getExistingWorkerSource(e,t))i&&(s[e][o][n][r].tileProvider=i);else{const t=this.actor.getWorkerSourceActor(e),a=this.workerSourceTypes[n];if(!a)throw new Error(`Unknown worker source type "${n}".`);s[e][o][n][r]=new a({actor:t,layerIndex:this.getLayerIndex(e,o),availableImages:this.getAvailableImages(e,o),availableModels:this.getAvailableModels(e,o),isSpriteLoaded:this.isSpriteLoaded[e][o],tileProvider:i,brightness:this.brightness,worldview:this.worldview,maxUniformBufferBindings:this.maxUniformBufferBindings,maxUniformBlockSizeDwords:this.maxUniformBlockSizeDwords})}return s[e][o][n][r]}enforceCacheSizeLimit(e,i){t.gu(i)}}return t.gq(self)&&(self.worker=new Ut(self)),Ut}),n(["./shared"],function(e){const t={antialias:!1,alpha:!0,stencil:!0,depth:!0};let i,n;function r(e){const i=document.createElement("canvas"),n=Object.create(t);n.failIfMajorPerformanceCaveat=e;const r=i.getContext("webgl2",n);if(!r)return!1;let o;try{o=r.createShader(r.VERTEX_SHADER)}catch(e){return!1}return!(!o||r.isContextLost())&&(r.shaderSource(o,"void main() {}"),r.compileShader(o),!0===r.getShaderParameter(o,r.COMPILE_STATUS))}const o=/firefox/i,s=/macintosh/i;function a(e,t,i){const n=document.createElement(e);return null!=t&&(n.className=t),i&&i.appendChild(n),n}function l(e,t,i){const n=document.createElementNS("http://www.w3.org/2000/svg",e);for(const e of Object.keys(t))n.setAttributeNS(null,e,String(t[e]));return i&&i.appendChild(n),n}const c="undefined"!=typeof document?document.documentElement&&document.documentElement.style:null,u=c&&void 0!==c.userSelect?"userSelect":"WebkitUserSelect";let h;function d(){c&&u&&(h=c[u],c[u]="none")}function f(){c&&u&&(c[u]=h)}function p(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",p,!0)}function m(){window.addEventListener("click",p,!0),window.setTimeout(()=>{window.removeEventListener("click",p,!0)},0)}function _(e,t){const i=e.getBoundingClientRect();return v(e,i,t)}function g(e,t){const i=e.getBoundingClientRect(),n=[];for(let r=0;r<t.length;r++)n.push(v(e,i,t[r]));return n}function y(e){return o.test(navigator.userAgent)&&s.test(navigator.userAgent)&&2===e.button&&e.ctrlKey?0:e.button}function v(t,i,n){const r=t.offsetWidth===i.width?1:t.offsetWidth/i.width;return new e.P((n.clientX-i.left)*r,(n.clientY-i.top)*r)}class x{constructor(){this._changed=!1,this._updatedLayers=Object.create(null),this._removedLayers=Object.create(null),this._updatedSourceCaches=Object.create(null),this._updatedPaintProps=new Set,this._updatedImages=Object.create(null)}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(e,t){this._updatedSourceCaches[e]=t,this.setDirty()}discardSourceCacheUpdate(e){delete this._updatedSourceCaches[e]}updateLayer(e){const t=e.scope;this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._updatedLayers[t].add(e.id),this.setDirty()}removeLayer(e){const t=e.scope;this._removedLayers[t]=this._removedLayers[t]||{},this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._removedLayers[t][e.id]=e,this._updatedLayers[t].delete(e.id),this._updatedPaintProps.delete(e.fqid),this.setDirty()}getRemovedLayer(e){return this._removedLayers[e.scope]?this._removedLayers[e.scope][e.id]:null}discardLayerRemoval(e){this._removedLayers[e.scope]&&delete this._removedLayers[e.scope][e.id]}getLayerUpdatesByScope(){const e={};for(const t in this._updatedLayers)e[t]=e[t]||{},e[t].updatedIds=Array.from(this._updatedLayers[t].values());for(const t in this._removedLayers)e[t]=e[t]||{},e[t].removedIds=Object.keys(this._removedLayers[t]);return e}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(e){this._updatedPaintProps.add(e.fqid),this.setDirty()}getUpdatedImages(e){return this._updatedImages[e]?Array.from(this._updatedImages[e].values()):[]}updateImage(t,i){this._updatedImages[i]=this._updatedImages[i]||new Set,this._updatedImages[i].add(e.I.toString(t)),this.setDirty()}resetUpdatedImages(e){this._updatedImages[e]&&this._updatedImages[e].clear()}reset(){this._changed=!1,this._updatedLayers=Object.create(null),this._removedLayers=Object.create(null),this._updatedSourceCaches=Object.create(null),this._updatedPaintProps.clear(),this._updatedImages=Object.create(null)}}
vendor: 7,191 bytes, line 2
2class b{constructor(e){this._layer=e,this._filterDependencies=void 0}invalidateFilter(){this._filterDependencies=void 0}get _filterDeps(){return void 0===this._filterDependencies&&(this._filterDependencies=this._computeFilterDependencies()),this._filterDependencies}_computeFilterDependencies(){const t=this._layer;if(!t.type||"custom"===t.type||"background"===t.type||"sky"===t.type||"slot"===t.type||"placement-group"===t.type)return null;const i=e.c(t.filter,e.s[`filter_${t.type}`]);return"error"===i.result?null:{configDependencies:i.value.configDependencies,isIndoorDependent:i.value.isIndoorDependent}}hasConfigDependency(e){const{_unevaluatedLayout:t,_transitionablePaint:i}=this._layer;if(t&&t.configDependencies.has(e))return!0;if(i&&i.configDependencies.has(e))return!0;const n=this._filterDeps;return!!n&&n.configDependencies.has(e)}get isConfigDependent(){const{_unevaluatedLayout:e,_transitionablePaint:t}=this._layer;if(e&&0!==e.configDependencies.size)return!0;if(t&&0!==t.configDependencies.size)return!0;const i=this._filterDeps;return!!i&&0!==i.configDependencies.size}get isIndoorDependent(){const{_unevaluatedLayout:e,_transitionablePaint:t}=this._layer;if(e&&e.isIndoorDependent())return!0;if(t&&t.isIndoorDependent())return!0;const i=this._filterDeps;return!!i&&i.isIndoorDependent}}function w(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}const T=new e.C(0,0,0);function E(e,t){const i=[],n=e[`stretch_${t}`];let r=null;for(let e=0;e<n.length;e++)null===r?r=0===i.length?n[0]:i.at(-1)[1]+n[e]:(i.push([r,r+n[e]]),r=null);e[`stretch_${t}_areas`]=i}function S(e,t){const i={name:void 0};let n;for(;n=e.nextField(t);)1===n?i.name=e.readString():2===n?i.metadata=I(e,e.readVarint()+e.pos):3===n&&(i.usvg_tree=C(e,e.readVarint()+e.pos),i.data="usvg_tree");return function(e){if(e.usvg_tree.height||(e.usvg_tree.height=e.usvg_tree.width),!e.metadata)return e;const{metadata:t}=e;if(t.content_area){const{content_area:i}=t;i.left??=0,i.top??=i.left,i.width??=e.usvg_tree.width,i.height??=i.width}if(t.text_placeholder){const{text_placeholder:e}=t;e.top??=e.left,e.height??=e.width}return t.stretch_x&&t.stretch_x.length&&E(t,"x"),t.stretch_y&&t.stretch_y.length&&E(t,"y"),e}(i)}function I(e,t){const i={stretch_x:null,stretch_y:null,stretch_x_areas:null,stretch_y_areas:null,variables:[]};let n;for(;n=e.nextField(t);)1===n?i.stretch_x=e.readPackedVarint():2===n?i.stretch_y=e.readPackedVarint():3===n?i.content_area=A(e,e.readVarint()+e.pos):4===n?i.variables.push(M(e,e.readVarint()+e.pos)):5===n&&(i.text_placeholder=A(e,e.readVarint()+e.pos));return i}function A(e,t){const i={};let n;for(;n=e.nextField(t);)1===n?i.left=e.readVarint():2===n?i.width=e.readVarint():3===n?i.top=e.readVarint():4===n&&(i.height=e.readVarint());return i}function M(e,t){const i={name:void 0};let n;for(;n=e.nextField(t);)1===n?i.name=e.readString():2===n&&(i.rgb_color=O(e.readVarint()),i.value="rgb_color");return i}function C(e,t){const i={width:20,children:[],linear_gradients:[],radial_gradients:[],clip_paths:[],masks:[],height:20};let n;for(;n=e.nextField(t);)1===n?i.width=i.height=e.readVarint():2===n?i.height=e.readVarint():3===n?i.children.push(D(e,e.readVarint()+e.pos)):4===n?i.linear_gradients.push(k(e,e.readVarint()+e.pos)):5===n?i.radial_gradients.push(N(e,e.readVarint()+e.pos)):7===n?i.clip_paths.push(V(e,e.readVarint()+e.pos)):8===n&&i.masks.push(U(e,e.readVarint()+e.pos));return i}function D(e,t){const i={};let n;for(;n=e.nextField(t);)1===n?(i.group=P(e,e.readVarint()+e.pos),i.node="group"):2===n&&(i.path=L(e,e.readVarint()+e.pos),i.node="path");return i}function P(e,t){const i={opacity:255,children:[]};let n;for(;n=e.nextField(t);)1===n?i.transform=R(e,e.readVarint()+e.pos):2===n?i.opacity=e.readVarint():5===n?i.clip_path_idx=e.readVarint():6===n?i.mask_idx=e.readVarint():7===n&&i.children.push(D(e,e.readVarint()+e.pos));return i}function R(e,t){const i={sx:1,ky:0,kx:0,sy:1,tx:0,ty:0};let n;for(;n=e.nextField(t);)1===n?i.sx=e.readFloat():2===n?i.ky=e.readFloat():3===n?i.kx=e.readFloat():4===n?i.sy=e.readFloat():5===n?i.tx=e.readFloat():6===n&&(i.ty=e.readFloat());return i}function L(e,t){const i={paint_order:1,commands:[],step:1,diffs:[],rule:1};let n;for(;n=e.nextField(t);)1===n?i.fill=z(e,e.readVarint()+e.pos):2===n?i.stroke=F(e,e.readVarint()+e.pos):3===n?i.paint_order=e.readVarint():5===n?e.readPackedVarint(i.commands):6===n?i.step=e.readFloat():7===n?e.readPackedSVarint(i.diffs):8===n&&(i.rule=e.readVarint());return i}function z(e,t){const i={rgb_color:T,paint:"rgb_color",opacity:255};let n;for(;n=e.nextField(t);)1===n?(i.rgb_color=O(e.readVarint()),i.paint="rgb_color"):2===n?(i.linear_gradient_idx=e.readVarint(),i.paint="linear_gradient_idx"):3===n?(i.radial_gradient_idx=e.readVarint(),i.paint="radial_gradient_idx"):5===n&&(i.opacity=e.readVarint());return i}function F(e,t){const i={rgb_color:T,paint:"rgb_color",dasharray:[],dashoffset:0,miterlimit:4,opacity:255,width:1,linecap:1,linejoin:1};let n;for(;n=e.nextField(t);)1===n?(i.rgb_color=O(e.readVarint()),i.paint="rgb_color"):2===n?(i.linear_gradient_idx=e.readVarint(),i.paint="linear_gradient_idx"):3===n?(i.radial_gradient_idx=e.readVarint(),i.paint="radial_gradient_idx"):5===n?e.readPackedFloat(i.dasharray):6===n?i.dashoffset=e.readFloat():7===n?i.miterlimit=e.readFloat():8===n?i.opacity=e.readVarint():9===n?i.width=e.readFloat():10===n?i.linecap=e.readVarint():11===n&&(i.linejoin=e.readVarint());return i}function O(t){return new e.C((t>>16&255)/255,(t>>8&255)/255,(255&t)/255,1)}function k(e,t){const i={spread_method:1,stops:[],x1:0,y1:0,x2:1,y2:0};let n;for(;n=e.nextField(t);)1===n?i.transform=R(e,e.readVarint()+e.pos):2===n?i.spread_method=e.readVarint():3===n?i.stops.push(B(e,e.readVarint()+e.pos)):4===n?i.x1=e.readFloat():5===n?i.y1=e.readFloat():6===n?i.x2=e.readFloat():7===n&&(i.y2=e.readFloat());return i}function B(e,t){const i={offset:0,opacity:255,rgb_color:T};let n;for(;n=e.nextField(t);)1===n?i.offset=e.readFloat():2===n?i.opacity=e.readVarint():3===n&&(i.rgb_color=O(e.readVarint()));return i}function N(e,t){const i={spread_method:1,stops:[],cx:.5,cy:.5,r:.5,fx:.5,fy:.5,fr:0};let n;for(;n=e.nextField(t);)1===n?i.transform=R(e,e.readVarint()+e.pos):2===n?i.spread_method=e.readVarint():3===n?i.stops.push(B(e,e.readVarint()+e.pos)):4===n?i.cx=e.readFloat():5===n?i.cy=e.readFloat():6===n?i.r=e.readFloat():7===n?i.fx=e.readFloat():8===n?i.fy=e.readFloat():9===n&&(i.fr=e.readFloat());return i}function V(e,t){const i={children:[]};let n;for(;n=e.nextField(t);)1===n?i.transform=R(e,e.readVarint()+e.pos):2===n?i.clip_path_idx=e.readVarint():3===n&&i.children.push(D(e,e.readVarint()+e.pos));return i}function U(e,t){const i={left:0,width:20,mask_type:1,children:[]};let n;for(;n=e.nextField(t);)1===n?i.left=i.top=e.readFloat():2===n?i.width=i.height=e.readFloat():3===n?i.top=e.readFloat():4===n?i.height=e.readFloat():5===n?i.mask_type=e.readVarint():6===n?i.mask_idx=e.readVarint():7===n&&i.children.push(D(e,e.readVarint()+e.pos));return i.height??=i.width,i.top??=i.left,i}class j{static calculate(t={},i=[]){const n=new Map,r=new Map;if(0===Object.keys(t).length)return n;
vendor: 4,414 bytes, line 2
2i.forEach(t=>{r.set(t.name,t.rgb_color||new e.C(0,0,0))});for(const[e,i]of Object.entries(t))r.has(e)?n.set(r.get(e).toString(),i):console.warn(`Ignoring unknown image variable "${e}"`);return n}}function G(t,i=255,n){const r=n.get(t.toString())||t;return 255===i?r.toString():new e.C(r.r,r.g,r.b,r.a*i/255).toString()}const $=[];let H=0;function Z(t,i){if(H>=$.length){const n=e.o()?new OffscreenCanvas(t,i).getContext("2d",{willReadFrequently:!0}):document.createElement("canvas").getContext("2d",{willReadFrequently:!0});$.push(n)}const n=$[H++];return n.canvas.width=t,n.canvas.height=i,n}function q(){H--}function W(e,t,i,n,r){for(const o of n.children)Y(e,t,i,o,r)}function Y(e,t,i,n,r){n.group?(e.save(),function(e,t,i,n,r){const o=null!=n.mask_idx?i.masks[n.mask_idx]:null,s=null!=n.clip_path_idx?i.clip_paths[n.clip_path_idx]:null;if(n.transform&&(t=re(n.transform).preMultiplySelf(t)),!function(e,t,i){return 255!==e.opacity||t||i}(n,null!=s,null!=o))return void W(e,t,i,n,r);const a=Z(e.canvas.width,e.canvas.height);W(a,t,i,n,r),s&&ie(a,t,i,s),o&&ne(a,t,i,o,r),e.globalAlpha=n.opacity/255,e.drawImage(a.canvas,0,0),q()}(e,t,i,n.group,r),e.restore()):n.path&&(e.save(),function(e,t,i,n,r){e.setTransform(t),1===n.paint_order?(X(e,i,n,r),K(e,i,n,r)):(K(e,i,n,r),X(e,i,n,r))}(e,t,i,n.path,r),e.restore())}function X(e,t,i,n){const r=i.fill;if(!r)return;const o=r.opacity/255;switch(e.save(),e.beginPath(),oe(i,e),r.paint){case"rgb_color":e.fillStyle=G(r.rgb_color,r.opacity,n);break;case"linear_gradient_idx":{const i=t.linear_gradients[r.linear_gradient_idx];i.transform&&e.setTransform(re(i.transform).preMultiplySelf(e.getTransform())),e.fillStyle=Q(e,i,o,n);break}case"radial_gradient_idx":{const i=t.radial_gradients[r.radial_gradient_idx];i.transform&&e.setTransform(re(i.transform).preMultiplySelf(e.getTransform())),e.fillStyle=ee(e,i,o,n)}}e.fill(J(i)),e.restore()}function J(e){return 1===e.rule?"nonzero":2===e.rule?"evenodd":void 0}function K(e,t,i,n){const r=i.stroke;if(!r)return;const o=se(i);e.lineWidth=r.width,e.miterLimit=r.miterlimit,e.setLineDash(r.dasharray),e.lineDashOffset=r.dashoffset;const s=r.opacity/255;switch(r.paint){case"rgb_color":e.strokeStyle=G(r.rgb_color,r.opacity,n);break;case"linear_gradient_idx":e.strokeStyle=Q(e,t.linear_gradients[r.linear_gradient_idx],s,n,!0);break;case"radial_gradient_idx":e.strokeStyle=ee(e,t.radial_gradients[r.radial_gradient_idx],s,n,!0)}switch(r.linejoin){case 2:case 1:e.lineJoin="miter";break;case 3:e.lineJoin="round";break;case 4:e.lineJoin="bevel"}switch(r.linecap){case 1:e.lineCap="butt";break;case 2:e.lineCap="round";break;case 3:e.lineCap="square"}e.stroke(o)}function Q(e,t,i,n,r=!1){if(1===t.stops.length){const e=t.stops[0];return G(e.rgb_color,e.opacity*i,n)}const{x1:o,y1:s,x2:a,y2:l}=t;let c=new DOMPoint(o,s),u=new DOMPoint(a,l);if(r){const e=re(t.transform);c=e.transformPoint(c),u=e.transformPoint(u)}const h=e.createLinearGradient(c.x,c.y,u.x,u.y);for(const e of t.stops)h.addColorStop(e.offset,G(e.rgb_color,e.opacity*i,n));return h}function ee(e,t,i,n,r=!1){if(1===t.stops.length){const e=t.stops[0];return G(e.rgb_color,e.opacity*i,n)}const o=re(t.transform),{fx:s,fy:a,fr:l,cx:c,cy:u,r:h}=t;let d=new DOMPoint(s,a),f=new DOMPoint(c,u),p=l,m=h;if(r){d=o.transformPoint(d),f=o.transformPoint(f);const e=(o.a+o.d)/2;p=l*e,m=t.r*e}const _=e.createRadialGradient(d.x,d.y,p,f.x,f.y,m);for(const e of t.stops)_.addColorStop(e.offset,G(e.rgb_color,e.opacity*i,n));return _}function te(e,t,i,n){const r=n.transform?re(n.transform).preMultiplySelf(t):t,o=Z(e.canvas.width,e.canvas.height);for(const e of n.children)if(e.group)te(o,r,i,e.group);else if(e.path){const t=e.path,i=new Path2D;i.addPath(se(t),r),o.fill(i,J(t))}const s=null!=n.clip_path_idx?i.clip_paths[n.clip_path_idx]:null;s&&ie(o,r,i,s),e.globalCompositeOperation="source-over",e.drawImage(o.canvas,0,0),q()}function ie(e,t,i,n){const r=Z(e.canvas.width,e.canvas.height);te(r,t,i,n),e.globalCompositeOperation="destination-in",e.drawImage(r.canvas,0,0),q()}function ne(e,t,i,n,r){if(0===n.children.length)return;const o=null!=n.mask_idx?i.masks[n.mask_idx]:null;o&&ne(e,t,i,o,r);const s=e.canvas.width,a=e.canvas.height,l=Z(s,a),c=n.width,u=n.height,h=n.left,d=n.top,f=new Path2D,p=new Path2D;p.rect(h,d,c,u),f.addPath(p,t),l.clip(f);for(const e of n.children)Y(l,t,i,e,r);const m=l.getImageData(0,0,s,a),_=m.data;if(1===n.mask_type)for(let e=0;e<_.length;
vendor: 4,085 bytes, line 2
2e+=4)_[e+3]=_[e+3]/255*(.2126*_[e]+.7152*_[e+1]+.0722*_[e+2]);l.putImageData(m,0,0),e.globalCompositeOperation="destination-in",e.drawImage(l.canvas,0,0),q()}function re(e){return e?new DOMMatrix([e.sx,e.ky,e.kx,e.sy,e.tx,e.ty]):new DOMMatrix}function oe(e,t){const i=e.step;let n=e.diffs[0]*i,r=e.diffs[1]*i;t.moveTo(n,r);for(let o=0,s=2;o<e.commands.length;o++)switch(e.commands[o]){case 1:n+=e.diffs[s++]*i,r+=e.diffs[s++]*i,t.moveTo(n,r);break;case 2:n+=e.diffs[s++]*i,r+=e.diffs[s++]*i,t.lineTo(n,r);break;case 3:{const o=n+e.diffs[s++]*i,a=r+e.diffs[s++]*i;n=o+e.diffs[s++]*i,r=a+e.diffs[s++]*i,t.quadraticCurveTo(o,a,n,r);break}case 4:{const o=n+e.diffs[s++]*i,a=r+e.diffs[s++]*i,l=o+e.diffs[s++]*i,c=a+e.diffs[s++]*i;n=l+e.diffs[s++]*i,r=c+e.diffs[s++]*i,t.bezierCurveTo(o,a,l,c,n,r);break}case 5:t.closePath()}return t}function se(e){return oe(e,new Path2D)}class ae{constructor(){this.cacheMap=new Map,this.cacheDependenciesMap=new Map}static _getImage(t){return new e.b(t,t.data)}getFromCache(t,i,n){return this.cacheMap.has(n)||this.cacheMap.set(n,new e.L(150)),this.cacheMap.get(n).get(e.m(t.toString(),i))}setInCache(t,i,n,r){this.cacheDependenciesMap.has(r)||this.cacheDependenciesMap.set(r,new Map),this.cacheMap.has(r)||this.cacheMap.set(r,new e.L(150));const o=this.cacheDependenciesMap.get(r),s=e.m(t.id.toString(),n);o.get(s)||o.set(s,new Set);const a=this.cacheMap.get(r),l=t.toString();o.get(s).add(l),a.put(e.m(t.toString(),n),i)}removeImagesFromCacheByIds(t,i,n=0){if(!this.cacheMap.has(n)||!this.cacheDependenciesMap.has(n))return;const r=this.cacheMap.get(n),o=this.cacheDependenciesMap.get(n);for(const n of t){const t=e.m(n.toString(),i);if(o.has(t)){for(const e of o.get(t))r.delete(e);o.delete(t)}}}rasterize(e,t,i,n){const r=this.getFromCache(e,i,n);if(r)return r.clone();const o=function(e,t){const i=j.calculate(t.params,e.metadata?e.metadata.variables:[]),n=e.usvg_tree,r=n.width,o=n.height,s=Math.max(1,Math.round(r*t.sx)),a=Math.max(1,Math.round(o*t.sy)),l=new DOMMatrix([s/r,0,0,a/o,0,0]),c=Z(s,a);W(c,l,n,n,i);const u=c.getImageData(0,0,s,a);return q(),u}(t.icon,e),s=ae._getImage(o);return this.setInCache(e,s,i,n),s.clone()}}class le extends e.E{constructor(t){super(),this.imageProviders=new Map,this.images=new Map,this.updatedImages=new Map,this.callbackDispatchedThisFrame=new Map,this.imageVersions=new Map,this.loaded=new Map,this.requestors=[],this.patterns=new Map,this.patternsInFlight=new Set,this.atlasImage=new Map,this.atlasTexture=new Map,this.imageAtlasCache=new e.d,this.dirty=!0,this.spriteFormat=t,this.imageRasterizer=new ae}addScope(t){this.loaded.set(t,!1),this.imageProviders.set(t,new Map),this.images.set(t,new Map),this.updatedImages.set(t,new Set),this.callbackDispatchedThisFrame.set(t,new Set),this.imageVersions.set(t,new Map),this.patterns.set(t,new Map),this.atlasImage.set(t,new e.b({width:1,height:1}))}removeScope(e){this.loaded.delete(e),this.imageProviders.delete(e),this.images.delete(e),this.updatedImages.delete(e),this.callbackDispatchedThisFrame.delete(e),this.imageVersions.delete(e),this.patterns.delete(e),this.atlasImage.delete(e);const t=this.atlasTexture.get(e);t&&(t.destroy(),this.atlasTexture.delete(e))}addImageProvider(e,t){this.imageProviders.has(t)||this.imageProviders.set(t,new Map),this.imageProviders.get(t).set(e.id,e)}removeImageProvider(e,t){this.imageProviders.has(t)&&this.imageProviders.get(t).delete(e)}getPendingImageProviders(){const e=[];for(const t of this.imageProviders.values())for(const i of t.values())i.hasPendingRequests()&&e.push(i);return e}isLoaded(){for(const e of this.loaded.keys())if(!this.loaded.get(e))return!1;return!0}setLoaded(e,t){if(this.loaded.get(t)!==e&&(this.loaded.set(t,e),e)){for(const{ids:e,callback:i}of this.requestors)this._notify(e,t,i);this.requestors=[]}}hasImage(e,t){return!!this.getImage(e,t)}getImage(e,t){return this.images.get(t).get(e.toString())}addImage(e,t,i){if(this._validate(e,i)){this.images.get(t).set(e.toString(),i);const n=this.imageVersions.get(t),r=n.get(e.toString())||0;n.set(e.toString(),r+1)}}_validate(t,i){let n=!0;
vendor: 14,305 bytes, line 2
2return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new e.f(new Error(`Image "${t.name}" has invalid "stretchX" value`))),n=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new e.f(new Error(`Image "${t.name}" has invalid "stretchY" value`))),n=!1),this._validateContent(i.content,i)||(this.fire(new e.f(new Error(`Image "${t.name}" has invalid "content" value`))),n=!1),n}_validateStretch(e,t){if(!e)return!0;let i=0;for(const n of e){if(n[0]<i||n[1]<n[0]||t<n[1])return!1;i=n[1]}return!0}_validateContent(e,t){if(!e)return!0;if(4!==e.length)return!1;if(!t.usvg){if(e[0]<0||t.data.width<e[0])return!1;if(e[1]<0||t.data.height<e[1])return!1;if(e[2]<0||t.data.width<e[2])return!1;if(e[3]<0||t.data.height<e[3])return!1}return!(e[2]<e[0]||e[3]<e[1])}updateImage(e,t,i){const n=this.images.get(t).get(e.toString());i.version=n.version+1,this.images.get(t).set(e.toString(),i),this.updatedImages.get(t).add(e);const r=this.imageVersions.get(t),o=r.get(e.toString())||0;r.set(e.toString(),o+1),this.removeFromImageRasterizerCache(e,t)}clearUpdatedImages(e){this.updatedImages.get(e).clear()}removeFromImageRasterizerCache(e,t){"raster"!==this.spriteFormat&&this.imageRasterizer.removeImagesFromCacheByIds([e],t)}removeImage(e,t){const i=this.images.get(t),n=i.get(e.toString());i.delete(e.toString());const r=this.imageVersions.get(t),o=r.get(e.toString())||0;r.set(e.toString(),o+1),this.patterns.get(t).delete(e.toString()),this.removeFromImageRasterizerCache(e,t),n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(t){return Array.from(this.images.get(t).keys()).map(t=>e.I.from(t))}getImageVersions(e){return this.imageVersions.get(e)||new Map}hasImageProviderForSource(e,t){const i=this.imageProviders.get(t);if(!i)return!1;for(const t of i.values())if(t.sourceCache.getSource().id===e)return!0;return!1}getImages(e,t,i){const n=[],r=[],o=this.imageProviders.get(t);for(const i of e){if(!i.iconsetId){n.push(i);continue}const e=o.get(i.iconsetId);e&&(this.getImage(i,t)?r.push(i):e.addPendingRequest(i))}if(0===n.length)return void this._notify(r,t,i);let s=!0;const a=!!this.loaded.get(t),l=this.images.get(t);if(!a)for(const e of n)l.has(e.toString())||(s=!1);a||s?this._notify(n,t,i):this.requestors.push({ids:n,scope:t,callback:i})}rasterizeImages(e,t){const i=new Map,{iconTasks:n,patternTasks:r,scope:o}=e;for(const e of[n,r])for(const[t,n]of e.entries()){const e=this.getImage(n.id,o);e&&i.set(t,{image:e,imageVariant:n})}t(null,this._rasterizeImages(o,i))}_rasterizeImages(e,t){const i=new Map;for(const[n,{image:r,imageVariant:o}]of t.entries())i.set(n,this.imageRasterizer.rasterize(o,r,e,0));return i}getUpdatedImages(e){return this.updatedImages.get(e)||new Set}_notify(t,i,n){const r=this.images.get(i),o=new Map;for(const i of t){if(!r.get(i.toString())){if(i.iconsetId)continue;this.fire(new e.h("styleimagemissing",{id:i.name}))}const t=r.get(i.toString());if(!t){e.w(`Image "${i.name}" 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.`);continue}const n={data:t.usvg?null:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,usvg:t.usvg,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)};t.usvg&&Object.assign(n,{width:t.icon.usvg_tree.width,height:t.icon.usvg_tree.height}),o.set(e.I.toString(i),n)}n(null,{images:o,versions:this.getImageVersions(i)})}getPixelSize(e){const{width:t,height:i}=this.atlasImage.get(e);return{width:t,height:i}}getPattern(t,i,n){const r=t.toString(),o=this.patterns.get(i),s=o.get(r),a=this.getImage(t,i);if(!a)return null;if(s){if(s.position.version===a.version)return s.position;s.position.version=a.version}else{if(a.usvg&&!a.data){const o=this.getPatternInFlightId(r,i);if(this.patternsInFlight.has(o))return null;this.patternsInFlight.add(o);const s=new e.i(t).scaleSelf(e.e.devicePixelRatio),l=new Map([[s.toString(),{image:a,imageVariant:s}]]),c=this._rasterizeImages(i,l);return this.storePatternImage(s,i,a,n,c),null}this.storePattern(t,i,a)}return this._updatePatternAtlas(i,n),o.get(r).position}getPatternInFlightId(t,i){return e.m(t,i)}hasPatternsInFlight(){return 0!==this.patternsInFlight.size}storePatternImage(e,t,i,n,r){const o=e.toString(),s=r?r.get(o):void 0;s&&(i.data=s,this.storePattern(e.id,t,i),this._updatePatternAtlas(t,n),this.patternsInFlight.delete(this.getPatternInFlightId(e.id.toString(),t)))}storePattern(t,i,n){const r={w:n.data.width+2*e.j,h:n.data.height+2*e.j,x:0,y:0},o=new e.k(r,n,e.j);this.patterns.get(i).set(t.toString(),{bin:r,position:o})}destroyAtlasTextures(){for(const e of this.atlasTexture.values())e&&e.destroy();this.atlasTexture.clear()}bind(t,i){const n=t.gl;let r=this.atlasTexture.get(i);r?this.dirty&&(r.update(this.atlasImage.get(i)),this.dirty=!1):(r=new e.T(t,this.atlasImage.get(i),n.RGBA8),this.atlasTexture.set(i,r)),r.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(t,i){const n=this.patterns.get(t),r=Array.from(n.values()).map(({bin:e})=>e),{w:o,h:s}=e.p(r),a=this.atlasImage.get(t);a.resize({width:o||1,height:s||1});const l=this.images.get(t);for(const[t,{bin:r,position:o}]of n.entries()){let n=o.padding;const s=r.x+n,c=r.y+n,u=l.get(t).data,h=u.width,d=u.height;n=n>1?n-1:n,e.b.copy(u,a,{x:0,y:0},{x:s,y:c},{width:h,height:d},i),e.b.copy(u,a,{x:0,y:d-n},{x:s,y:c-n},{width:h,height:n},i),e.b.copy(u,a,{x:0,y:0},{x:s,y:c+d},{width:h,height:n},i),e.b.copy(u,a,{x:h-n,y:0},{x:s-n,y:c},{width:n,height:d},i),e.b.copy(u,a,{x:0,y:0},{x:s+h,y:c},{width:n,height:d},i),e.b.copy(u,a,{x:h-n,y:d-n},{x:s-n,y:c-n},{width:n,height:n},i),e.b.copy(u,a,{x:0,y:d-n},{x:s+h,y:c-n},{width:n,height:n},i),e.b.copy(u,a,{x:0,y:0},{x:s+h,y:c+d},{width:n,height:n},i),e.b.copy(u,a,{x:h-n,y:0},{x:s-n,y:c+d},{width:n,height:n},i)}this.dirty=!0}beginFrame(){for(const e of this.images.keys())this.callbackDispatchedThisFrame.set(e,new Set);this.imageAtlasCache.beginFrame()}dispatchRenderCallbacks(e,t){const i=this.images.get(t);for(const n of e){if(this.callbackDispatchedThisFrame.get(t).has(n.toString()))continue;this.callbackDispatchedThisFrame.get(t).add(n.toString());const e=i.get(n.toString());w(e)&&this.updateImage(n,t,e)}}}class ce{constructor(e,t,i,n){this.message=(e?`${e}: `:"")+i,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}class ue extends ce{}function he(t){const i=t.value,n=t.valueSpec,r=t.style,o=t.styleSpec,s=t.key,a=t.arrayElementValidator||Be;if(!Array.isArray(i))return[new ce(s,i,`array expected, ${e.n(i)} found`)];if(n.length&&i.length!==n.length)return[new ce(s,i,`array length ${n.length} expected, length ${i.length} found`)];if(n["min-length"]&&i.length<n["min-length"])return[new ce(s,i,`array length at least ${n["min-length"]} expected, length ${i.length} found`)];let l={type:n.value,values:n.values,minimum:n.minimum,maximum:n.maximum,function:void 0};o.$version<7&&(l.function=n.function),e.l(n.value)&&(l=n.value);let c=[];for(let e=0;e<i.length;e++)c=c.concat(a({array:i,arrayIndex:e,value:i[e],valueSpec:l,style:r,styleSpec:o,key:`${s}[${e}]`},!0));return c}function de(t){const i=t.key,n=t.value,r=t.valueSpec;if(!e.q(n))return[new ce(i,n,`number expected, ${e.n(n)} found`)];if(n!=n)return[new ce(i,n,"number expected, NaN found")];if("minimum"in r){let e=r.minimum;if(Array.isArray(r.minimum)&&(e=r.minimum[t.arrayIndex]),n<e)return[new ce(i,n,`${n} is less than the minimum value ${e}`)]}if("maximum"in r){let e=r.maximum;if(Array.isArray(r.maximum)&&(e=r.maximum[t.arrayIndex]),n>e)return[new ce(i,n,`${n} is greater than the maximum value ${e}`)]}return[]}function fe(t){const i=t.key,n=t.value;if(!e.l(n))return[new ce(i,n,`object expected, ${e.n(n)} found`)];const r=t.valueSpec,o=e.u(n.type);let s,a,l,c={};const u="categorical"!==o&&void 0===n.property,h=!u,d=function(t){const i=t.stops;return Array.isArray(i)&&Array.isArray(i[0])&&e.l(i[0][0])}(n),f=Ne({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(e){if("identity"===o)return[new ce(e.key,e.value,'identity function may not have a "stops" property')];let t=[];const i=e.value;return t=t.concat(he({key:e.key,value:i,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:p})),Array.isArray(i)&&0===i.length&&t.push(new ce(e.key,i,"array must have at least one stop")),t},default:function(e){return Be({key:e.key,value:e.value,valueSpec:r,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===o&&u&&f.push(new ce(t.key,t.value,'missing required property "property"')),"identity"===o||n.stops||f.push(new ce(t.key,t.value,'missing required property "stops"')),"exponential"===o&&r.expression&&!e.r(r)&&f.push(new ce(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(h&&!e.t(r)?f.push(new ce(t.key,t.value,"property functions not supported")):u&&!e.v(r)&&f.push(new ce(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!d||void 0!==n.property||f.push(new ce(t.key,t.value,'"property" property is required')),f;function p(t){let i=[];const n=t.value,o=t.key;if(!Array.isArray(n))return[new ce(o,n,`array expected, ${e.n(n)} found`)];if(2!==n.length)return[new ce(o,n,`array length 2 expected, length ${n.length} found`)];if(d){if(!e.l(n[0]))return[new ce(o,n,`object expected, ${e.n(n[0])} found`)];const r=n[0];if(void 0===r.zoom)return[new ce(o,n,"object stop key must have zoom")];if(void 0===r.value)return[new ce(o,n,"object stop key must have value")];const s=e.u(r.zoom);if("number"!=typeof s)return[new ce(o,r.zoom,"stop zoom values must be numbers")];if(l&&l>s)return[new ce(o,r.zoom,"stop zoom values must appear in ascending order")];s!==l&&(l=s,a=void 0,c={}),i=i.concat(Ne({key:`${o}[0]`,value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:de,value:m}}))}else i=i.concat(m({key:`${o}[0]`,value:n[0],style:t.style,styleSpec:t.styleSpec},n));return e.x(e.y(n[1]))?i.concat([new ce(`${o}[1]`,n[1],"expressions are not allowed in function stops.")]):i.concat(Be({key:`${o}[1]`,value:n[1],valueSpec:r,style:t.style,styleSpec:t.styleSpec}))}function m(t,i){const n=e.n(t.value),l=e.u(t.value),u=null!==t.value?t.value:i;if(s){if(n!==s)return[new ce(t.key,u,`${n} stop domain type must match previous stop domain type ${s}`)]}else s=n;if("number"!==n&&"string"!==n&&"boolean"!==n&&"number"!=typeof l&&"string"!=typeof l&&"boolean"!=typeof l)return[new ce(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==n&&"categorical"!==o){let i=`number expected, ${n} found`;return e.t(r)&&void 0===o&&(i+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ce(t.key,u,i)]}return"categorical"!==o||"number"!==n||"number"==typeof l&&isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===n&&"number"==typeof l&&"number"==typeof a&&void 0!==a&&l<a?[new ce(t.key,u,"stop domain values must appear in ascending order")]:(a=l,"categorical"===o&&l in c?[new ce(t.key,u,"stop domain values must be unique")]:(c[l]=!0,[])):[new ce(t.key,u,`integer expected, found ${String(l)}`)]}}function pe(t){const i=("property"===t.expressionContext?e.z:e.c)(e.y(t.value),t.valueSpec);if("error"===i.result)return i.value.map(e=>new ce(`${t.key}${e.key}`,t.value,e.message));const n=i.value.expression||i.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!n.outputDefined())return[new ce(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!e.A(n))return[new ce(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return me(n,t);if("appearance"===t.expressionContext)return ye(n,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!e.B(n,["zoom","feature-state"]))return[new ce(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!e.D(n))return[new ce(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function me(t,i){const n=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(i.valueSpec&&i.valueSpec.expression)for(const e of i.valueSpec.expression.parameters)n.delete(e);if(0===n.size)return[];const r=[];return t instanceof e.F&&n.has(t.name)?[new ce(i.key,i.value,`["${t.name}"] expression is not supported in a filter for a ${i.object.type} layer with id: ${i.object.id}`)]:(t.eachChild(e=>{r.push(...me(e,i))}),r)}const _e=new Set(["get","has","properties","geometry-type","id"]),ge=new Set(["zoom","pitch","distance-from-center","feature","feature-state","measure-light","heatmap-density","line-progress","raster-value","raster-particle-speed","sky-radial-progress"]);function ye(t,i){if(i.valueSpec&&i.valueSpec.expression)for(const e of i.valueSpec.expression.parameters)ge.delete(e);if(0===ge.size)return[];const n=[];if(t instanceof e.F){const e=_e.has(t.name)?"feature":t.name;if(ge.has(e))return[new ce(i.key,i.value,`["${t.name}"] is not an allowed parameter`)]}return t.eachChild(e=>{n.push(...ye(e,i))}),n}function ve(t){const i=t.key,n=t.value,r=t.valueSpec,o=[];return Array.isArray(r.values)?r.values.includes(e.u(n))||o.push(new ce(i,n,`expected one of [${r.values.join(", ")}], ${JSON.stringify(n)} found`)):Object.keys(r.values).includes(e.u(n))||o.push(new ce(i,n,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(n)} found`)),o}function xe(t){if(e.J(e.y(t.value))){const e=t.layerType||"fill";return pe({...t,expressionContext:"filter",valueSpec:t.styleSpec[`filter_${e}`]})}return be(t)}function be(t){const i=t.value,n=t.key;if(!Array.isArray(i))return[new ce(n,i,`array expected, ${e.n(i)} found`)];if(i.length<1)return[new ce(n,i,"filter array must have at least 1 element")];const r=t.styleSpec;let o=ve({key:`${n}[0]`,value:i[0],valueSpec:r.filter_operator});const s=()=>{i.length>=2&&(e.H(i[1])||o.push(new ce(`${n}
2[1]`,i[1],`string expected, ${e.n(i[1])} found`)));for(let t=2;t<i.length;t++)"$type"===e.u(i[1])?o=o.concat(ve({key:`${n}[${t}]`,value:i[t],valueSpec:r.geometry_type})):e.H(i[t])||e.q(i[t])||e.G(i[t])||o.push(new ce(`${n}[${t}]`,i[t],`string, number, or boolean expected, ${e.n(i[t])} found.`))};switch(e.u(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===e.u(i[1])&&o.push(new ce(n,i,`"$type" cannot be use with operator "${i[0]}"`)),3!==i.length&&o.push(new ce(n,i,`filter array for operator "${i[0]}" must have 3 elements`)),s();break;case"==":case"!=":3!==i.length&&o.push(new ce(n,i,`filter array for operator "${i[0]}" must have 3 elements`)),s();break;case"in":case"!in":s();break;case"any":case"all":case"none":for(let e=1;e<i.length;e++)o=o.concat(be({key:`${n}[${e}]`,value:i[e],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":2!==i.length?o.push(new ce(n,i,`filter array for "${i[0]}" operator must have 2 elements`)):e.H(i[1])||o.push(new ce(`${n}[1]`,i[1],`string expected, ${e.n(i[1])} found`))}return o}const we=/^{([^}]+)}$/;function Te(t,i){const n=t.key,r=t.style,o=t.layer,s=t.styleSpec,a=t.value,l=t.objectKey,c=s[`${i}_${t.layerType}`];if(!c)return[];const u=l.match(e.U);if(u&&c[u[1]])return e.x(e.y(a))?[].concat(Be({key:n,value:a,valueSpec:{type:"string",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},style:r,styleSpec:s,expressionContext:"property",propertyType:i,propertyKey:l})):Be({key:n,value:a,valueSpec:{type:"string"},style:r,styleSpec:s});const h=l.match(e.K);if("paint"===i&&h&&c[h[1]]&&c[h[1]].transition)return Be({key:n,value:a,valueSpec:s.transition,style:r,styleSpec:s});const d=t.valueSpec||c[l];if(!d)return[new ue(n,a,`unknown property "${l}"`)];let f;if(e.H(a)&&e.t(d)&&!d.tokens&&(f=we.exec(a))){const e=`\`{ "type": "identity", "property": ${f?JSON.stringify(f[1]):'"_"'} }\``;return[new ce(n,a,`"${l}" does not support interpolation syntax\nUse an identity property function instead: ${e}.`)]}const p=[];if("symbol"===t.layerType)"text-field"!==l||!r||r.glyphs||r.imports||p.push(new ce(n,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===l&&e.M(e.y(a))&&"identity"===e.u(a.type)&&p.push(new ce(n,a,'"text-font" does not support identity functions'));else if("model"===t.layerType&&"paint"===i&&o&&o.layout&&Object.hasOwn(o.layout,"model-id")&&e.t(d)&&(e.N(d)||e.v(d))){const t=e.z(e.y(a),d).value,i="expression"in t&&t.expression||"_styleExpression"in t&&t._styleExpression&&t._styleExpression.expression;i&&!e.B(i,["measure-light"])&&("model-emissive-strength"===l&&e.D(i)&&e.A(i)||p.push(new ce(n,a,`${l} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)))}return p.concat(Be({key:t.key,value:a,valueSpec:d,style:r,styleSpec:s,expressionContext:"property",propertyType:i,propertyKey:l}))}function Ee(e){return Te(e,"paint")}function Se(e){return Te(e,"layout")}function Ie(t){let i=[];const n=t.value,r=t.key,o=t.style,s=t.styleSpec;if(!e.l(n))return[new ce(r,n,"object expected")];n.type||n.ref||i.push(new ce(r,n,'either "type" or "ref" is required'));let a=e.u(n.type);const l=e.u(n.ref);if(n.id){const s=e.u(n.id);for(let a=0;a<t.arrayIndex;a++){const t=o.layers[a];e.u(t.id)===s&&i.push(new ce(r,n.id,`duplicate layer id "${s}", previously used at line ${t.id.__line__}`))}}if("ref"in n){let t;["type","source","source-layer","filter","layout"].forEach(e=>{e in n&&i.push(new ce(r,n[e],`"${e}" is prohibited for ref layers`))}),o.layers.forEach(i=>{e.u(i.id)===l&&(t=i)}),t?t.ref?i.push(new ce(r,n.ref,"ref cannot reference another ref layer")):a=e.u(t.type):"string"==typeof l&&i.push(new ce(r,n.ref,`ref layer "${l}" not found`))}else if("background"!==a&&"sky"!==a&&"slot"!==a&&"placement-group"!==a)if(n.source)if(e.H(n.source)){const t=o.sources&&Object.hasOwn(o.sources,n.source)?o.sources[n.source]:void 0,s=t&&e.u(t.type);t?"vector"===s&&"raster"===a?i.push(new ce(r,n.source,`layer "${n.id}" requires a raster source`)):"raster"===s&&"raster"!==a?i.push(new ce(r,n.source,`layer "${n.id}" requires a vector source`)):"vector"!==s||n["source-layer"]?"raster-dem"===s&&"hillshade"!==a?i.push(new ce(r,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==s||["raster","raster-particle"].includes(a)?"line"===a&&n.paint&&n.paint["line-gradient"]&&"geojson"===s&&!t.lineMetrics?i.push(new ce(r,n,`layer "${n.id}" specifies a line-gradient, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):"line"===a&&n.paint&&n.paint["line-trim-offset"]&&"geojson"===s&&!t.lineMetrics?i.push(new ce(r,n,`layer "${n.id}" specifies a line-trim-offset, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):"raster-particle"===a&&"raster-array"!==s&&i.push(new ce(r,n.source,`layer "${n.id}" requires a 'raster-array' source.`)):i.push(new ce(r,n.source,"raster-array source can only be used with layer type 'raster'.")):i.push(new ce(r,n,`layer "${n.id}" must specify a "source-layer"`)):i.push(new ce(r,n.source,`source "${n.source}" not found`))}else i.push(new ce(`${r}.source`,n.source,'"source" must be a string'));else i.push(new ce(r,n,'missing required property "source"'));return i=i.concat(Ne({key:r,value:n,valueSpec:s.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Be({key:`${r}.type`,value:n.type,valueSpec:s.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"}),filter:e=>xe({layerType:a,...e}),layout:e=>Ne({layer:n,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>Se({layerType:a,...e})}}),paint:e=>Ne({layer:n,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>Ee({layerType:a,layer:n,...e})}}),appearances(t){const i=he({key:t.key,value:t.value,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:t=>function(t){const{key:i,layer:n,layerType:r}=t,o=e.u(t.value),s=e.u(o.name),a=e.u(o.condition),l=Ne({key:i,value:o,valueSpec:t.styleSpec.appearance,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{condition:t=>function(t){const i=[];return i.push(...pe({key:t.key,value:t.object.condition,valueSpec:e.s.appearance.condition,expressionContext:"appearance"})),i}({...t}),properties:e=>function(e){const t=[],{styleSpec:i,layer:n,layerType:r}=e,o=i[`paint_${r}`],s=i[`layout_${r}`],a=e.object[e.objectKey];
vendor: 5,063 bytes, line 2
2for(const i in a){const l=i in o?"paint":i in s?"layout":void 0;if(!l){t.push(new ce(e.key,i,`unknown property "${i}" for layer type "${r}"`));continue}const c={...e,key:`${e.key}.${i}`,objectKey:i,layer:n,layerType:r,value:a[i],valueSpec:"paint"===l?o[i]:s[i]};t.push(...Te(c,l))}return t}({layer:n,layerType:r,...e})}});return"hidden"!==s&&void 0===a&&l.push(new ce(t.key,"name",'Appearance with name different than "hidden" must have a condition')),l}({layerType:a,layer:n,...t})}),r=Array.isArray(t.value)?t.value:[],o=new Set;return r.forEach((r,s)=>{const a=e.u(r.name);if(a)if(o.has(a)){const r=e.u(n.id);i.push(new ce(t.key,a,`Duplicated appearance name "${a}" for layer "${r}"`))}else o.add(a)}),i}}})),i}function Ae({key:t,value:i}){return e.H(i)?[]:[new ce(t,i,`string expected, ${e.n(i)} found`)]}const Me={promoteId:function t({key:i,value:n}){if(e.H(n))return Ae({key:i,value:n});if(Array.isArray(n)){const t=[],r=e.y(n),o=e.c(r);return"error"===o.result?(o.value.forEach(e=>{t.push(new ce(`${i}${e.key}`,null,`${e.message}`))}),t):(e.B(o.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||t.push(new ce(`${i}`,null,"promoteId expression should be only feature dependent")),t)}if(!e.l(n))return[new ce(i,n,`string, expression or object expected, "${e.n(n)}" found`)];const r=[];for(const e in n)r.push(...t({key:`${i}.${e}`,value:n[e]}));return r}};function Ce(t){const i=t.value,n=t.key,r=t.styleSpec,o=t.style;if(!e.l(i))return[new ce(n,i,`object expected, ${e.n(i)} found`)];if(!("type"in i))return[new ce(n,i,'"type" is required')];const s=e.u(i.type);let a=[];switch(["vector","raster","raster-dem","raster-array"].includes(s)&&("url"in i||"tiles"in i||a.push(new ue(n,i,'Either "url" or "tiles" is required.'))),s){case"vector":case"raster":case"raster-dem":case"raster-array":return a=a.concat(Ne({key:n,value:i,valueSpec:r[`source_${s.replace("-","_")}`],style:t.style,styleSpec:r,objectElementValidators:Me})),a;case"geojson":if(a=Ne({key:n,value:i,valueSpec:r.source_geojson,style:o,styleSpec:r,objectElementValidators:Me}),"cluster"in i&&"clusterProperties"in i){if(!e.l(i.clusterProperties))return[new ce(`${n}.clusterProperties`,i,`object expected, ${e.n(i)} found`)];for(const e in i.clusterProperties){const t=i.clusterProperties[e];if(!Array.isArray(t))return[new ce(`${n}.clusterProperties.${e}`,t,"array expected")];const[r,o]=t,s="string"==typeof r?[r,["accumulated"],["get",e]]:r;a.push(...pe({key:`${n}.${e}.map`,value:o,expressionContext:"cluster-map"})),a.push(...pe({key:`${n}.${e}.reduce`,value:s,expressionContext:"cluster-reduce"}))}}return a;case"video":return Ne({key:n,value:i,valueSpec:r.source_video,style:o,styleSpec:r});case"image":return Ne({key:n,value:i,valueSpec:r.source_image,style:o,styleSpec:r});case"canvas":return[new ce(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ve({key:`${n}.type`,value:i.type,valueSpec:{values:De(r)}})}}function De(e){return e.source.reduce((t,i)=>{const n=e[i];return"enum"===n.type.type&&(t=t.concat(Object.keys(n.type.values||{}))),t},[])}function Pe(e,t){const i=!e.includes("://");try{return new URL(e,i&&t?"http://example.com":void 0),!0}catch(e){return!1}}function Re(t){const i=t.value;return i?e.H(i)?Pe(i,!0)?[]:[new ce(t.key,i,`invalid url "${i}"`)]:[new ce(t.key,i,`string expected, "${e.n(i)}" found`)]:[]}function Le(t){const i=t.value,n=t.styleSpec,r=n.light,o=t.style;if(void 0===i)return[];if(!e.l(i))return[new ce("light",i,`object expected, ${e.n(i)} found`)];let s=[];for(const t in i){const a=t.match(e.K),l=t.match(e.U);s=s.concat(l&&r[l[1]]?Be({key:t,value:i[t],valueSpec:{type:"string"},style:o,styleSpec:n}):a&&r[a[1]]&&r[a[1]].transition?Be({key:t,value:i[t],valueSpec:n.transition,style:o,styleSpec:n}):r[t]?Be({key:t,value:i[t],valueSpec:r[t],style:o,styleSpec:n}):[new ce(t,i[t],`unknown property "${t}"`)])}return s}function ze(t){const i=t.value;if(!i)return[];const n=t.key;if(!e.l(i))return[new ce(n,i,`object expected, ${e.n(i)} found`)];let r=[];const o=t.styleSpec,s=o["light-3d"],a=t.style,l=t.style.lights;for(const e of["type","id"])if(!(e in i))return r=r.concat([new ce(n,i,`missing property "${e}"`)]),r;if(!e.H(i.type))return r=r.concat([new ce(`${n}.type`,i.type,"string expected")]),r;if(l)for(let o=0;o<t.arrayIndex;o++){const t=e.u(i.type),s=l[o];e.u(s.type)===t&&r.push(new ce(n,i.id,`duplicate light type "${i.type}", previously defined at line ${s.id.__line__}`))}const c=`properties_light_${i.type}`;if(!(c in o))return r=r.concat([new ce(`${n}.type`,i,`Invalid light type ${i.type}`)]),r;const u=o[c];for(const n in i)if("properties"===n){const s=i[n];if(!e.l(s))return r=r.concat([new ce("properties",s,`object expected, ${e.n(s)} found`)]),r;for(const i in s){const n=i.match(e.K),l=i.match(e.U);r=r.concat(l&&u[l[1]]?Be({key:i,value:s[i],valueSpec:{type:"string"},style:a,styleSpec:o}
vendor: 5,841 bytes, line 2
2):n&&u[n[1]]&&u[n[1]].transition?Be({key:i,value:s[i],valueSpec:o.transition,style:a,styleSpec:o}):u[i]?Be({key:i,value:s[i],valueSpec:u[i],style:a,styleSpec:o}):[new ue(t.key,s[i],`unknown property "${i}"`)])}}else r=r.concat(s[n]?Be({key:n,value:i[n],valueSpec:s[n],style:a,styleSpec:o}):[new ue(n,i[n],`unknown property "${n}"`)]);return r}function Fe(t){const i=t.value,n=t.key,r=t.style,o=t.styleSpec,s=o.terrain;if(null==i)return[];if(!e.l(i))return[new ce("terrain",i,`object expected, ${e.n(i)} found`)];let a=[];for(const t in i){const n=t.match(e.K),l=t.match(e.U);a=a.concat(l&&s[l[1]]?Be({key:t,value:i[t],valueSpec:{type:"string"},style:r,styleSpec:o}):n&&s[n[1]]&&s[n[1]].transition?Be({key:t,value:i[t],valueSpec:o.transition,style:r,styleSpec:o}):s[t]?Be({key:t,value:i[t],valueSpec:s[t],style:r,styleSpec:o}):[new ue(t,i[t],`unknown property "${t}"`)])}if(i.source)if(e.H(i.source)){const t=r.sources&&Object.hasOwn(r.sources,i.source)?r.sources[i.source]:void 0,o=t&&e.u(t.type);t?"raster-dem"!==o&&a.push(new ce(`${n}.source`,i.source,`terrain cannot be used with a source of type ${o}, it only be used with a "raster-dem" source type`)):a.push(new ce(`${n}.source`,i.source,`source "${i.source}" not found`))}else a.push(new ce(`${n}.source`,i.source,"source must be a string"));else a.push(new ce(n,i,'terrain is missing required property "source"'));return a}function Oe(t){const i=t.value,n=t.style,r=t.styleSpec,o=r.fog;if(void 0===i)return[];if(!e.l(i))return[new ce("fog",i,`object expected, ${e.n(i)} found`)];let s=[];for(const t in i){const a=t.match(e.K),l=t.match(e.U);s=s.concat(l&&o[l[1]]?Be({key:t,value:i[t],valueSpec:{type:"string"},style:n,styleSpec:r}):a&&o[a[1]]&&o[a[1]].transition?Be({key:t,value:i[t],valueSpec:r.transition,style:n,styleSpec:r}):o[t]?Be({key:t,value:i[t],valueSpec:o[t],style:n,styleSpec:r}):[new ue(t,i[t],`unknown property "${t}"`)])}return s}const ke={"*":()=>[],array:he,boolean:function(t){const i=t.value,n=t.key;return e.G(i)?[]:[new ce(n,i,`boolean expected, ${e.n(i)} found`)]},number:de,color:function({key:t,value:i}){return e.H(i)?void 0===e.C.parse(e.u(i))?[new ce(t,i,`color expected, "${i}" found`)]:[]:[new ce(t,i,`color expected, ${e.n(i)} found`)]},enum:ve,filter:xe,function:fe,layer:Ie,object:Ne,source:Ce,model:Re,light:Le,"light-3d":ze,terrain:Fe,fog:Oe,string:Ae,formatted:function(e){return 0===Ae(e).length?[]:pe(e)},resolvedImage:function(e){return 0===Ae(e).length?[]:pe(e)},projection:function(t){const i=t.value,n=t.styleSpec,r=n.projection,o=t.style;if(e.l(i)){let e=[];for(const t in i)e=e.concat(Be({key:t,value:i[t],valueSpec:r[t],style:o,styleSpec:n}));return e}return e.H(i)?[]:[new ce("projection",i,`object or string expected, ${e.n(i)} found`)]},import:function(t){const i=t.key,{value:n,styleSpec:r}=t;if(!e.l(n))return[new ce(i,n,"import must be an object")];const{data:o,...s}=n;Object.defineProperty(s,"__line__",{value:n.__line__,enumerable:!1});let a=Ne({...t,value:s,valueSpec:r.import});""===e.u(s.id)&&a.push(new ce(`${t.key}.id`,s,"import id can't be an empty string"));const l=e.u(s.id);return"__proto__"!==l&&"constructor"!==l&&"prototype"!==l||a.push(new ce(`${t.key}.id`,s,`import id can't be "${String(l)}"`)),o&&(a=a.concat(Ue(o,r,{key:`${t.key}.data`}))),a},iconset:function(t){const i=t.value,n=t.key,r=t.styleSpec,o=t.style;if(!e.l(i))return[new ce(n,i,"object expected")];if(!i.type)return[new ce(n,i,'"type" is required')];const s=e.u(i.type);let a=[];if(a=a.concat(Ne({key:n,value:i,valueSpec:r[`iconset_${s}`],style:o,styleSpec:r})),function(e,t){return!("source"!==e||!t.source)}(s,i)){const t=o.sources&&Object.hasOwn(o.sources,i.source)?o.sources[i.source]:void 0,r=t&&e.u(t.type);t?"raster-array"!==r&&a.push(new ce(n,i.source,`iconset cannot be used with a source of type ${String(r)}, it only be used with a "raster-array" source type`)):a.push(new ce(n,i.source,`source "${i.source}" not found`))}return a},option:function(t){const i=t.styleSpec,n=t.value,r=e.l(n)&&!0===e.u(n.array)||!e.l(n)?void 0:e.u(n.type);return Ne({...t,valueSpec:i.option,objectElementValidators:{default:t=>{const i=t.value;return e.l(i)?Be({...t,valueSpec:{...t.valueSpec,type:"*",expression:void 0}}):r&&Array.isArray(i)?Be({...t,valueSpec:{...t.valueSpec,type:r}}):Be(t)}}})}};function Be(t,i=!1){const n=t.value,r=t.valueSpec,o=t.styleSpec;if(r.expression){if(e.M(e.u(n)))return fe(t);if(e.x(e.y(n)))return pe(t)}if(r.type&&ke[r.type]){const e=ke[r.type](t);return!0===i&&e.length>0&&Array.isArray(t.value)?pe(t):e}return Ne({...t,valueSpec:r.type?o[r.type]:r})}function Ne(t){const i=t.key,n=t.value,r=t.valueSpec||{},o=t.objectElementValidators||{},s=t.style,a=t.styleSpec;if(!e.l(n))return[new ce(i,n,`object expected, ${e.n(n)} found`)];let l=[];for(const e in n){if(!Object.hasOwn(n,e))continue;const t=e.split(".")[0],c=Object.hasOwn(r,t),u=Object.hasOwn(r,"*"),h=c?r[t]:u?r["*"]:void 0;let d;Object.hasOwn(o,t)?d=o[t]:c?d=Be:Object.hasOwn(o,"*")?d=o["*"]:u&&(d=Be),d?l=l.concat(d({key:(i?`${i}.`:i)+e,value:n[e],valueSpec:h,style:s,styleSpec:a,object:n,objectKey:e},n)):l.push(new ue(i,n[e],`unknown property "${e}"`))}for(const e in r){if(!Object.hasOwn(r,e))continue;if(Object.hasOwn(o,e))continue;const t=r[e];!t.required||void 0!==t.default||Object.hasOwn(n,e)&&void 0!==n[e]||l.push(new ce(i,n,`missing required property "${e}"`))}return l}function Ve({key:e,value:t}){const i=Ae({key:e,value:t});if(i.length)return i;const n=t;return n.includes("{fontstack}")||i.push(new ce(e,t,'"glyphs" url must include a "{fontstack}" token')),n.includes("{range}")||i.push(new ce(e,t,'"glyphs" url must include a "{range}" token')),i}function Ue(t,i=e.s,n={}){return Ne({key:n.key||"",value:t,valueSpec:{...i.$root,"*":{type:"*"}},styleSpec:i,style:t,objectElementValidators:{glyphs:Ve}})}function je(e){return e.slice().sort((e,t)=>
2e.line&&t.line?e.line-t.line:0)}const Ge="setStyle",$e="addLayer",He="removeLayer",Ze="setPaintProperty",qe="setLayerProperty",We="setTerrain",Ye="removeImport",Xe="addIconset",Je="removeIconset";function Ke(e,t,i){i.push({command:"addSource",args:[e,t[e]]})}function Qe(e,t,i){t.push({command:"removeSource",args:[e]}),i[e]=!0}function et(e,t,i,n){Qe(e,i,n),Ke(e,t,i)}function tt(t,i,n){let r;for(r in t[n])if(Object.hasOwn(t[n],r)&&"data"!==r&&!e.O(t[n][r],i[n][r]))return!1;for(r in i[n])if(Object.hasOwn(i[n],r)&&"data"!==r&&!e.O(t[n][r],i[n][r]))return!1;return!0}function it(t,i,n,r,o,s){let a;for(a in i=i||{},t=t||{})Object.hasOwn(t,a)&&(e.O(t[a],i[a])||n.push({command:s,args:[r,a,i[a],o]}));for(a in i)Object.hasOwn(i,a)&&!Object.hasOwn(t,a)&&(e.O(t[a],i[a])||n.push({command:s,args:[r,a,i[a],o]}))}function nt(e){return e.id}function rt(e,t){return e[t.id]=t,e}const ot=new e.C(1,0,0,1),st=new e.C(0,1,0,1),at=new e.C(0,0,1,1),lt=new e.C(1,0,1,1),ct=new e.C(0,1,1,1);function ut(t,i,n,r,o,s,a){const l=t.context,c=t.transform,u=l.gl,h="globe"===c.projection.name,d=h?["PROJECTION_GLOBE_VIEW"]:[];let f=e.Q(n.projMatrix);if(h&&e.S(c.zoom)>0){const t=e.V(n.canonical,c),i=e.W(t);f=e.X(new Float32Array(16),c.globeMatrix,i),e.X(f,c.projMatrix,f)}const p=e.Y();p[12]+=2*o/(e.e.devicePixelRatio*c.width),p[13]+=2*s/(e.e.devicePixelRatio*c.height),e.X(f,p,f);const m=t.getOrCreateProgram("debug",{defines:d}),_=i.getTileByID(n.key);t.terrain&&t.terrain.setupElevationDraw(_,m);const g=e.Z.disabled,y=e._.disabled,v=t.colorModeForRenderPass(),x="$debug";l.activeTexture.set(u.TEXTURE0),t.emptyTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),h?_._makeGlobeTileDebugBuffers(t.context,c):_._makeDebugTileBoundsBuffers(t.context,c.projection);const b=_._tileDebugBuffer||t.debugBuffer,w=_._tileDebugIndexBuffer||t.debugIndexBuffer,T=_._tileDebugSegments||t.debugSegments;if(m.draw(t,u.LINE_STRIP,g,y,v,e.$.disabled,e.a0(f,r.toPremultipliedRenderColor(null)),x,b,w,T,null,null,null,[_._globeTileDebugBorderBuffer]),a){const e=_.latestRawTileData,i=Math.floor((e&&e.byteLength||0)/1024);let r=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(r+=` => ${n.overscaledZ}`),r+=` ${_.state}`,r+=` ${i}kb`,function(e,t){e.initDebugOverlayCanvas();const i=e.debugOverlayCanvas,n=e.context.gl,r=e.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(t,5,5),r.strokeText(t,5,5),e.debugOverlayTexture.update(i),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,r)}const E=i.getTile(n).tileSize,S=512/Math.min(E,512)*(n.overscaledZ/c.zoom)*.5,I=_._tileDebugTextBuffer||t.debugBuffer,A=_._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,M=_._tileDebugTextSegments||t.debugSegments;m.draw(t,u.TRIANGLES,g,y,e.a1.alphaBlended,e.$.disabled,e.a0(f,e.C.transparent.toPremultipliedRenderColor(null),S),x,I,A,M,null,null,null,[_._globeTileDebugTextBuffer])}function ht(e,t,i,n){ft(e,0,t+i/2,e.transform.width,i,n)}function dt(e,t,i,n){ft(e,t-i/2,0,i,e.transform.height,n)}function ft(t,i,n,r,o,s){const a=t.context,l=a.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*e.e.devicePixelRatio,n*e.e.devicePixelRatio,r*e.e.devicePixelRatio,o*e.e.devicePixelRatio),a.clear({color:s}),l.disable(l.SCISSOR_TEST)}function pt(t,i,n){const r=t.context,o=r.gl,s=n.projMatrix,a=t.getOrCreateProgram("debug"),l=i.getTileByID(n.key);t.terrain&&t.terrain.setupElevationDraw(l,a);const c=e.Z.disabled,u=e._.disabled,h=t.colorModeForRenderPass(),d="$debug";r.activeTexture.set(o.TEXTURE0),t.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE);const f=l.queryGeometryDebugViz,p=l.queryBoundsDebugViz;if(f&&f.vertices.length>0){f.lazyUpload(r);const i=f.vertexBuffer,n=f.indexBuffer,l=f.segments;null!=i&&null!=n&&null!=l&&a.draw(t,o.LINE_STRIP,c,u,h,e.$.disabled,e.a0(s,f.color.toPremultipliedRenderColor(null)),d,i,n,l)}if(p&&p.vertices.length>0){p.lazyUpload(r);const i=p.vertexBuffer,n=p.indexBuffer,l=p.segments;null!=i&&null!=n&&null!=l&&a.draw(t,o.LINE_STRIP,c,u,h,e.$.disabled,e.a0(s,p.
vendor: 4,291 bytes, line 2
2color.toPremultipliedRenderColor(null)),d,i,n,l)}}const mt=(t,i,n,r,o,s,a,l)=>{const c=e.a6/s.tileSize;return{u_matrix:t,u_inv_rot_matrix:i,u_camera_to_center_distance:n.getCameraToCenterDistance(l),u_extrude_scale:[n.pixelsToGLUnits[0]/c,n.pixelsToGLUnits[1]/c],u_zoom_transition:r,u_tile_id:a,u_merc_center:o}},_t=(e,t,i,n)=>({u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:i.getCameraToCenterDistance(n),u_viewport_size:[i.width,i.height]});let gt;const yt={loaded:!0,validateStyle:function(t,i=e.s){return je(Ue(t,i))},validateSource:e=>je(Ce(e)),validateLight:e=>je(Le(e)),validateLights:e=>je(ze(e)),validateTerrain:e=>je(Fe(e)),validateFog:e=>je(Oe(e)),validateSnow:t=>je(function(t){const i=t.value,n=t.style,r=t.styleSpec,o=r.snow;if(void 0===i)return[];if(!e.l(i))return[new ce("snow",i,`object expected, ${e.n(i)} found`)];let s=[];for(const t in i){const a=t.match(e.K);s=s.concat(a&&o[a[1]]&&o[a[1]].transition?Be({key:t,value:i[t],valueSpec:r.transition,style:n,styleSpec:r}):o[t]?Be({key:t,value:i[t],valueSpec:o[t],style:n,styleSpec:r}):[new ue(t,i[t],`unknown property "${t}"`)])}return s}(t)),validateRain:t=>je(function(t){const i=t.value,n=t.style,r=t.styleSpec,o=r.rain;if(void 0===i)return[];if(!e.l(i))return[new ce("rain",i,`object expected, ${e.n(i)} found`)];let s=[];for(const t in i){const a=t.match(e.K);s=s.concat(a&&o[a[1]]&&o[a[1]].transition?Be({key:t,value:i[t],valueSpec:r.transition,style:n,styleSpec:r}):o[t]?Be({key:t,value:i[t],valueSpec:o[t],style:n,styleSpec:r}):[new ue(t,i[t],`unknown property "${t}"`)])}return s}(t)),validateLayer:e=>je(Ie(e)),validateFilter:e=>je(xe(e)),validatePaintProperty:e=>je(Ee(e)),validateLayoutProperty:e=>je(Se(e)),validateModel:e=>je(Re(e)),diffStyles:function(t,i){if(!t)return[{command:Ge,args:[i]}];let n=[];try{if(!e.O(t.version,i.version))return[{command:Ge,args:[i]}];if(e.O(t.center,i.center)||n.push({command:"setCenter",args:[i.center]}),e.O(t.zoom,i.zoom)||n.push({command:"setZoom",args:[i.zoom]}),e.O(t.bearing,i.bearing)||n.push({command:"setBearing",args:[i.bearing]}),e.O(t.pitch,i.pitch)||n.push({command:"setPitch",args:[i.pitch]}),e.O(t.sprite,i.sprite)||n.push({command:"setSprite",args:[i.sprite]}),e.O(t.glyphs,i.glyphs)||n.push({command:"setGlyphs",args:[i.glyphs]}),e.O(t.imports,i.imports)||function(t=[],i=[],n){i=i||[];const r=(t=t||[]).map(nt),o=i.map(nt),s=t.reduce(rt,{}),a=i.reduce(rt,{}),l=r.slice();let c,u,h,d;for(c=0,u=0;c<r.length;c++)h=r[c],Object.hasOwn(a,h)?u++:(n.push({command:Ye,args:[h]}),l.splice(l.indexOf(h,u),1));for(c=0,u=0;c<o.length;c++)h=o[o.length-1-c],l[l.length-1-c]!==h&&(Object.hasOwn(s,h)?(n.push({command:Ye,args:[h]}),l.splice(l.lastIndexOf(h,l.length-u),1)):u++,d=l[l.length-c],n.push({command:"addImport",args:[a[h],d]}),l.splice(l.length-c,0,h));for(const t of i){const i=s[t.id];i&&(delete i.data,e.O(i,t)||n.push({command:"updateImport",args:[t.id,t]}))}}(t.imports,i.imports,n),e.O(t.transition,i.transition)||n.push({command:"setTransition",args:[i.transition]}),e.O(t.light,i.light)||n.push({command:"setLight",args:[i.light]}),e.O(t.fog,i.fog)||n.push({command:"setFog",args:[i.fog]}),e.O(t.snow,i.snow)||n.push({command:"setSnow",args:[i.snow]}),e.O(t.rain,i.rain)||n.push({command:"setRain",args:[i.rain]}),e.O(t.projection,i.projection)||n.push({command:"setProjection",args:[i.projection]}),e.O(t.lights,i.lights)||n.push({command:"setLights",args:[i.lights]}),e.O(t.camera,i.camera)||n.push({command:"setCamera",args:[i.camera]}),e.O(t.iconsets,i.iconsets)||function(t,i,n){let r;for(r in i=i||{},t=t||{})Object.hasOwn(t,r)&&(Object.hasOwn(i,r)||n.push({command:Je,args:[r]}));for(r in i){if(!Object.hasOwn(i,r))continue;const o=i[r];Object.hasOwn(t,r)?e.O(t[r],o)||(n.push({command:Je,args:[r]}),n.push({command:Xe,args:[r,o]})):n.push({command:Xe,args:[r,o]})}}(t.iconsets,i.iconsets,n),!e.O(t["color-theme"],i["color-theme"]))return[{command:Ge,args:[i]}];const r={},o=[];!function(t,i,n,r){let o;for(o in i=i||{},t=t||{})Object.hasOwn(t,o)&&(Object.hasOwn(i,o)||Qe(o,n,r));for(o in i){if(!Object.hasOwn(i,o))continue;const s=i[o];Object.hasOwn(t,o)?e.O(t[o],s)||("geojson"===t[o].type&&"geojson"===s.type&&tt(t,i,o)?n.push({command:"setGeoJSONSourceData",args:[o,s.data]}):et(o,i,n,r)):Ke(o,i,n)}}(t.sources,i.sources,o,r);const s=[];
2t.layers&&t.layers.forEach(e=>{e.source&&r[e.source]?n.push({command:He,args:[e.id]}):s.push(e)});let a=t.terrain;a&&r[a.source]&&(n.push({command:We,args:[void 0]}),a=void 0),n=n.concat(o),e.O(a,i.terrain)||n.push({command:We,args:[i.terrain]}),function(t,i,n){i=i||[];const r=(t=t||[]).map(nt),o=i.map(nt),s=t.reduce(rt,{}),a=i.reduce(rt,{}),l=r.slice(),c=Object.create(null);let u,h,d,f,p,m,_;for(u=0,h=0;u<r.length;u++)d=r[u],Object.hasOwn(a,d)?h++:(n.push({command:He,args:[d]}),l.splice(l.indexOf(d,h),1));for(u=0,h=0;u<o.length;u++)d=o[o.length-1-u],l[l.length-1-u]!==d&&(Object.hasOwn(s,d)?(n.push({command:He,args:[d]}),l.splice(l.lastIndexOf(d,l.length-h),1)):h++,m=l[l.length-u],n.push({command:$e,args:[a[d],m]}),l.splice(l.length-u,0,d),c[d]=!0);for(u=0;u<o.length;u++)if(d=o[u],f=s[d],p=a[d],!c[d]&&!e.O(f,p))if(e.O(f.source,p.source)&&e.O(f["source-layer"],p["source-layer"])&&e.O(f.type,p.type)){for(_ in it(f.layout,p.layout,n,d,null,"setLayoutProperty"),it(f.paint,p.paint,n,d,null,Ze),e.O(f.slot,p.slot)||n.push({command:"setSlot",args:[d,p.slot]}),e.O(f.filter,p.filter)||n.push({command:"setFilter",args:[d,p.filter]}),e.O(f.minzoom,p.minzoom)&&e.O(f.maxzoom,p.maxzoom)||n.push({command:"setLayerZoomRange",args:[d,p.minzoom,p.maxzoom]}),f)Object.hasOwn(f,_)&&"layout"!==_&&"paint"!==_&&"filter"!==_&&"metadata"!==_&&"minzoom"!==_&&"maxzoom"!==_&&"slot"!==_&&(0===_.indexOf("paint.")?it(f[_],p[_],n,d,_.slice(6),Ze):e.O(f[_],p[_])||n.push({command:qe,args:[d,_,p[_]]}));for(_ in p)Object.hasOwn(p,_)&&!Object.hasOwn(f,_)&&"layout"!==_&&"paint"!==_&&"filter"!==_&&"metadata"!==_&&"minzoom"!==_&&"maxzoom"!==_&&"slot"!==_&&(0===_.indexOf("paint.")?it(f[_],p[_],n,d,_.slice(6),Ze):e.O(f[_],p[_])||n.push({command:qe,args:[d,_,p[_]]}))}else n.push({command:He,args:[d]}),m=l[l.lastIndexOf(d)+1],n.push({command:$e,args:[p,m]})}(s,i.layers,n)}catch(e){console.warn("Unable to compute style diff:",e),n=[{command:Ge,args:[i]}]}return n},drawDebug:function(t,i,n,r,o,s){for(let a=0;a<n.length;a++)if(o){const o=1,l=.8,c=new e.C(r.r*l,r.g*l,r.b*l,1);ut(t,i,n[a],r,-o,-o,s),ut(t,i,n[a],r,-o,o,s),ut(t,i,n[a],r,o,o,s),ut(t,i,n[a],r,o,-o,s),ut(t,i,n[a],c,0,0,s)}else ut(t,i,n[a],r,0,0,s)},drawDebugPadding:function(e){const t=e.transform.padding;ht(e,e.transform.height-(t.top||0),3,ot),ht(e,t.bottom||0,3,st),dt(e,t.left||0,3,at),dt(e,e.transform.width-(t.right||0),3,lt);const i=e.transform.centerPoint;!function(e,t,i,n){ft(e,t-1,i-10,2,20,n),ft(e,t-10,i-1,20,2,n)}(e,i.x,e.transform.height-i.y,ct)},drawDebugQueryGeometry:function(e,t,i){for(let n=0;n<i.length;n++)pt(e,t,i[n])},drawCollisionDebug:function(t,i,n,r,o,s,a){const l=t.context,c=l.gl,u=t.transform,h=[e.a7(u.center.lng),e.a8(u.center.lat)],d=n.layout.get("symbol-placement"),f=n.layout.get("text-variable-anchor"),p="map"===n.layout.get("icon-rotation-alignment"),m="map"===n.layout.get("text-rotation-alignment"),_="point"!==d,g=[];let y=0,v=0;for(let l=0;l<r.length;l++){const d=r[l],x=i.getTile(d),b=x.getBucket(n);if(!b)continue;const w=b.getProjection().createInversionMatrix(u,d.canonical),T=[],E=e.a9(d,b,u),S=!a&&p&&_,I=a&&m&&_,A=f&&b.hasTextData(),M=b.hasIconTextFit()&&A&&b.hasIconData(),C=S||I||a&&A||M,D="globe"===b.projection.name,P=D?e.S(u.zoom):0;D&&(T.push("PROJECTION_GLOBE_VIEW"),C&&T.push("PROJECTED_POS_ON_VIEWPORT"));const R=t.getOrCreateProgram("collisionBox",{defines:T});let L=E;0===o[0]&&0===o[1]||(L=t.translatePosMatrix(E,x,o,s));const z=a?b.textCollisionBox:b.iconCollisionBox,F=b.collisionCircleArray;if(F.length>0){const t=e.Y(),i=L;e.aa(t,b.placementInvProjMatrix,u.glCoordMatrix),e.aa(t,t,b.placementViewportMatrix),g.push({circleArray:F,circleOffset:v,transform:i,invTransform:t,projection:b.getProjection()}),y+=F.length/4,v=y}if(!z)continue;t.terrain&&t.terrain.setupElevationDraw(x,R);const O=D?[d.canonical.x,d.canonical.y,1<<d.canonical.z]:[0,0,0];R.draw(t,c.LINES,e.Z.disabled,e._.disabled,t.colorModeForRenderPass(),e.$.disabled,mt(L,w,u,P,h,x,O,b.getProjection()),n.id,z.layoutVertexBuffer,z.indexBuffer,z.segments,null,u.zoom,null,[z.collisionVertexBuffer,z.collisionVertexBufferExt])}if(!a||!g.length)return;const x=t.getOrCreateProgram("collisionCircle"),b=new e.ab;b.resize(4*y),b._trim();let w=0;for(const e of g)for(let t=0;t<e.circleArray.length/4;t++){const i=4*t,n=e.circleArray[i+0],r=e.circleArray[i+1],o=e.circleArray[i+2],s=e.circleArray[i+3];b.emplace(w++,n,r,o,s,0),b.emplace(w++,n,r,o,s,1),b.emplace(w++,n,r,o,s,2),b.emplace(w++,n,r,o,s,3)}(!gt||gt.length<2*y)&&(gt=function(t){const i=2*t,n=new e.ae;n.resize(i),n._trim();for(let e=0;e<i;e++){const t=6*e;n.uint16[t+0]=4*e+0,n.uint16[t+1]=4*e+1,n.uint16[t+2]=4*e+2,n.uint16[t+3]=4*e+2,n.uint16[t+4]=4*e+3,n.uint16[t+5]=4*e+0}return n}(y));const T=l.createIndexBuffer(gt,!0),E=l.createVertexBuffer(b,e.ac.members,!0);for(const i of g){const r=_t(i.transform,i.invTransform,u,i.projection);x.draw(t,c.TRIANGLES,e.Z.disabled,e._.disabled,t.colorModeForRenderPass(),e.$.disabled,r,n.id,E,T,e.ad.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,u.zoom)}E.destroy(),T.destroy()}};async function vt(){return Promise.resolve()}function xt(t,i){let n=!1;
vendor: 19,096 bytes, line 2
2if(i&&i.length)for(const r of i)r instanceof ue?e.w(r.message):(t.fire(new e.f(new Error(r.message))),n=!0);return n}function bt(e){return(...t)=>{const i=yt[e];return i?i(...t):[]}}const wt=bt("validateStyle"),Tt=bt("validateSource"),Et=bt("validateLight"),St=bt("validateLights"),It=bt("validateTerrain"),At=bt("validateFog"),Mt=bt("validateSnow"),Ct=bt("validateRain"),Dt=bt("validateLayer"),Pt=bt("validateFilter"),Rt=bt("validatePaintProperty"),Lt=bt("validateLayoutProperty"),zt=bt("validateModel"),Ft=e.s.light;let Ot;class kt extends e.E{constructor(t,i="flat"){super(),this._transitionable=new e.af(Ot||(Ot=new e.ag({anchor:new e.ah(Ft.anchor),position:new e.ai(Ft.position),color:new e.ah(Ft.color),intensity:new e.ah(Ft.intensity)}))),this.setLight(t,i),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,t,i={}){this._validate(Et,e,i)||(this._transitionable.setTransitionOrValue(e),this.id=t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&xt(this,t.call(wt,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.s}))}}const Bt=e.s.terrain;let Nt=class extends e.E{constructor(t,i,n,r,o){super(),this.scope=n,this._transitionable=new e.af(new e.ag({source:new e.ah(Bt.source),exaggeration:new e.ah(Bt.exaggeration)}),n,r),this._transitionable.setTransitionOrValue(t,r),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=i,this.worldview=o}get(){return this._transitionable.serialize()}set(e,t){this._transitionable.setTransitionOrValue(e,t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}getExaggeration(t){return this._transitioning.possiblyEvaluate(new e.aj(t,{worldview:this.worldview})).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const t=this._transitionable._values.exaggeration;if(!t)return null;const i=t.value.expression;if(!i)return null;let n=-1,r=-1,o=1;for(const t of i.zoomStops)o=i.evaluate(new e.aj(t,{worldview:this.worldview})),o>.01?(n=t,r=-1):r=t;return o<.01&&n>0&&r>n?[n,r]:null}isZoomDependent(){const t=this._transitionable._values.exaggeration;return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof e.ak}};function Vt(e,t){const i=e?e.terrain:null;return!!i&&(!t||!!t.projection.requiresDraping||!i.isZoomDependent()||i.getExaggeration(t.zoom)>0)}const Ut=e.s.fog;class jt extends e.E{constructor(t,i,n,r){super();const o=new e.ag({range:new e.ah(Ut.range),color:new e.ah(Ut.color),"color-use-theme":new e.ah({type:"string","property-type":"data-constant",default:"default"}),"high-color":new e.ah(Ut["high-color"]),"high-color-use-theme":new e.ah({type:"string","property-type":"data-constant",default:"default"}),"space-color":new e.ah(Ut["space-color"]),"space-color-use-theme":new e.ah({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new e.ah(Ut["horizon-blend"]),"star-intensity":new e.ah(Ut["star-intensity"]),"vertical-range":new e.ah(Ut["vertical-range"])});this._transitionable=new e.af(o,n,r),this.set(t,r),this._transitioning=this._transitionable.untransitioned(),this._transform=i,this.properties=new e.al(o),this.scope=n}get state(){const t=this._transform,i="globe"===t.projection.name,n=e.S(t.zoom),r=this.properties.get("range"),o=[2,4.5],s=.5/Math.tan(.5*t._fov),a=[r[0]+s,r[1]+s];return{range:i?[e.am(o[0],a[0],n),e.am(o[1],a[1],n)]:a,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(e,t,i={}){if(this._validate(At,e,i))return;const n={...e};for(const e of Object.keys(Ut))void 0===n[e]&&(n[e]=Ut[e].default);this._options=n,this._transitionable.setTransitionOrValue(this._options,t)}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const i=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:e.an(e.ap,e.ao,t))*i.a}getOpacityAtLatLng(t,i){return this._transform.projection.supportsFog?e.aq(this.state,t,i):0}getOpacityForTile(t){if(!this._transform.projection.supportsFog)return[1,1];const i=this._transform.calculateFogTileMatrix(t.toUnwrapped());return e.ar(this.state,i,0,0,e.a6,e.a6,this._transform)}getOpacityForBounds(t,i,n,r,o){return this._transform.projection.supportsFog?e.ar(this.state,t,i,n,r,o,this._transform):[1,1]}getRangeForProjection(){return this._transform.projection.supportsFog?this.state.range:[0,1]}isVisibleOnFrustum(t){if(!this._transform.projection.supportsFog)return!1;const i=[4,5,6,7];for(const n of i){const i=t.points[n];let r;if(i[2]>=0)r=i;else{const o=t.points[n-4];r=e.as(o,i,o[2]/(o[2]-i[2]))}if(e.at(this.state,r[0],r[1],0,this._transform)>=e.au)return!0}return!1}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,e)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&xt(this,t.call(wt,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.s}))}}let Gt,$t,Ht=class extends e.E{constructor(t,i,n,r){super();const o=Gt||(Gt=new e.ag({density:new e.ah(e.s.snow.density),intensity:new e.ah(e.s.snow.intensity),color:new e.ah(e.s.snow.color),opacity:new e.ah(e.s.snow.opacity),vignette:new e.ah(e.s.snow.vignette),"vignette-color":new e.ah(e.s.snow["vignette-color"]),"center-thinning":new e.ah(e.s.snow["center-thinning"]),direction:new e.ah(e.s.snow.direction),"flake-size":new e.ah(e.s.snow["flake-size"])}));this._transitionable=new e.af(o,n,r),this.set(t,r),this._transitioning=this._transitionable.untransitioned(),this.properties=new e.al(o),this.scope=n}get state(){const t=this.properties.get("opacity"),i=this.properties.get("color"),n=this.properties.get("direction"),r=e.av(n[0]),o=-Math.max(e.av(n[1]),.01),s=[Math.cos(r)*Math.cos(o),Math.sin(r)*Math.cos(o),Math.sin(o)],a=this.properties.get("vignette"),l=this.properties.get("vignette-color"),c=new e.C(l.r,l.g,l.b,a);return{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new e.C(i.r,i.g,i.b,i.a*t),direction:s,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:c}}get(){return this._transitionable.serialize()}set(t,i,n={}){if(this._validate(Mt,t,n))return;const r={...t},o=e.s.snow;for(const e of Object.keys(o))void 0===r[e]&&(r[e]=o[e].default);this._options=r,this._transitionable.setTransitionOrValue(this._options,i)}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,e)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&xt(this,t.call(wt,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.s}))}},Zt=class extends e.E{constructor(t,i,n,r){super();const o=$t||($t=new e.ag({density:new e.ah(e.s.rain.density),intensity:new e.ah(e.s.rain.intensity),color:new e.ah(e.s.rain.color),opacity:new e.ah(e.s.rain.opacity),vignette:new e.ah(e.s.rain.vignette),"vignette-color":new e.ah(e.s.rain["vignette-color"]),"center-thinning":new e.ah(e.s.rain["center-thinning"]),direction:new e.ah(e.s.rain.direction),"droplet-size":new e.ah(e.s.rain["droplet-size"]),"distortion-strength":new e.ah(e.s.rain["distortion-strength"])}));this._transitionable=new e.af(o,n,r),this.set(t,r),this._transitioning=this._transitionable.untransitioned(),this.properties=new e.al(o),this.scope=n}get state(){const t=this.properties.get("opacity"),i=this.properties.get("color"),n=this.properties.get("direction"),r=e.av(n[0]),o=-Math.max(e.av(n[1]),.01),s=[Math.cos(r)*Math.cos(o),Math.sin(r)*Math.cos(o),Math.sin(o)],a=this.properties.get("vignette-color"),l=new e.C(a.r,a.g,a.b,this.properties.get("vignette"));return{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new e.C(i.r,i.g,i.b,i.a*t),direction:s,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:l}}get(){return this._transitionable.serialize()}set(t,i,n={}){if(this._validate(Ct,t,n))return;const r={...t},o=e.s.rain;for(const e of Object.keys(o))void 0===r[e]&&(r[e]=o[e].default);this._options=r,this._transitionable.setTransitionOrValue(this._options,i)}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,e)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,n){return(!n||!1!==n.validate)&&xt(this,t.call(wt,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.s}))}};const qt={workerUrl:"",workerClass:null,workerParams:void 0};function Wt(e){return null!=qt.workerClass?new qt.workerClass:new self.Worker(qt.workerUrl,{name:e,type:"module",...qt.workerParams})}const Yt="mapboxgl_preloaded_worker_pool";class Xt{constructor(e){this.active={},this.workers=null,this.name=e}acquire(e,t=Xt.workerCount){if(!this.workers)for(this.workers=[];this.workers.length<t;){const t=Wt(`${this.name||""}WorkerPool: ${e}-${this.workers.length}`);this.workers.push(t)}return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.workers&&0===this.numActive()&&(this.workers.forEach(e=>{e.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Yt]}numActive(){return Object.keys(this.active).length}}Xt.workerCount=2;class Jt{constructor(t,i,n="Worker",r=Xt.workerCount){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=e.aw();const o=this.workerPool.acquire(this.id,r);for(let e=0;e<o.length;e++){const t=new Jt.Actor(o[e],i,this.id);t.name=`${n} ${e}`,this.actors.push(t)}this.ready=!1,this.send("checkIfReady",null).then(()=>{this.ready=!0}).catch(()=>{})}send(e,t,i){return Promise.all(this.actors.map(n=>n.send(e,t,i)))}broadcast(e,t){for(const i of this.actors)i.notify(e,t)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(e=>{e.remove()}),this.actors=[],this.workerPool.release(this.id)}}Jt.Actor=e.ax;class Kt extends e.E{constructor(t,i,n,r){super(),this.scope=n,this._options=t,this.properties=new e.al(i),this._transitionable=new e.af(i,n,r),this._transitionable.setTransitionOrValue(t.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(e){this._transitionable.setTransitionOrValue(this._options.properties,e)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(e,t){this._options=e,this._transitionable.setTransitionOrValue(e.properties,t)}shadowsEnabled(){return!!this.properties&&!0===this.properties.get("cast-shadows")}}let Qt;const ei=()=>Qt||(Qt=new e.ag({color:new e.ah(e.s.properties_light_ambient.color),"color-use-theme":new e.ah({type:"string",default:"default","property-type":"data-constant"}),intensity:new e.ah(e.s.properties_light_ambient.intensity)}));let ti;const ii=()=>ti||(ti=new e.ag({direction:new e.ay(e.s.properties_light_directional.direction),color:new e.ah(e.s.properties_light_directional.color),"color-use-theme":new e.ah({type:"string",default:"default","property-type":"data-constant"}),intensity:new e.ah(e.s.properties_light_directional.intensity),"cast-shadows":new e.ah(e.s.properties_light_directional["cast-shadows"]),"shadow-quality":new e.ah(e.s.properties_light_directional["shadow-quality"]),"shadow-intensity":new e.ah(e.s.properties_light_directional["shadow-intensity"]),"shadow-draw-before-layer":new e.ah(e.s.properties_light_directional["shadow-draw-before-layer"])})),ni=(e,t,i,n,r,o,s,a,l,c=[0,0,1])=>({u_matrix:e,u_normal_matrix:t,u_opacity:i,u_faux_facade_ao_intensity:n,u_camera_pos:r,u_tile_to_meter:o,u_facade_emissive_chance:s,u_flood_light_color:a,u_flood_light_intensity:l,u_front_cutoff_params:c}),ri=e=>({u_matrix:e}),oi=e=>({u_matrix:e}),si=e.az;async function ai(){return Promise.resolve()}function li(t,i,n,r,o,s,a,l){n.resetLayerRenderingStats(t);const c=t.context,u=c.gl,h=t.transform,d=n.paint.get("fill-extrusion-pattern"),f=n.paint.get("fill-extrusion-pattern-cross-fade"),p=d.constantOr(null),m=d.constantOr(1),_=n.paint.get("fill-extrusion-opacity"),g=t.style.enable3dLights(),y=n.paint.get(g&&!m?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),v=[n.paint.get("fill-extrusion-ambient-occlusion-intensity"),y],x=n.layout.get("fill-extrusion-edge-radius"),b=x>0&&!n.paint.get("fill-extrusion-rounded-roof"),w=b?0:x,T="globe"===h.projection.name?e.aE():0,E="globe"===h.projection.name,S=E?e.S(h.zoom):0,I=[e.a7(h.center.lng),e.a8(h.center.lat)],A="none"===n.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),M=n.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(A?null:n.lut).toArray01().slice(0,3),C=n.paint.get("fill-extrusion-flood-light-intensity"),D=n.paint.get("fill-extrusion-vertical-scale"),P=0!==n.paint.get("fill-extrusion-line-width").constantOr(1),R=n.paint.get("fill-extrusion-height-alignment"),L=n.paint.get("fill-extrusion-base-alignment"),z=e.aF(t,n.paint.get("fill-extrusion-cutoff-fade-range")),F=n.paint.get("fill-extrusion-front-cutoff"),O=ui(h.pitch,F,!!t.terrain),k=O[2]<1;k&&(t.maxFrontCutoffRawStart=Math.max(t.maxFrontCutoffRawStart,F[0]));const B=[];let N;E&&B.push("PROJECTION_GLOBE_VIEW"),v[0]>0&&B.push("FAUX_AO"),b&&B.push("ZERO_ROOF_RADIUS"),l&&B.push("HAS_CENTROID"),C>0&&B.push("FLOOD_LIGHT"),z.shouldRenderCutoff&&B.push("RENDER_CUTOFF"),k&&B.push("RENDER_FRONT_CUTOFF"),P&&B.push("RENDER_WALL_MODE");const V="shadow"===t.renderPass,U=t.shadowRenderer,j=V&&!!U,G=V?e.$.disabled:e.$.backCCW;t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!0);let $=[0,0,0];if(U){const i=t.style.directionalLight,n=t.style.ambientLight;i&&n&&($=e.aG(t.style,i,n)),V||(B.push("RENDER_SHADOWS"),U.useNormalOffset&&B.push("NORMAL_OFFSET")),N=B.concat(["SHADOWS_SINGLE_CASCADE"])}const H=j?"fillExtrusionDepth":m?"fillExtrusionPattern":"fillExtrusion",Z=n.getLayerRenderingStats();for(const d of r){const r=i.getTile(d),g=r.getBucket(n);if(!g||g.projection.name!==h.projection.name)continue;let y=!1;U&&(y=0===U.getMaxCascadeForTile(d.toUnwrapped()));const x=t.isTileAffectedByFog(d),b=g.programConfigurations.get(n.id);let A=!1;if(p&&r.imageAtlas){const t=r.imageAtlas,i=e.aH.from(p),n=i.getPrimary().scaleSelf(e.e.devicePixelRatio).toString(),o=i.getSecondary(),s=t.patternPositions.get(n),a=o?t.patternPositions.get(o.scaleSelf(e.e.devicePixelRatio).toString()):null;A=!!s&&!!a,s&&b.setConstantPatternPositions(s,a)}f>0&&(A||b.getPatternTransitionVertexBuffer("fill-extrusion-pattern"))&&B.push("FILL_EXTRUSION_PATTERN_TRANSITION");const F=t.getOrCreateProgram(H,{config:b,defines:y?N:B,overrideFog:x});if(t.terrain&&t.terrain.setupElevationDraw(r,F,{useMeterToDem:!0}),!g.centroidVertexBuffer){const e=F.getAttributeLocation(u,"a_centroid_pos");-1!==e&&u.vertexAttribI4ui(e,0,0,0,0)}!V&&U&&U.setupShadows(r.tileID.toUnwrapped(),F,"vector-tile"),m&&(t.context.activeTexture.set(u.TEXTURE0),r.imageAtlasTexture&&r.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),b.updatePaintBuffers());const k=n.paint.get("fill-extrusion-vertical-gradient"),j=1/g.tileToMeter;let q;if(V&&U){if(mi(r.tileID,g.maxHeight,t))continue;const i=U.calculateShadowPassMatrixFromTile(r.tileID.toUnwrapped());q=e.aN(i,w,j,D,R,L)}else{const i=t.translatePosMatrix(d.expandedProjMatrix,r,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),o=h.projection.createInversionMatrix(h,d.canonical),s=F.fixedDefines.includes("LIGHTING_3D_MODE");q=m?e.aI(i,t,k,_,v,w,j,d,r,T,R,L,S,I,o,M,D,f,s):e.aJ(i,t,k,_,v,w,j,d,T,R,L,S,I,o,M,D,C,$,O,s)}t.uploadCommonUniforms(c,F,d.toUnwrapped(),null,z);let W=g.segments;if("mercator"===h.projection.name&&!V&&(W=g.getVisibleSegments(r.tileID,t.terrain,t.transform.getFrustum(0)),!W.get().length))continue;if(Z)if(V)for(const e of W.get())Z.numRenderedVerticesInShadowPass+=e.primitiveLength;else for(const e of W.get())Z.numRenderedVerticesInTransparentPass+=e.primitiveLength;const Y=[];(t.terrain||l)&&Y.push(g.centroidVertexBuffer),E&&Y.push(g.layoutVertexExtBuffer),P&&Y.push(g.wallVertexBuffer),F.draw(t,c.gl.TRIANGLES,o,s,a,G,q,n.id,g.layoutVertexBuffer,g.indexBuffer,W,n.paint,t.transform.zoom,b,Y)}t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!1)}class ci{constructor(){this.translate=[0,0],this.translateAnchor="map",this.edgeRadius=0,this.cutoffFadeRange=0}}function ui(e,t,i){if(!(t[2]<1)||i)return[0,0,1];const n=180*e/Math.PI;if(n<15)return[-.5,t[1],t[2]];const r=Math.min(1,Math.max(0,(n-15)/5)),o=r*r*(3-2*r);return[-.5*(1-o)+t[0]*o,t[1],t[2]]}function hi(t,i,n,r,o,s,a){0===r.centroidVertexArray.length&&r.createCentroidsBuffer();const l=s?s.findDEMTileFor(n):null;if(!(l&&l.dem||a))return;s&&l&&l.dem&&r.selfDEMTileTimestamp!==l.dem._timestamp&&(r.borderDoneWithNeighborZ=[-1,-1,-1,-1],r.selfDEMTileTimestamp=l.dem._timestamp);const c=(t,i)=>{(t.flags|i.flags)&e.aK?(t.flags|=e.aK,i.flags|=e.aK):(t.flags&=~e.aK,i.flags&=~e.aK)},u=t=>new e.P(Math.ceil((t+e.aL)*e.aM),0),h=(t,i,n)=>{const r=Math.ceil((t+e.aL)*e.aM),o=Math.floor(Math.max(0,Math.min(e.a6-1,n))/4);return new e.P(r,o<<5|(3&i)<<3|7)},d=(t,i)=>{const n=Number.MAX_VALUE,r=i[0][0]!==n,o=i[1][0]!==n,s=i[2][0]!==n,a=i[3][0]!==n;if(!((r?1:0)+(o?1:0)+(s?1:0)+(a?1:0)>2))return t<2?s===a?void 0:s?0:e.a6-1:r===o?void 0:r?0:e.a6-1},f=(e,t,i,n)=>(t?d(e,t):void 0)??(n?d(i,n):void 0),p=e=>{const t=i.getSource().minzoom,n=e=>{const t=i.getTileByID(e);if(t&&t.hasData())return t.getBucket(o)},r=[0,-1,1];for(const i of r){if(e.overscaledZ+i<t)continue;const r=n(e.calculateScaledKey(e.overscaledZ+i));if(r)return r}},m=[0,0,0],_=(t,i)=>(m[0]=Math.min(t.min.y,i.min.y),m[1]=Math.max(t.max.y,i.max.y),m[2]=e.a6-i.min.x>t.max.x?i.min.x-e.a6:t.max.x,m),g=(t,i)=>(m[0]=Math.min(t.min.x,i.min.x),m[1]=Math.max(t.max.x,i.max.x),m[2]=e.a6-i.min.y>t.max.y?i.min.y-e.a6:t.max.y,m),y=[(e,t)=>_(e,t),(e,t)=>_(t,e),(e,t)=>g(e,t),(e,t)=>g(t,e)],v=(t,i,r,o,a,c,u)=>{if(!s)return 0;const h=[[c?r:t,c?t:r,0],[c?r:i,c?i:r,0]],d=u<0?e.a6+u:u,f=[c?d:(t+i)/2,c?(t+i)/2:d,0];
vendor: 5,341 bytes, line 2
2return 0===r&&u<0||0!==r&&u>0?s.getForTilePoints(a,[f],!0,o):h.push(f),s.getForTilePoints(n,h,!0,l),Math.max(h[0][2],h[1][2],f[2])/s.exaggeration()};for(let t=0;t<4;t++){const i=r.borderFeatureIndices[t];if(0===i.length)continue;const o=e.aC[t](n),l=p(o);if(!(l&&l instanceof e.aD))continue;const d=s?s.findDEMTileFor(o):null;if(!(d&&d.dem||a))continue;if(s&&d&&d.dem&&r.borderDEMTileTimestamp[t]!==d.dem._timestamp&&(r.borderDoneWithNeighborZ[t]=-1,r.borderDEMTileTimestamp[t]=d.dem._timestamp),r.borderDoneWithNeighborZ[t]===l.canonical.z)continue;0===l.centroidVertexArray.length&&l.createCentroidsBuffer();const m=(t<2?1:5)-t,_=l.borderDoneWithNeighborZ[m]!==r.canonical.z,g=l.borderFeatureIndices[m];let x=0;if(r.canonical.z!==l.canonical.z){for(const e of i)r.showCentroid(r.featuresOnBorder[e],"discard");if(_)for(const e of g)l.showCentroid(l.featuresOnBorder[e],"discard");r.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[m]=r.canonical.z;continue}const b=new Map,w=new Set,T=new Set;for(let e=0;e<g.length;e++){const t=l.featuresOnBorder[g[e]];void 0!==t.buildingId&&b.set(t.buildingId,e)}for(const n of i){const i=r.featuresOnBorder[n],u=r.centroidData.get(i.centroidDataIndex);if(void 0===i.buildingId)continue;const p=b.get(i.buildingId);if(void 0===p)continue;const _=l.featuresOnBorder[g[p]],x=l.centroidData.get(_.centroidDataIndex);w.add(n),T.add(p),a&&c(u,x);const E=0!==u.groupCentroidPos.x||0!==u.groupCentroidPos.y?u.groupCentroidPos:i.centroid(),S=0!==x.groupCentroidPos.x||0!==x.groupCentroidPos.y?x.groupCentroidPos:_.centroid(),I=s?void 0:f(t,i.borders,m,_.borders),A=void 0!==I?I:t<2?Math.round((E.y+S.y)/2):Math.round((E.x+S.x)/2),M=i.intersectsCount()>1||_.intersectsCount()>1;{let i=0;if(d&&d.dem&&!M){const n=y[t](u,x),r=t%2?e.a6-1:0;i=v(n[0],Math.min(e.a6-1,n[1]),r,d,o,t<2,n[2])}u.centroidXY=h(i,t,A),x.centroidXY=h(i,m,A)}if(r.writeCentroidToBuffer(u),l.writeCentroidToBuffer(x),void 0!==i.buildingId){for(const e of r.centroidData)e.buildingId===i.buildingId&&e!==u&&(e.centroidXY=u.centroidXY,r.writeCentroidToBuffer(e));for(const e of l.centroidData)e.buildingId===i.buildingId&&e!==x&&(e.centroidXY=x.centroidXY,l.writeCentroidToBuffer(e))}}for(const n of i){if(w.has(n))continue;const i=r.featuresOnBorder[n],p=r.centroidData.get(i.centroidDataIndex),_=i.borders[t];let b;for(;x<g.length;){if(T.has(x)){x++;continue}b=l.featuresOnBorder[g[x]];const e=b.borders[m];if(e[1]>_[0]+3||e[0]>_[0]-3)break;l.showCentroid(b,"keep"),x++}if(b&&x<g.length){let n=x,w=0;for(;;)if(T.has(x)){if(++x===g.length)break;b=l.featuresOnBorder[g[x]]}else{if(b.borders[m][0]>_[1]-3)break;if(w++,++x===g.length)break;b=l.featuresOnBorder[g[x]]}for(;n<g.length&&T.has(n);)n++;if(n>=g.length){r.showCentroid(i,"keep");continue}b=l.featuresOnBorder[g[n]];let E=!1;if(w>=1){const e=b.borders[m];Math.abs(_[0]-e[0])<3&&Math.abs(_[1]-e[1])<3&&(w=1,E=!0,x=n+1)}else if(0===w){r.showCentroid(i,"keep");continue}const S=l.centroidData.get(b.centroidDataIndex);a&&E&&c(p,S);const I=i.intersectsCount()>1||b.intersectsCount()>1;if(w>1)x=n,p.centroidXY=S.centroidXY=new e.P(0,0);else if(d&&d.dem&&!I){const i=y[t](p,S),n=t%2?e.a6-1:0,r=v(i[0],Math.min(e.a6-1,i[1]),n,d,o,t<2,i[2]);p.centroidXY=S.centroidXY=u(r)}else if(I){const n=s?void 0:f(t,i.borders,m,b.borders);void 0!==n?(p.centroidXY=h(0,t,n),S.centroidXY=h(0,m,n)):p.centroidXY=S.centroidXY=new e.P(0,0)}else p.centroidXY=r.encodeBorderCentroid(i),S.centroidXY=l.encodeBorderCentroid(b);r.writeCentroidToBuffer(p),l.writeCentroidToBuffer(S)}else r.showCentroid(i,"keep")}r.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[m]=r.canonical.z}(r.needsCentroidUpdate||!r.centroidVertexBuffer&&0!==r.centroidVertexArray.length)&&r.uploadCentroid(t)}const di=[1,0,0],fi=[0,1,0],pi=[0,0,1];function mi(t,i,n){const r=n.transform,o=n.shadowRenderer;if(!o)return!0;const s=n.frameCounter,a=n.currentShadowCascade;let l=n._shadowCullCache;if(!l||l.frame!==s||l.cascade!==a){const t=r.tileSize*o._cascades[a].scale,i=r.scaleZoom(t),c=o.shadowDirection,u=[c[0],c[1],-c[2]],h=[di,fi,pi,u,[u[0],0,u[2]],[0,u[1],u[2]]];l={frame:s,cascade:a,cameraFrustum:e.aA.fromInvProjectionMatrix(r.invProjMatrix,r.worldSize,i,!("globe"===r.projection.name)),edges:h,shadowDir:u,ws:t,zoom:i},n._shadowCullCache=l}const{cameraFrustum:c,edges:u,shadowDir:h,ws:d,zoom:f}=l;let p=i;if(r.elevation){const e=r.elevation.getMinMaxForTile(t);e&&(p+=e.max)}p/=e.aB(r.center.lat,f);const m=o.computeSimplifiedTileShadowVolume(t.toUnwrapped(),p,d,h);if(!m)return!1;const{vertices:_,planes:g}=m;return 0===c.intersectsPrecise(_,g,u)||0===o.getCurrentCascadeFrustum().intersectsPrecise(_,g,u)}const _i=new Float32Array(16),gi=new Float32Array(16);function yi(t){const{painter:i,source:n,layer:r,coords:o}=t;let s=t.defines;const a=i.context,l="shadow"===i.renderPass,c="light-beam"===i.renderPass,u=i.shadowRenderer,h=e.aB(i.transform.center.lat,i.transform.zoom),d=e.aF(i,r.paint.get("building-cutoff-fade-range"));d.shouldRenderCutoff&&(s=s.concat("RENDER_CUTOFF"));const f=r.paint.get("building-front-cutoff"),p=f[2]<1&&!i.terrain,m=ui(i.transform.pitch,f,!!i.terrain);p&&(s=s.concat("RENDER_FRONT_CUTOFF"),i.maxFrontCutoffRawStart=Math.max(i.maxFrontCutoffRawStart,f[0])),t.floodLightIntensity>0&&(s=s.concat("FLOOD_LIGHT"));for(const f of o){const o=n.getTile(f),p=o.getBucket(r);
vendor: 8,200 bytes, line 2
2if(!p)continue;u&&0===u.getMaxCascadeForTile(f.toUnwrapped())&&(s=s.concat("SHADOWS_SINGLE_CASCADE"));const _=p.programConfigurations.get(r.id);let g,y;const v=i.translatePosMatrix(f.expandedProjMatrix,o,[0,0],"map");e.aO(_i,v,[1,1,t.verticalScale]);const x=_i;let b;if(l&&u){if(mi(o.tileID,p.maxHeight*h,i))continue;const n=u.calculateShadowPassMatrixFromTile(o.tileID.toUnwrapped());e.aO(n,n,[1,1,t.verticalScale]),b=oi(n),g=y=i.getOrCreateProgram("buildingDepth",{config:_,defines:s,overrideFog:!1})}else if(c)g=y=i.getOrCreateProgram("buildingBloom",{config:_,defines:s,overrideFog:!1}),b=ri(x);else{const n=i.transform.calculatePosMatrix(f.toUnwrapped(),i.transform.worldSize);e.aO(n,n,[1,1,t.verticalScale]),e.aO(gi,n,[1,-1,1/h]),e.aP(gi,gi),e.aQ(gi,gi);const r=gi,o=i.transform.getFreeCameraOptions().position,l=1<<f.canonical.z;if(b=ni(x,r,t.opacity,t.facadeAOIntensity,[((o.x-f.wrap)*l-f.canonical.x)*e.a6,(o.y*l-f.canonical.y)*e.a6,o.z*l*e.a6],p.tileToMeter,t.facadeEmissiveChance,t.floodLightColor,t.floodLightIntensity,m),y=i.getOrCreateProgram("building",{config:_,defines:s,overrideFog:!1}),!0===t.depthOnly)g=y;else{const e=s.concat(["BUILDING_FAUX_FACADE","HAS_ATTRIBUTE_a_faux_facade_color_emissive"]);g=i.getOrCreateProgram("building",{config:_,defines:e,overrideFog:!1})}u&&(u.setupShadowsFromMatrix(n,y,!0),g!==y&&g.setShadowUniformValues(a,u.getShadowUniformValues()))}const w=(n,o)=>{if(c){const s=n.entranceBloom;o.draw(i,a.gl.TRIANGLES,t.depthMode,e._.disabled,t.blendMode,e.$.disabled,b,r.id,s.layoutVertexBuffer,s.indexBuffer,s.segmentsBucket,r.paint,i.transform.zoom,_,[s.layoutAttenuationBuffer,s.layoutColorBuffer])}else{const s=n.segmentsBucket;let c=[n.layoutNormalBuffer,n.layoutCentroidBuffer,n.layoutColorBuffer,n.layoutFloodLightDataBuffer];n.layoutFacadePaintBuffer&&(c=c.concat([n.layoutFacadeDataBuffer,n.layoutFacadeVerticalRangeBuffer,n.layoutFacadePaintBuffer])),o.draw(i,a.gl.TRIANGLES,t.depthMode,e._.disabled,t.blendMode,l?e.$.disabled:e.$.backCW,b,r.id,n.layoutVertexBuffer,n.indexBuffer,s,r.paint,i.transform.zoom,_,c)}};i.uploadCommonUniforms(a,y,f.toUnwrapped(),null,d),p.buildingWithoutFacade&&w(p.buildingWithoutFacade,y),p.buildingWithFacade&&(g!==y&&i.uploadCommonUniforms(a,g,f.toUnwrapped(),null,d),w(p.buildingWithFacade,g))}}function vi(t,i,n,r,o,s,a,l,c,u,h,d,f,p){const m=t.context.gl,_=t.depthModeForSublayer(1,e.Z.ReadOnly,m.LEQUAL,!0),g=e.am(.1,3,h),y=t._showOverdrawInspector,v=d,x=new ci;if(!y){const h=new e._({func:m.ALWAYS,mask:255},255,255,m.KEEP,m.KEEP,m.REPLACE),d=new e.a1([m.ONE,m.ONE,m.ONE,m.ONE],e.C.transparent,[!1,!1,!1,!0],m.MIN);e.aR(x,t,i,n,r,_,h,d,e.$.disabled,o,"sdf",s,a,l,c,u,g,v,!1,void 0)}{const h=y?e._.disabled:new e._({func:m.EQUAL,mask:255},255,255,m.KEEP,m.DECR,m.DECR),d=y?t.colorModeForRenderPass():new e.a1([m.ONE_MINUS_DST_ALPHA,m.DST_ALPHA,m.ONE,m.ONE],e.C.transparent,[!0,!0,!0,!0]);e.aR(x,t,i,n,r,_,h,d,e.$.disabled,o,"color",s,a,l,c,u,g,v,!1,void 0)}}class xi{constructor(){this._previousClosestBuildingId=null,this._hysteresisRatio=.8,this._indoorMinimumZoom=16}findClosestBuilding(e,t,i,n,r){if(i<this._indoorMinimumZoom)return this._previousClosestBuildingId=null,null;let o=null,s=Number.MAX_VALUE,a=Number.MAX_VALUE,l=!1;const c=this._previousClosestBuildingId?e[this._previousClosestBuildingId]:null;this._previousClosestBuildingId&&c&&this._isBuildingVisible(c,n,r)&&(l=!0,a=this._calculateDistance(t,c));for(const[i,a]of Object.entries(e)){if(!this._isBuildingVisible(a,n,r))continue;const e=this._calculateDistance(t,a);e<s&&(s=e,o=i)}return l&&o&&this._previousClosestBuildingId&&o!==this._previousClosestBuildingId?s>a*this._hysteresisRatio&&(o=this._previousClosestBuildingId):l&&!o&&(o=this._previousClosestBuildingId),this._previousClosestBuildingId=o,o}_calculateDistance(e,t){if(!t.center)return Number.MAX_VALUE;const i=e.lat-t.center[1],n=e.lng-t.center[0];return i*i+n*n}_isBuildingVisible(t,i,n){if(!n)return!1;for(const i of t.floorIds){const r=t.floors[i];if(!r.geometry)continue;const o=r.geometry;if("Polygon"===o.type){const t=this._convertRingToPoints(o.coordinates[0]);if(e.aU(t,n))return!0}else if("MultiPolygon"===o.type){const t=this._convertMultiPolygonToPoints(o.coordinates);if(e.aV(n,t))return!0}}return!1}_convertRingToPoints(t){return t.map(t=>new e.P(t[0],t[1]))}_convertMultiPolygonToPoints(t){return t.map(t=>0===t.length?[]:t[0].map(t=>new e.P(t[0],t[1])))}}const bi=.05,wi=(e,t,i,n,r,o,s,a,l,c,u,h)=>({u_matrix:e,u_normalize_matrix:t,u_globe_matrix:i,u_merc_matrix:n,u_grid_matrix:r,u_tl_parent:o,u_scale_parent:c,u_fade_t:u.mix,u_opacity:u.opacity,u_image0:0,u_image1:1,u_raster_elevation:h,u_zoom_transition:s,u_merc_center:a,u_cutoff_params:l}),Ti=(e,t,i,n,r,o,s,a,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_tile_offset:i,u_velocity:n,u_color_ramp:o,u_velocity_res:r,u_max_speed:s,u_uv_offset:a,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[bi,bi]}),Ei=(e,t,i,n,r,o,s,a,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_velocity:i,u_velocity_res:n,u_max_speed:r,u_speed_factor:o,u_reset_rate:s,u_rand_seed:Math.random(),u_uv_offset:a,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[bi,bi]});function Si(e,[t,i,n,r],[o,s]){if(o===s)return[0,0,0,0];const a=255*(e-1)/(e*(s-o));return[t*a,i*a,n*a,r*a]}function Ii(e,t,[i,n]){return i===n?0:.5/e+(t-i)*(e-1)/(e*(n-i))}var Ai=e.a$([{name:"a_index",type:"Int16",components:1}]);class Mi{constructor(t,i,n,r){const o={width:n[0],height:n[1],data:null},s=t.gl;this.targetColorTexture=new e.T(t,o,s.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new e.T(t,o,s.RGBA8,{useMipmap:!1}),this.context=t,this.updateParticleTexture(i,r),this.lastInvalidatedAt=0}updateParticleTexture(t,i){if(this.particleTextureDimension===i.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const n=this.context.gl,r=i.width*i.height;this.particleTexture0=new e.T(this.context,i,n.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new e.T(this.context,i,n.RGBA8,{premultiply:!1,useMipmap:!1});const o=new e.b0;o.reserve(r);for(let e=0;e<r;e++)o.emplaceBack(e);this.particleIndexBuffer=this.context.createVertexBuffer(o,Ai.members,!0),this.particleSegment=e.ad.simpleSegment(0,0,this.particleIndexBuffer.length,0),this.particleTextureDimension=i.width}update(t){return!(this.lastInvalidatedAt<t&&(this.lastInvalidatedAt=e.e.now(),1))}destroy(){this.targetColorTexture.destroy(),this.backgroundColorTexture.destroy(),this.particleIndexBuffer.destroy(),this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleSegment.destroy()}}function Ci(t,i,n,r,o){if(o>0){const s=e.e.now(),a=(s-t.timeAdded)/o,l=i?(s-i.timeAdded)/o:-1,c=n.getSource(),u=r.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),d=h&&t.refreshedUponExpiration?1:e.b1(h?a:1-l,0,1);return i?{opacity:1,mix:1-d,isFading:a<1}:{opacity:d,mix:0,isFading:a<1}}return{opacity:1,mix:0,isFading:!1}}function Di(t,i,n){if(!t)return null;const r=i.getTextureDescriptor(t,n,!0);if(!r)return null;let{texture:o,mix:s,offset:a,tileSize:l,buffer:c,format:u}=r;if(!o||!u)return null;let h=!1;return"uint32"===u&&(h=!0,s[3]=0,s=Si(e.ba,s,[0,n.paint.get("raster-particle-max-speed")]),a=Ii(e.ba,a,[0,n.paint.get("raster-particle-max-speed")])),{texture:o,textureOffset:[c/(l+2*c),l/(l+2*c)],tileSize:l,scalarData:h,scale:s,offset:a,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[u]]}}function Pi(e){const t=e._nearZ,i=e.projection.farthestPixelDistance(e),n=i-t,r=.2*e.height,o=t+r;return[t,i,(o-r-t)/n,(o-t)/n]}var Ri="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;
2ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}";e.bb["_prelude_raster_particle.glsl"]||(e.bb["_prelude_raster_particle.glsl"]=Ri);var Li={building:e.bc
vendor: 11,069 bytes, line 2
2('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nconst float window_depth=0.5;const float ao_radius=0.2;in vec4 v_color;in highp vec3 v_normal;in highp vec3 v_pos;\n#if defined(RENDER_FRONT_CUTOFF) || defined(ROUTE_CORRIDOR)\nin float v_dither_opacity;\n#endif\n#ifdef BUILDING_FAUX_FACADE\nin lowp float v_faux_facade;in highp float v_faux_facade_ed;in highp vec2 v_faux_facade_window;in highp vec2 v_faux_facade_floor;in highp vec2 v_faux_facade_range;in highp float v_aspect;in highp vec3 v_tbn_0;in highp vec3 v_tbn_1;in highp vec3 v_tbn_2;in highp vec4 v_faux_color_emissive;uniform float u_faux_facade_ao_intensity;\n#endif\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\n#ifdef FLOOD_LIGHT\nin highp float v_flood_radius;in float v_has_flood_light;\n#endif\nuniform lowp float u_opacity;uniform vec3 u_camera_pos;uniform highp float u_tile_to_meter;uniform float u_facade_emissive_chance;uniform vec3 u_flood_light_color;uniform float u_flood_light_intensity;vec3 linearTosRGB(in vec3 color) {return pow(color,vec3(1./2.2));}\n#ifdef BUILDING_FAUX_FACADE\nhighp float hash12(in highp vec2 p) {highp vec3 p3 =fract(vec3(p.xyx)*0.1031);p3+=dot(p3,p3.yzx+33.33);return fract((p3.x+p3.y)*p3.z);}float min3(in vec3 v) {return min(min(v.x,v.y),v.z);}highp vec2 get_uv_mask_id(in highp vec2 q,out highp float mask,out highp vec2 id) {highp vec2 p=q;mask=step(v_faux_facade_range.x,p.y)*step(p.y,v_faux_facade_range.y);p.y=p.y-v_faux_facade_range.x;highp vec2 uv=modf(p/v_faux_facade_floor,id);highp vec4 d=(v_faux_facade_floor.xyxy+vec4(-v_faux_facade_window,v_faux_facade_window))*0.5;highp vec4 edge=d/v_faux_facade_floor.xyxy;highp vec2 m=step(edge.xy,uv)*step(uv,edge.zw);mask*=m.x*m.y;uv-=vec2(0.5);uv*=vec2(0.5)/(vec2(0.5)-edge.xy);uv+=vec2(0.5);return uv;}highp float ray_unit_box(in highp vec3 ray_o,in highp vec3 ray_d,in highp vec3 bmin,in highp vec3 bmax) {highp vec3 planes=mix(bmin,bmax,step(0.0,ray_d));highp vec3 t=(planes-ray_o)/ray_d;return min3(t);}float get_emissive(in vec2 id) {if (u_facade_emissive_chance > 0.0) {return (step(hash12(id),u_facade_emissive_chance)+0.05)*v_faux_color_emissive.a;}return 0.0;}vec3 get_shade_info(in highp vec3 v,in highp vec3 v_normalized,in vec3 color,in vec2 id,in mat3 tbn,inout vec3 out_normal,inout float out_emissive) {vec3 out_color=color;highp vec3 abs_v=abs(v_normalized);bool x_major=abs_v.x >=abs_v.y && abs_v.x >=abs_v.z;bool y_major=abs_v.y >=abs_v.x && abs_v.y >=abs_v.z;bool z_major=abs_v.z >=abs_v.x && abs_v.z >=abs_v.y;if (x_major) {out_normal=-sign(v.x)*tbn[0];} else if (y_major) {out_normal=vec3(0.0,0.0,-sign(v.y));} else if (z_major) {out_color=v_faux_color_emissive.rgb;out_emissive=v.z <=0.0 ? get_emissive(id) : out_emissive;}float ao=1.0;if (u_faux_facade_ao_intensity > 0.0) {vec4 ao_range=v_faux_facade_window.xxyy*0.5-vec4(0,ao_radius,0,ao_radius);vec2 ao_range_z=vec2(window_depth*0.5)-vec2(0.0,ao_radius);if (x_major || y_major) {ao*=smoothstep(-ao_range_z.x,-ao_range_z.y,v.z);} else if (z_major) {ao*=smoothstep(-ao_range.x,-ao_range.y,v.x)*(1.0-smoothstep(ao_range.y,ao_range.x,v.x));ao*=smoothstep(-ao_range.z,-ao_range.w,v.y)*(1.0-smoothstep(ao_range.w,ao_range.z,v.y));}ao=mix(1.0,min(1.0,ao+0.25),u_faux_facade_ao_intensity);}out_color*=ao;return out_color;}\n#endif\nvec3 apply_lighting_linear(in vec3 color,in vec3 normal,in float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return color*(ambient_contrib+directional_contrib);}void main() {vec3 normal=normalize(v_normal);vec3 base_color=v_color.rgb;float emissive=v_color.a;\n#ifdef BUILDING_FAUX_FACADE\nif (v_faux_facade > 0.0) {highp mat3 tbn=mat3(v_tbn_0,v_tbn_1,v_tbn_2);highp vec3 v=vec3(v_pos.xy,v_pos.z/u_tile_to_meter)-u_camera_pos;highp vec3 view_tangent=transpose(tbn)*v;highp vec2 q=vec2(v_faux_facade_ed,v_pos.z);float mask=0.0;vec2 id=vec2(0.0);highp vec2 uv=get_uv_mask_id(q,mask,id);uv*=v_faux_facade_window;highp vec3 bmin=vec3(0.0,0.0,-window_depth);highp vec3 bmax=bmin+vec3(v_faux_facade_window,window_depth);highp vec3 ray_o=vec3(uv,0.0);highp vec3 ray_d=normalize(view_tangent);highp float t_min=ray_unit_box(ray_o,ray_d,bmin,bmax);highp vec3 hit=ray_o+t_min*ray_d;highp vec3 r=vec3(v_faux_facade_window,-window_depth);hit-=r*0.5;highp vec3 normalized=hit/r;vec3 out_normal=normal;float out_emissive=emissive;vec3 room_color=get_shade_info(hit,normalized,base_color,id,tbn,out_normal,out_emissive);base_color=mix(base_color,room_color,mask);normal=mix(normal,out_normal,mask);emissive=mix(emissive,out_emissive,mask);}\n#endif\nvec4 color=vec4(base_color,1.0);vec3 xy_flipped_normal=vec3(-normal.xy,normal.z);float shadowed_lighting_factor=0.0;\n#ifdef RENDER_SHADOWS\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\n#else\nshadowed_lighting_factor=max(0.0,dot(xy_flipped_normal,u_lighting_directional_dir));\n#endif\ncolor.rgb=apply_lighting_linear(color.rgb,xy_flipped_normal,shadowed_lighting_factor);color.rgb=linearTosRGB(color.rgb);\n#ifdef FLOOD_LIGHT\nfloat flood_radiance=(1.0-min(v_pos.z/v_flood_radius,1.0))*u_flood_light_intensity*v_has_flood_light;color.rgb=mix(color.rgb,u_flood_light_color,flood_radiance);\n#endif\ncolor.rgb=mix(color.rgb,linearTosRGB(base_color.rgb),emissive);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,v_pos.z));\n#endif\ncolor*=u_opacity;\n#if defined(RENDER_FRONT_CUTOFF) || defined(ROUTE_CORRIDOR)\nif (v_dither_opacity < 1.0) {int index=viewport_dither_index(gl_FragCoord.xy);if (v_dither_opacity < DITHER_THRESHOLDS[index]) {discard;}}\n#endif\nglFragColor=color;\n#ifdef DEBUG_SHOW_NORMALS\ncolor.rgb=xy_flipped_normal*0.5+vec3(0.5,0.5,0.5);color.a=1.0;glFragColor=color;\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_feature_cutout.vertex.glsl"\nin vec3 a_pos_3f;in ivec4 a_normal_3;in ivec4 a_centroid_3;\n#ifdef FLOOD_LIGHT\nin int a_flood_light_wall_radius_1i16;\n#endif\n#ifdef BUILDING_FAUX_FACADE\nin uvec4 a_faux_facade_data;in uvec2 a_faux_facade_vertical_range;\n#endif\nuniform mat4 u_matrix;uniform mat4 u_normal_matrix;uniform highp float u_tile_to_meter;\n#if defined(RENDER_FRONT_CUTOFF) || defined(ROUTE_CORRIDOR)\n#ifdef RENDER_FRONT_CUTOFF\nuniform vec3 u_front_cutoff_params;\n#endif\nout float v_dither_opacity;\n#endif\nout vec4 v_color;out vec3 v_normal;out highp vec3 v_pos;\n#ifdef BUILDING_FAUX_FACADE\nout lowp float v_faux_facade;out highp float v_faux_facade_ed;out highp vec2 v_faux_facade_window;out highp vec2 v_faux_facade_floor;out highp vec2 v_faux_facade_range;out highp float v_aspect;out highp vec3 v_tbn_0;out highp vec3 v_tbn_1;out highp vec3 v_tbn_2;out highp vec4 v_faux_color_emissive;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#ifdef FLOOD_LIGHT\nout highp float v_flood_radius;out float v_has_flood_light;\n#endif\nconst float MAX_UINT_16=65535.0;const float MAX_INT_16=32767.0;const float MAX_UINT_8=255.0;const float TWO_POW_8=256.0;const float FLOOD_LIGHT_MAX_RADIUS_METER=2048.0;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#ifdef BUILDING_FAUX_FACADE\nmat3 get_tbn(in vec3 normal) {const vec3 bitangent=vec3(0.0,0.0,1.0);vec3 tangent=normalize(vec3(normal.y,-normal.x,0.0));return mat3(tangent,bitangent,normal);}\n#endif\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 part_color_emissive\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 faux_facade_color_emissive\nvoid main() {\n#pragma mapbox: initialize-attribute-custom highp uvec2 part_color_emissive\n#pragma mapbox: initialize-attribute-custom highp uvec2 faux_facade_color_emissive\n#ifdef FLOOD_LIGHT\nv_flood_radius=(float(a_flood_light_wall_radius_1i16)/MAX_INT_16*FLOOD_LIGHT_MAX_RADIUS_METER);v_has_flood_light=step(0.0,v_flood_radius);\n#endif\nvec4 color_emissive=decode_color(vec2(part_color_emissive));v_color=vec4(sRGBToLinear(color_emissive.rgb),color_emissive.a);vec3 a_normal_3f=vec3(a_normal_3)/MAX_INT_16;v_normal=vec3(u_normal_matrix*vec4(a_normal_3f,0.0));float hidden=0.0;float depth_offset=0.0;float frontCutoffOpacity=1.0;float routeFade=0.0;vec2 centroid_xy=vec2(a_centroid_3.xy >> 2);vec2 spanBits=vec2(a_centroid_3.xy & 3);\n#ifdef BUILDING_FAUX_FACADE\nvec4 faux_facade_data=vec4(a_faux_facade_data);v_faux_facade=faux_facade_data.x;if (v_faux_facade > 0.0) {v_faux_facade_ed=faux_facade_data.x *u_tile_to_meter;float window_x_perc=floor(faux_facade_data.y/TWO_POW_8);float window_y_perc=faux_facade_data.y-TWO_POW_8*window_x_perc;vec2 window_perc=vec2(window_x_perc,window_y_perc)/MAX_UINT_8;v_faux_facade_floor=(faux_facade_data.zw/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_faux_facade_window=window_perc*v_faux_facade_floor;v_faux_facade_range=(vec2(a_faux_facade_vertical_range)/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_aspect=v_faux_facade_window.x/v_faux_facade_window.y;mat3 tbn=get_tbn(normalize(v_normal));v_tbn_0=tbn[0];v_tbn_1=tbn[1];v_tbn_2=tbn[2];v_faux_color_emissive=decode_color(vec2(faux_facade_color_emissive));v_faux_color_emissive.rgb=sRGBToLinear(v_faux_color_emissive.rgb);depth_offset=min(1000.0,float(a_centroid_3.z))*0.0000002;}\n#endif\nv_pos=a_pos_3f;\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nfloat halfSpanX=spanBits.x*10.0/u_tile_to_meter;float halfSpanY=spanBits.y*10.0/u_tile_to_meter;vec2 screenUpInTile=vec2(u_matrix[0][1],u_matrix[1][1]);vec2 spanOffset=vec2(halfSpanX,halfSpanY)*sign(screenUpInTile);vec2 cutoff_highestCorner=centroid_xy+spanOffset;vec2 cutoff_lowestCorner=centroid_xy-spanOffset;\n#endif\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nvec4 ground=u_matrix*vec4(centroid_xy,0.0,1.0);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,ground.z);hidden=float(v_cutoff_opacity==0.0);v_pos.z*=v_cutoff_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shadow_pos=v_pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset_model(v_normal);shadow_pos+=offset*shadow_normal_offset_multiplier0();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shadow_pos,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(shadow_pos,1.0);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(v_pos);\n#endif\n#ifdef RENDER_FRONT_CUTOFF\n{hidden=max(hidden,float(ground.w <=0.0));
vendor: 19,751 bytes, line 2
2float ndc_y=ground.y/max(ground.w,0.001);float threshold=u_front_cutoff_params.x*2.0-1.0;float range_ndc=u_front_cutoff_params.y*2.0;hidden=max(hidden,float(ndc_y < threshold-range_ndc));float t=clamp((ndc_y-(threshold-range_ndc))/max(range_ndc,0.001),0.0,1.0);frontCutoffOpacity=mix(u_front_cutoff_params.z,1.0,t);}\n#endif\ngl_Position=mix(u_matrix*vec4(v_pos,1),AWAY,hidden);gl_Position.z-=depth_offset*gl_Position.w;\n#if defined(RENDER_FRONT_CUTOFF) || defined(ROUTE_CORRIDOR)\nv_dither_opacity=1.0;\n#ifdef RENDER_FRONT_CUTOFF\nv_dither_opacity=min(v_dither_opacity,frontCutoffOpacity);\n#endif\n#endif\n}'),buildingBloom:e.bc("in vec4 v_color_emissive;\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\nfloat saturate(float val) {return clamp(val,0.0,1.0);}void main() {\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\nfloat emission=v_color_emissive.a;float opacity=1.0;\n#ifdef HAS_ATTRIBUTE_a_bloom_attenuation\nfloat distance=length(vec2(1.3*max(0.0,abs(bloom_attenuation.x)-bloom_attenuation.z),bloom_attenuation.y));distance+= mix(0.5,0.0,clamp(emission-1.0,0.0,1.0));opacity*=saturate(1.0-distance*distance);\n#endif\n#ifdef RENDER_CUTOFF\nopacity*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(v_color_emissive.rgb,1.0)*opacity;}","in vec3 a_pos_3f;\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 part_color_emissive\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\nout vec4 v_color_emissive;uniform mat4 u_matrix;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute-custom highp uvec2 part_color_emissive\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\n#ifdef HAS_ATTRIBUTE_a_part_color_emissive\nvec4 color_emissive=decode_color(vec2(part_color_emissive));float part_emissive=color_emissive.a*5.0;v_color_emissive=vec4(sRGBToLinear(color_emissive.rgb),part_emissive);\n#else\nv_color_emissive=vec4(1.0);\n#endif\ngl_Position=u_matrix*vec4(a_pos_3f,1.0);\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}"),buildingDepth:e.bc("void main() {}","in vec3 a_pos_3f;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos_3f,1.0);}"),rasterParticle:e.bc('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),1.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin ivec2 a_pos;in uvec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 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 mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,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)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=vec2(a_texture_pos)/8192.0;gl_Position=u_matrix*vec4(vec2(a_pos)*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:e.bc("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin int a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(float(a_index),u_particle_texture_side_len),float(a_index)/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:e.bc("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in ivec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*vec2(a_pos)+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:e.bc('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow(\nlinearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)\n);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in ivec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*vec2(a_pos+ivec2(1));gl_Position=vec4(a_pos,0.0,1.0);}"),snowParticle:e.bc("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; \nuniform float u_horizontalOscillationRate; \nuniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}"),rainParticle:e.bc("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity; \nuniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos*=halfBoxSize; \npos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}"),vignette:e.bc("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}"),elevatedStructuresDepth:e.bc("void main() {}","in ivec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform float u_depth_bias;void main() {gl_Position=u_matrix*vec4(a_pos,a_height,1);gl_Position.z=gl_Position.z+u_depth_bias;}"),elevatedStructures:e.bc('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nin vec3 v_normal;in float v_height;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth;\n#endif\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}vec3 compute_view_dependent_emissive_color(float ndotl,float emissive_strength,vec3 color)\n{color=sRGBToLinear(color);color=color*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);color=linearTosRGB(color.rgb);return color;}uniform float u_emissive_strength;uniform float u_opacity_multiplier;\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nvec3 color=structure_color.xyz;vec2 cutout_factors=vec2(0.0);\n#ifdef LIGHTING_3D_MODE\nvec3 normal=normalize(v_normal);vec3 transformed_normal=vec3(-normal.xy,normal.z);float ndotl=calculate_NdotL(transformed_normal);float emissive_strength=u_emissive_strength;emissive_strength=0.0;vec3 emissive_color=compute_view_dependent_emissive_color(ndotl,emissive_strength,color.xyz);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);color.rgb=apply_lighting(color.rgb,transformed_normal,light);\n#else\ncolor=apply_lighting(color,transformed_normal);\n#endif\ncolor=mix(color,emissive_color,emissive_strength);if (v_height < 0.0) {float penetration=max(v_height+7.5,0.0);float occlusion=1.0-1.0/PI*acos(1.0-penetration/4.0);color=color*(1.0-pow(occlusion,2.0)*0.3);}\n#endif\n#ifdef FOG\ncolor=fog_apply(color,v_fog_pos);\n#endif\nvec4 out_color=vec4(color,1.0);out_color*=u_opacity_multiplier;glFragColor=out_color;HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin ivec2 a_pos;in float a_height;in ivec4 a_pos_normal_3;uniform mat4 u_matrix;out vec3 v_normal;out float v_height;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth;\n#endif\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nv_normal=vec3(a_pos_normal_3)/16384.0;v_height=a_height;vec3 pos=vec3(vec2(a_pos),a_height);gl_Position=u_matrix*vec4(pos,1);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(-v_normal.xy,v_normal.z));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),elevatedStructuresDepthReconstruct:e.bc('#include "_prelude_feature_cutout.fragment.glsl"\n#ifdef DEPTH_RECONSTRUCTION\nin float v_height;\n#endif\nvoid main() {\n#ifdef DEPTH_RECONSTRUCTION\nif (v_height >=0.0)\ndiscard;\n#else\n#endif\nglFragColor=vec4(1.0,0.0,0.0,1.0);}',"in ivec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform vec3 u_camera_pos;uniform highp float u_depth_bias;uniform lowp float u_height_scale;uniform lowp float u_reset_depth;\n#ifdef DEPTH_RECONSTRUCTION\nout float v_height;\n#endif\nvoid main() {vec3 vpos=vec3(a_pos,a_height*u_height_scale);\n#ifdef DEPTH_RECONSTRUCTION\nif (u_camera_pos.z > vpos.z) {vpos-=(u_camera_pos-vpos)*(vpos.z/(u_camera_pos.z-vpos.z));}v_height=a_height;\n#endif\ngl_Position=u_matrix*vec4(vpos,1);gl_Position.z=u_reset_depth==1.0 ? gl_Position.w : gl_Position.z+u_depth_bias;}")};e.bc(
vendor: 1,393 bytes, line 2
2Ri,"");const zi=e.a$([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]),Fi=e.a$([{type:"Float32",name:"a_pos_2f",components:2}]);class Oi{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(t,i){const n=t.getOrCreateProgram("vignette");if(!this.vignetteVx||!this.vignetteIdx){const i=new e.bd,n=new e.ae;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1),n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),this.vignetteVx=t.context.createVertexBuffer(i,Fi.members),this.vignetteIdx=t.context.createIndexBuffer(n)}const r=e.ad.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){t.uploadCommonUniforms(t.context,n);const s={u_vignetteShape:(o={vignetteShape:[i.start,i.range,Math.pow(10,i.fadePower)],vignetteColor:[i.color.r,i.color.g,i.color.b,i.color.a*i.strength]}).vignetteShape,u_vignetteColor:o.vignetteColor};n.draw(t,t.context.gl.TRIANGLES,e.Z.disabled,e._.disabled,e.a1.alphaBlended,e.$.disabled,s,"vignette",this.vignetteVx,this.vignetteIdx,r)}var o}}class ki{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(t,i){const n=t.getFreeCameraOptions().position,r=n.toAltitude(),o=n.toLngLat(),s=e.av(o.lng),a=e.av(o.lat),l=t.pixelsPerMeter/i,c=s*e.bk,u=e.bk
vendor: 7,941 bytes, line 2
2*Math.log(Math.tan(Math.PI/4+a/2));if(void 0===this._offsetXPrev)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{const e=-this._offsetYPrev+u,t=-this._elevationPrev+r;this._accumulatedOffsetX+=(-this._offsetXPrev+c)*l,this._accumulatedOffsetY+=e*l,this._accumulatedElevation+=t*l,this._offsetXPrev=c,this._offsetYPrev=u,this._elevationPrev=r}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function Bi(e,t){return[-(e[0]-Math.floor(e[0]/t)*t),-(e[1]-Math.floor(e[1]/t)*t),-(e[2]-Math.floor(e[2]/t)*t)]}function Ni(t){const i=e.bj(1323123451230),n=[];for(let r=0;r<t;++r){const t=2*i()-1,r=2*i()-1,o=2*i()-1;n.push(e.bi(t,r,o))}return n}function Vi(t,i,n,r,o){const s=e.b1((o-n)/(r-n),0,1);return e.am(t,i,s)}class Ui{constructor(e){this._movement=new ki,this._accumulatedTimeFromStart=0,this._prevTime=Date.now()/1e3,this._vignette=new Oi,this._ppmScaleFactor=e}destroy(){this.particlesVx&&this.particlesVx.destroy(),this.particlesIdx&&this.particlesIdx.destroy(),this._vignette&&this._vignette.destroy()}updateOnRender(t,i){const n=t.transform;this._movement.update(n,this._ppmScaleFactor);const r=n.starsProjMatrix,o=e.be([]);e.bf(o,o,e.av(90)-n._pitch),e.bg(o,o,-n.angle);const s=e.bh(new Float32Array(16),o),a=new Float32Array([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),l=e.aQ([],a),c=e.X([],l,s),u=Date.now()/1e3;return this._accumulatedTimeFromStart+=(u-this._prevTime)*i,this._prevTime=u,{projectionMatrix:r,modelviewMatrix:c}}}const ji=e.a$([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_snowParticleData",components:4},{type:"Float32",name:"a_snowParticleDataHorizontalOscillation",components:2}]),Gi=(e,t)=>({u_matrix:e,u_depth_bias:t}),$i=(e,t)=>({u_matrix:e,u_ground_shadow_factor:t,u_opacity_multiplier:1}),Hi=(e,t,i,n,r)=>({u_matrix:e,u_camera_pos:[t[0],t[1],t[2]],u_depth_bias:i,u_height_scale:n,u_reset_depth:r}),Zi={building:t=>({u_matrix:new e.a4(t),u_normal_matrix:new e.a4(t),u_opacity:new e.a3(t),u_faux_facade_ao_intensity:new e.a3(t),u_camera_pos:new e.a5(t),u_tile_to_meter:new e.a3(t),u_facade_emissive_chance:new e.a3(t),u_flood_light_color:new e.a5(t),u_flood_light_intensity:new e.a3(t),u_front_cutoff_params:new e.a5(t)}),buildingBloom:t=>({u_matrix:new e.a4(t)}),buildingDepth:t=>({u_matrix:new e.a4(t)}),elevatedStructuresDepth:t=>({u_matrix:new e.a4(t),u_depth_bias:new e.a3(t)}),elevatedStructures:t=>({u_matrix:new e.a4(t),u_ground_shadow_factor:new e.a5(t),u_opacity_multiplier:new e.a3(t)}),elevatedStructuresDepthReconstruct:t=>({u_matrix:new e.a4(t),u_camera_pos:new e.a5(t),u_depth_bias:new e.a3(t),u_height_scale:new e.a3(t),u_reset_depth:new e.a3(t)}),rasterParticle:t=>({u_matrix:new e.a4(t),u_normalize_matrix:new e.a4(t),u_globe_matrix:new e.a4(t),u_merc_matrix:new e.a4(t),u_grid_matrix:new e.a_(t),u_tl_parent:new e.a2(t),u_scale_parent:new e.a3(t),u_fade_t:new e.a3(t),u_opacity:new e.a3(t),u_image0:new e.aY(t),u_image1:new e.aY(t),u_raster_elevation:new e.a3(t),u_zoom_transition:new e.a3(t),u_merc_center:new e.a2(t),u_cutoff_params:new e.aZ(t)}),rasterParticleTexture:t=>({u_texture:new e.aY(t),u_opacity:new e.a3(t)}),rasterParticleDraw:t=>({u_particle_texture:new e.aY(t),u_particle_texture_side_len:new e.a3(t),u_tile_offset:new e.a2(t),u_velocity:new e.aY(t),u_color_ramp:new e.aY(t),u_velocity_res:new e.a2(t),u_max_speed:new e.a3(t),u_uv_offset:new e.a2(t),u_data_scale:new e.a2(t),u_data_offset:new e.a3(t),u_particle_pos_scale:new e.a3(t),u_particle_pos_offset:new e.a2(t)}),rasterParticleUpdate:t=>({u_particle_texture:new e.aY(t),u_particle_texture_side_len:new e.a3(t),u_velocity:new e.aY(t),u_velocity_res:new e.a2(t),u_max_speed:new e.a3(t),u_speed_factor:new e.a3(t),u_reset_rate:new e.a3(t),u_rand_seed:new e.a3(t),u_uv_offset:new e.a2(t),u_data_scale:new e.a2(t),u_data_offset:new e.a3(t),u_particle_pos_scale:new e.a3(t),u_particle_pos_offset:new e.a2(t)}),snowParticle:t=>({u_modelview:new e.a4(t),u_projection:new e.a4(t),u_time:new e.a3(t),u_cam_pos:new e.a5(t),u_velocityConeAperture:new e.a3(t),u_velocity:new e.a3(t),u_horizontalOscillationRadius:new e.a3(t),u_horizontalOscillationRate:new e.a3(t),u_boxSize:new e.a3(t),u_billboardSize:new e.a3(t),u_simpleShapeParameters:new e.a2(t),u_screenSize:new e.a2(t),u_thinningCenterPos:new e.a2(t),u_thinningShape:new e.a5(t),u_thinningAffectedRatio:new e.a3(t),u_thinningParticleOffset:new e.a3(t),u_particleColor:new e.aZ(t),u_direction:new e.a5(t)}),rainParticle:t=>({u_modelview:new e.a4(t),u_projection:new e.a4(t),u_time:new e.a3(t),u_cam_pos:new e.a5(t),u_texScreen:new e.aY(t),u_velocityConeAperture:new e.a3(t),u_velocity:new e.a3(t),u_boxSize:new e.a3(t),u_rainDropletSize:new e.a2(t),u_distortionStrength:new e.a3(t),u_rainDirection:new e.a5(t),u_color:new e.aZ(t),u_screenSize:new e.a2(t),u_thinningCenterPos:new e.a2(t),u_thinningShape:new e.a5(t),u_thinningAffectedRatio:new e.a3(t),u_thinningParticleOffset:new e.a3(t),u_shapeDirectionalPower:new e.a3(t),u_shapeNormalPower:new e.a3(t),u_mode:new e.a3(t)}),vignette:t=>({u_vignetteShape:new e.a5(t),u_vignetteColor:new e.aZ(t)})};function qi(t,i){const n=1<<t.canonical.z,r=(i.x*n-t.canonical.x-t.wrap*n)*e.a6,o=(i.y*n-t.canonical.y)*e.a6,s=e.bn(i.z,i.y);return e.bi(r,o,s)}function Wi(e){let t=0;for(const i of e)t|=i.frcMask;return t}class Yi{constructor(e=[]){this.tiles=e}getTile(e){for(const t of this.tiles)if(t.tileId.z===e.z&&t.tileId.x===e.x&&t.tileId.y===e.y)return t;return null}getTileOrParent(e){for(let t=e.z;t>0;--t){const i=Math.floor(e.x/(1<<e.z-t)),n=Math.floor(e.y/(1<<e.z-t));for(const e of this.tiles)if(e.tileId.z===t&&e.tileId.x===i&&e.tileId.y===n&&0!==e.frcMask)return e}return null}getFullCoverageMask(t){let i=null,n=0;for(let e=t.z;e>0;--e){const r=Math.floor(t.x/(1<<t.z-e)),o=Math.floor(t.y/(1<<t.z-e));for(const t of this.tiles)if(t.tileId.z===e&&t.tileId.x===r&&t.tileId.y===o){i=t,n=e;break}if(i)break}if(!i||0===i.frcMask)return null;const r=1<<t.z-n,o=e.a6/r,s=t.x%r*o,a=t.y%r*o,l=s+o,c=a+o;let u=0;for(const e of i.polygons)0!==e.frcMask&&(e.hasGeometry()?0===e.rings.length||t.z<=n||Xi(e.rings,s,a,l,c)&&(u|=e.frcMask):u|=e.frcMask);return 0!==u?u:null}equals(e){if(this.tiles.length!==e.length)return!1;for(let t=0;t<this.tiles.length;++t){const i=this.tiles[t],n=e[t];if(i.tileId.z!==n.tileId.z||i.tileId.x!==n.tileId.x||i.tileId.y!==n.tileId.y||i.frcMask!==n.frcMask||i.polygons.length!==n.polygons.length)return!1}return!0}empty(){return 0===this.tiles.length}}function Xi(e,t,i,n,r){const o=[0,0,0,0],s=[t,n,n,t],a=[i,i,r,r];for(const l of e){const e=l.length;if(!(e<2))for(let c=0,u=e-1;c<e;u=c++){const e=l[u].x,h=l[u].y,d=l[c].x,f=l[c].y;for(let t=0;t<4;++t)h>a[t]!=f>a[t]&&s[t]<e+(d-e)*(a[t]-h)/(f-h)&&o[t]++;let p=0,m=0;if(e<t?p|=1:e>n&&(p|=2),h<i?p|=4:h>r&&(p|=8),d<t?m|=1:d>n&&(m|=2),f<i?m|=4:f>r&&(m|=8),!(p&m)){if(0===p||0===m)return!1;if(Ji(e,h,d,f,t,i,n,r))return!1}}}for(let e=0;e<4;++e)if(!(1&o[e]))return!1;return!0}function Ji(e,t,i,n,r,o,s,a){const l=(e,t,i,n,r,o,s,a)=>{const l=(i-e)*(o-t)-(n-t)*(r-e),c=(i-e)*(a-t)-(n-t)*(s-e);if(l>0&&c>0||l<0&&c<0)return!1;const u=(s-r)*(t-o)-(a-o)*(e-r),h=(s-r)*(n-o)-(a-o)*(i-r);return!(u>0&&h>0||u<0&&h<0)};return!!(l(e,t,i,n,r,o,s,o)||l(e,t,i,n,s,o,s,a)||l(e,t,i,n,r,a,s,a)||l(e,t,i,n,r,o,r,a))}class Ki{constructor(){this._tileCoverages=[],this._snapshot=new Yi}clear(){this._tileCoverages=[]}addTileCoverage(e,t){this._tileCoverages.push({tileId:e,polygons:t,frcMask:Wi(t)})}empty(){return 0===this._tileCoverages.length}updateSnapshotIfNeeded(){if(this._snapshot.equals(this._tileCoverages))return this._snapshot;const e=this._tileCoverages.map(e=>({tileId:e.tileId,polygons:e.polygons,frcMask:e.frcMask}));return this._snapshot=new Yi(e),this._snapshot}}function Qi(e,t){const i={};if(!t)return i;for(const n of e){const e=n.layerIds.map(e=>
vendor: 4,845 bytes, line 2
2t.getLayer(e)).filter(Boolean);if(0!==e.length){n.layers=e,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map(t=>e.filter(e=>e.id===t)[0])),n.updateExpressions&&n.updateExpressions(e);for(const t of e)i[t.fqid]=n}}return i}const en=32,tn=33,nn=new Uint16Array(8184);for(let e=0;e<2046;e++){let t=e+2,i=0,n=0,r=0,o=0,s=0,a=0;for(1&t?r=o=s=en:i=n=a=en;(t>>=1)>1;){const e=i+r>>1,l=n+o>>1;1&t?(r=i,o=n,i=s,n=a):(i=r,n=o,r=s,o=a),s=e,a=l}const l=4*e;nn[l+0]=i,nn[l+1]=n,nn[l+2]=r,nn[l+3]=o}const rn=new Uint16Array(2178),on=new Uint8Array(1089),sn=new Uint16Array(1089);function an(e){return 0===e?-.03125:32===e?.03125:0}var ln=e.a$([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Uint16",components:2}]);const cn={type:2,extent:e.a6,loadGeometry:()=>[[new e.P(0,0),new e.P(e.a6+1,0),new e.P(e.a6+1,e.a6+1),new e.P(0,e.a6+1),new e.P(0,0)]]};let un,hn=0;class dn{constructor(t,i,n,r,o,s){this.tileID=t,this.uid=e.aw(),this.uses=0,this.tileSize=i,this.tileZoom=n,this.dashIdealZ=t.overscaledZ,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasTunnelGeometry=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=o,r&&r.style&&(this._lastUpdatedBrightness=r.style.getBrightness()),this._lastAvailableImagesCount=0,this._firstPrepareComplete=!1,this.expiredRequestCount=0,this.state="loading",r&&r.transform&&(this.projection=r.transform.projection),this.worldview=s,this._hasAppearances=null}registerFadeDuration(t){const i=t+this.timeAdded;i<e.e.now()||void 0!==this.fadeEndTime&&i<this.fadeEndTime||(this.fadeEndTime=i)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=e.bq(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(t,i,n){if(this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=Qi(t.buckets,i.style),t.frcCoveragePolygons&&t.frcCoveragePolygons.length>0&&(this.frcCoveragePolygons=t.frcCoveragePolygons),this.hasDeferredRoadStructure=!!t.hasDeferredRoadStructure,void 0!==t.parsedElevationFeatures&&(this.parsedElevationFeatures=t.parsedElevationFeatures,this.parsedElevationGeneration=++hn),this.hasDeferredElevationFeatures=!!t.hasDeferredElevationFeatures,this.hasSymbolBuckets=!1,this.hasTunnelGeometry=!!t.hasTunnelGeometry;for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.bv){if(this.hasSymbolBuckets=!0,!n)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.bv&&i.hasRTLText){this.hasRTLText=!0,e.bO();break}}this.queryPadding=0;for(const e in this.buckets){const t=this.buckets[e],n=i.style.getOwnLayer(e);if(!n)continue;const r=n.queryRadius(t)||0;this.queryPadding=Math.max(this.queryPadding,r)}t.imageAtlas&&(this.imageAtlas=i.style.imageManager.imageAtlasCache.getOrCache(t.imageAtlas)),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas),this._lastUpdatedBrightness=t.brightness}else this.collisionBoxArray=new e.bu}resetPlacementVisibility(){for(const e in this.buckets)this.buckets[e].resetPlacementVisibility?.()}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture=null),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"}}loadModelData(e,t,i){e&&(e.resourceTiming&&(this.resourceTiming=e.resourceTiming),this.buckets={...this.buckets,...Qi(e.buckets,t.style)}
vendor: 2,920 bytes, line 2
2,e.featureIndex&&(this.latestFeatureIndex=e.featureIndex))}getBucket(e){return this.buckets[e.fqid]}upload(t,i){for(const e in this.buckets){const n=this.buckets[e];if(n.uploadPending()){let e={},r=[],o={zoom:0,pitch:0,brightness:0,worldview:""};if(i){if(i.style){r=i.style.listImages();const t=n.layers[0],o=t.sourceLayer||"_geojsonTileLayer",s=i.style.getLayerSourceCache(t);s&&(e=s._state.getState(o,void 0))}o={zoom:i.transform.zoom||0,pitch:i.transform.pitch||0,brightness:i.style.getBrightness()||0,worldview:i.worldview||""}}n.upload(t,this.tileID.canonical,e,r,o)}}const n=t.gl,r=this.imageAtlas;r&&i&&(this.imageAtlasTexture=i.style.imageManager.imageAtlasCache.getTextureForAtlas(r,t,n.RGBA8),r.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new e.T(t,this.glyphAtlasImage,n.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new e.T(t,this.lineAtlas.image,n.R8),this.lineAtlas.uploaded=!0)}prepare(e,t,i){if(this.imageAtlas&&this.imageAtlasTexture&&t){const n=t.style.getLut(i);this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture,i,n)}if(!t||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const n=t.style.getBrightness(),r=t.style.listImages(),o=r.length,s=t.style._changes.getUpdatedPaintProperties(),a=Object.keys(this.buckets).some(e=>this.buckets[e].layers.some(e=>s.has(e.fqid))),l=Object.keys(this.buckets).some(e=>this.buckets[e].layers.some(e=>e.hasTransition&&e.hasTransition())),c=this._firstPrepareComplete&&o!==this._lastAvailableImagesCount;null===this._hasAppearances&&(this._hasAppearances=this.hasAppearances(t));const u=this._lastUpdatedBrightness!==n;this._lastAvailableImagesCount=o,this._firstPrepareComplete=!0,(this._lastUpdatedBrightness||n||this._hasAppearances||a||l||c)&&(!(this._hasAppearances||a||l||c)&&this._lastUpdatedBrightness&&n&&Math.abs(this._lastUpdatedBrightness-n)<.001||(this.updateBuckets(t,u,void 0,c||a||l,s,r),this._lastUpdatedBrightness=n))}evaluateQueryRenderedFeaturePadding(){let e=0;for(const t in this.buckets){const i=this.buckets[t];i.evaluateQueryRenderedFeaturePadding&&(e=Math.max(e,i.evaluateQueryRenderedFeaturePadding()))}return e}queryRenderedFeatures(t,i,n,r,o,s,a){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile)return{};const l=this.evaluateQueryRenderedFeaturePadding(),c=function(t,i){const n=e.bM([],[.5*t.width,.5*-t.height,1]);return e.bN(n,n,[1,-1,0]),e.X(n,n,t.calculateProjMatrix(i.toUnwrapped())),Float32Array.from(n)}(o,this.tileID);return this.latestFeatureIndex.query(t,{tilespaceGeometry:i,pixelPosMatrix:c,transform:r,availableImages:n,tileTransform:this.tileTransform,worldview:this.worldview,queryRadius:l,scope:a})}querySourceFeatures(t,i){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const r=n.loadVTLayers(),o=i?i.sourceLayer:"",s=r._geojsonTileLayer||r[o];if(!s)return;
2const a=e.bw(i&&i.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let i=0;i<s.length;i++){const r=s.feature(i);if(a.needGeometry){const t=e.bx(r,!0);if(!a.filter(new e.aj(this.tileID.overscaledZ,{worldview:this.worldview}),t,this.tileID.canonical))continue}else if(!a.filter(new e.aj(this.tileID.overscaledZ,{worldview:this.worldview}),r))continue;const d=n.getId(r,o),f=new e.by(r,l,c,u,d);f.tile=h,t.push(f)}}loaded(){return"loaded"===this.state||"errored"===this.state}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!this.imageAtlas.patternPositions.size}setExpiryData(t){const i=this.expirationTime;if(t.cacheControl){const i=e.bz(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const e=Date.now();let t=!1;if(this.expirationTime>e)t=!1;else if(i)if(this.expirationTime<i)t=!0;else{const n=this.expirationTime-i;n?this.expirationTime=e+Math.max(n,3e4):t=!0}else t=!0;t?(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-Date.now(),Math.pow(2,31)-1)}refreshFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile||!e)return;const i=e.style.listImages();this.updateBuckets(e,!1,t,void 0,void 0,i)}hasAppearances(e){for(const t in this.buckets)if(e.style.hasLayer(t)&&this.buckets[t].layers.some(e=>e.appearances&&e.appearances.length>0))return!0;return!1}updateBuckets(t,i,n,r,o,s){if(!this.latestFeatureIndex)return;if(!t.style)return;const a=s||t.style.listImages(),l=t.style.getBrightness(),c=o||new Set;for(const o in this.buckets){if(!t.style.hasLayer(o))continue;const s=this.buckets[o],u=s.layers[0],h=u.sourceLayer||"_geojsonTileLayer",d=t.style.getLayerSourceCache(u),f=s.layers.some(e=>c.has(e.fqid)),p=(r||f)&&s instanceof e.bv?t.style.getOwnLayer(o):void 0;let m=n&&n[h]||{};d&&!n&&(m=d._state.getState(h,void 0));const _=this.imageAtlas?Object.fromEntries(this.imageAtlas.patternPositions):{},g=Object.keys(m).length>0&&!i;s.hasAppearances=s.layers.some(e=>e.appearances&&e.appearances.length>0);const y=g?s.stateDependentLayers:s.layers;if(g&&0!==s.stateDependentLayers.length||i||f||r){const n=this.latestFeatureIndex.loadVTLayers()[h];if(s.update(m,n,a,_,y,i,l,this.tileID.canonical),(r||f)&&(!i||i&&s instanceof e.bv&&(!s.text.uboBinder||s.text.uboBinder.isLightConstant||!s.icon.uboBinder||s.icon.uboBinder.isLightConstant))&&s instanceof e.bv&&p&&"symbol"===p.type){const e=s;e.text&&e.text.uboBinder&&e.text.uboBinder.updateDynamicExpressions(p,n,this.tileID.canonical,a,m,l),e.icon&&e.icon.uboBinder&&e.icon.uboBinder.updateDynamicExpressions(p,n,this.tileID.canonical,a,m,l)}if(s instanceof e.bv){const e=s,i=t.context;e.text&&e.text.uboBinder&&e.text.uboBinder.upload(i),e.icon&&e.icon.uboBinder&&e.icon.uboBinder.upload(i)}}if(g&&0!==s.stateDependentLayers.length||i||s.hasAppearances){const i={zoom:t.transform.zoom,pitch:t.transform.pitch,brightness:t.style.getBrightness()||0,worldview:t.worldview},n=s.updateAppearances(this.tileID.canonical,m,a,i,t.imageManager,g&&0!==s.stateDependentLayers.length);if(n&&n.hasUboChanges){const i=t.context;s instanceof e.bv&&s.text&&s.text.uboBinder&&s.text.uboBinder.upload(i),s instanceof e.bv&&s.icon&&s.icon.uboBinder&&s.icon.uboBinder.upload(i)}}(s instanceof e.bA||s instanceof e.bB)&&t._terrain&&t._terrain.enabled&&d&&s.uploadPending()&&t._terrain._clearRenderCacheForTile(d.id,this.tileID);const v=t&&t.style&&t.style.getOwnLayer(o);v&&(this.queryPadding=Math.max(this.queryPadding,v.queryRadius(s)||0))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<e.e.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=e.e.now()+t}
vendor: 7,174 bytes, line 2
2setTexture(t,i){const n=i.context,r=n.gl;this.texture=this.texture||i.getTileTexture(t.width),this.texture&&this.texture instanceof e.T?this.texture.update(t):(this.texture=new e.T(n,t,r.RGBA8,{useMipmap:!0}),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE))}setDependencies(e,t){const i={};for(const e of t)i[e]=!0;this.dependencies[e]=i}hasDependency(e,t){for(const i of e){const e=this.dependencies[i];if(e)for(const i of t)if(e[i])return!0}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(t,i){if(!i||"mercator"===i.name||this._tileDebugBuffer)return;const n=e.bC(cn,this.tileID.canonical,this.tileTransform)[0],r=new e.bD,o=new e.bE;for(let e=0;e<n.length;e++){const{x:t,y:i}=n[e];r.emplaceBack(t,i),o.emplaceBack(e)}o.emplaceBack(0),this._tileDebugIndexBuffer=t.createIndexBuffer(o),this._tileDebugBuffer=t.createVertexBuffer(r,e.bF.members),this._tileDebugSegments=e.ad.simpleSegment(0,0,r.length,o.length)}_makeTileBoundsBuffers(t,i){if(this._tileBoundsBuffer||!i||"mercator"===i.name)return;const n=e.bC(cn,this.tileID.canonical,this.tileTransform)[0];let r,o;if(this.isRaster){const t=function(t,i){const n=e.bq(t,i),r=Math.pow(2,t.z);for(let o=0;o<tn;o++)for(let s=0;s<tn;s++){const a=e.br((t.x+(s+an(s))/en)/r),l=e.bs((t.y+(o+an(o))/en)/r),c=i.project(a,l),u=o*tn+s;rn[2*u+0]=Math.round((c.x*n.scale-n.x)*e.a6),rn[2*u+1]=Math.round((c.y*n.scale-n.y)*e.a6)}on.fill(0),sn.fill(0);for(let e=2045;e>=0;e--){const t=4*e,i=nn[t+0],n=nn[t+1],r=nn[t+2],o=nn[t+3],s=i+r>>1,a=n+o>>1,l=s+a-n,c=a+i-s,u=n*tn+i,h=o*tn+r,d=a*tn+s,f=Math.hypot((rn[2*u+0]+rn[2*h+0])/2-rn[2*d+0],(rn[2*u+1]+rn[2*h+1])/2-rn[2*d+1])>=16;on[d]=on[d]||(f?1:0),e<1022&&(on[d]=on[d]||on[(n+c>>1)*tn+(i+l>>1)]||on[(o+c>>1)*tn+(r+l>>1)])}const o=new e.bt,s=new e.ae;let a=0;function l(t,i){const n=i*tn+t;return 0===sn[n]&&(o.emplaceBack(rn[2*n+0],rn[2*n+1],t*e.a6/en,i*e.a6/en),sn[n]=++a),sn[n]-1}function c(e,t,i,n,r,o){const a=e+i>>1,u=t+n>>1;if(Math.abs(e-r)+Math.abs(t-o)>1&&on[u*tn+a])c(r,o,e,t,a,u),c(i,n,r,o,a,u);else{const a=l(e,t),c=l(i,n),u=l(r,o);s.emplaceBack(a,c,u)}}return c(0,0,en,en,en,0),c(en,en,0,0,0,en),{vertices:o,indices:s}}(this.tileID.canonical,i);r=t.vertices,o=t.indices}else{r=new e.bt,o=new e.ae;for(const{x:e,y:t}of n)r.emplaceBack(e,t,0,0);const t=e.bG(r.int16.subarray(0,4*r.length),void 0,4);for(let e=0;e<t.length;e+=3)o.emplaceBack(t[e],t[e+1],t[e+2])}this._tileBoundsBuffer=t.createVertexBuffer(r,ln.members),this._tileBoundsIndexBuffer=t.createIndexBuffer(o),this._tileBoundsSegments=e.ad.simpleSegment(0,0,r.length,o.length)}_makeGlobeTileDebugBuffers(t,i){const n=i.projection;if(!n||"globe"!==n.name||i.freezeTileCoverage)return;const r=this.tileID.canonical,o=e.V(r,i),s=e.b5(o),a=e.S(i.zoom);let l;a>0&&(l=e.aP(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,r,i,s,l,a),this._makeGlobeTileDebugTextBuffer(t,r,i,s,l,a)}_globePoint(t,i,n,r,o,s,a){let l=e.bH(t,i,n);if(s){const o=1<<n.z,c=e.a7(r.center.lng),u=e.a8(r.center.lat),h=(n.x+.5)/o-c;let d=0;h>.5?d=-1:h<-.5&&(d=1);let f=(t/e.a6+n.x)/o+d,p=(i/e.a6+n.y)/o;f=(f-c)*r._pixelsPerMercatorPixel+c,p=(p-u)*r._pixelsPerMercatorPixel+u;const m=[f*r.worldSize,p*r.worldSize,0];e.bI(m,m,s),l=e.bJ(l,m,a)}return e.bI(l,l,o)}_makeGlobeTileDebugBorderBuffer(t,i,n,r,o,s){const a=new e.bD,l=new e.bE,c=new e.bK,u=(e,t,u,h,d)=>{const f=(u-e)/(d-1),p=(h-t)/(d-1),m=a.length;for(let u=0;u<d;u++){const h=e+u*f,d=t+u*p;a.emplaceBack(h,d);const _=this._globePoint(h,d,i,n,r,o,s);c.emplaceBack(_[0],_[1],_[2]),l.emplaceBack(m+u)}},h=e.a6;u(0,0,h,0,16),u(h,0,h,h,16),u(h,h,0,h,16),u(0,h,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(l),this._tileDebugBuffer=t.createVertexBuffer(a,e.bF.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(c,e.bL.members),this._tileDebugSegments=e.ad.simpleSegment(0,0,a.length,l.length)}_makeGlobeTileDebugTextBuffer(t,i,n,r,o,s){const a=e.a6/4,l=new e.bD,c=new e.ae,u=new e.bK,h=25;c.reserve(32),l.reserve(h),u.reserve(h);const d=(e,t)=>h*e+t;for(let e=0;e<h;e++){const t=e*a;for(let e=0;e<h;e++){const c=e*a;l.emplaceBack(c,t);const h=this._globePoint(c,t,i,n,r,o,s);u.emplaceBack(h[0],h[1],h[2])}}for(let e=0;e<4;e++)for(let t=0;t<4;t++){const i=d(e,t),n=d(e,t+1),r=d(e+1,t),o=d(e+1,t+1);c.emplaceBack(i,n,r),c.emplaceBack(r,n,o)}this._tileDebugTextIndexBuffer=t.createIndexBuffer(c),this._tileDebugTextBuffer=t.createVertexBuffer(l,e.bF.members),this._globeTileDebugTextBuffer=t.createVertexBuffer(u,e.bL.members),this._tileDebugTextSegments=e.ad.simpleSegment(0,0,h,32)}destroy(t=!0){for(const e in this.buckets)this.buckets[e].destroy(t);this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&delete this.imageAtlasTexture,this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),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),t&&this.texture&&this.texture instanceof e.T&&(this.texture.destroy(),delete this.texture),this.emissiveTexture&&this.emissiveTexture instanceof e.T&&(this.emissiveTexture.destroy(),delete this.emissiveTexture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.rasterParticleState&&(this.rasterParticleState.destroy(),delete this.rasterParticleState),this.latestFeatureIndex=null,this.state="unloaded"}}class fn{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,i){const n=e.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);const r={value:t,timeout:void 0};if(void 0!==i&&(r.timeout=setTimeout(()=>{this.remove(e,r)},i)),this.data[n].push(r),this.order.push(n),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}
vendor: 18,916 bytes, line 2
2get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const i=e.wrapped().key,n=void 0===t?0:this.data[i].indexOf(t),r=this.data[i][n];return this.data[i].splice(n,1),r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(r.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const i in this.data)for(const n of this.data[i])e(n.value)||t.push(n);for(const e of t)this.remove(e.value.tileID,e)}}class pn{constructor(){this.state=Object.create(null),this.stateChanges=Object.create(null),this.deletedStates=Object.create(null)}updateState(e,t,i){const n=String(t);if(this.stateChanges[e]=this.stateChanges[e]||Object.create(null),this.stateChanges[e][n]=this.stateChanges[e][n]||Object.create(null),Object.assign(this.stateChanges[e][n],i),null===this.deletedStates[e]){this.deletedStates[e]=Object.create(null);for(const t in this.state[e])t!==n&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][n]){this.deletedStates[e][n]=Object.create(null);for(const t in this.state[e][n])i[t]||(this.deletedStates[e][n][t]=null)}else for(const t in i)this.deletedStates[e]&&this.deletedStates[e][n]&&null===this.deletedStates[e][n][t]&&delete this.deletedStates[e][n][t]}removeFeatureState(e,t,i){if(null===this.deletedStates[e])return;const n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||Object.create(null),i&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||Object.create(null),this.deletedStates[e][n][i]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(i in this.deletedStates[e][n]=Object.create(null),this.stateChanges[e][n])this.deletedStates[e][n][i]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}getState(e,t){const i=this.state[e]||Object.create(null),n=this.stateChanges[e]||Object.create(null),r=this.deletedStates[e];if(null===r)return Object.create(null);if(void 0!==t){const e=String(t),o=Object.assign(Object.create(null),i[e],n[e]);if(r){const e=r[t];if(null===e)return Object.create(null);for(const t in e)delete o[t]}return o}const o=Object.assign(Object.create(null),i,n);if(r)for(const e in r)delete o[e];return o}initializeTileState(e,t){e.refreshFeatureState(t)}coalesceChanges(e,t){const i=Object.create(null);for(const e in this.stateChanges){this.state[e]=this.state[e]||Object.create(null);const t=Object.create(null);for(const i in this.stateChanges[e])this.state[e][i]||(this.state[e][i]=Object.create(null)),Object.assign(this.state[e][i],this.stateChanges[e][i]),t[i]=this.state[e][i];i[e]=t}for(const e in this.deletedStates){this.state[e]=this.state[e]||Object.create(null);const t=Object.create(null);if(null===this.deletedStates[e])for(const i in this.state[e])t[i]=Object.create(null),this.state[e][i]=Object.create(null);else for(const i in this.deletedStates[e]){if(null===this.deletedStates[e][i])this.state[e][i]=Object.create(null);else if(this.state[e][i])for(const t of Object.keys(this.deletedStates[e][i]))delete this.state[e][i][t];t[i]=this.state[e][i]}i[e]=i[e]||Object.create(null),Object.assign(i[e],t)}if(this.stateChanges=Object.create(null),this.deletedStates=Object.create(null),0!==Object.keys(i).length)for(const n in e)e[n].refreshFeatureState(t,i)}}class mn extends e.E{constructor(e,t,i){super(),this.id=e,this._renderSourceType=i,this._maxzoomOverride=null,this.setSource(t),this._tiles={},this._cache=new fn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new pn,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===this._source.type||"custom"===this._source.type&&"_dataType"in this._source&&"raster"===this._source._dataType,this._supportsFading="raster"===this._source.type||"raster-array"===this._source.type||"image"===this._source.type||"video"===this._source.type||"custom"===this._source.type,this._isRasterElevatedOverTerrain=!1}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}setSource(e){e.on("data",e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),e.on("error",()=>{this._sourceErrored=!0}),this._source=e}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const e in this._tiles)if(!this._tiles[e].loaded())return!1;return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}setMaxzoomOverride(e){this._maxzoomOverride=e}_loadTile(e,t){return e.renderSourceType=this._renderSourceType,e.isExtraShadowCaster=this._shadowCasterTiles[e.tileID.key],this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e)}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e)}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const i=this._tiles[t];i.upload(e,this.map?this.map.painter:void 0),i.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(_n).map(e=>e.key)}getRenderableIds(t,i){const n=[];for(const e in this._tiles)this._isIdRenderable(+e,t,i)&&n.push(this._tiles[e]);return t?n.sort((t,i)=>{const n=t.tileID,r=i.tileID,o=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),s=new e.P(r.canonical.x,r.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-r.overscaledZ||s.y-o.y||s.x-o.x}).map(e=>e.tileID.key):n.map(e=>e.tileID).sort(_n).map(e=>e.key)}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())&&(i||!this._shadowCasterTiles[e])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,t){const i=this._tiles[e];i&&("loading"!==i.state&&(i.state=t),this._loadTile(i,this._tileLoaded.bind(this,i,e,t)))}_tileLoaded(t,i,n,r,o){if(r){if(t.state="errored",e.bP(r)){if(this._source.fire(new e.h("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:t})),!(t.tileID.key in this._loadedParentTiles))return;if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const e=this.map.painter.terrain;this.update(this.transform,e.getScaledDemTileSize(),!0),e.resetTileLookupCache(this.id)}else this.update(this.transform)}else this._source.fire(new e.f(r,{tile:t}));return}t.timeAdded=e.e.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),"raster-dem"===this._source.type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null);let s=new Headers;o&&o.headers&&(s=o.headers),this._source.fire(new e.h("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id,responseHeaders:s}))}_hasTunnelGeometry(){for(const e in this._tiles){const t=this._tiles[e];if(t&&t.hasTunnelGeometry)return!0}return!1}_backfillDEM(e){const t=this.getRenderableIds();for(let n=0;n<t.length;n++){const r=t[n];if(e.neighboringTiles&&e.neighboringTiles[r]){const t=this.getTileByID(r);i(e,t),i(t,e)}}function i(e,t){if(!e.dem||e.dem.borderReady)return;e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0;let i=t.tileID.canonical.x-e.tileID.canonical.x;const n=t.tileID.canonical.y-e.tileID.canonical.y,r=Math.pow(2,e.tileID.canonical.z),o=t.tileID.key;0===i&&0===n||Math.abs(n)>1||(Math.abs(i)>1&&(1===Math.abs(i+r)?i+=r:1===Math.abs(i-r)&&(i-=r)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,i,n),e.neighboringTiles&&e.neighboringTiles[o]&&(e.neighboringTiles[o].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,i,n){const r="raster-array"===this._source.type;for(const o in this._tiles){let s=this._tiles[o];if(n[o]||!s.hasData()||s.tileID.overscaledZ<=t||s.tileID.overscaledZ>i)continue;if(r&&s.parentTile)continue;let a=s.tileID;for(;s&&s.tileID.overscaledZ>t+1;){const e=s.tileID.scaledTo(s.tileID.overscaledZ-1);s=this._tiles[e.key],s&&s.hasData()&&(a=e)}let l=a;for(;l.overscaledZ>t;)if(l=l.scaledTo(l.overscaledZ-1),e[l.key]){n[a.key]=a;const e=this._tiles[a.key];e&&(e.dashIdealZ=l.overscaledZ);break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const i=this._loadedParentTiles[e.key];return i&&i.tileID.overscaledZ>=t?i:null}for(let i=e.overscaledZ-1;i>=t;i--){const t=e.scaledTo(i),n=this._getLoadedTile(t);if(n)return n}}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,t){t=t||this._source.tileSize;const i=Math.ceil(e.width/t)+1,n=Math.ceil(e.height/t)+1,r=Math.floor(i*n*5),o="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,r):r,s="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(s)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const i in this._tiles){const n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),e[n.tileID.key]=n}this._tiles=e;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(+e,this._tiles[e])}}update(t,i,n,r,o){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!n)return;this.updateCacheSize(t,i),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const s="batched-model"===this._source.type;let a,l=this._source.maxzoom;null!==this._maxzoomOverride&&(l=Math.min(l,this._maxzoomOverride));const c=this.map&&this.map.painter?this.map.painter._terrain:null;if(c&&c.sourceCache===this&&c.attenuationRange()){const e=c.attenuationRange()[0],t=Math.floor(e)-Math.log2(c.getDemUpscale());l>t&&(l=t)}const u=null===this._maxzoomOverride&&this._source.reparseOverscaled;if(this.used||this.usedForTerrain){if(this._source.tileID)a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(t=>new e.bQ(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y));else if(0!==this.tileCoverLift){const r=t.clone();r.tileCoverLift=this.tileCoverLift,a=r.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:l,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:u,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:s}),this._source.minzoom<=1&&"globe"===t.projection.name&&(a.push(new e.bQ(1,0,1,0,0)),a.push(new e.bQ(1,0,1,1,0)),a.push(new e.bQ(1,0,1,0,1)),a.push(new e.bQ(1,0,1,1,1)))}else if(a=t.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:l,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:u,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:s}),this._source.hasTile){const e=this._source.hasTile.bind(this._source);a=a.filter(t=>e(t))}}else a=[];if(a.length>0&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!this._supportsFading){const e=t.coveringZoomLevel({tileSize:i||this._source.tileSize,roundZoom:this._source.roundZoom&&!n}),c=Math.min(e,l);if(s){const e=t.extendTileCover(a,c);for(const t of e)a.push(t)}else if(o){const e=this.transform.getFrustum(c),i=t.extendTileCoverToNearPlane(a,e,c);for(const e of i)a.push(e);if(c>=18&&this._hasTunnelGeometry()){const i=t.extendTileCoverForTunnels(a,e,c,20);for(const e of i)a.push(e)}}else if(this.castsShadows&&r){const e=t.extendTileCover(a,c,r,16);for(const t of e)this._shadowCasterTiles[t.key]=!0,a.push(t)}}for(const e in this._tiles){const t=this._tiles[e];t.dashIdealZ=t.tileID.overscaledZ}const h=this._updateRetainedTiles(a);if(this._supportsFading&&0!==a.length){const t={},i={},n=e.e.now(),r=Object.keys(h);for(const e of r){const r=h[e],o=this._tiles[e];if(!o||void 0!==o.fadeEndTime&&o.fadeEndTime<=n)continue;const s=this.findLoadedParent(r,Math.max(r.overscaledZ-mn.maxOverzooming,this._source.minzoom));s&&(this._addTile(s.tileID),t[s.tileID.key]=s.tileID),i[e]=r}const o=a.at(-1).overscaledZ;for(const e in this._tiles){const t=this._tiles[e];if(h[e]||!t.hasData())continue;let n=t.tileID;for(;n.overscaledZ>o;){n=n.scaledTo(n.overscaledZ-1);const r=this._tiles[n.key];if(r&&r.hasData()&&i[n.key]){h[e]=t.tileID;break}}}for(const e in t)h[e]||(this._coveredTiles[e]=!0,h[e]=t[e])}for(const e in h)this._tiles[e].clearFadeHold();const d=e.bR(this._tiles,h);for(const e of d){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(+e)}this._updateLoadedParentTileCache(),this._renderSourceType===e.bS.Symbol&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const t={};if(0===e.length)return t;const i={},n=e.reduce((e,t)=>Math.min(e,t.overscaledZ),1/0),r=e[0].overscaledZ,o=Math.max(r-mn.maxOverzooming,this._source.minzoom),s=Math.max(r+mn.maxUnderzooming,this._source.minzoom),a={};for(const i of e){const e=this._addTile(i);t[i.key]=i,e.hasData()||n<this._source.maxzoom&&(a[i.key]=i)}if(this._retainLoadedChildren(a,n,s,t),"raster-array"===this._source.type){const i=this._source,n=this._tiles;for(const r of i.collectOverzoomParentTileIDs(n,e))t[r.key]=r}for(const n of e){let e=this._tiles[n.key];if(e.hasData())continue;if(n.canonical.z>=this._source.maxzoom){const e=n.children(this._source.maxzoom)[0],i=this.getTile(e);if(i&&i.hasData()){t[e.key]=e,i.dashIdealZ=n.overscaledZ;continue}}else{const e=n.children(this._source.maxzoom);if(t[e[0].key]&&t[e[1].key]&&t[e[2].key]&&t[e[3].key])continue}let r=e.wasRequested();for(let s=n.overscaledZ-1;s>=o;--s){const o=n.scaledTo(s);if(i[o.key])break;if(i[o.key]=!0,e=this.getTile(o),!e&&r&&(e=this._addTile(o)),e&&(t[o.key]=o,e.dashIdealZ=n.overscaledZ,r=e.wasRequested(),e.hasData()))break}}return t}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let i,n=this._tiles[e].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){i=this._loadedParentTiles[n.key];break}t.push(n.key);const e=n.scaledTo(n.overscaledZ-1);if(i=this._getLoadedTile(e),i)break;n=e}for(const e of t)this._loadedParentTiles[e]=i}}_addTile(t){let i=this._tiles[t.key];if(i)return!0!==i.isExtraShadowCaster||!!this._shadowCasterTiles[t.key]||this._reloadTile(t.key,"reloading"),i;i=this._cache.getAndRemove(t),i&&(this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,i)),i.resetPlacementVisibility());const n=Boolean(i);if(!n){const e=this.map?this.map.painter:null,n=this._source.tileSize*t.overscaleFactor();i="raster-array"===this._source.type?function(e,t,i,n,r){if(!un)throw new Error("Raster-array module is not loaded.");return un(e,t,i,n,r)}(t,n,this.transform.tileZoom,e,this._isRaster):new dn(t,n,this.transform.tileZoom,e,this._isRaster,this._source.worldview),this._loadTile(i,this._tileLoaded.bind(this,i,t.key,i.state))}return i.uses++,this._tiles[t.key]=i,n||this._source.fire(new e.h("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const i=t.getExpiryTimeout();i&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},i))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state||"empty"===t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(t,i,n){const r=[],o=this.transform;if(!o)return r;const s="globe"===o.projection.name,a=e.a7(o.center.lng),l=o.getFreeCameraOptions().position||new e.bT(0,0,0);for(const c in this._tiles){const u=this._tiles[c];if(n&&u.clearQueryDebugViz(),u.holdingForFade())continue;let h;if(s){const t=u.tileID.canonical;if(0===t.z){const i=[Math.abs(e.b1(a,...gn(t,-1))-a),Math.abs(e.b1(a,...gn(t,1))-a)];h=[0,2*i.indexOf(Math.min(...i))-1]}else{const i=[Math.abs(e.b1(a,...gn(t,-1))-a),Math.abs(e.b1(a,...gn(t,0))-a),Math.abs(e.b1(a,...gn(t,1))-a)];h=[i.indexOf(Math.min(...i))-1]}}else h=[0];for(const e of h){const n=t.containsTile(u,o,i,e,l);n&&r.push(n)}}return r}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(e){return this._getRenderableCoordinates(e)}_getRenderableCoordinates(e,t){if(!this.transform)return[];const i=this.getRenderableIds(e,t).map(e=>this._tiles[e].tileID),n="globe"===this.transform.projection.name;for(const e of i)e.projMatrix=this.transform.calculateProjMatrix(e.toUnwrapped()),e.expandedProjMatrix=n?this.transform.calculateProjMatrix(e.toUnwrapped(),!1,!0):e.projMatrix;return i}sortCoordinatesByDistance(e){if(!this.transform)return e.slice();const t=e.slice(),i=this.transform._camera.position,n=this.transform._camera.forward(),r={};for(const e of t){const t=1/(1<<e.canonical.z);r[e.key]=((e.canonical.x+.5)*t+e.wrap-i[0])*n[0]+((e.canonical.y+.5)*t-i[1])*n[1]-i[2]*n[2]}return t.sort((e,t)=>
vendor: 10,829 bytes, line 2
2r[e.key]-r[t.key]),t}hasTransition(){if(this._source.hasTransition())return!0;if(this._supportsFading){const t=e.e.now();for(const e in this._tiles){const i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=t)return!0}}return!1}setFeatureState(e,t,i){this._state.updateState(e=e||"_geojsonTileLayer",t,i)}removeFeatureState(e,t,i){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,i)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,i){const n=this._tiles[e];n&&n.setDependencies(t,i)}reloadTilesForDependencies(e,t){for(const i in this._tiles)this._tiles[i].hasDependency(e,t)&&this._reloadTile(+i,"reloading");this._cache.filter(i=>!i.hasDependency(e,t))}_preloadTiles(t,i){if(!this._sourceLoaded){const e=()=>{this._sourceLoaded&&(this._source.off("data",e),this._preloadTiles(t,i))};return void this._source.on("data",e)}const n=new Map,r=Array.isArray(t)?t:[t],o=this.map.painter.terrain,s=this.usedForTerrain&&o?o.getScaledDemTileSize():this._source.tileSize;for(const e of r){const t=e.coveringTiles({tileSize:s,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const e of t)n.set(e.key,e);this.usedForTerrain&&e.updateElevation(!1)}const a=Array.from(n.values());e.bU(a,(e,t)=>{const i=new dn(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster,this._source.worldview);this._loadTile(i,e=>{"raster-dem"===this._source.type&&i.dem&&this._backfillDEM(i),t(e,i)})},i)}}function _n(e,t){const i=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-i||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function gn(e,t){const i=1<<e.z;return[e.x/i+t,(e.x+1)/i+t]}function yn(e,t){if(e.z<=t.z){const i=t.z-e.z;return t.x>>i===e.x&&t.y>>i===e.y}const i=e.z-t.z;return e.x>>i===t.x&&e.y>>i===t.y}function vn(e,t){return e.sourceFQID!==t.sourceFQID?e.sourceFQID<t.sourceFQID?-1:1:e.tileId.z!==t.tileId.z?e.tileId.z-t.tileId.z:e.tileId.x!==t.tileId.x?e.tileId.x-t.tileId.x:e.tileId.y-t.tileId.y}mn.maxOverzooming=10,mn.maxUnderzooming=3;class xn{constructor(e=[]){this.tiles=e}getTilesIntersecting(e){const t=[];for(const i of this.tiles)yn(i.tileId,e)&&t.push(i);return t}equals(e){if(this.tiles.length!==e.length)return!1;for(let t=0;t<this.tiles.length;++t){const i=this.tiles[t],n=e[t];if(i.sourceFQID!==n.sourceFQID||i.tileId.z!==n.tileId.z||i.tileId.x!==n.tileId.x||i.tileId.y!==n.tileId.y||i.generation!==n.generation)return!1}return!0}empty(){return 0===this.tiles.length}}class bn{constructor(){this._tiles=[],this._snapshot=new xn,this._snapshotChanged=!1}clear(){this._tiles.length=0}consumeSnapshotChanged(){const e=this._snapshotChanged;return this._snapshotChanged=!1,e}addTileElevation(e,t,i,n){this._tiles.push({sourceFQID:e,tileId:t,features:i,generation:n})}updateSnapshotIfNeeded(){return this._tiles.sort(vn),this._snapshot.equals(this._tiles)||(this._snapshot=new xn(this._tiles.slice()),this._snapshotChanged=!0),this._snapshot}}function wn(e,t){const i=[];for(const n of e.getTilesIntersecting(t))i.push(`${n.tileId.z}/${n.tileId.x}/${n.tileId.y}:${n.generation}`);return i.sort(),i.join("|")}function Tn(e,t){return e._mergedOtherSourceCaches[t]||e._mergedSymbolSourceCaches[t]}function En(e){return!("none"===e.visibility||!e.sourceLayer||"fill"!==e.type||!e.layout||"hd-road-base"!==e.layout.get("fill-elevation-reference"))}function Sn(e){return!!e.layout&&("line"===e.type&&"hd-road-markup"===e.layout.get("line-elevation-reference")||"circle"===e.type&&"hd-road-markup"===e.layout.get("circle-elevation-reference")||"symbol"===e.type&&"hd-road-markup"===e.layout.get("symbol-elevation-reference")||"fill"===e.type&&"hd-road-markup"===e.layout.get("fill-elevation-reference"))}function In(t){const i=new Set;for(const n in t._mergedLayers){const r=t._mergedLayers[n];Sn(r)&&i.add(e.m(r.source,r.scope))}return i}function An(e){const t=In(e);if(0===t.size)return!1;const i=Mn(e);for(const e of t)for(const t of i)if(e!==t)return!0;return!1}function Mn(t){const i=new Set;for(const n in t._mergedLayers){const r=t._mergedLayers[n];r.source&&En(r)&&i.add(e.m(r.source,r.scope))}return i}function Cn(t,i,n){const r=new Set;for(const i in t._mergedLayers){const n=t._mergedLayers[i];"none"!==n.visibility&&Sn(n)&&r.add(e.m(n.source,n.scope))}if(0===r.size)return;if(!n){const e=Mn(t);for(const t of e)r.delete(t)}if(0===r.size)return;const o=[t._mergedOtherSourceCaches,t._mergedSymbolSourceCaches];for(const e of o)for(const t in e){if(!r.has(t))continue;const n=e[t];for(const e in n._tiles){const t=n._tiles[e];t&&(i&&!i(t)||(t.hasDeferredElevationFeatures=!1,n._reloadTile(+e,"reloading")))}}}class Dn{constructor(){this.manager=new bn,this._needsCrossSourceElevation=!1,this._ingestFQIDs=new Set,this._terrainActiveLast=void 0}}function Pn(e){e.map&&e.map.painter&&(e.map.painter.elevationCoverageSnapshot=null,e.map.painter.elevationProvidersReady=void 0)}function Rn(e){if(e._crossSourceElevationActive=!1,function(e){const t=e._hdElevation,i=!!(e.map&&e.map.painter&&e.map.painter.elevationCoverageSnapshot);return t?!t._needsCrossSourceElevation&&0===t._ingestFQIDs.size&&0===t.manager._tiles.length&&!i:!i}(e))return;const t=!!e._hdElevation&&e._hdElevation._needsCrossSourceElevation;Pn(e),e._hdElevation&&(e._hdElevation._needsCrossSourceElevation=!1,e._hdElevation._ingestFQIDs.clear(),e._hdElevation.manager.clear(),e._hdElevation._terrainActiveLast=void 0,t&&Cn(e,void 0,!0))}function Ln(t,i){if(Vt(t,t.map&&t.map.transform))return i.manager.clear(),void(t.map.painter&&(t.map.painter.elevationCoverageSnapshot=null));if(!i._needsCrossSourceElevation)return void Pn(t);i.manager.clear();let n=!0;for(const e of i._ingestFQIDs){const r=Tn(t,e);if(!r)continue;const o=r._tiles;for(const t in o){const r=o[t];if(!r||!r.loaded())continue;const s=r.parsedElevationFeatures;void 0!==s?i.manager.addTileElevation(e,r.tileID.canonical,s,r.parsedElevationGeneration):n=!1}}const r=i.manager._snapshot,o=i.manager.updateSnapshotIfNeeded();t.map.painter&&(t.map.painter.elevationCoverageSnapshot=o.empty()?null:o);const s=n&&function(e,t){for(const i of t){const t=Tn(e,i);if(!t)return!1;if(!t._sourceLoaded)return!1;for(const e in t._tiles){const i=t._tiles[e];if(i&&("loading"===i.state||"reloading"===i.state))return!1}}return!0}(t,function(t){const i=In(t),n=new Set;for(const r in t._mergedLayers){const o=t._mergedLayers[r];if(!o.source||!En(o))continue;const s=e.m(o.source,o.scope);i.has(s)||n.add(s)}return n}(t));t.map.painter&&(t.map.painter.elevationProvidersReady=s);const a=i.manager.consumeSnapshotChanged();(a||s)&&Cn(t,e=>{return!!e.hasDeferredElevationFeatures||a&&(t=o,wn(r,i=e.tileID.canonical)!==wn(t,i));var t,i})}const zn=e=>({u_matrix:e});function Fn(t,i){const n=t.context.gl;return new e._({func:n.EQUAL,mask:255},t._tileClippingMaskIDs[i.key]||0,0,n.KEEP,n.KEEP,n.KEEP)}function On(t,i){const n=t.context.gl;return new e._({func:n.EQUAL,mask:255},255&~(t._tileClippingMaskIDs[i.key]||0),0,n.KEEP,n.KEEP,n.KEEP)}function kn(t,i){if(!t.frcCoverageSnapshot||!t.frcCoverageRenderer)return null;const n=t.frcCoverageSnapshot.getTileOrParent(i.canonical);if(!n||0===n.frcMask)return null;const r=t.frcCoverageRenderer.getBuffers(n.tileId);if(!r)return null;const o=new e.bW(n.tileId.z,n.tileId.x,n.tileId.y),s=new e.bX(i.wrap,o);return{buffers:r,projMatrix:t.transform.calculateProjMatrix(s),coverageTile:n}}function Bn(t,i,n){if(!t.frcCoverageSnapshot)return;const r=t.context,o=r.gl,s=t.getOrCreateProgram("clippingMask");r.setColorMode(e.a1.disabled),r.setDepthMode(e.Z.disabled);for(const r of i){const i=kn(t,r);if(!i)continue;const a=i.buffers.frcLevelSegments[n];a&&s.draw(t,o.TRIANGLES,e.Z.disabled,new e._({func:o.EQUAL,mask:255},t._tileClippingMaskIDs[r.key]||0,255,o.KEEP,o.KEEP,o.INVERT),e.a1.disabled,e.$.disabled,zn(i.projMatrix),`$frc_coverage_${n}`,i.buffers.vertexBuffer,i.buffers.indexBuffer,a)}}function Nn(t,i,n){if(!t.frcCoverageSnapshot)return;const r=t.context,o=r.gl,s=t.getOrCreateProgram("clippingMask");r.setColorMode(e.a1.disabled),r.setDepthMode(e.Z.disabled);for(const r of i){const i=kn(t,r);if(!i)continue;const a=i.buffers.frcLevelSegments[n];a&&s.draw(t,o.TRIANGLES,e.Z.disabled,new e._({func:o.EQUAL,mask:255},255&~(t._tileClippingMaskIDs[r.key]||0),255,o.KEEP,o.KEEP,o.INVERT),e.a1.disabled,e.$.disabled,zn(i.projMatrix),`$frc_coverage_restore_${n}`,i.buffers.vertexBuffer,i.buffers.indexBuffer,a)}}function Vn(e,t,i,n,r){if(0===t.length)return;let o=0;for(const e of t)o|=e.frcMask;const s=t.map(e=>e.coord);for(let a=0;a<9;++a)if(o&1<<a){if(Bn(e,s,a),n)for(const i of t)i.frcMask&1<<a&&n(i,a,Fn(e,i.coord));if(i>0&&r)for(const i of t)i.frcMask&1<<a&&r(i,a,On(e,i.coord));Nn(e,s,a)}}function Un(e){for(const t of e)if(t.rings.length>0&&t.rings[0].length>0)return!0;return!1}function jn(e){const t=e.frcCoverageFadeRange;return!t||t[1]<=t[0]?0:1-Math.max(0,Math.min(1,(e.transform.zoom-t[0])/(t[1]-t[0])))}const Gn={loaded:!0,drawBuilding:function(t,i,n,r){t.currentLayer<t.firstLightBeamLayer&&(t.firstLightBeamLayer=t.currentLayer);const o=n.paint.get("building-ambient-occlusion-ground-intensity"),s=n.paint.get("building-ambient-occlusion-ground-radius"),a=n.paint.get("building-ambient-occlusion-ground-attenuation"),l=n.paint.get("building-opacity");if(l<=0)return;let c=o>0&&s>0,u=!0;const h=n.paint.get("building-vertical-scale");if(h<=0)return;t.shadowRenderer||(u=!1);const d=t.conflationActive&&t.style.isLayerClipped(n,i.getSource()),f=t.style.order.indexOf(n.fqid);if(function(e,t,i,n,r,o){for(const s of o){const o=t.getTile(s).getBucket(i);o&&(r&&o.updateReplacement(s,e.replacementSource,n),o.uploadUpdatedIndexBuffer(e.context))}}(t,i,n,f,d,r),function(e,t,i,n){for(const r of n){const n=t.getTile(r).getBucket(i);n&&n.needsEvaluation()&&n.uploadUpdatedColorBuffer(e.context)}}(t,i,n,r),n.resetLayerRenderingStats(t),t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!0),"shadow"===t.renderPass&&t.shadowRenderer){const o=[],s=t.shadowRenderer.getShadowPassDepthMode();yi({painter:t,source:i,layer:n,coords:r,defines:o,blendMode:e.a1.disabled,depthMode:s,opacity:l,verticalScale:h,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}else if("translucent"===t.renderPass){let f=["HAS_ATTRIBUTE_a_part_color_emissive","LIGHTING_3D_MODE"];u&&(f=f.concat("RENDER_SHADOWS")),t.shadowRenderer&&t.shadowRenderer.useNormalOffset&&(f=f.concat("NORMAL_OFFSET"));const p=n.paint.get("building-facade-emissive-chance"),m=n.paint.get("building-ambient-occlusion-intensity"),_=n.paint.get("building-flood-light-intensity"),g="none"===n.paint.get("building-flood-light-color-use-theme").
vendor: 6,625 bytes, line 2
2constantOr("default"),y=n.paint.get("building-flood-light-color").toNonPremultipliedRenderColor(g?null:n.lut).toArray01().slice(0,3),v=n.paint.get("building-flood-light-ground-attenuation"),x=_>0,b=new e.Z(t.context.gl.LEQUAL,e.Z.ReadWrite,t.depthRangeFor3D);l<1&&yi({painter:t,source:i,layer:n,coords:r,defines:f,blendMode:e.a1.disabled,depthMode:b,opacity:l,verticalScale:h,facadeEmissiveChance:p,facadeAOIntensity:m,floodLightIntensity:_,floodLightColor:y,depthOnly:!0});const w=t.colorModeForRenderPass();yi({painter:t,source:i,layer:n,coords:r,defines:f,blendMode:w,depthMode:b,opacity:l,verticalScale:h,facadeEmissiveChance:p,facadeAOIntensity:m,floodLightIntensity:_,floodLightColor:y});const T=n.paint.get("building-front-cutoff");ui(t.transform.pitch,T,!!t.terrain),c&&vi(t,i,n,r,!0,l,o,s,_,y,a,d),x&&vi(t,i,n,r,!1,l,o,s,_,y,v,d)}else if("light-beam"===t.renderPass){const o=["HAS_ATTRIBUTE_a_part_color_emissive","HAS_ATTRIBUTE_a_bloom_attenuation"],s=new e.Z(t.context.gl.LEQUAL,e.Z.ReadOnly,t.depthRangeFor3D);yi({painter:t,source:i,layer:n,coords:r,defines:o,blendMode:e.a1.alphaBlended,depthMode:s,opacity:l,verticalScale:h,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!1),t.resetStencilClippingMasks()},BuildingTileBorderManager:class{constructor(){this.visibleTiles=[]}updateBorders(t,i){const n=[],r=[],o=t._getRenderableCoordinates(!1,!0);for(const e of o){const o=t.getTile(e);if(!o.hasData())continue;const s=o.getBucket(i);s&&(s.isEmpty()||(n.push(e.key),r.push({bucket:s,tileID:e.canonical})))}let s=n.length!==this.visibleTiles.length;if(!s){n.sort();for(let e=0;e<n.length;e++)if(n[e]!==this.visibleTiles[e]){s=!0;break}}if(!s)return;const a=new Set;this.visibleTiles=n,r.sort((e,t)=>e.tileID.z-t.tileID.z||e.tileID.x-t.tileID.x||e.tileID.y-t.tileID.y);for(const t of r){const i=new Array,n=new Array,r=t.bucket;for(const t of r.featuresOnBorder)r.footprints[t.footprintIndex].hiddenFlags&e.aS||(a.has(t.featureId)?n.push(t.footprintIndex):(a.add(t.featureId),i.push(t.footprintIndex)));r.updateFootprintHiddenFlags(i,e.aT,!1),r.updateFootprintHiddenFlags(n,e.aT,!0)}}},drawRasterParticle:function(t,i,n,r,o,s){"offscreen"===t.renderPass&&function(t,i,n,r){if(!r.length)return;const o=t.context,s=o.gl,a=i.getSource();if("raster-array"!==a.type)return;const l=Math.ceil(Math.sqrt(n.paint.get("raster-particle-count")));let c=n.particlePositionRGBAImage;if(!c||c.width!==l){const t=function(t){const i=t*t,n=new Uint8Array(4*i),r=.9090909090909091;for(let t=0;t<i;t++){const i=r*(e.b9(2*t+0)+bi),o=r*(e.b9(2*t+1)+bi),s=255*i%1,a=255*o%1,l=s,c=o-a/255,u=a;n[4*t+0]=255*(i-s/255),n[4*t+1]=255*l,n[4*t+2]=255*c,n[4*t+3]=255*u}return n}(l);c=n.particlePositionRGBAImage=new e.b({width:l,height:l},t)}let u=n.particleFramebuffer;u?u.width!==l&&(u.destroy(),u=n.particleFramebuffer=o.createFramebuffer(l,l,1,null)):u=n.particleFramebuffer=o.createFramebuffer(l,l,1,null);const h=[];for(const e of r){const t=i.getTile(e);if(!t)continue;const r=Di(t,a,n);if(!r)continue;const s=[t.tileSize,t.tileSize];let u=n.tileFramebuffer;u||(u=n.tileFramebuffer=o.createFramebuffer(s[0],s[1],1,null));let d=t.rasterParticleState;d||(d=t.rasterParticleState=new Mi(o,e,s,c));const f=d.update(n.lastInvalidatedAt);d.particleTextureDimension!==l&&d.updateParticleTexture(e,c);const p=d.targetColorTexture;d.targetColorTexture=d.backgroundColorTexture,d.backgroundColorTexture=p;const m=d.particleTexture0;d.particleTexture0=d.particleTexture1,d.particleTexture1=m,h.push([e,r,d,f])}if(0===h.length)return;const d=e.e.now(),f=n.previousDrawTimestamp?.001*(d-n.previousDrawTimestamp):.0167;if(n.previousDrawTimestamp=d,n.hasColorMap()){o.activeTexture.set(s.TEXTURE0+2);let t=n.colorRampTexture;t||(t=n.colorRampTexture=new e.T(o,n.colorRamp,s.RGBA8)),t.bind(s.LINEAR,s.CLAMP_TO_EDGE)}o.bindFramebuffer.set(n.tileFramebuffer.framebuffer),function(t,i,n){const r=t.context,o=r.gl,s=i.tileFramebuffer;r.activeTexture.set(o.TEXTURE0);const a={u_texture:0,u_opacity:1.05*(c=i.paint.get("raster-particle-fade-opacity-factor"))/(c+.05)},l=t.getOrCreateProgram("rasterParticleTexture",{defines:[],overrideFog:!1});var c;for(const c of n){const[,,n,u]=c;s.colorAttachment0.set(n.targetColorTexture.texture),r.viewport.set([0,0,s.width,s.height]),r.clear({color:e.C.transparent}),u&&(n.backgroundColorTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),l.draw(t,o.TRIANGLES,e.Z.disabled,e._.disabled,e.a1.alphaBlended,e.$.disabled,a,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments))}}(t,n,h),function(t,i,n,r){const o=t.context,s=o.gl,a=n.tileFramebuffer,l="globe"===t.transform.projection.name,c=n.paint.get("raster-particle-max-speed");for(const u of r){const[r,h,d]=u;o.activeTexture.set(s.TEXTURE0+0),h.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),a.colorAttachment0.set(d.targetColorTexture.texture);const f=t.getOrCreateProgram("rasterParticleDraw",{defines:h.defines,overrideFog:!1});o.activeTexture.set(s.TEXTURE0+1);const p=h.scalarData?[]:[0,1,2,3].map(t=>e.aC[t](r));p.push(r);const m=r.canonical.x,_=r.canonical.y;for(const o of p){const a=i.getTile(l?o.wrapped():o);if(!a)continue;const u=a.rasterParticleState;if(!u)continue;const d=o.canonical.x+(1<<o.canonical.z)*(o.wrap-r.wrap),p=o.canonical.y;u.particleTexture0.bind(s.NEAREST,s.CLAMP_TO_EDGE);const g=Ti(1,u.particleTexture0.size[0],[d-m,p-_],0,h.texture.size,2,c,h.textureOffset,h.scale,h.offset);f.draw(t,s.POINTS,e.Z.disabled,e._.disabled,e.a1.alphaBlended,e.$.disabled,g,n.id,u.particleIndexBuffer,void 0,u.particleSegment)}}}(t,i,n,h),o.bindFramebuffer.set(n.particleFramebuffer.framebuffer),function(t,i,n,r){const o=t.context,s=o.gl,a=i.paint.get("raster-particle-max-speed"),l=r*i.paint.get("raster-particle-speed-factor")*.15,c=function(e){return Math.pow(e,6)}(.01+1*i.paint.get("raster-particle-reset-rate-factor")),u=i.particleFramebuffer;o.viewport.set([0,0,u.width,u.height]);for(const r of n){const[,n,h]=r;o.activeTexture.set(s.TEXTURE0+0),n.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),o.activeTexture.set(s.TEXTURE0+1);const d=h.particleTexture0;d.bind(s.NEAREST,s.CLAMP_TO_EDGE);const f=Ei(1,d.size[0],0,n.texture.size,a,l,c,n.textureOffset,n.scale,n.offset);u.colorAttachment0.set(h.particleTexture1.texture),o.clear({color:e.C.transparent}),t.getOrCreateProgram("rasterParticleUpdate",{defines:n.defines}).draw(t,s.TRIANGLES,e.Z.disabled,e._.disabled,e.a1.unblended,e.$.disabled,f,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments)}}(t,n,h,f)}(t,i,n,r),"translucent"===t.renderPass&&(function(t,i,n,r){const o=t.context,s=o.gl,a=i.get
vendor: 8,427 bytes, line 2
2Source().tileSize,l=5*(1-e.an(e.b2,e.b2+1,t.transform.zoom))*a+n.paint.get("raster-particle-elevation"),c=!t.options.moving,u="globe"===t.transform.projection.name;if(!r.length)return;const[h,d]=t.stencilConfigForOverlap(r),f=[];u&&f.push("PROJECTION_GLOBE_VIEW");const p=t.stencilModeFor3D();for(const r of d){const a=r.toUnwrapped(),d=i.getTile(r);if(!d.rasterParticleState)continue;const m=d.rasterParticleState,_=100;d.registerFadeDuration(_);const g=i.findLoadedParent(r,0),y=Ci(d,g,i,t.transform,_);let v,x;t.terrain&&t.terrain.prepareDrawTile(),o.activeTexture.set(s.TEXTURE0),m.targetColorTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),o.activeTexture.set(s.TEXTURE1),g&&g.rasterParticleState?(g.rasterParticleState.targetColorTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),v=Math.pow(2,g.tileID.overscaledZ-d.tileID.overscaledZ),x=[d.tileID.canonical.x*v%1,d.tileID.canonical.y*v%1]):m.targetColorTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE);const b=u?t.transform.expandedFarZProjMatrix:t.transform.calculateProjMatrix(a,c),w=t.transform,T=Pi(w),E=e.b3(r.canonical),S=e.b4(E.getCenter().lat);let I,A,M,C,D;u?(I=Float32Array.from(e.b5(e.b6(r.canonical))),A=Float32Array.from(w.globeMatrix),M=Float32Array.from(e.b7(w)),C=[e.a7(w.center.lng),e.a8(w.center.lat)],D=Float32Array.from(e.b8(r.canonical,E,S,w.worldSize/w._pixelsPerMercatorPixel))):(I=new Float32Array(16),A=new Float32Array(9),M=new Float32Array(16),C=[0,0],D=new Float32Array(9));const P=wi(b,I,A,M,D,x||[0,0],e.S(t.transform.zoom),C,T,v||1,y,l),R=t.isTileAffectedByFog(r),L=t.getOrCreateProgram("rasterParticle",{defines:f,overrideFog:R});if(t.uploadCommonUniforms(o,L,a),u){const i=new e.Z(s.LEQUAL,e.Z.ReadOnly,t.depthRangeFor3D),r=0,o=t.globeSharedBuffers;if(o){const[a,l,c]=o.getGridBuffers(S,0!==r);L.draw(t,s.TRIANGLES,i,p,e.a1.alphaBlended,t.renderElevatedRasterBackface?e.$.frontCCW:e.$.backCCW,P,n.id,a,l,c)}}else{const i=t.depthModeForSublayer(0,e.Z.ReadOnly),o=h[r.overscaledZ],{tileBoundsBuffer:a,tileBoundsIndexBuffer:l,tileBoundsSegments:c}=t.getTileBoundsBuffers(d);L.draw(t,s.TRIANGLES,i,o,e.a1.alphaBlended,e.$.disabled,P,n.id,a,l,c)}}t.resetStencilClippingMasks()}(t,i,n,r),t.style.map.triggerRepaint())},prepareRasterParticle:function(e,t,i){const n=t.getSource();if("raster-array"!==n.type||!n.loaded())return;const r=e.sourceLayer||n.rasterLayerIds&&n.rasterLayerIds[0];if(!r)return;const o=e.paint.get("raster-particle-array-band")||n.getInitialBand(r);if(null==o)return;const s=t.getIds().map(e=>t.getTileByID(e));for(const t of s)t.updateNeeded(e.id,o)&&(t._isHeaderLoaded||t.parentTile)&&n.prepareTile(t,r,e.id,o)},Rain:class extends Ui{constructor(){super(4.25),this._params={intensity:.5,timeFactor:1,velocityConeAperture:0,velocity:300,boxSize:2500,dropletSizeX:1,dropletSizeYScale:10,distortionStrength:70,screenThinning:{intensity:.57,start:.46,range:1.17,fadePower:.17,affectedRatio:1,particleOffset:-.2},color:{r:.66,g:.68,b:.74,a:.7},direction:{x:-50,y:-35},shapeDirPower:2,shapeNormalPower:1},this._vignetteParams={strength:1,start:.7,range:1,fadePower:.4,color:{r:.27,g:.27,b:.27,a:1}},this.particlesCount=16e3,this._devtoolsFolder=null,this._painter=null}destroy(){super.destroy()}update(t){const i=t.context;if(!this.particlesVx){const t=Ni(this.particlesCount),n=new e.bl,r=new e.ae;let o=0;const s=e.bj(1323123451230);for(let e=0;e<t.length;++e){const i=t[e],a=[2*s()-1,s(),s(),s()];n.emplaceBack(i[0],i[1],i[2],-1,-1,...a),n.emplaceBack(i[0],i[1],i[2],1,-1,...a),n.emplaceBack(i[0],i[1],i[2],1,1,...a),n.emplaceBack(i[0],i[1],i[2],-1,1,...a),r.emplaceBack(o+0,o+1,o+2),r.emplaceBack(o+0,o+2,o+3),o+=4}this.particlesVx=i.createVertexBuffer(n,zi.members),this.particlesIdx=i.createIndexBuffer(r)}}getDrawParams(e){if(!e.style.rain)return null;const t=e.style.rain.state,i=structuredClone(this._params);i.intensity=t.density,i.timeFactor=t.intensity,i.color=structuredClone(t.color),i.screenThinning.intensity=t.centerThinning,i.dropletSizeX=t.dropletSize[0],i.dropletSizeYScale=t.dropletSize[1]/t.dropletSize[0],i.distortionStrength=100*t.distortionStrength;const n=structuredClone(this._vignetteParams);return n.strength=1,n.color=structuredClone(t.vignetteColor),{params:i,vignetteParams:n,revealParams:{revealStart:0,revealRange:.01},direction:structuredClone(t.direction)}}draw(t){const i=this.getDrawParams(t);if(!i)return;const{params:n,revealParams:r,direction:o,vignetteParams:s}=i,a=t.transform.zoom;if(r.revealStart>a)return;const l=Vi(0,1,r.revealStart,r.revealStart+r.revealRange,a);if(!this.particlesVx||!this.particlesIdx)return;s.strength*=l;const c=this.updateOnRender(t,n.timeFactor),u=t.context,h=u.gl,d=t.transform;this.screenTexture&&this.screenTexture.size[0]===t.width&&this.screenTexture.size[1]===t.height||(this.screenTexture=new e.T(u,{width:t.width,height:t.height,data:null},h.RGBA8)),n.distortionStrength>0&&(u.activeTexture.set(h.TEXTURE0),this.screenTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,0,0,t.width,t.height));const f=t.getOrCreateProgram("rainParticle");t.uploadCommonUniforms(u,f),u.activeTexture.set(h.TEXTURE0),this.screenTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE);const p=[n.color.r,n.color.g,n.color.b,n.color.a],m=(i,r)=>{const s=Bi(this._movement.getPosition(),i),a=n.dropletSizeX,l=n.dropletSizeX*n.dropletSizeYScale,u=t.width/2,m=t.height/2,_=Vi(0,n.screenThinning.start,0,1,n.screenThinning.intensity),g=Vi(.001,n.screenThinning.range,0,1,n.screenThinning.intensity),y=Vi(0,n.screenThinning.particleOffset,0,1,n.screenThinning.intensity),v=(x={modelview:c.modelviewMatrix,projection:c.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:s,velocityConeAperture:n.velocityConeAperture,velocity:n.velocity,boxSize:i,rainDropletSize:[a,l],distortionStrength:n.distortionStrength,rainDirection:o,color:p,screenSize:[d.width,d.height],thinningCenterPos:[u,m],thinningShape:[_,g,Math.pow(10,n.screenThinning.fadePower)],thinningAffectedRatio:n.screenThinning.affectedRatio,thinningParticleOffset:y,shapeDirectionalPower:n.shapeDirPower,shapeNormalPower:n.shapeNormalPower,mode:r?0:1},{u_modelview:Float32Array.from(x.modelview),u_projection:Float32Array.from(x.projection),u_time:x.time,u_cam_pos:x.camPos,u_texScreen:0,u_velocityConeAperture:x.velocityConeAperture,u_velocity:x.velocity,u_boxSize:x.boxSize,u_rainDropletSize:x.rainDropletSize,u_distortionStrength:x.distortionStrength,u_rainDirection:x.rainDirection,u_color:x.color,u_screenSize:x.screenSize,u_thinningCenterPos:x.thinningCenterPos,u_thinningShape:x.thinningShape,u_thinningAffectedRatio:x.thinningAffectedRatio,u_thinningParticleOffset:x.thinningParticleOffset,u_shapeDirectionalPower:x.shapeDirectionalPower,u_shapeNormalPower:x.shapeNormalPower,u_mode:x.mode});var x;const b=Math.round(n.intensity*this.particlesCount),w=e.ad.simpleSegment(0,0,4*b,2*b);f.draw(t,h.TRIANGLES,e.Z.disabled,e._.disabled,e.a1.alphaBlended,e.$.disabled,v,"rain_particles",this.particlesVx,this.particlesIdx,w)};n.distortionStrength>0&&m(n.boxSize,!0),m(n.boxSize,!1),this._vignette.draw(t,s)}},Snow:class extends Ui{constructor(){super(2.25),this._params={intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3,this._devtoolsFolder=null,this._painter=null}destroy(){super.destroy()}update(t){const i=t.context;if(!this.particlesVx){const t=Ni(this.particlesCount),n=new e.bm,r=new e.ae;let o=0;const s=e.bj(1323123451230);for(let e=0;e<t.length;++e){const i=t[e],a=s(),l=s(),c=s(),u=[e/t.length,a,l,c],h=[s(),s()];n.emplaceBack(i[0],i[1],i[2],-1,-1,...u,...h),n.emplaceBack(i[0],i[1],i[2],1,-1,...u,...h),n.emplaceBack(i[0],i[1],i[2],1,1,...u,...h),n.emplaceBack(i[0],i[1],i[2],-1,1,...u,...h),r.emplaceBack(o+0,o+1,o+2),r.emplaceBack(o+0,o+2,o+3),o+=4}this.particlesVx=i.createVertexBuffer(n,ji.members),this.particlesIdx=i.createIndexBuffer(r)}}getDrawParams(e){if(!e.style.snow)return null;const t=e.style.snow.state,i=structuredClone(this._params);i.intensity=t.density,i.timeFactor=t.intensity,i.color=structuredClone(t.color),i.screenThinning.intensity=t.centerThinning,i.billboardSize=2.79*t.flakeSize;
vendor: 5,262 bytes, line 2
2const n=structuredClone(this._vignetteParams);return n.strength=1,n.color=structuredClone(t.vignetteColor),{params:i,vignetteParams:n,revealParams:{revealStart:0,revealRange:.01},direction:structuredClone(t.direction)}}draw(t){const i=this.getDrawParams(t);if(!i)return;const{params:n,revealParams:r,direction:o,vignetteParams:s}=i,a=t.transform.zoom;if(r.revealStart>a)return;const l=Vi(0,1,r.revealStart,r.revealStart+r.revealRange,a);s.strength*=l;const c=this.updateOnRender(t,n.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const u=t.context,h=u.gl,d=t.transform,f=t.getOrCreateProgram("snowParticle");t.uploadCommonUniforms(u,f),((i,n,r)=>{const s=Bi(this._movement.getPosition(),i),a=d.width/2,l=d.height/2,u=Vi(0,r.screenThinning.start,0,1,r.screenThinning.intensity),p=Vi(.001,r.screenThinning.range,0,1,r.screenThinning.intensity),m=Vi(0,r.screenThinning.particleOffset,0,1,r.screenThinning.intensity),_=(g={modelview:c.modelviewMatrix,projection:c.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:s,velocityConeAperture:r.velocityConeAperture,velocity:r.velocity,horizontalOscillationRadius:r.horizontalOscillationRadius,horizontalOscillationRate:r.horizontalOscillationRate,boxSize:i,billboardSize:1*r.billboardSize,simpleShapeParameters:[r.shapeFadeStart,r.shapeFadePower],screenSize:[d.width,d.height],thinningCenterPos:[a,l],thinningShape:[u,p,Math.pow(10,r.screenThinning.fadePower)],thinningAffectedRatio:r.screenThinning.affectedRatio,thinningParticleOffset:m,color:[r.color.r,r.color.g,r.color.b,r.color.a],direction:o},{u_modelview:Float32Array.from(g.modelview),u_projection:Float32Array.from(g.projection),u_time:g.time,u_cam_pos:g.camPos,u_velocityConeAperture:g.velocityConeAperture,u_velocity:g.velocity,u_horizontalOscillationRadius:g.horizontalOscillationRadius,u_horizontalOscillationRate:g.horizontalOscillationRate,u_boxSize:g.boxSize,u_billboardSize:g.billboardSize,u_simpleShapeParameters:g.simpleShapeParameters,u_screenSize:g.screenSize,u_thinningCenterPos:g.thinningCenterPos,u_thinningShape:g.thinningShape,u_thinningAffectedRatio:g.thinningAffectedRatio,u_thinningParticleOffset:g.thinningParticleOffset,u_particleColor:g.color,u_direction:g.direction});var g;const y=Math.round(r.intensity*this.particlesCount),v=e.ad.simpleSegment(0,0,4*y,2*y);this.particlesVx&&this.particlesIdx&&f.draw(t,h.TRIANGLES,e.Z.disabled,e._.disabled,e.a1.alphaBlended,e.$.disabled,_,"snow_particles",this.particlesVx,this.particlesIdx,v)})(n.boxSize,0,n),this._vignette.draw(t,s)}},shaders:Li,programUniforms:Zi,drawElevatedStructures:function(t){const{painter:i,sourceCache:n,layer:r,coords:o,colorMode:s}=t,a=i.context.gl,l=t.painter.shadowRenderer,c=!!l&&l.enabled,u=new e.Z(i.context.gl.LEQUAL,e.Z.ReadOnly,i.depthRangeFor3D);let h=[0,0,0];if(c){const t=i.style.directionalLight,n=i.style.ambientLight;t&&n&&(h=e.aG(i.style,t,n))}const d=t=>{for(const d of o){const o=n.getTile(d),f=o.getBucket(r);if(!f)continue;const p=f.hdExt?f.hdExt.elevatedStructures:void 0;if(!p)continue;let m,_;if(t?(m=p.renderableBridgeSegments,_=p.bridgeProgramConfigurations.get(r.id)):(m=p.renderableTunnelSegments,_=p.tunnelProgramConfigurations.get(r.id)),!m||0===m.segments[0].primitiveLength)continue;_.updatePaintBuffers(),i.prepareDrawTile();const g=i.isTileAffectedByFog(d),y=[];c&&y.push("RENDER_SHADOWS","NORMAL_OFFSET");const v=i.getOrCreateProgram("elevatedStructures",{config:_,overrideFog:g,defines:y}),x=i.translatePosMatrix(d.projMatrix,o,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));c&&l.setupShadows(o.tileID.toUnwrapped(),v,"vector-tile");const b=$i(x,h);i.uploadCommonUniforms(i.context,v,d.toUnwrapped()),v.draw(i,a.TRIANGLES,u,e._.disabled,s,e.$.backCCW,b,r.id,p.vertexBuffer,p.indexBuffer,m,r.paint,i.transform.zoom,_,[p.vertexBufferNormal])}};d(!0),d(!1)},drawElevatedFillShadows:function(t){const{painter:i,sourceCache:n,layer:r,coords:o}=t,s=i.context.gl,a=t.painter.shadowRenderer;for(const t of o){const o=n.getTile(t),l=o.getBucket(r);if(!l)continue;const c=l.hdExt?l.hdExt.elevatedStructures:void 0;if(!c)continue;if(!c.shadowCasterSegments||0===c.shadowCasterSegments.segments[0].primitiveLength)continue;i.prepareDrawTile();const u=l.bufferData.programConfigurations.get(r.id),h=i.isTileAffectedByFog(t),d=i.getOrCreateProgram("elevatedStructuresDepth",{config:u,overrideFog:h}),f=a.calculateShadowPassMatrixFromTile(o.tileID.toUnwrapped());i.uploadCommonUniforms(i.context,d,t.toUnwrapped());const p=Gi(f,0);d.draw(i,s.TRIANGLES,a.getShadowPassDepthMode(),e._.disabled,e.a1.disabled,e.$.disabled,p,r.id,c.vertexBuffer,c.indexBuffer,c.shadowCasterSegments,r.paint,i.transform.zoom,u)}},drawDepthPrepass:function(t,i,n,r,o){if(!i)return;if(!n.layout||"none"===n.layout.get("fill-elevation-reference")||0===n.paint.get("fill-opacity").constantOr(1))return;const s=t.context.gl,a=new e.Z(t.context.gl.LEQUAL,e.Z.ReadWrite,t.depthRangeFor3D),l=new e.Z(t.context.gl.GREATER,e.Z.ReadWrite,t.depthRangeFor3D),c=function(t){let i=.01;return t.isOrthographic&&(i=e.am(1e-4,i,e.bp(t.pitch>=e.bo?1:t.pitch/e.bo))),2*i}(t.transform),u=t.transform.getFreeCameraOptions().position,h="elevatedStructuresDepthReconstruct";let d;for(const f of r){const r=i.getTile(f),p=r.getBucket(n);if(!p)continue;
vendor: 4,377 bytes, line 2
2if(!p.hdExt)continue;const m=p.hdExt.elevatedStructures,_=p.hdExt.elevationBufferData;if(!m||!m.depthSegments||!_)continue;const g=_.heightRange,y=qi(f.toUnwrapped(),u),v=t.translatePosMatrix(f.projMatrix,r,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));let x,b,w;if("initialize"===o){if(!g||g.min>=1||0===m.depthSegments.segments[0].primitiveLength)continue;x=Hi(v,y,c,1,0),b=a,w=m.depthSegments,d=d||t.getOrCreateProgram(h,{defines:["DEPTH_RECONSTRUCTION"]})}else if("reset"===o){if(!g||g.min>=0||0===m.maskSegments.segments[0].primitiveLength)continue;x=Hi(v,y,0,0,1),b=l,w=m.maskSegments,d=d||t.getOrCreateProgram(h,{defines:["DEPTH_RECONSTRUCTION"]})}else if("geometry"===o){if(0===m.depthSegments.segments[0].primitiveLength)continue;x=Hi(v,y,c,1,0),b=a,w=m.depthSegments,d=d||t.getOrCreateProgram(h)}d.draw(t,s.TRIANGLES,b,e._.disabled,e.a1.disabled,e.$.disabled,x,n.id,m.vertexBuffer,m.indexBuffer,w,n.paint,t.transform.zoom)}},drawGroundShadowMask:function(t,i,n,r){if(!i)return;if(!n.layout||"none"===n.layout.get("fill-elevation-reference")||0===n.paint.get("fill-opacity").constantOr(1))return;const o=t.context.gl,s=new e.Z(o.LEQUAL,e.Z.ReadOnly,t.depthRangeFor3D),a=new e._({func:o.ALWAYS,mask:255},255,255,o.KEEP,o.KEEP,o.REPLACE),l=t.transform.getFreeCameraOptions().position;let c;for(const u of r){const r=i.getTile(u),h=r.getBucket(n);if(!h)continue;const d=h.hdExt?h.hdExt.elevatedStructures:void 0;if(!d||!d.depthSegments||0===d.depthSegments.segments[0].primitiveLength)continue;const f=qi(u.toUnwrapped(),l),p=t.translatePosMatrix(u.projMatrix,r,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));c=c||t.getOrCreateProgram("elevatedStructuresDepthReconstruct");const m=Hi(p,f,0,1,0);c.draw(t,o.TRIANGLES,s,a,e.a1.disabled,e.$.disabled,m,n.id,d.vertexBuffer,d.indexBuffer,d.depthSegments,n.paint,t.transform.zoom)}},IndoorManager:class extends e.E{constructor(t,i=!1){super(),this._style=t,this._buildings={},this._activeFloors=new Set,this._closestBuildingId=null,this._indoorState={selectedFloorId:null,activeFloorsVisible:!0,activeFloors:this._activeFloors},this._buildingDetectionStrategy=new xi,this._initialLoadDone=!1,e.aW(["_updateUI"],this);const n=()=>{this._style.isIndoorEnabled()&&(this._style.map.on("load",()=>{this._initialLoadDone=!0,this._indoorState&&this._indoorState.needsUpdate&&(this._indoorState.needsUpdate=!1,this._style.updateIndoorDependentLayers()),this._updateUI()}),this._style.map.on("move",this._updateUI),this._style.map.on("idle",this._updateUI))};i?(this._initialLoadDone=!0,n()):this._style.on("style.load",n)}destroy(){this._buildings={},this._activeFloors=new Set,this._indoorState=null}selectFloor(e){e===this._selectedFloorId&&this._indoorState&&this._indoorState.activeFloorsVisible||(this._selectedFloorId=e,this._recalculateActiveFloors())}setActiveFloorsVisibility(e){this._updateActiveFloors(e),this._updateIndoorSelector()}setIndoorData(e){let t=!1;for(const[i,n]of Object.entries(e.buildings))if(this._buildings[i])for(const e of n.floorIds)this._buildings[i].floorIds.add(e),this._buildings[i].floors[e]?this._mergeFloors(this._buildings[i].floors[e],n.floors[e]):(this._buildings[i].floors[e]=n.floors[e],t=!0);else this._buildings[i]=n,t=!0;t&&this._recalculateActiveFloors()}getIndoorTileOptions(e,t){return this._indoorState?{sourceLayers:this._style.getIndoorSourceLayers(e,t),indoorState:this._indoorState}:null}getControlState(){const e=this._buildings,t=this._closestBuildingId,i=t&&e?e[t]:void 0;if(!i)return{selectedFloorId:null,activeFloorsVisible:!!this._indoorState&&this._indoorState.activeFloorsVisible,floors:[]};let n=null;for(const e of i.floorIds)if(this._activeFloors&&this._activeFloors.has(e)){n=e;break}const r=Array.from(i.floorIds).map(e=>({id:e,name:i.floors[e].name,zIndex:i.floors[e].zIndex})).sort((e,t)=>t.zIndex-e.zIndex).filter((e,t,i)=>0===t||e.zIndex!==i[t-1].zIndex);return{selectedFloorId:n,activeFloorsVisible:!!this._indoorState&&this._indoorState.activeFloorsVisible,floors:r}}_updateUI(){this._initialLoadDone=!0;const e=this._style.map.transform,t=this._buildingDetectionStrategy.findClosestBuilding(this._buildings,e.center,e.zoom,e.getBounds(),this._makeViewportPolygon());if(t!==this._closestBuildingId){const e=this._closestBuildingId;this._closestBuildingId=t,this._onBuildingTransition(e,t),this._updateIndoorSelector()}}
vendor: 4,415 bytes, line 2
2_onBuildingTransition(e,t){if(!this._indoorState)return;const i=!!t&&!e;!t&&e?(this._indoorState.activeFloors=new Set,this._indoorState.activeFloorsVisible=!1,this._style.updateIndoorDependentLayers()):i&&(this._recalculateActiveFloors(),this._updateActiveFloors(!0))}_updateIndoorSelector(){this.fire(new e.h("selector-update",this.getControlState()))}_updateActiveFloors(e){this._indoorState={selectedFloorId:this._selectedFloorId,activeFloorsVisible:e,activeFloors:this._activeFloors},this._initialLoadDone?this._style.updateIndoorDependentLayers():this._indoorState.needsUpdate=!0}_recalculateActiveFloors(){if(!this._buildings)return;const t=e.aX.calculate(this._buildings,this._selectedFloorId,this._activeFloors);(function(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0})(t,this._activeFloors)||(this._activeFloors=t,this._updateActiveFloors(!!this._indoorState&&this._indoorState.activeFloorsVisible),this._updateIndoorSelector())}_mergeFloors(e,t){t.geometry&&(e.geometry?("Polygon"===e.geometry.type&&(e.geometry={type:"MultiPolygon",coordinates:[e.geometry.coordinates]}),"Polygon"===t.geometry.type?e.geometry.coordinates.push(t.geometry.coordinates):"MultiPolygon"===t.geometry.type&&e.geometry.coordinates.push(...t.geometry.coordinates)):e.geometry=t.geometry)}_makeViewportPolygon(){const t=this._style.map.transform,i=t.width,n=t.height;return[t.pointLocation(new e.P(0,0)),t.pointLocation(new e.P(i,0)),t.pointLocation(new e.P(i,n)),t.pointLocation(new e.P(0,n))].map(t=>new e.P(t.lng,t.lat))}},HdCoverageState:class{constructor(){this.coverageSourceCaches={},this.manager=new Ki}},updateFrcCoverage:function(e,t){t.manager.clear();for(const i in e._mergedHdRoadCoverageSourceCaches){const n=e._mergedHdRoadCoverageSourceCaches[i]._tiles;for(const e in n){const i=n[e];if(!i||!i.loaded())continue;const r=i.frcCoveragePolygons;t.manager.addTileCoverage(i.tileID.canonical,r&&r.length>0?r:[])}}const i=t.manager.updateSnapshotIfNeeded();if(e.map.painter&&(e.map.painter.frcCoverageSnapshot=i.empty()?null:i),!i.empty()){const t=[e._mergedOtherSourceCaches,e._mergedSymbolSourceCaches];for(const e of t)for(const t in e){const i=e[t];for(const e in i._tiles){const t=i._tiles[e];t&&t.hasDeferredRoadStructure&&(t.hasDeferredRoadStructure=!1,i._reloadTile(+e,"reloading"))}}}},updateHdCoverageSourceCache:function(t,i,n){if("fill"!==n.type||n.sourceLayer!==e.bV)return;if(i.coverageSourceCaches[n.source])return;const r=t.getOwnSource(n.source);if(!r||"vector"!==r.type)return;const o=`hd-road-coverage:${n.source}`,s=e.m(o,t.scope),a=t._sourceCaches[o]=new mn(s,r,e.bS.HdRoadCoverage);i.coverageSourceCaches[n.source]=a,a.setMaxzoomOverride(14),a.onAdd(t.map);const l=t._otherSourceCaches[n.source];l&&l._sourceLoaded&&(a._sourceLoaded=!0)},updateFrcCoverageFadeRange:function(t,i){let n=null,r=null;const o={globals:{zoom:0}};t.forEachFragmentStyle(i=>{if(n)return;const s=i.stylesheet?i.stylesheet.schema:null;if(!s||!s.sdCoverageFadeRange)return;const a=e.m("sdCoverageFadeRange",i.scope),l=i.options?i.options.get(a):void 0,c=l?l.value||l.default:null;if(c){const e=c.evaluate(o);Array.isArray(e)&&2===e.length&&(e[0]>0||e[1]>0)&&(n=[e[0],e[1]])}const u=e.m("sdCoverageSourceLayers",i.scope),h=i.options?i.options.get(u):void 0,d=h?h.value||h.default:null;if(d){const e=d.evaluate(o);Array.isArray(e)&&e.length>0&&(r=e)}else{const e=t.stylesheet&&t.stylesheet.imports||[];for(const t of e)if(t.id===i.scope){const e=t.config?t.config.sdCoverageSourceLayers:void 0;Array.isArray(e)&&e.length>0&&(r=e);break}}}),i.frcCoverageFadeRange=n,i.frcCoverageSourceLayers=null!=n?r||["road","structure"]:[]},HdElevationState:Dn,setupAndUpdateElevationCoverage:function(e){if(!function(e){for(const t in e._mergedLayers)if(Sn(e._mergedLayers[t]))return!0;return!1}(e))return void Rn(e);const t=Vt(e,e.map&&e.map.transform);e._hdElevation||(e._hdElevation=new Dn);const i=e._hdElevation._terrainActiveLast;if(e._hdElevation._terrainActiveLast=t,void 0!==i&&i!==t&&Cn(e,void 0,!0),t)return void(e.map.painter&&(e.map.painter.elevationCoverageSnapshot=null));if(!An(e))return void Rn(e);void 0===i&&Cn(e,void 0,!0);const n=e._hdElevation;n._needsCrossSourceElevation=!0,e._crossSourceElevationActive=!0,n._ingestFQIDs=Mn(e),Ln(e,n)},updateElevationCoverage:Ln,updateCrossSourceElevationGate:function(e){e._crossSourceElevationActive=An(e)}
vendor: 6,956 bytes, line 2
2,buildElevationRequestParams:function(e,t,i){if(Vt(e.style,e.transform))return null;if(!i)return null;const n=e.painter?e.painter.elevationCoverageSnapshot:null,r=!(!e.painter||!e.painter.elevationProvidersReady);return n?function(e,t,i){const n=e.getTilesIntersecting(t);if(0===n.length)return{registry:[],hasCoveringTile:!1,allProvidersReady:i};const r=[];for(const e of n)for(const t of e.features)r.push({tileId:e.tileId,feature:t});return r.sort((e,t)=>e.feature.id-t.feature.id),{registry:r,hasCoveringTile:!0,allProvidersReady:i}}(n,t.tileID.canonical,r):{registry:[],hasCoveringTile:!1,allProvidersReady:r}},FrcCoverageRenderer:class{constructor(){this.tileBuffers=new Map,this._context=null}update(e,t){this._context=e;const i=new Set;for(const n of t){if(0===n.frcMask)continue;let t=!1;for(const e of n.polygons)if(e.hasGeometry()){t=!0;break}if(!t)continue;const r=`${n.tileId.z}/${n.tileId.x}/${n.tileId.y}`;if(i.add(r),!this.tileBuffers.has(r)){const t=this._createBuffers(e,n);t&&this.tileBuffers.set(r,t)}}for(const e of this.tileBuffers.keys())if(!i.has(e)){const t=this.tileBuffers.get(e);t.vertexBuffer.destroy(),t.indexBuffer.destroy();for(const e of t.frcLevelSegments)e&&e.destroy();this.tileBuffers.delete(e)}}getBuffers(e){return this.tileBuffers.get(`${e.z}/${e.x}/${e.y}`)||null}destroy(){for(const e of this.tileBuffers.values()){e.vertexBuffer.destroy(),e.indexBuffer.destroy();for(const t of e.frcLevelSegments)t&&t.destroy()}this.tileBuffers.clear()}_createBuffers(t,i){const n=new e.bD,r=new e.ae,o=[];for(const t of i.polygons){if(!t.hasGeometry()||0===t.rings.length)continue;const i=n.length,s=r.length,a=n.length,l=[],c=[];let u=0;for(let e=0;e<t.rings.length;e++){const i=t.rings[e];if(!(i.length<3)){e>0&&c.push(u);for(const e of i)n.emplaceBack(e.x,e.y),l.push(e.x,e.y),u++}}const h=e.bG(l,c.length>0?c:void 0);for(let e=0;e<h.length;e+=3)r.emplaceBack(a+h[e],a+h[e+1],a+h[e+2]);o.push({vertexOffset:i,indexOffset:s,vertexCount:n.length-i,indexCount:r.length-s,frcMask:t.frcMask})}if(0===n.length)return null;const s=new Array(9).fill(null);for(let t=0;t<9;++t){const n=1<<t;if(0===(i.frcMask&n))continue;let r=1/0,a=0,l=0,c=!1;for(const e of o)0!==(e.frcMask&n)&&(r=Math.min(r,e.indexOffset),a=Math.max(a,e.indexOffset+e.indexCount),l=Math.max(l,e.vertexOffset+e.vertexCount),c=!0);c&&(s[t]=e.ad.simpleSegment(0,r,l,a-r))}return{vertexBuffer:t.createVertexBuffer(n,e.bF.members),indexBuffer:t.createIndexBuffer(r),frcLevelSegments:s}}},drawFillFrcCoverageFirstPass:function(t){const{painter:i,bucket:n,coord:r,elevatedGeometry:o}=t,s="road"===n.sourceLayerName,a="structure"===n.sourceLayerName;if(!s&&!a)return"fallthrough";if(!i.frcCoverageSnapshot||o)return"fallthrough";const l=i.frcCoverageSnapshot.getTileOrParent(r.canonical);if(!l||0===l.frcMask)return"fallthrough";const c=n.hdExt&&n.hdExt.frcData,u=!!c&&!c.empty(),h=Un(l.polygons);if(a&&!h)return"skip";if(a&&h)return t.polygonCoverageTiles.push({coord:t.coord,bufferData:t.bufferData,program:t.program,programConfiguration:t.programConfiguration,uniformValues:t.uniformValues,depthMode:t.depthMode,dynamicBuffers:t.dynamicBuffers,indexBuffer:t.indexBuffer,segments:t.segments,frcMask:l.frcMask}),"deferred";if(s&&u&&c){const n=l.frcMask,r=i.transform.zoom;for(const[o,s]of c.frcPerLevel)n&1<<o||0!==s.segments.length&&t.program.draw(i,t.drawMode,t.depthMode,t.stencilMode,t.colorMode,e.$.disabled,t.uniformValues,t.layer.id,t.bufferData.layoutVertexBuffer,t.indexBuffer,s,t.layer.paint,r,t.programConfiguration,t.dynamicBuffers);return c.frcNonRoadSegments.segments.length>0&&t.program.draw(i,t.drawMode,t.depthMode,t.stencilMode,t.colorMode,e.$.disabled,t.uniformValues,t.layer.id,t.bufferData.layoutVertexBuffer,t.indexBuffer,c.frcNonRoadSegments,t.layer.paint,r,t.programConfiguration,t.dynamicBuffers),"drawn"}return"fallthrough"},drawFillFrcCoverageSecondPass:function(t,i,n,r,o){if(0===n.length)return;const s=jn(t),a=t.transform.zoom,l=(n,s,l)=>{1!==l&&(n.uniformValues.u_opacity_multiplier=l),n.program.draw(t,r,n.depthMode,s,o,e.$.disabled,n.uniformValues,i.id,n.bufferData.layoutVertexBuffer,n.indexBuffer,n.segments,i.paint,a,n.programConfiguration,n.dynamicBuffers),1!==l&&(n.uniformValues.u_opacity_multiplier=1)};Vn(t,n,s,(e,t,i)=>l(e,i,1),(e,t,i)=>l(e,i,s))},drawLineFrcCoverageDetect:function(e,t,i,n,r,o,s,a,l,c){const u=t.hdExt&&t.hdExt.frcData;if(!u||0===u.frcPerLevel.size)return null;if(!e.frcCoverageSnapshot||n)return null;const h=e.frcCoverageSnapshot.getTileOrParent(i.canonical);if(!h||0===h.frcMask)return null;const d=Un(h.polygons),f=e.frcCoverageFadeRange,p=null!=f&&e.transform.zoom>=f[0];if(d&&p){let e=!1;for(const t of u.frcPerLevel.keys())if(h.frcMask&1<<t){e=!0;break}e&&c.push({coord:i,bucket:t,uniformValues:r,programConfiguration:o,program:s,depthMode:a,colorMode:l,frcMask:h.frcMask})}return{coverageTile:h,frcMask:h.frcMask,active:p,hasPolygonGeometry:d}},drawLineFrcRenderLine:function(e,t,i,n){const r=e.hdExt&&e.hdExt.frcData;if(!r)return;const o=t.frcMask;for(const[e,t]of r.frcPerLevel)o&1<<e||n(i,t);const s=r.frcNonRoadSegments;s.segments.length>0&&n(i,s)},drawLineFrcFadePass:function(e,t,i,n,r,o,s){if(n.hasPolygonGeometry)return;const a=t.hdExt&&t.hdExt.frcData;if(!a||!e.frcCoverageFadeRange)return;const[l,c]=e.frcCoverageFadeRange;if(l>=c)return;const u=1-Math.max(0,Math.min(1,(e.transform.zoom-l)/(c-l)));if(u<=0)return;const h=r?o:e.stencilModeForClipping(i),d=n.frcMask;for(const[e,t]of a.frcPerLevel)d&1<<e&&s(h,t,u)},drawLineFrcCoverageSecondPass:function(t,i,n){if(0===n.length)return;const r=t.context.gl,o=jn(t),s=t.transform.zoom,a=(n,o,a,l)=>{const c=n.bucket.hdExt&&n.bucket.hdExt.frcData,u=c&&c.frcPerLevel.get(o);u&&0!==u.segments.length&&(1!==l&&(n.uniformValues.u_opacity_multiplier=l),n.program.draw(t,r.TRIANGLES,n.depthMode,a,n.colorMode,e.$.disabled,n.uniformValues,i.id,n.bucket.layoutVertexBuffer,n.bucket.indexBuffer,u,i.paint,s,n.programConfiguration,[n.bucket.layoutVertexBuffer2,n.bucket.patternVertexBuffer,n.bucket.zOffsetVertexBuffer,n.bucket.elevationIdColVertexBuffer,n.bucket.elevationGroundScaleVertexBuffer]),1!==l&&(n.uniformValues.u_opacity_multiplier=1))};Vn(t,n,o,(e,t,i)=>a(e,t,i,1),(e,t,i)=>a(e,t,i,o))}},$n=Gn;async function Hn(){return Promise.resolve()}function Zn(t,i){const n=Math.pow(2,i.canonical.z),r=i.canonical.y;return[new e.bT(0,r/n).toLngLat().lat,new e.bT(0,(r+1)/n).toLngLat().lat]}function qn(t,i,n,r,o,s,a){const l=t.context,c=l.gl,u=n.hillshadeFBO;if(!u)return;t.prepareDrawTile();const h=t.isTileAffectedByFog(i),d=[];t.terrain&&t.terrain.renderingToTexture&&t.isEmissiveMrtActive()&&(d.push("USE_MRT1"),"mrt-full-rgba"===t.emissiveMode&&d.push("USE_MRT1_RGBA"));const f=t.getOrCreateProgram("hillshade",{overrideFog:h,defines:d});l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,u.colorAttachment0.get());const p=((t,i,n,r)=>{const o=n.paint.get("hillshade-shadow-color"),s="none"===n.paint.get("hillshade-shadow-color-use-theme").
vendor: 5,715 bytes, line 2
2constantOr("default"),a=n.paint.get("hillshade-highlight-color"),l="none"===n.paint.get("hillshade-highlight-color-use-theme").constantOr("default"),c=n.paint.get("hillshade-accent-color"),u="none"===n.paint.get("hillshade-accent-color-use-theme").constantOr("default"),h=n.paint.get("hillshade-emissive-strength");let d=e.av(n.paint.get("hillshade-illumination-direction"));if("viewport"===n.paint.get("hillshade-illumination-anchor"))d-=t.transform.angle;else if(t.style&&t.style.enable3dLights()&&t.style.directionalLight){const i=t.style.directionalLight.properties.get("direction"),n=e.b_(i.x,i.y,i.z);d=e.av(n[1])}const f=!t.options.moving;return{u_matrix:r||t.transform.calculateProjMatrix(i.tileID.toUnwrapped(),f),u_image:0,u_latrange:Zn(0,i.tileID),u_light:[n.paint.get("hillshade-exaggeration"),d],u_shadow:o.toPremultipliedRenderColor(s?null:n.lut),u_highlight:a.toPremultipliedRenderColor(l?null:n.lut),u_emissive_strength:h,u_accent:c.toPremultipliedRenderColor(u?null:n.lut)}})(t,n,r,t.terrain?i.projMatrix:null);t.uploadCommonUniforms(l,f,i.toUnwrapped());const{tileBoundsBuffer:m,tileBoundsIndexBuffer:_,tileBoundsSegments:g}=t.getTileBoundsBuffers(n);f.draw(t,c.TRIANGLES,o,s,a,e.$.disabled,p,r.id,m,_,g)}function Wn(t,i,n){if(!i.needsDEMTextureUpload)return;const r=t.context,o=r.gl;r.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||t.getTileTexture(n.stride);const s=n.getPixels();i.demTexture?i.demTexture.update(s,{premultiply:!1}):i.demTexture=new e.T(r,s,o.R32F,{premultiply:!1}),i.needsDEMTextureUpload=!1}function Yn(t,i,n){const r=t.context,o=r.gl;if(!i.dem)return;const s=i.dem;if(r.activeTexture.set(o.TEXTURE1),Wn(t,i,s),!i.demTexture)return;i.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE);const a=s.dim;r.activeTexture.set(o.TEXTURE0);let l=i.hillshadeFBO;if(!l){const t=new e.T(r,{width:a,height:a,data:null},o.RGBA8);t.bind(o.LINEAR,o.CLAMP_TO_EDGE),l=i.hillshadeFBO=r.createFramebuffer(a,a,1,"renderbuffer"),l.colorAttachment0.set(t.texture)}r.bindFramebuffer.set(l.framebuffer),r.viewport.set([0,0,a,a]);const{tileBoundsBuffer:c,tileBoundsIndexBuffer:u,tileBoundsSegments:h}=t.getMercatorTileBoundsBuffers(),d=[];t.linearFloatFilteringSupported()&&d.push("TERRAIN_DEM_FLOAT_FORMAT"),t.terrain&&t.terrain.renderingToTexture&&t.isEmissiveMrtActive()&&(d.push("USE_MRT1"),"mrt-full-rgba"===t.emissiveMode&&d.push("USE_MRT1_RGBA")),t.getOrCreateProgram("hillshadePrepare",{defines:d}).draw(t,o.TRIANGLES,e.Z.disabled,e._.disabled,e.a1.unblended,e.$.disabled,((t,i)=>{const n=i.stride,r=e.Y();return e.bZ(r,0,e.a6,-e.a6,0,0,1),e.bN(r,r,[0,-e.a6,0]),{u_matrix:r,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ}})(i.tileID,s),n.id,c,u,h),i.needsHillshadePrepare=!1}class Xn{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Jn extends Xn{getDefault(){return e.C.transparent.toNonPremultipliedRenderColor(null)}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Kn extends Xn{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class Qn extends Xn{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class er extends Xn{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class tr extends Xn{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class ir extends Xn{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class nr extends Xn{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class rr extends Xn{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class or extends Xn{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class sr extends Xn{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class ar extends Xn{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class lr extends Xn{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class cr extends Xn{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class ur extends Xn{getDefault(){const e=this.gl;return[e.ONE,e.ZERO,e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.blendFuncSeparate(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class hr extends Xn{getDefault(){return e.C.transparent.toNonPremultipliedRenderColor(null)}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor
vendor: 5,030 bytes, line 2
2(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class dr extends Xn{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(e,e),this.current=e,this.dirty=!1)}}class fr extends Xn{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class pr extends Xn{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class mr extends Xn{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}let _r=class extends Xn{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}};class gr extends Xn{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class yr extends Xn{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class vr extends Xn{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class xr extends Xn{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class br extends Xn{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class wr extends Xn{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Tr extends Xn{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Er extends Xn{getDefault(){return null}set(e){this.gl&&(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}}class Sr extends Xn{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class Ir extends Xn{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Ar extends Xn{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class Mr extends Xn{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class Cr extends Mr{constructor(e,t,i=0){super(e,t),this.attachmentPoint=e.gl.COLOR_ATTACHMENT0+i}setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,this.attachmentPoint,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Dr extends Mr{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,this.attachment(),t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Pr extends Mr{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,this.attachment(),t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Rr extends Dr{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const Lr=(e,t,i,n)=>({u_matrix:e,u_image0:0,u_image1:1,u_skirt_height:t,u_ground_shadow_factor:i,u_emissive_texture_available:n}),zr=(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(n),u_merc_matrix:i,u_zoom_transition:r,u_merc_center:o,u_image0:0,u_image1:1,u_frustum_tl:s,u_frustum_tr:a,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:u,u_globe_radius:h,u_viewport:d,u_grid_matrix:_?Float32Array.from(_):new Float32Array(9),u_skirt_height:f,u_far_z_cutoff:p,u_emissive_texture_available:m});function Fr(e,t){return null!=e&&null!=t&&!(!e.hasData()||!t.hasData())&&null!=e.demTexture&&null!=t.demTexture&&e.tileID.key!==t.tileID.key}const Or=new class{constructor(){this.operations={}}newMorphing(e,t,i,n,r){if(e in this.operations){const t=this.operations[e];t.to.tileID.key!==i.tileID.key&&(t.queued=i)}else this.operations[e]={startTime:n,phase:0,duration:r,from:t,to:i,queued:null}}getMorphValuesForProxy(e){if(!(e in this.operations))return null;const t=this.operations[e];return{from:t.from,to:t.to,phase:t.phase}}update(e){for(const t in this.operations){const i=this.operations[t];for(i.phase=(e-i.startTime)/i.duration;i.phase>
vendor: 6,357 bytes, line 2
2=1||!this._validOp(i);)if(!this._nextOp(i,e)){delete this.operations[t];break}}}_nextOp(e,t){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=t,!0)}_validOp(e){return e.from.hasData()&&e.to.hasData()}};function kr(e,t,i){if(0===t)return 0;const n=t<1&&514===i?.25/t:1;return 6*Math.pow(1.5,22-e)*Math.max(t,1)*n}function Br(e,t){const i=1<<e.z;return!t&&(0===e.x||e.x===i-1)||0===e.y||e.y===i-1}function Nr(e,t){if(!e.style||!e.style.enable3dLights())return;const i=e.context,n=i.gl;i.activeTexture.set(n.TEXTURE1),t?t.bind(n.LINEAR,n.CLAMP_TO_EDGE):e.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}class Vr extends e.E{constructor(e,t,i,n,r,o){super(),this.id=e,this.type=t,this.tileSize=i,this.minzoom=n,this.maxzoom=r,this.roundZoom=!1,this.reparseOverscaled=o}loaded(){return!0}loadTile(e,t){t(null)}serialize(){return{type:this.type}}}class Ur extends mn{constructor(e){const t=new Vr("mock-dem","raster-dem",512,0,Math.ceil(e.transform.maxZoom),!1);super("mock-dem",t,null),t.setEventedParent(this),this._sourceLoaded=!0}_loadTile(e,t){e.state="loaded",t(null)}}class jr extends mn{constructor(e){const t=new Vr("proxy","geojson",512,0,Math.ceil(e.transform.maxZoom),!0);super("proxy",t,null),t.setEventedParent(this),this.map=this.getSource().map=e,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(e,t,i){if(e.freezeTileCoverage)return;this.transform=e;const n=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((t,i)=>{if(t[i.key]="",!this._tiles[i.key]){const t=new dn(i,this._source.tileSize*i.overscaleFactor(),e.tileZoom,void 0,void 0,this._source.worldview);t.state="loaded",this._tiles[i.key]=t}return t},{});for(const e in this._tiles)e in n||(this.freeFBO(e),this._tiles[e].unloadVectorData(),delete this._tiles[e])}freeFBO(e){const t=this.proxyCachedFBO[e];if(void 0!==t){const i=Object.values(t);this.renderCachePool.push(...i),delete this.proxyCachedFBO[e]}}deallocRenderCache(){this.renderCache.forEach(e=>e.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Gr extends e.bQ{constructor(e,t,i){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=t,this.projMatrix=i}}function $r(e,t){return"rgba8"===t?e.RGBA8:e.R8}class Hr extends e.c2{constructor(t,i){super(),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[n,r,o]=function(){const t=new e.bD,i=new e.ae,n=131;t.reserve(17161),i.reserve(33800);const r=e.a6/128,o=e.a6+r/2,s=o+r;for(let i=-r;i<s;i+=r)for(let n=-r;n<s;n+=r){const r=n<0||n>o||i<0||i>o?24575:0,s=e.b1(Math.round(n),0,e.a6),a=e.b1(Math.round(i),0,e.a6);t.emplaceBack(s+r,a)}const a=(e,t)=>{const r=t*n+e;i.emplaceBack(r+1,r,r+n),i.emplaceBack(r+n,r+n+1,r+1)};for(let e=1;e<129;e++)for(let t=1;t<129;t++)a(t,e);return[0,129].forEach(e=>{for(let t=0;t<130;t++)a(t,e),a(e,t)}),[t,i,32768]}(),s=t.context;this.gridBuffer=s.createVertexBuffer(n,e.bF.members),this.gridIndexBuffer=s.createIndexBuffer(r),this.gridSegments=e.ad.simpleSegment(0,0,n.length,r.length),this.gridNoSkirtSegments=e.ad.simpleSegment(0,0,n.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new jr(i.map),this.orthoMatrix=e.Y(),e.bZ(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,e.a6,0,e.a6,0,1);const a=s.gl;this._overlapStencilMode=new e._({func:a.GEQUAL,mask:255},0,255,a.KEEP,a.KEEP,a.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=i,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Ur(i.map),this._pendingGroundEffectLayers=[],this._emissiveTexture="none",this._devtoolsFolder=null}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),this._style=e,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(t,i,n){if(t&&t.terrain){this._style!==t&&(this.style=t,this._evaluationZoom=void 0);const r=t.terrain.properties,o=0===t.terrain.drapeRenderMode,s=t.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=e.e.now();const a=t.terrain&&t.terrain.scope,l=r.get("source"),c=o?this._mockSourceCache:t.getSourceCache(l,a);if(!c)return void e.w(`Couldn't find terrain source "${l}".`);if(this.sourceCache=c,this._attenuationRange=t.terrain.getAttenuationRange(),this._exaggeration=s?this.calculateExaggeration(i):r.get("exaggeration"),!i.projection.requiresDraping&&s&&0===this._exaggeration)return void this._disable();this.enabled=!0;const u=()=>{this.sourceCache.used&&e.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const t=this.getScaledDemTileSize();this.sourceCache.update(i,t,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,u(),this._initializing=!0),u(),i.updateElevation(!0,n),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(i),this._emptyDEMTextureDirty=!0,this._previousZoom=i.zoom}else this._disable()}calculateExaggeration(t){if(this._attenuationRange&&t.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(t.zoom);const i=this._previousCameraAltitude,n=t.getFreeCameraOptions().position.z/t.pixelsPerMeter*t.worldSize;this._previousCameraAltitude=n;const r=null!=i?n-i:Number.MAX_VALUE;if(Math.abs(r)<2)return this._exaggeration;const o=t.zoom,s=this._style.terrain;if(!this._previousUpdateTimestamp)return s.getExaggeration(o);let a=o-this._previousZoom;const l=this._previousUpdateTimestamp;let c=o;null!=this._evaluationZoom&&(c=this._evaluationZoom,Math.abs(o-c)>.5&&(a=.5*(o-c+a)),a*r<0&&(c+=a)),this._evaluationZoom=c;const u=s.getExaggeration(c),h=u===s.getExaggeration(Math.max(0,c-.1));if(h&&Math.abs(u-this._exaggeration)<.01)return u;let d=Math.min(.1,.00375*(this._updateTimestamp-l));
vendor: 5,078 bytes, line 2
2return(h||u<.1||Math.abs(a)<1e-4)&&(d=Math.min(.2,4*d)),e.am(this._exaggeration,u,d)}resetTileLookupCache(e){this._findCoveringTileCache[e]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(e){"source"===e.dataType&&e.coord?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const e in this._style._mergedSourceCaches)this._style._mergedSourceCaches[e].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(e=>e.fb.destroy()),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}set useVertexMorphing(e){this._useVertexMorphing=e}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const i=this.proxySourceCache,n=this.painter.transform;this._initializing&&(this._initializing=0===n._centerAltitude&&-1===this.getAtPointOrZero(e.bT.fromLngLat(n.center),-1),this._emptyDEMTextureDirty=!this._initializing);const r=this.proxyCoords=i.getIds().map(e=>{const t=i.getTileByID(e).tileID;return t.projMatrix=n.calculateProjMatrix(t.toUnwrapped()),t});!function(t,i){const n=i.transform.pointCoordinate(i.transform.getCameraPoint()),r=new e.P(n.x,n.y);t.sort((t,i)=>{if(i.overscaledZ-t.overscaledZ)return i.overscaledZ-t.overscaledZ;const n=new e.P(t.canonical.x+(1<<t.canonical.z)*t.wrap,t.canonical.y),o=new e.P(i.canonical.x+(1<<i.canonical.z)*i.wrap,i.canonical.y),s=r.mult(1<<t.canonical.z);return s.x-=.5,s.y-=.5,s.distSqr(n)-s.distSqr(o)})}(r,this.painter);const o=this.proxyToSource||{};this.proxyToSource={},r.forEach(e=>{this.proxyToSource[e.key]={}}),this.terrainTileForTile={};const s=this._style._mergedSourceCaches;for(const e in s){const i=s[e];if(!i.used)continue;if(!i.transform)continue;if(i!==this.sourceCache&&this.resetTileLookupCache(i.id),this._setupProxiedCoordsForOrtho(i,t[e],o),i.usedForTerrain)continue;const n=t[e];(i.getSource().reparseOverscaled||i._isRasterElevatedOverTerrain)&&this._assignTerrainTiles(n)}this.proxiedCoords[i.id]=r.map(e=>new Gr(e,e.key,this.orthoMatrix)),this._assignTerrainTiles(r),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(o),this.renderingToTexture=!1;const a={};this._visibleDemTiles=[];for(const e of this.proxyCoords){const t=this.terrainTileForTile[e.key];if(!t)continue;const i=t.tileID.key;i in a||(this._visibleDemTiles.push(t),a[i]=i)}}_assignTerrainTiles(e){this._initializing||e.forEach(e=>{if(this.terrainTileForTile[e.key])return;const t=this._findTileCoveringTileID(e,this.sourceCache);t&&(this.terrainTileForTile[e.key]=t)})}_prepareDEMTextures(){const e=this.painter.context,t=e.gl;for(const i in this.terrainTileForTile){const n=this.terrainTileForTile[i],r=n.dem;!r||n.demTexture&&!n.needsDEMTextureUpload||(e.activeTexture.set(t.TEXTURE1),Wn(this.painter,n,r))}}_prepareDemTileUniforms(e,t,i,n){if(!t||null==t.demTexture)return!1;const r=e.tileID.canonical,o=Math.pow(2,t.tileID.canonical.z-r.z),s=n||"";return i[`u_dem_tl${s}`]=[r.x*o%1,r.y*o%1],i[`u_dem_scale${s}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let e=0;const t=this._visibleDemTiles.reduce((t,i)=>{if(!i.dem)return t;const n=i.dem.tree.minimums[0];return n>0&&e++,t+n},0);return e?t/e:0}_updateEmptyDEMTexture(){const t=this.painter.context,i=t.gl;t.activeTexture.set(i.TEXTURE2);const n=this._getLoadedAreaMinimum(),r=new e.c3({width:1,height:1},new Float32Array([n]));this._emptyDEMTextureDirty=!1;let o=this._emptyDEMTexture;return o?o.update(r,{premultiply:!1}):o=this._emptyDEMTexture=new e.T(t,r,i.R32F,{premultiply:!1}),o}setupElevationDraw(t,i,n){const r=this.painter.context,o=r.gl,s={u_dem:2,u_dem_prev:4,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_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};s.u_exaggeration=this.exaggeration();let a=null,l=null,c=1;if(n&&n.morphing&&this._useVertexMorphing){const e=n.morphing.srcDemTile,i=n.morphing.dstDemTile;
vendor: 8,404 bytes, line 2
2c=n.morphing.phase,e&&i&&(this._prepareDemTileUniforms(t,e,s,"_prev")&&(l=e),this._prepareDemTileUniforms(t,i,s)&&(a=i))}const u=e=>e&&e.demTexture&&this.painter.linearFloatFilteringSupported()?o.LINEAR:o.NEAREST;let h=null;var d;if(this.enabled?l&&a?(h=a.demTexture,r.activeTexture.set(o.TEXTURE4),l.demTexture.bind(u(l),o.CLAMP_TO_EDGE),s.u_dem_lerp=c):(a=this.terrainTileForTile[t.tileID.key],h=this._prepareDemTileUniforms(t,a,s)?a.demTexture:this.emptyDEMTexture):h=this.emptyDEMTexture,r.activeTexture.set(o.TEXTURE2),h&&(s.u_dem_size=1===(d=h).size[0]?1:d.size[0]-2,h.bind(u(a),o.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(n&&n.useDepthForOcclusion,i,s),n&&n.useMeterToDem&&a){const t=(1<<a.tileID.canonical.z)*e.c4(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;s.u_meter_to_dem=t}if(n&&n.labelPlaneMatrixInv&&(s.u_label_plane_matrix_inv=n.labelPlaneMatrixInv),i.setTerrainUniformValues(r,s),"globe"===this.painter.transform.projection.name){const e=this.globeUniformValues(this.painter.transform,t.tileID.canonical,n&&n.useDenormalizedUpVectorScale);i.setGlobeUniformValues(r,e)}}globeUniformValues(t,i,n){const r=t.projection;return{u_tile_tl_up:r.upVector(i,0,0),u_tile_tr_up:r.upVector(i,e.a6,0),u_tile_br_up:r.upVector(i,e.a6,e.a6),u_tile_bl_up:r.upVector(i,0,e.a6),u_tile_up_scale:n?e.c5(1):r.upVectorScale(i,t.center.lat,t.worldSize).metersToTile}}renderToBackBuffer(t){const i=this.painter,n=this.painter.context;0!==t.length&&(n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),i.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(t,i,n,r,o){if("globe"===t.transform.projection.name)!function(t,i,n,r,o){const s=t.context,a=s.gl;let l,c;const u=t.transform,h=e.c0(t,s,u),d=(e,i)=>{if(c===i)return;const n=[];1===i&&n.push("TERRAIN_VERTEX_MORPHING"),n.push("PROJECTION_GLOBE_VIEW"),h&&n.push("CUSTOM_ANTIALIASING");const r=t.isTileAffectedByFog(e);l=t.getOrCreateProgram("globeRaster",{defines:n,overrideFog:r}),c=i},f=t.colorModeForRenderPass(),p=new e.Z(a.LEQUAL,e.Z.ReadWrite,t.depthRangeFor3D);Or.update(o);const m=e.b7(u),_=[e.a7(u.center.lng),e.a8(u.center.lat)],g=t.globeSharedBuffers,y=[u.width*e.e.devicePixelRatio,u.height*e.e.devicePixelRatio],v=Float32Array.from(u.globeMatrix),x={useDenormalizedUpVectorScale:!0};{const u=t.transform,h=kr(u.zoom,i.exaggeration(),i.sourceCache._source.tileSize);c=-1;const b=a.TRIANGLES;for(const c of r){const r=n.getTile(c),w=e._.disabled,T=i.prevTerrainTileForTile[c.key],E=i.terrainTileForTile[c.key];Fr(T,E)&&Or.newMorphing(c.key,T,E,o,250),Nr(t,r.emissiveTexture),s.activeTexture.set(a.TEXTURE0),r.texture&&r.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const S=Or.getMorphValuesForProxy(c.key),I=S?1:0;S&&Object.assign(x,{morphing:{srcDemTile:S.from,dstDemTile:S.to,phase:e.b$(S.phase)}});const A=e.b3(c.canonical),M=e.b4(A.getCenter().lat),C=e.b8(c.canonical,A,M,u.worldSize/u._pixelsPerMercatorPixel),D=e.b5(e.b6(c.canonical)),P=t.isEmissiveMrtActive()?1:0,R=zr(u.expandedFarZProjMatrix,v,m,D,e.S(u.zoom),_,u.frustumCorners.TL,u.frustumCorners.TR,u.frustumCorners.BR,u.frustumCorners.BL,u.globeCenterInViewSpace,u.globeRadius,y,h,u._farZ,P,C);if(d(c,I),l&&(i.setupElevationDraw(r,l,x),t.uploadCommonUniforms(s,l,c.toUnwrapped()),g)){const[i,n,r]=g.getGridBuffers(M,0!==h);l.draw(t,b,p,w,f,e.$.backCCW,R,"globe_raster",i,n,r)}}}if(g&&(t.renderDefaultNorthPole||t.renderDefaultSouthPole)){const o=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];h&&o.push("CUSTOM_ANTIALIASING"),l=t.getOrCreateProgram("globeRaster",{defines:o});for(const o of r){const{x:r,y:c,z:h}=o.canonical,d=0===c,m=c===(1<<h)-1,[v,b,w,T]=g.getPoleBuffers(h,!1);if(T&&(d||m)){const c=n.getTile(o);Nr(t,c.emissiveTexture),s.activeTexture.set(a.TEXTURE0),c.texture&&c.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);let g=e.c1(h,r,u);const E=e.b5(e.b6(o.canonical)),S=t.isEmissiveMrtActive()?1:0,I=(i,n)=>i.draw(t,a.TRIANGLES,p,e._.disabled,f,e.$.disabled,zr(u.expandedFarZProjMatrix,g,g,E,0,_,u.frustumCorners.TL,u.frustumCorners.TR,u.frustumCorners.BR,u.frustumCorners.BL,u.globeCenterInViewSpace,u.globeRadius,y,0,u._farZ,S),"globe_pole_raster",n,w,T);i.setupElevationDraw(c,l,x),t.uploadCommonUniforms(s,l,o.toUnwrapped()),d&&t.renderDefaultNorthPole&&I(l,v),m&&t.renderDefaultSouthPole&&(g=e.aO(e.Y(),g,[1,-1,1]),I(l,b))}}}}(t,i,n,r,o);else{const s=t.context,a=s.gl;let l,c;const u=t.shadowRenderer,h=e.aF(t,t.longestCutoffRange),d=e=>{if(c===e)return;const i=[];1===e&&i.push("TERRAIN_VERTEX_MORPHING"),h.shouldRenderCutoff&&i.push("RENDER_CUTOFF"),u&&(i.push("RENDER_SHADOWS"),u.useNormalOffset&&i.push("NORMAL_OFFSET")),l=t.getOrCreateProgram("terrainRaster",{defines:i}),c=e},f=t.colorModeForRenderPass(),p=new e.Z(a.LEQUAL,e.Z.ReadWrite,t.depthRangeFor3D);Or.update(o);const m=t.transform,_=kr(m.zoom,i.exaggeration(),i.sourceCache._source.tileSize);let g=[0,0,0];if(u){const i=t.style.directionalLight,n=t.style.ambientLight;i&&n&&(g=e.aG(t.style,i,n))}{c=-1;const y=a.TRIANGLES,[v,x]=[i.gridIndexBuffer,i.gridSegments];for(const c of r){const r=n.getTile(c),b=e._.disabled,w=i.prevTerrainTileForTile[c.key],T=i.terrainTileForTile[c.key];Fr(w,T)&&Or.newMorphing(c.key,w,T,o,250),Nr(t,r.emissiveTexture),s.activeTexture.set(a.TEXTURE0),r.texture&&r.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const E=Or.getMorphValuesForProxy(c.key),S=E?1:0;let I;E&&(I={morphing:{srcDemTile:E.from,dstDemTile:E.to,phase:e.b$(E.phase)}});const A=t.isEmissiveMrtActive()?1:0,M=Lr(c.projMatrix,Br(c.canonical,m.renderWorldCopies)?_/10:_,g,A);if(d(S),!l)continue;i.setupElevationDraw(r,l,I);const C=c.toUnwrapped();u&&u.setupShadows(C,l),t.uploadCommonUniforms(s,l,C,null,h),l.draw(t,y,p,b,f,e.$.backCCW,M,"terrain_raster",i.gridBuffer,v,x)}}}}(i,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,i.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const i=this.painter,n=this.painter.context,r=this.proxySourceCache,o=this.proxiedCoords[r.id],s=this._drapedRenderBatches.shift(),a=i.style.order,l=[];this._updateFBOs("mrt-full-rgba"===i.emissiveMode?"rgba8":"mrt-fallback"===i.emissiveMode?"r8":"none");let c=0;for(const u of o){const o=r.getTileByID(u.proxyTileKey),h=r.proxyCachedFBO[u.key]?r.proxyCachedFBO[u.key][t]:void 0,d=void 0!==h?r.renderCache[h]:this.pool[c++],f=void 0!==h;if(o.texture=d.tex,o.emissiveTexture=d.emissiveTex,f&&!d.dirty){l.push(o.tileID);continue}n.bindFramebuffer.set(d.fb.framebuffer);const p=n.gl;let m;i.isEmissiveMrtActive()?p.drawBuffers([p.COLOR_ATTACHMENT0,p.COLOR_ATTACHMENT1]):p.drawBuffers([p.COLOR_ATTACHMENT0]),this.renderedToTile=!1,d.dirty&&(n.clear({color:e.C.transparent,stencil:0}),d.dirty=!1);for(let e=s.start;e<=s.end;++e){const t=i.style._mergedLayers[a[e]];if(t.isHidden(i.transform.zoom))continue;const r=i.style.getLayerSourceCache(t),o=r?this.proxyToSource[u.key][r.id]:[u];if(!o)continue;const s=o;n.viewport.set([0,0,d.fb.width,d.fb.height]),m!==(r?r.id:null)&&(this._setupStencil(d,o,t,r),m=r?r.id:null),i.renderLayer(i,r,t,s)}if(p.drawBuffers([p.COLOR_ATTACHMENT0]),0===this._drapedRenderBatches.length)for(const e of this._pendingGroundEffectLayers){const t=i.style._mergedLayers[a[e]];if(t.isHidden(i.transform.zoom))continue;const r=i.style.getLayerSourceCache(t),o=r?this.proxyToSource[u.key][r.id]:[u];if(!o)continue;const s=o;n.viewport.set([0,0,d.fb.width,d.fb.height]),m!==(r?r.id:null)&&(this._setupStencil(d,o,t,r),m=r?r.id:null),i.renderLayer(i,r,t,s)}this.renderedToTile?(d.dirty=!0,l.push(o.tileID)):f||--c,5===c&&(c=0,this.renderToBackBuffer(l))}return this.renderToBackBuffer(l),this.renderingToTexture=!1,n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),s.end+1}postRender(){}isLayerOrderingCorrect(e){const t=e.order.length;let i=-1,n=t;for(let r=0;r<t;++r)this._style.isLayerDraped(e._mergedLayers[e.order[r]])?i=Math.max(i,r):n=Math.min(n,r);return n>i}getMinElevationBelowMSL(){let e=0;return this._visibleDemTiles.filter(e=>e.dem).forEach(t=>{e=Math.min(e,t.dem.tree.minimums[0])}),0===e?e:(e-30)*this._exaggeration}raycast(e,t,i){if(!this._visibleDemTiles)return null;const n=this._visibleDemTiles.filter(e=>e.dem).map(n=>{const r=n.tileID,o=1<<r.overscaledZ,{x:s,y:a}=r.canonical,l=s/o,c=(s+1)/o,u=a/o,h=(a+1)/o;return{minx:l,miny:u,maxx:c,maxy:h,t:n.dem.tree.raycastRoot(l,u,c,h,e,t,i),tile:n}});n.sort((e,t)=>
vendor: 5,115 bytes, line 2
2(null!==e.t?e.t:Number.MAX_VALUE)-(null!==t.t?t.t:Number.MAX_VALUE));for(const r of n){if(null==r.t)return null;const n=r.tile.dem.tree.raycast(r.minx,r.miny,r.maxx,r.maxy,e,t,i);if(null!=n)return n}return null}_createFBO(){const t=this.painter.context,i=t.gl,n=this.drapeBufferSize;t.activeTexture.set(i.TEXTURE0);const r=new e.T(t,{width:n[0],height:n[1],data:null},i.RGBA8);r.bind(i.LINEAR,i.CLAMP_TO_EDGE);const o=t.createFramebuffer(n[0],n[1],1,null);let s;return o.colorAttachment0.set(r.texture),"none"!==this._emissiveTexture&&(s=new e.T(t,{width:n[0],height:n[1],data:null},$r(i,this._emissiveTexture)),s.bind(i.LINEAR,i.CLAMP_TO_EDGE),o.createColorAttachment(t,1),o.colorAttachment1.set(s.texture)),o.depthAttachment=new Rr(t,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,n[0],n[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:o,tex:r,emissiveTex:s,dirty:!1}}_updateFBOs(e){if(this._emissiveTexture!==e){for(const t of this.pool)this._updateFBO(t,e);for(const t of this.proxySourceCache.renderCache)this._updateFBO(t,e);this._emissiveTexture=e}}_updateFBO(t,i){const n=t.fb,r=this.painter.context,o=r.gl,s=this.drapeBufferSize;if("none"!==i){const a=new e.T(r,{width:s[0],height:s[1],data:null},$r(o,i));a.bind(o.LINEAR,o.CLAMP_TO_EDGE),t.emissiveTex=a,n.createColorAttachment(r,1),n.colorAttachment1.set(a.texture)}else t.emissiveTex=void 0,n.removeColorAttachment(r,1);t.dirty=!0}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.hasLightTransitions())return!0;for(const e in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[e].hasTransition())return!0;return this._style.order.some(e=>{const t=this._style._mergedLayers[e],i=t.isHidden(this.painter.transform.zoom);return"hillshade"===t.type||"custom"===t.type?!i&&t.shouldRedrape():!i&&t.hasTransition()})}_clearLineLayersFromRenderCache(){let t=!1;for(const e of this._style.getSources())if("vector"===e.type){t=!0;break}if(!t)return;const i={};for(let t=0;t<this._style.order.length;++t){const n=this._style._mergedLayers[this._style.order[t]],r=this._style.getLayerSourceCache(n);if(!r||i[r.id])continue;if(n.isHidden(this.painter.transform.zoom)||"line"!==n.type)continue;const o=n.widthExpression(),s=n.emissiveStrengthExpression();if(o instanceof e.ak||s instanceof e.ak){i[r.id]=!0;for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][r.id];if(t)for(const e of t)this._clearRenderCacheForTile(r.id,e)}}}}_clearRasterLayersFromRenderCache(){let e=!1;for(const t in this._style._mergedSourceCaches){const i=this._style._mergedSourceCaches[t]._source.type;if("raster"===i||"raster-dem"===i||"raster-array"===i){e=!0;break}}if(!e)return;const t={};for(let e=0;e<this._style.order.length;++e){const i=this._style._mergedLayers[this._style.order[e]],n=this._style.getLayerSourceCache(i);if(!n||t[n.id])continue;if(i.isHidden(this.painter.transform.zoom)||"raster"!==i.type)continue;const r=i.paint.get("raster-fade-duration");for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][n.id];if(t)for(const e of t){const t=Ci(n.getTile(e),n.findLoadedParent(e,0),n,this.painter.transform,r);(1!==t.opacity||0!==t.mix)&&this._clearRenderCacheForTile(n.id,e)}}}}_setupDrapedRenderBatches(){this._style.updateDrapeFirstLayers();const t=this._style.order,i=t.length;if(0===i)return;const n=[];this._pendingGroundEffectLayers=[];let r,o=0,s=this._style._mergedLayers[t[o]];for(;!this._style.isLayerDraped(s)&&s.isHidden(this.painter.transform.zoom)&&++o<i;)s=this._style._mergedLayers[t[o]];for(;o<i;++o){const e=this._style._mergedLayers[t[o]];e.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(e)?void 0===r&&(r=o):("fill-extrusion"===e.type&&this._pendingGroundEffectLayers.push(o),void 0!==r&&(n.push({start:r,end:o-1}),r=void 0)))}if(void 0!==r&&n.push({start:r,end:o-1}),0!==n.length){const t=n.at(-1);this._pendingGroundEffectLayers.every(e=>e>t.end)||e.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=n}_setupRenderCache(e){const t=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,t.renderCache.length>t.renderCachePool.length){const e=Object.values(t.proxyCachedFBO);t.proxyCachedFBO={};for(let i=0;i<e.length;++i){const n=Object.values(e[i]);t.renderCachePool.push(...n)}}return}this._clearRasterLayersFromRenderCache();const i=this.proxyCoords,n=this._tilesDirty;for(let r=i.length-1;r>=0;r--){const o=i[r];if(t.getTileByID(o.key),void 0!==t.proxyCachedFBO[o.key]){const i=e[o.key],r=this.proxyToSource[o.key];let s=0;for(const e in r){const t=r[e],o=i[e];if(!o||o.length!==t.length||t.some((t,i)=>
vendor: 5,311 bytes, line 2
2t!==o[i]||n[e]&&Object.hasOwn(n[e],t.key))){s=-1;break}++s}for(const e in t.proxyCachedFBO[o.key])t.renderCache[t.proxyCachedFBO[o.key][e]].dirty=s<0||s!==Object.values(i).length}}const r=[...this._drapedRenderBatches];r.sort((e,t)=>t.end-t.start-(e.end-e.start));for(const e of r)for(const n of i){if(t.proxyCachedFBO[n.key])continue;let i=t.renderCachePool.pop();void 0===i&&t.renderCache.length<50&&(i=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==i&&(t.proxyCachedFBO[n.key]={},t.proxyCachedFBO[n.key][e.start]=i,t.renderCache[i].dirty=!0)}this._tilesDirty={}}_setupStencil(e,t,i,n){if(!n||!this._sourceTilesOverlap[n.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const r=this.painter.context,o=r.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let s;if(i.isTileClipped())s=t.length,this._overlapStencilMode.test={func:o.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>t.at(-1).overscaledZ))return void(this._overlapStencilType=!1);s=1,this._overlapStencilMode.test={func:o.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+s>255&&(r.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=s,this._overlapStencilMode.ref=this._stencilRef,i.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(t){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[t.key]),this._overlapStencilMode):e._.disabled}_renderTileClippingMasks(t,i){const n=this.painter,r=this.painter.context,o=r.gl;n._tileClippingMaskIDs={},r.setColorMode(e.a1.disabled),r.setDepthMode(e.Z.disabled);const s=n.getOrCreateProgram("clippingMask");for(const r of t){const t=n._tileClippingMaskIDs[r.key]=--i;s.draw(n,o.TRIANGLES,e.Z.disabled,new e._({func:o.ALWAYS,mask:0},t,255,o.KEEP,o.KEEP,o.REPLACE),e.a1.disabled,e.$.disabled,zn(r.projMatrix),"$clipping",n.tileExtentBuffer,n.quadTriangleIndexBuffer,n.tileExtentSegments)}}pointCoordinate(t){const i=this.painter.transform;if(t.x<0||t.x>i.width||t.y<0||t.y>i.height)return null;const n=[t.x,t.y,1,1];e.c6(n,n,i.pixelMatrixInverse),e.c7(n,n,1/n[3]),n[0]/=i.worldSize,n[1]/=i.worldSize;const r=i._camera.position,o=e.c4(1,i.center.lat),s=[r[0],r[1],r[2]/o,0],a=e.c8([],n.slice(0,3),s);e.c9(a,a);const l=this.raycast(s,a,this._exaggeration);return null!==l&&l?(e.ca(s,s,a,l),s[3]=s[2],s[2]*=o,s):null}_setupProxiedCoordsForOrtho(e,t,i){if(["image","video","canvas"].includes(e.getSource().type))return this._setupProxiedCoordsForImageSource(e,t,i);this._findCoveringTileCache[e.id]=this._findCoveringTileCache[e.id]||{};const n=this.proxiedCoords[e.id]=[],r=this.proxyCoords;for(let t=0;t<r.length;t++){const o=r[t],s=this._findTileCoveringTileID(o,e);if(s){const t=this._createProxiedId(o,s,i[o.key]&&i[o.key][e.id]);n.push(t),this.proxyToSource[o.key][e.id]=[t]}}let o=!1;const s=new Set;for(let r=0;r<t.length;r++){const a=e.getTile(t[r]);if(!a||!a.hasData())continue;const l=this._findTileCoveringTileID(a.tileID,this.proxySourceCache);if(l&&l.tileID.canonical.z!==a.tileID.canonical.z){const t=this.proxyToSource[l.tileID.key][e.id],r=this._createProxiedId(l.tileID,a,i[l.tileID.key]&&i[l.tileID.key][e.id]);t?t.splice(t.length-1,0,r):this.proxyToSource[l.tileID.key][e.id]=[r];const c=this.proxyToSource[l.tileID.key][e.id];s.has(c)||s.add(c),n.push(r),o=!0}}if(this._sourceTilesOverlap[e.id]=o,o)for(const e of s)e.sort((e,t)=>t.overscaledZ-e.overscaledZ)}_setupProxiedCoordsForImageSource(t,i,n){if(!t.getSource().loaded())return;const r=this.proxiedCoords[t.id]=[],o=this.proxyCoords,s=t.getSource(),a=s.tileID;if(!a)return;const l=new e.P(a.x,a.y)._div(1<<a.z),c=s.coordinates.map(e.bT.fromLngLat).reduce((e,t)=>(e.min.x=Math.min(e.min.x,t.x-l.x),e.min.y=Math.min(e.min.y,t.y-l.y),e.max.x=Math.max(e.max.x,t.x-l.x),e.max.y=Math.max(e.max.y,t.y-l.y),e),{min:new e.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),u=(t,i)=>{const n=t.wrap+t.canonical.x/(1<<t.canonical.z),r=t.canonical.y/(1<<t.canonical.z),o=e.a6/(1<<t.canonical.z),s=i.wrap+i.canonical.x/(1<<i.canonical.z),a=i.canonical.y/(1<<i.canonical.z);return n+o<s+c.min.x||n>s+c.max.x||r+o<a+c.min.y||r>a+c.max.y};for(let e=0;e<o.length;e++){const s=o[e];for(let e=0;e<i.length;e++){const o=t.getTile(i[e]);if(!o||!o.hasData())continue;if(u(s,o.tileID))continue;const a=this._createProxiedId(s,o,n[s.key]&&n[s.key][t.id]),l=this.proxyToSource[s.key][t.id];l?l.push(a):this.proxyToSource[s.key][t.id]=[a],r.push(a)}}}_createProxiedId(t,i,n){let r=this.orthoMatrix;if(n){const e=n.find(e=>e.key===i.tileID.key);if(e)return e}if(i.tileID.key!==t.key){const n=t.canonical.z-i.tileID.canonical.z;let o,s,a;r=e.Y();const l=i.tileID.wrap-t.wrap<<t.overscaledZ;n>0?(o=e.a6>>n,s=o*((i.tileID.canonical.x<<n)-t.canonical.x+l),a=o*((i.tileID.canonical.y<<n)-t.canonical.y)):(o=e.a6<<-n,s=e.a6*(i.tileID.canonical.x-(t.canonical.x+l<<-n)),a=e.a6*(i.tileID.canonical.y-(t.canonical.y<<-n))),e.bZ(r,0,o,0,o,0,1),e.bN(r,r,[s,a,0])}return new Gr(i.tileID,t.key,r)}_findTileCoveringTileID(t,i){let n=i.getTile(t);if(n&&n.hasData())return n;
vendor: 4,968 bytes, line 2
2const r=this._findCoveringTileCache[i.id],o=r[t.key];if(n=o?i.getTileByID(o):null,n&&n.hasData()||null===o)return n;let s=n?n.tileID:t,a=s.overscaledZ;const l=i.getSource().minzoom,c=[];if(!o){const r=i.getSource().maxzoom;if(t.canonical.z>=r){const n=t.canonical.z-r;i.getSource().reparseOverscaled?(a=Math.max(t.canonical.z+2,i.transform.tileZoom),s=new e.bQ(a,t.wrap,r,t.canonical.x>>n,t.canonical.y>>n)):0!==n&&(a=r,s=new e.bQ(a,t.wrap,r,t.canonical.x>>n,t.canonical.y>>n))}s.key!==t.key&&(c.push(s.key),n=i.getTile(s))}const u=e=>{c.forEach(t=>{r[t]=e}),c.length=0};for(a-=1;a>=l&&(!n||!n.hasData());a--){n&&u(n.tileID.key);const e=s.calculateScaledKey(a);if(n=i.getTileByID(e),n&&n.hasData())break;const t=r[e];if(null===t)break;void 0===t?c.push(e):n=i.getTileByID(t)}return u(n?n.tileID.key:null),n&&n.hasData()?n:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(e,t){let i=this._tilesDirty[e];i||(i=this._tilesDirty[e]={}),i[t.key]=!0}}let Zr=null;const qr=[];function Wr(e,t){return Zr?Zr.create(e,t):null}const Yr=(e,t,i)=>({u_matrix:e,u_emissive_strength:t,u_ground_shadow_factor:i,u_opacity_multiplier:1}),Xr=(t,i,n,r,o,s=0)=>Object.assign(Yr(t,i,o),e.cb(n,r,s)),Jr=(e,t,i,n)=>({u_matrix:e,u_world:i,u_emissive_strength:t,u_ground_shadow_factor:n,u_opacity_multiplier:1}),Kr=(e,t,i,n,r,o,s=0)=>Object.assign(Xr(e,t,i,n,o,s),{u_world:r}),Qr=(e,t,i)=>({u_image:e,u_texel_size:t,u_first_pass:i?1:0}),eo=e.Y(),to=(t,i,n,r,o,s,a)=>{const l=t.transform,c="globe"===l.projection.name,u=c?e.cc(l.zoom,i.canonical)*l._pixelsPerMercatorPixel:e.cd(n,1,s),h={u_matrix:i.projMatrix,u_extrude_scale:u,u_intensity:a,u_inv_rot_matrix:eo,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){h.u_inv_rot_matrix=r,h.u_merc_center=o,h.u_tile_id=[i.canonical.x,i.canonical.y,1<<i.canonical.z],h.u_zoom_transition=e.S(l.zoom);const t=o[0]*e.a6,n=o[1]*e.a6;h.u_up_dir=l.projection.upVector(new e.bW(0,0,0),t,n)}return h};function io(t){const i=t.terrain?t.terrain.exaggeration():1;return(t.transform.pitch<15?e.am(.07,.7,e.b1((14-t.transform.zoom)/5,0,1)):.07)*i}const no=(t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w)=>({u_matrix:i,u_normalize_matrix:n,u_globe_matrix:r,u_merc_matrix:o,u_grid_matrix:s,u_tl_parent:a,u_scale_parent:h,u_fade_t:d.mix,u_opacity:d.opacity*f.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:f.paint.get("raster-brightness-min"),u_brightness_high:f.paint.get("raster-brightness-max"),u_saturation_factor:e.cg(f.paint.get("raster-saturation")),u_contrast_factor:e.cf(f.paint.get("raster-contrast")),u_spin_weights:ro(f.paint.get("raster-hue-rotate")),u_perspective_transform:p,u_raster_elevation:m,u_zoom_transition:l,u_merc_center:c,u_cutoff_params:u,u_colorization_mix:Si(e.ce,g,v),u_colorization_offset:Ii(e.ce,y,v),u_color_ramp:_,u_color_ramp_size:e.ce,u_texture_offset:[b/(x+2*b),x/(x+2*b)],u_texture_res:[x+2*b,x+2*b],u_emissive_strength:w,u_zbias_factor:io(t)});function ro(e){e*=Math.PI/180;const t=Math.sin(e),i=Math.cos(e);return[(2*i+1)/3,(-Math.sqrt(3)*t-i+1)/3,(Math.sqrt(3)*t-i+1)/3]}const oo=e.Y(),so=(t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x,b,w,T,E,S)=>{const I=o.transform,A={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:I.getCameraToCenterDistance(x),u_rotate_symbol:+n,u_aspect_ratio:I.width/I.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:a,u_coord_matrix:l,u_is_text:+u,u_is_sdf:+h,u_elevation_from_sea:c?1:0,u_pitch_with_map:+r,u_texsize:d,u_texsize_icon:f,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:oo,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:oo,u_up_vector:[0,-1,0],u_color_adj_mat:T,u_icon_transition:E||0,u_gamma_scale:h?r?o.transform.getCameraToCenterDistance(x)*Math.cos(o.terrain?0:o.transform._pitch):1:0,u_device_pixel_ratio:e.e.devicePixelRatio,u_is_halo:1,u_scale_factor:S||1,u_ground_shadow_factor:b,u_inv_matrix:e.aP(e.Y(),a),u_normal_scale:w,u_lutTexture:e.ci.LUT,u_spp_fill_np_color:[0,0,0,1],u_spp_halo_np_color:[0,0,0,0],u_spp_opacity:1,u_spp_halo_width:0,u_spp_halo_blur:0,u_spp_emissive_strength:0,u_spp_occlusion_opacity:1,u_spp_z_offset:0,u_spp_translate_rotation:[1,0],u_spp_zoom_fraction:0,u_opacity_multiplier:1};return"globe"===x.name&&(A.u_tile_id=[m.canonical.x,m.canonical.y,1<<m.canonical.z],A.u_zoom_transition=_,A.u_inv_rot_matrix=y,A.u_merc_center=g,A.u_camera_forward=I._camera.forward(),A.u_ecef_origin=e.ch(I.globeMatrix,m.toUnwrapped()),A.u_tile_matrix=I.globeMatrix,A.u_up_vector=v),A},ao=(e,t,i,n)=>({u_matrix:e,u_emissive_strength:t,u_opacity:i,u_color:n}),lo=(t,i,n,r,o,s,a,l,c)=>Object.assign(e.cj(o,s,a,r,l,c),{u_matrix:t,u_emissive_strength:i,u_opacity:n}
2),co={fillExtrusion:e.cp,fillExtrusionPattern:e.co,fill:t=>({u_matrix:new e.a4(t),u_emissive_strength:new e.a3(t),u_ground_shadow_factor:new e.a5(t),u_opacity_multiplier:new e.a3(t)}),fillPattern:t=>({u_matrix:new e.a4(t),u_emissive_strength:new e.a3(t),u_image:new e.aY(t),u_texsize:new e.a2(t),u_pixel_coord_upper:new e.a2(t),u_pixel_coord_lower:new e.a2(t),u_tile_units_to_pixels:new e.a3(t),u_ground_shadow_factor:new e.a5(t),u_pattern_transition:new e.a3(t),u_opacity_multiplier:new e.a3(t)}),fillOutline:t=>({u_matrix:new e.a4(t),u_emissive_strength:new e.a3(t),u_world:new e.a2(t),u_ground_shadow_factor:new e.a5(t),u_opacity_multiplier:new e.a3(t)}),fillOutlinePattern:t=>({u_matrix:new e.a4(t),u_emissive_strength:new e.a3(t),u_world:new e.a2(t),u_image:new e.aY(t),u_texsize:new e.a2(t),u_pixel_coord_upper:new e.a2(t),u_pixel_coord_lower:new e.a2(t),u_tile_units_to_pixels:new e.a3(t),u_ground_shadow_factor:new e.a5(t),u_pattern_transition:new e.a3(t),u_opacity_multiplier:new e.a3(t)}),lineBlendComposite:t=>({u_image:new e.aY(t),u_opacity:new e.a3(t),u_blend_mode:new e.aY(t),u_max_density:new e.a3(t)}),lineBlendReduce:t=>({u_image:new e.aY(t),u_texel_size:new e.a2(t),u_first_pass:new e.aY(t)}),circle:e.cn,collisionBox:t=>({u_matrix:new e.a4(t),u_inv_rot_matrix:new e.a4(t),u_camera_to_center_distance:new e.a3(t),u_extrude_scale:new e.a2(t),u_zoom_transition:new e.a3(t),u_merc_center:new e.a2(t),u_tile_id:new e.a5(t)}),collisionCircle:t=>({u_matrix:new e.a4(t),u_inv_matrix:new e.a4(t),u_camera_to_center_distance:new e.a3(t),u_viewport_size:new e.a2(t)}),debug:e.cm,clippingMask:t=>({u_matrix:new e.a4(t)}),heatmap:t=>({u_extrude_scale:new e.a3(t),u_intensity:new e.a3(t),u_matrix:new e.a4(t),u_inv_rot_matrix:new e.a4(t),u_merc_center:new e.a2(t),u_tile_id:new e.a5(t),u_zoom_transition:new e.a3(t),u_up_dir:new e.a5(t)}),heatmapTexture:t=>({u_image:new e.aY(t),u_color_ramp:new e.aY(t),u_opacity:new e.a3(t)}),hillshade:t=>({u_matrix:new e.a4(t),u_image:new e.aY(t),u_latrange:new e.a2(t),u_light:new e.a2(t),u_shadow:new e.bY(t),u_highlight:new e.bY(t),u_emissive_strength:new e.a3(t),u_accent:new e.bY(t)}),hillshadePrepare:t=>({u_matrix:new e.a4(t),u_image:new e.aY(t),u_dimension:new e.a2(t),u_zoom:new e.a3(t)}),line:e.cl,linePattern:e.ck,raster:t=>({u_matrix:new e.a4(t),u_normalize_matrix:new e.a4(t),u_globe_matrix:new e.a4(t),u_merc_matrix:new e.a4(t),u_grid_matrix:new e.a_(t),u_tl_parent:new e.a2(t),u_scale_parent:new e.a3(t),u_fade_t:new e.a3(t),u_opacity:new e.a3(t),u_image0:new e.aY(t),u_image1:new e.aY(t),u_brightness_low:new e.a3(t),u_brightness_high:new e.a3(t),u_saturation_factor:new e.a3(t),u_contrast_factor:new e.a3(t),u_spin_weights:new e.a5(t),u_perspective_transform:new e.a2(t),u_raster_elevation:new e.a3(t),u_zoom_transition:new e.a3(t),u_merc_center:new e.a2(t),u_cutoff_params:new e.aZ(t),u_colorization_mix:new e.aZ(t),u_colorization_offset:new e.a3(t),u_color_ramp:new e.aY(t),u_color_ramp_size:new e.a3(t),u_texture_offset:new e.a2(t),u_texture_res:new e.a2(t),u_emissive_strength:new e.a3(t),u_zbias_factor:new e.a3(t)}),symbol:t=>({u_is_size_zoom_constant:new e.aY(t),u_is_size_feature_constant:new e.aY(t),u_size_t:new e.a3(t),u_size:new e.a3(t),u_camera_to_center_distance:new e.a3(t),u_rotate_symbol:new e.aY(t),u_aspect_ratio:new e.a3(t),u_fade_change:new e.a3(t),u_matrix:new e.a4(t),u_label_plane_matrix:new e.a4(t),u_coord_matrix:new e.a4(t),u_is_text:new e.aY(t),u_is_sdf:new e.aY(t),u_elevation_from_sea:new e.aY(t),u_pitch_with_map:new e.aY(t),u_texsize:new e.a2(t),u_texsize_icon:new e.a2(t),u_texture:new e.aY(t),u_texture_icon:new e.aY(t),u_gamma_scale:new e.a3(t),u_device_pixel_ratio:new e.a3(t),u_tile_id:new e.a5(t),u_zoom_transition:new e.a3(t),u_inv_rot_matrix:new e.a4(t),u_merc_center:new e.a2(t),u_camera_forward:new e.a5(t),u_tile_matrix:new e.a4(t),u_up_vector:new e.a5(t),u_ecef_origin:new e.a5(t),u_is_halo:new e.aY(t),u_icon_transition:new e.a3(t),u_color_adj_mat:new e.a4(t),u_scale_factor:new e.a3(t),u_ground_shadow_factor:new e.a5(t),u_inv_matrix:new e.a4(t),u_normal_scale:new e.a3(t),u_lutTexture:new e.aY(t),u_spp_fill_np_color:new e.aZ(t),u_spp_halo_np_color:new e.aZ(t),u_spp_opacity:new e.a3(t),u_spp_halo_width:new e.a3(t),u_spp_halo_blur:new e.a3(t),u_spp_emissive_strength:new e.a3(t),u_spp_occlusion_opacity:new e.a3(t),u_spp_z_offset:new e.a3(t),u_spp_translate_rotation:new e.a2(t),u_spp_zoom_fraction:new e.a3(t),u_opacity_multiplier:new e.a3(t)}),background:t=>({u_matrix:new e.a4(t),u_emissive_strength:new e.a3(t),u_opacity:new e.a3(t),u_color:new e.bY(t)}),backgroundPattern:t=>({u_matrix:new e.a4(t),u_emissive_strength:new e.a3(t),u_opacity:new e.a3(t),u_image:new e.aY(t),u_pattern_tl:new e.a2(t),u_pattern_br:new e.a2(t),u_texsize:new e.a2(t),u_pattern_size:new e.a2(t),u_pixel_coord_upper:new e.a2(t),u_pixel_coord_lower:new e.a2(t),u_pattern_units_to_pixels:new e.a2(t)}),skybox:t=>({u_matrix:new e.a4(t),u_sun_direction:new e.a5(t),u_cubemap:new e.aY(t),u_opacity:new e.a3(t),u_temporal_offset:new e.a3(t)}),skyboxGradient:t=>({u_matrix:new e.a4(t),u_color_ramp:new e.aY(t),u_center_direction:new e.a5(t),u_radius:new e.a3(t),u_opacity:new e.a3(t),u_temporal_offset:new e.a3(t)}),skyboxCapture:t=>({u_matrix_3f:new e.a_(t),u_sun_direction:new e.a5(t),u_sun_intensity:new e.a3(t),u_color_tint_r:new e.aZ(t),u_color_tint_m:new e.aZ(t),u_luminance:new e.a3(t)}),globeAtmosphere:t=>({u_frustum_tl:new e.a5(t),u_frustum_tr:new e.a5(t),u_frustum_br:new e.a5(t),u_frustum_bl:new e.a5(t),u_horizon:new e.a3(t),u_transition:new e.a3(t),u_fadeout_range:new e.a3(t),u_atmosphere_fog_color:new e.aZ(t),u_high_color:new e.aZ(t),u_space_color:new e.aZ(t),u_temporal_offset:new e.a3(t),u_horizon_angle:new e.a3(t)}),stars:t=>({u_matrix:new e.a4(t),u_up:new e.a5(t),u_right:new e.a5(t),u_intensity_multiplier:new e.a3(t)}),occlusion:t=>({u_matrix:new e.a4(t),u_anchorPos:new e.a5(t),u_screenSizePx:new e.a2(t),u_occluderSizePx:new e.a2(t),u_color:new e.aZ(t)})};var uo={terrainRaster:e.bc('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nuniform sampler2D u_image1;uniform float u_emissive_texture_available;\n#endif\nin vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nvec3 unlit_base;vec3 emissive_base;\n#ifdef USE_MRT1_RGBA\nvec4 emissive_premult=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0) : vec4(0.0);unlit_base=image_color.rgb-emissive_premult.rgb;emissive_base=emissive_premult.rgb;\n#else\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;unlit_base=image_color.rgb*(1.0-emissive_strength);emissive_base=image_color.rgb*emissive_strength;\n#endif\nfloat ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\n#ifdef USE_MRT1_RGBA\nvec4 emissive_premult=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0) : vec4(0.0);vec3 unlit_base=image_color.rgb-emissive_premult.rgb;color.rgb=apply_lighting(unlit_base,normal,lighting_factor)+emissive_premult.rgb;color.a=1.0;\n#else\ncolor=apply_lighting(image_color,normal,lighting_factor);float emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;color.rgb=mix(color.rgb,image_color.rgb,emissive_strength);color.a=1.0;\n#endif\n#else\ncolor=apply_lighting(image_color,normal,lighting_factor);\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);
2\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in ivec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);\n#endif\n}'),terrainDepth:e.bc("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in ivec2 a_pos;out float v_depth;void main() {float elevation=elevation(vec2(a_pos));gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),globeRaster:e.bc('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nuniform sampler2D u_image1;uniform float u_emissive_texture_available;\n#endif\nuniform float u_far_z_cutoff;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nhighp vec2 uv=gl_FragCoord.xy/u_viewport;FLIP_VIEWPORT_UV_Y(uv);highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\n#ifdef USE_MRT1_RGBA\nvec4 emissive_premult=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0) : vec4(0.0);vec3 unlit_base=raster.rgb-emissive_premult.rgb;raster.rgb=apply_lighting_ground(vec4(unlit_base,1.0)).rgb+emissive_premult.rgb;color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias);\n#else\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : raster.a;raster=apply_lighting_with_emission_ground(raster,emissive_strength);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias);\n#endif\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS \n#ifdef USE_MRT1_RGBA\nvec4 emissive_premult=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0) : vec4(0.0);vec3 unlit_base=color.rgb-emissive_premult.rgb;color.rgb=apply_lighting_ground(vec4(unlit_base,1.0)).rgb+emissive_premult.rgb;color.a=1.0;\n#else\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : color.a;color=apply_lighting_with_emission_ground(color,emissive_strength);color.a=1.0;\n#endif\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;\n#ifndef GLOBE_POLES\nuniform mat4 u_merc_matrix;\n#endif\nuniform float u_zoom_transition;uniform vec2 u_merc_center;\n#ifndef GLOBE_POLES\nuniform mat3 u_grid_matrix;\n#endif\nuniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin ivec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}')};!function(e){Zr=e;for(const e of qr.splice(0))e()}({create:(e,t)=>
vendor: 9,456 bytes, line 2
2new Hr(e,t)}),Object.assign(co,{terrainRaster:t=>({u_matrix:new e.a4(t),u_image0:new e.aY(t),u_image1:new e.aY(t),u_skirt_height:new e.a3(t),u_ground_shadow_factor:new e.a5(t),u_emissive_texture_available:new e.a3(t)}),globeRaster:t=>({u_proj_matrix:new e.a4(t),u_globe_matrix:new e.a4(t),u_normalize_matrix:new e.a4(t),u_merc_matrix:new e.a4(t),u_zoom_transition:new e.a3(t),u_merc_center:new e.a2(t),u_image0:new e.aY(t),u_image1:new e.aY(t),u_grid_matrix:new e.a_(t),u_skirt_height:new e.a3(t),u_far_z_cutoff:new e.a3(t),u_frustum_tl:new e.a5(t),u_frustum_tr:new e.a5(t),u_frustum_br:new e.a5(t),u_frustum_bl:new e.a5(t),u_globe_pos:new e.a5(t),u_globe_radius:new e.a3(t),u_viewport:new e.a2(t),u_emissive_texture_available:new e.a3(t)})});const ho={shaders:uo};class fo{constructor(e,t,i){this.screenBounds=e,this.cameraPoint=i.getCameraPoint(),this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=t,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,i)}static createFromScreenPoints(t,i){let n,r;if(t instanceof e.P||"number"==typeof t[0]){const o=e.P.convert(t);n=[o],r=i.isPointAboveHorizon(o)}else{const o=e.P.convert(t[0]),s=e.P.convert(t[1]),a=o.add(s)._div(2);n=[o,s],r=e.cq(o,s).every(e=>i.isPointAboveHorizon(e))&&i.isPointAboveHorizon(a)}return new fo(n,r,i)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return e.cq(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],r=e.cq(i,n,0,!1);return this.cameraPoint.y>n.y&&(this.cameraPoint.x>i.x&&this.cameraPoint.x<n.x?r.splice(3,0,this.cameraPoint):this.cameraPoint.x>=n.x?r[2]=this.cameraPoint:this.cameraPoint.x<=i.x&&(r[3]=this.cameraPoint)),e.cr(r,t)}bufferedCameraGeometryGlobe(t){const i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],r=e.cq(i,n,t),o=this.cameraPoint.clone(),s=Number(o.x>i.x)+Number(o.x>n.x);switch(3*(Number(o.y>i.y)+Number(o.y>n.y))+s){case 0:r[0]=o,r[4]=o.clone();break;case 1:r.splice(1,0,o);break;case 2:r[1]=o;break;case 3:r.splice(4,0,o);break;case 5:r.splice(2,0,o);break;case 6:r[3]=o;break;case 7:r.splice(3,0,o);break;case 8:r[2]=o}return r}containsTile(t,i,n,r=0,o){const s=Math.max(t.queryPadding,t.evaluateQueryRenderedFeaturePadding())/i._pixelsPerMercatorPixel+1,a=n?this._bufferedCameraMercator(s,i):this._bufferedScreenMercator(s,i);let l=t.tileID.wrap+(a.unwrapped?r:0);const c=a.polygon.map(i=>e.cs(t.tileTransform,i,l));if(!e.ct(c,0,0,e.a6,e.a6))return;l=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?r:0);const u=this.screenGeometryMercator.polygon.map(i=>e.cu(t.tileTransform,i,l)),h=u.map(t=>new e.P(t[0],t[1])),d=e.cu(t.tileTransform,o,l),f=u.map(t=>{const i=e.cv(t,t,d);return e.c9(i,i),new e.cw(d,i)}),p=e.cd(t,1,i.zoom)*i._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:h,tilespaceRays:f,bufferedTilespaceGeometry:c,bufferedTilespaceBounds:(m=e.cx(c),m.min.x=e.b1(m.min.x,0,e.a6),m.min.y=e.b1(m.min.y,0,e.a6),m.max.x=e.b1(m.max.x,0,e.a6),m.max.y=e.b1(m.max.y,0,e.a6),m),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:p};var m}_bufferedScreenMercator(e,t){const i=_o(e);if(this._screenRaycastCache[i])return this._screenRaycastCache[i];{let n;return n="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map(e=>t.pointCoordinate3D(e)),unwrapped:!0},this._screenRaycastCache[i]=n,n}}_bufferedCameraMercator(e,t){const i=_o(e);if(this._cameraRaycastCache[i])return this._cameraRaycastCache[i];{let n;return n="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map(e=>t.pointCoordinate3D(e)),unwrapped:!0},this._cameraRaycastCache[i]=n,n}}_projectAndResample(t,i){const n=function(t,i){const n=e.X([],i.pixelMatrix,i.globeMatrix),r=[0,-e.cy,0,1],o=[0,e.cy,0,1],s=[0,0,0,1];e.c6(r,r,n),e.c6(o,o,n),e.c6(s,s,n);const a=new e.P(r[0]/r[3],r[1]/r[3]),l=new e.P(o[0]/o[3],o[1]/o[3]),c=e.cz(t,a)&&r[3]<s[3],u=e.cz(t,l)&&o[3]<s[3];if(!c&&!u)return null;const h=function(e,t,i){for(let n=1;n<e.length;n++){const r=mo(t.pointCoordinate3D(e[n-1]).x),o=mo(t.pointCoordinate3D(e[n]).x);if(i<0){if(r<o)return{idx:n,t:-r/(o-1-r)}}else if(o<r)return{idx:n,t:(1-r)/(o+1-r)}}return null}(t,i,c?-1:1);if(!h)return null;const{idx:d,t:f}=h;let p=d>1?po(t.slice(0,d),i):[],m=d<t.length?po(t.slice(d),i):[];p=p.map(t=>new e.P(mo(t.x),t.y)),m=m.map(t=>new e.P(mo(t.x),t.y));const _=[...p];0===_.length&&_.push(m.at(-1));const g=_.at(-1),y=e.am(g.y,(0===m.length?p[0]:m[0]).y,f);let v;return v=c?[new e.P(0,y),new e.P(0,0),new e.P(1,0),new e.P(1,y)]:[new e.P(1,y),new e.P(1,1),new e.P(0,1),new e.P(0,y)],_.push(...v),0===m.length?_.push(p[0]):_.push(...m),{polygon:_.map(t=>new e.bT(t.x,t.y)),unwrapped:!1}}(t,i);if(n)return n;const r=function(t,i){let n=!1,r=-1/0,o=0;for(let e=0;e<t.length-1;e++)t[e].x>r&&(r=t[e].x,o=e);for(let e=0;e<t.length-1;e++){const i=(o+e)%(t.length-1),r=t[i],s=t[i+1];Math.abs(r.x-s.x)>.5&&(r.x<s.x?(r.x+=1,0===i&&(t.at(-1).x+=1)):(s.x+=1,i+1===t.length-1&&(t[0].x+=1)),n=!0)}const s=e.a7(i.center.lng);return n&&s<Math.abs(s-1)&&t.forEach(e=>{e.x-=1}),{polygon:t,unwrapped:n}}(po(t,i).map(t=>new e.P(mo(t.x),t.y)),i);return{polygon:r.polygon.map(t=>new e.bT(t.x,t.y)),unwrapped:r.unwrapped}}}function po(t,i){return e.cA(t,e=>{const t=i.pointCoordinate3D(e);e.x=t.x,e.y=t.y},1/256)}function mo(e){return e<0?1+e%1:e%1}function _o(e){return 100*e|0}class go extends e.E{constructor(t,i,n,r){super(),this.id=t,this.dispatcher=n,this.setEventedParent(r),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options={type:"raster",...i},Object.assign(this,e.cB(i,["url","scheme","tileSize"]))}load(t){this._loaded=!1,this.fire(new e.h("dataloading",{dataType:"source"}));const i=this.map.getWorldview(),n=(i,n)=>{this._tileJSONRequest=null,this._loaded=!0,i?this.fire(new e.f(i)):n&&(Object.assign(this,n),n.raster_layers&&(this.rasterLayers=n.raster_layers,this.rasterLayerIds=this.rasterLayers.map(e=>e.id)),this.tileBounds=e.cF.fromTileJSON(n),e.cK(n.tiles),this.fire(new e.h("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.h("data",{dataType:"source",sourceDataType:"content"}))),t&&t(i)};this.provider="string"==typeof this._options.provider?this._options.provider:void 0,this._tileProvider=void 0;const r=e.cD(this._options);return r instanceof Error?(this._loaded=!0,this.fire(new e.f(r)),void(t&&t())):this.provider&&!r?(this._loaded=!0,this.fire(new e.f(new Error(`TileProvider "${this.provider}" is not registered`))),void(t&&t())):void(this._tileJSONRequest=r?this.loadTileJSONWithProvider(r,n):e.cE(this._options,this.map._requestManager,null,i,n))}loadTileJSONWithProvider(t,i){this.provider=t.name;const n=new AbortController;return(async()=>{const{request:r,options:o}=await e.cL(this._options,this.map._requestManager,n.signal);if(n.signal.aborted)return;const s=await e.cN(t.name,t.url);if(n.signal.aborted)return;const a=new s(o);let l=null;if(a.load&&r&&(l=await a.load({request:r}),n.signal.aborted))return;this._tileProvider=a;const c=e.cM(this._options,l,this.map._requestManager);c instanceof Error?i(c):i(null,c)})().catch(e=>{n.signal.aborted||i(new Error(`Could not load tile provider ${t.name}`,{cause:e}))}),{cancel:()=>n.abort()}}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.m(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return{...this._options}}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}async loadTile(t,i){const n=e.e.devicePixelRatio>=2,r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),n,this.tileSize),o=new AbortController;if(t.request=o,this._tileProvider)this.loadTileWithProvider(t,this._tileProvider,r,o,i);else try{const n=await this.map._requestManager.transformRequest(r,e.R.Tile,o.signal);if(o.signal.aborted)return delete t.request,i(null);const{data:s,headers:a}=await e.a(n,o.signal);if(delete t.request,t.aborted)return i(null);const l=e.cI(a);this.map._refreshExpiredTiles&&t.setExpiryData(l),t.setTexture(s,this.map.painter),t.state="loaded",e.cJ(this.dispatcher),i(null)}catch(e){if(delete t.request,o.signal.aborted)return i(null);t.state="errored",i(e)}}async loadTileWithProvider(t,i,n,r,o){const{z:s,x:a,y:l}=t.tileID.canonical;try{const c=await this.map._requestManager.transformRequest(n,e.R.Tile,r.signal);if(r.signal.aborted)return o(null);const u=await i.loadTile({z:s,x:a,y:l},{request:c,signal:r.signal});if(r.signal.aborted)return o(null);if(null==u){const e=new Error("Tile not found");return e.status=404,t.state="errored",o(e)}if(null==u.data)return t.state="loaded",o(null);const h=u.data instanceof ImageBitmap?u.data:await createImageBitmap(new Blob([u.data]));if(r.signal.aborted)return o(null);t.setTexture(h,this.map.painter),t.state="loaded",this.map._refreshExpiredTiles&&t.setExpiryData({cac
vendor: 11,144 bytes, line 2
2heControl:u.cacheControl,expires:u.expires}),o(null)}catch(e){if(r.signal.aborted)return o(null);t.state="errored",o(new Error(`Could not load tile from ${n}`,{cause:e}))}finally{delete t.request}}abortTile(e,t){e.request&&(e.request.abort(),delete e.request),t&&t()}unloadTile(t,i){t.texture&&t.texture instanceof e.T?(t.destroy(!1),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),i&&i()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function yo(t,i,n,r,o,s,a,l){const c=[t,i,1,n,r,1,o,s,1],u=[a,l,1],h=e.cU([],c),[d,f,p]=e.cT(u,u,h);return e.cV(c,c,[d,0,0,0,f,0,0,0,p])}function vo(t,i,n,r,o,s,a,l){const c=function(t,i,n,r,o,s,a,l){const c=yo(0,0,1,0,1,1,0,1),u=yo(t,i,n,r,o,s,a,l),h=e.cU([],c);return e.cV(u,u,h)}(t,i,n,r,o,s,a,l);return[c[2]/c[8]/e.a6,c[5]/c[8]/e.a6]}function xo(t){return[t[0],Math.min(Math.max(t[1],-e.cP),e.cP)]}class bo extends e.E{constructor(e,t,i,n){super(),this.id=e,this.dispatcher=i,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(n),this.options=t,this._dirty=!1}async load(t,i){if(this._loaded=i||!1,this.fire(new e.h("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return t&&(this.coordinates=t),this._loaded=!0,void this._finishLoading();const n=new AbortController;this._imageRequest=n;try{const i=await this.map._requestManager.transformRequest(this.url,e.R.Image,n.signal),{data:r}=await e.a(i,n.signal);this._imageRequest=null,this._loaded=!0,this.image=r,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,t&&(this.coordinates=t),this._finishLoading()}catch(t){if(n.signal.aborted)return;this._imageRequest=null,this._loaded=!0,this.fire(new e.f(t))}}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.abort(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}setTexture(t){if(!(t.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new e.cO(this.map.painter.context,t.handle),this.width=t.dimensions[0],this.height=t.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.h("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(t){this._imageRequest&&(this._imageRequest.abort(),this._imageRequest=null),!this.texture||this.texture instanceof e.cO||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(t){if(this.coordinates=t,this._boundsArray=void 0,this._unsupportedCoords=!1,!t.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let i=t[0][1],n=t[0][1];for(const e of t)e[1]>n&&(n=e[1]),e[1]<i&&(i=e[1]);const r=(n+i)/2;if(r>e.cP?this.onNorthPole=!0:r<-e.cP&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const i=t.map(e.bT.fromLngLat);this.tileID=function(t){let i=1/0,n=1/0,r=-1/0,o=-1/0;for(const e of t)i=Math.min(i,e.x),n=Math.min(n,e.y),r=Math.max(r,e.x),o=Math.max(o,e.y);const s=Math.max(r-i,o-n),a=Math.max(0,Math.floor(-Math.log2(s))),l=Math.pow(2,a);let c=Math.floor((i+r)/2*l);return c>1&&(c-=1),new e.bW(a,c,Math.floor((n+o)/2*l))}(i),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new e.h("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){!this.texture||this.texture instanceof e.cO||(this.texture.destroy(),this._dirty=!0),this.texture=null,this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(t){for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const i=e.bq(new e.bW(0,0,0),this.map.transform.projection),n=[i.projection.project(this.coordinates[0][0],this.coordinates[0][1]),i.projection.project(this.coordinates[1][0],this.coordinates[1][1]),i.projection.project(this.coordinates[2][0],this.coordinates[2][1]),i.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(e){const t=e[1].x-e[0].x,i=e[1].y-e[0].y,n=e[2].x-e[1].x,r=e[2].y-e[1].y,o=e[3].x-e[2].x,s=e[3].y-e[2].y,a=e[0].x-e[3].x,l=e[0].y-e[3].y,c=t*r-n*i,u=n*s-o*r,h=o*l-a*s,d=a*i-t*l;return c>0&&u>0&&h>0&&d>0||c<0&&u<0&&h<0&&d<0}(n))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const r=e.bq(this.tileID,this.map.transform.projection),[o,s,a,l]=this.coordinates.map(t=>{const i=r.projection.project(t[0],t[1]);return e.cs(r,i)._round()});this.perspectiveTransform=vo(o.x,o.y,s.x,s.y,a.x,a.y,l.x,l.y);const c=this._boundsArray=new e.bt;c.emplaceBack(o.x,o.y,0,0),c.emplaceBack(s.x,s.y,e.a6,0),c.emplaceBack(l.x,l.y,0,e.a6),c.emplaceBack(a.x,a.y,e.a6,e.a6),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=t.createVertexBuffer(c,ln.members),this.boundsSegments=e.ad.simpleSegment(0,0,4,2);const u=e.cS,h=u+1,d=u+1,f=h*d,p=u*u*2,m=[],_=function(e){return[xo(e[0]),xo(e[1]),xo(e[2]),xo(e[3])]}(this.coordinates),[g,y,v,x]=function(e){let t=e[0][0],i=t,n=e[0][1],r=n;for(let o=1;o<e.length;o++)e[o][0]<t?t=e[o][0]:e[o][0]>i&&(i=e[o][0]),e[o][1]<n?n=e[o][1]:e[o][1]>r&&(r=e[o][1]);return[t,n,i-t,r-n]}(_);{const r=new e.bt,[o,s,a,l]=function(e){let t=e[0].x,i=t,n=e[0].y,r=n;for(let o=1;o<e.length;o++)e[o].x<t?t=e[o].x:e[o].x>i&&(i=e[o].x),e[o].y<n?n=e[o].y:e[o].y>r&&(r=e[o].y);return[t,n,i-t,r-n]}(n),c=e=>[(e.x-o)/a,(e.y-s)/l],[f,p,_,b]=n.map(c),w=function(t,i,n,r,o,s,a,l){const c=yo(0,0,1,0,1,1,0,1),u=yo(t,i,n,r,o,s,a,l),h=e.cU([],u);return e.cV(c,c,h)}(f[0],f[1],p[0],p[1],_[0],_[1],b[0],b[1]);this.elevatedGlobePerspectiveTransform=vo(f[0],f[1],p[0],p[1],_[0],_[1],b[0],b[1]);const T=(t,i)=>{m.push(t.lng);const n=Math.round((t.lng-g)/v*e.a6),o=Math.round((t.lat-y)/x*e.a6),s=c(i),a=e.cT([],[s[0],s[1],1],w),l=Math.round(a[0]/a[2]*e.a6),u=Math.round(a[1]/a[2]*e.a6);r.emplaceBack(n,o,l,u)},E=n[3].x-n[0].x,S=n[3].y-n[0].y,I=n[2].x-n[1].x,A=n[2].y-n[1].y;for(let e=0;e<d;e++){const t=e/u,r=[n[0].x+t*E,n[0].y+t*S],o=[n[1].x+t*I,n[1].y+t*A],s=o[0]-r[0],a=o[1]-r[1];for(let e=0;e<h;e++){const t=e/u,n={x:r[0]+s*t,y:r[1]+a*t};T(i.projection.unproject(n.x,n.y),n)}}this.elevatedGlobeVertexBuffer=t.createVertexBuffer(r,ln.members)}{this.maxLongitudeTriangleSize=0;let i=[],n=new e.ae;const r=(e,t,r)=>{n.emplaceBack(e,t,r);const o=m[e],s=m[t],a=m[r],l=Math.min(Math.min(o,s),a),c=Math.max(Math.max(o,s),a)-l;c>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=c),i.push(l+c/2)};for(let e=0;e<u;e++)for(let t=0;t<u;t++){const i=e*h+t,n=i+1,o=i+h,s=o+1;r(i,o,n),r(n,o,s)}[i,n]=function(t,i){const n=Array.from({length:t.length},(e,t)=>t);n.sort((e,i)=>t[e]-t[i]);const r=[],o=new e.ae;for(let e=0;e<n.length;e++){const s=n[e];r.push(t[s]);const a=3*s,l=a+1;o.emplaceBack(i.uint16[a],i.uint16[l],i.uint16[l+1])}return[r,o]}(i,n),this.elevatedGlobeTrianglesCenterLongitudes=i,this.elevatedGlobeIndexBuffer=t.createIndexBuffer(n)}this.elevatedGlobeSegments=e.ad.simpleSegment(0,0,f,p),this.elevatedGlobeGridMatrix=new Float32Array([0,v/e.a6,0,x/e.a6,0,0,y,g,0])}prepare(){const t=0!==Object.keys(this.tiles).length;if(this.tileID&&!t)return;const i=this.map.painter.context,n=i.gl;!this._dirty||this.texture instanceof e.cO||(this.texture?this.texture.update(this.image):(this.texture=new e.T(i,this.image,n.RGBA8),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this._dirty=!1),t&&this._prepareData(i)}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(t){const i=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!i)return null;const n=this.elevatedGlobeTrianglesCenterLongitudes;let r=(o=t+180)+360*Math.round((n[0]-o)/360);var o;const s=new e.ad,a=(e,t)=>{s.segments.push({vertexOffset:0,primitiveOffset:e,vertexLength:i.segments[0].vertexLength,primitiveLength:t,sortKey:void 0,vaos:{}})},l=.51*this.maxLongitudeTriangleSize;if(Math.abs(n[0]-r)<=l){const t=e.cQ(n,0,n.length,r+l);return t===n.length||a(t,e.cR(n,t+1,n.length,r+360-l)-t),s}r<n[0]&&(r+=360);const c=e.cR(n,0,n.length,r-l);if(c===n.length)return a(0,n.length),s;a(0,c-0);const u=e.cQ(n,c+1,n.length,r+l);return u!==n.length&&a(u,n.length-u),s}}const wo={vector:class extends e.E{constructor(t,i,n,r){if(super(),this.id=t,this.dispatcher=n,this.type="vector",this.provider=i.provider,this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,Object.assign(this,e.cB(i,["url","scheme","tileSize","promoteId"])),this._options={type:"vector",...i},this._collectResourceTiming=!!i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r),this._tileWorkers={},this._deduped=new e.cC}load(t){this._loaded=!1,this.fire(new e.h("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map.getWorldview(),r=(r,o)=>{this._tileJSONRequest=null,this._loaded=!0,r?(i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),n&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${n}`),this.fire(new e.f(r))):o&&(this._setTileJSON(o),$n.updateCrossSourceElevationGate&&this.map.style&&$n.updateCrossSourceElevationGate(this.map.style),e.cK(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.h("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.h("data",{dataType:"source",sourceDataType:"content"}))),t&&t(r)};this.provider=this._options.provider;const o=e.cD(this._options);return o instanceof Error?(this._loaded=!0,this.fire(new e.f(o)),void(t&&t())):this.provider&&!o?(this._loaded=!0,this.fire(new e.f(new Error(`TileProvider "${this.provider}" is not registered`))),void(t&&t())):void(this._tileJSONRequest=o?this.loadTileJSONWithProvider(o,r):e.cE(this._options,this.map._requestManager,i,n,r))}loadTileJSONWithProvider(t,i){this.provider=t.name;const n=new AbortController;return(async()=>{const{request:r,options:o}=await e.cL(this._options,this.map._requestManager,n.signal);if(n.signal.aborted)return;const s=await this.dispatcher.send("loadTileProvider",{name:t.name,url:t.url,source:this.id,scope:this.scope,type:this.t
vendor: 4,411 bytes, line 2
2ype,options:o,request:r},{signal:n.signal});if(n.signal.aborted)return;const a=s?s.find(e=>null!=e):null,l=e.cM(this._options,a,this.map._requestManager);l instanceof Error?i(l):i(null,l)})().catch(e=>{n.signal.aborted||i(e)}),{cancel:()=>n.abort()}}_setTileJSON(t){if(Object.assign(this,t),this.hasWorldviews=!!t.worldview_options,t.worldview_default&&(this.worldviewDefault=t.worldview_default),t.vector_layers){this.vectorLayers=t.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const e of t.vector_layers)this.vectorLayerIds.push(e.id),t.worldview&&t.worldview[e.source]&&this.localizableLayerIds.add(e.id)}this.tileBounds=e.cF.fromTileJSON(t)}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.m(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return{...this._options}}async loadTile(t,i){const n=t.tileID.canonical.url(this.tiles,this.scheme),r=this.map._requestManager.normalizeTileURL(n),o=!t.actor||"expired"===t.state;if(!o&&"loading"===t.state)return void(t.reloadCallback=i);o&&(t.actor=this._tileWorkers[r]=this._tileWorkers[r]||this.dispatcher.getActor());const s=new AbortController;t.request=s;try{const a=await this.map._requestManager.transformRequest(r,e.R.Tile,s.signal);if(s.signal.aborted)return i(null);this.dispatchTile(t,r,n,a,s,o,i)}catch(e){if(s.signal.aborted)return i(null);i(e)}}dispatchTile(t,i,n,r,o,s,a){const l=this.map.style?this.map.style.getLut(this.scope):null,c=l?{image:l.image.clone()}:null,u=!(!this.map.style||!this.map.style._crossSourceElevationActive),h=!(!this.map.style||!u),d={request:r,data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,lut:c,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,pixelRatio:e.e.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,showElevationIdDebug:!!this.map.painter&&this.map.painter._debugParams.showElevationIdDebug,promoteId:this.promoteId,renderSourceType:t.renderSourceType,frcCoverage:(()=>{const e=this.map.painter,i=e?e.frcCoverageFadeRange:null;if(null==i)return null;const n=e?e.frcCoverageSnapshot:null,r=this.map.transform.zoom<i[0],o=n?n.getTileOrParent(t.tileID.canonical):null,s=t.tileID.overscaledZ>=Math.ceil(i[1]),a=n&&s?n.getFullCoverageMask(t.tileID.canonical):null;return{frcMask:s?a??null:null,resolved:r||null!=n,polygons:o&&0!==o.frcMask?o.polygons:null,tileZoom:o&&0!==o.frcMask?o.tileId.z:null,sourceLayers:e?e.frcCoverageSourceLayers:["road","structure"]}})(),terrainEnabled:Vt(this.map.style,this.map.transform),crossSourceElevationEnabled:h,elevation:$n.buildElevationRequestParams?$n.buildElevationRequestParams(this.map,t,u):null,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor(),worldview:this.map.getWorldview()||this.worldviewDefault,indoor:this.map.getIndoorTileOptions(this.id,this.scope)};if(this.hasWorldviews&&e.cG(n)&&(d.localizableLayerIds=this.localizableLayerIds),d.request.collectResourceTiming=this._collectResourceTiming,s)if(this.dispatcher.ready||this.provider)t.request=t.actor.sendCancelable("loadTile",d,{},f.bind(this));else{const i=e.cH.call({deduped:this._deduped},d,(e,i)=>{t.aborted||(e||!i?f.call(this,e):(d.data={rawData:i.rawData.slice(0),headers:i.headers},t.actor&&(t.request=t.actor.sendCancelable("loadTile",d,{},f.bind(this)))))},!0);o.signal.addEventListener("abort",i,{once:!0})}else t.request=t.actor.sendCancelable("reloadTile",d,{},f.bind(this));function f(i,n){return delete t.request,t.aborted?a(null):i?a(i):(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&n&&t.setExpiryData(e.cI(n.headers)),void function(){if(t.aborted)return a(null);t.loadVectorData(n,this.map.painter),e.cJ(this.dispatcher),a(null,n),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)}.call(this))}}abortTile(e){e.request&&(e.request.abort(),delete e.request),e.actor&&e.actor.notify("abortTile",{uid:e.uid,type:this.t
vendor: 1,563 bytes, line 2
2ype,source:this.id,scope:this.scope})}unloadTile(e,t){e.actor&&e.actor.notify("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}},raster:go,"raster-dem":class extends go{constructor(e,t,i,n){super(e,t,i,n),this.type="raster-dem",this.maxzoom=22,this._options={type:"raster-dem",...t},this.encoding=t.encoding||"mapbox"}loadTileJSONWithProvider(t,i){this.provider=t.name;const n=new AbortController;return(async()=>{const{request:r,options:o}=await e.cL(this._options,this.map._requestManager,n.signal);if(n.signal.aborted)return;const s=await this.dispatcher.send("loadTileProvider",{name:t.name,url:t.url,source:this.id,scope:this.scope,type:this.type,options:o,request:r},{signal:n.signal});if(n.signal.aborted)return;const a=s?s.find(e=>null!=e):null,l=e.cM(this._options,a,this.map._requestManager);l instanceof Error?i(l):i(null,l)})().catch(e=>{n.signal.aborted||i(e)}),{cancel:()=>n.abort()}}async loadTile(t,i){if(t.actor&&"expired"!==t.state)return;const n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);t.actor=this.dispatcher.getActor();const r=new AbortController;t.request=r;try{const o=await this.map._requestManager.transformRequest(n,e.R.Tile,r.signal);if(r.signal.aborted)return i(null);t.request=t.actor.sendCancelable("loadTile",{uid:t.uid,tileID:t.tileID,source:this.id,type:this.t
vendor: 3,104 bytes, line 2
2ype,scope:this.scope,request:o,encoding:this.encoding},{},function(n,r){return delete t.request,t.aborted?i(null):n?(t.state="errored",i(n)):(r&&(this.map._refreshExpiredTiles&&t.setExpiryData(e.cI(r.headers)),r.borderReady||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID)),t.dem=r.dem,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0),t.state="loaded",void i(null))}.bind(this))}catch(e){if(r.signal.aborted)return i(null);t.state="errored",i(e)}}abortTile(e,t){e.request&&(e.request.abort(),delete e.request),e.actor&&e.actor.notify("abortTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),t&&t()}_getNeighboringTiles(t){const i=t.canonical,n=Math.pow(2,i.z),r=(i.x-1+n)%n,o=0===i.x?t.wrap-1:t.wrap,s=(i.x+1+n)%n,a=i.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.bQ(t.overscaledZ,o,i.z,r,i.y).key]={backfilled:!1},l[new e.bQ(t.overscaledZ,a,i.z,s,i.y).key]={backfilled:!1},i.y>0&&(l[new e.bQ(t.overscaledZ,o,i.z,r,i.y-1).key]={backfilled:!1},l[new e.bQ(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new e.bQ(t.overscaledZ,a,i.z,s,i.y-1).key]={backfilled:!1}),i.y+1<n&&(l[new e.bQ(t.overscaledZ,o,i.z,r,i.y+1).key]={backfilled:!1},l[new e.bQ(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new e.bQ(t.overscaledZ,a,i.z,s,i.y+1).key]={backfilled:!1}),l}},geojson:class extends e.E{constructor(t,i,n,r){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=n.getActor(),this.setEventedParent(r),this._data=i.data,this._options={...i},this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),void 0!==i.minzoom&&(this.minzoom=i.minzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const o=e.a6/this.tileSize;this.workerOptions={source:this.id,scope:this.scope,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*o,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*o,extent:e.a6,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.a6,radius:(void 0!==i.clusterRadius?i.clusterRadius:50)*o,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter,dynamic:i.dynamic,...i.workerOptions}}onAdd(e){this.map=e,this.setData(this._data)}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(t){if(!this._options.dynamic)return this.fire(new e.f(new Error("Can't call updateData on a GeoJSON source with dynamic set to false.")));if("string"!=typeof t&&("Feature"===t.type&&(t={type:"FeatureCollection",features:[t]}),"FeatureCollection"!==t.type))return this.fire(new e.f(new Error("Data to update should be a feature or a feature collection.")));if(this._coalesce&&"string"!=typeof t&&"string"!=typeof this._data&&"FeatureCollection"===this._data.type){const e=new Map;
vendor: 3,163 bytes, line 2
2for(const t of this._data.features)e.set(t.id,t);for(const i of t.features)e.set(i.id,i);this._data.features=[...e.values()]}else this._data=t;return this._updateWorkerData(!0),this}getClusterExpansionZoom(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id,scope:this.scope}).then(e=>t(null,e)).catch(e=>t(e)),this}getClusterChildren(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id,scope:this.scope}).then(e=>t(null,e)).catch(e=>t(e)),this}getClusterLeaves(e,t,i,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:e,limit:t,offset:i}).then(e=>n(null,e)).catch(e=>n(e)),this}async _updateWorkerData(t=!1){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new e.h("dataloading",{dataType:"source"})),this._loaded=!1;const i={append:t,...this.workerOptions};i.scope=this.scope;const n=this._data,r=new AbortController;this._pendingLoad=r;try{if("string"==typeof n){if(i.request=await this.map._requestManager.transformRequest(e.e.resolveURL(n),e.R.Source,r.signal),r.signal.aborted)return this._pendingLoad=null,void(this._coalesce=!1);i.request.collectResourceTiming=this._collectResourceTiming}else i.data=JSON.stringify(n);const o=await this.actor.send(`${this.type}.loadData`,i,{signal:r.signal});this._loaded=!0,this._pendingLoad=null;const s={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&o&&o.resourceTiming&&o.resourceTiming[this.id]&&(s.resourceTiming=o.resourceTiming[this.id]),t&&(this._partialReload=!0),this.fire(new e.h("data",s)),this._partialReload=!1,this._metadataFired=!0}catch(t){if(r.signal.aborted)return this._pendingLoad=null,void(this._coalesce=!1);this._loaded=!0,this._pendingLoad=null,this.fire(new e.f(t))}this._coalesce&&(this._updateWorkerData(t),this._coalesce=!1)}loaded(){return this._loaded}reload(){const t=e.m(this.id,this.scope);this.map.style.clearSource(t),this._updateWorkerData()}loadTile(t,i){const n=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const r=this.map.style?this.map.style.getLut(this.scope):null,o=r?{image:r.image.clone()}:null,s=this._partialReload,a={type:this.type,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:o,scope:this.scope,pixelRatio:e.e.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,showElevationIdDebug:!!this.map.painter&&this.map.painter._debugParams.showElevationIdDebug,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,scaleFactor:this.map.getScaleFactor(),partial:s,worldview:this.map.getWorldview(),indoor:this.map.getIndoorTileOptions(this.id,this.scope)};t.request=this.actor.sendCancelable(n,a,{},(e,r)=>s&&!r?(t.state="loaded",i(null)):(delete t.request,t.destroy(!1),t.aborted?i(null):e?i(e):(t.loadVectorData(r,this.map.painter,"reloadTile"===n),void i(null))))}abortTile(e){e.request&&(e.request.abort(),delete e.request),e.aborted=!0}unloadTile(e,t){this.actor.notify("removeTile",{uid:e.uid,type:this.t
2ype,source:this.id,scope:this.scope}),e.destroy()}onRemove(e){this._pendingLoad&&this._pendingLoad.abort()}serialize(){return{...this._options,type:this.type,data:this._data}}hasTransition(){return!1}},video:class extends bo{constructor(e,t,i,n){super(e,t,i,n),this.roundZoom=!0,this.type="video",this.options=t}async load(){this._loaded=!1;const t=this.options,i=new AbortController;this._imageRequest=i;try{const n=await Promise.all(t.urls.map(async t=>(await this.map._requestManager.transformRequest(t,e.R.Source,i.signal)).url));if(i.signal.aborted)return;this.urls=n;const r=await e.cW(n);if(i.signal.aborted)return;this._imageRequest=null,this.video=r,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(t){if(i.signal.aborted)return;this.fire(new e.f(t))}finally{this._loaded=!0}}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new e.f(new ce(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,i=t.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new e.T(t,this.video,i.RGBA8),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}serialize(){return{type:"video",urls:this.options.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:bo,canvas:class extends bo{constructor(t,i,n,r){super(t,i,n,r),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some(e=>!Array.isArray(e)||2!==e.length||e.some(e=>"number"!=typeof e))||this.fire(new e.f(new ce(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.f(new ce(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.f(new ce(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.f(new ce(`sources.${t}`,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 e.f(new ce(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}async load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.f(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(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(e){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context;this.texture?!t&&!this._playing||this.texture instanceof e.cO||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.T(i,this.canvas,i.gl.RGBA8,{premultiply:!0}),this._prepareData(i)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},custom:class extends e.E{constructor(t,i,n,r){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=n,this._implementation=i,this.setEventedParent(r),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.f(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.f(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new e.cF(this._implementation.bounds,this.minzoom,this.maxzoom));const o=i;o.update=this._update.bind(this),o.clearTiles=this._clearTiles.bind(this),o.coveringTiles=this._coveringTiles.bind(this),Ob
2ject.assign(this,e.cB(i,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return e.cB(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.h("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.h("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(t){this.map=t,this._loaded=!1,this.fire(new e.h("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(t),this.load()}onRemove(e){this._implementation.onRemove&&this._implementation.onRemove(e)}hasTile(e){if(this._implementation.hasTile){const{x:t,y:i,z:n}=e.canonical;return this._implementation.hasTile({x:t,y:i,z:n})}return!this.tileBounds||this.tileBounds.contains(e.canonical)}async loadTile(e,t){const{x:i,y:n,z:r}=e.tileID.canonical,o=new AbortController;e.request=o;try{const s=await this._implementation.loadTile({x:i,y:n,z:r},{signal:o.signal});if(delete e.request,e.aborted)return e.state="unloaded",t(null);if(void 0===s)return e.state="errored",t(null);if(null===s)return this.loadTileData(e,{width:this.tileSize,height:this.tileSize,data:null}),e.state="loaded",t(null);if(!function(e){return e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof ImageBitmap||e instanceof HTMLImageElement}(s))return e.state="errored",t(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`));this.loadTileData(e,s),e.state="loaded",t(null)}catch(i){if(o.signal.aborted)return;e.state="errored",t(i)}}loadTileData(e,t){e.setTexture(t,this.map.painter)}unloadTile(t,i){if(t.texture&&t.texture instanceof e.T?(t.destroy(!1),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),this._implementation.unloadTile){const{x:e,y:i,z:n}=t.tileID.canonical;this._implementation.unloadTile({x:e,y:i,z:n})}i&&i()}abortTile(e,t){e.request&&(e.request.abort(),delete e.request),t&&t()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(e=>({x:e.canonical.x,y:e.canonical.y,z:e.canonical.z}))}_clearTiles(){const t=e.m(this.id,this.scope);this.map.style.clearSource(t)}_update(){this.fire(new e.h("data",{dataType:"source",sourceDataType:"content"}))}}},To=function(t,i,n,r){const o=Eo(i.type);if(!o)throw new Error(`Unknown source type "${i.type}"`);const s=new o(t,i,n,r);if(s.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${s.id}`);return e.aW(["load","abort","unload","serialize","prepare"],s),s}
vendor: 11,104 bytes, line 2
2,Eo=function(e){return Object.hasOwn(wo,e)?wo[e]:void 0};function So([t,i],n,r,{scaled:o=!0}={}){const{tileSize:s,buffer:a}=r,{x:l,y:c,z:u}=n;if(!isFinite(l)||!isFinite(c)||!isFinite(u))throw new Error("Invalid MRT header");const h=2**u,d=h*e.a7(t),f=h*e.a8(i);return function([e,t],i,{scaled:n=!0}={}){if(!i)throw new Error("bandView is undefined");const{data:r,tileSize:o,buffer:s,offset:a,scale:l,dimension:c}=i;if(e<-s||e>o+s||t<-s||t>o+s)throw new Error(`Point (${e}, ${t}) out of bounds for tileSize=${o}, buffer=${s}`);const u=(t+s)*(o+2*s)+(e+s);if(4294967295===new Uint32Array(r.buffer)[u])return null;let h=[];h=n?[]:new(0,i.data.constructor)(c);for(let e=0;e<c;e++)h[e]=Math.round(1e12*(r[c*u+e]*l+a))/1e12;return h}([Math.min(Math.max(-a,Math.floor((d-l)*s)),s-1+a),Math.min(Math.max(-a,Math.floor((f-c)*s)),s-1+a)],r,{scaled:o})}class Io extends Error{constructor(e){super(e),this.name="MRTOverzoomError"}}const Ao={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array};function Mo(e,t,i){const{x:n,y:r,z:o}=t,{x:s,y:a,z:l}=i,c=l-o;if(c<0)throw new Io(`Invalid overzoom, source (z=${o}) is higher zoom than destination (z=${l}).`);const u=s-(n<<c),h=a-(r<<c),d=1<<c;if(u<0||u>=d||h<0||h>=d)throw new Io(`Invalid overzoom, ${l}/${s}/${a} is not a child of ${o}/${n}/${r}.`);const f=0|Math.log2(e),p=Math.min(c,f),m=c-p,_=e>>p;return{offset:[(u>>m)*_,(h>>m)*_],tileSize:_,deltaZ:c}}e.c_.setPbf(e.c$);class Co extends dn{constructor(e,t,i,n,r){super(e,t,i,n,r),this._workQueuePerLayer=new Map,this._fetchQueuePerLayer=new Map,this._taskQueue=new Map,this._isHeaderLoaded=!1,this._isLoadInProgress=!1,this.textureDescriptorPerLayer=new Map,this.texturePerLayer=new Map,this.parentTile=null,this.overzoomCoordsPerLayer=null}getLayers(){return this._mrt?Object.values(this._mrt.layers):[]}getLayer(e){return this._mrt&&this._mrt.getLayer(e)}setTexturePerLayer(t,i,n){const r=n.context,o=r.gl;let s=this.texturePerLayer.get(t)||n.getTileTexture(i.width);s&&s instanceof e.T?s.update(i,{premultiply:!1}):(s=new e.T(r,i,o.RGBA8,{premultiply:!1}),s.bind(o.LINEAR,o.CLAMP_TO_EDGE)),this.texturePerLayer.has(t)||this.texturePerLayer.set(t,s)}flushQueues(e){const t=this._workQueuePerLayer.get(e)||[],i=this._fetchQueuePerLayer.get(e)||[];for(;t.length;)t.pop()();for(;i.length;)i.pop()()}flushAllQueues(){for(const e of this._workQueuePerLayer.keys()){const t=this._workQueuePerLayer.get(e)||[];for(;t.length;)t.pop()()}for(const e of this._fetchQueuePerLayer.keys()){const t=this._fetchQueuePerLayer.get(e)||[];for(;t.length;)t.pop()()}}fetchHeader(t=16384,i){const n=this._mrt=new e.c_(30),r={...this.requestParams,headers:{Range:"bytes=0-"+(t-1)}};this.entireBuffer=null;const o=new AbortController;return this.request=o,e.d0(r,o.signal).then(({data:e,headers:r})=>{try{const o=n.getHeaderLength(e);if(o>t)return void(this.request=this.fetchHeader(o,i));n.parseHeader(e),this._isHeaderLoaded=!0;let s=0;for(const e of Object.values(n.layers))s=Math.max(s,e.dataIndex.at(-1).lastByte);e.byteLength>=s&&(this.entireBuffer=e),i(null,this.entireBuffer||e,r)}catch(e){i(e)}}).catch(e=>{o.signal.aborted||i(e)}),this.request}fetchBandForRender(e,t,i,n){this.fetchBand(e,t,i,r=>{if(r)return void n(r);this.updateTextureDescriptor(e,t,i);const o=this.textureDescriptorPerLayer.get(t);n(null,o?o.img:null)})}fetchBand(t,i,n,r){const o=this._mrt;if(!this._isHeaderLoaded||!o)return void r(new Error("Tile header is not ready"));if(this.parentTile&&this.overzoomCoordsPerLayer)return void r(null,null);const s=this.actor;if(!s)return void r(new Error("Can't fetch tile band without an actor"));let a;const l=e.m(String(n),e.m(this.tileID.key,t));let c=this._taskQueue.get(l);c?c.add(r):(c=new Set,c.add(r),this._taskQueue.set(l,c));const u=(e,t)=>{a.complete(e,t),e?r(e):(c.forEach(e=>e(null,t)),this._taskQueue.delete(l))},h=(e,t)=>{if(e)return r(e);let n,o=!1;if(null!==i){const e=this._workQueuePerLayer.get(i)||[];e.push(()=>{o=!0,n&&n.abort(),a.cancel()}),this._workQueuePerLayer.has(i)||this._workQueuePerLayer.set(i,e)}const l=()=>{o||(n=s.sendCancelable("decodeRasterArray",{type:"raster-array",source:this.source,scope:this.scope,tileID:this.tileID,uid:this.uid,buffer:t,task:a},{},u))};void 0!==this.workerReady?this.workerReady.then(l).catch(e=>r(e)):l()};let d;try{d=o.getLayer(t)}catch(e){if(this.parentTile&&this.overzoomCoordsPerLayer)return void r(new Error(`Layer '${t}' not found in parent tile MRT`));if("reloading"===this.state)return;throw e}if(!d)return void r(new Error(`Unknown sourceLayer "${t}"`));if(d.hasDataForBand(n))return c.forEach(e=>e(null,null)),void this._taskQueue.delete(l);const f=d.getDataRange([n]);if(a=o.createDecodingTask(f),!a||a.tasks.length)if(null!==i&&this.flushQueues(i),this.entireBuffer)h(null,this.entireBuffer.slice(f.firstByte,f.lastByte+1));else{const t={...this.requestParams,headers:{Range:`bytes=${f.firstByte}-${f.lastByte}`}},n=new AbortController;if(e.d0(t,n.signal).then(({data:e})=>h(null,e)).catch(e=>{n.signal.aborted||h(e)}),null!==i){const e=this._fetchQueuePerLayer.get(i)||[];e.push(()=>{n.abort(),a.cancel()}),this._fetchQueuePerLayer.has(i)||this._fetchQueuePerLayer.set(i,e)}}}updateNeeded(e,t){return(!this.textureDescriptorPerLayer.get(e)||this.textureDescriptorPerLayer.get(e).band!==t||this.refreshedUponExpiration)&&"errored"!==this.state}updateTextureDescriptor(t,i,n){if(!this._mrt)return;let r;try{r=this._mrt.getLayer(t)}catch(e){return}if(!r||!r.hasBand(n)||!r.hasDataForBand(n))return;let{bytes:o,tileSize:s,buffer:a,offset:l,scale:c}=r.getBandView(n);if(this.parentTile&&this.overzoomCoordsPerLayer){const e=this.overzoomCoordsPerLayer.get(t);e&&(o=this.cropBandData(o,s,a,e),s=e.tileSize)}const u=s+2*a,h=new e.b({width:u,height:u},o),d=this.texturePerLayer.get(i);d&&d instanceof e.T&&d.update(h,{premultiply:!1}),this.textureDescriptorPerLayer.set(i,{layer:t,band:n,img:h,buffer:a,offset:l,tileSize:s,format:r.pixelFormat,mix:[c,256*c,65536*c,16777216*c]})}cropBandData(e,t,i,n){const{offset:r,tileSize:o}=n,s=t+2*i,a=o+2*i;return function(e,t,i,n){const r=function(e){if(e instanceof Uint8Array)return"uint8";if(e instanceof Uint16Array)return"uint16";if(e instanceof Uint32Array)return"uint32";throw new Error("Invalid array type")}(e),o=Ao[r];if(!o)throw new Error(`Invalid data type "${r}"`);const s=t[2]*t[3],a=t[1]*s,l=i[2]*i[3],c=i[1]*l,u=new o(c*i[0]);for(let r=0;r<i[0];r++){let o=r*a;o+=i[3]*(n[1]*t[2]+n[0]);let h=r*c;for(let t=0;t<i[1];t++)u.subarray(h,h+l).set(e.subarray(o,o+l)),o+=s,h+=l}return u}(e,[1,s,s,4],[1,a,a,4],r)}setupOverzoom(e){let t=e;for(;t.parentTile;)t=t.parentTile;const i=t._mrt;if(!i||!i.layers)return!1;const n=Object.values(i.layers);if(0===n.length)return!1;const r={x:t.tileID.canonical.x,y:t.tileID.canonical.y,z:t.tileID.canonical.z},o={x:this.tileID.canonical.x,y:this.tileID.canonical.y,z:this.tileID.canonical.z},s=new Map;for(const t of n)try{s.set(t.name,Mo(t.tileSize,r,o))}catch(e){return!1}return this.parentTile=t,this._mrt=i,this._isHeaderLoaded=!0,this.overzoomCoordsPerLayer=s,!0}destroy(t=!1){if(super.destroy(t),delete this._mrt,!t)for(const t of this.texturePerLayer.values())t&&t instanceof e.T&&t.destroy();this.texturePerLayer.clear(),this.textureDescriptorPerLayer.clear(),this.fbo&&(this.fbo.destroy(),delete this.fbo),delete this.request,delete this.requestParams,this._isHeaderLoaded=!1}}un=(e,t,i,n,r)=>new Co(e,t,i,n,r);const Do={RasterArrayTileSource:class extends go{get partial(){return!this.map.style.imageManager.hasImageProviderForSource(this.id,this.scope)}constructor(e,t,i,n){super(e,t,i,n),this.type="raster-array",this.maxzoom=void 0!==t.maxzoom?t.maxzoom:22,this._loadTilePending={},this._loadTileLoaded={},this._pendingParentWaiters=new Map,this._options={type:"raster-array",...t}}onAdd(e){super.onAdd(e);const t=e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this.off("data",t),void 0===this._dataMaxzoom&&(this._dataMaxzoom=this.maxzoom))};this.on("data",t)}getDataMaxzoom(){return this._dataMaxzoom}collectOverzoomParentTileIDs(e,t){const i=[];for(const t in e){const n=e[t];if(!n)continue;const r=n.parentTile;r&&e[r.tileID.key]&&i.push(r.tileID)}const n=this._dataMaxzoom;if(void 0!==n)for(const r of t){if(r.canonical.z<=n)continue;const t=r.scaledTo(n);e[t.key]&&i.push(t)}return i}_narrowDataMaxzoom(e){const t=Math.max(this.minzoom,e-1);(void 0===this._dataMaxzoom||t<this._dataMaxzoom)&&(this._dataMaxzoom=t)}_isParentReady(e){const t=e._mrt;return e._isHeaderLoaded&&!!t&&!!t.layers&&Object.keys(t.layers).length>0}_waitForParent(e,t){if(this._isParentReady(e))return void t(null);if("errored"===e.state)return void t(new Error("Parent tile failed to load"));const i=this._pendingParentWaiters.get(e.uid);if(i)return void i.push(t);this._pendingParentWaiters.set(e.uid,[t]);const n=t=>{if("source"!==t.dataType||t.tile!==e)return;const i=this._isParentReady(e);if(!i&&"errored"!==e.state)return;this.off("data",n);const r=this._pendingParentWaiters.get(e.uid)||[];this._pendingParentWaiters.delete(e.uid);const o=i?null:new Error("Parent tile failed to load");for(const e of r)e(o)};this.on("data",n)}triggerRepaint(e){const t=this.map.painter._terrain,i=this.map.style.getSourceCache(this.id);t&&t.enabled&&i&&t._clearRenderCacheForTile(i.id,e.tileID),this.map.triggerRepaint()}_setupOverzoomTile(e,t){const i=void 0!==this._dataMaxzoom?this._dataMaxzoom:this.maxzoom,n=this.map.style.getSourceCache(this.id);if(!n)return void t(new Error("Source cache not found"));e._isLoadInProgress=!0;const r=e.tileID.scaledTo(i);let o=n.getTile(r);for(;o&&o.parentTile;)o=o.parentTile;o||(o=n._addTile(r));const s=i=>{e._isLoadInProgress=!1,t(i)};this._waitForParent(o,t=>{if(t||!e.setupOverzoom(o))return e.state="errored",void s(t||new Error("Parent tile setup failed"));e.state="loaded",s(null)})}async loadTile(t,i){const n=t.tileID.canonical.z>(void 0!==this._dataMaxzoom?this._dataMaxzoom:this.maxzoom);if("loaded"===t.state)return void i(null);if(t._isLoadInProgress)return void i(null);if(n)return void this._setupOverzoomTile(t,i);const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);t.source=this.id,t.scope=this.scope,void 0===this._workerReady&&(this._workerReady=this.dispatcher.send("ensureRasterArraySource",void 0).then(()=>{}),this._workerReady.catch(()=>{})),t.workerReady=this._workerReady,t.actor||(t.actor=this.dispatcher.getActor());const o=new AbortController;t.request=o;const s=(n,r,o)=>{if(delete t.request,t.aborted)return i(null);if(n)return(404===n.status||"string"==typeof n.message&&n.message.includes("Not Found"))&&(this._narrowDataMaxzoom(t.tileID.canonical.z),void 0!==this._dataMaxzoom&&t.tileID.canonical.z>this._dataMaxzoom)?void this._setupOverzoomTile(t,i):(t.state="errored",i(n));if(this.map._refreshExpiredTiles&&r&&t.setExpiryData(e.cI(o)),this.partial&&"expired"!==t.state)t.state="empty";else if(!this.partial){if(!r)return i(null);t.state="loaded",t._isHeaderLoaded=!0,t._mrt=r}i(null)};try{const n=await this.map._requestManager.transformRequest(r,e.R.Tile,o.signal);if(o.signal.aborted)return i(null);t.requestParams=n;
vendor: 2,928 bytes, line 2
2const a={request:n,uid:t.uid,tileID:t.tileID,type:this.type,source:this.id,scope:this.scope,partial:this.partial};t.request=this.partial?t.fetchHeader(void 0,(e,t,i)=>{s(e,t,i)}):t.actor.sendCancelable("loadTile",a,{},(e,t)=>e?s(e):t?void s(null,t.mrt,t.headers):s(null,null))}catch(e){if(o.signal.aborted)return i(null);t.state="errored",i(e)}}abortTile(e){e.request&&(e.request.abort(),delete e.request),e.actor&&e.actor.notify("abortTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(e,t){const i=e.texturePerLayer;if(e.flushAllQueues(),i.size){e.destroy(!1);for(const e of i.values())this.map.painter.saveTileTexture(e)}else e.destroy()}prepareTile(t,i,n,r){t.tileID.canonical.z>(void 0!==this._dataMaxzoom?this._dataMaxzoom:this.maxzoom)&&(!t.parentTile||!t.overzoomCoordsPerLayer)||t._isHeaderLoaded&&("empty"!==t.state&&(t.state="reloading"),t.fetchBandForRender(i,n,r,(i,r)=>{i?(t.state="errored",this.fire(new e.f(i))):r&&(t._isHeaderLoaded=!0,t.setTexturePerLayer(n,r,this.map.painter),t.state="loaded"),this.triggerRepaint(t)}))}getInitialBand(e){if(!this.rasterLayers)return 0;const t=this.rasterLayers.find(({id:t})=>t===e),i=t&&t.fields,n=i&&i.bands&&i.bands;return n?n[0]:0}getTextureDescriptor(t,i,n){if(!t)return;const r=i.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!r)return;let o=null;i instanceof e.cX?o=i.paint.get("raster-array-band"):i instanceof e.cY&&(o=i.paint.get("raster-particle-array-band"));const s=o||this.getInitialBand(r);return null==s||!t.textureDescriptorPerLayer.get(i.id)||t.updateNeeded(i.id,s)&&!n?void 0:{...t.textureDescriptorPerLayer.get(i.id),texture:t.texturePerLayer.get(i.id)}}getImages(t,i){const n=new Map;for(const r of t)for(const t of i){const[i,o]=t.split("/"),s=r.getLayer(i);if(!s)continue;if(!s.hasBand(o)||!s.hasDataForBand(o))continue;const{bytes:a,tileSize:l,buffer:c}=s.getBandView(o),u=l+2*c,h={data:new e.b({width:u,height:u},a),pixelRatio:2,sdf:!1,usvg:!1,version:0};n.set(t,h)}return n}queryRasterArrayValueByBandId(t,i,n){const r=i._mrt;return new Promise(o=>{const s={},a=new Set;for(const[l,c]of Object.entries(r.layers)){if(n.layerName&&l!==n.layerName)continue;const u={};s[l]=u;for(const{bands:h}of c.dataIndex)for(const d of h)n.bands&&!n.bands.includes(d)||(a.add(e.m(l,d)),i.fetchBand(l,null,d,i=>{e.e.frame(()=>{u[d]=i?null:So([t.lng,t.lat],r,c.getBandView(d)),a.delete(e.m(l,d)),0===a.size&&o(s)})}))}0===a.size&&o(s)})}_loadTileForQuery(e){if(this._loadTileLoaded[e.uid])return Promise.resolve(e._mrt);if(e.uid in this._loadTilePending)return this._loadTilePending[e.uid];const t=this._fetchTileForQuery(e);return this._loadTilePending[e.uid]=t,t}async _fetchTileForQuery(t){const i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);try{const n={request:await this.map._requestManager.transformRequest(i,e.R.Tile),uid:t.uid,tileID:t.tileID,type:this.t
vendor: 4,394 bytes, line 2
2ype,source:this.id,scope:this.scope,partial:!1},r=await t.actor.send("loadTile",n);if(!r)return null;const o=r.mrt;return this.map._refreshExpiredTiles&&t.setExpiryData(e.cI(r.headers)),t._mrt=o,t._isHeaderLoaded=!0,t.state="loaded",this._loadTileLoaded[t.uid]=!0,o}finally{delete this._loadTilePending[t.uid]}}async queryRasterArrayValueByAllBands(e,t,i){return await this._loadTileForQuery(t)?this.queryRasterArrayValueByBandId(e,t,i):null}queryRasterArrayValue(t,i){const n=e.cZ.convert(t),r=this.findLoadedParent(n);return r&&r._mrt?i.bands||!this.partial?this.queryRasterArrayValueByBandId(n,r,i):this.queryRasterArrayValueByAllBands(n,r,i):Promise.resolve(null)}findLoadedParent(t){const i=e.bT.fromLngLat(t,this.map.transform.tileSize),n=this.maxzoom+1,r=1<<n,o=Math.floor(i.x),s=Math.floor((i.x-o)*r),a=Math.floor(i.y*r);if(s<0||s>=r||a<0||a>=r)return null;const l=this.map.style.getSourceCache(this.id),c=new e.bQ(n,o,n,s,a);return l.findLoadedParent(c,this.minzoom)}}},Po=Do,Ro={model:()=>ai().then(()=>si.ModelSource),"batched-model":()=>ai().then(()=>si.Tiled3dModelSource),"raster-array":()=>async function(){return Promise.resolve()}().then(()=>Po.RasterArrayTileSource)};class Lo extends e.E{constructor(e,t,i,n){super(),this.id=e,this.type=t.type,this._options=t,this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.setEventedParent(n)}hasTransition(){return!1}loaded(){return!1}onAdd(e){}onRemove(e){}loadTile(e,t){}serialize(){return this._options}}function zo(e,t,i=""){return`${i}:${t.id||""}:${t.layer.id}:${function(e){if("layerId"in e)return`layer:${e.layerId}`;{const{featuresetId:t,importId:i}=e;return`featureset:${t}${i?`:import:${i}`:""}`}}(e.target)}`}function Fo(e,t,i,n=""){if(e.uniqueFeatureID){const r=zo(e,t,n);if(i.has(r))return!0;i.add(r)}return!1}function Oo(e,t,i,n,r=!1,o=void 0){const s=t.sourceCache.transform,a=t.sourceCache.tilesIn(e,t.has3DLayers,r);a.sort(No);const l=[];for(const e of a){const a=e.tile.queryRenderedFeatures(t,e,i,n,s,r,o);Object.keys(a).length&&l.push({wrappedTileID:e.tile.tileID.wrapped().key,queryResults:a})}for(const i in t.layers){const r=t.layers[i];if(r.styleLayer){const i=r.styleLayer.queryRenderedFeatures(e,t.sourceCache,n);Object.keys(i).length&&l.push({wrappedTileID:0,queryResults:i})}}return 0===l.length?{}:function(e){const t={},i={};for(const n of e){const e=n.queryResults,r=n.wrappedTileID,o=i[r]=i[r]||{};for(const i in e){const n=e[i],r=o[i]=o[i]||{},s=t[i]=t[i]||[];for(const e of n)r[e.featureIndex]||(r[e.featureIndex]=!0,s.push(e))}}return t}(l)}function ko(e,t,i,n,r,o){const s={},a=n.queryRenderedSymbols(e),l=[];for(const e of Object.keys(a).map(Number))l.push(r[e]);l.sort(No);for(const e of l){const n=e.featureIndex.lookupSymbolFeatures(a[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,t,i,o);for(const t in n){const i=s[t]=s[t]||[],r=n[t];r.sort((t,i)=>{const n=e.featureSortOrder;if(n){const e=n.indexOf(t.featureIndex);return n.indexOf(i.featureIndex)-e}return i.featureIndex-t.featureIndex});for(const e of r)i.push(e)}}return s}function Bo(e,t){const i=e.getRenderableIds().map(t=>e.getTileByID(t)),n=[],r={};for(let e=0;e<i.length;e++){const o=i[e],s=o.tileID.canonical.key;r[s]||(r[s]=!0,o.querySourceFeatures(n,t))}return n}function No(e,t){const i=e.tileID,n=t.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}class Vo{constructor(e){this.style=e,this.layersGotHidden=!1,this.layers=[]}processLayersChanged(){this.layers=[];const e=!1,t=!1;for(const i in this.style._mergedLayers){const n=this.style._mergedLayers[i];if("fill-extrusion"===n.type||"building"===n.type)this.layers.push({layer:n,visible:e,visibilityChanged:t});else if("model"===n.type){const i=this.style.getLayerSource(n);i&&"batched-model"===i.type&&this.layers.push({layer:n,visible:e,visibilityChanged:t})}}}onNewFrame(e){this.layersGotHidden=!1;for(const t of this.layers){const i=t.layer;let n=!1;"fill-extrusion"===i.type?n=!i.isHidden(e)&&i.paint.get("fill-extrusion-opacity")>0:"building"===i.type?n=!i.isHidden(e)&&i.paint.get("building-opacity")>0:"model"===i.type&&(n=!i.isHidden(e)&&i.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!n&&t.visible,t.visible=n}}updateZOffset(e,t){this.currentBuildingBuckets=[];for(const e of this.layers){const i=e.layer,n=this.style.getLayerSourceCache(i);let r=1;
vendor: 11,573 bytes, line 2
2"fill-extrusion"===i.type?r=e.visible?i.paint.get("fill-extrusion-vertical-scale"):0:"building"===i.type&&(r=e.visible?i.paint.get("building-vertical-scale"):0);let o=n?n.getTile(t):null;if(!o&&n)for(const e in n._tiles){const i=n._tiles[e];if(t.canonical.isChildOf(i.tileID.canonical)){o=i;break}}this.currentBuildingBuckets.push({bucket:o?o.getBucket(i):null,tileID:o?o.tileID:t,verticalScale:r})}e.hasAnyZOffset=!1;let i=!1;for(let n=0;n<e.symbolInstances.length;n++){const r=e.symbolInstances.get(n),o=r.zOffset,s=this._getHeightAtTileOffset(t,r.tileAnchorX,r.tileAnchorY);r.zOffset=s!==Number.NEGATIVE_INFINITY?s:o,i||o===r.zOffset||(i=!0),e.hasAnyZOffset||0===r.zOffset||(e.hasAnyZOffset=!0)}i&&(e.zOffsetBuffersNeedUpload=!0,e.zOffsetSortDirty=!0)}hasLayerForSourceCache(e){for(const{layer:t}of this.layers){const i=this.style.getLayerSourceCache(t);if(i&&i.id===e)return!0}return!1}_mapCoordToOverlappingTile(t,i,n,r){let o=i,s=n;if(t.canonical.z!==r.canonical.z){const a=r.canonical,l=1/(1<<t.canonical.z-a.z);o=(i+t.canonical.x*e.a6)*l-a.x*e.a6|0,s=(n+t.canonical.y*e.a6)*l-a.y*e.a6|0}return{tileX:o,tileY:s}}_getHeightAtTileOffset(e,t,i){let n,r;for(let o=0;o<this.layers.length;++o){const s=this.layers[o].layer;if("fill-extrusion"!==s.type&&"building"!==s.type)continue;const{bucket:a,tileID:l,verticalScale:c}=this.currentBuildingBuckets[o];if(!a)continue;const{tileX:u,tileY:h}=this._mapCoordToOverlappingTile(e,t,i,l),d=a.getHeightAtTileCoord(u,h);d&&void 0!==d.height&&(d.hidden?n=d.height:r=Math.max(d.height*c,r||0))}if(void 0!==r)return r;for(let r=0;r<this.layers.length;++r){const o=this.layers[r];if("model"!==o.layer.type||!o.visible)continue;const{bucket:s,tileID:a}=this.currentBuildingBuckets[r];if(!s)continue;const{tileX:l,tileY:c}=this._mapCoordToOverlappingTile(e,t,i,a),u=s.getHeightAtTileCoord(l,c);if(u&&!u.hidden)return void 0===u.height&&void 0!==n?Math.min(u.maxHeight,n)*u.verticalScale:u.height?u.height*u.verticalScale:Number.NEGATIVE_INFINITY}return this.layersGotHidden?0:Number.NEGATIVE_INFINITY}}let Uo;function jo(){return Uo||(Uo=new Xt),Uo}function Go(t,i){const n={},r=t,o=i,s=n;for(const e in r)"ref"!==e&&(s[e]=r[e]);return e.d1.forEach(e=>{e in o&&(s[e]=o[e])}),n}function $o(e){e=e.slice();const t=Object.create(null);for(const i of e)t[i.id]=i;for(let i=0;i<e.length;i++){const n=e[i];if(n&&"ref"in n){const r=t[n.ref];r&&(e[i]=Go(n,r))}}return e}class Ho{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances.at(-1),this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.b1(t,0,1);let i=1,n=this._distances[i];const r=t*this.paddedLength+this.padding;for(;n<r&&i<this._distances.length;)n=this._distances[++i];const o=i-1,s=this._distances[o],a=n-s,l=a>0?(r-s)/a:0;return this.points[o].mult(1-l).add(this.points[i].mult(l))}}const Zo=100;class qo{constructor(e,t){this.gridRightBoundary=0,this.gridBottomBoundary=0,this.clippedSymbols=new Map,this.reset(e,t)}reset(t,i){const n=t.width+200,r=t.height+200;n!==this.gridRightBoundary||r!==this.gridBottomBoundary?(this.grid=new e.d2(n,r,25),this.ignoredGrid=new e.d2(n,r,25)):(this.grid.clear(),this.ignoredGrid.clear()),this.transform=t,this.fogState=i,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+Zo,this.screenBottomBoundary=t.height+Zo,this.gridRightBoundary=n,this.gridBottomBoundary=r,this.clippedSymbols.clear()}clearClippedSymbolsForBucket(e){this.clippedSymbols.delete(e)}markSymbolAsClipped(e,t){let i=this.clippedSymbols.get(e);i||(i=new Set,this.clippedSymbols.set(e,i)),i.add(t)}placeCollisionBox(t,i,n,r,o,s,a,l,c,u,h){let d=n.projectedAnchorX,f=n.projectedAnchorY,p=n.projectedAnchorZ;const m=n.tileAnchorX,_=n.tileAnchorY,g=n.elevation,y=n.tileID,v=t.getProjection();if(g&&y){const[e,t,i]=v.upVector(y.canonical,n.tileAnchorX,n.tileAnchorY),r=v.upVectorScale(y.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;d+=e*g*r,f+=t*g*r,p+=i*g*r}const x="globe"===t.projection.name,b="globe"===t.projection.name?e.S(this.transform.zoom):0;if(y&&x&&b<1&&!s){const t=1<<y.canonical.z,i=e.d3(m,_);e.d4(i,i,1/e.a6),e.d5(i,i,e.d3(y.canonical.x,y.canonical.y)),e.d4(i,i,1/t),e.d6(i,i,e.d3(r[0],r[1])),i[0]=e.d7(i[0],-.5,.5),e.d4(i,i,e.a6);const n=e.d8(i[0],i[1],e.a6/(2*Math.PI),1);e.c6(n,n,o),d=e.am(d,n[0],b),f=e.am(f,n[1],b),p=e.am(p,n[2],b)}const w=this.projectAndGetPerspectiveRatio(u,d,f,p,n.tileID,"globe"===v.name||!!g||this.transform.pitch>0,v),T=c*w.perspectiveRatio,E=(n.x1*i+a.x-n.padding)*T+w.point.x,S=(n.y1*i+a.y-n.padding)*T+w.point.y,I=(n.x2*i+a.x+n.padding)*T+w.point.x,A=(n.y2*i+a.y+n.padding)*T+w.point.y,M=w.perspectiveRatio<=e.d9||w.occluded;return!this.isInsideGrid(E,S,I,A)||!l&&this.grid.hitTest(E,S,I,A,h)||M?{box:[],offscreen:!1,occluded:w.occluded}:{box:[E,S,I,A],offscreen:this.isOffscreen(E,S,I,A),occluded:!1}}placeCollisionCircles(t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_){const g=[],y=this.transform.elevation,v=t.getProjection(),x="road"===t.elevationType,b=!!y||x,w=e.c2.getAtTileOffsetFunc(_,this.transform.center.lat,this.transform.worldSize,v),T=new e.P(n.tileAnchorX,n.tileAnchorY),E=new e.P(n.tileAnchorX,n.tileAnchorY);let{x:S,y:I,z:A}=v.projectTilePoint(E.x,E.y,_.canonical),M=null;if(b){M=x&&t.hdExt?t.hdExt.makeRoadSymbolElevationParams(t,t.text,r,_,w,y,v,this.transform.center.lat,this.transform.worldSize):{getElevation:w,elevation:y,elevationFeature:null};const[e,i,n]=M.getElevation(T,y,M.elevationFeature);S+=e,I+=i,A+=n}const C="globe"===v.name,D=this.projectAndGetPerspectiveRatio(l,S,I,A,_,C||!!y||this.transform.pitch>0,v),{perspectiveRatio:P}=D,R=(d?a/P:a*P)/e.dg,L=e.da(S,I,A,c),z=n.lineOffsetX*R,F=n.lineOffsetY*R,O=e.av(t.layers[0].layout.get("text-max-angle")),k=Math.cos(O),B=D.signedDistanceFromCamera>0?e.db(R,s,z,F,x&&1===n.flipState,L,E,n,o,c,{},b&&!d?M:null,d&&b,v,_,d,k):null;let N=!1,V=!1,U=!0;if(B&&!D.occluded){const t=.5*p*P+m,n=new e.P(-100,-100),r=new e.P(this.screenRightBoundary,this.screenBottomBoundary),o=new Ho,{first:s,last:a}=B,l=s.path.length;let c=[];for(let e=l-1;e>=1;e--)c.push(s.path[e]);for(let e=1;e<a.path.length;e++)c.push(a.path[e]);const d=2.5*t;u&&(c=c.map(([t,i,n],r)=>(b&&!C&&(n=M.getElevation(r<l-1?s.tilePath[l-1-r]:a.tilePath[r-l+2],y,M.elevationFeature)[2]),e.da(t,i,n,u))),c.some(e=>e[3]<=0)&&(c=[]));let _=[];if(c.length>0){let t=1/0,i=-1/0,o=1/0,s=-1/0;for(const e of c)t=Math.min(t,e[0]),o=Math.min(o,e[1]),i=Math.max(i,e[0]),s=Math.max(s,e[1]);i>=n.x&&t<=r.x&&s>=n.y&&o<=r.y&&(_=[c.map(t=>new e.P(t[0],t[1]))],(t<n.x||i>r.x||o<n.y||s>r.y)&&(_=e.dc(_,n.x,n.y,r.x,r.y)))}for(const e of _){o.reset(e,.25*t);let n=0;n=o.length<=.5*t?1:Math.ceil(o.paddedLength/d)+1;for(let e=0;e<n;e++){const r=e/Math.max(n-1,1),s=o.lerp(r),a=s.x+Zo,l=s.y+Zo;g.push(a,l,t,0);const c=a-t,u=l-t,d=a+t,p=l+t;if(U=U&&this.isOffscreen(c,u,d,p),V=V||this.isInsideGrid(c,u,d,p),!i&&this.grid.hitTestCircle(a,l,t,f)&&(N=!0,!h))return{circles:[],offscreen:!1,collisionDetected:N,occluded:!1}}}}return{circles:!h&&N||!V?[]:g,offscreen:U,collisionDetected:N,occluded:D.occluded}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const i=[];let n=1/0,r=1/0,o=-1/0,s=-1/0;for(const a of t){const t=new e.P(a.x+Zo,a.y+Zo);n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),s=Math.max(s,t.y),i.push(t)}const a=this.grid.query(n,r,o,s).concat(this.ignoredGrid.query(n,r,o,s)),l={},c={};for(const t of a){const n=t.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;const r=this.clippedSymbols.get(n.bucketInstanceId);if(r&&r.has(n.featureIndex))continue;const o=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.aU(i,o)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(e,t,i,n,r){(t?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:r},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,i,n,r){const o=t?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:r};for(let t=0;t<e.length;t+=4)o.insertCircle(s,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(t,i,n,r,o,s,a){const l=[i,n,r,1];let c=!1;r||this.transform.pitch>0?(e.c6(l,l,t),this.fogState&&o&&"globe"!==a.name&&(c=e.dd(this.fogState,i,n,r,o.toUnwrapped(),this.transform)>e.dh)):e.de(l,l,t);const u=l[3];return{point:new e.P((l[0]/u+1)/2*this.transform.width+Zo,(-l[1]/u+1)/2*this.transform.height+Zo),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(a)/u*.5,1.5),signedDistanceFromCamera:u,occluded:s&&l[2]>u||c}}isOffscreen(e,t,i,n){return i<Zo||e>=this.screenRightBoundary||n<Zo||t>this.screenBottomBoundary}isInsideGrid(e,t,i,n){return i>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const t=e.df([]);return e.bN(t,t,[-100,-100,0]),t}}class Wo{constructor(e,t,i,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class Yo{constructor(e,t,i,n,r,o=!1){this.text=new Wo(e?e.text:null,t,i,r),this.icon=new Wo(e?e.icon:null,t,n,r),this.clipped=o}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Xo{constructor(e,t,i,n=!1){this.text=e,this.icon=t,this.skipFade=i,this.clipped=n}}class Jo{constructor(){this.invProjMatrix=e.Y(),this.viewportMatrix=e.Y(),this.circles=[]}}class Ko{constructor(e,t,i,n,r){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=r}}class Qo{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function es(t,i,n,r,o){const{horizontalAlign:s,verticalAlign:a}=e.du(t),l=-(s-.5)*i,c=-(a-.5)*n,u=e.dv(t,r);return new e.P(l+u[0]*o,c+u[1]*o)}function ts(t,i,n,r,o){const s=new e.P(t,i);return n&&s._rotate(r?o:-o),s}function is(t,i,n,r){const{leftJustifiedTextSymbolIndex:o,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:l,crossTileID:c}=n,u=e.dw(i),h=r===e.dt.vertical?l:"left"===u?o:"center"===u?s:"right"===u?a:-1;o>=0&&(t.text.placedSymbolArray.get(o).crossTileID=h>=0&&o!==h?0:c),s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=h>=0&&s!==h?0:c),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=h>=0&&a!==h?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=h>=0&&l!==h?0:c)}function ns(t,i,n){const r=i===e.dt.horizontal||i===e.dt.horizontalOnly?i:0,o=i===e.dt.vertical?i:0,{leftJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=n,u=t.text.placedSymbolArray;s>=0&&(u.get(s).placedOrientation=r),a>=0&&(u.get(a).placedOrientation=r),l>=0&&(u.get(l).placedOrientation=r),c>=0&&(u.get(c).placedOrientation=o)}class rs{constructor(e,t,i,n,r,o,s){this.transform=e.clone(),this.projection=e.projection.name,s instanceof qo?(s.reset(this.transform,r),this.collisionIndex=s):this.collisionIndex=new qo(this.transform,r),this.buildingIndex=o,this.frontCutoff
vendor: 8,832 bytes, line 2
2Start=0,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new Qo(i),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={},this.lastReplacementSourceUpdateTime=0}getBucketParts(t,i,n,r,o=1){const s=n.getBucket(i),a=n.latestFeatureIndex;if(!s||!a||i.fqid!==s.layerIds[0])return;const l=s.layers[0].layout,c=s.layers[0].paint,u=n.collisionBoxArray,h=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),d=n.tileSize/e.a6,f=n.tileID.toUnwrapped();this.transform.setProjection(s.projection);const p=e.di(n.tileID,s.getProjection(),this.transform,this.projection),m="map"===l.get("text-pitch-alignment"),_="map"===l.get("text-rotation-alignment");i.compileFilter(i.options);const g=i.dynamicFilter(),y=i.dynamicFilterNeedsFeature(),v=i.dynamicFilterNeedsGeometry(),x=this.transform.calculatePixelsToTileUnitsMatrix(n),b=e.dj(p,n.tileID.canonical,m,_,this.transform,s.getProjection(),x);let w=null;const T=s.getProjection().createInversionMatrix(this.transform,n.tileID.canonical);if(m){const t=e.dk(p,n.tileID.canonical,m,_,this.transform,s.getProjection(),x);w=e.X([],this.transform.labelPlaneMatrix,t)}let E=null;g&&n.latestFeatureIndex&&(E={unwrappedTileID:f,dynamicFilter:g,dynamicFilterNeedsFeature:y,needGeometry:v}),this.retainedQueryData[s.bucketInstanceId]=new Ko(s.bucketInstanceId,a,s.sourceLayerIndex,s.index,n.tileID);const[S,I]=s.layers[0].layout.get("text-size-scale-range"),A=e.b1(o,S,I),[M,C]=l.get("icon-size-scale-range"),D=e.b1(o,M,C),P={bucket:s,layout:l,paint:c,posMatrix:p,invMatrix:T,mercatorCenter:[e.a7(this.transform.center.lng),e.a8(this.transform.center.lat)],textLabelPlaneMatrix:b,labelToScreenMatrix:w,clippingData:E,scale:h,textPixelRatio:d,holdingForFade:n.holdingForFade(),collisionBoxArray:u,partiallyEvaluatedTextSize:e.dl(s.textSizeData,this.transform.zoom,A),partiallyEvaluatedIconSize:e.dl(s.iconSizeData,this.transform.zoom,D),collisionGroup:this.collisionGroups.get(s.sourceID),latestFeatureIndex:n.latestFeatureIndex};if(r)for(const e of s.sortKeyRanges){const{sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r}=e;t.push({sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r,parameters:P})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:s.symbolInstances.length,parameters:P})}placeLayerBucketPart(t,i,n,r=1){const{bucket:o,layout:s,paint:a,posMatrix:l,textLabelPlaneMatrix:c,labelToScreenMatrix:u,clippingData:h,textPixelRatio:d,mercatorCenter:f,invMatrix:p,holdingForFade:m,collisionBoxArray:_,partiallyEvaluatedTextSize:g,partiallyEvaluatedIconSize:y,collisionGroup:v,latestFeatureIndex:x}=t.parameters,b=s.get("text-optional"),w=s.get("icon-optional"),T=s.get("text-allow-overlap"),E=s.get("icon-allow-overlap"),S="map"===s.get("text-rotation-alignment"),I="map"===s.get("icon-rotation-alignment"),A="map"===s.get("text-pitch-alignment"),M=a.get("symbol-z-offset"),C="sea"===s.get("symbol-elevation-reference"),D=s.get("symbol-placement"),P=s.get("text-variable-anchor"),R=S&&"point"!==D,L=I&&"point"!==D,z=P&&o.hasTextData(),F=o.hasIconTextFit()&&z&&o.hasIconData();this.transform.setProjection(o.projection);const O=z||R,k=L||F;let B=T&&(E||!o.hasIconData()||w),N=E&&(T||!o.hasTextData()||b);const V=!M.isConstant();!o.collisionArrays&&_&&o.deserializeCollisionBoxes(_);const U=(t,r,a)=>{const{crossTileID:_,numVerticalGlyphVertices:I}=t;let D=null;if(h&&h.dynamicFilterNeedsFeature||V){const i=this.retainedQueryData[o.bucketInstanceId],n=x.loadFeature({featureIndex:t.featureIndex,bucketIndex:i.bucketIndex,sourceLayerIndex:i.sourceLayerIndex,layoutVertexArrayOffset:0}),r=n.properties?n.properties.worldview:null;if(o.localizable&&o.worldview&&"string"==typeof r)if("all"===r)n.properties.$localized=!0;else{if(!r.split(",").includes(o.worldview))return;n.properties.$localized=!0,n.properties.worldview=o.worldview}D=h&&h.needGeometry?e.bx(n,!0):n}if(h&&!(0,h.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch,worldview:o.worldview},D,this.retainedQueryData[o.bucketInstanceId].tileID.canonical,new e.P(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(h.unwrappedTileID)))return this.placements[_]=new Xo(!1,!1,!1,!0),void i.add(_);const R=M.evaluate(D,{});if((t.zOffset||0)+(R||0)>0&&this.frontCutoffStart>0){const n=2*this.frontCutoffStart-1,r=[t.tileAnchorX,t.tileAnchorY,0,1],o=e.c6(e.dr(),r,l);if(o[1]/o[3]<n)return this.placements[_]=new Xo(!1,!1,!1,!0),void i.add(_)}if(i.has(_))return;if(m)return void(this.placements[_]=new Xo(!1,!1,!1));let L=!1,z=!1,F=!0,U=!1,j=!1,G=null,$={box:null,offscreen:null,occluded:null},H={box:null},Z=null,q=null,W=null,Y=0,X=0,J=0;a.textFeatureIndex?Y=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(Y=t.featureIndex),a.verticalTextFeatureIndex&&(X=a.verticalTextFeatureIndex);const K=i=>{i.tileID=this.retainedQueryData[o.bucketInstanceId].tileID;const n=this.transform.elevation;if("road"===o.elevationType)i.elevation=C?R:R+e.c2.getAtTileOffset(i.tileID,new e.P(i.tileAnchorX,i.tileAnchorY),n,null);else{const r=o.hdExt?o.hdExt.elevationFeatures[t.elevationFeatureIndex]:void 0;i.elevation=C?R:R+e.c2.getAtTileOffset(i.tileID,new e.P(i.tileAnchorX,i.tileAnchorY),n,r)}i.elevation+=t.zOffset},Q=a.textBox;if(Q){K(Q);const i=i=>{let n=e.dt.horizontal;if(o.allowVerticalPlacement&&!i&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[_];e&&(this.placedOrientations[_]=e,n=e,ns(o,n,t))}return n},n=(t,i)=>{if(o.allowVerticalPlacement&&I>0&&a.verticalTextBox){for(const n of o.writingModes)if(n===e.dt.vertical?($=i(),H=$):$=t(),$&&$.box&&$.box.length)break}else $=t()};if(P){let s=P;if(this.prevPlacement&&this.prevPlacement.variableOffsets[_]){const e=this.prevPlacement.variableOffsets[_];s.indexOf(e.anchor)>0&&(s=s.filter(t=>t!==e.anchor),s.unshift(e.anchor))}const c=(e,i,n)=>{const a=o.getSymbolInstanceTextSize(g,t,this.transform.zoom,r),c=(e.x2-e.x1)*a+2*e.padding,u=(e.y2-e.y1)*a+2*e.padding,h=t.hasIconTextFit&&!E?i:null;h&&K(h);let m={box:[],offscreen:!1,occluded:!1};const _=T?2*s.length:s.length;for(let i=0;i<_;++i){const _=this.attemptAnchorPlacement(s[i%s.length],e,f,p,O,c,u,a,S,A,d,l,v,i>=s.length,t,r,o,n,h,g,y);if(_&&(m=_.placedGlyphBoxes,m&&m.box&&m.box.length)){L=!0,G=_.shift;break}}return m};n(()=>c(Q,a.iconBox,e.dt.horizontal),()=>{const t=a.verticalTextBox;return t&&K(t),o.allowVerticalPlacement&&!($&&$.box&&$.box.length)&&I>0&&t?c(t,a.verticalIconBox,e.dt.vertical):{box:null,offscreen:null,occluded:null}}),$&&(L=$.box,F=$.offscreen,U=$.occluded);const u=i(!(!$||!$.box));if(!L&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[_];e&&(this.variableOffsets[_]=e,is(o,e.anchor,t,u))}}else{const s=(i,n)=>{const s=o.getSymbolInstanceTextSize(g,t,this.transform.zoom,r),a=this.collisionIndex.placeCollisionBox(o,s,i,f,p,O,new e.P(0,0),T,d,l,v.predicate);return a&&a.box&&a.box.length&&(ns(o,n,t),this.placedOrientations[_]=n),a};n(()=>s(Q,e.dt.horizontal),()=>{const t=a.verticalTextBox;return o.allowVerticalPlacement&&I>0&&t?(K(t),s(t,e.dt.vertical)):{box:null,offscreen:null,occluded:null}}),i(!!($&&$.box&&$.box.length))}}if(Z=$,L=Z&&Z.box&&Z.box.length>0,F=Z&&Z.offscreen,U=Z&&Z.occluded,t.useRuntimeCollisionCircles){const i=t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex,r=o.text.placedSymbolArray.get(i),a=e.ds(o.textSizeData,g,r),h=s.get("text-padding");q=this.collisionIndex.placeCollisionCircles(o,T,r,i,o.lineVertexArray,o.glyphOffsetArray,a,l,c,u,n,A,v.predicate,t.collisionCircleDiameter*a/e.dg,h,this.retainedQueryData[o.bucketInstanceId].tileID),L=T||q.circles.length>0&&!q.collisionDetected,F=F&&q.offscreen,U=q.occluded}if(a.iconFeatureIndex&&(J=a.iconFeatureIndex),a.iconBox){const i=i=>{K(i);const n=t.hasIconTextFit&&G?ts(G.x,G.y,S,A,this.transform.angle):new e.P(0,0),r=o.getSymbolInstanceIconSize(y,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(o,r,i,f,p,k,n,E,d,l,v.predicate)};H&&H.box&&H.box.length&&a.verticalIconBox?(W=i(a.verticalIconBox),z=W.box.length>0):(W=i(a.iconBox),z=W.box.length>0),F=F&&W.offscreen,j=W.occluded}const ee=b||0===t.numHorizontalGlyphVertices&&0===I,te=w||0===t.numIconVertices;if(ee||te?te?ee||(z=z&&L):L=z&&L:z=L=z&&L,L&&Z&&Z.box&&this.collisionIndex.insertCollisionBox(Z.box,s.get("text-ignore-placement"),o.bucketInstanceId,H&&H.box&&X?X:Y,v.ID),z&&W&&this.collisionIndex.insertCollisionBox(W.box,s.get("icon-ignore-placement"),o.bucketInstanceId,J,v.ID),q&&(L&&this.collisionIndex.insertCollisionCircles(q.circles,s.get("text-ignore-placement"),o.bucketInstanceId,Y,v.ID),n)){const e=o.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new Jo);for(let e=0;e<q.circles.length;
vendor: 20,712 bytes, line 2
2e+=4)t.circles.push(q.circles[e+0]),t.circles.push(q.circles[e+1]),t.circles.push(q.circles[e+2]),t.circles.push(q.collisionDetected?1:0)}const ie="globe"!==o.projection.name;B=B&&(ie||!U),N=N&&(ie||!j),this.placements[_]=new Xo(L||B,z||N,F||o.justReloaded),i.add(_)},j=this.retainedQueryData[o.bucketInstanceId].tileID;if("offset"===o.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(o,j),"road"===o.elevationType&&o.hdExt&&o.hdExt.updateRoadElevation(o,j.canonical),o.updateZOffset(),o.sortFeaturesByY){const t=o.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const i=t[e];U(o.symbolInstances.get(i),i,o.collisionArrays[i])}o.hasAnyZOffset&&e.w(`${o.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(o.hasAnyZOffset){const e=o.getSortedIndexesByZOffset();for(let t=0;t<e.length;++t){const i=e[t];U(o.symbolInstances.get(i),i,o.collisionArrays[i])}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)U(o.symbolInstances.get(e),e,o.collisionArrays[e]);if(n&&o.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[o.bucketInstanceId];e.aP(t.invProjMatrix,l),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1}attemptAnchorPlacement(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m,_,g,y,v,x){const{textOffset0:b,textOffset1:w,crossTileID:T}=p,E=[b,w],S=es(e,o,s,E,a),I=this.collisionIndex.placeCollisionBox(_,a,t,i,n,r,ts(S.x,S.y,l,c,this.transform.angle),f,u,h,d.predicate);if(y){const e=_.getSymbolInstanceIconSize(x,this.transform.zoom,p.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(_,e,y,i,n,r,ts(S.x,S.y,l,c,this.transform.angle),f,u,h,d.predicate).box.length)return}if(I.box.length>0){let t;return this.prevPlacement&&this.prevPlacement.variableOffsets[T]&&this.prevPlacement.placements[T]&&this.prevPlacement.placements[T].text&&(t=this.prevPlacement.variableOffsets[T].anchor),this.variableOffsets[T]={textOffset:E,width:o,height:s,anchor:e,textScale:a,prevAnchor:t},is(_,e,p,g),_.allowVerticalPlacement&&(ns(_,g,p),this.placedOrientations[T]=g),{shift:S,placedGlyphBoxes:I}}}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let i=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const n=t?t.symbolFadeChange(e):1,r=t?t.opacities:{},o=t?t.variableOffsets:{},s=t?t.placedOrientations:{};for(const e in this.placements){const t=this.placements[e],o=r[e];o?(this.opacities[e]=new Yo(o,n,t.text,t.icon,null,t.clipped),i=i||t.text!==o.text.placed||t.icon!==o.icon.placed):(this.opacities[e]=new Yo(null,n,t.text,t.icon,t.skipFade,t.clipped),i=i||t.text||t.icon)}for(const e in r){const t=r[e];if(!this.opacities[e]){const r=new Yo(t,n,!1,!1);r.isHidden()||(this.opacities[e]=r,i=i||t.text.placed||t.icon.placed)}}for(const e in o)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=o[e]);for(const e in s)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=s[e]);i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(t,i,n,r,o=!1,s=1){r&&(this.lastReplacementSourceUpdateTime=r.updateTime);const a=new Set;for(const l of i){const i=l.getBucket(t);if(i&&l.latestFeatureIndex&&t.fqid===i.layerIds[0]&&(this.updateBucketOpacities(i,a,l,l.collisionBoxArray,n,r,l.tileID,t.scope),"offset"===i.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(i,l.tileID),"road"===i.elevationType&&i.hdExt&&i.hdExt.updateRoadElevation(i,l.tileID.canonical),i.updateZOffset(),o&&l.collisionBoxArray)){const t=i.layers[0].layout,[n,r]=t.get("text-size-scale-range"),[o,a]=t.get("icon-size-scale-range"),c=e.b1(s,n,r),u=e.b1(s,o,a);i.updateCollisionDebugBuffers(this.transform.zoom,l.collisionBoxArray,c,u)}}}updateBucketOpacities(t,i,n,r,o,s,a,l){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const c=t.layers[0].layout,u=t.layers[0].paint,h=!!t.layers[0].dynamicFilter(),d=new Yo(null,0,!1,!1,!0),f=c.get("text-allow-overlap"),p=c.get("icon-allow-overlap"),m=c.get("text-variable-anchor"),_="map"===c.get("text-rotation-alignment"),g="map"===c.get("text-pitch-alignment"),y=u.get("symbol-z-offset"),v="sea"===c.get("symbol-elevation-reference"),x=!y.isConstant(),b=new Yo(null,0,f&&(p||!t.hasIconData()||c.get("icon-optional")),p&&(f||!t.hasTextData()||c.get("text-optional")),!0);!t.collisionArrays&&r&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(r);const w=(e,t,i)=>{for(let n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(i)};let T=0;s&&t.updateReplacement(a,s),this.collisionIndex.clearClippedSymbolsForBucket(t.bucketInstanceId);for(let r=0;r<t.symbolInstances.length;r++){const c=t.symbolInstances.get(r),{numHorizontalGlyphVertices:u,numVerticalGlyphVertices:f,crossTileID:p,numIconVertices:E,tileAnchorX:S,tileAnchorY:I}=c;let A=null;const M=this.retainedQueryData[t.bucketInstanceId];x&&c&&M&&(A=n.latestFeatureIndex.loadFeature({featureIndex:c.featureIndex,bucketIndex:M.bucketIndex,sourceLayerIndex:M.sourceLayerIndex,layoutVertexArrayOffset:0}));const C=y.evaluate(A,{}),D=i.has(p);let P=this.opacities[p];D?P=d:P||(P=b,this.opacities[p]=P),i.add(p);const R=u>0||f>0,L=E>0,z=this.placedOrientations[p],F=z===e.dt.vertical,O=z===e.dt.horizontal||z===e.dt.horizontalOnly;!R&&!L||P.isHidden()||T++;let k=!1;if((R||L)&&s)for(const i of t.activeReplacements){if(e.dm(i,o,e.dn.Symbol,l))continue;if(i.min.x>S||S>i.max.x||i.min.y>I||I>i.max.y)continue;const t=e.dp(S,I,a.canonical,i.footprintTileId.canonical);if(k=e.dq(t,i.footprint),k)break}if(k&&this.collisionIndex.markSymbolAsClipped(t.bucketInstanceId,c.featureIndex),R){const e=k?ps:fs(P.text);w(t.text,u,F?ps:e),w(t.text,f,O?ps:e);const i=P.text.isHidden(),{leftJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:r,rightJustifiedTextSymbolIndex:o,verticalPlacedTextSymbolIndex:s}=c,a=t.text.placedSymbolArray,l=i||F?1:0;n>=0&&(a.get(n).hidden=l),r>=0&&(a.get(r).hidden=l),o>=0&&(a.get(o).hidden=l),s>=0&&(a.get(s).hidden=i||O?1:0);const h=this.variableOffsets[p];h&&is(t,h.anchor,c,z);const d=this.placedOrientations[p];d&&(is(t,"left",c,d),ns(t,d,c))}if(L){const e=k?ps:fs(P.icon),{placedIconSymbolIndex:i,verticalPlacedIconSymbolIndex:n}=c,r=t.icon.placedSymbolArray,o=P.icon.isHidden()?1:0;i>=0&&(w(t.icon,E,F?ps:e),r.get(i).hidden=o),n>=0&&(w(t.icon,c.numVerticalIconVertices,O?ps:e),r.get(n).hidden=o)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const i=t.collisionArrays[r];if(i){let n=new e.P(0,0),r=!0;if(i.textBox||i.verticalTextBox){if(m){const e=this.variableOffsets[p];e?(n=es(e.anchor,e.width,e.height,e.textOffset,e.textScale),_&&n._rotate(g?this.transform.angle:-this.transform.angle)):r=!1}h&&(r=!P.clipped),i.textBox&&os(t.textCollisionBox.collisionVertexArray,P.text.placed,!r||F,C,v,n.x,n.y),i.verticalTextBox&&os(t.textCollisionBox.collisionVertexArray,P.text.placed,!r||O,C,v,n.x,n.y)}const o=r&&Boolean(!O&&i.verticalIconBox);i.iconBox&&os(t.iconCollisionBox.collisionVertexArray,P.icon.placed,o,C,v,c.hasIconTextFit?n.x:0,c.hasIconTextFit?n.y:0),i.verticalIconBox&&os(t.iconCollisionBox.collisionVertexArray,P.icon.placed,!o,C,v,c.hasIconTextFit?n.x:0,c.hasIconTextFit?n.y:0)}}}if(t.fullyClipped=0===T,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){const i=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*i>e}isStale(){return this.stale}setStale(){this.stale=!0}}function os(e,t,i,n,r,o,s){e.emplaceBack(t?1:0,i?1:0,o||0,s||0,n,r?1:0),e.emplaceBack(t?1:0,i?1:0,o||0,s||0,n,r?1:0),e.emplaceBack(t?1:0,i?1:0,o||0,s||0,n,r?1:0),e.emplaceBack(t?1:0,i?1:0,o||0,s||0,n,r?1:0)}const ss=Math.pow(2,25),as=Math.pow(2,24),ls=Math.pow(2,17),cs=Math.pow(2,16),us=Math.pow(2,9),hs=Math.pow(2,8),ds=Math.pow(2,1);function fs(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,i=Math.floor(127*e.opacity);return i*ss+t*as+i*ls+t*cs+i*us+t*hs+i*ds+t}const ps=0;class ms{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(e,t,i,n,r,o){const s=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(s,n,e[this._currentTileIndex],this._sortAcrossTiles,o),this._currentTileIndex++,r())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,s.sort((e,t)=>e.sortKey-t.sortKey));this._currentPartIndex<s.length;)if(t.placeLayerBucketPart(s[this._currentPartIndex],this._seenCrossTileIDs,i,o),this._currentPartIndex++,r())return!0;return!1}}class _s{constructor(){this._retiredCI=null}startNewPlacement(e,t,i,n,r,o,s,a){return this.placement=new rs(e,n,r,o,s,a,this._retiredCI),this._retiredCI=null,this._currentPlacementIndex=t.length-1,this._forceFullPlacement=!1,this._showCollisionBoxes=i,this._fadeDuration=n,this._done=!1,this._inProgressLayer=null,this}requestFullPlacement(){this._forceFullPlacement=!0}isFullPlacementRequested(){return this._forceFullPlacement}setStale(){this.placement&&(this.placement.stale=!0)}isStale(){return!!this.placement&&this.placement.stale}isDone(){return this._done}continuePlacement(t,i,n,r,o){const s=e.e.now(),a=()=>!this.isFullPlacementRequested()&&0!==this._fadeDuration&&e.e.now()-s>2;for(;this._currentPlacementIndex>=0;){const s=i[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&"none"!==s.visibility&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){const t=s,i=t.layout.get("symbol-z-elevate"),l=void 0!==t.layout.get("symbol-sort-key").constantOr(1),c=t.layout.get("symbol-z-order"),u="viewport-y"===c||"auto"===c&&!("viewport-y"!==c&&l),h=t.layout.get("text-allow-overlap")||t.layout.get("icon-allow-overlap")||t.layout.get("text-ignore-placement")||t.layout.get("icon-ignore-placement"),d=u&&h,f=this._inProgressLayer=this._inProgressLayer||new ms(t),p=e.m(s.source,s.scope);if(f.continuePlacement(i||d?r[p]:n[p],this.placement,this._showCollisionBoxes,s,a,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._forceFullPlacement=!1,this._done=!0}commit(e){return this._retiredCI=this.placement.prevPlacement?this.placement.prevPlacement.collisionIndex:null,this.placement.commit(e),this.placement}}const gs=512/e.a6/2;class ys{constructor(t,i,n){this.tileID=t,this.bucketInstanceId=n,this.index=new e.dx(i.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const r=t.canonical.x*e.a6,o=t.canonical.y*e.a6;for(let e=0;e<i.length;e++){const{key:t,crossTileID:n,tileAnchorX:s,tileAnchorY:a}=i.get(e),l=Math.floor((r+s)*gs),c=Math.floor((o+a)*gs);this.index.add(l,c),this.keys.push(t),this.crossTileIDs.push(n)}this.index.finish()}findMatches(t,i,n){const r=this.tileID.canonical.z<i.canonical.z?1:Math.pow(2,this.tileID.canonical.z-i.canonical.z),o=gs/Math.pow(2,i.canonical.z-this.tileID.canonical.z),s=i.canonical.x*e.a6,a=i.canonical.y*e.a6;for(let e=0;e<t.length;e++){const i=t.get(e);if(i.crossTileID)continue;const{key:l,tileAnchorX:c,tileAnchorY:u}=i,h=Math.floor((s+c)*o),d=Math.floor((a+u)*o),f=this.index.range(h-r,d-r,h+r,d+r).sort((e,t)=>e-t);for(const e of f){const t=this.crossTileIDs[e];if(this.keys[e]===l&&!n.has(t)){n.add(t),i.crossTileID=t;break}}}}}class vs{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class xs{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const e in this.indexes){const i=this.indexes[e],n={};for(const e in i){const r=i[e];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),n[r.tileID.key]=r}this.indexes[e]=n}this.lng=e}addBucket(e,t,i){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]=new Set);const n=this.usedCrossTileIDs[e.overscaledZ];for(const i in this.indexes){const r=this.indexes[i];if(Number(i)>e.overscaledZ)for(const i in r){const o=r[i];o.tileID.isChildOf(e)&&o.findMatches(t.symbolInstances,e,n)}else{const o=r[e.scaledTo(Number(i)).key];o&&o.findMatches(t.symbolInstances,e,n)}}for(let e=0;e<t.symbolInstances.length;e++){const r=t.symbolInstances.get(e);r.crossTileID||(r.crossTileID=i.generate(),n.add(r.crossTileID))}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new ys(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const i of t.crossTileIDs)this.usedCrossTileIDs[e].delete(i)}removeStaleBuckets(e){let t=!1;for(const i in this.indexes){const n=this.indexes[i];for(const r in n)e[n[r].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[r]),delete n[r],t=!0)}return t}}class bs{constructor(){this.layerIndexes={},this.crossTileIDs=new vs,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,i,n){let r=this.layerIndexes[e.fqid];void 0===r&&(r=this.layerIndexes[e.fqid]=new xs);let o=!1;const s={};"globe"!==n.name&&r.handleWrapJump(i);for(const i of t){const t=i.getBucket(e);t&&e.fqid===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(i.tileID,t,this.crossTileIDs)&&(o=!0),s[t.bucketInstanceId]=!0)}return r.removeStaleBuckets(s)&&(o=!0),o}pruneUnusedLayers(e){const t={};e.forEach(e=>{t[e]=!0});for(const e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}function ws(e,t){const i=(t.right-t.left)/2,n=Math.abs(e.x-(t.left+i));if(n>=e.radius+i)return!1;const r=(t.bottom-t.top)/2,o=Math.abs(e.y-(t.top+r));if(o>=e.radius+r)return!1;if(n<i||o<r)return!0;const s=n-i,a=o-r;return s*s+a*a<e.radius*e.radius}function Ts(e,t){return"box"===e.kind&&"box"===t.kind?function(e,t){return e.left<t.right&&t.left<e.right&&e.top<t.bottom&&t.top<e.bottom}(e,t):"circle"===e.kind&&"circle"===t.kind?function(e,t){const i=e.x-t.x,n=e.y-t.y,r=e.radius+t.radius;return i*i+n*n<r*r}(e,t):"circle"===e.kind?ws(e,t):ws(t,e)}class Es{constructor(t,i,n,r){this._cellSize=r,this._padding=n,this._screenWidth=t,this._screenHeight=i,this._grid=new e.d2(t+2*n,i+2*n,r),this._workingArea=this._computeWorkingArea(),this._geometries=[],this._geometryData=[]}clearAndResize(t,i){t===this._screenWidth&&i===this._screenHeight?this._grid.clear():(this._screenWidth=t,this._screenHeight=i,this._grid=new e.d2(t+2*this._padding,i+2*this._padding,this._cellSize),this._workingArea=this._computeWorkingArea()),this._geometries.length=0,this._geometryData.length=0}_computeWorkingArea(){return{kind:"box",left:-this._padding,top:-this._padding,right:this._grid.xCellCount*this._cellSize-this._padding,bottom:this._grid.yCellCount*this._cellSize-this._padding}}intersects(e,t,i){let n="outside-of-grid";for(const r of e){const e=this._elementIntersects(r,t,i);if("intersects"===e)return"intersects";"does-not-intersect"===e&&(n="does-not-intersect")}return n}_elementIntersects(e,t,i){if(!Ts(e,this._workingArea))return"outside-of-grid";const n=this._padding,r=function(e,t){return 0===t?e:"box"===e.kind?{kind:"box",left:e.left-t,top:e.top-t,right:e.right+t,bottom:e.bottom+t}:{kind:"circle",x:e.x,y:e.y,radius:e.radius+t}}(e,t),o=e=>{if(!Ts(this._geometries[e],r))return!1;const t=this._geometryData[e];return void 0===t||!i(t)};return("box"===r.kind?this._grid.hitTest(r.left+n,r.top+n,r.right+n,r.bottom+n,o):this._grid.hitTestCircle(r.x+n,r.y+n,r.radius,o))?"intersects":"does-not-intersect"}insert(e,t){const i=this._padding;let n=!1;for(const r of e){if(!Ts(r,this._workingArea))continue;const e=this._geometries.length;this._geometries.push(r),this._geometryData.push(t),"box"===r.kind?this._grid.insert(e,r.left+i,r.top+i,r.right+i,r.bottom+i):this._grid.insertCircle(e,r.x+i,r.y+i,r.radius),n=!0}return n}}function Ss(e){return 2*e.styleLayerId+e.symbolIdOrigin}function Is(e,t){const i=e.get(Ss(t.symbolId));if(!i)return!1;const n=i.get(t.symbolId.symbolId);return void 0!==n&&n.has(t.variantIdx)}function As(e,t){const i=Ss(t.symbolId);let n=e.get(i);n||(n=new Map,e.set(i,n));let r=n.get(t.symbolId.symbolId);r||(r=new Set,n.set(t.symbolId.symbolId,r)),r.add(t.variantIdx)}class Ms{constructor(){this._runStarted=!1,this._grid=null,this._timestamp=0,this._symbols=[],this._ignoredSymbolVariantIds=new Map,this._onlyIfPlacedReferencedIds=new Map,this._placedVariantIds=new Map,this._placedSymbolIds=new Map,this._processingSource=null,this._variantProcessingStarted=!1}startPlacement(e,t,i){if(this._runStarted)throw new Error("Attempt to start a placement run before finishing the previous one");this._runStarted=!0,this._grid?this._grid.clearAndResize(t,i):this._grid=new Es(t,i,100,32),this._timestamp=e,this._symbols=[],this._ignoredSymbolVariantIds.clear(),this._onlyIfPlacedReferencedIds.clear(),this._placedVariantIds.clear(),this._placedSymbolIds.clear()}_hasPlacedSymbol(e){const t=this._placedSymbolIds.get(Ss(e));return void 0!==t&&t.has(e.symbolId)}_addPlacedSymbol(e){const t=Ss(e);let i=this._placedSymbolIds.get(t);i||(i=new Set,this._placedSymbolIds.set(t,i)),i.add(e.symbolId)}startSymbolSourceProcessing(e){if(!this._runStarted)throw new Error("Attempt to start symbol source processing outside of a placement run");if(this._processingSource)throw new Error("Attempt to start a placement symbol source processing before finishing the previous one");this._processingSource=e}startSymbolVariantProcessing(e,t,i){const n=this._processingSource;if(!n)throw new Error("Attempt to start a symbol variant processing outside of symbol source processing");if(this._variantProcessingStarted)throw new Error("Attempt to begin a symbol variant processing before finishing the previous one");this._symbols.push({priority:t,source:n,variantId:e,geometry:[],placementRules:i});const r=i.collisionRules;r&&(r.symbolVariantToIgnoreCollisionWith&&As(this._ignoredSymbolVariantIds,r.symbolVariantToIgnoreCollisionWith),r.onlyIfPlaced&&As(this._onlyIfPlacedReferencedIds,r.onlyIfPlaced)),this._variantProcessingStarted=!0}addGeometry(e){if(!this._variantProcessingStarted)throw new Error("Attempt to add geometry outside of symbol variant processing");this._symbols.at(-1).geometry.push(e)}finishVariantProcessing(){if(!this._variantProcessingStarted)throw new Error("Attempt to finish a symbol variant processing that was not started");this._variantProcessingStarted=!1;const t=this._symbols.at(-1);0===t.geometry.length&&(t.priority.symbolVariantVisibility===e.dy.VARIANT_VISIBLE&&t.source.hideSymbolVariant(t.variantId,this._timestamp),this._symbols.pop())}finishSourceProcessing(){this._processingSource=null}finishPlacementRun(){if(!this._runStarted)throw new Error("Attempt to finish a placement run that was not started");this._runStarted=!1;const t=this._grid,i=this._timestamp;this._symbols.sort((e,t)=>
vendor: 8,967 bytes, line 2
2function(e,t){return e.placementSubgroupOrder-t.placementSubgroupOrder||e.symbolPlacementPriority-t.symbolPlacementPriority||e.symbolVariantVisibility-t.symbolVariantVisibility||e.symbolPlacementType-t.symbolPlacementType||e.styleLayerOrder-t.styleLayerOrder||e.symbolDisplayOrder-t.symbolDisplayOrder}(t.priority,e.priority));for(const n of this._symbols){const r=n.priority.symbolVariantVisibility===e.dy.VARIANT_VISIBLE;let o=!0;if(this._hasPlacedSymbol(n.variantId.symbolId))o=!1;else if(n.placementRules.collisionRules){const e=n.placementRules.collisionRules.onlyIfPlaced;if(e&&!Is(this._placedVariantIds,e))o=!1;else{const e=n.placementRules.collisionRules.symbolVariantToIgnoreCollisionWith;"does-not-intersect"!==t.intersects(n.geometry,r?0:1,t=>{return void 0!==e&&(i=t).variantIdx===(n=e).variantIdx&&i.symbolId.styleLayerId===n.symbolId.styleLayerId&&i.symbolId.symbolIdOrigin===n.symbolId.symbolIdOrigin&&i.symbolId.symbolId===n.symbolId.symbolId;var i,n})&&(o=!1)}}if(o&&n.placementRules.insertIntoCollisionGrid){const e=Is(this._ignoredSymbolVariantIds,n.variantId)?n.variantId:void 0;t.insert(n.geometry,e)||(o=!1)}o&&(this._addPlacedSymbol(n.variantId.symbolId),Is(this._onlyIfPlacedReferencedIds,n.variantId)&&As(this._placedVariantIds,n.variantId)),r!==o&&(o?n.source.showSymbolVariant(n.variantId,i):n.source.hideSymbolVariant(n.variantId,i))}}}class Cs{constructor(){this._nextIdByLayer=new Map}allocateRange(e,t){const i=this._nextIdByLayer.get(e)||0;return this._nextIdByLayer.set(e,i+t),i}releaseLayer(e){this._nextIdByLayer.delete(e)}}class Ds extends e.E{constructor(e){super(),this.requestManager=e,this.models=Object.create(null),this.models[""]=Object.create(null),this.modelUris=Object.create(null),this.modelUris[""]=Object.create(null),this.modelByURL=Object.create(null),this.numModelsLoading=Object.create(null)}async loadModel(t,i){try{const n=await this.requestManager.transformRequest(i,e.R.Model);return this.modelByURL[i]?(await ai(),si.loadModel?await si.loadModel(n.url,t,i):null):null}catch(n){if(404===n.status)return null;this.fire(new e.f(new Error(`Could not load model ${t} from ${i}`,{cause:n})))}}load(t,i,n={forceReload:!1}){this.models[i]||(this.models[i]=Object.create(null));const r=Object.keys(t),o=[],s=[];for(const e of r){const r=t[e];this.hasURLBeenRequested(r)&&!n.forceReload||(this.modelByURL[r]={modelId:e,scope:i},o.push(this.loadModel(e,r)),s.push(e)),this.models[i][e]||(this.models[i][e]={model:null,numReferences:1})}this.numModelsLoading[i]=(this.numModelsLoading[i]||0)+s.length,Promise.allSettled(o).then(t=>{for(let e=0;e<t.length;e++){const{status:n}=t[e];if("rejected"===n)continue;const{value:r}=t[e];this.models[i][s[e]]||(this.models[i][s[e]]={model:null,numReferences:1}),this.models[i][s[e]].model=r}this.numModelsLoading[i]-=s.length,this.fire(new e.h("data",{dataType:"style"}))}).catch(t=>{this.fire(new e.f(new Error(`Could not load models: ${t.message}`)))})}isLoaded(){for(const e in this.numModelsLoading)if(this.numModelsLoading[e]>0)return!1;return!0}hasModel(e,t,i={exactIdMatch:!1}){return!!(i.exactIdMatch?this.getModel(e,t):this.getModelByURL(this.modelUris[t][e]))}getModel(e,t){return this.models[t]||(this.models[t]=Object.create(null)),this.models[t][e]?this.models[t][e].model:void 0}getModelByURL(e){if(!e)return null;const t=this.modelByURL[e];return t?this.models[t.scope][t.modelId].model:null}hasModelBeenAdded(e,t){return this.models[t]&&void 0!==this.models[t][e]}getModelURIs(e){return this.modelUris[e]||Object.create(null)}addModel(e,t,i){this.models[i]||(this.models[i]=Object.create(null)),this.modelUris[i]||(this.modelUris[i]=Object.create(null));const n=this.requestManager.normalizeModelURL(t);if((this.hasModel(e,i,{exactIdMatch:!0})||this.hasModelBeenAdded(e,i))&&this.modelUris[i][e]===n)this.models[i][e].numReferences++;else if(this.hasURLBeenRequested(n)){const{scope:e,modelId:t}=this.modelByURL[n];this.models[e][t].numReferences++}else this.modelUris[i][e]=n,this.load({[e]:this.modelUris[i][e]},i)}addModelURLs(e,t){this.models[t]||(this.models[t]=Object.create(null)),this.modelUris[t]||(this.modelUris[t]=Object.create(null));const i=this.modelUris[t];for(const t of Object.keys(e))i[t]=this.requestManager.normalizeModelURL(e[t])}reloadModels(e){this.load(this.modelUris[e],e,{forceReload:!0})}addModelsFromBucket(e,t){this.models[t]||(this.models[t]=Object.create(null)),this.modelUris[t]||(this.modelUris[t]=Object.create(null));const i=Object.create(null);for(const n of e)this.hasModel(n,t,{exactIdMatch:!0})||this.hasURLBeenRequested(n)?this.models[t][n].numReferences++:this.modelUris[t][n]&&!this.hasURLBeenRequested(n)?i[n]=this.modelUris[t][n]:!this.hasURLBeenRequested(n)&&Pe(n,!1)&&(this.modelUris[t][n]=this.requestManager.normalizeModelURL(n),i[n]=this.modelUris[t][n]);this.load(i,t)}hasURLBeenRequested(e){return void 0!==this.modelByURL[e]}removeModel(e,t,i=!1,n=!1){if(this.models[t]&&this.models[t][e]&&(this.models[t][e].numReferences--,0===this.models[t][e].numReferences||n)){const n=this.modelUris[t][e];i||delete this.modelUris[t][e],delete this.modelByURL[n];const r=this.models[t][e].model;if(!r)return;delete this.models[t][e],r.destroy()}}destroy(){for(const e of Object.keys(this.models))for(const t of Object.keys(this.models[e])){const i=this.models[e][t].model;delete this.models[e][t],i&&i.destroy()}this.models=Object.create(null),this.models[""]=Object.create(null),this.modelUris=Object.create(null),this.modelUris[""]=Object.create(null),this.modelByURL=Object.create(null),this.numModelsLoading=Object.create(null)}listModels(e){return this.models[e]||(this.models[e]=Object.create(null)),Object.keys(this.models[e])}upload(e,t){this.models[t]||(this.models[t]=Object.create(null));for(const i in this.models[t])this.models[t][i].model&&this.models[t][i].model.upload(e.context)}}const Ps=["RENDER_SHADOWS","NORMAL_OFFSET"],Rs=new Set(["symbol","circle"]),Ls=class t{constructor(){this._queue=[],this._needsBuild=!0,this._idleHandle=null}needsBuild(){return this._needsBuild}buildQueue(e,t,i){null!=this._idleHandle&&"undefined"!=typeof cancelIdleCallback&&cancelIdleCallback(this._idleHandle),this._idleHandle=null,this._queue=[],this._needsBuild=!1;const n=!!i.fog,r=i.hasTerrain(),o=!(!i.projection||"globe"!==i.projection.name),s=r||o,a=!(!i.directionalLight||!i.directionalLight.shadowsEnabled()),l=i.map&&i.map.painter,c=!l||!l.context.extParallelShaderCompile,u=!!l&&("mrt-fallback"===l.emissiveMode||"mrt-full-rgba"===l.emissiveMode),h=(e,t=[],i={})=>{this._queue.push({programId:e,params:{...i.params,defines:t,overrideFog:!!i.fog,overrideTerrain:!!i.terrain,overrideGlobe:!!i.globe,overrideRtt:!!i.rtt,precompiled:!0}})};for(const d of e){if("none"===d.visibility)continue;const e=d.getProgramIds();if(e)for(const f of e){if(Rs.has(f))continue;const e=d.getDefaultProgramParams(f,t.zoom,i._styleColorTheme.lut);if(!e)continue;const p=l?l.getShaderSource(f):null,m=s&&(!p||p.usedDefines.has("RENDER_TO_TEXTURE"));let _=e.defines;if(u&&m&&(_=(_||[]).concat("USE_MRT1"),"mrt-full-rgba"===l.emissiveMode&&(_=(_||[]).concat("USE_MRT1_RGBA"))),c){h(f,e.defines,{params:e}),m&&h(f,_,{params:e,rtt:!0});continue}const g=n&&(!p||p.usedDefines.has("FOG")),y=r&&!d.isDraped()&&(!p||p.usedDefines.has("TERRAIN")),v=o&&(!p||p.usedDefines.has("GLOBE")),x=a&&d.hasElevation()&&(!p||p.usedDefines.has("RENDER_SHADOWS"));for(const t of x?[!1,!0]:[!1]){const i=t?(e.defines||[]).concat(Ps):e.defines||[];for(const t of y?[!1,!0]:[!1])for(const n of v?[!1,!0]:[!1])for(const r of g?[!1,!0]:[!1])h(f,i,{params:e,fog:r,terrain:t,globe:n})}m&&h(f,_,{params:e,rtt:!0})}}if(h("clippingMask"),r)for(const e of[!1,!0])h("terrainRaster",e?["TERRAIN_VERTEX_MORPHING"]:[],{terrain:!0,fog:n});if(!c){if(e.some(e=>"hillshade"===e.type)&&h("hillshadePrepare"),a)for(const e of[!1,!0])for(const t of[!1,!0]){const i=[];e&&i.push("RENDER_CUTOFF"),i.push("RENDER_SHADOWS"),t&&i.push("NORMAL_OFFSET"),h("groundShadow",i),n&&h("groundShadow",i,{fog:!0})}if(o){for(const e of[[],["TERRAIN_VERTEX_MORPHING"],["GLOBE_POLES"]])for(const t of[!1,!0]){const i=[...e,"PROJECTION_GLOBE_VIEW"];t&&i.push("CUSTOM_ANTIALIASING"),h("globeRaster",i,{terrain:r,globe:!0,fog:n})}for(const e of[!1,!0]){const t=e?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];h("globeAtmosphere",t,{fog:!0,terrain:r,globe:e}),h("globeAtmosphere",[...t,"ALPHA_PASS"],{fog:!0,terrain:r,globe:e})}h("stars",[],{fog:n,terrain:r,globe:!0})}}}_executeBatch(i,n,r){if(r.map&&r.map.isMoving())return void(this._idleHandle=e.e.requestIdleCallback(e=>this._executeBatch(e,n,r)));n.context.sweepPendingPrograms();const o=n.context.extParallelShaderCompile?t.DEADLINE_MARGIN_KHR_MS:t.DEADLINE_MARGIN_SYNC_MS;let s=0;for(;this._queue.length>0;){const e=this._queue.shift();if(!e)break;if(e.programId in co&&(n.style=r,n._fogVisible=!!e.params.overrideFog,n.getOrCreateProgram(e.programId,e.params),s++,i.timeRemaining()<=o))break}const a=0===this._queue.length||i.timeRemaining()>o;s>
vendor: 4,996 bytes, line 2
20&&a&&n.context.gl.flush(),this._idleHandle=this._queue.length>0||n.context._pendingPrograms.size>0?e.e.requestIdleCallback(e=>this._executeBatch(e,n,r)):null}processQueue(t,i){0!==this._queue.length&&(null!=this._idleHandle&&"undefined"!=typeof cancelIdleCallback&&cancelIdleCallback(this._idleHandle),this._idleHandle=e.e.requestIdleCallback(e=>this._executeBatch(e,t,i)))}reset(){null!=this._idleHandle&&"undefined"!=typeof cancelIdleCallback&&cancelIdleCallback(this._idleHandle),this._queue=[],this._idleHandle=null,this._needsBuild=!0}};Ls.DEADLINE_MARGIN_KHR_MS=5,Ls.DEADLINE_MARGIN_SYNC_MS=25;let zs=Ls;const Fs=e.s.colorTheme,Os=new e.ag({data:new e.ah(Fs.data)});function ks(t){if(!t.metadata||!t.metadata.content_area)return;const i=e.e.devicePixelRatio,{left:n,top:r,width:o,height:s}=t.metadata.content_area,a=n*i,l=r*i;return[a,l,a+o*i,l+s*i]}function Bs(t){if(t)return t.map(([t,i])=>[t*e.e.devicePixelRatio,i*e.e.devicePixelRatio])}class Ns{constructor(e,t,i){this.id=e,this.scope=t,this.sourceCache=i,this.pendingRequests=new Set,this.missingRequests=new Set}addPendingRequest(e){this.missingRequests.has(e.name)||this.pendingRequests.has(e.name)||this.pendingRequests.add(e.name)}hasPendingRequests(){return this.pendingRequests.size>0}resolvePendingRequests(){const t=new Map;if(!this.sourceCache.loaded())return t;const i=this.sourceCache.getVisibleCoordinates();if(0===i.length)return t;const n=this.sourceCache.getSource();if("raster-array"!==n.type)return t;const r=i.map(e=>this.sourceCache.getTile(e)),o=n.getImages(r,Array.from(this.pendingRequests));for(const[i,n]of o)t.set(e.I.from({name:i,iconsetId:this.id}),n),this.pendingRequests.delete(i);for(const e of this.pendingRequests)this.missingRequests.add(e);return this.pendingRequests.clear(),t}}const Vs=(e,t)=>xt(e,t&&t.filter(e=>"source.canvas"!==e.identifier)),Us=new Set(["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setLayerProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport","addIconset","removeIconset"]),js=new Set(["setCenter","setZoom","setBearing","setPitch"]),Gs=new Set(["background","sky","slot","custom","placement-group"]),$s={version:8,layers:[],sources:{}},Hs={duration:300,delay:0};class Zs extends e.E{constructor(t,i={}){super(),this.map=t,this.scope=i.scope||"",this.globalId=null,this.fragments=[],this.importDepth=i.importDepth||0,this.importsCache=i.importsCache||new Map,this.resolvedImports=i.resolvedImports||new Set,this.transition={...Hs},this._buildingIndex=new Vo(this),this.crossTileSymbolIndex=new bs,this.globalPlacement=null,this.symbolIdRangeAllocator=new Cs,this._groupOrders=null,this._groupOrdersVersion=-1,this._mergedOrder=[],this._mergedOrderVersion=0,this._drapedFirstOrder=[],this._mergedLayers=Object.create(null),this._mergedIndoor={},this._indoorEnabled=!1,this._mergedSourceCaches={},this._mergedOtherSourceCaches=Object.create(null),this._mergedSymbolSourceCaches=Object.create(null),this._mergedFillExtrusionSourceCaches=Object.create(null),this._mergedHdRoadCoverageSourceCaches=Object.create(null),this._hdCoverage=null,this._hdElevation=null,this._crossSourceElevationActive=!1,this._clipLayerPresent=!1,this._hasAppearances=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._importedAsBasemap=!1,this._changes=i.styleChanges||new x,this._hasDataDrivenEmissive=!1,this.indoorManager=null,this.dispatcher=i.dispatcher?i.dispatcher:new Jt(jo(),this);const n={referrer:e.dA(),config:e.dT()};if(this.map.painter&&this.map.painter.context){const e=this.map.painter.context.maxUniformBufferBindings,t=Math.floor(this.map.painter.context.maxUniformBlockSize/4);n.contextOptions={maxBindingPoints:e,maxUniformBlockSizeDwords:t}}this.isRootStyle()&&this.dispatcher.broadcast("setGlobalParams",n),i.imageManager?this.imageManager=i.imageManager:(this.imageManager=new le(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.addScope(this.scope),this.glyphManager=i.glyphManager?i.glyphManager:new e.dB(t._requestManager,i.localFontFamily?e.dC.all:i.localIdeographFontFamily?e.dC.ideographs:e.dC.none,i.localFontFamily||i.localIdeographFontFamily,i.fontstackCompositing),i.modelManager?this.modelManager=i.modelManager:(this.modelManager=new Ds(t._requestManager),this.modelManager.setEventedParent(this)),this._layers=Object.create(null),this._sourceCaches={},this._otherSourceCaches=Object.create(null),this._symbolSourceCaches=Object.create(null),this._fillExtrusionSourceCaches=Object.create(null),this._hdCoverage=null,this._hdElevation=null,this._crossSourceElevationActive=!1,this._loaded=!1,this._drapingLoaded=void 0,this._initialBroadcastDone=!1,this._programPrecompiler=this.map._precompilePrograms&&this.isRootStyle()?new zs:null,this._availableImages=[],this._availableModels={}
vendor: 18,198 bytes, line 2
2,this._order=[],this._markersNeedUpdate=!1,this.options=i.configOptions?i.configOptions:new Map,this._layerExpressionDependencies=i.layerExpressionDependencies?i.layerExpressionDependencies:new Map,this._config=i.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:i.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=i.initialConfig;const r=this;this._rtlTextPluginCallback=Zs.registerForPluginStateChange(t=>{r.dispatcher.send("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL}).then(t=>{if(e.dD(null),t.every(e=>e))for(const e in r._sourceCaches){const t=r._sourceCaches[e],i=t.getSource().type;"vector"!==i&&"geojson"!==i||t.reload()}}).catch(t=>{e.dD(t)})}),this.on("data",e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.getOwnSource(e.sourceId);if(t&&t.vectorLayerIds)for(const e in this._layers){const i=this._layers[e];i.source===t.id&&this._validateLayer(i)}})}load(e){return e?("string"==typeof e?this.loadURL(e):this.loadJSON(e),this):this}_getGlobalId(t){if(!t)return null;if("string"==typeof t){if(e.cG(t))return t;const i=e.dE(t);if(!i.startsWith("http"))try{return new URL(i,location.href).toString()}catch(e){return i}return i}return`json://${e.dF(JSON.stringify(t))}`}_diffStyle(t,i,n){this.globalId=this._getGlobalId(t),vt();const r=(e,t)=>{try{t(null,this.setState(e,n))}catch(e){t(e,!1)}};if("string"==typeof t){const n=this.map._requestManager.normalizeStyleURL(t),o=new AbortController;this._request={cancel:()=>o.abort()},(async()=>{const t=await this.map._requestManager.transformRequest(n,e.R.Style,o.signal),{data:s}=await e.g(t,o.signal);this._request=null,r(s,i)})().catch(t=>{this._request=null,o.signal.aborted||this.fire(new e.f(t))})}else"object"==typeof t&&r(t,i)}loadURL(t,i={}){this.fire(new e.h("dataloading",{dataType:"style"}));const n="boolean"==typeof i.validate?i.validate:!e.cG(t);n&&vt(),this.globalId=this._getGlobalId(t),t=this.map._requestManager.normalizeStyleURL(t,i.accessToken),this.resolvedImports.add(t);const r=this.importsCache.get(t);if(r)return void this._load(r,n);const o=new AbortController;this._request={cancel:()=>o.abort()},(async()=>{const i=await this.map._requestManager.transformRequest(t,e.R.Style,o.signal),{data:r}=await e.g(i,o.signal);this._request=null,this.importsCache.set(t,r),this._load(r,n)})().catch(t=>{this._request=null,o.signal.aborted||this.fire(new e.f(t))})}loadJSON(t,i={}){this.fire(new e.h("dataloading",{dataType:"style"}));const n=!1!==i.validate;n&&vt(),this.globalId=this._getGlobalId(t),this._request=e.e.frame(()=>{this._request=null,this._load(t,n)})}loadEmpty(){this.fire(new e.h("dataloading",{dataType:"style"})),this._load($s,!1)}_loadImports(t,i,n){if(this.importDepth>=4)return e.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const r=[];for(const o of t){const t=this._createFragmentStyle(o),s=new Promise(e=>{t.once("style.import.load",e),t.once("error",e)}).then(()=>{this.mergeAll(),this.fire(new e.h("data",{dataType:"style"}))});if(r.push(s),this.resolvedImports.has(o.url)){t.loadEmpty();continue}const a=o.data||this.importsCache.get(o.url);a?(o.data?(t.fire(new e.h("dataloading",{dataType:"style"})),t.globalId=t._getGlobalId(a),i&&vt(),queueMicrotask(()=>{t._load(a,i)})):t.loadJSON(a,{validate:i}),this._isInternalStyle(a)&&(t.globalId=null)):o.url?t.loadURL(o.url,{validate:i}):t.loadEmpty();const l={style:t,id:o.id,config:o.config};if(n){const e=this.fragments.findIndex(({id:e})=>e===n);this.fragments=this.fragments.slice(0,e).concat(l).concat(this.fragments.slice(e))}else this.fragments.push(l)}return Promise.allSettled(r)}getImportGlobalIds(e=this,t=new Set){for(const i of e.fragments)i.style.globalId&&t.add(i.style.globalId),this.getImportGlobalIds(i.style,t);return[...t.values()]}_createFragmentStyle(t){const i=this.scope?e.m(t.id,this.scope):t.id;let n;const r=this._initialConfig&&this._initialConfig[i];(t.config||r)&&(n={...t.config,...r});const o=new Zs(this.map,{scope:i,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:n,configOptions:this.options,colorThemeOverride:t["color-theme"],layerExpressionDependencies:this._layerExpressionDependencies});return o.setEventedParent(this.map,{style:o}),o}_reloadImports(e=!1){this.mergeAll(),this._updateMapProjection(),e||this.updateConfigDependencies(),this._updateLayers(this._dependentLayerIds(e=>e.isIndoorDependent)),this.map._triggerCameraUpdate(this.camera),(!e||this.isRootStyle()||this.map.style._initialBroadcastDone)&&(e&&this.isRootStyle()?(this.forEachFragmentStyle(e=>{this.dispatcher.broadcast("setLayers",{layers:e._serializeLayers(e._order),scope:e.scope,options:e.options})}),this._initialBroadcastDone=!0):this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}))}_isInternalStyle(e){return this.isRootStyle()&&(e.fragment||!!e.schema&&!1!==e.fragment)}async _load(t,i){if(this._isInternalStyle(t)){const e={id:"basemap",data:t,url:""},n={...$s,imports:[e],...t.center?{center:t.center}:{},...t.bearing?{bearing:t.bearing}:{},...t.pitch?{pitch:t.pitch}:{},...t.zoom?{zoom:t.zoom}:{},...t.light?{light:t.light}:{}};return this._importedAsBasemap=!0,void this._load(n,i)}if(this.updateConfig(this._config,t.schema),i){if(await vt(),!this.dispatcher.actors.length)return;if(Vs(this,wt(t)))return}this._loaded=!0;for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1,isInitialLoad:!0});this.stylesheet=e.dG(t);const n=()=>{if(t.iconsets)for(const e in t.iconsets)this.addIconset(e,t.iconsets[e]);t.sprite?this._loadIconset(t.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope})),!this.glyphManager.url&&t.glyphs&&this.glyphManager.setURL(t.glyphs);const n=$o(this.stylesheet.layers);if(this._order=n.map(e=>e.id),this.stylesheet.light&&e.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){const e=this.stylesheet.lights[0];this.light=new kt(e.properties,e.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new kt(this.stylesheet.light)),this._layers=Object.create(null);let r=!1;for(const t of n){const i=e.dM(t,this.scope,this._styleColorTheme.lut,this.options);this._layerExpressionDependencies.set(i.fqid,new b(i)),this._hasAppearances=this._hasAppearances||0!==i.getAppearances().length,i.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=i,this._updateHdCoverageSourceCache(i)&&(r=!0);const n=this.getOwnLayerSourceCache(i),o=!!this.directionalLight&&this.directionalLight.shadowsEnabled();n&&i.canCastShadows()&&o&&(n.castsShadows=!0)}if(r&&Hn().then(()=>{if(!this.map)return;for(const e in this._layers)this._updateHdCoverageSourceCache(this._layers[e]);this.map.style.mergeAll();const e=this.map.transform;for(const t in this.map.style._mergedHdRoadCoverageSourceCaches){const i=this.map.style._mergedHdRoadCoverageSourceCaches[t];i.used=!0,e&&i.update(e)}this.map._update()}),this.glyphManager.url){const e=new Set;for(const t in this._layers){const i=this._layers[t];if("symbol"===i.type&&i.layout){const t=i.layout.get("text-font");t&&t.value&&"constant"===t.value.kind&&e.add(t.value.value.join(","))}}for(const t of e)this.glyphManager.prefetchRange(t,0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.addModelURLs(this.stylesheet.models);const o=this.stylesheet.terrain;o&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||(this._startLiteLoad(),this._createTerrain(o,1))),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new e.h("data",{dataType:"style"}));const s=this.isRootStyle();t.imports?this._loadImports(t.imports,i).then(()=>{this._reloadImports(!0),this.fire(new e.h(s?"style.load":"style.import.load"))}).catch(t=>{this.fire(new e.f(new Error("Failed to load imports",t))),this.fire(new e.h(s?"style.load":"style.import.load"))}):(this._reloadImports(!0),this.fire(new e.h(s?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const r=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(r){const t=this._evaluateColorThemeData(r);this._loadColorTheme(t).then(()=>{n()}).catch(t=>{e.w(`Couldn't load color theme from the stylesheet: ${t}`),n()})}else this._styleColorTheme.lut=null,n()}isRootStyle(){return 0===this.importDepth}hasAppearances(){return this._hasAppearances||this.fragments.some(e=>e.style.hasAppearances())}mergeAll(){let e,t,i,n,r,o,s,a,l,c;const u={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(h=>{if(h.stylesheet){if(h.disableElevatedTerrain&&(this.disableElevatedTerrain=!0),null!=h.light&&(e=h.light),h.stylesheet.lights)for(const e of h.stylesheet.lights)"ambient"===e.type&&null!=h.ambientLight&&(t=h.ambientLight),"directional"===e.type&&null!=h.directionalLight&&(i=h.directionalLight);n=this._prioritizeTerrain(n,h.terrain,h.stylesheet.terrain),h.stylesheet.fog&&null!=h.fog&&(r=h.fog),h.stylesheet.snow&&null!=h.snow&&(o=h.snow),h.stylesheet.rain&&null!=h.rain&&(s=h.rain),null!=h.stylesheet.camera&&(c=h.stylesheet.camera),null!=h.stylesheet.projection&&(a=h.stylesheet.projection),null!=h.stylesheet.transition&&(l=h.stylesheet.transition),u[h.scope]=h._styleColorTheme}}),this.light=e,this.ambientLight=t,this.directionalLight=i,this.fog=r,this.snow=o,this.rain=s,this._styleColorThemeForScope=u,null===n?delete this.terrain:this.terrain=n,this.camera=c||{"camera-projection":"perspective"},this.projection=a||{name:"mercator"},this.transition={...Hs,...l},this.mergeSources(),this.mergeLayers(),this.mergeIndoor(),this._programPrecompiler&&this._programPrecompiler.reset()}forEachFragmentStyle(e){const t=i=>{for(const e of i.fragments)t(e.style);e(i)};t(this)}_prioritizeTerrain(e,t,i){const n=e&&0===e.drapeRenderMode;return null===i?t&&0===t.drapeRenderMode?t:n?e:null:null!=t&&(!e||n||t&&1===t.drapeRenderMode)?t:e}mergeTerrain(){let e;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(t=>{e=this._prioritizeTerrain(e,t.terrain,t.stylesheet.terrain)}),null===e?delete this.terrain:this.terrain=e,this._programPrecompiler&&this._programPrecompiler.reset()}mergeProjection(){let e;this.forEachFragmentStyle(t=>{null!=t.stylesheet.projection&&(e=t.stylesheet.projection)}),this.projection=e||{name:"mercator"},this._programPrecompiler&&this._programPrecompiler.reset()}mergeSources(){const t={},i=Object.create(null),n=Object.create(null),r=Object.create(null),o=Object.create(null);this.forEachFragmentStyle(s=>{for(const i in s._sourceCaches){const n=e.m(i,s.scope);t[n]=s._sourceCaches[i]}for(const t in s._otherSourceCaches){const n=e.m(t,s.scope);i[n]=s._otherSourceCaches[t]}for(const t in s._symbolSourceCaches){const i=e.m(t,s.scope);n[i]=s._symbolSourceCaches[t]}for(const t in s._fillExtrusionSourceCaches){const i=e.m(t,s.scope);r[i]=s._fillExtrusionSourceCaches[t]}if(s._hdCoverage){const t=s._hdCoverage.coverageSourceCaches;for(const i in t)o[e.m(i,s.scope)]=t[i]}}),this._mergedSourceCaches=t,this._mergedOtherSourceCaches=i,this._mergedSymbolSourceCaches=n,this._mergedFillExtrusionSourceCaches=r,this._mergedHdRoadCoverageSourceCaches=o,Object.keys(o).length>0&&!this._hdCoverage&&$n.HdCoverageState&&(this._hdCoverage=new $n.HdCoverageState),$n.updateCrossSourceElevationGate&&$n.updateCrossSourceElevationGate(this)}mergeIndoor(){this._mergedIndoor={},this.forEachFragmentStyle(t=>{if(t.stylesheet&&t.stylesheet.indoor)for(const i of Object.values(t.stylesheet.indoor)){const n=i,r=e.m(n.sourceId,t.scope);this._mergedIndoor[r]=new Set(n.sourceLayers||[])}}),this._updateIndoorEnabled()}_updateIndoorEnabled(){const t=this._indoorEnabled;if(this._indoorEnabled=!1,Object.keys(this._mergedIndoor).length>0)for(const t of this._mergedOrder){const i=this._mergedLayers[t];if("none"!==i.visibility&&this._mergedIndoor[e.m(i.source,i.scope)]){this._indoorEnabled=!0;break}}!this._indoorEnabled||t||this.indoorManager||Hn().then(()=>{this._initIndoorManager()})}_initIndoorManager(){if(!this.indoorManager&&$n.IndoorManager&&this.isRootStyle()&&0!==Object.keys(this._mergedIndoor).length&&(this.indoorManager=new $n.IndoorManager(this,this._loaded),this._loaded))for(const e of Object.keys(this._mergedIndoor)){const t=this._mergedSourceCaches[e]||this._mergedOtherSourceCaches[e];t&&t.reload()}}mergeLayers(){const t={},i=[],n=Object.create(null);this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle(n=>{for(const r of n._order){const o=n._layers[r];if("slot"===o.type){const i=e.dH(r);if(t[i])continue;t[i]=[]}o.slot&&t[o.slot]?t[o.slot].push(o):i.push(o)}}),this._mergedOrder=[];let r=-1;const o=(i=[])=>{for(const s of i)if("slot"===s.type){const i=e.dH(s.id);t[i]&&o(t[i]),this._mergedSlots.push(i)}else{const t=e.m(s.id,s.scope);this._mergedOrder.push(t),n[t]=s,s.is3D(!!this.terrain)&&(this._has3DLayers=!0,r=this._mergedOrder.length-1),"circle"===s.type&&(this._hasCircleLayers=!0),"symbol"===s.type&&(this._hasSymbolLayers=!0),"clip"===s.type&&(this._clipLayerPresent=!0)}};if(o(i),this._has3DLayers){const e={};for(let t=0;t<this._mergedOrder.length;++t){const i=this._mergedOrder[t];e[i]=t===r?1:t<r?n[i].hasOcclusionOpacityProperties?2:0:4}this._mergedOrder.sort((t,i)=>e[t]-e[i])}this._mergedLayers=n,this._mergedOrderVersion++,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged(),this._updateDataDrivenEmissiveStrength()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(e){return this.stylesheet.camera={...this.stylesheet.camera,...e},this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(t){return t.data?function(t,i,n){const r={...i};for(const e of Object.keys(Fs))void 0===r[e]&&(r[e]=Fs[e].default);const o=new e.af(Os,t,new Map(n));return o.setTransitionOrValue(r,n),o.untransitioned().possiblyEvaluate(new e.aj(0,{worldview:void 0}))}(this.scope,t,this.options).get("data"):null}_loadColorTheme(t){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const i=this._styleColorTheme.lutLoadingCorrelationID;return new Promise((n,r)=>{const o="data:image/png;base64,";if(!t||0===t.length)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void n();let s=t;s.startsWith(o)||(s=o+s);const a=e.I.from("mapbox-reserved-lut"),l=new Image;l.src=s,l.onerror=()=>{this._styleColorTheme.lutLoading=!1,r(new Error("Failed to load image data"))},l.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==i)return void n();this._styleColorTheme.lutLoading=!1;const{width:o,height:s,data:c}=e.e.getImageData(l);if(s>32)return void r(new Error("The height of the image must be less than or equal to 32 pixels."));if(o!==s*s)return void r(new Error("The width of the image must be equal to the height squared."));this.getImage(a)&&this.removeImage(a),this.addImage(a,{data:new e.b({width:o,height:s},c),pixelRatio:1,sdf:!1,usvg:!1,version:0});const u=this.imageManager.getImage(a,this.scope);u?(this._styleColorTheme.lut={image:u.data,data:t},n()):r(new Error("Missing LUT image."))}})}getLut(e){const t=this._styleColorThemeForScope[e];return t?t.lut:null}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this.map.transform.projection.requiresDraping&&this._startLiteLoad(),this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(t){const i=new AbortController;this._spriteRequest=i,function(t,i,n,r){let o,s,a;const l=e.e.devicePixelRatio>1?"@2x":"";function c(t){a||t&&n.aborted||(t&&(a=t),function(){if(a)r(a);else if(o&&s){const t=e.e.getImageData(s),i={};for(const n in o){const{width:r,height:s,x:a,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:d,content:f}=o[n],p=new e.b({width:r,height:s});e.b.copy(t,p,{x:a,y:l},{x:0,y:0},{width:r,height:s},null),i[n]={data:p,pixelRatio:void 0!==u?u:1,sdf:void 0!==c&&c,stretchX:h,stretchY:d,content:f,usvg:!1,version:0}}r(null,i)}}())}(async function(){const r=await i.transformRequest(i.normalizeSpriteURL(t,l,".json"),e.R.SpriteJSON,n),{data:s}=await e.g(r,n);a||(o=s)})().then(()=>c(void 0),e=>c(e)),async function(){const r=await i.transformRequest(i.normalizeSpriteURL(t,l,".png"),e.R.SpriteImage,n),{data:o}=await e.a(r,n);a||(s=o)}().then(()=>c(void 0),e=>c(e))}(t,this.map._requestManager,i.signal,(t,i)=>{if(this._spriteRequest=null,t)this.dispatcher.broadcast("spriteLoaded",{scope:this.scope}),this.fire(new e.f(t));else if(i){const t=new Map;for(const n in i)t.set(e.I.from(n),i[n]);this.addImages(t,!0)}this.imageManager.setLoaded(!0,this.scope),this.fire(new e.h("data",{dataType:"style"}))})}addIconset(t,i){if("sprite"===i.type)return void this._loadSprite(i.url);const n=this.getOwnSourceCache(i.source);if(!n)return void this.fire(new e.f(new Error(`Source "${i.source}" as specified by iconset "${t}" does not exist and cannot be used as an iconset source`)));
2if("raster-array"!==n.getSource().type)return void this.fire(new e.f(new Error(`Source "${i.source}" as specified by iconset "${t}" is not a "raster-array" source and cannot be used as an iconset source`)));const r=new Ns(t,this.scope,n);this.imageManager.addImageProvider(r,this.scope)}removeIconset(e){this.imageManager.removeImageProvider(e,this.scope)}_loadIconset(t){if(!e.cG(t)&&"icon_set"!==this.map._spriteFormat||"raster"===this.map._spriteFormat)return void this._loadSprite(t);const i="auto"===this.map._spriteFormat,n=new AbortController;this._spriteRequest=n,async function(t,i,n,r){try{const o=await i.transformRequest(i.normalizeIconsetURL(t),e.R.Iconset,n),{data:s}=await e.d0(o,n),a={},l=function(e){const t={icons:[]};let i;for(;i=e.nextField(void 0);)1===i&&t.icons.push(S(e,e.readVarint()+e.pos));return t}(new e.c$(s));for(const t of l.icons){const i={version:1,pixelRatio:e.e.devicePixelRatio,content:ks(t),stretchX:t.metadata?Bs(t.metadata.stretch_x_areas):void 0,stretchY:t.metadata?Bs(t.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:t};a[t.name]=i}r(null,a)}catch(e){n.aborted||r(e)}}(t,this.map._requestManager,n.signal,(n,r)=>{if(this._spriteRequest=null,n)i?this._loadSprite(t):(this.dispatcher.broadcast("spriteLoaded",{scope:this.scope}),this.fire(new e.f(n)));else if(r){const t=new Map;for(const i in r)t.set(e.I.from(i),r[i]);this.addImages(t,!0)}this.imageManager.setLoaded(!0,this.scope),this.fire(new e.h("data",{dataType:"style"}))})}_validateLayer(t){const i=this.getOwnSource(t.source);if(!i)return;const n=t.sourceLayer;
vendor: 4,919 bytes, line 2
2n&&("geojson"===i.type||i.vectorLayerIds&&!i.vectorLayerIds.includes(n))&&this.fire(new e.f(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;if(!this.imageManager.isLoaded())return!1;if(this.imageManager.hasPatternsInFlight())return!1;if(!this.modelManager.isLoaded())return!1;if(this._styleColorTheme.lutLoading)return!1;if(!1===this._drapingLoaded)return!1;for(const{style:e}of this.fragments)if(!e.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((e,t)=>{const i=this.fragments[t];return i&&i.style&&(e.data=i.style.serialize()),e})}_serializeSources(){const e={};for(const t in this._sourceCaches){const i=this._sourceCaches[t].getSource();e[i.id]||(e[i.id]=i.serialize())}return e}_serializeLayers(e){const t=[];for(const i of e){const e=this._layers[i];e&&"custom"!==e.type&&t.push(e.serialize())}return t}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return!!this.snow&&this.snow.hasTransition()}hasRainTransition(){return!!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions())return!0;if(this.hasFogTransition())return!0;if(this.hasSnowTransition())return!0;if(this.hasRainTransition())return!0;for(const e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_updateDataDrivenEmissiveStrength(){for(const e in this._mergedLayers){const t=this._mergedLayers[e];if(t._transitionablePaint&&t._transitionablePaint._values){const e=t._transitionablePaint._values["line-emissive-strength"];if(e&&e.value&&e.value.isDataDriven())return void(this._hasDataDrivenEmissive=!0)}}this._hasDataDrivenEmissive=!1}hasDataDrivenEmissiveStrength(){return this._hasDataDrivenEmissive}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(e){return e?this.order:this._mergedOrder}isLayerDraped(e){return!!this.terrain&&e.isDraped(this.getLayerSourceCache(e))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(t){const i=this.getOwnLayer(t);if(i)return i;this.fire(new e.f(new Error(`The layer '${t}' does not exist in the map's style.`)))}_checkSource(t){const i=this.getOwnSource(t);if(i)return i;this.fire(new e.f(new Error(`The source '${t}' does not exist in the map's style.`)))}_resolveLayerFragment(t){const i=this.getLayer(t);if(!i)return void this.fire(new e.f(new Error(`The layer '${t}' does not exist in the map's style.`)));const n=this.getFragmentStyle(i.scope);return n?{layer:i,fragment:n}:void 0}handleIdle(){const e=this.map.painter;e&&(e.context.sweepPendingPrograms(),this._programPrecompiler&&this._programPrecompiler.processQueue(e,this))}handleContextLost(){this._programPrecompiler&&this._programPrecompiler.reset()}update(t){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(t),this.directionalLight&&this.directionalLight.recalculate(t);const i=this.calculateLightsBrightness();t.brightness=i||0;let n=!1;i!==this._brightness&&(this._brightness=i,n=!0),t.worldview!==this._worldview&&(this._worldview=t.worldview,n=!0),n&&this.dispatcher.broadcast("upsertRenderParams",{brightness:this._brightness,worldview:this._worldview});const r=this._changes.isDirty();let o=!1;if(this._changes.isDirty()){const e=this._changes.getLayerUpdatesByScope();for(const t in e){const{updatedIds:i,removedIds:n}=e[t];(i||n)&&(this._updateWorkerLayers(t,i,n),o=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(t),this.light&&this.light.updateTransitions(t),this.ambientLight&&this.ambientLight.updateTransitions(t),this.directionalLight&&this.directionalLight.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this.snow&&this.snow.updateTransitions(t),this.rain&&this.rain.updateTransitions(t),this._changes.reset()}const s={};for(const e in this._mergedSourceCaches){const t=this._mergedSourceCaches[e];s[e]=t.used,t.used=!1,t.tileCoverLift=0}const a={};for(const i of this._mergedOrder){const n=this._mergedLayers[i];if(("none"!==n.visibility||n.hasTransition())&&n.recalculate(t,this._availableImages),!n.isHidden(t.zoom)){n.mayUse("HD")&&(n.prepare(),Hn()),n.mayUse("Standard")&&(n.prepare(),ai()),n.mayUse("Lite")&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this._startLiteLoad());const e=this.getLayerSourceCache(n);e&&(e.used=!0,e.tileCoverLift=Math.max(e.tileCoverLift,n.tileCoverLift()))}
2if(n.source){const t=e.m(n.source,n.scope),i=this._mergedHdRoadCoverageSourceCaches[t];i&&!i.used&&(i.used=!0)}if("fill-extrusion"===n.type){const t=e.m(n.source,n.scope);if(t in this._mergedFillExtrusionSourceCaches){const e=n.layout&&n.layout.get("source-max-zoom");if(null!=e){const i=a[t];a[t]=null==i?e:Math.min(i,e)}}}}if(this._programPrecompiler&&this._programPrecompiler.needsBuild()){const e=this._mergedOrder.map(e=>this._mergedLayers[e]);this._programPrecompiler.buildQueue(e,t,this)}for(const e in this._mergedFillExtrusionSourceCaches)this._mergedFillExtrusionSourceCaches[e].setMaxzoomOverride(a[e]??null);this.terrain&&o&&this.mergeLayers();const l=this.imageManager.getPendingImageProviders();for(const e of l)e.sourceCache.used=!0;for(const t in s){const i=this._mergedSourceCaches[t];s[t]!==i.used&&i.getSource().fire(new e.h("data",{sourceDataType:"visibility",dataType:"source",sourceId:i.getSource().id}))}this.light&&this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.snow&&this.snow.recalculate(t),this.rain&&this.rain.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),this.imageManager.clearUpdatedImages(this.scope),r&&this.fire(new e.h("data",{dataType:"style"}))}updateImageProviders(){const e=this.imageManager.getPendingImageProviders();for(const t of e){const e=t.resolvePendingRequests(),i=this.getFragmentStyle(t.scope);i&&i.addImages(e)}}_updateTilesForChangedImages(){const e={};for(const t in this._mergedSourceCaches){const i=this._mergedSourceCaches[t].getSource().scope;e[i]=e[i]||this._changes.getUpdatedImages(i),0!==e[i].length&&this._mergedSourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e[i])}for(const t in e)this._changes.resetUpdatedImages(t)}_updateWorkerLayers(e,t,i){const n=this.getFragmentStyle(e);n&&this.dispatcher.broadcast("updateLayers",{layers:t?n._serializeLayers(t):[],scope:e,removedIds:i||[],options:n.options})}setState(t,i){if(this._checkLoaded(),Vs(this,wt(t)))return!1;if((t=e.dG(t)).layers=$o(t.layers),!yt.diffStyles)throw new Error("Debug module not loaded; cannot diff style.");const n=yt.diffStyles(this.serialize(),t).filter(e=>!js.has(e.command));if(0===n.length)return!1;const r=n.filter(e=>!Us.has(e.command));if(r.length>0)throw new Error(`Unimplemented: ${r.map(e=>e.command).join(", ")}.`);const o=[];return n.forEach(e=>{o.push(this[e.command](...e.args))}),i&&Promise.all(o).then(i).catch(i),this.stylesheet=t,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}_updateWorkerImages(e=!1){this._availableImages=this.imageManager.listImages(this.scope);const t={scope:this.scope,images:this._availableImages};e&&(t.isSpriteLoaded=!0),this.dispatcher.broadcast("setImages",t)}_updateWorkerModels(){this._availableModels=this.modelManager.getModelURIs(this.scope),this.dispatcher.broadcast("setModels",{scope:this.scope,models:this._availableModels})}addImages(t,i){if(0===t.size)return i&&this.dispatcher.broadcast("spriteLoaded",{scope:this.scope}),this;for(const[i,n]of t.entries()){if(this.getImage(i))return this.fire(new e.f(new Error(`An image with the name "${i.name}" already exists.`)));this.imageManager.addImage(i,this.scope,n),this._changes.updateImage(i,this.scope)}return this._updateWorkerImages(i),this.fire(new e.h("data",{dataType:"style"})),this}addImage(t,i){return this.getImage(t)?this.fire(new e.f(new Error(`An image with the name "${t.name}" already exists.`))):(this.imageManager.addImage(t,this.scope,i),this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.h("data",{dataType:"style"})),this)}updateImage(t,i,n=!1){this.imageManager.updateImage(t,this.scope,i),n&&(this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.h("data",{dataType:"style"})))}getImage(e){return this.imageManager.getImage(e,this.scope)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t,this.scope),this._changes.updateImage(t,this.scope),this._updateWorkerImages(),this.fire(new e.h("data",{dataType:"style"})),this):this.fire(new e.f(new Error("No image with this name exists.")))}listImages(){return this._checkLoaded(),this._availableImages.slice()}getActualScope(){return this._importedAsBasemap?"basemap":this.scope}addModelURLs(t){return this.modelManager.addModelURLs(t,this.getActualScope()),this._updateWorkerModels(),this.fire(new e.h("data",{dataType:"style"})),this}addModel(t,i,n={}
vendor: 4,355 bytes, line 2
2){return this._checkLoaded(),this._validate(zt,`models.${t}`,i,null,n)||(this.modelManager.addModel(t,i,this.getActualScope()),this.fire(new e.h("data",{dataType:"style"}))),this}hasModel(e){return this.modelManager.hasModel(e,this.getActualScope())}removeModel(t){return this.hasModel(t)?(this.modelManager.removeModel(t,this.getActualScope(),!1,!0),this.fire(new e.h("data",{dataType:"style"})),this):this.fire(new e.f(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.getActualScope())}addSource(t,i,n={}){if(this._checkLoaded(),void 0!==this.getOwnSource(t))throw new Error(`There is already a source with ID "${t}".`);if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].includes(i.type)&&this._validate(Tt,`sources.${t}`,i,null,n))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const r=Object.hasOwn(Ro,i.type)&&!Eo(i.type),o=r?new Lo(t,i,this.dispatcher,this):To(t,i,this.dispatcher,this);o.scope=this.scope;const s=e=>{e.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(e.id),source:e.serialize(),sourceId:e.id}))};s(o);const a=t=>{const i=(t===e.bS.Symbol?"symbol:":t===e.bS.FillExtrusion?"fill-extrusion:":"other:")+o.id,n=e.m(i,this.scope),r=this._sourceCaches[i]=new mn(n,o,t);t===e.bS.Symbol?this._symbolSourceCaches[o.id]=r:t===e.bS.FillExtrusion?this._fillExtrusionSourceCaches[o.id]=r:this._otherSourceCaches[o.id]=r,r.onAdd(this.map)};a(e.bS.Other),"vector"!==i.type&&"geojson"!==i.type||(a(e.bS.Symbol),"vector"===i.type&&a(e.bS.FillExtrusion)),o.onAdd&&o.onAdd(this.map),r&&async function(e){if(Eo(e))return;const t=Ro[e];if(!t)throw new Error(`Unknown source type "${e}"`);const i=await t();i&&!Eo(e)&&function(e,t){wo[e]=t}(e,i)}(i.type).then(()=>{const n=Eo(i.type),r=this._otherSourceCaches[t];if(!r||r.getSource()!==o)return;if(!n)return void this.fire(new e.f(new Error(`Could not load module for source type "${i.type}".`)));const a=To(t,i,this.dispatcher,this);a.scope=this.scope,s(a),r.setSource(a),a.onAdd&&a.onAdd(this.map),this._changes.setDirty()}),n.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(t){this._checkLoaded();const i=this.getOwnSource(t);if(!i)throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===t)return this.fire(new e.f(new Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===t)return this.fire(new e.f(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));if(this.stylesheet.iconsets){const i=Object.entries(this.stylesheet.iconsets).find(([e,i])=>"source"===i.type&&i.source===t);if(i)return this.fire(new e.f(new Error(`Source "${t}" cannot be removed while iconset "${i[0]}" is using it.`)))}const n=this.getOwnSourceCaches(t);for(const t of n){const i=e.dH(t.id);delete this._sourceCaches[i],this._changes.discardSourceCacheUpdate(t.id),t.fire(new e.h("data",{sourceDataType:"metadata",dataType:"source",sourceId:t.getSource().id})),t.setEventedParent(null),t.clearTiles()}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],delete this._fillExtrusionSourceCaches[t],this._hdCoverage&&delete this._hdCoverage.coverageSourceCaches[t],this.mergeSources(),i.setEventedParent(null),i.onRemove&&i.onRemove(this.map),this.dispatcher.broadcast("removeSource",{type:i.type,source:t,scope:i.scope}),this._changes.setDirty(),this}setGeoJSONSourceData(e,t){this._checkLoaded(),this.getOwnSource(e).setData(t),this._changes.setDirty()}getOwnSource(e){const t=this.getOwnSourceCache(e);return t&&t.getSource()}getOwnSources(){const e=[];for(const t in this._otherSourceCaches){const i=this.getOwnSourceCache(t);i&&e.push(i.getSource())}return e}areTilesLoaded(){const e=this._mergedSourceCaches;for(const t in e){const i=e[t]._tiles;for(const e in i){const t=i[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}setLights(t){if(this._checkLoaded(),this._programPrecompiler&&this._programPrecompiler.reset(),!t)return delete this.ambientLight,void delete this.directionalLight;const i=this._getTransitionParameters();
vendor: 4,694 bytes, line 2
2for(const e of t){if(this._validate(St,"lights",e))return;switch(e.type){case"ambient":if(this.ambientLight){const t=this.ambientLight;t.set(e),t.updateTransitions(i)}else this.ambientLight=new Kt(e,ei(),this.scope,this.options);break;case"directional":if(this.directionalLight){const t=this.directionalLight;t.set(e),t.updateTransitions(i)}else this.directionalLight=new Kt(e,ii(),this.scope,this.options)}}const n=Object.assign(i,{worldview:this.map.getWorldview()}),r=new e.aj(this.z||0,n);this.ambientLight&&this.ambientLight.recalculate(r),this.directionalLight&&this.directionalLight.recalculate(r),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("upsertRenderParams",{brightness:this._brightness})}calculateLightsBrightness(){const t=this.directionalLight,i=this.ambientLight;if(!t||!i)return;const n=e=>.2126*(e[0]<=.03928?e[0]/12.92:Math.pow((e[0]+.055)/1.055,2.4))+.7152*(e[1]<=.03928?e[1]/12.92:Math.pow((e[1]+.055)/1.055,2.4))+.0722*(e[2]<=.03928?e[2]/12.92:Math.pow((e[2]+.055)/1.055,2.4)),r=t.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),o=t.properties.get("intensity"),s=t.properties.get("direction"),a=1-e.b_(s.x,s.y,s.z)[2]/90,l=n(r)*o*a,c=i.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),u=i.properties.get("intensity"),h=n(c)*u;return Number(((l+h)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const e=[];return this.directionalLight&&e.push(this.directionalLight.get()),this.ambientLight&&e.push(this.ambientLight.get()),e}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(t){if(null==t||""===t&&this.isRootStyle())return this;if(e.dI(t)){const i=e.dJ(t),n=this.fragments.find(({id:e})=>e===i);if(!n)return;const r=e.dH(t);return n.style.getFragmentStyle(r)}{const e=this.fragments.find(({id:e})=>e===t);return e?e.style:void 0}}setFeaturesetSelectors(t){if(!t)return;const i=(e,t="")=>`${e}::${t}`;this._featuresetSelectors={};for(const n in t){const r={},o=this._featuresetSelectors[n]=[];for(const s of t[n].selectors){if(s.featureNamespace){const t=this.getOwnLayer(s.layer);if(!t){e.w(`Layer is undefined for selector: ${s.layer}`);continue}const o=i(t.source,t.sourceLayer);if(o in r&&r[o]!==s.featureNamespace){e.w(`"featureNamespace ${s.featureNamespace} of featureset ${n}'s selector is not associated to the same source, skip this selector`);continue}r[o]=s.featureNamespace}let t;if(s.properties)for(const i in s.properties){const n=e.c(s.properties[i]);"success"===n.result&&(t=t||{},t[i]=n.value)}o.push({layerId:s.layer,namespace:s.featureNamespace,properties:t,uniqueFeatureID:s._uniqueFeatureID})}}}getFeaturesetDescriptors(e){const t=this.getFragmentStyle(e);if(!t||!t.stylesheet.featuresets)return[];const i=[];for(const e in t.stylesheet.featuresets)i.push({featuresetId:e,importId:t.scope?t.scope:void 0});return i}getFeaturesetLayers(t,i){const n=this.getFragmentStyle(i),r=n.stylesheet.featuresets;if(!r||!r[t])return this.fire(new e.f(new Error(`The featureset '${t}' does not exist in the map's style and cannot be queried.`))),[];const o=[];for(const e of r[t].selectors){const t=n.getOwnLayer(e.layer);t&&o.push(t)}return o}getConfigProperty(t,i){const n=this.getFragmentStyle(t);if(!n)return null;const r=e.m(i,n.scope),o=n.options.get(r),s=o?o.value||o.default:null;return s?s.serialize():null}isIndoorEnabled(){return this._indoorEnabled}getIndoorSourceLayers(t,i){const n=e.m(t,i);return this._mergedIndoor[n]}setIndoorData(e,t){this.indoorManager&&this.indoorManager.setIndoorData(t)}updateIndoorDependentLayers(){this._updateLayers(this._dependentLayerIds(e=>e.isIndoorDependent)),this.map._styleDirty=!0,this.map.triggerRepaint()}setConfigProperty(t,i,n){const r=this.getFragmentStyle(t);if(!r)return;const o=r.stylesheet.schema;if(!o||!o[i])return;const s=e.dK(n,o[i]);if("success"!==s.result)return void Vs(this,s.value);const a=s.value.expression,l=e.m(i,r.scope),c=r.options.get(l);if(!c)return;let u;const{minValue:h,maxValue:d,stepValue:f,type:p,values:m}=o[i],_=e.dK(o[i].default,o[i]);"success"===_.result&&(u=_.value.expression),u?(this.options.set(l,{...c,value:a,default:u,minValue:h,maxValue:d,stepValue:f,type:p,values:m}),this.updateConfigDependencies(i)):this.fire(new e.f(new Error(`No schema defined for the config option "${i}" in the "${t}" fragment.`)))}getConfig(t){const i=this.getFragmentStyle(t);if(!i)return null;const n=i.stylesheet.schema;if(!n)return null;const r={};for(const t in n){const n=e.m(t,i.scope),o=i.options.get(n),s=o?o.value||o.default:null;r[t]=s?s.serialize():null}return r}setConfig(e,t){const i=this.getFragmentStyle(e);
2i&&(i.updateConfig(t,i.stylesheet.schema),this.updateConfigDependencies())}getSchema(e){const t=this.getFragmentStyle(e);return t?t.stylesheet.schema:null}setSchema(e,t){const i=this.getFragmentStyle(e);i&&(i.stylesheet.schema=t,i.updateConfig(i._config,t),this.updateConfigDependencies())}updateConfig(t,i){if(this._config=t,t||i)if(i)for(const n in i){let r,o;const s=e.dK(i[n].default,i[n]);if("success"===s.result&&(r=s.value.expression),t&&void 0!==t[n]){const r=e.dK(t[n],i[n]);"success"===r.result&&(o=r.value.expression)}const{minValue:a,maxValue:l,stepValue:c,type:u,values:h}=i[n];if(r){const t=e.m(n,this.scope);this.options.set(t,{default:r,value:o,minValue:a,maxValue:l,stepValue:c,type:u,values:h})}else this.fire(new e.f(new Error(`No schema defined for config option "${n}".`)))}else this.fire(new e.f(new Error("Attempting to set config for a style without schema.")))}_updateLayers(e){for(const t of e){const e=this.getLayer(t);e&&(e.possiblyEvaluateVisibility(),this._updateLayer(e),this._changes.setDirty())}}_dependentLayerIds(e){const t=[];for(const[i,n]of this._layerExpressionDependencies)e(n)&&t.push(i);return t}updateConfigDependencies(e){this._updateLayers(this._dependentLayerIds(t=>e?t.hasConfigDependency(e):t.isConfigDependent)),this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle(e=>{const t=e._styleColorTheme.colorThemeOverride?e._styleColorTheme.colorThemeOverride:e._styleColorTheme.colorTheme;if(t){const i=e._evaluateColorThemeData(t);(!e._styleColorTheme.lut&&""!==i||e._styleColorTheme.lut&&i!==e._styleColorTheme.lut.data)&&e.setColorTheme(t)}}),this._updateIndoorEnabled(),this._changes.setDirty()}addLayer(t,i,n={}){this._checkLoaded();const r=t.id;if(this._layers[r])return void this.fire(new e.f(new Error(`Layer with i
2d "${r}" already exists on this map`)));let o;if("custom"===t.type){if(Vs(this,e.dL(t)))return;o=e.dM(t,this.scope,this._styleColorTheme.lut,this.options)}else{if("object"==typeof t.source&&(this.addSource(r,t.source),t=e.dG(t),t=Object.assign(t,{source:r})),this._validate(Dt,`layers.${r}`,t,{arrayIndex:-1},n))return;o=e.dM(t,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(o),o.setEventedParent(this,{layer:{id:r}})}this._layerExpressionDependencies.set(o.fqid,new b(o));let s=this._order.length;if(i){const t=this._order.indexOf(i);if(-1===t)return void this.fire(new e.f(new Error(`Layer with id "${i}" does not exist on this map.`)));o.slot&&o.slot!==this._layers[i].slot?e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`):s=t}this._order.splice(s,0,r),this._handleLayerOrderChange(),this._layers[r]=o;const a=this.getOwnLayerSourceCache(o),l=!!this.directionalLight&&this.directionalLight.shadowsEnabled();a&&o.canCastShadows()&&l&&(a.castsShadows=!0);const c=this._changes.getRemovedLayer(o);if(c&&o.source&&a&&"custom"!==o.type){this._changes.discardLayerRemoval(o);const t=e.m(o.source,o.scope);c.type!==o.type?this._changes.updateSourceCache(t,"clear"):(this._changes.updateSourceCache(t,"reload"),a.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),o.scope=this.scope,this.mergeLayers()}moveLayer(t,i){this._checkLoaded();const n=this._checkLayer(t);if(!n)return;if(t===i)return;const r=this._order.indexOf(t);this._order.splice(r,1);let o=this._order.length;if(i){const t=this._order.indexOf(i);
vendor: 3,358 bytes, line 2
2if(-1===t)return void this.fire(new e.f(new Error(`Layer with id "${i}" does not exist on this map.`)));n.slot&&n.slot!==this._layers[i].slot?e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`):o=t}this._order.splice(o,0,t),this._changes.setDirty(),this._handleLayerOrderChange(),this.mergeLayers()}removeLayer(e){this._checkLoaded();const t=this._checkLayer(e);if(!t)return;t.setEventedParent(null);const i=this._order.indexOf(e);this._order.splice(i,1),delete this._layers[e],this._changes.setDirty(),this._handleLayerOrderChange(),this._layerExpressionDependencies.delete(t.fqid),this._changes.removeLayer(t),this.symbolIdRangeAllocator.releaseLayer(t.runtimeLayerUID);const n=this.getOwnLayerSourceCache(t);if(n&&n.castsShadows){let e=!1;for(const i in this._layers)if(this._layers[i].source===t.source&&this._layers[i].canCastShadows()){e=!0;break}n.castsShadows=e}t.onRemove&&t.onRemove(this.map),this.mergeLayers()}getOwnLayer(e){return this._layers[e]}hasLayer(e){return e in this._mergedLayers}hasLayerType(e){for(const t in this._layers)if(this._layers[t].type===e)return!0;return!1}setLayerZoomRange(e,t,i){this._checkLoaded();const n=this._checkLayer(e);n&&(n.minzoom===t&&n.maxzoom===i||(null!=t&&(n.minzoom=t),null!=i&&(n.maxzoom=i),this._updateLayer(n)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(e,t){this._checkLoaded();const i=this._checkLayer(e);i&&i.slot!==t&&(i.slot=t,this._updateLayer(i))}setFilter(t,i,n={}){this._checkLoaded();const r=this._checkLayer(t);if(!r)return;if(e.O(r.filter,i))return;const o=this._layerExpressionDependencies.get(r.fqid);if(null==i)return r.filter=void 0,o&&o.invalidateFilter(),void this._updateLayer(r);this._validate(Pt,`layers.${r.id}.filter`,i,{layerType:r.type},n)||(r.filter=e.dG(i),o&&o.invalidateFilter(),this._updateLayer(r))}getFilter(t){const i=this._checkLayer(t);if(i)return e.dG(i.filter)}setLayoutProperty(t,i,n,r={}){this._checkLoaded();const o=this._checkLayer(t);if(o&&!e.O(o.getLayoutProperty(i),n)){if(null!=n&&(!r||!1!==r.validate)&&Vs(o,Lt.call(wt,{key:`layers.${t}.layout.${i}`,layerType:o.type,objectKey:i,value:n,styleSpec:e.s,style:{glyphs:!0,sprite:!0}})))return;o.setLayoutProperty(i,n),this._updateLayer(o)}}getLayerProperty(e,t){const i=this._checkLayer(e);if(i){switch(t){case"minzoom":return i.minzoom;case"maxzoom":return i.maxzoom;case"filter":return this.getFilter(e);case"slot":return i.slot;case"appearances":return i.getAppearances().map(e=>e.serialize())}return i.isPaintProperty(t)?this.getPaintProperty(e,t):this.getLayoutProperty(e,t)}}setLayerProperty(e,t,i,n={}){this._checkLoaded();const r=this._checkLayer(e);if(r){switch(t){case"appearances":return r.setAppearances(i),void this._updateLayer(r);case"minzoom":return this.setLayerZoomRange(e,i);case"maxzoom":return this.setLayerZoomRange(e,null,i);case"filter":return this.setFilter(e,i,n);case"slot":return this.setSlot(e,i)}r.isPaintProperty(t)?this.setPaintProperty(e,t,i,n):this.setLayoutProperty(e,t,i,n)}}getLayoutProperty(e,t){const i=this._checkLayer(e);if(i)return i.getLayoutProperty(t)}setPaintProperty(t,i,n,r={}){this._checkLoaded();const o=this._checkLayer(t);o&&(e.O(o.getPaintProperty(i),n)||(null==n||r&&!1===r.validate||!Vs(o,Rt.call(wt,{key:`layers.${t}.paint.${i}`,layerType:o.type,objectKey:i,value:n,styleSpec:e.s}
vendor: 5,089 bytes, line 2
2)))&&(o.setPaintProperty(i,n)&&this._updateLayer(o),this._changes.updatePaintProperties(o)))}getPaintProperty(e,t){const i=this._checkLayer(e);if(i)return i.getPaintProperty(t)}setFeatureState(t,i){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:e,importId:n}=t.target,r=this.getFragmentStyle(n),o=r.getFeaturesetLayers(e);for(const{source:e,sourceLayer:n}of o)r.setFeatureState({id:t.id,source:e,sourceLayer:n},i)}else if("layerId"in t.target){const e=this._resolveLayerFragment(t.target.layerId);e?.fragment.setFeatureState({id:t.id,source:e.layer.source,sourceLayer:e.layer.sourceLayer},i)}return}const n=t.source,r=t.sourceLayer,o=this._checkSource(n);if(!o)return;const s=o.type;if("geojson"===s&&r)return void this.fire(new e.f(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===s&&!r)return void this.fire(new e.f(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new e.f(new Error("The feature id parameter must be provided.")));const a=this.getOwnSourceCaches(n);for(const e of a)e.setFeatureState(r,t.id,i)}removeFeatureState(t,i){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:e,importId:n}=t.target,r=this.getFragmentStyle(n),o=r.getFeaturesetLayers(e);for(const{source:e,sourceLayer:n}of o)r.removeFeatureState({id:t.id,source:e,sourceLayer:n},i)}else if("layerId"in t.target){const e=this._resolveLayerFragment(t.target.layerId);e?.fragment.removeFeatureState({id:t.id,source:e.layer.source,sourceLayer:e.layer.sourceLayer},i)}return}const n=t.source,r=this._checkSource(n);if(!r)return;const o=r.type,s="vector"===o?t.sourceLayer:void 0;if("vector"===o&&!s)return void this.fire(new e.f(new Error("The sourceLayer parameter must be provided for vector source types.")));if(i&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new e.f(new Error("A feature id is required to remove its specific state property.")));const a=this.getOwnSourceCaches(n);for(const e of a)e.removeFeatureState(s,t.id,i)}getFeatureState(t){if(this._checkLoaded(),"target"in t){let i;if("featuresetId"in t.target){const{featuresetId:n,importId:r}=t.target,o=this.getFragmentStyle(r),s=o.getFeaturesetLayers(n);for(const{source:n,sourceLayer:r}of s){const s=o.getFeatureState({id:t.id,source:n,sourceLayer:r});if(s&&!i)i=s;else if(!e.O(i,s))return void this.fire(new e.f(new Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in t.target){const e=this._resolveLayerFragment(t.target.layerId);i=e?.fragment.getFeatureState({id:t.id,source:e.layer.source,sourceLayer:e.layer.sourceLayer})}return i}const i=t.source,n=t.sourceLayer,r=this._checkSource(i);if(r){if("vector"!==r.type||n)return void 0===t.id&&this.fire(new e.f(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(i)[0].getFeatureState(n,t.id);this.fire(new e.f(new Error("The sourceLayer parameter must be provided for vector source types.")))}}resetFeatureStates(e){if(this._checkLoaded(),"featuresetId"in e){const{featuresetId:t,importId:i}=e,n=this.getFragmentStyle(i);if(!n)return;const r=n.getFeaturesetLayers(t);for(const{source:e,sourceLayer:t}of r)n.removeFeatureState({source:e,sourceLayer:t})}else{const t=this._resolveLayerFragment(e.layerId);t?.fragment.removeFeatureState({source:t.layer.source,sourceLayer:t.layer.sourceLayer})}}setTransition(e){return this.stylesheet.transition={...this.stylesheet.transition,...e},this.transition=this.stylesheet.transition,this}getTransition(){return{...this.stylesheet.transition}}setWorldview(e){e!==this._worldview&&(this._worldview=e,this.dispatcher.broadcast("upsertRenderParams",{worldview:this._worldview}),this.reloadSources())}serialize(){this._checkLoaded();const t=this.getTerrain(),i=t&&this.terrain&&this.terrain.scope===this.scope?t:this.stylesheet.terrain;return e.dN({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,iconsets:this.stylesheet.iconsets,featuresets:this.stylesheet.featuresets,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:i,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,indoor:this.stylesheet.indoor,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],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:this._serializeSources(),layers:this._serializeLayers(this._order)},e=>void 0!==e)}_updateFilteredLayers(e){for(const t of Object.values(this._mergedLayers))e(t)&&this._updateLayer(t)}_updateLayer(t){this._changes.updateLayer(t);const i=this.getLayerSourceCache(t),n=e.m(t.source,t.scope),r=this._changes.getUpd
vendor: 4,225 bytes, line 2
2atedSourceCaches();t.source&&!r[n]&&i&&"raster"!==i.getSource().type&&(this._changes.updateSourceCache(n,"reload"),i.pause()),t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(e){const t=e=>this._mergedLayers[e].is3D(!!this.terrain),i=this.order,n={},r=[];for(let o=i.length-1;o>=0;o--){const s=i[o];if(t(s)){n[s]=o;for(const t of e){const e=t[s];if(e)for(const t of e)r.push(t)}}}r.sort((e,t)=>t.intersectionZ-e.intersectionZ);const o=[];for(let s=i.length-1;s>=0;s--){const a=i[s];if(t(a))for(let e=r.length-1;e>=0;e--){const t=r[e].feature;if(t.layer&&n[t.layer.id]<s)break;o.push(t),r.pop()}else for(const t of e){const e=t[a];if(e)for(const t of e)o.push(t.feature)}}return o}queryRasterValue(t,i,n){const r=this.getOwnSource(t);return r?"raster-array"!==r.type?(this.fire(new e.f(new Error('queryRasterValue support only "raster-array" sources.'))),Promise.resolve(null)):r.queryRasterArrayValue(i,n):(this.fire(new e.f(new Error(`Source with id "${t}" does not exist in the style.`))),Promise.resolve(null))}queryRenderedFeatures(t,i,n){let r;i&&!Array.isArray(i)&&i.filter&&(this._validate(Pt,"queryRenderedFeatures.filter",i.filter,null,i),r=e.bw(i.filter));const o={},s=e=>{if(Gs.has(e.type))return;const t=this.getOwnLayerSourceCache(e),i=o[t.id]=o[t.id]||{sourceCache:t,layers:{},has3DLayers:!1};e.is3D(!!this.terrain)&&(i.has3DLayers=!0),i.layers[e.fqid]=i.layers[e.fqid]||{styleLayer:e,targets:[]},i.layers[e.fqid].targets.push({filter:r})};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new e.f(new Error("parameters.layers must be an Array."))),[];for(const t of i.layers){const i=this._layers[t];if(!i)return this.fire(new e.f(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];s(i)}}else for(const e in this._layers)s(this._layers[e]);const a=this._queryRenderedFeatures(t,o,n),l=this._flattenAndSortRenderedFeatures(a),c=[];for(const t of l)e.dO(t.layer.id)===this.scope&&c.push(t);return c}queryRenderedFeatureset(t,i,n){let r;i&&!Array.isArray(i)&&i.filter&&(this._validate(Pt,"queryRenderedFeatures.filter",i.filter,null,i),r=e.bw(i.filter));const o="mock",s=[];if(i&&i.target)s.push({...i,targetId:o,filter:r});else{const e=this.getFeaturesetDescriptors();for(const t of e)s.push({targetId:o,filter:r,target:t});for(const{style:e}of this.fragments){const t=e.getFeaturesetDescriptors();for(const e of t)s.push({targetId:o,filter:r,target:e})}}const a=this.queryRenderedTargets(t,s,n),l=[],c=new Set;for(const t of a)for(const i of t.variants[o])Fo(i,t,c)||l.push(new e.dP(t,i));return l}queryRenderedTargets(t,i,n){const r={},o=(e,t,i,n)=>{const o=r[t.id]=r[t.id]||{sourceCache:t,layers:{},has3DLayers:!1};if(o.layers[e.fqid]=o.layers[e.fqid]||{styleLayer:e,targets:[]},e.is3D(!!this.terrain)&&(o.has3DLayers=!0),!n)return i.uniqueFeatureID=!1,void o.layers[e.fqid].targets.push(i);o.layers[e.fqid].targets.push({...i,namespace:n.namespace,properties:n.properties,uniqueFeatureID:n.uniqueFeatureID})};for(const t of i)if("featuresetId"in t.target){const{featuresetId:i,importId:n}=t.target,r=this.getFragmentStyle(n);if(!r||!r._featuresetSelectors)continue;const s=r._featuresetSelectors[i];if(!s){this.fire(new e.f(new Error(`The featureset '${i}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const e of s){const i=r.getOwnLayer(e.layerId);i&&!Gs.has(i.type)&&o(i,r.getOwnLayerSourceCache(i),t,e)}}else if("layerId"in t.target){const{layerId:e}=t.target,i=this.getLayer(e);if(!i||Gs.has(i.type))continue;o(i,this.getLayerSourceCache(i),t)}const s=this._queryRenderedFeatures(t,r,n);return this._flattenAndSortRenderedFeatures(s)}_queryRenderedFeatures(t,i,n){const r=[],o=!!this.map._showQueryGeometry,s=fo.createFromScreenPoints(t,n);for(const e in i){const t=Oo(s,i[e],this._availableImages,n,o,this.getActualScope());Object.keys(t).length&&r.push(t)}if(this.placement)for(const t in i){if(i[t].sourceCache._renderSourceType!==e.bS.Symbol)continue;const n=ko(s.screenGeometry,i[t],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData,this.map.getWorldview());Object.keys(n).length&&r.push(n)}return r}querySourceFeatures(e,t){const i=t&&t.filter;
vendor: 8,421 bytes, line 2
2i&&this._validate(Pt,"querySourceFeatures.filter",i,null,t);let n=[];const r=this.getOwnSourceCaches(e);for(const e of r)n=n.concat(Bo(e,t));return n}getFlatLight(){return this.light.getLight()}setFlatLight(t,i,n={}){this._checkLoaded();const r=this.light.getLight();let o=!1;for(const i in t)if(!e.O(t[i],r[i])){o=!0;break}if(!o)return;const s=this._getTransitionParameters();this.light.setLight(t,i,n),this.light.updateTransitions(s)}hasTerrain(){return!!this.terrain&&1===this.terrain.drapeRenderMode}getTerrain(){return this.hasTerrain()?this.terrain.get():null}_startLiteLoad(){void 0===this._drapingLoaded&&(this._drapingLoaded=!1,async function(){return Promise.resolve()}().then(()=>{this._drapingLoaded=!0,this.map._removed||0===this.dispatcher.actors.length||this.map.triggerRepaint()}))}setTerrainForDraping(){this._startLiteLoad(),this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=e.e.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&e.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(t,i=1){if(this._checkLoaded(),!t)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),0===i&&delete this.terrain,null===t?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);this.checkCanvasFingerprintNoise();let n=t;const r=!("source"in t)||null==t.source;if(1===i){if(this._startLiteLoad(),this.disableElevatedTerrain)return;if("source"in n&&"object"==typeof n.source){const t="terrain-dem-src";this.addSource(t,n.source),n=e.dG(n),n=Object.assign(n,{source:t})}const t={...n},i={};if(this.terrain&&r){t.source=this.terrain.get().source;const e=this.terrain?this.getFragmentStyle(this.terrain.scope):null;e&&(i.style=e.serialize())}if(this._validate(It,"terrain",t,i))return}if(!this.terrain||this.terrain.scope!==this.scope&&!r||this.terrain&&i!==this.terrain.drapeRenderMode){if(!n)return;this._createTerrain(n,i),this.fire(new e.h("data",{dataType:"style"}))}else{const i=this.terrain,r=i.get();for(const t of Object.keys(e.s.terrain))!Object.hasOwn(n,t)&&e.s.terrain[t].default&&(n[t]=e.s.terrain[t].default);for(const n in t)if(!e.O(t[n],r[n])){i.set(t,this.options),this.stylesheet.terrain=t;const n=this._getTransitionParameters({duration:0});i.updateTransitions(n),this.fire(new e.h("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){const t=this.fog=new jt(e,this.map.transform,this.scope,this.options);this.stylesheet.fog=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i)}_createSnow(e){const t=this.snow=new Ht(e,this.map.transform,this.scope,this.options);this.stylesheet.snow=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i)}_createRain(e){const t=this.rain=new Zt(e,this.map.transform,this.scope,this.options);this.stylesheet.rain=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(const e of this.map._markers)e._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(t){if(this._checkLoaded(),t)if(this.fog){const i=this.fog;if(!e.O(i.get(),t)){i.set(t,this.options),this.stylesheet.fog=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e)}}else this._createFog(t);else delete this.fog,delete this.stylesheet.fog;this._markersNeedUpdate=!0,this._programPrecompiler&&this._programPrecompiler.reset()}getSnow(){return this.snow?this.snow.get():null}setSnow(t){if(this._checkLoaded(),!t)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){const i=this.snow;if(!e.O(i.get(),t)){i.set(t,this.options),this.stylesheet.snow=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e)}}else this._createSnow(t);this._markersNeedUpdate=!0}getRain(){return this.rain?this.rain.get():null}setRain(t){if(this._checkLoaded(),!t)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){const i=this.rain;if(!e.O(i.get(),t)){i.set(t,this.options),this.stylesheet.rain=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e)}}else this._createRain(t);this._markersNeedUpdate=!0}_reloadColorTheme(){const t=()=>{for(const e in this._layers)this._layers[e].lut=this._styleColorTheme.lut;for(const e in this._sourceCaches)this._sourceCaches[e].clearTiles()},i=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!i)return this._styleColorTheme.lut=null,void t();const n=this._evaluateColorThemeData(i);this._loadColorTheme(n).then(()=>{this.fire(new e.h("colorthemeset")),t()}).catch(t=>{e.w(`Couldn't set color theme: ${t}`)})}setColorTheme(t){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&e.w("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=t,this._reloadColorTheme()}setImportColorTheme(e,t){const i=this.getFragmentStyle(e);i&&(i._styleColorTheme.colorThemeOverride=t,i._reloadColorTheme())}_getTransitionParameters(t){return{now:e.e.now(),transition:Object.assign(this.transition,t)}}updateDrapeFirstLayers(){if(!this.terrain)return;const e=[],t=[];for(const i of this._mergedOrder)this.isLayerDraped(this._mergedLayers[i])?e.push(i):t.push(i);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...t)}_createTerrain(t,i){const n=this.terrain=new Nt(t,i,this.scope,this.options,this.map.getWorldview());1===i&&(this.stylesheet.terrain=t),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const r=this._getTransitionParameters({duration:0});n.updateTransitions(r);const o=new e.aj(this.z||0,{...r,worldview:this.map.getWorldview()});n.recalculate(o)}_force3DLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"fill-extrusion"===t.type&&this._updateLayer(t)}}_forceSymbolLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"symbol"===t.type&&this._updateLayer(t)}}_validate(t,i,n,r,o={}){if(o&&!1===o.validate)return!1;const s={...this.serialize()};return Vs(this,t.call(wt,{key:i,style:s,value:n,styleSpec:e.s,...r}))}_remove(){this._programPrecompiler&&(this._programPrecompiler.reset(),this._programPrecompiler=null),this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),e.dQ.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._mergedLayers)this._mergedLayers[e].setEventedParent(null);for(const e in this._mergedSourceCaches){const t=this._mergedSourceCaches[e];t.clearTiles(),t.setEventedParent(null);const i=t.getSource();i&&i.onRemove&&i.onRemove(this.map)}this.imageManager.removeScope(this.scope),this.imageManager.imageAtlasCache.clear(),this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.indoorManager&&this.indoorManager.destroy(),this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.modelManager.destroy(),this.dispatcher.remove())}clearSource(e){const t=this.getSourceCaches(e);for(const e of t)e.clearTiles()}clearSources(){for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles()}clearLayers(){for(const e in this._mergedLayers){const t=this._mergedLayers[e];t._clear&&t._clear()}}reloadSource(e){const t=this.getSourceCaches(e);for(const e of t)e.resume(),e.reload()}reloadSources(){for(const e of this.getSources())e.reload&&e.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle(e=>{e.modelManager.reloadModels(e.scope)})}updateSources(t){let i;this.directionalLight&&(i=e.dR(this.directionalLight));const n=new Set,r=new Set,o=new Set;for(const e in this._mergedLayers){const t=this._mergedLayers[e];"building"===t.type?n.add(t.source):"raster"===t.type&&t.paint&&"ground"===t.paint.get("raster-elevation-reference")&&o.add(t.source),t.hasElevation()&&
vendor: 4,895 bytes, line 2
2!r.has(t.source)&&r.add(t.source)}this.updateFrcCoverageFadeRange();for(const e in this._mergedSourceCaches){const s=this._mergedSourceCaches[e],a=r.has(s._source.id);s._isRasterElevatedOverTerrain=o.has(s._source.id),n.has(s._source.id)&&(s._source.reparseOverscaled=!1),s.update(t,void 0,void 0,i,a)}this.updateFrcCoverage(),this.updateElevationCoverage()}_reloadSources(){for(const e in this._sourceCaches){const t=this._sourceCaches[e];t.resume(),t.reload()}}updateFrcCoverageFadeRange(){this.map.painter&&$n.updateFrcCoverageFadeRange&&$n.updateFrcCoverageFadeRange(this,this.map.painter)}updateFrcCoverage(){this._hdCoverage&&$n.updateFrcCoverage&&$n.updateFrcCoverage(this,this._hdCoverage)}updateElevationCoverage(){this.isRootStyle()&&$n.setupAndUpdateElevationCoverage&&$n.setupAndUpdateElevationCoverage(this)}_handleLayerOrderChange(){this._requestFullLabelPlacement(),this.fire(new e.h("neworder"))}_requestFullLabelPlacement(){this.pauseablePlacement||(this.pauseablePlacement=new _s),this.pauseablePlacement.requestFullPlacement()}_setLabelPlacementStale(){this.placement&&this.placement.setStale()}_updatePlacement(t,i,n,r,o,s){this.pauseablePlacement||(this.pauseablePlacement=new _s);let a=!1,l=!1;const c={},u={},h="global"===s,d=h?[]:this._mergedOrder;h&&this._driveGlobalPlacement(t,o);for(const i of d){const n=this._mergedLayers[i];if("symbol"!==n.type)continue;const r=e.m(n.source,n.scope);let o=c[r];if(!o){const e=this.getLayerSourceCache(n);if(!e)continue;const t=e.getRenderableIds(!0).map(t=>e.getTileByID(t));u[r]=t.slice(),o=c[r]=t.sort((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1))}const s=this.crossTileSymbolIndex.addLayer(n,o,t.center.lng,t.projection);a=a||s}this.crossTileSymbolIndex.pruneUnusedLayers(d);const f=Boolean(this.placement&&!t.equals(this.placement.transform)),p=Boolean(this.placement&&(0!==this.placement.lastReplacementSourceUpdateTime&&!o||this.placement.lastReplacementSourceUpdateTime!==o.updateTime)),m=f||p||a,_=(m||this.pauseablePlacement.isStale())&&0===n,g=this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.e.now(),t.zoom)&&0!==n;if((this.pauseablePlacement.isFullPlacementRequested()||!this.pauseablePlacement.placement||_||g)&&(this.pauseablePlacement=this.pauseablePlacement.startNewPlacement(t,d,i,n,r,this.placement,this.fog&&t.projection.supportsFog?this.fog.state:null,this._buildingIndex),this.map.painter)){const e=this.map.painter.maxFrontCutoffRawStart;if(e>0){const i=180*t.pitch/Math.PI;if(i>=15){const t=Math.min(1,Math.max(0,(i-15)/5)),n=t*t*(3-2*t);this.pauseablePlacement.placement.frontCutoffStart=-.5*(1-n)+e*n}}}if(this.pauseablePlacement.isDone()?m&&0!==n&&this.pauseablePlacement.setStale():(this.pauseablePlacement.continuePlacement(d,this._mergedLayers,c,u,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.e.now()),l=!0),a&&this.pauseablePlacement.setStale()),l||a){this._buildingIndex.onNewFrame(t.zoom);for(let t=0;t<d.length;t++){const n=this._mergedLayers[d[t]];if("symbol"!==n.type)continue;if("none"===n.visibility)continue;const r=this.isLayerClipped(n);this.placement.updateLayerOpacities(n,c[e.m(n.source,n.scope)],t,r?o:null,i,this.map.painter.scaleFactor)}}return!this.pauseablePlacement.isDone()||this.placement.isStale()||this.placement.hasTransitions(e.e.now())}_driveGlobalPlacement(t,i){if(0===t.width||0===t.height)return;this.globalPlacement||(this.globalPlacement=new Ms);const n=this.globalPlacement;n.startPlacement(e.e.now(),t.width,t.height),this._buildingIndex.onNewFrame(t.zoom);const r=this.fog&&t.projection.supportsFog?this.fog.state:null;if(this._groupOrdersVersion!==this._mergedOrderVersion||!this._groupOrders){const t=new Map;for(let i=0;i<this._mergedOrder.length;i++){const n=this._mergedLayers[this._mergedOrder[i]];"placement-group"===n.type&&t.set(n.fqid,e.dS(i))}this._groupOrders=t,this._groupOrdersVersion=this._mergedOrderVersion}const o={globalPlacement:n,idRangeAllocator:this.symbolIdRangeAllocator,transform:t,buildingIndex:this._buildingIndex,fogState:r,groupOrders:this._groupOrders,replacementSource:i};for(let e=0;e<this._mergedOrder.length;e++){const t=this._mergedLayers[this._mergedOrder[e]];if("symbol"!==t.type)continue;const i=this.getLayerSourceCache(t);if(!i)continue;const n=i.getRenderableIds(!0).map(e=>i.getTileByID(e)),r=this.isLayerClipped(t);t.placeSymbols(o,n,e,i,r)}n.finishPlacementRun()}_releaseSymbolFadeTiles(){for(const e in this._sourceCaches)this._sourceCaches[e].releaseSymbolFadeTiles()}addImport(t,i){if(this._checkLoaded(),new Set(["__proto__","constructor","prototype"]).has(t.id))return void this.fire(new e.f(new Error(`Import id can't be "${t.id}".`)));const n=this.stylesheet.imports=this.stylesheet.imports||[];if(-1!==n.findIndex(({id:e})=>e===t.id))return void this.fire(new e.f(new Error(`Import with i
2d '${t.id}' already exists in the map's style.`)));if(!i)return n.push(t),this._loadImports([t],!0);const r=n.findIndex(({id:e})=>e===i);return-1===r&&this.fire(new e.f(new Error(`Import with id "${i}" does not exist on this map.`))),this.stylesheet.imports=n.slice(0,r).concat(t).concat(n.slice(r)),this._loadImports([t],!0,i)}updateImport(t,i){this._checkLoaded();const n=this.stylesheet.imports||[],r=this.getImportIndex(t);return-1===r?this:"string"==typeof i?(this.setImportUrl(t,i),this):(i.url&&i.url!==n[r].url&&this.setImportUrl(t,i.url),e.O(i.config,n[r].config)||this.setImportConfig(t,i.config,i.data.schema),e.O(i.data,n[r].data)||this.setImportData(t,i.data),this)}moveImport(e,t){this._checkLoaded();let i=this.stylesheet.imports||[];const n=this.getImportIndex(e);if(-1===n)return this;const r=this.getImportIndex(t);if(-1===r)return this;const o=i[n],s=this.fragments[n];return i=i.filter(({id:t})=>t!==e),this.fragments=this.fragments.filter(({id:t})=>t!==e),this.stylesheet.imports=i.slice(0,r).concat(o).concat(i.slice(r)),this.fragments=this.fragments.slice(0,r).concat(s).concat(this.fragments.slice(r)),this.mergeLayers(),this}setImportUrl(e,t){this._checkLoaded();const i=this.stylesheet.imports||[],n=this.getImportIndex(e);if(-1===n)return this;i[n].url=t;const r=this.fragments[n];return r.style=this._createFragmentStyle(i[n]),r.style.on("style.import.load",()=>this.mergeAll()),r.style.loadURL(t),this}setImportData(e,t){this._checkLoaded();const i=this.getImportIndex(e),n=this.stylesheet.imports||[];return-1===i?this:t?(this.fragments[i].style.setState(t),this._reloadImports(),this):(delete n[i].data,this.setImportUrl(e,n[i].url))}setImportConfig(e,t,i){this._checkLoaded();const n=this.getImportIndex(e),r=this.stylesheet.imports||[];if(-1===n)return this;t?r[n].config=t:delete r[n].config;const o=this.fragments[n];i&&o.style.stylesheet&&(o.style.stylesheet.schema=i);const s=o.style.stylesheet&&o.style.stylesheet.schema;return o.config=t,o.style.updateConfig(t,s),this.updateConfigDependencies(),this}removeImport(e){this._checkLoaded();const t=this.stylesheet.imports||[],i=this.getImportIndex(e);-1!==i&&(t.splice(i,1),this.fragments[i].style._remove(),this.fragments.splice(i,1),this._reloadImports())}getImportIndex(t){const i=(this.stylesheet.imports||[]).findIndex(e=>e.id===t);return-1===i&&this.fire(new e.f(new Error(`Import '${t}' does not exist in the map's style and cannot be updated.`))),i}getLayer(e){return this._mergedLayers[e]}getSources(){const e=[];for(const t in this._mergedOtherSourceCaches){const i=this._mergedOtherSourceCaches[t];i&&e.push(i.getSource())}return e}getSource(e,t){const i=this.getSourceCache(e,t);return i&&i.getSource()}getLayerSource(e){const t=this.getLayerSourceCache(e);return t&&t.getSource()}getSourceCache(t,i){const n=e.m(t,i);return this._mergedOtherSourceCaches[n]}getLayerSourceCache(t){const i=e.m(t.source,t.scope);return"symbol"===t.type?this._mergedSymbolSourceCaches[i]:"fill-extrusion"===t.type?this._mergedFillExtrusionSourceCaches[i]||this._mergedOtherSourceCaches[i]:"fill"===t.type&&t.sourceLayer===e.bV&&this._mergedHdRoadCoverageSourceCaches[i]?this._mergedHdRoadCoverageSourceCaches[i]:this._mergedOtherSourceCaches[i]}getSourceCaches(e){return null==e?Object.values(this._mergedSourceCaches):[this._mergedOtherSourceCaches[e],this._mergedSymbolSourceCaches[e],this._mergedFillExtrusionSourceCaches[e],this._mergedHdRoadCoverageSourceCaches[e]].filter(Boolean)}updateSourceCaches(){const e=this._changes.getUpdatedSourceCaches();for(const t in e){const i=e[t];"reload"===i?this.reloadSource(t):"clear"===i&&this.clearSource(t)}}updateLayers(e){const t=this._changes.getUpdatedPaintProperties();for(const i of t){const t=this.getLayer(i);t&&t.updateTransitions(e)}}getGlyphsUrl(){return this.stylesheet.glyphs}setGlyphsUrl(e){this.stylesheet.glyphs=e,this.glyphManager.setURL(e)}getOwnSourceCache(e){return this._otherSourceCaches[e]}getOwnLayerSourceCache(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:"fill-extrusion"===e.type&&this._fillExtrusionSourceCaches[e.source]||this._otherSourceCaches[e.source]}getOwnSourceCaches(e){return[this._otherSourceCaches[e],this._symbolSourceCaches[e],this._fillExtrusionSourceCaches[e],this._hdCoverage&&this._hdCoverage.coverageSourceCaches[e]].filter(
vendor: 4,492 bytes, line 2
2Boolean)}_updateHdCoverageSourceCache(t){return $n.HdCoverageState&&$n.updateHdCoverageSourceCache?(this._hdCoverage||(this._hdCoverage=new $n.HdCoverageState),$n.updateHdCoverageSourceCache(this,this._hdCoverage,t),!1):"fill"===t.type&&t.sourceLayer===e.bV}_isSourceCacheLoaded(t){const i=this.getOwnSourceCaches(t);return 0===i.length?(this.fire(new e.f(new Error(`There is no source with ID '${t}'`))),!1):i.every(e=>e.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(e,t){if(!this._clipLayerPresent&&"fill-extrusion"!==e.type&&"building"!==e.type)return!1;const i="fill-extrusion"===e.type&&("building"===e.sourceLayer||"procedural_buildings"===e.sourceLayer),n="building"===e.type;if(e.is3D(!!this.terrain)){if(i||n||t&&"batched-model"===t.type)return!0;if("model"===e.type)return!0}else if("symbol"===e.type)return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}getBOMObject(){}destroy(){this._clearWorkerCaches(),this.imageManager.imageAtlasCache.clear(),this.fragments.forEach(e=>{e.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}async getImages(t,i){const n=new Promise((e,t)=>{this.imageManager.getImages(i.icons.concat(i.patterns),i.scope,(i,n)=>{i?t(i):e(n)})});this._updateTilesForChangedImages();const r=i.icons.map(t=>e.I.toString(t)),o=i.patterns.map(t=>e.I.toString(t)),s=e=>{e&&(e.setDependencies(i.tileID.key,"icons",r),e.setDependencies(i.tileID.key,"patterns",o))},a=e.m(i.source,i.scope);return s(this._mergedOtherSourceCaches[a]),s(this._mergedSymbolSourceCaches[a]),(i.icons.some(e=>e.iconsetId)||i.patterns.some(e=>e.iconsetId))&&this.fire(new e.h("data",{dataType:"style"})),n}async rasterizeImages(e,t){return new Promise((e,i)=>{this.imageManager.rasterizeImages(t,(t,n)=>{t?i(t):e(n)})})}async checkAtlasCache(e,t){const i=this.imageManager.imageAtlasCache.findCachedAtlas(t.descriptor);return i&&i.contentDescriptor?{iconPositions:i.iconPositions,patternPositions:i.patternPositions,sourceHash:i.contentDescriptor.hash}:null}async getGlyphs(e,t){return new Promise((e,i)=>{this.glyphManager.getGlyphs(t.stacks,(t,n)=>{t?i(t):e(n)})})}}Zs.registerForPluginStateChange=e.dz;class qs{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(e,t,i,n,r,o,s,a){this.context=e;let l=this.boundPaintVertexBuffers.length!==n.length;for(let e=0;!l&&e<n.length;e++)this.boundPaintVertexBuffers[e]!==n[e]&&(l=!0);let c=this.boundDynamicVertexBuffers.length!==s.length;for(let e=0;!c&&e<s.length;e++)this.boundDynamicVertexBuffers[e]!==s[e]&&(c=!0);if(!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==i||l||c||this.boundIndexBuffer!==r||this.boundVertexOffset!==o)this.freshBind(t,i,n,r,o,s,a);else{e.bindVertexArrayOES.set(this.vao);for(const i of s)i&&(i.bind(),a&&i.instanceCount&&i.setVertexAttribDivisor(e.gl,t,a));r&&r.dynamicDraw&&r.bind()}}freshBind(e,t,i,n,r,o,s){const a=this.context,l=a.gl;this.vao&&this.destroy(),this.vao=a.gl.createVertexArray(),a.bindVertexArrayOES.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=r,this.boundDynamicVertexBuffers=o,t.enableAttributes(l,e),t.bind(),t.setVertexAttribPointers(l,e,r);for(const t of i)t.enableAttributes(l,e),t.bind(),t.setVertexAttribPointers(l,e,r);for(const t of o)t&&(t.enableAttributes(l,e),t.bind(),t.setVertexAttribPointers(l,e,r),s&&t.instanceCount&&t.setVertexAttribDivisor(l,e,s));n&&n.bind()}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null)}}function Ws(t,i,n){const r=function(t,i,n){const r=e.dY(i,t),o=e.dY(n,[.2126,.7152,.0722]),s=1-.3*Math.min(o,1),a=e.am(s,1,Math.min(r+1,1));return e.am(.92,1,Math.asin(e.b1(i[2],-1,1))/Math.PI+.5)*a}(t,[0,0,1],i),o=[0,0,0];e.dV(o,n.slice(0,3),r);const s=[0,0,0];e.dV(s,i.slice(0,3),t[2]);const a=[0,0,0];return e.dW(a,o,s),e.dX(a)}const Ys=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],Xs=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","building","buildingBloom","elevatedStructures","model","symbol"];class Js{static cacheKey(e,t,i,n){const r=[t];n&&r.push(n.cacheKey);
vendor: 2,728 bytes, line 2
2for(const t of i)("string"==typeof t&&t.includes(" ")||e.usedDefines.has(t))&&r.push(t);return r.join("/")}constructor(t,i,n,r,o,s,a=!1){const l=t.gl;this.program=l.createProgram(),this._context=t,this._fixedUniformsFn=o,this._pending=!0,this._precompiled=a,this.attributes={},this.configuration=r,this.name=i,this.fixedDefines=[...s],a?t._compileStats.precompiled++:t._compileStats.onDemand++;const c=`#version 300 es\n${(r?r.defines():[]).concat(s.map(e=>`#define ${e}`)).join("\n")}`,u=[c,e.dZ];for(const t of n.fragmentIncludes)u.push(e.bb[t]);u.push(n.fragmentSource);const h=u.join("\n"),d=[c,e.d_];for(const t of n.vertexIncludes)d.push(e.bb[t]);this.forceManualRenderingForInstanceIDShaders=t.forceManualRenderingForInstanceIDShaders&&n.vertexSource.includes("gl_InstanceID"),this.forceManualRenderingForInstanceIDShaders&&d.push("uniform int u_instanceID;"),d.push(n.vertexSource);let f=d.join("\n");this.forceManualRenderingForInstanceIDShaders&&(f=f.replaceAll("gl_InstanceID","u_instanceID"));const p=l.createShader(l.FRAGMENT_SHADER);if(l.isContextLost())return this.failedToCreate=!0,void(this._pending=!1);l.shaderSource(p,h),l.compileShader(p),l.attachShader(this.program,p);const m=l.createShader(l.VERTEX_SHADER);if(l.isContextLost())return this.failedToCreate=!0,void(this._pending=!1);l.shaderSource(m,f),l.compileShader(m),l.attachShader(this.program,m),l.linkProgram(this.program),this._fragmentShader=p,this._vertexShader=m,t.extParallelShaderCompile?t._pendingPrograms.add(this):this._finalize()}_finalize(){if(!this._pending)return;this._pending=!1;const t=this._context,i=t.gl;t._pendingPrograms.delete(this);const n=e.e.now(),r=i.getProgramParameter(this.program,i.LINK_STATUS),o=e.e.now()-n,s=t._compileStats;if(s.totalStallMs+=o,o>s.maxStallMs&&(s.maxStallMs=o),o>1){s.framesMissed+=Math.floor(60*o/1e3);const e=this.fixedDefines.join(",");s.stalls.push({name:`${this.name}${e?"/":""}${e}`,ms:o,timestamp:n})}if(this._fragmentShader&&(r||e.w(`Fragment shader '${this.name}': ${i.getShaderInfoLog(this._fragmentShader)}`),i.deleteShader(this._fragmentShader),this._fragmentShader=null),this._vertexShader&&(r||e.w(`Vertex shader '${this.name}': ${i.getShaderInfoLog(this._vertexShader)}`),i.deleteShader(this._vertexShader),this._vertexShader=null),!r)return e.w(`Failed to link program '${this.name}': ${i.getProgramInfoLog(this.program)}`),void(this.failedToCreate=!0);this.fixedUniforms=this._fixedUniformsFn(t),this.fixedUniformsEntries=Object.entries(this.fixedUniforms),this.binderUniforms=this.configuration?this.configuration.getUniforms(t):[],this.forceManualRenderingForInstanceIDShaders&&(this.instancingUniforms=(t=>({u_instanceID:new e.aY(t)}))(t));const a=this.fixedDefines,l=this.name;
vendor: 6,966 bytes, line 2
2(a.includes("TERRAIN")||a.includes("ELEVATED")||l.includes("symbol")||l.includes("circle"))&&(this.terrainUniforms=(t=>({u_dem:new e.aY(t),u_dem_prev:new e.aY(t),u_dem_tl:new e.a2(t),u_dem_scale:new e.a3(t),u_dem_tl_prev:new e.a2(t),u_dem_scale_prev:new e.a3(t),u_dem_size:new e.a3(t),u_dem_lerp:new e.a3(t),u_exaggeration:new e.a3(t),u_depth:new e.aY(t),u_depth_size_inv:new e.a2(t),u_depth_range_unpack:new e.a2(t),u_occluder_half_size:new e.a3(t),u_occlusion_depth_offset:new e.a3(t),u_meter_to_dem:new e.a3(t),u_label_plane_matrix_inv:new e.a4(t)}))(t)),a.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new e.a5(t),u_tile_tr_up:new e.a5(t),u_tile_br_up:new e.a5(t),u_tile_bl_up:new e.a5(t),u_tile_up_scale:new e.a3(t)}))(t)),a.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new e.a4(t),u_fog_range:new e.a2(t),u_fog_color:new e.aZ(t),u_fog_horizon_blend:new e.a3(t),u_fog_vertical_limit:new e.a2(t),u_fog_temporal_offset:new e.a3(t),u_frustum_tl:new e.a5(t),u_frustum_tr:new e.a5(t),u_frustum_br:new e.a5(t),u_frustum_bl:new e.a5(t),u_globe_pos:new e.a5(t),u_globe_radius:new e.a3(t),u_globe_transition:new e.a3(t),u_is_globe:new e.aY(t),u_viewport:new e.a2(t)}))(t)),a.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=e.d$(t)),a.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(t=>({u_lighting_ambient_color:new e.a5(t),u_lighting_directional_dir:new e.a5(t),u_lighting_directional_color:new e.a5(t),u_ground_radiance:new e.a5(t)}))(t)),a.includes("RENDER_SHADOWS")&&(this.shadowUniforms=e.e0(t))}maybeFinalize(){if(!this._pending)return;const e=this._context.extParallelShaderCompile;e&&!this._context.gl.getProgramParameter(this.program,e.COMPLETION_STATUS_KHR)||this._finalize()}_ensureReady(){this._pending&&(this._finalize(),this._context.sweepPendingPrograms())}getAttributeLocation(e,t){this._ensureReady();let i=this.attributes[t];return void 0===i&&(i=this.attributes[t]=e.getAttribLocation(this.program,t)),i}_setUniformGroup(e,t,i){this._ensureReady();const n=this[t];if(!this.failedToCreate&&n){e.program.set(this.program);for(const e in i){const t=n[e];t&&t.set(this.program,e,i[e])}}}setTerrainUniformValues(e,t){this._setUniformGroup(e,"terrainUniforms",t)}setGlobeUniformValues(e,t){this._setUniformGroup(e,"globeUniforms",t)}setFogUniformValues(e,t){this._setUniformGroup(e,"fogUniforms",t)}setCutoffUniformValues(e,t){this._setUniformGroup(e,"cutoffUniforms",t)}setLightsUniformValues(e,t){this._setUniformGroup(e,"lightsUniforms",t)}setShadowUniformValues(e,t){this._setUniformGroup(e,"shadowUniforms",t)}_drawDebugWireframe(t,i,n,r,o,s,a,l,c,u){const h=t.options.wireframe;if(!1===h.terrain&&!1===h.layers2D&&!1===h.layers3D)return;const d=t.context;if(!(()=>!(!h.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!h.layers2D||t._terrain&&t._terrain.renderingToTexture||!Ys.includes(this.name))||!(!h.layers3D||!Xs.includes(this.name)))())return;const f=d.gl,p=t.wireframeDebugCache.getLinesFromTrianglesBuffer(t.frameCounter,o,d);if(!p)return;const m=[...this.fixedDefines,"DEBUG_WIREFRAME"],_=t.getOrCreateProgram(this.name,{config:this.configuration,defines:m});_._ensureReady(),d.program.set(_.program);const g=(e,t,i)=>{if(t[e]&&i[e])for(const n in t[e])i[e][n]&&i[e][n].set(i.program,n,t[e][n].current)};c&&c.setUniforms(_.program,d,_.binderUniforms,a,{zoom:l}),g("fixedUniforms",this,_),g("terrainUniforms",this,_),g("globeUniforms",this,_),g("fogUniforms",this,_),g("lightsUniforms",this,_),g("shadowUniforms",this,_),p.bind(),d.setColorMode(new e.a1([f.ONE,f.ONE_MINUS_SRC_ALPHA,f.ZERO,f.ONE],e.C.transparent,[!0,!0,!0,!1])),d.setDepthMode(new e.Z(i.func===f.LESS?f.LEQUAL:i.func,e.Z.ReadOnly,i.range)),d.setStencilMode(e._.disabled);const y=3*s.primitiveLength*2,v=3*s.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const e=u||1;for(let t=0;t<e;++t)_.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",t),f.drawElements(f.LINES,y,f.UNSIGNED_SHORT,v)}else u&&u>1?f.drawElementsInstanced(f.LINES,y,f.UNSIGNED_SHORT,v,u):f.drawElements(f.LINES,y,f.UNSIGNED_SHORT,v);o.bind(),d.program.set(this.program),d.setDepthMode(i),d.setStencilMode(n),d.setColorMode(r)}checkUniforms(e,t,i){if(this.fixedDefines.includes(t))for(const n of Object.keys(i))if(!i[n].initialized)throw new Error(`Program '${this.name}', from draw '${e}': uniform ${n} not set but required by ${t} being defined`)}draw(e,t,i,n,r,o,s,a,l,c,u,h,d,f,p,m){const _=e.context,g=_.gl;if(this._ensureReady(),this.failedToCreate)return;_.program.set(this.program),_.setDepthMode(i),_.setStencilMode(n),_.setColorMode(r),_.setCullFace(o);for(const[e,t]of this.fixedUniformsEntries)t.set(this.program,e,s[e]);f&&f.setUniforms(this.program,_,this.binderUniforms,h,{zoom:d});const y={[g.POINTS]:1,[g.LINES]:2,[g.TRIANGLES]:3,[g.LINE_STRIP]:1}[t];this.checkUniforms(a,"RENDER_SHADOWS",this.shadowUniforms);const v=p||[],x=f?f.getPaintVertexBuffers():[],b=t===g.TRIANGLES&&c,w=m&&m>0?1:void 0;for(const o of u.get()){const s=o.vaos||(o.vaos={});if((s[a]||(s[a]=new qs)).bind(_,this,l,x,c,o.vertexOffset,v,w),this.forceManualRenderingForInstanceIDShaders){const e=m||1;for(let i=0;i<e;++i)this.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",i),c?g.drawElements(t,o.primitiveLength*y,g.UNSIGNED_SHORT,o.primitiveOffset*y*2):g.drawArrays(t,o.vertexOffset,o.vertexLength)}else m&&m>1?g.drawElementsInstanced(t,o.primitiveLength*y,g.UNSIGNED_SHORT,o.primitiveOffset*y*2,m):c?g.drawElements(t,o.primitiveLength*y,g.UNSIGNED_SHORT,o.primitiveOffset*y*2):g.drawArrays(t,o.vertexOffset,o.vertexLength);b&&this._drawDebugWireframe(e,i,n,r,c,o,h,d,f,m)}}}class Ks{constructor(e,t,i,n){this.id=Ks.uniqueIdxCounter,Ks.uniqueIdxCounter++,this.context=e;const r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||n||t.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){this.id=Ks.uniqueIdxCounter,Ks.uniqueIdxCounter++;const t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}Ks.uniqueIdxCounter=0;const Qs={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ea{constructor(e,t,i,n,r,o){this.length=t.length,this.attributes=i,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.instanceCount=o,this.context=e;const s=e.gl;this.buffer=s.createBuffer(),e.bindVertexBuffer.set(this.buffer),s.bufferData(s.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||r||t.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}
vendor: 5,320 bytes, line 2
2enableAttributes(e,t){for(const i of this.attributes){const n=t.getAttributeLocation(e,i.name);-1!==n&&e.enableVertexAttribArray(n)}}setVertexAttribPointers(e,t,i){for(const n of this.attributes){const r=t.getAttributeLocation(e,n.name);if(-1!==r){const t=n.offset+this.itemSize*(i||0);"Float32"===n.type||n.normalized?e.vertexAttribPointer(r,n.components,e[Qs[n.type]],!!n.normalized,this.itemSize,t):e.vertexAttribIPointer(r,n.components,e[Qs[n.type]],this.itemSize,t)}}}setVertexAttribDivisor(e,t,i){for(let n=0;n<this.attributes.length;n++){const r=t.getAttributeLocation(e,this.attributes[n].name);-1!==r&&this.instanceCount&&this.instanceCount>0&&e.vertexAttribDivisor(r,i)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class ta{constructor(e,t,i,n,r){this.context=e,this.width=t,this.height=i;const o=this.framebuffer=e.gl.createFramebuffer();n>0&&(this.colorAttachment0=new Cr(e,o,0)),n>1&&(this.colorAttachment1=new Cr(e,o,1)),r&&(this.depthAttachmentType=r,this.depthAttachment="renderbuffer"===r?new Dr(e,o):new Pr(e,o))}static createWithTexture(t,i,n,r,o){const s=t.gl;if(t.activeTexture.set(s.TEXTURE1),t.viewport.set([0,0,n,r]),i&&i.width===n&&i.height===r)return s.bindTexture(s.TEXTURE_2D,i.colorAttachment0.get()),t.bindFramebuffer.set(i.framebuffer),i;i&&i.destroy();const a=t.extRenderToTextureHalfFloat||t.extColorBufferFloat?t.gl.RGBA16F:t.gl.RGBA8,l=new e.T(t,{width:n,height:r,data:null},a);l.bind(s.LINEAR,s.CLAMP_TO_EDGE);const c=t.createFramebuffer(n,r,1,null);if(c.format=a,c.colorAttachment0.set(l.texture),o){const e=t.createRenderbuffer(s.DEPTH24_STENCIL8,n,r);t.bindFramebuffer.set(c.framebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,e),c._stencilRbo=e}return c}createColorAttachment(e,t){0===t?this.colorAttachment0=new Cr(e,this.framebuffer,0):1===t&&(this.colorAttachment1=new Cr(e,this.framebuffer,1))}removeColorAttachment(e,t){const i=this.context.gl;let n;0===t?(n=this.colorAttachment0.get(),this.colorAttachment0=void 0):1===t&&(n=this.colorAttachment1.get(),this.colorAttachment1=void 0),n&&i.deleteTexture(n)}destroy(){const e=this.context.gl;if(this.colorAttachment0){const t=this.colorAttachment0.get();t&&e.deleteTexture(t)}if(this.colorAttachment1){const t=this.colorAttachment1.get();t&&e.deleteTexture(t)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}else{const t=this.depthAttachment.get();t&&e.deleteTexture(t)}this._stencilRbo&&(e.deleteRenderbuffer(this._stencilRbo),this._stencilRbo=null),e.deleteFramebuffer(this.framebuffer)}}class ia{constructor(e,t){this.gl=e,this._pendingPrograms=new Set,this._compileStats={precompiled:0,onDemand:0,totalStallMs:0,maxStallMs:0,framesMissed:0,stalls:[]},this.clearColor=new Jn(this),this.clearDepth=new Kn(this),this.clearStencil=new Qn(this),this.colorMask=new er(this),this.depthMask=new tr(this),this.stencilMask=new ir(this),this.stencilFunc=new nr(this),this.stencilOp=new rr(this),this.stencilTest=new or(this),this.depthRange=new sr(this),this.depthTest=new ar(this),this.depthFunc=new lr(this),this.blend=new cr(this),this.blendFunc=new ur(this),this.blendColor=new hr(this),this.blendEquation=new dr(this),this.cullFace=new fr(this),this.cullFaceSide=new pr(this),this.frontFace=new mr(this),this.program=new _r(this),this.activeTexture=new gr(this),this.viewport=new yr(this),this.bindFramebuffer=new vr(this),this.bindRenderbuffer=new xr(this),this.bindTexture=new br(this),this.bindVertexBuffer=new wr(this),this.bindElementBuffer=new Tr(this),this.bindVertexArrayOES=new Er(this),this.pixelStoreUnpack=new Sr(this),this.pixelStoreUnpackPremultiplyAlpha=new Ir(this),this.pixelStoreUnpackFlipY=new Ar(this),this.options=t?{...t}:{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=t&&!!t.forceManualRenderingForInstanceIDShaders||this.renderer&&this.renderer.includes("PowerVR"),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=e.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float"),this.extColorBufferFloat=e.getExtension("EXT_color_buffer_float"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxUniformBlockSize=Math.min(e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),32768),this.maxUniformBufferBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS),this.extBlendFuncExtended=e.getExtension("WEBGL_blend_func_extended"),this.extParallelShaderCompile=e.getExtension("KHR_parallel_shader_compile")}
2sweepPendingPrograms(){if(0!==this._pendingPrograms.size)for(const e of this._pendingPrograms)e.maybeFinalize()}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.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t,i){return new Ks(this,e,t,i)}createVertexBuffer(e,t,i,n,r){return new ea(this,e,t,i,n,r)}createRenderbuffer(e,t,i){const n=this.gl,r=n.createRenderbuffer();return this.bindRenderbuffer.set(r),n.renderbufferStorage(n.RENDERBUFFER,e,t,i),this.bindRenderbuffer.set(null),r}createFramebuffer(e,t,i,n){return new ta(this,e,t,i,n)}clear({color:e,depth:t,stencil:i,colorMask:n}){const r=this.gl;let o=0;e&&(o|=r.COLOR_BUFFER_BIT,this.clearColor.set(e.toNonPremultipliedRenderColor(null)),this.colorMask.set(n||[!0,!0,!0,!0])),void 0!==t&&(o|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==i&&(o|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(o)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(t){e.O(t.blendFunction,e.a1.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor),t.blendEquation?this.blendEquation.set(t.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(t.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}const na=e.Y();function ra(t){const i=t._camera.getWorldToCamera(t.worldSize,1),n=e.X([],i,t.globeMatrix);e.aP(n,n);const r=[0,0,0],o=[0,1,0,0];return e.c6(o,o,n),r[0]=o[0],r[1]=o[1],r[2]=o[2],e.c9(r,r),r}function oa({width:t,height:i,anchor:n,textOffset:r,textScale:o},s){const{horizontalAlign:a,verticalAlign:l}=e.du(n),c=-(a-.5)*t,u=-(l-.5)*i,h=e.dv(n,r);return new e.P((c/o+h[0])*s,(u/o+h[1])*s)}function sa(t,i,n,r,o,s,a,l,c,u){const h=t.text.placedSymbolArray,d=t.text.dynamicLayoutVertexArray,f=t.icon.dynamicLayoutVertexArray,p={},m=t.getProjection(),_=e.e1(a,m,o),g=o.elevation,y=m.upVectorScale(a.canonical,o.center.lat,o.worldSize).metersToTile;d.clear();for(let f=0;f<h.length;f++){const v=h.get(f),{tileAnchorX:x,tileAnchorY:b,numGlyphs:w}=v,T=v.hidden||!v.crossTileID||t.allowVerticalPlacement&&!v.placedOrientation?null:r[v.crossTileID];if(T){let r=0,h=0,E=0;const S="road"===t.elevationType;if(g||S){const i=new e.P(x,b);let n=0;if(S&&t.hdExt){const r=t.symbolInstances.get(t.text.symbolInstanceIndices[f]);if(t.hdExt.isCrossTileRoadElevation(r.elevationFeatureIndex,a.canonical)){const e=t.hdExt.getRoadFeatureHeightForPlacedSymbol(t,t.text,f,i,a.canonical);n=null!==e?e:0}else{const r=t.hdExt.getElevationFeatureForPlacedSymbol(t,t.text,f);n=e.c2.getAtTileOffset(a,i,g,void 0!==r?r:null)}}else n=e.c2.getAtTileOffset(a,i,g,null);
vendor: 7,828 bytes, line 2
2const[o,s,l]=m.upVector(a.canonical,x,b);r=n*o*y,h=n*s*y,E=n*l*y}let[I,A,M,C]=e.da(v.projectedAnchorX+r,v.projectedAnchorY+h,v.projectedAnchorZ+E,n?_:s);const D=e.e4(o.getCameraToCenterDistance(m),C);let P=e.ds(t.textSizeData,c,v)*D/e.dg;n&&(P*=t.tilePixelRatio/l);const R=oa(T,P);n?(({x:I,y:A,z:M}=m.projectTilePoint(x+R.x,b+R.y,a.canonical)),[I,A,M]=e.da(I+r,A+h,M+E,s)):(i&&R._rotate(-o.angle),I+=R.x,A+=R.y,M=0);const L=t.allowVerticalPlacement&&v.placedOrientation===e.dt.vertical?Math.PI/2:0;for(let t=0;t<w;t++)e.e5(d,I,A,M,L);u&&v.associatedIconIndex>=0&&(p[v.associatedIconIndex]={x:I,y:A,z:M,angle:L})}else e.e3(w,d)}if(u){f.clear();const i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){const n=i.get(t),{numGlyphs:r}=n,o=p[t];if(n.hidden||!o)e.e3(r,f);else{const{x:t,y:i,z:n,angle:s}=o;for(let o=0;o<r;o++)e.e5(f,t,i,n,s)}}t.icon.dynamicLayoutVertexBuffer.updateData(f)}t.text.dynamicLayoutVertexBuffer.updateData(d)}function aa(t,i,n,r,o,s,a={}){const l=n.paint.get("icon-translate"),c=n.paint.get("text-translate"),u=n.paint.get("icon-translate-anchor"),h=n.paint.get("text-translate-anchor"),d=n.layout.get("icon-rotation-alignment"),f=n.layout.get("text-rotation-alignment"),p=n.layout.get("icon-pitch-alignment"),m=n.layout.get("text-pitch-alignment"),_=n.layout.get("icon-keep-upright"),g=n.layout.get("text-keep-upright"),y=n.paint.get("icon-color-saturation"),v=n.paint.get("icon-color-contrast"),x=n.paint.get("icon-color-brightness-min"),b=n.paint.get("icon-color-brightness-max"),w="sea"===n.layout.get("symbol-elevation-reference"),T="none"===n.layout.get("icon-image-use-theme"),E=t.context,S=E.gl,I=t.transform,A="map"===d,M="map"===f,C="map"===p,D="map"===m,P=void 0!==n.layout.get("symbol-sort-key").constantOr(1);let R=!1;const L=t.depthModeForSublayer(0,e.Z.ReadOnly),z=new e.Z(t.context.gl.LEQUAL,e.Z.ReadOnly,t.depthRangeFor3D),F=[e.a7(I.center.lng),e.a8(I.center.lat)],O=n.layout.get("text-variable-anchor"),k="globe"===I.projection.name,B=[],N=[0,-1,0];for(const o of r){const r=i.getTile(o),s=r.getBucket(n);if(!s)continue;if("mercator"===s.projection.name&&k)continue;if(s.fullyClipped)continue;const d="globe"===s.projection.name,f=d?e.S(I.zoom):0,p=e.e1(o,s.getProjection(),I),m=I.calculatePixelsToTileUnitsMatrix(r),V=O&&s.hasTextData(),U=s.hasIconTextFit()&&V&&s.hasIconData(),j=s.getProjection().createInversionMatrix(I,o.canonical),G=(1<<r.tileID.canonical.z)*e.a6/t.transform.worldSize,$=i=>{let n=[0,0,0];if(i){const i=t.style.directionalLight,r=t.style.ambientLight;i&&r&&(n=e.aG(t.style,i,r))}return n},H=e=>{const i=Math.floor(t.context.maxUniformBlockSize/4),n=Math.floor(i/4);e.push(`MAX_UBO_SIZE_VEC4 ${n}u`)},Z=e=>{I.depthOcclusionForSymbolsAndCircles&&(n.hasOcclusionOpacityProperties||t.terrain)&&(e.push("DEPTH_D24"),e.push("DEPTH_OCCLUSION"))},q=i=>{n.lut&&!T&&(n.lut.texture||(n.lut.texture=new e.e7(t.context,n.lut.image,[n.lut.image.height,n.lut.image.height,n.lut.image.height],E.gl.RGBA8)),E.activeTexture.set(E.gl.TEXTURE0+e.ci.LUT),n.lut.texture&&n.lut.texture.bind(E.gl.LINEAR,E.gl.CLAMP_TO_EDGE),i.push("APPLY_LUT_ON_GPU"))},W=()=>{const i=A&&"point"!==n.layout.get("symbol-placement"),a=[];Z(a),q(a);const c=i||U,h="road"===s.elevationType,g=t.shadowRenderer,T=h&&C&&!!g&&g.enabled,E=$(T),M=h&&C&&!t.terrain?z:L,D=n.paint.get("icon-image-cross-fade");t.terrainRenderModeElevated()&&C&&a.push("PITCH_WITH_MAP_TERRAIN"),d&&(a.push("PROJECTION_GLOBE_VIEW"),c&&a.push("PROJECTED_POS_ON_VIEWPORT")),D>0&&s.hasAnySecondaryIcon&&a.push("ICON_TRANSITION"),!s.icon.zOffsetVertexBuffer||h&&t.terrain||a.push("Z_OFFSET"),0===y&&0===v&&0===x&&1===b||a.push("COLOR_ADJUSTMENT"),T&&a.push("RENDER_SHADOWS","NORMAL_OFFSET"),h&&C&&!t.terrain&&s.icon.orientationVertexBuffer&&a.push("ELEVATED_ROADS"),H(a);const P=t.getOrCreateProgram("symbol",{defines:a}),R=r.imageAtlasTexture?r.imageAtlasTexture.size:[0,0],O=s.iconSizeData,B=e.dl(O,I.zoom),V=C||!I.isOrthographic,W=e.e2(p,r.tileID.canonical,C,A,I,s.getProjection(),m),Y=e.dk(p,r.tileID.canonical,C,A,I,s.getProjection(),m),X=s.icon.uboBinder&&s.icon.uboBinder.hasPerFeatureTranslate()?[0,0]:l,J=t.translatePosMatrix(Y,r,X,u,!0),K=t.translatePosMatrix(p,r,X,u),Q=c?na:W,ee=A&&!C&&!i;let te=N;!k&&!I.mercatorFromTransition||A||(te=ra(I));const ie=d?te:N,ne=n.getColorAdjustmentMatrix(y,v,x,b),re=so(O.kind,B,ee,C,t,K,Q,J,w,!1,s.sdfIcons,R,[0,0],0,o,f,F,j,ie,s.getProjection(),E,G,ne,D,null),oe=r.imageAtlasTexture?r.imageAtlasTexture:null,se=1!==n.layout.get("icon-size").constantOr(0)||s.iconsNeedLinear,ae=s.sdfIcons||t.options.rotating||t.options.zooming||se||V?S.LINEAR:S.NEAREST,le=s.sdfIcons&&0!==n.paint.get("icon-halo-width").constantOr(1),ce=t.terrain&&C&&i?e.aP(e.Y(),W):na;if(i&&s.icon){const i=e.c2.getAtTileOffsetFunc(o,I.center.lat,I.worldSize,s.getProjection()),a=e.dj(p,r.tileID.canonical,C,A,I,s.getProjection(),m),l=n.layout.get("icon-size-scale-range"),c=e.b1(t.scaleFactor,l[0],l[1]);e.e6(s,p,t,!1,a,Y,C,_,i,o,c)}return{program:P,buffers:s.icon,uniformValues:re,atlasTexture:oe,atlasTextureIcon:null,atlasInterpolation:ae,atlasInterpolationIcon:null,isSDF:s.sdfIcons,hasHalo:le,depthMode:M,tile:r,renderWithShadows:T,labelPlaneMatrixInv:ce}},Y=()=>{const i=M&&"point"!==n.layout.get("symbol-placement"),a=[],l=i||O||U,u="road"===s.elevationType,_=t.shadowRenderer,y=u&&D&&!!_&&_.enabled,v=$(y),x=u&&D&&!t.terrain?z:L;t.terrainRenderModeElevated()&&D&&a.push("PITCH_WITH_MAP_TERRAIN"),d&&(a.push("PROJECTION_GLOBE_VIEW"),l&&a.push("PROJECTED_POS_ON_VIEWPORT")),!s.text.zOffsetVertexBuffer||u&&t.terrain||a.push("Z_OFFSET"),s.iconsInText&&a.push("RENDER_TEXT_AND_SYMBOL"),y&&a.push("RENDER_SHADOWS","NORMAL_OFFSET"),u&&D&&!t.terrain&&s.text.orientationVertexBuffer&&a.push("ELEVATED_ROADS"),Z(a),H(a);const b=t.getOrCreateProgram("symbol",{defines:a});let T,E=[0,0],A=null;const C=s.textSizeData;s.iconsInText&&(E=r.imageAtlasTexture?r.imageAtlasTexture.size:[0,0],A=r.imageAtlasTexture?r.imageAtlasTexture:null,T=D||!I.isOrthographic||t.options.rotating||t.options.zooming||"composite"===C.kind||"camera"===C.kind?S.LINEAR:S.NEAREST);const P=r.glyphAtlasTexture?r.glyphAtlasTexture.size:[0,0],R=n.layout.get("text-size-scale-range"),B=e.b1(t.scaleFactor,R[0],R[1]),V=e.dl(C,I.zoom,B),q=e.e2(p,r.tileID.canonical,D,M,I,s.getProjection(),m),W=e.dk(p,r.tileID.canonical,D,M,I,s.getProjection(),m),Y=s.text.uboBinder&&s.text.uboBinder.hasPerFeatureTranslate()?[0,0]:c,X=t.translatePosMatrix(W,r,Y,h,!0),J=t.translatePosMatrix(p,r,Y,h),K=l?na:q,Q=M&&!D&&!i;let ee=N;!k&&!I.mercatorFromTransition||M||(ee=ra(I));const te=so(C.kind,V,Q,D,t,J,K,X,w,!0,!0,P,E,0,o,f,F,j,d?ee:N,s.getProjection(),v,G,null,null,B),ie=r.glyphAtlasTexture?r.glyphAtlasTexture:null,ne=S.LINEAR,re=0!==n.paint.get("text-halo-width").constantOr(1),oe=t.terrain&&D&&i?e.aP(e.Y(),q):na;if(i&&s.text){const i=e.c2.getAtTileOffsetFunc(o,I.center.lat,I.worldSize,s.getProjection()),n=e.dj(p,r.tileID.canonical,D,M,I,s.getProjection(),m);e.e6(s,p,t,!0,n,W,D,g,i,o,B)}return{program:b,buffers:s.text,uniformValues:te,atlasTexture:ie,atlasTextureIcon:A,atlasInterpolation:ne,atlasInterpolationIcon:T,isSDF:!0,hasHalo:re,depthMode:x,tile:r,renderWithShadows:y,labelPlaneMatrixInv:oe}},X=s.icon.segments.get().length,J=s.text.segments.get().length,K=X&&!a.onlyText?W():null,Q=J&&!a.onlyIcons?Y():null,ee=n.paint.get("icon-opacity").constantOr(1),te=n.paint.get("text-opacity").constantOr(1);if(P&&s.canOverlap){R=!0;const t=ee&&!a.onlyText?s.icon.segments.get():[],i=te&&!a.onlyIcons?s.text.segments.get():[];for(const i of t)B.push({segments:new e.ad([i]),sortKey:i.sortKey,state:K});for(const t of i)B.push({segments:new e.ad([t]),sortKey:t.sortKey,state:Q})}else a.onlyText||B.push({segments:ee?s.icon.segments:new e.ad([]),sortKey:0,state:K}),a.onlyIcons||B.push({segments:te?s.text.segments:new e.ad([]),sortKey:0,state:Q})}R&&B.sort((e,t)=>
vendor: 5,705 bytes, line 2
2e.sortKey-t.sortKey);for(const e of B){const i=e.state;if(i)if(t.terrain?t.terrain.setupElevationDraw(i.tile,i.program,{useDepthForOcclusion:I.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:i.labelPlaneMatrixInv}):t.setupDepthForOcclusion(I.depthOcclusionForSymbolsAndCircles,i.program),E.activeTexture.set(S.TEXTURE0),i.atlasTexture&&i.atlasTexture.bind(i.atlasInterpolation,S.CLAMP_TO_EDGE,!0),i.atlasTextureIcon&&(E.activeTexture.set(S.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,S.CLAMP_TO_EDGE,!0)),i.renderWithShadows&&t.shadowRenderer.setupShadows(i.tile.tileID.toUnwrapped(),i.program,"vector-tile"),t.uploadCommonLightUniforms(t.context,i.program),i.hasHalo){const r=i.uniformValues;r.u_is_halo=1,la(i.buffers,e.segments,n,t,i.program,i.depthMode,o,s,r,2),r.u_is_halo=0}else{if(i.isSDF){const r=i.uniformValues;i.hasHalo&&(r.u_is_halo=1,la(i.buffers,e.segments,n,t,i.program,i.depthMode,o,s,r,1)),r.u_is_halo=0}la(i.buffers,e.segments,n,t,i.program,i.depthMode,o,s,i.uniformValues,1)}}}function la(t,i,n,r,o,s,a,l,c,u){const h=r.context,d=h.gl,f=[t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer,t.iconTransitioningVertexBuffer,t.globeExtVertexBuffer,t.zOffsetVertexBuffer,t.orientationVertexBuffer];t.featureIdBuffer&&f.push(t.featureIdBuffer);const p=t.uboBinder?null:t.programConfigurations.get(n.id);if(t.uboBinder){t.uboBinder.layer=n;const e=r.transform.zoom,i=r.style.getBrightness?r.style.getBrightness():null,o=t.uboBinder.getConstantUniformValues(e,i);c.u_spp_fill_np_color=o.fill_np_color,c.u_spp_halo_np_color=o.halo_np_color,c.u_spp_opacity=o.opacity,c.u_spp_halo_width=o.halo_width,c.u_spp_halo_blur=o.halo_blur,c.u_spp_emissive_strength=o.emissive_strength,c.u_spp_occlusion_opacity=o.occlusion_opacity,c.u_spp_z_offset=o.z_offset,c.u_spp_zoom_fraction=e-t.uboBinder._floorZoom;const s=n.paint.get(t.uboBinder.isText?"text-translate-anchor":"icon-translate-anchor"),a=t.uboBinder.hasPerFeatureTranslate()&&"map"===s?r.transform.angle:0;c.u_spp_translate_rotation=[Math.cos(a),Math.sin(a)]}const{batchIndices:m,batchSegments:_}=t.getBatchGrouping(i);for(const i of m){const m=_.get(i);t.uboBinder&&t.uboBinder.bind(h,o.program,i),o.draw(r,d.TRIANGLES,s,a,l,e.$.disabled,c,n.id,t.layoutVertexBuffer,t.indexBuffer,m,n.paint,r.transform.zoom,p,f,u)}}function ca(t,i,n,r,o,s){const a=n.paint.get("line-width"),l=n.paint.get("line-emissive-strength").isConstant(),c=n.paint.get("line-emissive-strength").constantOr(0),u=n.paint.get("line-occlusion-opacity"),h=n.layout.get("line-elevation-reference"),d="meters"===n.layout.get("line-width-unit"),f="sea"===h,p=!(!t.terrain||!t.terrain.enabled),m=t.context,_=m.gl;if(n.hasElevatedBuckets&&"globe"===t.transform.projection.name)return;const g=n.layout.get("line-cross-slope"),y=void 0!==g,v=g<1,x=o||t.colorModeForDrapableLayerRenderPass(l?c:null),b=t.terrain&&t.terrain.renderingToTexture||s,w=b?1:e.e.devicePixelRatio,T=n.paint.get("line-dasharray"),E=T.constantOr(1),S=n.layout.get("line-cap"),I=T.constantOr(null),A=S.constantOr(null),M=n.paint.get("line-pattern"),C=M.constantOr(1),D=n.paint.get("line-pattern-cross-fade"),P=M.constantOr(null),R=n.paint.get("line-opacity").constantOr(1);let L=!C&&1!==R||t.depthOcclusion&&u>0&&u<1;const z=n.paint.get("line-gradient"),F=0!==n.paint.get("line-border-width").constantOr(1)?n.paint.get("line-border-gradient"):null,O=C?"linePattern":"line",k=e.ea(n);let B;if(b&&t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(L=!1),0!==u&&t.depthOcclusion){const t=n.paint._values["line-opacity"];t&&t.value&&"constant"===t.value.kind?B=t.value:e.w(`Occlusion opacity for layer ${n.id} is supported only when line-opacity isn't data-driven.`)}"constant"!==a.value.kind&&!1===a.value.isLineProgressConstant&&k.push("VARIABLE_LINE_WIDTH");const N=n.paint.get("line-emissive-strength");C||"constant"===N.value.kind||!1!==N.value.isLineProgressConstant||k.push("VARIABLE_LINE_EMISSIVE_STRENGTH"),t._debugParams.showElevationIdDebug&&k.push("DEBUG_ELEVATION_ID"),b&&("dual-source-blending"!==t.emissiveMode||l?t.isEmissiveMrtActive()&&(k.push("USE_MRT1"),"mrt-full-rgba"===t.emissiveMode&&k.push("USE_MRT1_RGBA")):k.push("DUAL_SOURCE_BLENDING"));const V={},U=[],j=(r,o,s,a,l,c)=>{for(const h of r){const r=i.getTile(h);if(C&&!r.patternsLoaded())continue;const f=r.getBucket(n);if(!f)continue;if("none"!==f.elevationType&&!l||"none"===f.elevationType&&l)continue;t.prepareDrawTile();const p=[...o],g="road"===f.elevationType,y=t.shadowRenderer,v=g&&!!y&&y.enabled;let T=[0,0,0];if(v){const i=t.style.directionalLight,n=t.style.ambientLight;i&&n&&(T=e.aG(t.style,i,n)),p.push("RENDER_SHADOWS","NORMAL_OFFSET")}const S=f.programConfigurations.get(n.id);let M=!1;if(P&&r.imageAtlas){const t=e.aH.from(P),i=t.getPrimary().scaleSelf(w).toString(),n=r.imageAtlas.patternPositions.get(i),o=t.getSecondary(),s=o?r.imageAtlas.patternPositions.get(o.scaleSelf(w).toString()):null;M=!!n&&!!s,n&&S.setConstantPatternPositions(n,s)}D>0&&(M||S.getPatternTransitionVertexBuffer("line-pattern"))&&p.push("LINE_PATTERN_TRANSITION"),f.elevationGroundScaleVertexBuffer&&p.push("ELEVATION_GROUND_SCALE");const k=t.isTileAffectedByFog(h),N=t.getOrCreateProgram(O,{config:S,defines:p,overrideFog:k});if(!C&&I&&A&&r.lineAtlas){const e=r.lineAtlas.getDash(I,A);e&&S.setConstantPatternPositions(e)}v&&y.setupShadows(r.tileID.toUnwrapped(),N,"vector-tile");let[j,G]=n.paint.get("line-trim-offset");if("round"===A||"square"===A){const e=1;j!==G&&(0===j&&(j-=e),1===G&&(G+=e))}const $=b?h.projMatrix:null,H=d?1/f.tileToMeter/e.cd(r,1,t.transform.zoom):1,Z=d?1/f.tileToMeter/e.cd(r,1,Math.floor(t.transform.zoom)):1,q=E?n.paint._values["line-floorwidth"]:null;let W;const Y=r.dashIdealZ;
2if(q&&"constant"===q.value.kind&&Y!==r.tileID.overscaledZ){const e=f.zoom;e in V||(V[e]=Math.max(.01,n.widthExpression().evaluate({zoom:e}))),W=q.value.value,q.value.value=V[e]*Math.pow(2,Y-e)}const X=C?e.eb(t,r,n,$,w,H,Z,[j,G],T,D):e.ec(t,r,n,$,f.lineClipsArray.length,w,H,Z,[j,G],T),J=(r,o,s,a,l,c)=>{let u=r.texture;if(o!==r.version){let c=256;if(s){const n=i.getSource().maxzoom,r=h.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-h.canonical.z):1;c=e.b1(e.ed(f.maxLineLength/e.a6*1024*r),256,m.maxTextureSize)}r.gradient=e.ee({expression:a,evaluationKey:"lineProgress",resolution:c,image:r.gradient||void 0,clips:f.lineClipsArray,lut:l?null:n.lut}),r.texture?r.texture.update(r.gradient):r.texture=new e.T(m,r.gradient,_.RGBA8),r.version=o,u=r.texture}m.activeTexture.set(c),u.bind(s?_.NEAREST:_.LINEAR,_.CLAMP_TO_EDGE)};z&&J(f.gradients[n.id],n.gradientVersion,n.stepInterpolant,n.gradientExpression(),"none"===n.paint.get("line-gradient-use-theme").constantOr("default"),_.TEXTURE1),F&&J(f.borderGradients[n.id],n.borderGradientVersion,n.borderStepInterpolant,n.borderGradientExpression(),"none"===n.paint.get("line-border-gradient-use-theme").constantOr("default"),_.TEXTURE2),E&&(m.activeTexture.set(_.TEXTURE0),r.lineAtlasTexture&&r.lineAtlasTexture.bind(_.LINEAR,_.REPEAT),S.updatePaintBuffers()),C&&(m.activeTexture.set(_.TEXTURE0),r.imageAtlasTexture&&r.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),S.updatePaintBuffers()),l&&!g&&t.terrain.setupElevationDraw(r,N),t.uploadCommonUniforms(m,N,h.toUnwrapped());const K=$n.drawLineFrcCoverageDetect?$n.drawLineFrcCoverageDetect(t,f,h,l,X,S,N,s,x,U):null,Q=(i,r,o)=>{r&&0!==r.get().length&&(null!=B&&(B.value=R*u),void 0!==o&&(X.u_opacity_multiplier=o),N.draw(t,_.TRIANGLES,s,i,x,e.$.disabled,X,n.id,f.layoutVertexBuffer,f.indexBuffer,r,n.paint,t.transform.zoom,S,[f.layoutVertexBuffer2,f.patternVertexBuffer,f.zOffsetVertexBuffer,f.elevationIdColVertexBuffer,f.elevationGroundScaleVertexBuffer]),void 0!==o&&(X.u_opacity_multiplier=1),null!=B&&(B.value=R))},ee=e=>{K&&K.active&&$n.drawLineFrcRenderLine?$n.drawLineFrcRenderLine(f,K,e,Q):Q(e,f.segments)};if(L&&!l){const i=t.stencilModeForClipping(h).ref;0===i&&b&&m.clear({stencil:0});const n={func:_.EQUAL,mask:255};X.u_alpha_discard_threshold=.8,ee(new e._(n,i,255,_.KEEP,_.KEEP,_.INVERT)),X.u_alpha_discard_threshold=0,ee(new e._(n,i,255,_.KEEP,_.KEEP,_.KEEP))}
vendor: 8,065 bytes, line 2
2else X.u_alpha_discard_threshold=L&&l&&c?.8:0,ee(l?a:t.stencilModeForClipping(h));K&&$n.drawLineFrcFadePass&&$n.drawLineFrcFadePass(t,f,h,K,l,a,Q),void 0!==W&&(q.value.value=W)}};let G=t.depthModeForSublayer(0,e.Z.ReadOnly);const $=new e.Z(t.depthOcclusion?_.GREATER:_.LEQUAL,e.Z.ReadOnly,t.depthRangeFor3D);if(n.hasNonElevatedBuckets){const i=!b&&t.terrain;0!==u&&i?e.w(`Occlusion opacity for layer ${n.id} is supported on terrain only if the layer has line-z-offset enabled.`):i?e.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${n.id}.`):j(r,k,G,e._.disabled,!1,!0)}if(n.hasElevatedBuckets){"hd-road-markup"===h?p||(G=$,k.push("ELEVATED_ROADS")):(k.push("ELEVATED"),G=$,y&&k.push(v?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),f&&k.push("ELEVATION_REFERENCE_SEA"));const i=L?t.stencilModeFor3D():e._.disabled;"hd-road-markup"!==h&&(t.forceTerrainMode=!0),j(r,k,G,i,!0,!0),L&&j(r,k,G,i,!0,!1),"hd-road-markup"!==h&&(t.forceTerrainMode=!1)}$n.drawLineFrcCoverageSecondPass&&$n.drawLineFrcCoverageSecondPass(t,n,U),L&&(t.resetStencilClippingMasks(),b&&m.clear({stencil:0})),0===u||t.depthOcclusion||b||t.layersWithOcclusionOpacity.push(t.currentLayer)}class ua{destroy(){this.fbo&&(this.fbo.destroy(),this.fbo=null),this.drapeFbo&&(this.drapeFbo.destroy(),this.drapeFbo=null)}}class ha{constructor(e){this.pbo=e.createBuffer(),this.sync=null,this.fboA=null,this.fboB=null,this.maxDensity=0}destroy(e){this.sync&&(e.deleteSync(this.sync),this.sync=null),e.deleteBuffer(this.pbo),this.fboA&&(this.fboA.destroy(),this.fboA=null),this.fboB&&(this.fboB.destroy(),this.fboB=null)}}const da={additive:{clearColor:new e.C(0,0,0,0),colorMode:e.a1.additiveAlphaWeighted,compositeUniformValue:1},multiply:{clearColor:new e.C(1,1,1,1),colorMode:e.a1.multiply,compositeUniformValue:0}};function fa(e){return!(!e.extRenderToTextureHalfFloat&&!e.extColorBufferFloat)}function pa(t,i){return"additive"===t&&fa(i)?e.a1.additiveAlphaWeightedUnboundedAlpha:da[t].colorMode}function ma(t,i,n){const r=t.context,o=r.gl;let s=n.width,a=n.height,l=n.colorAttachment0.get();i.lineBlendDensityReadback||(i.lineBlendDensityReadback=new ha(o));const c=i.lineBlendDensityReadback;let u=0,h=!0;for(;s>1||a>1;){const n=Math.max(1,Math.floor(s/2)),d=Math.max(1,Math.floor(a/2)),f=0===u?"fboA":"fboB";c[f]=ta.createWithTexture(r,c[f],n,d,!1);const p=c[f];r.bindFramebuffer.set(p.framebuffer),r.viewport.set([0,0,n,d]),r.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,l),t.getOrCreateProgram("lineBlendReduce").draw(t,o.TRIANGLES,e.Z.disabled,e._.disabled,e.a1.unblended,e.$.disabled,Qr(0,[1/s,1/a],h),i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom),s=n,a=d,l=p.colorAttachment0.get(),u=1-u,h=!1}const d=fa(r),f=d?16:4;c.sync&&(o.deleteSync(c.sync),c.sync=null),o.bindBuffer(o.PIXEL_PACK_BUFFER,c.pbo),o.bufferData(o.PIXEL_PACK_BUFFER,f,o.STREAM_READ),o.readPixels(0,0,1,1,o.RGBA,d?o.FLOAT:o.UNSIGNED_BYTE,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),c.sync=o.fenceSync(o.SYNC_GPU_COMMANDS_COMPLETE,0),r.viewport.set([0,0,t.width,t.height])}function _a(e,t,i){if(!fa(e.context))return;const n=t.lineBlendDensityReadback;n&&n.sync?(function(e,t,i){if(e.sync&&t.getSyncParameter(e.sync,t.SYNC_STATUS)===t.SIGNALED){if(t.deleteSync(e.sync),e.sync=null,t.bindBuffer(t.PIXEL_PACK_BUFFER,e.pbo),fa(i)){const i=new Float32Array(4);t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,i);const n=i[1];e.maxDensity=Math.max(2*(n>0?i[0]/n:0),1)}else e.maxDensity=1;t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}}(n,e.context.gl,e.context),n.sync||(ma(e,t,i),e.style.map.triggerRepaint())):(ma(e,t,i),e.style.map.triggerRepaint())}function ga(t,i,n,r,o,s){const a=t.context,l=a.gl,c="additive"===n?1:i.paint.get("line-opacity").constantOr(1),u="additive"===n?function(e,t){const i=t.paint.get("line-blend-additive-clamp");if(i>0)return i;const n=t.lineBlendDensityReadback;return n&&0!==n.maxDensity?n.maxDensity:null}(0,i):1;if(null===u)return;a.bindFramebuffer.set(o),s&&a.viewport.set([0,0,s[0],s[1]]),a.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,r.colorAttachment0.get());const h=pa(n,t.context);t.getOrCreateProgram("lineBlendComposite").draw(t,l.TRIANGLES,e.Z.disabled,e._.disabled,h,e.$.disabled,((e,t,i,n)=>({u_image:0,u_opacity:t,u_blend_mode:i,u_max_density:n}))(0,c,da[n].compositeUniformValue,u),i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom)}function ya(t,i,n,r){const{painter:o,sourceCache:s,layer:a,coords:l,colorMode:c,elevationType:u,terrainEnabled:h,pass:d}=t,f=o.context.gl,p=a.paint.get("fill-pattern"),m=a.paint.get("fill-pattern-cross-fade"),_=p.constantOr(null);let g=u;"road"!==u||i&&!h||(g="none");const y="road"===g,v=t.painter.shadowRenderer,x=y&&!!v&&v.enabled,b=new e.Z(o.context.gl.LEQUAL,e.Z.ReadOnly,o.depthRangeFor3D);let w=[0,0,0];if(x){const t=o.style.directionalLight,i=o.style.ambientLight;t&&i&&(w=e.aG(o.style,t,i))}const T=p&&p.constantOr(1),E=o.terrain&&o.terrain.renderingToTexture,S=(t,d)=>{let p,g,S,I,A;d?(p=T&&!a.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",S=f.LINES):(p=T?"fillPattern":"fill",S=f.TRIANGLES);const M=[];for(const C of l){const l=s.getTile(C);if(T&&!l.patternsLoaded())continue;const D=l.getBucket(a);if(!D)continue;const P=i?D.hdExt&&D.hdExt.elevationBufferData:D.bufferData;if(!P||P.isEmpty())continue;o.prepareDrawTile();const R=P.programConfigurations.get(a.id),L=o.isTileAffectedByFog(C),z=[],F=[];y&&(z.push("ELEVATED_ROADS"),F.push(P.elevatedLayoutVertexBuffer)),x&&z.push("RENDER_SHADOWS","NORMAL_OFFSET"),E&&n&&(z.push("USE_MRT1"),"mrt-full-rgba"===o.emissiveMode&&z.push("USE_MRT1_RGBA")),T&&(o.context.activeTexture.set(f.TEXTURE0),l.imageAtlasTexture&&l.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),R.updatePaintBuffers());let O=!1;if(_&&l.imageAtlas){const t=l.imageAtlas,i=e.aH.from(_),n=i.getPrimary().scaleSelf(e.e.devicePixelRatio).toString(),r=i.getSecondary(),o=t.patternPositions.get(n),s=r?t.patternPositions.get(r.scaleSelf(e.e.devicePixelRatio).toString()):null;O=!!o&&!!s,o&&R.setConstantPatternPositions(o,s)}m>0&&(O||R.getPatternTransitionVertexBuffer("fill-pattern"))&&z.push("FILL_PATTERN_TRANSITION");const k=o.getOrCreateProgram(p,{config:R,overrideFog:L,defines:z}),B=o.translatePosMatrix(C.projMatrix,l,a.paint.get("fill-translate"),a.paint.get("fill-translate-anchor"));x&&v.setupShadows(l.tileID.toUnwrapped(),k,"vector-tile");const N=a.paint.get("fill-emissive-strength");if(d){I=P.lineIndexBuffer,A=P.lineSegments;const e=o.terrain&&o.terrain.renderingToTexture?o.terrain.drapeBufferSize:[f.drawingBufferWidth,f.drawingBufferHeight];g="fillOutlinePattern"===p&&T?Kr(B,N,o,l,e,w,m):Jr(B,N,e,w)}else I=P.indexBuffer,A=P.triangleSegments,g=T?Xr(B,N,o,l,w,m):Yr(B,N,w);o.uploadCommonUniforms(o.context,k,C.toUnwrapped());let V=t;if(("road"===u&&!h||"offset"===u)&&(V=b),!A||A.get&&0===A.get().length)continue;const U=r||o.stencilModeForClipping(C);let j="fallthrough";!d&&$n.drawFillFrcCoverageFirstPass&&(j=$n.drawFillFrcCoverageFirstPass({painter:o,layer:a,bucket:D,coord:C,elevatedGeometry:i,program:k,programConfiguration:R,uniformValues:g,drawMode:S,depthMode:V,stencilMode:U,colorMode:c,bufferData:P,indexBuffer:I,segments:A,dynamicBuffers:F,polygonCoverageTiles:M})),"fallthrough"===j&&k.draw(o,S,V,U,c,e.$.disabled,g,a.id,P.layoutVertexBuffer,I,A,a.paint,o.transform.zoom,R,F)}!d&&$n.drawFillFrcCoverageSecondPass&&$n.drawFillFrcCoverageSecondPass(o,a,M,S,c)};o.renderPass===d&&S(o.depthModeForSublayer(1,"opaque"===o.renderPass?e.Z.ReadWrite:e.Z.ReadOnly),!1),"none"===g&&"translucent"===o.renderPass&&a.paint.get("fill-antialias")&&S(o.depthModeForSublayer(a.getPaintProperty("fill-outline-color")?2:0,e.Z.ReadOnly),!0)}function va(t){return[t[0]*e.eg,t[1]*e.eg,t[2]*e.eg,0]}function xa(t,i,n,r,o,s,a,l,c,u){const h=o.getSource(),d=r.globeSharedBuffers;if(!d)return;let f,p,m;if(n&&(f=o.getTile(n)),h instanceof bo?(p=h.texture,m=e.c1(0,0,r.transform)):f&&n&&(p=f.texture,m=e.c1(n.canonical.z,n.canonical.x,r.transform)),!p||!m)return;
vendor: 8,754 bytes, line 2
2i||(m=e.aO(e.Y(),m,[1,-1,1]));const _=r.context,g=_.gl,y="nearest"===s.paint.get("raster-resampling")?g.NEAREST:g.LINEAR,v=r.colorModeForDrapableLayerRenderPass(a),x=l.defines;x.push("GLOBE_POLES");const b=new e.Z(g.LEQUAL,e.Z.ReadWrite,r.depthRangeFor3D),w=r.transform.expandedFarZProjMatrix,T=Float32Array.from(e.b5(e.b6(new e.bW(0,0,0))));r.terrain&&r.terrain.prepareDrawTile(),_.activeTexture.set(g.TEXTURE0),p.bind(y,g.CLAMP_TO_EDGE),_.activeTexture.set(g.TEXTURE1),p.bind(y,g.CLAMP_TO_EDGE),"useMipmap"in p&&_.extTextureFilterAnisotropic&&r.transform.pitch>20&&g.texParameterf(g.TEXTURE_2D,_.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,_.extTextureFilterAnisotropicMax);const[E,S,I,A]=n?d.getPoleBuffers(n.canonical.z,!1):d.getPoleBuffers(0,!0),M=t;let C;i?(C=E,r.renderDefaultNorthPole=0!==M):(C=S,r.renderDefaultSouthPole=0!==M);const D=va(l.mix),P=((e,t,i,n,r,o,s,a,l,c,u,h,d,f)=>no(e,t,i,n,new Float32Array(16),new Float32Array(9),[0,0],r,[0,0],[0,0,0,0],1,{opacity:1,mix:0},s,[0,0]||0,l,2,u,h,d,1,0,f))(r,w,T,m,e.S(r.transform.zoom),0,s,0,M,0,D,l.offset,l.range,a),R=r.getOrCreateProgram("raster",{defines:x});r.uploadCommonUniforms(_,R,null),R.draw(r,g.TRIANGLES,b,u,v,c,P,s.id,C,I,A)}function ba(e){if(e.isOrthographic)return[0,0,0,0];const t=e._nearZ,i=e.projection.farthestPixelDistance(e),n=i-t,r=.2*e.height,o=t+r;return[t,i,(o-r-t)/n,(o-t)/n]}function wa(e,t,i,n){if(e)return"raster-array"===t.type?t.getTextureDescriptor(e,i,!0):{texture:e.texture,mix:va(n.mix),offset:n.offset,buffer:0,tileSize:1}}const Ta=e.df(new Float32Array(16)),Ea={"dual-source-blending":"dual-source-blending","mrt-fallback":"mrt","mrt-full-rgba":"mrt-rgba"},Sa=e.a$([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Ia}=Sa;function Aa(e,t,i,n){e.emplaceBack(t,i,n)}class Ma{constructor(t){this.vertexArray=new e.eh,this.indices=new e.ae,Aa(this.vertexArray,-1,-1,1),Aa(this.vertexArray,1,-1,1),Aa(this.vertexArray,-1,1,1),Aa(this.vertexArray,1,1,1),Aa(this.vertexArray,-1,-1,-1),Aa(this.vertexArray,1,-1,-1),Aa(this.vertexArray,-1,1,-1),Aa(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=t.createVertexBuffer(this.vertexArray,Ia),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=e.ad.simpleSegment(0,0,36,12)}}function Ca(t,i,n,r,o,s){const a=t.context.gl,l=i.paint.get("sky-atmosphere-color"),c=i.paint.get("sky-atmosphere-halo-color"),u=i.paint.get("sky-atmosphere-sun-intensity"),h=((e,t,i,n,r)=>({u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:i,u_color_tint_r:[n.r,n.g,n.b,n.a],u_color_tint_m:[r.r,r.g,r.b,r.a],u_luminance:5e-5}))(e.ek(e.el(),r),o,u,l.toPremultipliedRenderColor(null),c.toPremultipliedRenderColor(null));a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+s,i.skyboxTexture,0),n.draw(t,a.TRIANGLES,e.Z.disabled,e._.disabled,e.a1.unblended,e.$.frontCW,h,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}const Da=e.a$([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Pa{constructor(t){const i=new e.em;i.emplaceBack(-1,1,1,0,0),i.emplaceBack(1,1,1,1,0),i.emplaceBack(1,-1,1,1,1),i.emplaceBack(-1,-1,1,0,1);const n=new e.ae;n.emplaceBack(0,1,2),n.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(i,Da.members),this.indexBuffer=t.createIndexBuffer(n),this.segments=e.ad.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Ra=e.a$([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_opacity",components:1}]);class La{constructor(){this.colorModeAlphaBlendedWriteRGB=new e.a1([e.en,e.eo,e.en,e.eo],e.C.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new e.a1([e.en,e.ep,e.en,e.ep],e.C.transparent,[!1,!1,!1,!0]),this.params={starsCount:16e3,sizeMultiplier:.15,sizeRange:100,intensityRange:200},this.updateNeeded=!0,this._painter=null,this._devtoolsFolder=null}update(t){this._painter=t;const i=t.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new Pa(i);let t=this.params;const n=t.sizeRange,r=t.intensityRange,o=function(t){const i=e.bj(30),n=[];for(let r=0;r<t;++r){const t=2*Math.PI*i(),r=Math.acos(1-2*i())-.5*Math.PI;n.push(e.bi(Math.cos(r)*Math.cos(t),Math.cos(r)*Math.sin(t),Math.sin(r)))}return n}(t.starsCount),s=e.bj(300),a=new e.eq,l=new e.ae;let c=0;for(let t=0;t<o.length;++t){const i=e.dV([],o[t],200),u=Math.max(0,1+.01*n*(1*s()-.5)),h=Math.max(0,1+.01*r*(1*s()-.5));a.emplaceBack(i[0],i[1],i[2],-1,-1,u,h),a.emplaceBack(i[0],i[1],i[2],1,-1,u,h),a.emplaceBack(i[0],i[1],i[2],1,1,u,h),a.emplaceBack(i[0],i[1],i[2],-1,1,u,h),l.emplaceBack(c+0,c+1,c+2),l.emplaceBack(c+0,c+2,c+3),c+=4}this.starsVx=i.createVertexBuffer(a,Ra.members),this.starsIdx=i.createIndexBuffer(l),this.starsSegments=e.ad.simpleSegment(0,0,a.length,l.length)}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy(),this._painter=null}drawAtmosphereGlow(t,i){const n=t.context,r=n.gl,o=t.transform,s=new e.Z(r.LEQUAL,e.Z.ReadOnly,[0,1]),a=e.S(o.zoom),l=t.style.getLut(i.scope),c="none"===i.properties.get("color-use-theme"),u=i.properties.get("color").toNonPremultipliedRenderColor(c?null:l),h="none"===i.properties.get("high-color-use-theme"),d=i.properties.get("high-color").toNonPremultipliedRenderColor(h?null:l),f="none"===i.properties.get("space-color-use-theme"),p=i.properties.get("space-color").toNonPremultipliedRenderColor(f?null:l),m=5e-4,_=e.er(i.properties.get("horizon-blend"),0,1,m,.25),g=e.c0(t,n,o)&&_===m?o.worldSize/(2*Math.PI*1.025)-1:o.globeRadius,y=t.frameCounter/1e3%1,v=e.es(o.globeCenterInViewSpace),x=Math.sqrt(Math.pow(v,2)-Math.pow(g,2)),b=Math.acos(x/v),w=i=>{const l="globe"===o.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];i&&l.push("ALPHA_PASS");const c=t.getOrCreateProgram("globeAtmosphere",{defines:l}),h=((e,t,i,n,r,o,s,a,l,c,u,h)=>({u_frustum_tl:e,u_frustum_tr:t,u_frustum_br:i,u_frustum_bl:n,u_horizon:r,u_transition:o,u_fadeout_range:s,u_atmosphere_fog_color:a.toArray01(),u_high_color:l.toArray01(),u_space_color:c.toArray01(),u_temporal_offset:u,u_horizon_angle:h}))(o.frustumCorners.TL,o.frustumCorners.TR,o.frustumCorners.BR,o.frustumCorners.BL,o.frustumCorners.horizon,a,_,u,d,p,y,b);t.uploadCommonUniforms(n,c);const f=this.atmosphereBuffer;f&&c.draw(t,r.TRIANGLES,s,e._.disabled,i?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,e.$.backCW,h,i?"atmosphere_glow_alpha":"atmosphere_glow",f.vertexBuffer,f.indexBuffer,f.segments)};w(!1),w(!0)}drawStars(t,i){const n=e.b1(i.properties.get("star-intensity"),0,1);if(0===n)return;const r=t.context,o=r.gl,s=t.transform,a=t.getOrCreateProgram("stars"),l=e.be([]);e.bf(l,l,-s._pitch),e.bg(l,l,-s.angle),e.bf(l,l,e.av(s._center.lat)),e.et(l,l,-e.av(s._center.lng));const c=e.bh(new Float32Array(16),l),u=e.X([],s.starsProjMatrix,c),h=e.ek([],c),d=e.eu([],h);let f=this.params.sizeMultiplier;const p=[0,1,0];e.cT(p,p,d),e.dV(p,p,f);const m=[1,0,0];e.cT(m,m,d),e.dV(m,m,f);const _=(g=p,y=m,v=n,{u_matrix:Float32Array.from(u),u_up:g,u_right:y,u_intensity_multiplier:v});var g,y,v;t.uploadCommonUniforms(r,a),this.starsVx&&this.starsIdx&&a.draw(t,o.TRIANGLES,e.Z.disabled,e._.disabled,this.colorModeAlphaBlendedWriteRGB,e.$.disabled,_,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}class za{}class Fa{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(t,i,n){{const e=this._storage.get(i.id);if(e)return e.lastUsedFrameIdx=t,e.buf}const r=n.gl,o=r.getBufferParameter(r.ELEMENT_ARRAY_BUFFER,r.BUFFER_SIZE),s=new ArrayBuffer(o),a=new Int16Array(s);r.getBufferSubData(r.ELEMENT_ARRAY_BUFFER,0,new Int16Array(s));const l=new e.ev;for(let e=0;e<o/2;e+=3){const t=a[e],i=a[e+1],n=a[e+2];l.emplaceBack(t,i),l.emplaceBack(i,n),l.emplaceBack(n,t)}const c=n.bindVertexArrayOES.current,u=new za;return u.buf=new Ks(n,l),u.lastUsedFrameIdx=t,this._storage.set(i.id,u),n.bindVertexArrayOES.set(c),u.buf}update(e){for(const[t,i]of this._storage)e-i.lastUsedFrameIdx>30&&(i.buf.destroy(),this._storage.delete(t))}destroy(){for(const[e,t]of this._storage)t.buf.destroy(),this._storage.delete(e)}}class Oa{constructor(){this.occluderSize=30,this.depthOffset=-1e-4}}
vendor: 2,962 bytes, line 2
2const ka={symbol:function(t,i,n,r,o){if("translucent"!==t.renderPass)return;const s=e._.disabled,a=t.colorModeForRenderPass(),l=n.layout.get("text-variable-anchor"),c=n.layout.get("text-size-scale-range"),u=e.b1(t.scaleFactor,c[0],c[1]);l&&function(t,i,n,r,o,s,a,l){const c=i.transform,u="map"===o,h="map"===s;for(const i of t){const t=r.getTile(i),o=t.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;const s=e.dl(o.textSizeData,c.zoom,l),d=e.e1(i,o.getProjection(),c),f=c.calculatePixelsToTileUnitsMatrix(t),p=e.e2(d,t.tileID.canonical,h,u,c,o.getProjection(),f),m=o.hasIconTextFit()&&o.hasIconData();s&&sa(o,u,h,a,c,p,i,Math.pow(2,c.zoom-t.tileID.overscaledZ),s,m)}}(r,t,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),o,u);const h=0!==n.paint.get("icon-opacity").constantOr(1),d=0!==n.paint.get("text-opacity").constantOr(1);void 0!==n.layout.get("symbol-sort-key").constantOr(1)&&(h||d)?aa(t,i,n,r,s,a):(h&&aa(t,i,n,r,s,a,{onlyIcons:!0}),d&&aa(t,i,n,r,s,a,{onlyText:!0})),i.map.showCollisionBoxes&&yt.drawCollisionDebug&&(yt.drawCollisionDebug(t,i,n,r,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),yt.drawCollisionDebug(t,i,n,r,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(t,i,n,r){if("translucent"!==t.renderPass)return;const o=n.paint.get("circle-opacity"),s=n.paint.get("circle-stroke-width"),a=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1),c=n.paint.get("circle-emissive-strength");if(0===o.constantOr(1)&&(0===s.constantOr(1)||0===a.constantOr(1)))return;const u=t.context,h=u.gl,d=t.transform,f=!(!t.terrain||!t.terrain.enabled),p=n.layout.get("circle-elevation-reference"),m=t.depthModeForSublayer(0,e.Z.ReadOnly),_=new e.Z(t.context.gl.LEQUAL,e.Z.ReadOnly,t.depthRangeFor3D),g="none"===p||f?m:_,y=e._.disabled,v=t.colorModeForDrapableLayerRenderPass(c),x="globe"===d.projection.name,b=[e.a7(d.center.lng),e.a8(d.center.lat)],w=[];for(let o=0;o<r.length;o++){const s=r[o],a=i.getTile(s),c=a.getBucket(n);if(!c||c.projection.name!==d.projection.name)continue;const u=c.programConfigurations.get(n.id),h=c.layoutVertexBuffer,f=c.globeExtVertexBuffer,p=c.indexBuffer,m=e.e8(n),_=[f],g=t.isTileAffectedByFog(s);x&&m.push("PROJECTION_GLOBE_VIEW"),m.push("DEPTH_D24"),t.terrain&&d.depthOcclusionForSymbolsAndCircles&&m.push("DEPTH_OCCLUSION"),c.hdExt&&c.hdExt.hasElevation&&!t.terrain&&(m.push("ELEVATED_ROADS"),_.push(c.hdExt.elevatedLayoutVertexBuffer));const y=t.getOrCreateProgram("circle",{config:u,defines:m,overrideFog:g}),v=d.projection.createInversionMatrix(d,s.canonical),T={programConfiguration:u,program:y,layoutVertexBuffer:h,dynamicBuffers:_,indexBuffer:p,uniformValues:e.e9(t,s,a,v,b,n),tile:a};if(l){const t=c.segments.get();for(const i of t)w.push({segments:new e.ad([i]),sortKey:i.sortKey,state:T})}else w.push({segments:c.segments,sortKey:0,state:T})}l&&w.sort((e,t)=>
vendor: 5,098 bytes, line 2
2e.sortKey-t.sortKey);const T={useDepthForOcclusion:d.depthOcclusionForSymbolsAndCircles};for(const i of w){const{programConfiguration:r,program:o,layoutVertexBuffer:s,dynamicBuffers:a,indexBuffer:l,uniformValues:c,tile:f}=i.state,p=i.segments;t.terrain&&t.terrain.setupElevationDraw(f,o,T),t.uploadCommonUniforms(u,o,f.tileID.toUnwrapped()),o.draw(t,h.TRIANGLES,g,y,v,e.$.disabled,c,n.id,s,l,p,n.paint,d.zoom,r,a)}},heatmap:function(t,i,n,r){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const o=t.context,s=o.gl,a=e._.disabled,l=new e.a1([s.ONE,s.ONE,s.ONE,s.ONE],e.C.transparent,[!0,!0,!0,!0]),c="globe"===t.transform.projection.name?.5:.25;n.heatmapFbo=ta.createWithTexture(o,n.heatmapFbo,t.width*c,t.height*c),o.clear({color:e.C.transparent});const u=t.transform,h="globe"===u.projection.name,d=h?["PROJECTION_GLOBE_VIEW"]:[],f=h?e.$.frontCCW:e.$.disabled,p=[e.a7(u.center.lng),e.a8(u.center.lat)];for(let c=0;c<r.length;c++){const m=r[c];if(i.hasRenderableParent(m))continue;const _=i.getTile(m),g=_.getBucket(n);if(!g||g.projection.name!==u.projection.name)continue;const y=t.isTileAffectedByFog(m),v=g.programConfigurations.get(n.id),x=t.getOrCreateProgram("heatmap",{config:v,defines:d,overrideFog:y}),{zoom:b}=t.transform;t.terrain&&t.terrain.setupElevationDraw(_,x),t.uploadCommonUniforms(o,x,m.toUnwrapped());const w=u.projection.createInversionMatrix(u,m.canonical);x.draw(t,s.TRIANGLES,e.Z.disabled,a,l,f,to(t,m,_,w,p,b,n.paint.get("heatmap-intensity")),n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,n.paint,t.transform.zoom,v,h?[g.globeExtVertexBuffer]:null)}o.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,i){const n=t.context,r=n.gl,o=i.heatmapFbo;if(!o)return;n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o.colorAttachment0.get()),n.activeTexture.set(r.TEXTURE1);let s=i.colorRampTexture;s||(s=i.colorRampTexture=new e.T(n,i.colorRamp,r.RGBA8)),s.bind(r.LINEAR,r.CLAMP_TO_EDGE),t.getOrCreateProgram("heatmapTexture").draw(t,r.TRIANGLES,e.Z.disabled,e._.disabled,t.colorModeForRenderPass(),e.$.disabled,((e,t)=>({u_image:0,u_color_ramp:1,u_opacity:t.paint.get("heatmap-opacity")}))(0,i),i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom)}(t,n))},line:function(e,t,i,n){const r=i.paint.get("line-opacity"),o=i.paint.get("line-width");if(0===r.constantOr(1)||0===o.constantOr(1))return;const s=i.paint.get("line-blend-mode"),a=e.terrain&&e.terrain.renderingToTexture;if("default"===s||"globe"===e.transform.projection.name)"translucent"===e.renderPass&&ca(e,t,i,n);else{if(a)return void function(e,t,i,n,r){if("translucent"!==e.renderPass)return;const o=e.context,s=o.gl,a=e.terrain;if(!a)return;const l=o.bindFramebuffer.current,c=e.isEmissiveMrtActive(),u=a.drapeBufferSize[0],h=a.drapeBufferSize[1];i.lineBlendFbos||(i.lineBlendFbos=new ua),i.lineBlendFbos.drapeFbo=ta.createWithTexture(o,i.lineBlendFbos.drapeFbo,u,h,!0),c&&s.drawBuffers([s.COLOR_ATTACHMENT0]),o.clear({color:da[r].clearColor,depth:1,stencil:0});const d=e.currentStencilSource,f=e._tileClippingMaskIDs,p=e.nextStencilID;e.currentStencilSource=void 0,e._tileClippingMaskIDs={},e.nextStencilID=1;const m=e._terrain;e._terrain=null,e._renderTileClippingMasks(i,t,n),ca(e,t,i,n,pa(r,e.context),!0),e._terrain=m,e.currentStencilSource=d,e._tileClippingMaskIDs=f,e.nextStencilID=p,c&&s.drawBuffers([s.COLOR_ATTACHMENT0,s.COLOR_ATTACHMENT1]);const _=a.drapeBufferSize,g=i.lineBlendFbos&&i.lineBlendFbos.drapeFbo;g&&("additive"===r&&_a(e,i,g),ga(e,i,r,g,l,_))}(e,t,i,n,s);if("offscreen"===e.renderPass)return void function(e,t,i,n,r){const o=e.context,s=Math.ceil(e.width),a=Math.ceil(e.height);i.lineBlendFbos||(i.lineBlendFbos=new ua),i.lineBlendFbos.fbo=ta.createWithTexture(o,i.lineBlendFbos.fbo,s,a,!0),o.clear({color:da[r].clearColor,depth:1,stencil:0});const l=e.currentStencilSource,c=e._tileClippingMaskIDs,u=e.nextStencilID;e.currentStencilSource=void 0,e._tileClippingMaskIDs={},e.nextStencilID=1,e._renderTileClippingMasks(i,t,n);const h=e.renderPass;e.renderPass="translucent",ca(e,t,i,n,pa(r,e.context)),e.renderPass=h,e.currentStencilSource=l,e._tileClippingMaskIDs=c,e.nextStencilID=u,o.viewport.set([0,0,e.width,e.height]),"additive"===r&&_a(e,i,i.lineBlendFbos.fbo)}(e,t,i,n,s);if("translucent"===e.renderPass){const t=i.lineBlendFbos&&i.lineBlendFbos.fbo;return void(t&&ga(e,i,s,t,null))}}},fill:function(t,i,n,r){const o=n.paint.get("fill-color"),s=n.paint.get("fill-opacity");if(0===s.constantOr(1))return;const a=n.paint.get("fill-emissive-strength"),l=t.colorModeForDrapableLayerRenderPass(a),c=n.paint.get("fill-pattern"),u=t.opaquePassEnabledForLayer()&&!c.constantOr(1)&&1===o.constantOr(e.C.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";let h="none";"none"!==n.layout.get("fill-elevation-reference")?h="road":0!==n.paint.get("fill-z-offset").constantOr(1)&&(h="offset");const d=!(!t.terrain||!t.terrain.enabled),f={painter:t,sourceCache:i,layer:n,coords:r,colorMode:l,elevationType:h,terrainEnabled:d,pass:u};
2if("shadow"===t.renderPass)return void(t.shadowRenderer&&"road"===h&&!d&&$n.drawElevatedFillShadows&&$n.drawElevatedFillShadows(f));const p=t.isEmissiveMrtActive();if("offset"!==h){if(ya(f,!1,p),"road"===h){const o=!d&&"translucent"===t.renderPass;o&&$n.drawDepthPrepass&&$n.drawDepthPrepass(t,i,n,r,"geometry"),ya(f,!0,p,e._.disabled),o&&$n.drawElevatedStructures&&$n.drawElevatedStructures(f)}}else ya(f,!1,p,t.stencilModeFor3D())},"fill-extrusion":function(t,i,n,r){const o=n.paint.get("fill-extrusion-opacity"),s=t.context,a=s.gl,l=t.terrain,c=l&&l.renderingToTexture;if(0===o)return;const u=t.isEmissiveMrtActive(),h=t.conflationActive&&t.style.isLayerClipped(n,i.getSource()),d=t.style.order.indexOf(n.fqid);if(h&&function(e,t,i,n,r){for(const o of n){const n=t.getTile(o).getBucket(i);n&&(n.updateReplacement(o,e.replacementSource,r),n.uploadCentroid(e.context))}}(t,i,n,r,d),l||h)for(const e of r){const r=i.getTile(e).getBucket(n);r&&hi(t.context,i,e,r,n,l,h)}if("shadow"===t.renderPass&&t.shadowRenderer){if(l&&o<.65&&n._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof e.ak)return;const s=t.shadowRenderer.getShadowPassDepthMode();li(t,i,n,r,s,e._.disabled,e.a1.disabled,h)}else if("translucent"===t.renderPass){const d=!n.paint.get("fill-extrusion-pattern").constantOr(1),f=n.paint.get("fill-extrusion-color").constantOr(e.C.white);if(!c&&0!==f.a){const s=new e.Z(t.context.gl.LEQUAL,e.Z.ReadWrite,t.depthRangeFor3D);1===o&&d?li(t,i,n,r,s,e._.disabled,e.a1.unblended,h):(li(t,i,n,r,s,e._.disabled,e.a1.disabled,h),li(t,i,n,r,s,t.stencilModeFor3D(),t.colorModeForRenderPass(),h),t.resetStencilClippingMasks())}const p=t.style.enable3dLights()&&d&&(!l&&"globe"!==t.transform.projection.name||c);if(p&&!si.drawGroundEffect&&ai(),p&&si.drawGroundEffect){const o=n.paint.get("fill-extrusion-opacity"),d=n.paint.get("fill-extrusion-ambient-occlusion-intensity"),f=n.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),p=n.paint.get("fill-extrusion-flood-light-intensity"),m="none"===n.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),_=n.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(m?null:n.lut).toArray01().slice(0,3),g=d>0&&f>0,y=p>0,v=new ci;v.translate=n.paint.get("fill-extrusion-translate"),v.translateAnchor=n.paint.get("fill-extrusion-translate-anchor"),v.edgeRadius=n.layout.get("fill-extrusion-edge-radius"),v.cutoffFadeRange=n.paint.get("fill-extrusion-cutoff-fade-range");const x=s=>{const l=t.depthModeForSublayer(1,e.Z.ReadOnly,a.LEQUAL,!0),c=n.paint.get(s?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),u=e.am(.1,3,c),m=t._showOverdrawInspector;if(!m){const c=new e._({func:a.ALWAYS,mask:255},255,255,a.KEEP,a.KEEP,a.REPLACE),m=new e.a1([a.ONE,a.ONE,a.ONE,a.ONE],e.C.transparent,[!1,!1,!1,!0],a.MIN);si.drawGroundEffect(v,t,i,n,r,l,c,m,e.$.disabled,s,"sdf",o,d,f,p,_,u,h,!1)}{const c=m?e._.disabled:new e._({func:a.EQUAL,mask:255},255,255,a.KEEP,a.DECR,a.DECR),g=m?t.colorModeForRenderPass():new e.a1([a.ONE_MINUS_DST_ALPHA,a.DST_ALPHA,a.ONE,a.ONE],e.C.transparent,[!0,!0,!0,!0]);si.drawGroundEffect(v,t,i,n,r,l,c,g,e.$.disabled,s,"color",o,d,f,p,_,u,h,!1)}};if(c){const c=()=>{const t=l.drapeBufferSize[0],i=l.drapeBufferSize[1];let n=l.framebufferCopyTexture;return n&&(!n||n.size[0]===t&&n.size[1]===i)||(n&&n.destroy(),n=l.framebufferCopyTexture=new e.T(s,new e.b({width:t,height:i}),a.RGBA8)),n.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.copyTexSubImage2D(a.TEXTURE_2D,0,0,0,0,0,t,i),n},m=(s,l,m)=>{const g=t.depthModeForSublayer(1,e.Z.ReadOnly,a.LEQUAL,!1),y=n.paint.get(s?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),x=e.am(.1,3,y);{const c=new e.a1([a.ONE,a.ONE,a.ONE,a.ONE],e.C.transparent,[!1,!1,!1,!0]);si.drawGroundEffect(v,t,i,n,r,g,e._.disabled,c,e.$.disabled,s,"clear",o,d,f,p,_,x,h,l)}{const c=new e._({func:a.ALWAYS,mask:255},255,255,a.KEEP,a.KEEP,a.REPLACE),u=new e.a1([a.ONE,a.ONE,a.ONE,a.ONE],e.C.transparent,[!1,!1,!1,!0],a.MIN);si.drawGroundEffect(v,t,i,n,r,g,c,u,e.$.disabled,s,"sdf",o,d,f,p,_,x,h,l)}u&&!s&&(m=c());
vendor: 16,330 bytes, line 2
2{const c=s?a.ZERO:a.ONE_MINUS_DST_ALPHA,u=new e._({func:a.EQUAL,mask:255},255,255,a.KEEP,a.DECR,a.DECR),m=new e.a1([c,a.DST_ALPHA,a.ONE_MINUS_DST_ALPHA,a.ZERO],e.C.transparent,[!0,!0,!0,!0]);si.drawGroundEffect(v,t,i,n,r,g,u,m,e.$.disabled,s,"color",o,d,f,p,_,x,h,l)}if(!u||s){const c=new e.a1([a.ONE,a.ONE,a.ONE,s?a.ZERO:a.ONE],e.C.transparent,[!1,!1,!1,!0],s?a.FUNC_ADD:a.MAX);si.drawGroundEffect(v,t,i,n,r,g,e._.disabled,c,e.$.disabled,s,"clear",o,d,f,p,_,x,h,l,m)}else{a.drawBuffers([a.NONE,a.COLOR_ATTACHMENT1]);const c=new e._({func:a.EQUAL,mask:255},254,255,a.KEEP,a.DECR,a.DECR),u=new e.a1([a.ONE,a.ONE,a.ONE,a.ONE],e.C.transparent,[!0,!1,!1,!1],a.MAX);si.drawGroundEffect(v,t,i,n,r,g,c,u,e.$.disabled,s,"emissive",o,d,f,p,_,x,h,l,m),a.drawBuffers([a.COLOR_ATTACHMENT0])}};if(g||y){let e;t.prepareDrawTile(),u&&!g||(e=c()),g&&m(!0,!1,e),y&&m(!1,!0,e)}}else g&&x(!0),y&&x(!1),(g||y)&&t.resetStencilClippingMasks()}}},hillshade:function(t,i,n,r){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;if(t.style.disableElevatedTerrain)return;const o=t.context,s=t.terrain&&t.terrain.renderingToTexture,[a,l]="translucent"!==t.renderPass||s?[{},r]:t.stencilConfigForOverlap(r);for(const r of l){const o=i.getTile(r);if(o.needsHillshadePrepare&&"offscreen"===t.renderPass)Yn(t,o,n);else if("translucent"===t.renderPass){const i=t.depthModeForSublayer(0,e.Z.ReadOnly),l=n.paint.get("hillshade-emissive-strength"),c=t.colorModeForDrapableLayerRenderPass(l),u=s&&t.terrain?t.terrain.stencilModeForRTTOverlap(r):a[r.overscaledZ];qn(t,r,o,n,i,u,c)}}o.viewport.set([0,0,t.width,t.height]),t.resetStencilClippingMasks()},raster:function(t,i,n,r,o,s){if("translucent"!==t.renderPass)return;const a=n.paint.get("raster-opacity");if(0===a)return;const l="globe"===t.transform.projection.name,c=n.paint.get("raster-elevation"),u="ground"===n.paint.get("raster-elevation-reference"),h=c>0,d=t.terrain&&t.terrain.exaggeration()>0&&h&&u,f=h&&l,p=!l&&d;if(t.renderElevatedRasterBackface&&!f)return;const m=t.context,_=m.gl,g=i.getSource(),y=function(t,i,n,r,o){const s=n.paint.get("raster-color"),a="raster-array"===i.type,l=[],c=n.paint.get("raster-resampling"),u=n.paint.get("raster-color-mix");let h=n.paint.get("raster-color-range");const d=[u[0],u[1],u[2],0],f=u[3];let p="nearest"===c?o.NEAREST:o.LINEAR;if(a&&(l.push("RASTER_ARRAY"),s||l.push("RASTER_COLOR"),"linear"===c&&l.push("RASTER_ARRAY_LINEAR"),p=o.NEAREST,s&&"log"===n.paint.get("raster-color-scale")&&l.push("RASTER_COLOR_SCALE_LOG"),!h&&i.rasterLayers)){const e=i.rasterLayers.find(({id:e})=>e===n.sourceLayer);e&&e.fields&&e.fields.range&&(h=e.fields.range)}if(h=h||[0,1],s){l.push("RASTER_COLOR"),r.activeTexture.set(o.TEXTURE2),n.updateColorRamp(h);let t=n.colorRampTexture;t||(t=n.colorRampTexture=new e.T(r,n.colorRamp,o.RGBA8)),t.bind(p,o.CLAMP_TO_EDGE)}return t.terrain&&t.terrain.renderingToTexture&&t.isEmissiveMrtActive()&&(l.push("USE_MRT1"),"mrt-full-rgba"===t.emissiveMode&&l.push("USE_MRT1_RGBA")),{mix:d,range:h,offset:f,defines:l,resampling:p}}(t,g,n,m,_);if(g instanceof bo&&!r.length&&!l)return;const v=n.paint.get("raster-emissive-strength"),x=t.colorModeForDrapableLayerRenderPass(v),b=t.terrain&&t.terrain.renderingToTexture,w=!t.options.moving,T="nearest"===n.paint.get("raster-resampling")?_.NEAREST:_.LINEAR;if(g instanceof bo&&!r.length&&(g.onNorthPole||g.onSouthPole)){const r=h?t.stencilModeFor3D():e._.disabled;return void xa(c,!!g.onNorthPole,null,t,i,n,v,y,e.$.disabled,r)}if(!r.length)return;const[E,S]=g instanceof bo||b?[{},r]:t.stencilConfigForOverlap(r),I=S.at(-1).overscaledZ;f&&y.defines.push("PROJECTION_GLOBE_VIEW"),h&&y.defines.push("RENDER_CUTOFF","ELEVATED"),d&&y.defines.push("ELEVATION_REFERENCE_GROUND");const A=(r,o,u)=>{for(const S of r){const r=S.toUnwrapped(),A=i.getTile(S);if(b&&(!A||!A.hasData()))continue;m.activeTexture.set(_.TEXTURE0);const M=wa(A,g,n,y);if(!M||!M.texture)continue;const{texture:C,mix:D,offset:P,tileSize:R,buffer:L}=M;let z,F;b?(z=e.Z.disabled,F=S.projMatrix):h?(z=new e.Z(_.LEQUAL,e.Z.ReadWrite,t.depthRangeFor3D),F=l?t.transform.expandedFarZProjMatrix:t.transform.calculateProjMatrix(r,w)):(z=t.depthModeForSublayer(S.overscaledZ-I,1===a?e.Z.ReadWrite:e.Z.ReadOnly,_.LESS),F=t.transform.calculateProjMatrix(r,w));const O=t.terrain&&b?t.terrain.stencilModeForRTTOverlap(S):E[S.overscaledZ],k=s?0:n.paint.get("raster-fade-duration");A.registerFadeDuration(k);const B=i.findLoadedParent(S,0),N=Ci(A,B,i,t.transform,k);let V,U;!N.isFading&&A.refreshedUponExpiration&&(A.refreshedUponExpiration=!1),t.terrain&&t.terrain.prepareDrawTile(),m.activeTexture.set(_.TEXTURE0),C.bind(T,_.CLAMP_TO_EDGE),m.activeTexture.set(_.TEXTURE1),B?(B.texture&&B.texture.bind(T,_.CLAMP_TO_EDGE),V=Math.pow(2,B.tileID.overscaledZ-A.tileID.overscaledZ),U=[A.tileID.canonical.x*V%1,A.tileID.canonical.y*V%1]):C.bind(T,_.CLAMP_TO_EDGE),"useMipmap"in C&&m.extTextureFilterAnisotropic&&t.transform.pitch>20&&_.texParameterf(_.TEXTURE_2D,m.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,m.extTextureFilterAnisotropicMax);const j=t.transform;let G;const $=h?ba(j):[0,0,0,0];let H,Z,q,W,Y,X=0;if(f&&g instanceof bo&&g.coordinates.length>3)H=Float32Array.from(e.b5(e.b6(new e.bW(0,0,0)))),Z=Float32Array.from(j.globeMatrix),q=Float32Array.from(e.b7(j)),W=[e.a7(j.center.lng),e.a8(j.center.lat)],G=g.elevatedGlobePerspectiveTransform,Y=g.elevatedGlobeGridMatrix||new Float32Array(9);else if(f){const t=e.b3(S.canonical);X=e.b4(t.getCenter().lat),H=Float32Array.from(e.b5(e.b6(S.canonical))),Z=Float32Array.from(j.globeMatrix),q=Float32Array.from(e.b7(j)),W=[e.a7(j.center.lng),e.a8(j.center.lat)],G=[0,0],Y=Float32Array.from(e.b8(S.canonical,t,X,j.worldSize/j._pixelsPerMercatorPixel))}else G=g instanceof bo?g.perspectiveTransform:[0,0],H=new Float32Array(16),Z=new Float32Array(9),q=new Float32Array(16),W=[0,0],Y=new Float32Array(9);const J=no(t,F,H,Z,q,Y,U||[0,0],e.S(t.transform.zoom),W,$,V||1,N,n,G,c,2,D,P,y.range,R,L,v),K=t.isTileAffectedByFog(S),Q=t.getOrCreateProgram("raster",{defines:y.defines,overrideFog:K});if(t.uploadCommonUniforms(m,Q,r),g instanceof bo){const i=g.elevatedGlobeVertexBuffer,r=g.elevatedGlobeIndexBuffer;if(b||!l)g.boundsBuffer&&g.boundsSegments&&Q.draw(t,_.TRIANGLES,z,e._.disabled,x,e.$.disabled,J,n.id,g.boundsBuffer,t.quadTriangleIndexBuffer,g.boundsSegments);else if(i&&r){const s=j.zoom<=e.ef?g.elevatedGlobeSegments:g.getSegmentsForLongitude(j.center.lng);s&&Q.draw(t,_.TRIANGLES,z,e._.disabled,x,o,J,n.id,i,r,s)}}else if(f){z=new e.Z(_.LEQUAL,e.Z.ReadOnly,t.depthRangeFor3D);const i=t.globeSharedBuffers;if(i){d&&(t.terrain.setupElevationDraw(A,Q),t.uploadCommonUniforms(m,Q,A.tileID.toUnwrapped()));const[e,r,s]=i.getGridBuffers(X,!1),a=Q.getAttributeLocation(_,"a_texture_pos");-1!==a&&_.vertexAttribI4ui(a,0,0,0,0),Q.draw(t,_.TRIANGLES,z,u||O,t.colorModeForRenderPass(),o,J,n.id,e,r,s)}}else if(p)z=new e.Z(_.LEQUAL,e.Z.ReadOnly,t.depthRangeFor3D),t.terrain.setupElevationDraw(A,Q),t.uploadCommonUniforms(m,Q,A.tileID.toUnwrapped()),j.pitch>20&&Q.draw(t,_.TRIANGLES,z,e._.disabled,e.a1.disabled,e.$.frontCCW,J,n.id,t.terrain.gridBuffer,t.terrain.gridIndexBuffer,t.terrain.gridSegments),Q.draw(t,_.TRIANGLES,z,O,x,e.$.backCCW,J,n.id,t.terrain.gridBuffer,t.terrain.gridIndexBuffer,t.terrain.gridSegments);else{const{tileBoundsBuffer:i,tileBoundsIndexBuffer:r,tileBoundsSegments:o}=t.getTileBoundsBuffers(A);Q.draw(t,_.TRIANGLES,z,O,x,e.$.disabled,J,n.id,i,r,o)}}if(!(g instanceof bo)&&f)for(const s of r){const r=s.canonical.y===(1<<s.canonical.z)-1;0===s.canonical.y&&xa(c,!0,s,t,i,n,v,y,o,u||e._.disabled),r&&xa(c,!1,s,t,i,n,v,y,o===e.$.frontCW?e.$.backCW:e.$.frontCW,u||e._.disabled)}};f?A(S,t.renderElevatedRasterBackface?e.$.backCW:e.$.frontCW,t.stencilModeFor3D()):A(S,e.$.disabled,void 0),t.resetStencilClippingMasks()},background:function(t,i,n,r){const o=n.paint.get("background-color"),s="none"===n.paint.get("background-color-use-theme").constantOr("default"),a=n.paint.get("background-opacity"),l=n.paint.get("background-emissive-strength"),c="viewport"===n.paint.get("background-pitch-alignment");if(0===a)return;const u=t.context,h=u.gl,d=t.transform,f=d.tileSize,p=n.paint.get("background-pattern");let m;if(void 0!==p){if(null===p)return;if(m=t.imageManager.getPattern(e.I.from(p.toString()),n.scope,t.style.getLut(n.scope)),!m)return}const _=!p&&1===o.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==_)return;const g=e._.disabled,y=t.depthModeForSublayer(0,"opaque"===_?e.Z.ReadWrite:e.Z.ReadOnly),v=t.colorModeForDrapableLayerRenderPass(l),x=p?"backgroundPattern":"background";let b,w=r;w||(b=t.getBackgroundTiles(),w=Object.values(b).map(e=>e.tileID)),p&&(u.activeTexture.set(h.TEXTURE0),t.imageManager.bind(t.context,n.scope));const T=[];if(t.terrain&&t.terrain.renderingToTexture&&t.isEmissiveMrtActive()&&(T.push("USE_MRT1"),"mrt-full-rgba"===t.emissiveMode&&T.push("USE_MRT1_RGBA")),c){const i=t.getOrCreateProgram(x,{overrideFog:!1,overrideRtt:!0,defines:T}),r=Ta,u=new e.bQ(0,0,0,0,0),d=p?lo(r,l,a,t,p,n.scope,m,c,{tileID:u,tileSize:f}):ao(r,l,a,o.toPremultipliedRenderColor(s?null:n.lut));return void i.draw(t,h.TRIANGLES,y,g,v,e.$.disabled,d,n.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments)}for(const _ of w){const w=t.isTileAffectedByFog(_),E=t.getOrCreateProgram(x,{overrideFog:w,defines:T}),S=_.toUnwrapped(),I=r?_.projMatrix:t.transform.calculateProjMatrix(S);t.prepareDrawTile();const A=i?i.getTile(_):b?b[_.key]:new dn(_,f,d.zoom,t),M=p?lo(I,l,a,t,p,n.scope,m,c,{tileID:_,tileSize:f}):ao(I,l,a,o.toPremultipliedRenderColor(s?null:n.lut));t.uploadCommonUniforms(u,E,S);const{tileBoundsBuffer:C,tileBoundsIndexBuffer:D,tileBoundsSegments:P}=t.getTileBoundsBuffers(A);E.draw(t,h.TRIANGLES,y,g,v,e.$.disabled,M,n.id,C,D,P)}},sky:function(t,i,n){const r=t._atmosphere?e.S(t.transform.zoom):1,o=n.paint.get("sky-opacity")*r;if(0===o)return;const s=t.context,a=n.paint.get("sky-type"),l=new e.Z(s.gl.LEQUAL,e.Z.ReadOnly,[0,1]),c=t.frameCounter/1e3%1;"atmosphere"===a?"offscreen"===t.renderPass?n.needsSkyboxCapture(t)&&(function(t,i){const n=t.context,r=n.gl;let o=i.skyboxFbo;if(!o){o=i.skyboxFbo=n.createFramebuffer(32,32,1,null),i.skyboxGeometry=new Ma(n),i.skyboxTexture=n.gl.createTexture(),r.bindTexture(r.TEXTURE_CUBE_MAP,i.skyboxTexture),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MAG_FILTER,r.LINEAR);for(let e=0;e<6;++e)r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,r.RGBA,32,32,0,r.RGBA,r.UNSIGNED_BYTE,null)}n.bindFramebuffer.set(o.framebuffer),n.viewport.set([0,0,32,32]);const s=i.getCenter(t,!0),a=t.getOrCreateProgram("skyboxCapture"),l=new Float64Array(16);e.ei(l,.5*-Math.PI),Ca(t,i,a,l,s,0),e.ei(l,.5*Math.PI),Ca(t,i,a,l,s,1),e.ej(l,.5*-Math.PI),Ca(t,i,a,l,s,2),e.ej(l,.5*Math.PI),Ca(t,i,a,l,s,3),e.df(l),Ca(t,i,a,l,s,4),e.ei(l,Math.PI),Ca(t,i,a,l,s,5),n.viewport.set([0,0,t.width,t.height])}(t,n),n.markSkyboxValid(t)):"sky"===t.renderPass&&function(t,i,n,r,o){const s=t.context,a=s.gl,l=t.transform,c=t.getOrCreateProgram("skybox");s.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_CUBE_MAP,i.skyboxTexture);const u=((e,t,i,n,r)=>({u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:n,u_temporal_offset:r}))(l.skyboxMatrix,i.getCenter(t,!1),0,r,o);t.uploadCommonUniforms(s,c),c.draw(t,a.TRIANGLES,n,e._.disabled,t.colorModeForRenderPass(),e.$.backCW,u,"skybox",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}(t,n,l,o,c):"gradient"===a&&"sky"===t.renderPass&&function(t,i,n,r,o){const s=t.context,a=s.gl,l=t.transform,c=t.getOrCreateProgram("skyboxGradient");i.skyboxGeometry||(i.skyboxGeometry=new Ma(s)),s.activeTexture.set(a.TEXTURE0);let u=i.colorRampTexture;u||(u=i.colorRampTexture=new e.T(s,i.colorRamp,a.RGBA8)),u.bind(a.LINEAR,a.CLAMP_TO_EDGE);const h=((t,i,n,r,o)=>({u_matrix:t,u_color_ramp:0,u_center_direction:i,u_radius:e.av(n),u_opacity:r,u_temporal_offset:o}))(l.skyboxMatrix,i.getCenter(t,!1),i.paint.get("sky-gradient-radius"),r,o);t.uploadCommonUniforms(s,c),c.draw(t,a.TRIANGLES,n,e._.disabled,t.colorModeForRenderPass(),e.$.backCW,h,"skyboxGradient",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}(t,n,l,o,c)},custom:function(t,i,n,r){const o=t.context,s=n.implementation;if(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes("custom")||t.terrain&&(t.terrain.renderingToTexture||"offscreen"===t.renderPass)&&n.isDraped(i)){if("offscreen"===t.renderPass){const i=s.prerender;if(i){if(t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),"globe"===t.transform.projection.name){const n=t.transform.pointMerc;i.call(s,o.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.S(t.transform.zoom),[n.x,n.y],t.transform.pixelsPerMeterRatio)}else i.call(s,o.gl,t.transform.customLayerMatrix());o.setDirty(),t.setBaseState()}}else if("translucent"===t.renderPass){if(t.terrain&&t.terrain.renderingToTexture){const i=s.renderToTile;if(i){const n=r[0].canonical,a={x:n.x+r[0].wrap*(s.wrapTileId?0:1<<n.z),y:n.y,z:n.z};o.setDepthMode(e.Z.disabled),o.setStencilMode(e._.disabled),o.setColorMode(t.colorModeForRenderPass()),t.setCustomLayerDefaults();const l=Ea[t.emissiveMode],c=o.gl,u=s.supportsEmissiveMode,h=l&&u&&u.call(s,l);t.isEmissiveMrtActive()&&!h&&c.drawBuffers([c.COLOR_ATTACHMENT0]),i.call(s,o.gl,a,l),t.isEmissiveMrtActive()&&!h&&c.drawBuffers([c.COLOR_ATTACHMENT0,c.COLOR_ATTACHMENT1]),o.setDirty(),t.setBaseState()}return}t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),o.setStencilMode(e._.disabled);const i="3d"===s.renderingMode?new e.Z(t.context.gl.LEQUAL,e.Z.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,e.Z.ReadOnly);if(o.setDepthMode(i),"globe"===t.transform.projection.name){const i=t.transform.pointMerc;s.render(o.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.S(t.transform.zoom),[i.x,i.y],t.transform.pixelsPerMeterRatio)}else s.render(o.gl,t.transform.customLayerMatrix());o.setDirty(),t.setBaseState(),o.bindFramebuffer.set(null)}}else e.w("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")}},Ba={line:function(e,t,i){if(e.hasElevatedBuckets=!1,e.hasNonElevatedBuckets=!1,void 0!==e._unevaluatedLayout.getValue("line-elevation-reference")||void 0!==e._unevaluatedLayout.getValue("line-z-offset")){if(t){const i=t.getVisibleCoordinates();for(const n of i){const i=t.getTile(n).getBucket(e);if(i&&("none"!==i.elevationType?e.hasElevatedBuckets=!0:e.hasNonElevatedBuckets=!0,e.hasElevatedBuckets&&e.hasNonElevatedBuckets))break}}}else e.hasNonElevatedBuckets=!0},raster:function(e,t,i){const n=t.getSource();if("raster-array"!==n.type||!n.loaded())return;const r=e.sourceLayer||n.rasterLayerIds&&n.rasterLayerIds[0];if(!r)return;const o=e.paint.get("raster-array-band")||n.getInitialBand(r);if(null==o)return;const s=t.getIds().map(e=>t.getTileByID(e));for(const t of s)t.updateNeeded(e.id,o)&&n.prepareTile(t,r,e.id,o)}};async function Na(e){if(await ai(),Object.assign(ka,{model:si.drawModels}),Object.assign(Ba,{model:si.prepare}),e&&!e._destroyed&&!e._shadowRenderer){const t=si.ShadowRenderer;t&&(e._shadowRenderer=new t(e))}}class Va{constructor(t,i,n,r,o,s){this._forceFullRgbaEmissive=!1,this.context=new ia(t,i),this._forceFullRgbaEmissive="exact"===s,this.transform=n,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.frcCoverageSnapshot=null,this.elevationCoverageSnapshot=null,this.elevationProvidersReady=void 0,this.frcCoverageFadeRange=null,this.frcCoverageSourceLayers=[],this.frcCoverageRenderer=$n.FrcCoverageRenderer?new $n.FrcCoverageRenderer:null,this._debugParams={averageFPS:0,fpsHistory:[],fpsWindow:30,continousRedraw:!1,enabledLayers:{},buildingsShowNormals:!1,buildingsDrawGroundAO:!0,buildingsDrawShadowPass:!0,buildingsDrawTranslucentPass:!0,showTerrainProxyTiles:!1,terrainSortTilesHiZFirst:!0,terrainDisableRenderCache:!1,forceEnablePrecipitation:!1,overrideSnowParams:!1,snowParamsOverride:null,snowRevealParamsOverride:null,snowVignetteParam
vendor: 6,469 bytes, line 2
2sOverride:null,overrideRainParams:!1,rainParamsOverride:null,rainRevealParamsOverride:null,rainVignetteParamsOverride:null,overrideStarsParams:!1,starsParamsOverride:null,show3DModelFootprints:!1,showElevationIdDebug:!1,lodSwitchDistance:-1,lodSwitchFadeDuration:.5},this.occlusionParams=new Oa,this.setup(),this.numSublayers=mn.maxUnderzooming+mn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this.frameTimeDelta=0,this.lastPaintStartTimeStamp=0,this._shadowCullCache=null,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new e.ew,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._wireframeDebugCache=new Fa,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const a=new e.b({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new e.T(this.context,a,t.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=r,this.maxFrontCutoffRawStart=0,this.worldview=o,this._forceEmissiveMode=!1,this.emissiveMode="constant"}updateTerrain(e,t){const i=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;var n;(i||this._terrain&&this._terrain.enabled)&&(this._terrain||(this._terrain=Wr(this,e),this._terrain)?(this.transform.elevation=i?this._terrain:null,this._terrain.update(e,this.transform,t),this.transform.elevation&&!this._terrain.enabled&&(this.transform.elevation=null)):this._terrainRendererRetryPending||(this._terrainRendererRetryPending=!0,n=()=>{this._terrainRendererRetryPending=!1,this.style&&this.style.map&&this.style.map._update(!1)},Zr?n():qr.push(n)))}_updateFog(e){const t=e.fog;if(!t||"globe"===this.transform.projection.name||t.getOpacity(this.transform.pitch)<1||t.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[i,n]=t.getRangeForProjection();if(i>n)return void(this.transform.fogCullDistSq=null);const r=i+.78*(n-i);this.transform.fogCullDistSq=r*r}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(e){e&&!this._terrain&&(this._terrain=Wr(this,this.style),this._terrain||console.warn("forceTerrainMode: Lite module not loaded yet, terrain renderer unavailable")),this._forceTerrainMode=e}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(t,i){if(this.width=t*e.e.devicePixelRatio,this.height=i*e.e.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style.order)this.style._mergedLayers[e].resize()}setup(){const t=this.context,i=new e.bD;i.emplaceBack(0,0),i.emplaceBack(e.a6,0),i.emplaceBack(0,e.a6),i.emplaceBack(e.a6,e.a6),this.tileExtentBuffer=t.createVertexBuffer(i,e.bF.members),this.tileExtentSegments=e.ad.simpleSegment(0,0,4,2);const n=new e.bD;n.emplaceBack(0,0),n.emplaceBack(e.a6,0),n.emplaceBack(0,e.a6),n.emplaceBack(e.a6,e.a6),this.debugBuffer=t.createVertexBuffer(n,e.bF.members),this.debugSegments=e.ad.simpleSegment(0,0,4,5);const r=new e.bD;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(-1,1),r.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(r,e.bF.members),this.viewportSegments=e.ad.simpleSegment(0,0,4,2);const o=new e.bt;o.emplaceBack(0,0,0,0),o.emplaceBack(e.a6,0,e.a6,0),o.emplaceBack(0,e.a6,0,e.a6),o.emplaceBack(e.a6,e.a6,e.a6,e.a6),this.mercatorBoundsBuffer=t.createVertexBuffer(o,ln.members),this.mercatorBoundsSegments=e.ad.simpleSegment(0,0,4,2);const s=new e.ae;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);const a=new e.bE;for(const e of[0,1,3,2,0])a.emplaceBack(e);this.debugIndexBuffer=t.createIndexBuffer(a),this.emptyTexture=new e.T(t,new e.b({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA8),this.identityMat=e.Y();const l=this.context.gl;this.stencilClearMode=new e._({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(e){return e._makeTileBoundsBuffers(this.context,this.transform.projection),e._tileBoundsBuffer?{tileBoundsBuffer:e._tileBoundsBuffer,tileBoundsIndexBuffer:e._tileBoundsIndexBuffer,tileBoundsSegments:e._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const t=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,t.TRIANGLES,e.Z.disabled,this.stencilClearMode,e.a1.disabled,e.$.disabled,zn(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(t,i,n){if(!i||this.currentStencilSource===i.id||!t.isTileClipped()||!n||0===n.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(const t of n)if(void 0===this._tileClippingMaskIDs[t.key]){e=!0;break}if(!e)return}this.currentStencilSource=i.id;const r=this.context,o=r.gl;this.nextStencilID+n.length>256&&this.clearStencil(),r.setColorMode(e.a1.disabled),r.setDepthMode(e.Z.disabled);const s=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const t of n){const n=i.getTile(t),r=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,{tileBoundsBuffer:a,tileBoundsIndexBuffer:l,tileBoundsSegments:c}=this.getTileBoundsBuffers(n);s.draw(this,o.TRIANGLES,e.Z.disabled,new e._({func:o.ALWAYS,mask:0},r,255,o.KEEP,o.KEEP,o.REPLACE),e.a1.disabled,e.$.disabled,zn(t.projMatrix),"$clipping",a,l,c)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,i=this.context.gl;return new e._({func:i.NOTEQUAL,mask:255},t,255,i.KEEP,i.KEEP,i.REPLACE)}stencilModeForClipping(t){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(t);const i=this.context.gl;return new e._({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,i.KEEP,i.KEEP,i.REPLACE)}stencilConfigForOverlap(t){const i=this.context.gl,n=t.sort((e,t)=>
vendor: 9,467 bytes, line 2
2t.overscaledZ-e.overscaledZ),r=n.at(-1).overscaledZ,o=n[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();const t={};for(let n=0;n<o;n++)t[n+r]=new e._({func:i.GEQUAL,mask:255},n+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=o,[t,n]}return[{[r]:e._.disabled},n]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new e.a1([t.CONSTANT_COLOR,t.ONE,t.CONSTANT_COLOR,t.ONE],new e.C(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?e.a1.unblended:e.a1.alphaBlended}isEmissiveMrtActive(){return"mrt-fallback"===this.emissiveMode||"mrt-full-rgba"===this.emissiveMode}colorModeForDrapableLayerRenderPass(t){const i=this.context.gl;return(()=>this.style&&this.style.enable3dLights()&&!!this._terrain&&this._terrain.renderingToTexture)()&&"translucent"===this.renderPass?null!=t&&!this.isEmissiveMrtActive()||"constant"===this.emissiveMode?new e.a1([i.ONE,i.ONE_MINUS_SRC_ALPHA,i.CONSTANT_ALPHA,i.ONE_MINUS_SRC_ALPHA],new e.C(0,0,0,t??0),[!0,!0,!0,!0]):"dual-source-blending"===this.emissiveMode?new e.a1([i.ONE,i.ONE_MINUS_SRC_ALPHA,this.context.extBlendFuncExtended.SRC1_ALPHA_WEBGL,i.ONE_MINUS_SRC_ALPHA],e.C.transparent,[!0,!0,!0,!0]):this.colorModeForRenderPass():this.colorModeForRenderPass()}depthModeForSublayer(t,i,n,r=!1){if(this.depthOcclusion)return new e.Z(this.context.gl.GREATER,e.Z.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!r)return e.Z.disabled;const o=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new e.Z(n||this.context.gl.LEQUAL,i,[o,o])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}blitDepth(){const t=this.context.gl,i=Math.ceil(this.width),n=Math.ceil(this.height),r=this.context.bindFramebuffer.get(),o=t.getParameter(t.TEXTURE_BINDING_2D);this.depthFBO&&this.depthFBO.width===i&&this.depthFBO.height===n||(this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),0!==i&&0!==n&&(this.depthFBO=new ta(this.context,i,n,0,"texture"),this.depthTexture=new e.T(this.context,{width:i,height:n,data:null},t.DEPTH24_STENCIL8),this.depthFBO.depthAttachment.set(this.depthTexture.texture))),this.context.bindFramebuffer.set(r),t.bindTexture(t.TEXTURE_2D,o),this.depthFBO&&(t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,this.depthFBO.framebuffer),t.blitFramebuffer(0,0,i,n,0,0,i,n,t.DEPTH_BUFFER_BIT,t.NEAREST),t.bindFramebuffer(t.FRAMEBUFFER,this.context.bindFramebuffer.current))}render(t,i){this.context.sweepPendingPrograms(),this.frameTimeDelta=0===this.lastPaintStartTimeStamp?0:i.paintStartTimeStamp-this.lastPaintStartTimeStamp,this.lastPaintStartTimeStamp=i.paintStartTimeStamp,this._wireframeDebugCache.update(this.frameCounter),this.style=t,this.options=i,this.frcCoverageSnapshot&&!this.frcCoverageSnapshot.empty()&&(!this.frcCoverageRenderer&&$n.FrcCoverageRenderer&&(this.frcCoverageRenderer=new $n.FrcCoverageRenderer),this.frcCoverageRenderer&&this.frcCoverageRenderer.update(this.context,this.frcCoverageSnapshot.tiles));const n=this.style._mergedLayers,r=!(!this.terrain||!this.terrain.enabled),o=()=>this.style._getOrder(r);let s=o(),a=!1,l=!1,c=null,u=0,h=!1;for(const e of s){const t=n[e];"none"!==t.visibility&&("circle"===t.type?a=!0:"building"===t.type?(c=t,++u):"symbol"===t.type&&(t.hasOcclusionOpacityProperties?l=!0:a=!0))}this.updateEmissiveMode();let d=s.map(e=>n[e]);const f=this.style._mergedSourceCaches;this.imageManager=t.imageManager,this.modelManager=t.modelManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.e.now()),this.imageManager.beginFrame();for(const e in f){const t=f[e];t.used&&(t.prepare(this.context),t.getSource().usedInConflation&&++u)}let p=!1;for(const e of d)e.isHidden(this.transform.zoom)||("clip"===e.type&&(p=!0),this.prepareLayer(e));const m={},_={},g={},y={},v={};for(const e in f){const t=f[e];m[e]=t.getVisibleCoordinates(),_[e]=m[e].slice().reverse(),g[e]=t.getVisibleCoordinates(!0).reverse(),y[e]=t.getShadowCasterCoordinates(),v[e]=t.sortCoordinatesByDistance(m[e])}const x=e=>{const t=this.style.getLayerSourceCache(e);return t&&t.used?t.getSource():null};if(u||p||this._clippingActiveLastFrame){const t=[],i=[];let n=0;for(const e of d)this.isSourceForClippingOrConflation(e,x(e))&&(t.push(e),i.push(n)),n++;if(t&&(p||t.length>1)||this._clippingActiveLastFrame){p=!1;const n=[];for(let r=0;r<t.length;r++){const o=t[r],s=i[r],a=this.style.getLayerSourceCache(o);if(!a||!a.used||!a.getSource().usedInConflation&&"clip"!==o.type&&"building"!==o.type)continue;let l=e.ex,c=e.dn.None;const u=[];let h=!0;if("building"===o.type)l=e.eB;else if("clip"===o.type)if(l=s,o.isHidden(this.transform.zoom))h=!1;else{if(!o.layout){h=!1;continue}for(const t of o.layout.get("clip-layer-types"))c|="model"===t?e.dn.Model:"symbol"===t?e.dn.Symbol:e.dn.FillExtrusion;for(const t of o.layout.get("clip-layer-scope"))u.push(e.m(t,o.scope));p=!0}h&&n.push({layer:o.fqid,cache:a,order:l,clipMask:c,clipScope:u})}this.replacementSource.setSources(n),h=!0}}this._clippingActiveLastFrame=p,h||this.replacementSource.clear(),this.conflationActive=h,this.minCutoffZoom=0,this.longestCutoffRange=0,this.maxFrontCutoffRawStart=0,this.opaquePassCutoff=1/0,this._lastOcclusionLayer=-1,this.layersWithOcclusionOpacity=[];for(let e=0;e<d.length;e++){const t=d[e];if("none"===t.visibility)continue;const i=t.cutoffRange();if(this.longestCutoffRange=Math.max(i,this.longestCutoffRange),i>0){const e=x(t);e&&(this.minCutoffZoom=Math.max(e.minzoom,this.minCutoffZoom)),t.minzoom&&(this.minCutoffZoom=Math.max(t.minzoom,this.minCutoffZoom))}t.is3D(r)&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=e),this._lastOcclusionLayer=e)}const b=this.style&&this.style.fog;b?(this._fogVisible=0!==b.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=b.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(g),this.opaquePassCutoff=0,s=o(),d=s.map(e=>n[e])),this.style.enable3dLights()&&!this._shadowRenderer&&Na(this);const w=this._shadowRenderer;if(w){w.updateShadowParameters(this.transform,this.style.directionalLight,y);for(const e in f)for(const t of m[e]){let e={min:0,max:0};this.terrain&&(e=this.terrain.getMinMaxForTile(t)||e),w.addShadowReceiver(t.toUnwrapped(),e.min,e.max)}}"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.ey(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new La),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);let T=!(!this.style||!this.style.snow),E=!(!this.style||!this.style.rain);if(T&&!this._snow&&$n.Snow&&(this._snow=new $n.Snow),!T&&this._snow&&(this._snow.destroy(),delete this._snow),E&&!this._rain&&$n.Rain&&(this._rain=new $n.Rain),!E&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),c&&(!this.buildingTileBorderManager&&$n.BuildingTileBorderManager&&(this.buildingTileBorderManager=new $n.BuildingTileBorderManager),this.buildingTileBorderManager)){const e=this.style.getLayerSourceCache(c);this.buildingTileBorderManager.updateBorders(e,c)}if(!e.ez(this.context.gl))return;this.renderPass="offscreen";for(const e of d){const i=t.getLayerSourceCache(e);if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const n=i?_[i.id]:void 0;("custom"===e.type||"raster"===e.type||"raster-particle"===e.type||e.isSky()||n&&n.length)&&this.renderLayer(this,i,e,n)}this.depthRangeFor3D=[0,1-(d.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,y)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const S="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),I=(()=>{if(i.showOverdrawInspector)return e.C.black;const t=this.style.fog;if(t&&this.transform.projection.supportsFog){const i=this.style.getLut(t.scope);if(!S){const n="none"===t.properties.get("color-use-theme"),r=t.properties.get("color").toNonPremultipliedRenderColor(n?null:i).toArray01();return new e.C(...r)}if(S){const n="none"===t.properties.get("space-color-use-theme"),r=t.properties.get("space-color").toNonPremultipliedRenderColor(n?null:i).toArray01();return new e.C(...r)}}return e.C.transparent})();if(this.context.clear({color:I,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&S&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){const e=d[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky())continue;const n=i?(e.is3D(r)?v:_)[i.id]:void 0;this._renderTileClippingMasks(e,i,n),this.renderLayer(this,i,e,n)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&S&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||e.S(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isH
vendor: 17,759 bytes, line 2
2orizonVisible()))for(this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){const e=d[this.currentLayer],i=t.getLayerSourceCache(e);e.isSky()&&this.renderLayer(this,i,e,i?_[i.id]:void 0)}function A(e,t){let i;return t&&(i=("symbol"===e.type?g:e.is3D(r)?v:_)[t.id]),i}if(this.renderPass="translucent","globe"===this.transform.projection.name){for(this.renderElevatedRasterBackface=!0,this.currentLayer=0;this.currentLayer<s.length;){const e=d[this.currentLayer];if("raster"===e.type||"raster-particle"===e.type){const i=t.getLayerSourceCache(e);this.renderLayer(this,i,e,A(e,i))}++this.currentLayer}this.renderElevatedRasterBackface=!1}this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;const M=w?w.getGroundShadowLayerIndex():-1;let C=!1,D=-1;for(let e=0;e<s.length;++e){const t=d[e];t.isHidden(this.transform.zoom)||t.is3D(r)&&(D=e)}l&&-1===D&&(a=!0);let P=!1;for(;this.currentLayer<s.length;){const e=d[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky())++this.currentLayer;else if(this.terrain&&this.style.isLayerDraped(e)){if(e.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer),this._lastOcclusionLayer=Math.max(this.currentLayer,this._lastOcclusionLayer)}else{if(!P&&e.is3D(r)&&!r){const e=this.currentLayer,t=e=>{for(this.currentLayer=0;this.currentLayer<d.length;this.currentLayer++){const t=d[this.currentLayer];if("fill"===t.type&&$n.drawDepthPrepass){const i=this.style.getLayerSourceCache(t);$n.drawDepthPrepass(this,i,t,A(t,i),e)}}};t("initialize"),t("reset"),this.currentLayer=e,P=!0}if(a&&!C&&this.terrain&&!this.transform.isOrthographic&&(C=!0,this.blitDepth()),l&&-1!==D&&this.currentLayer===D+1&&!this.transform.isOrthographic&&this.blitDepth(),this.terrain||this._renderTileClippingMasks(e,i,i?m[i.id]:void 0),this.renderLayer(this,i,e,A(e,i)),!this.terrain&&w&&this.currentLayer===M){{this.clearStencil(),this.resetStencilClippingMasks();const e=this.currentLayer;for(this.currentLayer=0;this.currentLayer<d.length;this.currentLayer++){const e=d[this.currentLayer];if("fill"===e.type&&$n.drawGroundShadowMask){const t=this.style.getLayerSourceCache(e);$n.drawGroundShadowMask(this,t,e,A(e,t))}}this.currentLayer=e}if(w.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer){const e=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=e;this.currentLayer++){const e=d[this.currentLayer];if(!e.hasLightBeamPass())continue;const i=t.getLayerSourceCache(e);this.renderLayer(this,i,e,i?_[i.id]:void 0)}this.currentLayer=e,this.renderPass="translucent"}}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const e=this.currentLayer;this.depthOcclusion=!0;for(const e of this.layersWithOcclusionOpacity){this.currentLayer=e;const i=d[this.currentLayer],n=t.getLayerSourceCache(i),r=n?_[n.id]:void 0;this.terrain||this._renderTileClippingMasks(i,n,n?m[n.id]:void 0),this.renderLayer(this,n,i,r)}this.depthOcclusion=!1,this.currentLayer=e,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let i=null;d.forEach(e=>{const n=t.getLayerSourceCache(e);n&&!e.isHidden(this.transform.zoom)&&n.getVisibleCoordinates().length&&(!i||i.getSource().maxzoom<n.getSource().maxzoom)&&(i=n)}),i&&this.options.showTileBoundaries&&yt.drawDebug&&yt.drawDebug(this,i,i.getVisibleCoordinates(),e.C.red,!1,this.options.showParseStatus)}this.options.showPadding&&yt.drawDebugPadding&&yt.drawDebugPadding(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(performance.now()),this.saveCanvasCopy()),h||(this.conflationActive=!1)}prepareLayer(e){this.gpuTimingStart(e);const{unsupportedLayers:t}=this.transform.projection,i=!t||!t.includes(e.type);if(Ba[e.type]&&(i||this.terrain&&"custom"===e.type)){const t=this.style.getLayerSourceCache(e);Ba[e.type](e,t,this)}this.gpuTimingEnd()}renderLayer(e,t,i,n){i.isHidden(this.transform.zoom)||("background"===i.type||"sky"===i.type||"custom"===i.type||"model"===i.type||"raster"===i.type||"raster-particle"===i.type||n&&n.length)&&(this.id=i.id,this.gpuTimingStart(i),(!e.transform.projection.unsupportedLayers||!e.transform.projection.unsupportedLayers.includes(i.type)||e.terrain&&"custom"===i.type)&&"clip"!==i.type&&"slot"!==i.type&&"placement-group"!==i.type&&ka[i.type]&&ka[i.type](e,t,i,n,this.style.placement.variableOffsets,this.options.isInitialLoad),ka[i.type]||(i.mayUse("HD")&&async function(){await Hn(),Object.assign(ka,{building:$n.drawBuilding,"raster-particle":$n.drawRasterParticle}),Object.assign(Ba,{"raster-particle":$n.prepareRasterParticle})}(),i.mayUse("Standard")&&Na(e)),this.gpuTimingEnd())}gpuTimingStart(e){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery,i=this.context.gl;let n=this.gpuTimers[e.id];n||(n=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:i.createQuery()}),n.calls++,i.beginQuery(t.TIME_ELAPSED_EXT,n.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const e=this.context.extTimerQuery,t=this.context.gl,i=t.createQuery();this.deferredRenderGpuTimeQueries.push(i),t.beginQuery(e.TIME_ELAPSED_EXT,i)}}gpuTimingDeferredRenderEnd(){this.options.gpuTimingDeferredRender&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}gpuTimingEnd(){this.options.gpuTiming&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT)}collectGpuTimers(){const e=this.gpuTimers;return this.gpuTimers={},e}collectDeferredRenderGpuQueries(){const e=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],e}queryGpuTimers(e){const t={};for(const i in e){const n=e[i],r=this.context.extTimerQuery,o=r.getQueryParameter(n.query,this.context.gl.QUERY_RESULT)/1e6;r.deleteQueryEXT(n.query),t[i]=o}return t}queryGpuTimeDeferredRender(e){if(!this.options.gpuTimingDeferredRender)return 0;const t=this.context.gl;let i=0;for(const n of e)i+=t.getQueryParameter(n,t.QUERY_RESULT)/1e6,t.deleteQuery(n);return i}translatePosMatrix(t,i,n,r,o){if(!n[0]&&!n[1])return t;const s=o?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(s){const e=Math.sin(s),t=Math.cos(s);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}const a=[o?n[0]:e.cd(i,n[0],this.transform.zoom),o?n[1]:e.cd(i,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.bN(l,t,a),l}saveTileTexture(e){if(e.context!==this.context)return;const t=e.size[0],i=this._tileTextures[t];i?i.push(e):this._tileTextures[t]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}terrainRenderModeElevated(){return this.style&&this.style.hasTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(e,t,i,n,r){const o=void 0===i?!!this._terrain&&this._terrain.renderingToTexture:i,s=void 0===n?this.terrainRenderModeElevated():n,a=void 0===r?"globe"===this.transform.projection.name:r,l=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===e||"terrainRaster"===e?(l.push("LIGHTING_3D_MODE"),l.push("LIGHTING_3D_ALPHA_EMISSIVENESS"),"mrt-full-rgba"===this.emissiveMode&&l.push("USE_MRT1_RGBA")):o||l.push("LIGHTING_3D_MODE")),s&&(l.push("TERRAIN"),this.linearFloatFilteringSupported()&&l.push("TERRAIN_DEM_FLOAT_FORMAT")),a&&l.push("GLOBE"),!this._fogVisible||o||void 0!==t&&!t||l.push("FOG"),o&&l.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&l.push("OVERDRAW_INSPECTOR"),l}getOrCreateProgram(e,t){this.cache=this.cache||{};const{defines:i,config:n,overrideFog:r,overrideRtt:o,overrideTerrain:s,overrideGlobe:a,precompiled:l}=t||{},c=this.currentGlobalDefines(e,r,o,s,a).concat(i||[]),u=this.getShaderSource(e),h=$n.programUniforms,d=si.programUniforms,f=co[e]||h&&h[e]||d&&d[e],p=Js.cacheKey(u,e,c,n);return this.cache[p]||(this.cache[p]=new Js(this.context,e,u,n,f,c,l)),this.cache[p]}getShaderSource(t){const i=$n.shaders,n=si.shaders,r=ho.shaders;return e.eA[t]||i&&i[t]||n&&n[t]||r&&r[t]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy(),this._destroyed=!0}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(t,i,n){if(this.style.enable3dLights()){const r=this.style.directionalLight,o=this.style.ambientLight;if(r&&o){const s=((t,i,n,r)=>{const o=t.properties.get("direction"),s="none"===t.properties.get("color-use-theme"),a=t.properties.get("color").toNonPremultipliedRenderColor(s?null:n.getLut(t.scope)).toArray01();let l=t.properties.get("intensity");const c="none"===i.properties.get("color-use-theme"),u=i.properties.get("color").toNonPremultipliedRenderColor(c?null:n.getLut(i.scope)).toArray01();let h=i.properties.get("intensity");const d=[o.x,o.y,o.z];r&&(void 0!==r.ambientIntensity&&(h=r.ambientIntensity),void 0!==r.directionalIntensity&&(l=r.directionalIntensity),void 0!==r.ambientColor&&(u[0]=r.ambientColor[0],u[1]=r.ambientColor[1],u[2]=r.ambientColor[2]),void 0!==r.directionalColor&&(a[0]=r.directionalColor[0],a[1]=r.directionalColor[1],a[2]=r.directionalColor[2]));const f=e.dU(u,h),p=e.dU(a,l);return{u_lighting_ambient_color:f,u_lighting_directional_dir:d,u_lighting_directional_color:p,u_ground_radiance:Ws(d,p,f)}})(r,o,this.style,n);i.setLightsUniformValues(t,s)}}}uploadCommonUniforms(t,i,n,r,o,s){if(this.uploadCommonLightUniforms(t,i,s),this.terrain&&this.terrain.renderingToTexture)return;const a=this.style.fog;if(a){const o=a.getOpacity(this.transform.pitch),s=((t,i,n,r,o,s,a,l,c,u,h,d)=>{const f=t.transform,p="none"===i.properties.get("color-use-theme"),m=i.properties.get("color").toNonPremultipliedRenderColor(p?null:t.style.getLut(i.scope)).toArray01();m[3]=r;const _=t.frameCounter/1e3%1,[g,y]=i.properties.get("vertical-range");return{u_fog_matrix:n?f.calculateFogTileMatrix(n):d||t.identityMat,u_fog_range:i.getRangeForProjection(),u_fog_color:m,u_fog_horizon_blend:i.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(g,y),y],u_fog_temporal_offset:_,u_frustum_tl:o,u_frustum_tr:s,u_frustum_br:a,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:u,u_viewport:h,u_globe_transition:e.S(f.zoom),u_is_globe:+("globe"===f.projection.name)}})(this,a,n,o,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*e.e.devicePixelRatio,this.transform.height*e.e.devicePixelRatio],r);i.setFogUniformValues(t,s)}o&&i.setCutoffUniformValues(t,o.uniformValues)}setTileLoadedFlag(e){this.tileLoaded=e}saveCanvasCopy(){const e=this.canvasCopy();e&&(this.frameCopies.push(e),this.tileLoaded=!1)}canvasCopy(){const e=this.context.gl,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),t}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}getBackgroundTiles(){const e=this._backgroundTiles,t=this._backgroundTiles={},i=this.transform.coveringTiles({tileSize:512});for(const n of i)t[n.key]=e[n.key]||new dn(n,512,this.transform.tileZoom,this,void 0,this.worldview);return t}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(e,t){return!(!e.is3D(!(!this.terrain||!this.terrain.enabled))||"clip"!==e.type&&"building"!==e.type&&(e.minzoom&&e.minzoom>this.transform.zoom||(this.style._clipLayerPresent||"building"!==e.sourceLayer&&"procedural_buildings"!==e.sourceLayer)&&(!t||"batched-model"!==t.type)))}isTileAffectedByFog(t){if(!this.style||!this.style.fog)return!1;if("globe"===this.transform.projection.name)return!0;let i=this._cachedTileFogOpacities[t.key];return i||(this._cachedTileFogOpacities[t.key]=i=this.style.fog.getOpacityForTile(t)),i[0]>=e.au||i[1]>=e.au}setupDepthForOcclusion(e,t,i){const n=this.context,r=n.gl,o=!!i;var s;i||(i={u_dem:2,u_dem_prev:4,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_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),n.activeTexture.set(r.TEXTURE3),e&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE),i.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],i.u_depth_range_unpack=[2/((s=this.depthRangeFor3D)[1]-s[0]),-1-2*s[0]/(s[1]-s[0])],i.u_occluder_half_size=.5*this.occlusionParams.occluderSize,i.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE),n.activeTexture.set(r.TEXTURE0),o||t.setTerrainUniformValues(n,i)}updateEmissiveMode(){if(this._forceEmissiveMode)return;const e=this.style.hasDataDrivenEmissiveStrength();this.emissiveMode=this._forceFullRgbaEmissive?"mrt-full-rgba":e?this.context.extBlendFuncExtended?"dual-source-blending":"mrt-fallback":"constant"}}function Ua(e,t){let i=!1,n=null;const r=()=>{n=null,i&&(e(),n=setTimeout(r,t),i=!1)};return()=>(i=!0,n||r(),n)}const ja=/(#.+)?$/;class Ga{constructor(t){this._hashName=t&&encodeURIComponent(t),e.aW(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Ua(this._updateHashUnthrottled.bind(this),300)}addTo(e){return this._map=e,window.addEventListener("hashchange",this._onHashChange,!1),e.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const e=this._map;if(!e)return"";const t=$a(e);if(this._hashName){const e=this._hashName;let i=!1;const n=location.hash.slice(1).split("&").map(n=>{const r=n.split("=")[0];return r===e?(i=!0,`${r}=${t}`):n}).filter(e=>e);return i||n.push(`${e}=${t}`),`#${n.join("&")}`}return`#${t}`}_getCurrentHash(){const e=location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map(e=>e.split("=")).forEach(e=>{e[0]===this._hashName&&(t=e)}),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const e=this._map;if(!e)return!1;const t=this._getCurrentHash();if(t.length>=3&&!t.some(e=>isNaN(Number(e)))){const i=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:i,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(ja,this.getHashString()))}}function $a(e,t){const i=e.getCenter(),n=Math.round(100*e.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),s=Math.round(i.lng*o)/o,a=Math.round(i.lat*o)/o,l=e.getBearing(),c=e.getPitch();let u=t?`/${s}/${a}/${n}`:`${n}/${a}/${s}`;return(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+=`/${Math.round(c)}`),u}const Ha={linearity:.3,easing:e.eC(0,0,.3,1)},Za={deceleration:2500,maxSpeed:1400,...Ha},qa={deceleration:20,maxSpeed:1400,...Ha},Wa={deceleration:1e3,maxSpeed:360,...Ha},Ya={deceleration:1e3,maxSpeed:90,...Ha};class Xa{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.e.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,i=e.e.now();for(;t.length>0&&i-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)i.zoom+=e.zoomDelta||0,i.bearing+=e.bearingDelta||0,i.pitch+=e.pitchDelta||0,e.panDelta&&i.pan._add(e.panDelta),e.around&&(i.around=e.around),e.pinchAround&&(i.pinchAround=e.pinchAround);const n=this._inertiaBuffer.at(-1).time-this._inertiaBuffer[0].time,r={};if(i.pan.mag()){const e=Ka(i.pan.mag(),n,{...Za,...t||{}});r.offset=i.pan.mult(e.amount/i.pan.mag()),r.center=this._map.transform.center,Ja(r,e)}if(i.zoom){const e=Ka(i.zoom,n,qa);r.zoom=this._map.transform.zoom+e.amount,Ja(r,e)}if(i.bearing){const t=Ka(i.bearing,n,Wa);
vendor: 4,461 bytes, line 2
2r.bearing=this._map.transform.bearing+e.b1(t.amount,-179,179),Ja(r,t)}if(i.pitch){const e=Ka(i.pitch,n,Ya);r.pitch=this._map.transform.pitch+e.amount,Ja(r,e)}if(r.zoom||r.bearing){const e=void 0===i.pinchAround?i.around:i.pinchAround;r.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),r.noMoveStart=!0,r}}function Ja(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Ka(t,i,n){const{maxSpeed:r,linearity:o,deceleration:s}=n,a=e.b1(t*o/(i/1e3),-r,r),l=Math.abs(a)/(s*o);return{easing:n.easing,duration:1e3*l,amount:a*(l/2)}}class Qa extends e.h{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,i,n={}){const r=_(t.getCanvasContainer(),i);super(e,{point:r,lngLat:t.unproject(r),originalEvent:i,...n}),this._defaultPrevented=!1,this.target=t}}class el extends e.h{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,n){const r="touchend"===t?n.changedTouches:n.touches,o=g(i.getCanvasContainer(),r),s=o.map(e=>i.unproject(e)),a=o.reduce((e,t,i,n)=>e.add(t.div(n.length)),new e.P(0,0));super(t,{points:o,point:a,lngLats:s,lngLat:i.unproject(a),originalEvent:n}),this._defaultPrevented=!1}}class tl extends e.h{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}}class il{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._mousedownPos=void 0}wheel(e){return this._firePreventable(new tl(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new Qa(e.type,this._map,e))}mouseup(e){this._map.fire(new Qa(e.type,this._map,e))}preclick(e){const t=new MouseEvent("preclick",e);this._map.fire(new Qa(t.type,this._map,t))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new Qa(e.type,this._map,e)))}dblclick(e){return this._firePreventable(new Qa(e.type,this._map,e))}mouseover(e){this._map.fire(new Qa(e.type,this._map,e))}mouseout(e){this._map.fire(new Qa(e.type,this._map,e))}touchstart(e){return this._firePreventable(new el(e.type,this._map,e))}touchmove(e){this._map.fire(new el(e.type,this._map,e))}touchend(e){this._map.fire(new el(e.type,this._map,e))}touchcancel(e){this._map.fire(new el(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class nl{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(e){this._map.fire(new Qa(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Qa("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new Qa(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class rl{constructor(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(d(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const i=t,n=this._startPos,r=this._lastPos;if(!n||!r||r.equals(i)||!this._box&&i.dist(n)<this._clickTolerance)return;this._lastPos=i,this._box||(this._box=a("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));const o=Math.min(n.x,i.x),s=Math.max(n.x,i.x),l=Math.min(n.y,i.y),c=Math.max(n.y,i.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${o}px,${l}px)`,this._box.style.width=s-o+"px",this._box.style.height=c-l+"px")})}mouseupWindow(t,i){if(!this._active)return;const n=this._startPos,r=i;if(n&&0===t.button){if(this.reset(),m(),n.x!==r.x||n.y!==r.y)return this._map.fire(new e.h("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(n,r,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}
vendor: 5,101 bytes, line 2
2keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),f(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.h(t,{originalEvent:i}))}}function ol(e,t){const i={};for(let n=0;n<e.length;n++)i[e[n].identifier]=t[n];return i}class sl{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(t,i,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){const i=new e.P(0,0);for(const e of t)i._add(e);return i.div(t.length)}(i),this.touches=ol(n,i)))}touchmove(e,t,i){if(this.aborted||!this.centroid)return;const n=ol(i,t);for(const e in this.touches){const t=n[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,i){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class al{constructor(e){this.singleTap=new sl(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(e,t,i){this.singleTap.touchstart(e,t,i)}touchmove(e,t,i){this.singleTap.touchmove(e,t,i)}touchend(e,t,i){const n=this.singleTap.touchend(e,t,i);if(n){const t=e.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(t&&i||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class ll{constructor(){this._zoomIn=new al({numTouches:1,numTaps:2}),this._zoomOut=new al({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,i){this._zoomIn.touchstart(e,t,i),this._zoomOut.touchstart(e,t,i)}touchmove(e,t,i){this._zoomIn.touchmove(e,t,i),this._zoomOut.touchmove(e,t,i)}touchend(e,t,i){const n=this._zoomIn.touchend(e,t,i),r=this._zoomOut.touchend(e,t,i);return n?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(n)},{originalEvent:e})}):r?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(r)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const cl=0,ul=2,hl={[cl]:1,[ul]:2},dl={Control:"ctrlKey",Alt:"altKey",Shift:"shiftKey",Meta:"metaKey"};class fl{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(e,t){return!1}_move(e,t){return{}}mousedown(e,t){if(this._lastPoint)return;const i=y(e);this._correctButton(e,i)&&(this._lastPoint=t,this._eventButton=i)}mousemoveWindow(e,t){const i=this._lastPoint;if(i)if(e.preventDefault(),null!=this._eventButton&&function(e,t){const i=hl[t];return void 0===e.buttons||(e.buttons&i)!==i}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(i,t)}mouseupWindow(e){this._lastPoint&&y(e)===this._eventButton&&(this._moved&&m(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class pl extends fl{mousedown(e,t){super.mousedown(e,t),this._lastPoint&&(this._active=!0)}_correctButton(e,t){return 0===t&&!e.ctrlKey}_move(e,t){return{around:t,panDelta:t.sub(e)}}}class ml extends fl{constructor(e){super(e),this._pitchRotateKey=e.pitchRotateKey?dl[e.pitchRotateKey]:void 0}_correctButton(e,t){return this._pitchRotateKey?0===t&&e[this._pitchRotateKey]:0===t&&e.ctrlKey||2===t}_move(e,t){const i=.8*(t.x-e.x);if(i)return this._active=!0,{bearingDelta:i}}contextmenu(e){this._pitchRotateKey||e.preventDefault()}}class _l extends fl{constructor(e){super(e),this._pitchRotateKey=e.pitchRotateKey?dl[e.pitchRotateKey]:void 0}_correctButton(e,t){return this._pitchRotateKey?0===t&&e[this._pitchRotateKey]:0===t&&e.ctrlKey||2===t}_move(e,t){const i=-.5*(t.y-e.y);if(i)return this._active=!0,{pitchDelta:i}}contextmenu(e){this._pitchRotateKey||e.preventDefault()}}class gl{constructor(t,i){this._map=t,this._el=t.getCanvasContainer(),this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset(),e.aW(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}touchstart(e,t,i){return this._calculateTransform(e,t,i)}touchmove(t,i,n){if(this._active&&!(n.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===n.length&&!e.eD())return void this._showTouchPanBlockerAlert();
vendor: 4,238 bytes, line 2
2"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return t.cancelable&&t.preventDefault(),this._calculateTransform(t,i,n)}}touchend(e,t,i){this._calculateTransform(e,t,i),this._active&&i.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,n){n.length>0&&(this._active=!0);const r=ol(n,i),o=new e.P(0,0),s=new e.P(0,0);let a=0;for(const e in r){const t=r[e],i=this._touches[e];i&&(o._add(t),s._add(t.sub(i)),a++,r[e]=t)}if(this._touches=r,a<this._minTouches||!s.mag())return;const l=s.div(a);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(a),panDelta:l}}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=a("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=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")},500)}}class yl{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(e){}_move(e,t,i){return{}}touchstart(e,t,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,i){const n=this._firstTwoTouches;if(!n)return;e.preventDefault();const[r,o]=n,s=vl(i,t,r),a=vl(i,t,o);if(!s||!a)return;const l=this._aroundCenter?null:s.add(a).div(2);return this._move([s,a],l,e)}touchend(e,t,i){if(!this._firstTwoTouches)return;const[n,r]=this._firstTwoTouches,o=vl(i,t,n),s=vl(i,t,r);o&&s||(this._active&&m(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function vl(e,t,i){for(let n=0;n<e.length;n++)if(e[n].identifier===i)return t[n]}function xl(e,t){return Math.log2(e/t)}class bl extends yl{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){const i=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(xl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:xl(this._distance,i),pinchAround:t}}}function wl(e,t){return 180*e.angleWith(t)/Math.PI}class Tl extends yl{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t){const i=this._vector;if(this._vector=e[0].sub(e[1]),i&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:wl(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,i=this._startVector;if(!i)return!1;const n=wl(e,i);return Math.abs(n)<t}}function El(e){return Math.abs(e.y)>Math.abs(e.x)}class Sl extends yl{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(e){this._lastPoints=e,El(e[0].sub(e[1]))&&(this._valid=!1)}_move(t,i,n){const r=this._lastPoints;if(!r)return;const o=t[0].sub(r[0]),s=t[1].sub(r[1]);return this._map._cooperativeGestures&&!e.eD()&&n.touches.length<3||(this._val
vendor: 4,675 bytes, line 2
2id=this.gestureBeginsVertically(o,s,n.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+s.y)/2*-.5})}gestureBeginsVertically(e,t,i){if(void 0!==this._valid)return this._valid;const n=e.mag()>=2,r=t.mag()>=2;if(!n&&!r)return;if(!n||!r)return this._firstMove??=i,i-this._firstMove<100&&void 0;const o=e.y>0==t.y>0;return El(e)&&El(t)&&o}}const Il={panStep:100,bearingStep:15,pitchStep:10};class Al{constructor(){const e=Il;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._bearingDisabled=!1,this._pitchDisabled=!1,this._panDisabled=!1,this._zoomDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;if(!this.isEnabled())return;let t=0,i=0,n=0,r=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?i=-1:(e.preventDefault(),r=-1);break;case 39:e.shiftKey?i=1:(e.preventDefault(),r=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),o=1);break;default:return}return this._bearingDisabled&&(i=0),this._pitchDisabled&&(n=0),this._panDisabled&&(r=0,o=0),this._zoomDisabled&&(t=0),{cameraAnimation:s=>{const a=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:Ml,zoom:t?Math.round(a)+t*(e.shiftKey?2:1):a,bearing:s.getBearing()+i*this._bearingStep,pitch:s.getPitch()+n*this._pitchStep,offset:[-r*this._panStep,-o*this._panStep],center:s.getCenter()},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled&&!(this._bearingDisabled&&this._pitchDisabled&&this._panDisabled&&this._zoomDisabled)}isActive(){return this._active}disableRotation(){this._pitchDisabled=!0,this._bearingDisabled=!0}enableRotation(){this._pitchDisabled=!1,this._bearingDisabled=!1}isRotationEnabled(){return!this._pitchDisabled&&!this._bearingDisabled}disablePan(){this._panDisabled=!0}enablePan(){this._panDisabled=!1}isPanEnabled(){return!this._panDisabled}disableZoom(){this._zoomDisabled=!0}enableZoom(){this._zoomDisabled=!1}isZoomEnabled(){return!this._zoomDisabled}disablePitch(){this._pitchDisabled=!0}enablePitch(){this._pitchDisabled=!1}isPitchEnabled(){return!this._pitchDisabled}disableBearing(){this._bearingDisabled=!0}enableBearing(){this._bearingDisabled=!1}isBearingEnabled(){return!this._bearingDisabled}}function Ml(e){return e*(2-e)}const Cl=4.000244140625,Dl=1/450,Pl=/(Mac|iPad)/i;class Rl{constructor(t,i){this._map=t,this._el=t.getCanvasContainer(),this._handler=i,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=Dl,e.aW(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||e.eD()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let i=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const n=e.e.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%Cl===0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=i,this._timeout=window.setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),t.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=t,this._delta-=i,this._active||this._start(t)),t.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const t=_(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:t,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRe
vendor: 11,836 bytes, line 2
2nderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;"wheel"===this._type&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const i=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>Cl?this._wheelZoomRate:this._defaultZoomRate;let n=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==n&&(n=1/n);const r=i(),o=Math.pow(2,r),s="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(s*n))),"wheel"===this._type&&(this._startZoom=r,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const n="number"==typeof this._targetZoom?this._targetZoom:i(),r=this._startZoom,o=this._easing;let s,a=!1;if("wheel"===this._type&&r&&o){const t=Math.min((e.e.now()-this._lastWheelEventTime)/200,1),i=o(t);s=e.am(r,n,i),t<1?this._frameId||(this._frameId=!0):a=!0}else s=n,a=!0;this._active=!0,a&&(this._active=!1,this._finishTimeout=window.setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let l=s-i();return l*this._lastDelta<0&&(l=0),{noInertia:!0,needsRenderFrame:!a,zoomDelta:l,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.eE;if(this._prevEase){const t=this._prevEase,n=(e.e.now()-t.start)/t.duration,r=t.easing(n+.01)-t.easing(n),o=.27/Math.sqrt(r*r+1e-4)*.01,s=Math.sqrt(.0729-o*o);i=e.eC(o,s,.25,1)}return this._prevEase={start:e.e.now(),duration:t,easing:i},i}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=a("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=Pl.test(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=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")},200)}}class Ll{constructor(e,t){this._clickZoom=e,this._tapZoom=t}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 zl{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(e,t){return e.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:i.getZoom()+(e.shiftKey?-1:1),around:i.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fl{constructor(){this._tap=new al({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(e,t,i){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=t[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(e,t,i))}touchmove(e,t,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const n=t[0],r=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(e,t,i)}touchend(e,t,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(e,t,i)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ol{constructor(e,t,i){this._el=e,this._mousePan=t,this._touchPan=i}enable(e){this._inertiaOptions=e||{},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 kl{constructor(e,t,i){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=i,this._pitchDisabled=!1,this._rotationDisabled=!1}enable(){this._rotationDisabled||this._mouseRotate.enable(),this._pitchWithRotate&&!this._pitchDisabled&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._pitchWithRotate?!this._rotationDisabled&&this._mouseRotate.isEnabled()||!this._pitchDisabled&&this._mousePitch.isEnabled():!this._rotationDisabled&&this._mouseRotate.isEnabled()}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}disablePitch(){this._pitchDisabled=!0,this._mousePitch.disable()}enablePitch(){this._pitchDisabled=!1,this._pitchWithRotate&&this._mousePitch.enable()}isPitchEnabled(){return!this._pitchDisabled&&this._mousePitch.isEnabled()}disableRotation(){this._rotationDisabled=!0,this._mouseRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._mouseRotate.enable()}isRotationEnabled(){return!this._rotationDisabled&&this._mouseRotate.isEnabled()}}class Bl{constructor(e,t,i,n){this._el=e,this._touchZoom=t,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._tapDragZoomDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoomDisabled||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._tapDragZoomDisabled&&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()}isRotationEnabled(){return!this._rotationDisabled}disableTapDragZoom(){this._tapDragZoomDisabled=!0,this._tapDragZoom.disable()}enableTapDragZoom(){this._tapDragZoomDisabled=!1,this._touchZoom.isEnabled()&&this._tapDragZoom.enable()}isTapDragZoomEnabled(){return!this._tapDragZoomDisabled}}const Nl=e=>e.zoom||e.drag||e.pitch||e.rotate;class Vl extends e.h{}class Ul{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,i){const n=e.cv([],i,t);this.radius=e.es(n[2]<0?e.eG([],n,this.constants):[n[0],n[1],0])}projectRay(t){e.eG(t,t,this.constants),e.c9(t,t),e.eH(t,t,this.constants);const i=e.dV([],t,this.radius);if(i[2]>0){const t=e.dV([],[0,0,1],e.dY(i,[0,0,1])),n=e.dV([],e.c9([],[i[0],i[1],0]),this.radius),r=e.dW([],i,e.dV([],e.cv([],e.dW([],n,t),i),2));i[0]=r[0],i[1]=r[1]}return i}}function jl(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Gl{constructor(t,i){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Xa(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Ul,this._dragOrigin=null,this._mouseBeingPressed=!1,this._activeTouchCount=0,this._eventsInProgress={},this._addDefaultHandlers(i),e.aW(["handleEvent","handleWindowEvent"],this);const n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]];for(const[e,t,i]of this._listeners){const n=e===document?this.handleWindowEvent:this.handleEvent;e.addEventListener(t,n,i)}}destroy(){for(const[e,t,i]of this._listeners){const n=e===document?this.handleWindowEvent:this.handleEvent;e.removeEventListener(t,n,i)}}_addDefaultHandlers(e){const t=this._map,i=t.getCanvasContainer();this._add("mapEvent",new il(t,e));const n=t.boxZoom=new rl(t,e);this._add("boxZoom",n);const r=new ll,o=new zl;t.doubleClickZoom=new Ll(o,r),this._add("tapZoom",r),this._add("clickZoom",o);const s=new Fl;this._add("tapDragZoom",s);const a=t.touchPitch=new Sl(t);this._add("touchPitch",a);const l=new ml(e),c=new _l(e);t.dragRotate=new kl(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new pl(e),h=new gl(t,e);t.dragPan=new Ol(i,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);const d=new Tl,f=new bl;t.touchZoomRotate=new Bl(i,f,d,s),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),this._add("blockableMapEvent",new nl(t));const p=t.scrollZoom=new Rl(t,this);this._add("scrollZoom",p,["mousePan"]);const m=t.keyboard=new Al;this._add("keyboard",m);for(const i of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[i]&&t[i].enable(e[i])}_add(e,t,i){this._handlers.push({handlerName:e,handler:t,allowed:i}),this._handlersById[e]=t}stop(e="never"){if(!this._updatingCamera&&!("always"===e||"ifPointerDown"===e&&this._isPointerDown())){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},!1),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Nl(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(e,t,i){for(const n in e)if(!(n===i||t&&t.includes(n)))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){const t=[];for(const i of e)this._el.contains(i.target)&&t.push(i);return t}_updatePointerLiveness(e){switch(e.type){case"mousedown":this._mouseBeingPressed=!0;break;case"mousemove":0===e.buttons&&(this._mouseBeingPressed=!1);break;case"mouseup":this._mouseBeingPressed=!1;break;case"touchstart":case"touchmove":case"touchend":case"touchcancel":this._activeTouchCount=e.touches?e.touches.length:0;break;case"blur":this._mouseBeingPressed=!1,this._activeTouchCount=0}}_isPointerDown(){return this._mouseBeingPressed||this._activeTouchCount>0}handleEvent(e,t){this._updatePointerLiveness(e),this._updatingCamera=!0;const i="renderFrame"===e.type,n=i?void 0:e,r={needsRenderFrame:!1},o={},s={},a=e.touches?this._getMapTouches(e.touches):void 0,l=a?g(this._el,a):i?void 0:_(this._el,e);for(const{handlerName:i,handler:c,allowed:u}of this._handlers){if(!c.isEnabled())continue;let h;this._blockedByActive(s,u,i)?c.reset():c[t||e.type]&&(h=c[t||e.type](e,l,a),this.mergeHandlerResult(r,o,h,i,n),h&&h.needsRenderFrame&&this._triggerRe
vendor: 4,176 bytes, line 2
2nderFrame()),(h||c.isActive())&&(s[i]=c)}const c={};for(const e in this._previousActiveHandlers)s[e]||(c[e]=n);this._previousActiveHandlers=s,(Object.keys(c).length||jl(r))&&(this._changes.push([r,o,c]),this._triggerRenderFrame()),(Object.keys(s).length||jl(r))&&this._map._stop({keepGesture:"always"}),this._updatingCamera=!1;const{cameraAnimation:u}=r;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))}mergeHandlerResult(e,t,i,n,r){if(!i)return;Object.assign(e,i);const o={handlerName:n,originalEvent:i.originalEvent||r};void 0!==i.zoomDelta&&(t.zoom=o),void 0!==i.panDelta&&(t.drag=o),void 0!==i.pitchDelta&&(t.pitch=o),void 0!==i.bearingDelta&&(t.rotate=o)}_applyChanges(){const t={},i={},n={};for(const[r,o,s]of this._changes)r.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(r.panDelta)),r.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+r.pitchDelta),void 0!==r.around&&(t.around=r.around),void 0!==r.aroundCoord&&(t.aroundCoord=r.aroundCoord),void 0!==r.pinchAround&&(t.pinchAround=r.pinchAround),r.noInertia&&(t.noInertia=r.noInertia),Object.assign(i,o),Object.assign(n,s);this._updateMapTransform(t,i,n),this._changes=[]}_updateMapTransform(t,i,n){const r=this._map,o=r.transform,s=e=>[e.x,e.y,e.z];if((()=>{const e=this._eventsInProgress.drag;return e&&!this._handlersById[e.handlerName].isActive()})()&&!jl(t)){const e=o.zoom;o.cameraElevationReference="sea",null!=this._originalZoom&&o._orthographicProjectionAtLowPitch&&"globe"!==o.projection.name&&0===o.pitch?(o.cameraElevationReference="ground",o.zoom=this._originalZoom):(o.recenterOnTerrain(),o.cameraElevationReference="ground"),e!==o.zoom&&this._map._update(!0)}if(o._isCameraConstrained&&r._stop({keepGesture:"always"}),!jl(t))return void this._fireEvents(i,n,!0);let{panDelta:a,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:h,aroundCoord:d,pinchAround:f}=t;o._isCameraConstrained&&(l>0&&(l=0),o._isCameraConstrained=!1),void 0!==f&&(h=f),(l||(e=>i[e]&&!this._eventsInProgress[e])("drag"))&&h&&(this._dragOrigin=s(o.pointCoordinate3D(h)),this._originalZoom=o.zoom,this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",r._stop({keepGesture:"always"}),h=h||r.transform.centerPoint,c&&(o.bearing+=c),u&&(o.pitch+=u),o._updateCameraState();const p=[0,0,0];if(a)if("mercator"===o.projection.name){const e=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h).dir),t=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h.sub(a)).dir);p[0]=t[0]-e[0],p[1]=t[1]-e[1]}else{const t=o.pointCoordinate(h);if("globe"===o.projection.name){a=a.rotate(-o.angle);const i=o._pixelsPerMercatorPixel/o.worldSize;p[0]=-a.x*e.eF(e.bs(t.y))*i,p[1]=-a.y*e.eF(o.center.lat)*i}else{const e=o.pointCoordinate(h.sub(a));t&&e&&(p[0]=e.x-t.x,p[1]=e.y-t.y)}}const m=o.zoom,_=[0,0,0];if(l){const t=s(d||o.pointCoordinate3D(h)),i={dir:e.c9([],e.cv([],t,o._camera.position))};if(i.dir[2]<0){const n=o.zoomDeltaToMovement(t,l);e.dV(_,i.dir,n)}}const g=e.dW(p,p,_);o._translateCameraConstrained(g),l&&Math.abs(o.zoom-m)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(i,n,!0)}_fireEvents(t,i,n){const r=Nl(this._eventsInProgress),o=Nl(t),s={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=i),this._eventsInProgress[e]=t[e]}!r&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in s)this._fireEvent(e,s[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i)}const a={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:n}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=i[t]||n,a[`${e}end`]=l)}for(const e in a)this._fireEvent(e,a[e]);const c=Nl(this._eventsInProgress);if(n&&(r||o)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;
vendor: 8,157 bytes, line 2
2t?(i(t.bearing||this._map.getBearing())&&(t.bearing=0),this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new e.h("moveend",{originalEvent:l})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new e.h(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{this._frameId=void 0,this.handleEvent(new Vl("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const $l="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Hl extends e.E{constructor(t,i){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=i.bearingSnap,this._respectPrefersReducedMotion=!1!==i.respectPrefersReducedMotion,e.aW(["_renderFrameCallback"],this)}getCenter(){return new e.cZ(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,i,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,{offset:t,...i},n)}panTo(e,t,i){return this.easeTo({center:e,...t},i)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,i){return this.easeTo({zoom:e,...t},i)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,t,i){return this.easeTo({bearing:e,...t},i)}resetNorth(e,t){return this.rotateTo(0,{duration:1e3,...e},t),this}resetNorthPitch(e,t){return this.easeTo({bearing:0,pitch:0,duration:1e3,...e},t),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,t){return this.jumpTo({fov:e},t)}getHorizontalFieldOfView(){return this.transform.horizontalFov}cameraForBounds(t,i){t=e.eI.convert(t);const n=i&&i.bearing||0,r=i&&i.pitch||0,o=t.getNorthWest(),s=t.getSouthEast();return this._cameraForBounds(this.transform,o,s,n,r,i)}_extendPadding(e){const t={top:0,right:0,bottom:0,left:0};return null==e?{...t,...this.transform.padding}:"number"==typeof e?{top:e,bottom:e,right:e,left:e}:{...t,...e}}_extendCameraOptions(e){return(e={offset:[0,0],maxZoom:this.transform.maxZoom,...e}).padding=this._extendPadding(e.padding),e}_minimumAABBFrustumDistance(e,t){const i=t.max[0]-t.min[0],n=t.max[1]-t.min[1];return i/n>e.aspect?i/(2*Math.tan(.5*e.fovX)*e.aspect):n/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(t,i,n,r,o,s){const a=t.clone(),l=this._extendCameraOptions(s);a.bearing=r,a.pitch=o;const c=e.cZ.convert(i),u=e.cZ.convert(n),h=.5*(c.lat+u.lat),d=.5*(c.lng+u.lng),f=e.eJ(h,d),p=e.c9([],f),m=e.c9([],e.eK([],p,[0,1,0])),_=e.eK([],m,p),g=[m[0],m[1],m[2],0,_[0],_[1],_[2],0,p[0],p[1],p[2],0,0,0,0,1],y=[f,e.eJ(c.lat,c.lng),e.eJ(u.lat,c.lng),e.eJ(u.lat,u.lng),e.eJ(c.lat,u.lng),e.eJ(h,c.lng),e.eJ(h,u.lng),e.eJ(c.lat,d),e.eJ(u.lat,d)];let v=e.eL.fromPoints(y.map(t=>[e.dY(m,t),e.dY(_,t),e.dY(p,t)]));const x=e.bI([],v.center,g);0===e.eM(x)&&e.eN(x,0,0,1),e.c9(x,x),e.dV(x,x,e.cy),a.center=e.eO(x);const b=a.getWorldToCameraMatrix(),w=e.aP(new Float64Array(16),b);v=e.eL.applyTransform(v,e.X([],b,g));const T=this._extendAABB(v,a,l,r);if(!T)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");v=T,e.bI(x,x,b);const E=.5*(v.max[2]-v.min[2]),S=this._minimumAABBFrustumDistance(a,v),I=e.dV([],[0,0,1],E),A=e.dW(I,x,I),M=S+(0===a.pitch?0:e.eP(x,A)),C=a.globeCenterInViewSpace,D=e.cv([],x,[C[0],C[1],C[2]]);e.c9(D,D),e.dV(D,D,M);const P=e.dW([],x,D);e.bI(P,P,w);const R=e.bk/e.cy,L=e.es(P),z=e.c4(Math.max(L*R-e.bk,Number.EPSILON),0),F=Math.min(a.zoomFromMercatorZAdjusted(z),l.maxZoom);return F>.5*(e.ef+e.b2)?(a.setProjection({name:"mercator"}),a.zoom=F,this._cameraForBounds(a,i,n,r,o,s)):{center:a.center,zoom:F,bearing:r,pitch:o}}_extendAABB(t,i,n,r){const o=.5*((n.padding.left||0)+(n.padding.right||0)),s=.5*((n.padding.top||0)+(n.padding.bottom||0)),a=s,l=o,c=o,u=s,h=i.width-(l+c),d=i.height-(a+u),f=e.cv([],t.max,t.min),p=Math.min(h/f[0],d/f[1]),m=Math.min(i.scaleZoom(i.scale*p),n.maxZoom);if(isNaN(m))return null;const _=i.scale/i.zoomScale(m),g=new e.eL([t.min[0]-l*_,t.min[1]-u*_,t.min[2]],[t.max[0]+c*_,t.max[1]+a*_,t.max[2]]),y=("number"==typeof n.offset.x&&"number"==typeof n.offset.y?new e.P(n.offset.x,n.offset.y):e.P.convert(n.offset)).rotate(-e.av(r));return g.center[0]-=y.x*_,g.center[1]+=y.y*_,g}queryTerrainElevation(t,i){const n=this.transform.elevation;return n?(i={exaggerated:!0,...i},n.getAtPoint(e.bT.fromLngLat(t),null,i.exaggerated)):null}_cameraForBounds(t,i,n,r,o,s){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,i,n,r,o,s);const a=t.clone(),l=this._extendCameraOptions(s);a.bearing=r,a.pitch=o;const c=e.cZ.convert(i),u=e.cZ.convert(n),h=new e.cZ(c.lng,u.lat),d=new e.cZ(u.lng,c.lat),f=a.project(c),p=a.project(u),m=this.queryTerrainElevation(c),_=this.queryTerrainElevation(u),g=this.queryTerrainElevation(h),y=this.queryTerrainElevation(d),v=[[f.x,f.y,Math.min(m||0,_||0,g||0,y||0)],[p.x,p.y,Math.max(m||0,_||0,g||0,y||0)]];let x=e.eL.fromPoints(v);const b=a.getWorldToCameraMatrix(),w=e.aP(new Float64Array(16),b);x=e.eL.applyTransform(x,b);const T=this._extendAABB(x,a,l,r);if(!T)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");x=T;const E=.5*e.cv([],x.max,x.min)[2],S=this._minimumAABBFrustumDistance(a,x),I=[0,0,1,0];e.c6(I,I,b),e.eQ(I,I);const A=e.dV([],I,S+E),M=e.dW([],x.center,A);e.bI(x.center,x.center,w),e.bI(M,M,w);const C=a.unproject(new e.P(x.center[0],x.center[1])),D=e.eR(a.projection,C),P=Math.pow(2,D),R=Math.min(a._zoomFromMercatorZ(M[2]*a.pixelsPerMeter*P/a.worldSize),l.maxZoom);return a.mercatorFromTransition&&R<.5*(e.ef+e.b2)?(a.setProjection({name:"globe"}),a.zoom=R,this._cameraForBounds(a,i,n,r,o,s)):{center:C,zoom:R,bearing:r,pitch:o}}fitBounds(e,t,i){const n=this.cameraForBounds(e,t);return this._fitInternal(n,t,i)}fitScreenCoordinates(t,i,n,r,o){const s=e.P.convert(t),a=e.P.convert(i),l=new e.P(Math.min(s.x,a.x),Math.min(s.y,a.y)),c=new e.P(Math.max(s.x,a.x),Math.max(s.y,a.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(s,a))return this;const u=this.transform.pointLocation3D(l),h=this.transform.pointLocation3D(c),d=this.transform.pointLocation3D(new e.P(l.x,c.y)),f=this.transform.pointLocation3D(new e.P(c.x,l.y)),p=[Math.min(u.lng,h.lng,d.lng,f.lng),Math.min(u.lat,h.lat,d.lat,f.lat)],m=[Math.max(u.lng,h.lng,d.lng,f.lng),Math.max(u.lat,h.lat,d.lat,f.lat)],_=r&&r.pitch?r.pitch:this.getPitch(),g=this._cameraForBounds(this.transform,p,m,n,_,r);return this._fitInternal(g,r,o)}_fitInternal(e,t,i){return e?(t=Object.assign(e,t)).linear?this.easeTo(t,i):this.flyTo(t,i):this}jumpTo(t,i){this._stop({keepGesture:"ifPointerDown"});const n=t.preloadOnly?this.transform.clone():this.transform;let r=!1,o=!1,s=!1;"zoom"in t&&n.zoom!==+t.zoom&&(r=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.cZ.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(o=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(s=!0,n.pitch=+t.pitch),"fov"in t&&(n.fov=+t.fov);const a="number"==typeof t.padding?this._extendPadding(t.padding):t.padding;if(null!=t.padding&&!n.isPaddingEqual(a))if(!1===t.retainPadding){const e=n.clone();e.padding=a,n.setLocationAtPoint(n.center,e.centerPoint)}else n.padding=a;return t.preloadOnly?(this._preloadTiles(n),this):(this.fire(new e.h("movestart",i)).fire(new e.h("move",i)),r&&this.fire(new e.h("zoomstart",i)).fire(new e.h("zoom",i)).fire(new e.h("zoomend",i)),o&&this.fire(new e.h("rotatestart",i)).fire(new e.h("rotate",i)).fire(new e.h("rotateend",i)),s&&this.fire(new e.h("pitchstart",i)).fire(new e.h("pitch",i)).fire(new e.h("pitchend",
vendor: 5,150 bytes, line 2
2i)),this.fire(new e.h("moveend",i)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.w($l),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,i){const n=this.transform;if(!n.projection.supportsFreeCamera)return e.w($l),this;this.stop();const r=n.zoom,o=n.pitch,s=n.bearing;n.setFreeCameraOptions(t);const a=r!==n.zoom,l=o!==n.pitch,c=s!==n.bearing;return this.fire(new e.h("movestart",i)).fire(new e.h("move",i)),a&&this.fire(new e.h("zoomstart",i)).fire(new e.h("zoom",i)).fire(new e.h("zoomend",i)),c&&this.fire(new e.h("rotatestart",i)).fire(new e.h("rotate",i)).fire(new e.h("rotateend",i)),l&&this.fire(new e.h("pitchstart",i)).fire(new e.h("pitch",i)).fire(new e.h("pitchend",i)),this.fire(new e.h("moveend",i)),this}easeTo(t,i){this._stop({easeId:t.easeId}),(!1===(t={offset:[0,0],duration:500,easing:e.eE,...t}).animate||this._prefersReducedMotion(t))&&(t.duration=0);const n=this.transform,r=this.getZoom(),o=this.getBearing(),s=this.getPitch(),a=this.getPadding(),l=this.getVerticalFieldOfView(),c="zoom"in t?+t.zoom:r,u="bearing"in t?this._normalizeBearing(t.bearing,o):o,h="pitch"in t?+t.pitch:s,d="fov"in t?+t.fov:l,f=this._extendPadding(t.padding),p=e.P.convert(t.offset);let m,_,g;if("globe"===n.projection.name){const i=e.bT.fromLngLat(n.center),r=p.rotate(-n.angle);i.x+=r.x/n.worldSize,i.y+=r.y/n.worldSize;const o=i.toLngLat(),s=e.cZ.convert(t.center||o);this._normalizeCenter(s),m=n.centerPoint.add(r),_=new e.P(i.x,i.y).mult(n.worldSize),g=new e.P(e.a7(s.lng),e.a8(s.lat)).mult(n.worldSize).sub(_)}else{m=n.centerPoint.add(p);const i=n.pointLocation(m),r=e.cZ.convert(t.center||i);this._normalizeCenter(r),_=n.project(i),g=n.project(r).sub(_)}const y=n.zoomScale(c-r);let v,x;t.around&&(v=e.cZ.convert(t.around),x=n.locationPoint(v));const b=this._zooming||c!==r,w=this._rotating||o!==u,T=this._pitching||h!==s,E=d!==l,S=!n.isPaddingEqual(f),I=!1===t.retainPadding?n.clone():n,A=n=>A=>{if(b&&(n.zoom=e.am(r,c,A)),w&&(n.bearing=e.am(o,u,A)),T&&(n.pitch=e.am(s,h,A)),E&&(n.fov=e.am(l,d,A)),S&&(I.interpolatePadding(a,f,A),m=I.centerPoint.add(p)),v)n.setLocationAtPoint(v,x);else{const e=n.zoomScale(n.zoom-r),t=c>r?Math.min(2,y):Math.max(.5,y),i=Math.pow(t,1-A),o=n.unproject(_.add(g.mult(A*i)).mult(e));n.setLocationAtPoint(n.renderWorldCopies?o.wrap():o,m)}return t.preloadOnly||this._fireMoveEvents(i),n};if(t.preloadOnly){const e=this._emulate(A,t.duration,n);return this._preloadTiles(e),this}const M={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=b,this._rotating=w,this._pitching=T,this._padding=S,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,M),this._ease(A(n),e=>{"sea"===n.cameraElevationReference&&n.recenterOnTerrain(),this._afterEase(i,e)},t),this}_prepareEase(t,i,n={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),i||n.moving||this.fire(new e.h("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.h("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.h("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.h("pitchstart",t))}_fireMoveEvents(t){this.fire(new e.h("move",t)),this._zooming&&this.fire(new e.h("zoom",t)),this._rotating&&this.fire(new e.h("rotate",t)),this._pitching&&this.fire(new e.h("pitch",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const n=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.h("zoomend",t)),r&&this.fire(new e.h("rotateend",t)),o&&this.fire(new e.h("pitchend",t)),this.fire(new e.h("moveend",t))}flyTo(t,i){if(this._prefersReducedMotion(t)){const n=e.cB(t,["center","zoom","bearing","pitch","fov","around","padding","retainPadding"]);return this.jumpTo(n,i)}this.stop(),t={offset:[0,0],speed:1.2,curve:1.42,easing:e.eE,...t};const n=this.transform,r=this.getZoom(),o=this.getBearing(),s=this.getPitch(),a=this.getPadding(),l=this.getVerticalFieldOfView(),c="zoom"in t?e.b1(+t.zoom,n.minZoom,n.maxZoom):r,u="bearing"in t?this._normalizeBearing(t.bearing,o):o,h="pitch"in t?+t.pitch:s,d="fov"in t?+t.fov:l,f=d!==l,p=this._extendPadding(t.padding),m=n.zoomScale(c-r),_=e.P.convert(t.offset);let g=n.centerPoint.add(_);const y=n.pointLocation(g),v=e.cZ.convert(t.center||y);this._normalizeCenter(v);const x=n.project(y),b=n.project(v).sub(x);let w=t.curve;const T=Math.max(n.width,n.height),E=T/m,S=b.mag();if("minZoom"in t){const i=e.b1(Math.min(t.minZoom,r,c),n.minZoom,n.maxZoom),o=T/n.zoomScale(i-r);w=Math.sqrt(o/S*2)}const I=w*w;function A(e){const t=(E*E-T*T+(e?-1:1)*I*I*S*S)/(2*(e?E:T)*I*S);return Math.log(Math.sqrt(t*t+1)-t)}function M(e){return(Math.exp(e)-Math.exp(-e))/2}function C(e){return(Math.exp(e)+Math.exp(-e))/2}const D=A(0);let P=function(e){return C(D)/C(D+w*e)},R=function(e){return T*((C(D)*(M(t=D+w*e)/C(t))-M(D))/I)/S;var t},L=(A(1)-D)/w;
vendor: 9,909 bytes, line 2
2if(Math.abs(S)<1e-6||!isFinite(L)){if(Math.abs(T-E)<1e-6)return this.easeTo(t,i);const e=E<T?-1:1;L=Math.abs(Math.log(E/T))/w,R=function(){return 0},P=function(t){return Math.exp(e*w*t)}}t.duration="duration"in t?+t.duration:1e3*L/("screenSpeed"in t?+t.screenSpeed/w:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0);const z=o!==u,F=h!==s,O=!n.isPaddingEqual(p),k=!1===t.retainPadding?n.clone():n,B=n=>m=>{const y=m*L,w=1/P(y);n.zoom=1===m?c:r+n.scaleZoom(w),z&&(n.bearing=e.am(o,u,m)),F&&(n.pitch=e.am(s,h,m)),f&&(n.fov=e.am(l,d,m)),O&&(k.interpolatePadding(a,p,m),g=k.centerPoint.add(_));const T=1===m?v:n.unproject(x.add(b.mult(R(y))).mult(w));return n.setLocationAtPoint(n.renderWorldCopies?T.wrap():T,g),n._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(i),n};if(t.preloadOnly){const e=this._emulate(B,t.duration,n);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=z,this._pitching=F,this._padding=O,this._prepareEase(i,!1),this._ease(B(n),()=>this._afterEase(i),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(e){}_cancelRenderFrame(e){}_stop({easeId:e,keepGesture:t}={}){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const t=this._onEaseEnd;this._onEaseEnd=void 0,t.call(this,e)}const i=this.handlers;return i&&i.stop(t),this}_ease(t,i,n){!1===n.animate||0===n.duration?(t(1),i()):(this._easeStart=e.e.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((e.e.now()-this._easeStart)/this._easeOptions.duration,1),i=this._onEaseFrame;i&&i(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,i){t=e.d7(t,-180,180);const n=Math.abs(t-i);return Math.abs(t-360-i)<n&&(t-=360),Math.abs(t+360-i)<n&&(t+=360),t}_normalizeCenter(e){const t=this.transform;if(t.maxBounds)return;if("globe"!==t.projection.name&&!t.renderWorldCopies)return;const i=e.lng-t.center.lng;e.lng+=i>180?-360:i<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&e.e.prefersReducedMotion&&!(t&&t.essential)}_emulate(e,t,i){const n=Math.ceil(15*t/1e3),r=[],o=e(i.clone());for(let e=0;e<=n;e++){const t=o(e/n);r.push(t.clone())}return r}_preloadTiles(e,t){}}const Zl=/^(https?:|mailto:)/i;class ql{constructor(t={}){this.options=t,e.aW(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){const t=this.options&&this.options.compact,i=e._getUIString("AttributionControl.ToggleAttribution");this._map=e,this._container=a("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=a("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",i);const n=a("span","mapboxgl-ctrl-icon",this._compactButton);return n.setAttribute("aria-hidden","true"),n.setAttribute("title",i),this._innerContainer=a("div","mapboxgl-ctrl-attrib-inner",this._container),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(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}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.eS.ACCESS_TOKEN}];if(t){const n=i.reduce((e,t,n)=>(t.value&&(e+=`${t.key}=${t.value}${n<i.length-1?"&":""}`),e),"?");t.href=`${e.eS.FEEDBACK_URL}/${n}#${$a(this._map,!0)}`,t.rel="noopener nofollow"}}_updateData(e){!e||("source"!==e.dataType||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType)&&"style"!==e.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let e=[];if(this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style._mergedSourceCaches;for(const i in t){const n=t[i];if(n.used){const t=n.getSource();t.attribution&&!e.includes(t.attribution)&&e.push(t.attribution)}}e.sort((e,t)=>e.length-t.length),e=e.filter((t,i)=>{for(let n=i+1;n<e.length;n++)if(e[n].includes(t))return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[...this.options.customAttribution,...e]:e.unshift(this.options.customAttribution));const i=e.map(e=>function(e){const t=(new DOMParser).parseFromString(e,"text/html");return Array.from(t.body.querySelectorAll("*")).reverse().forEach(e=>{const i=e.textContent||"";if("A"!==e.tagName)return void e.replaceWith(...e.childNodes);const n=e.getAttribute("href");if(!n||!Zl.test(n))return void e.replaceWith(t.createTextNode(i));const r=t.createElement("a");r.href=n,r.textContent=i,r.rel="noopener nofollow";const o=e.getAttribute("class");o&&(r.className=o),e.replaceWith(r)}),t.body.innerHTML}(e)).join(" | ");i!==this._attribHTML&&(this._attribHTML=i,e.length?(this._innerContainer.innerHTML=i,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 Wl{constructor(){e.aW(["_updateLogo","_updateCompact"],this)}onAdd(e){this._map=e,this._container=a("div","mapboxgl-ctrl");const t=a("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),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(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(const t in e){const i=e[t].getSource();if(Object.hasOwn(i,"mapbox_logo")&&!i.mapbox_logo)return!1}return!0}_updateCompact(){const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}}}class Yl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,i=t?this._queue.concat(t):this._queue;for(const t of i)if(t.id===e)return void(t.cancelled=!0)}run(e=0){const t=this._currentlyRunning=this._queue;this._queue=[];for(const i of t)if(!i.cancelled&&(i.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class Xl{constructor(e){this.jumpTo(e)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const i=e.b$((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-i)+this._end*i}isEasing(e){return e>=this._startTime&&e<=this._endTime}jumpTo(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}easeTo(e,t,i){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+i}}const Jl={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","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 â + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class Kl extends e.h{constructor(e,t,i,n){const{point:r,lngLat:o,originalEvent:s,target:a}=e;super(e.type,{point:r,lngLat:o,originalEvent:s,target:a}),this.preventDefault=()=>{e.preventDefault()},this.id=t,this.interaction=i,this.feature=n}}class Ql{constructor(e){this.map=e,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map}
vendor: 6,591 bytes, line 2
2add(t,i){if(this.typeById.has(t))throw new Error(`Interaction id "${t}" already exists.`);const n=i.filter;let r=i.type;n&&this.filters.set(t,e.bw(n)),"mouseover"===r&&(r="mouseenter"),"mouseout"===r&&(r="mouseleave");const o=this.interactionsByType.get(r)||new Map;"mouseenter"===r||"mouseleave"===r?(0===this.delegatedInteractions.size&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(t,i)):0===o.size&&this.map.on(r,this.handleType),0===o.size&&this.interactionsByType.set(r,o),o.set(t,i),this.typeById.set(t,r)}get(e){const t=this.typeById.get(e);if(!t)return;const i=this.interactionsByType.get(t);return i?i.get(e):void 0}remove(e){const t=this.typeById.get(e);if(!t)return;this.typeById.delete(e),this.filters.delete(e);const i=this.interactionsByType.get(t);i&&(i.delete(e),"mouseenter"===t||"mouseleave"===t?(this.delegatedInteractions.delete(e),0===this.delegatedInteractions.size&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):0===i.size&&this.map.off(t,this.handleType))}queryTargets(e,t){const i=[];for(const[e,n]of t)n.target&&i.push({targetId:e,target:n.target,filter:this.filters.get(e)});return this.map.style.queryRenderedTargets(e,i,this.map.transform)}handleMove(e){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const t=this.queryTargets(e.point,Array.from(this.delegatedInteractions).reverse());t.length&&(e.type="mouseenter",this.handleType(e,t));const i=new Map;for(const[e,{feature:t}]of this.prevHoveredFeatures)this.hoveredFeatures.has(e)||i.set(t.id,t);i.size&&(e.type="mouseleave",this.handleType(e,Array.from(i.values())))}handleOut(e){const t=Array.from(this.hoveredFeatures.values()).map(({feature:e})=>e);t.length&&(e.type="mouseleave",this.handleType(e,t)),this.hoveredFeatures.clear()}handleType(t,i){const n="mouseenter"===t.type;if(n&&!this.interactionsByType.has(t.type))return void e.w("mouseenter interaction required for mouseleave to work.");const r=Array.from(this.interactionsByType.get(t.type)).reverse(),o=!!i;i=i||this.queryTargets(t.point,r);let s=!1;const a=new Set;for(const l of i){for(const[i,c]of r){if(!c.target)continue;const r=l.variants?l.variants[i]:null;if(r){for(const u of r){if(Fo(u,l,a,i))continue;const r=new e.dP(l,u),h=zo(u,l,i);o&&void 0!==r.id&&(r.state=this.map.getFeatureState(r));const d=n?this.prevHoveredFeatures.get(h):null,f=new Kl(t,i,c,r),p=d?d.stop:c.handler(f);if(n&&this.hoveredFeatures.set(h,{feature:l,stop:p}),!1!==p){s=!0;break}}if(s)break}}if(s)break}if(!s)for(const[e,i]of r){const{handler:n,target:r}=i;if(!r&&!1!==n(new Kl(t,e,i,null)))break}}}function ec(t,i){if(Array.isArray(t)&&Array.isArray(i)){const e=new Set(t),n=new Set(i);return e.size===n.size&&t.every(e=>n.has(e))}return e.O(t,i)}const tc=/matrix.*\((.+)\)/,ic={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,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,fontstackCompositing:"client",transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1,emissiveColorPrecision:"approximate"},nc={showCompass:!0,showZoom:!0,visualizePitch:!1};class rc{constructor(t,i,n=!1){this._clickTolerance=10,this.element=i,this.mouseRotate=new ml({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,n&&(this.mousePitch=new _l({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.aW(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchmove",this.touchmove),i.addEventListener("touchend",this.touchend),i.addEventListener("touchcancel",this.reset)}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),d()}move(e,t){const i=this.map,n=this.mouseRotate.mousemoveWindow(e,t),r=n&&n.bearingDelta;if(r&&i.setBearing(i.getBearing()+r),this.mousePitch){const n=this.mousePitch.mousemoveWindow(e,t),r=n&&n.pitchDelta;r&&i.setPitch(i.getPitch()+r)}}off(){const e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){f(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(e){this.down({...e,button:e.button,type:e.type,ctrlKey:!0,preventDefault:()=>e.preventDefault()},_(this.element,e)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(e){this.move(e,_(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=g(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=g(this.element,e.targetTouches)[0],this.move({buttons:1,preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&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()}}function oc(t,i,n){if(t=new e.cZ(t.lng,t.lat),i){const r=new e.cZ(t.lng-360,t.lat),o=new e.cZ(t.lng+360,t.lat),s=360*Math.ceil(Math.abs(t.lng-n.center.lng)/360),a=n.locationPoint3D(t).distSqr(i),l=i.x<0||i.y<0||i.x>n.width||i.y>n.height;n.locationPoint3D(r).distSqr(i)<a&&(l||Math.abs(r.lng-n.center.lng)<s)?t=r:n.locationPoint3D(o).distSqr(i)<a&&(l||Math.abs(o.lng-n.center.lng)<s)&&(t=o)}for(;Math.abs(t.lng-n.center.lng)>180;){const e=n.locationPoint3D(t);
vendor: 4,897 bytes, line 2
2if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}const sc={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%)"},ac=/\s+/,lc={rotation:0,rotationAlignment:"auto",pitchAlignment:"auto",occludedOpacity:.2,altitude:0};class cc extends e.E{constructor(t,i){super(),(t instanceof HTMLElement||i)&&(t={element:t,...i}),e.aW(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this);const{anchor:n="center",color:r="#3FB1CE",scale:o=1,draggable:s=!1,clickTolerance:a=0,rotation:l=lc.rotation,rotationAlignment:c=lc.rotationAlignment,pitchAlignment:u=lc.pitchAlignment,occludedOpacity:h=lc.occludedOpacity,altitude:d=lc.altitude}=t||{};this._anchor=n,this._color=r,this._scale=o,this._draggable=s,this._clickTolerance=a,this._rotation=l,this._rotationAlignment=c,this._pitchAlignment=u,this._occludedOpacity=h,this._altitude=d,this._state="inactive",this._isDragging=!1,this._pointerEvents=null,this._updateMoving=()=>this._update(!0),t&&t.element?(this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0])):(this._defaultMarker=!0,this._element=this._createDefaultMarker(),this._offset=e.P.convert(t&&t.offset||[0,-14])),this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",e=>{e.preventDefault()}),this._element.addEventListener("mousedown",e=>{e.preventDefault()});const f=this._element.classList;for(const e in sc)f.remove(`mapboxgl-marker-anchor-${e}`);f.add(`mapboxgl-marker-anchor-${this._anchor}`),t&&t.className&&f.add(...t.className.trim().split(ac)),this._popup=null}_createDefaultMarker(){const e=a("div"),t=l("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},e);this._svgElement=t;const i=l("radialGradient",{id:"shadowGradient"},l("defs",{},t));l("stop",{offset:"10%","stop-opacity":.4},i),l("stop",{offset:"100%","stop-opacity":.05},i);const n=l("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"});return this._shadowElement=n,0===this._altitude&&t.insertBefore(n,t.firstChild),l("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"},t),l("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"},t),l("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},t),e}addTo(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}remove(){const e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.cZ.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}setAltitude(e){if(e===this._altitude)return this;const t=this._altitude;return this._altitude=e||lc.altitude,this._defaultMarker&&0===t!=(0===this._altitude)&&(0===this._altitude?this._svgElement.insertBefore(this._shadowElement,this._svgElement.firstChild):this._shadowElement.remove()),this._update(),this}getAltitude(){return this._altitude}getElement(){return this._element}setPopup(e){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")),e){if(!("offset"in e.options)){const t=38.1,i=13.5,n=Math.sqrt(Math.pow(i,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
vendor: 3,387 bytes, line 2
20,-t],"bottom-left":[n,-1*(t-i+n)],"bottom-right":[-n,-1*(t-i+n)],left:[i,-1*(t-i)],right:[-i,-1*(t-i)]}:this._offset}this._popup=e,e._marker=this,e._altitude=this._altitude,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(e){const t=e.code,i=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==i&&13!==i||this.togglePopup()}_onMapClick(e){const t=e.originalEvent.target,i=this._element;this._popup&&(t===i||i.contains(t))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const e=this._map,t=this._pos;if(!e||!t)return!1;const i=e.unproject(t,this._altitude),n=e.getFreeCameraOptions();if(!n.position)return!1;const r=n.position.toLngLat();return r.distanceTo(i)<.9*r.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const i=this._pos;if(!i||i.x<0||i.x>t.transform.width||i.y<0||i.y>t.transform.height)return void this._clearFadeTimer();const n=t.unproject(i,this._altitude);let r;t._showingGlobe()&&e.f9(t.transform,this._lngLat)?r=0:(r=1-t._queryFogOpacity(n),t.transform._terrainEnabled()&&t.style&&t.style.hasTerrain()&&this._behindTerrain()&&(r*=this._occludedOpacity)),this._element.style.opacity=`${r}`;const o=this._element.style.pointerEvents;(null===this._pointerEvents?""===o:o===this._pointerEvents)&&(this._pointerEvents=r>0?"auto":"none",this._element.style.pointerEvents=this._pointerEvents),this._popup&&this._popup._setOpacity(r),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const e=this._pos;if(!e||!this._map)return;const t=this._offset.mult(this._scale);this._element.style.transform=`\n translate(${e.x}px,${e.y}px)\n ${sc[this._anchor]}\n ${this._calculateXYTransform()} ${this._calculateZTransform()}\n translate(${t.x}px,${t.y}px)\n `}_calculateXYTransform(){const t=this._pos,i=this._map,n=this.getPitchAlignment();if(!i||!t||"map"!==n)return"";if(!i._showingGlobe()){const e=i.getPitch();return e?`rotateX(${e}deg)`:""}const r=e.fa(e.fb(i.transform,this._lngLat)),o=t.sub(e.fc(i.transform)),s=Math.abs(o.x)+Math.abs(o.y);if(0===s)return"";const a=r/s;return`rotateX(${-o.y*a}deg) rotateY(${o.x*a}deg)`}_calculateZTransform(){const t=this._pos,i=this._map;if(!i||!t)return"";let n=0;const r=this.getRotationAlignment();if("map"===r)if(i._showingGlobe()){const t=i.project(new e.cZ(this._lngLat.lng,this._lngLat.lat+.001),this._altitude),r=i.project(new e.cZ(this._lngLat.lng,this._lngLat.lat-.001),this._altitude).sub(t);n=e.fa(Math.atan2(r.y,r.x))-90}else n=-i.getBearing();else if("horizon"===r){const r=e.an(4,6,i.getZoom()),o=e.fc(i.transform);o.y+=r*i.transform.height;const s=t.sub(o),a=e.fa(Math.atan2(s.y,s.x));n=(a>90?a-270:a+90)*(1-r)}return n+=this._rotation,n?`rotateZ(${n}deg)`:""}_update(e){cancelAnimationFrame(this._updateFrameId);const t=this._map;
vendor: 13,872 bytes, line 2
2t&&(t.transform.renderWorldCopies&&(this._lngLat=oc(this._lngLat,this._pos,t.transform)),this._pos=t.project(this._lngLat,this._altitude),!0===e?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),t._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(t._showingGlobe()||t.style&&t.style.hasTerrain()||t.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(e){return this._element.classList.add(e),this}removeClassName(e){return this._element.classList.remove(e),this}toggleClassName(e){return this._element.classList.toggle(e)}_onMove(t){const i=this._map;if(!i)return;const n=this._pointerdownPos,r=this._positionDelta;if(n&&r){if(!this._isDragging){const e=this._clickTolerance||i._clickTolerance;if(t.point.dist(n)<e)return;this._isDragging=!0}this._pos=t.point.sub(r),this._lngLat=i.unproject(this._pos,this._altitude),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.h("dragstart"))),this.fire(new e.h("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const t=this._map;t&&(t.off("mousemove",this._onMove),t.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new e.h("dragend")),this._state="inactive"}_addDragHandler(e){const t=this._map,i=this._pos;t&&i&&this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(i),this._pointerdownPos=e.point,this._state="pending",t.on("mousemove",this._onMove),t.on("touchmove",this._onMove),t.once("mouseup",this._onUp),t.once("touchend",this._onUp))}setDraggable(e){this._draggable=!!e;const t=this._map;return t&&(e?(t.on("mousedown",this._addDragHandler),t.on("touchstart",this._addDragHandler)):(t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||lc.rotation,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||lc.rotationAlignment,this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e||lc.pitchAlignment,this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(e){return this._occludedOpacity=e||lc.occludedOpacity,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const uc={OFF:[],WAITING_ACTIVE:["waiting","active"],ACTIVE_LOCK:["active"],ACTIVE_ERROR:["waiting","active-error"],BACKGROUND:["background"],BACKGROUND_ERROR:["waiting","background-error"]},hc=e=>`mapboxgl-ctrl-geolocate-${e}`,dc=["waiting","active","active-error","background","background-error"].map(hc),fc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1,showButton:!0,followUserLocation:!0},pc={maxWidth:100,unit:"metric"},mc={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},_c=/\s+/,gc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",altitude:0},yc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function vc(t=new e.P(0,0),i="bottom"){if("number"==typeof t){const n=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(i){case"top":return new e.P(0,t);case"top-left":return new e.P(n,n);case"top-right":return new e.P(-n,n);case"bottom":return new e.P(0,-t);case"bottom-left":return new e.P(n,-n);case"bottom-right":return new e.P(-n,-n);case"left":return new e.P(t,0);case"right":return new e.P(-t,0)}return new e.P(0,0)}return t instanceof e.P||Array.isArray(t)?e.P.convert(t):e.P.convert(t[i]||[0,0])}const xc="undefined"!=typeof document?document.currentScript:null;e.fd(xc&&xc.src&&e.fe(xc.src)?"cdn":"other");const bc={version:e.f8,supported:function(e){return!function(e){return"undefined"!=typeof window&&"undefined"!=typeof document?Object.hasOwn?"undefined"==typeof Worker?"Web Workers not supported":function(){const e=document.createElement("canvas");e.width=e.height=1;const t=e.getContext("2d");return!!t&&t.getImageData(0,0,1,1).width===e.width}()?function(e){return e?(void 0===n&&(n=r(!0)),n):(void 0===i&&(i=r(!1)),i)}(e)?"":"insufficient WebGL2 support":"insufficient Canvas/getImageData support":"Object.hasOwn not supported":"not a browser"}(e)},setRTLTextPlugin:e.fj,getRTLTextPluginStatus:e.fi,setSdkInfo:e.fh,addTileProvider:e.fg,Map:class extends Hl{constructor(t){e.eT.mark(e.eU.create);const i=t;if(null!=(t={...ic,...t}).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");super(new e.eV(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies,null,null),t),this._animationFrameProvider=t.animationFrameProvider,this._repaint=!!t.repaint,this._interactive=t.interactive,this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._placementAlgorithm=t.placementAlgorithm||"default",this._isInitialLoad=!0,this._crossSourceCollisions=t.crossSourceCollisions,this._collectResourceTiming=t.collectResourceTiming,this._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new Yl,this._domRenderTaskQueue=new Yl,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.aw(),this._locale={...Jl,...t.locale},this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._tessellationStep=t.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=t.precompilePrograms,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new Xl(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._emissiveColorPrecision=t.emissiveColorPrecision,this._scaleFactor=t.scaleFactor,this._requestManager=new e.eW(t.transformRequest,t.accessToken,t.testMode);const n=e.eX(t.accessToken||e.eS.ACCESS_TOKEN);if(n&&"atlas"in n&&"number"==typeof n.atlas&&(this._tokenExpiration=n.atlas),this._silenceAuthErrors=!!t.testMode,this._contextCreateOptions=t.contextCreateOptions?{...t.contextCreateOptions}:{},"string"==typeof t.container){const e=document.getElementById(t.container);if(!e)throw new Error(`Container '${t.container.toString()}' not found.`);this._container=e}else{if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(this._container.childNodes.length>0&&e.w("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."),t.maxBounds&&this.setMaxBounds(t.maxBounds),this._spriteFormat="auto",e.aW(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new Gl(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,this._fontstackCompositing=t.fontstackCompositing,(t.style||!t.testMode)&&this.setStyle(t.style||e.eS.DEFAULT_STYLE,{config:t.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily,fontstackCompositing:this._fontstackCompositing}),t.projection&&this.setProjection(t.projection),t.hash&&(this._hash=new Ga("string"==typeof t.hash&&t.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==i.center&&null==i.zoom||(this.transform._unmodified=!1),this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});const e=t.bounds;e&&(this.resize(),this.fitBounds(e,{...t.fitBoundsOptions,duration:0}))}this.resize(),t.attributionControl&&this.addControl(new ql({customAttribution:t.customAttribution})),this._logoControl=new Wl,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent(),this._postStyleWithAppearanceEvent()}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new e.h(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new e.h(`${t.dataType}dataloading`,t))}),this._interactions=new Ql(this)}_getMapId(){return this._mapId}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.f(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=t.onAdd(this);this._controls.push(t);const r=this._controlPositions[i];return i.includes("bottom")?r.insertBefore(n,r.firstChild):r.appendChild(n),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.f(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(e){return this._controls.includes(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const i=!this._moving;return i&&this.fire(new e.h("movestart",t)).fire(new e.h("move",t)),this.fire(new e.h("resize",t)),i&&this.fire(new e.h("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(e.eI.convert(t)),this._update()}setMinZoom(t){if((t=t??-2)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t?this.setZoom(t):this.fire(new e.h("zoomstart")).fire(new e.h("zoom")).fire(new e.h("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=t??22)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t?this.setZoom(t):this.fire(new e.h("zoomstart")).fire(new e.h("zoom")).fire(new e.h("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=t??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t?this.setPitch(t):this.fire(new e.h("pitchstart")).fire(new e.h("pitch")).fire(new e.h("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=t??85)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t?this.setPitch(t):this.fire(new e.h("pitchstart")).fire(new e.h("pitch")).fire(new e.h("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(e){return this._scaleFactor=e,this.painter.scaleFactor=e,this.style&&this.style._setLabelPlacementStale(),this.style._updateFilteredLayers(e=>"symbol"===e.type),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMar
vendor: 4,967 bytes, line 2
2kerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(e){return"auto"===e?navigator.language:Array.isArray(e)?0===e.length?void 0:e.map(e=>"auto"===e?navigator.language:e):e}setLanguage(e){const t=this._parseLanguage(e);if(!this.style||t===this._language)return this;this._language=t,this.style.reloadSources();for(const e of this._controls)e._setLanguage&&e._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(e){return this.style&&e!==this._worldview?(this._worldview=e,this._styleDirty=!0,this.style.setWorldview(e),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.projection)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,i=t.projection.name;let n;"globe"===i&&t.zoom>=e.b2?(t.setMercatorFromTransition(),n=!0):"mercator"===i&&t.zoom<e.b2&&(t.setProjection({name:"globe"}),n=!0),n&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate(),this._update(!0))}_prioritizeAndUpdateProjection(e,t){return this._updateProjection(e||t||{name:"mercator"})}_updateProjection(t){let i;const n=this.transform.mercatorFromTransition;i="globe"===t.name&&this.transform.zoom>=e.b2?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate();const r="mercator"===this.transform.getProjection().name&&n!==this.transform.mercatorFromTransition;return(i||r)&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(t,i){return this.transform.locationPoint3D(e.cZ.convert(t),i)}unproject(t,i){return this.transform.pointLocation3D(e.P.convert(t),i)}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(e,t,i){const n=e=>{let i=[];if(Array.isArray(t)){const n=t.filter(e=>this.getLayer(e));i=n.length?this.queryRenderedFeatures(e,{layers:n}):[]}else i=this.queryRenderedFeatures(e,{target:t});return i};if("mouseenter"===e||"mouseover"===e){let r=!1;const o=t=>{const o=n(t.point);o.length?r||(r=!0,i.call(this,new Qa(e,this,t.originalEvent,{features:o}))):r=!1};return{listener:i,targets:t,delegates:{mousemove:o,mouseout:()=>{r=!1}}}}if("mouseleave"===e||"mouseout"===e){let r=!1;const o=t=>{n(t.point).length?r=!0:r&&(r=!1,i.call(this,new Qa(e,this,t.originalEvent)))},s=t=>{r&&(r=!1,i.call(this,new Qa(e,this,t.originalEvent)))};return{listener:i,targets:t,delegates:{mousemove:o,mouseout:s}}}{const r=e=>{const t=n(e.point);t.length&&(e.features=t,i.call(this,e),delete e.features)};return{listener:i,targets:t,delegates:{[e]:r}}}}on(e,t,i){if("function"==typeof t||void 0===i)return super.on(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._createDelegatedListener(e,t,i);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(n);for(const e in n.delegates)this.on(e,n.delegates[e]);return this}once(e,t,i){if("function"==typeof t||void 0===i)return super.once(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._createDelegatedListener(e,t,i);for(const e in n.delegates)this.once(e,n.delegates[e]);return this}off(e,t,i){if("function"==typeof t||void 0===i)return super.off(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const n=this._delegatedListeners?this._delegatedListeners[e]:void 0;return n&&(e=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.listener===i&&ec(r.targets,t)){for(const e in r.delegates)this.off(e,r.delegates[e]);return e.splice(n,1),this}}})(n),this}queryRenderedFeatures(t,i){if(!this.style)return[];if(void 0===t||t instanceof e.P||Array.isArray(t)||void 0!==i||(i=t,t=void 0),t=t||[[0,0],[this.transform.width,this.transform.height]],!i){const e=this.style.queryRenderedFeatures(t,void 0,this.transform),i=this.style.queryRenderedFeatureset(t,void 0,this.transform);return e.concat(i)}let n=!0;if(i.target&&(n=this._isTargetValid(i.target),n&&!i.layers))return this.style.queryRenderedFeatureset(t,i,this.transform);let r=!0;if(i.layers&&Array.isArray(i.layers)){for(const e of i.layers)if(!this._isValidId(e)){r=!1;break}if(r&&!i.target)return this.style.queryRenderedFeatures(t,i,this.transform)}let o=[];return r&&(o=o.concat(this.style.queryRenderedFeatures(t,i,this.transform))),n&&(o=o.c
vendor: 10,592 bytes, line 2
2oncat(this.style.queryRenderedFeatureset(t,i,this.transform))),o}querySourceFeatures(e,t){return!e||"string"==typeof e&&!this._isValidId(e)?[]:this.style.querySourceFeatures(e,t)}queryRasterValue(e,t,i){return this._isValidId(e)?this.style.queryRasterValue(e,t,i):Promise.resolve(null)}isPointOnSurface(t){const{name:i}=this.transform.projection;return"globe"!==i&&"mercator"!==i&&e.w(`${i} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(e.P.convert(t))}addInteraction(e,t){return this._interactions.add(e,t),this}removeInteraction(e){return this._interactions.remove(e),this}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(e){return this._cooperativeGestures=e,this}setStyle(t,i){return i={localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily,fontstackCompositing:this._fontstackCompositing,...i},this.style&&t&&!1!==i.diff&&i.localFontFamily===this._localFontFamily&&i.localIdeographFontFamily===this._localIdeographFontFamily&&i.fontstackCompositing===this._fontstackCompositing&&!i.config?(this.style._diffStyle(t,(n,r)=>{if(n){const r="string"==typeof n?n:n instanceof Error?n.message:n.error;e.w(`Unable to perform style diff: ${r}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}else r&&this._update(!0)},()=>this._postStyleLoadEvent()),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._fontstackCompositing=i.fontstackCompositing,this._updateStyle(t,i))}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),e){const i={...t};t&&t.config&&(i.initialConfig=t.config,delete i.config),this.style=new Zs(this,i).load(e),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Zs(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.w("There is no style added to the map."),!1)}_isValidId(t){return null==t?(this.fire(new e.f(new Error("IDs can't be empty."))),!1):e.dI(t)?(this.fire(new e.f(new Error(`IDs can't contain special symbols: "${t}".`))),!1):"__proto__"!==t&&"constructor"!==t&&"prototype"!==t||(this.fire(new e.f(new Error(`IDs can't be "${t}".`))),!1)}_isTargetValid(e){return"featuresetId"in e?this._isValidId("importId"in e?e.importId:e.featuresetId):"layerId"in e&&this._isValidId(e.layerId)}_areTargetsValid(e){if(Array.isArray(e)){for(const t of e)if(!this._isValidId(t))return!1;return!0}return this._isTargetValid(e)}addSource(e,t){return this._isValidId(e)?(this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)):this}isSourceLoaded(e){return!!this._isValidId(e)&&!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){return this.style.areTilesLoaded()}removeSource(e){return this._isValidId(e)?(this.style.removeSource(e),this._updateTerrain(),this._update(!0)):this}getSource(e){return this._isValidId(e)?this.style.getOwnSource(e):null}addImage(t,i,{pixelRatio:n=1,sdf:r=!1,stretchX:o,stretchY:s,content:a}={}){this._lazyInitEmptyStyle();const l=e.I.from(t);if(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap){const{width:t,height:c,data:u}=e.e.getImageData(i);this.style.addImage(l,{data:new e.b({width:t,height:c},u),pixelRatio:n,stretchX:o,stretchY:s,content:a,sdf:r,version:0,usvg:!1})}else if(void 0===i.width||void 0===i.height)this.fire(new e.f(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:c,height:u}=i,h=i;this.style.addImage(l,{data:new e.b({width:c,height:u},new Uint8Array(h.data)),pixelRatio:n,stretchX:o,stretchY:s,content:a,sdf:r,usvg:!1,version:0,userImage:h}),h.onAdd&&h.onAdd(this,t)}}updateImage(t,i){this._lazyInitEmptyStyle();const n=e.I.from(t),r=this.style.getImage(n);if(!r)return void this.fire(new e.f(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const o=i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap?e.e.getImageData(i):i,{width:s,height:a,data:l}=o;if(void 0===s||void 0===a)return void this.fire(new e.f(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(s!==(r.usvg?r.icon.usvg_tree.width:r.data.width)||a!==(r.usvg?r.icon.usvg_tree.height:r.data.height))return void this.fire(new e.f(new Error(`The width and height of the updated image (${s}, ${a})\n must be that same as the previous version of the image\n (${r.data.width}, ${r.data.height})`)));const c=!(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap);let u=!1;r.usvg?(r.data=new e.b({width:s,height:a},new Uint8Array(l)),r.usvg=!1,r.icon=void 0,u=!0):r.data.replace(l,c),this.style.updateImage(n,r,u)}hasImage(t){return t?!!this.style&&!!this.style.getImage(e.I.from(t)):(this.fire(new e.f(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(e.I.from(t))}loadImage(t,i){(async()=>{const i=await this._requestManager.transformRequest(t,e.R.Image),{data:n}=await e.a(i);return n})().then(e=>i(null,e)).catch(i)}listImages(){return this.style.listImages().map(e=>e.name)}addModel(e,t){this._lazyInitEmptyStyle(),this.style.addModel(e,t)}hasModel(t){return t?this.style.hasModel(t):(this.fire(new e.f(new Error("Missing required model id"))),!1)}removeModel(e){this.style.removeModel(e)}listModels(){return this.style.listModels()}addLayer(e,t){return this._isValidId(e.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)):this}getSlot(e){const t=this.getLayer(e);return t&&t.slot||null}setSlot(e,t){return this.style.setSlot(e,t),this.style.mergeLayers(),this._update(!0)}addImport(t,i){return this._isValidId(t.id)?(this.style.addImport(t,i).catch(t=>this.fire(new e.f(new Error("Failed to add import",t)))),this):this}updateImport(e,t){return"string"!=typeof t&&t.id!==e?(this.removeImport(e),this.addImport(t)):(this.style.updateImport(e,t),this._update(!0))}removeImport(e){return this.style.removeImport(e),this}moveImport(e,t){return this.style.moveImport(e,t),this._update(!0)}moveLayer(e,t){return this._isValidId(e)?(this.style.moveLayer(e,t),this._update(!0)):this}removeLayer(e){return this._isValidId(e)?(this.style.removeLayer(e),this._update(!0)):this}getLayer(e){if(!this._isValidId(e))return null;const t=this.style.getOwnLayer(e);return t?"custom"===t.type?t.implementation:t.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(e,t,i){return this._isValidId(e)?(this.style.setLayerZoomRange(e,t,i),this._update(!0)):this}setFilter(e,t,i={}){return this._isValidId(e)?(this.style.setFilter(e,t,i),this._update(!0)):this}getFilter(e){return this._isValidId(e)?this.style.getFilter(e):null}setPaintProperty(e,t,i,n={}){return this._isValidId(e)?(this.style.setPaintProperty(e,t,i,n),this._update(!0)):this}getPaintProperty(e,t){return this._isValidId(e)?this.style.getPaintProperty(e,t):null}setLayoutProperty(e,t,i,n={}){return this._isValidId(e)?(this.style.setLayoutProperty(e,t,i,n),this._update(!0)):this}getLayoutProperty(e,t){return this._isValidId(e)?this.style.getLayoutProperty(e,t):null}getLayerProperty(e,t){return this._isValidId(e)?this.style.getLayerProperty(e,t):null}setLayerProperty(e,t,i,n={}){return this._isValidId(e)?("appearances"===t&&this._postAddingAppearancesToStyleEvent(),this.style.setLayerProperty(e,t,i,n),this._update(!0)):this}getGlyphsUrl(){return this.style.getGlyphsUrl()}setGlyphsUrl(e){return this.style.setGlyphsUrl(e),this._update(!0)}getSchema(e){return this.style.getSchema(e)}setSchema(e,t){return this.style.setSchema(e,t),this._update(!0)}getConfig(e){return this.style.getConfig(e)}setConfig(e,t){return this.style.setConfig(e,t),this._update(!0)}getConfigProperty(e,t){return this.style.getConfigProperty(e,t)}setConfigProperty(e,t,i){return this.style.setConfigProperty(e,t,i),this._update(!0)}getFeaturesetDescriptors(e){return this.style.getFeaturesetDescriptors(e)}setLights(e){if(this._lazyInitEmptyStyle(),e&&1===e.length&&"flat"===e[0].type){const t=e[0];t.properties?this.style.setFlatLight(t.properties,t.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(e),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const e=this.style.getLights()||[];return 0===e.length&&e.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),e}setLight(e,t={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:e}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(e){return this._lazyInitEmptyStyle(),this.style.setSnow(e),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(e){return this._lazyInitEmptyStyle(),this.style.setRain(e),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(e){return this._lazyInitEmptyStyle(),this.style.setColorTheme(e),this._update(!0)}setImportColorTheme(e,t){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(e,t),this._update(!0)}setCamera(e){return this.style.setCamera(e),this._triggerCameraUpdate(e)}getNearClipOffset(){return this.transform.nearClipOffset}setNearClipOffset(e){const t=this.transform.nearClipOffset!==e;return this.transform.nearClipOffset=e,this._update(t)}_triggerCameraUpdate(e){return this._update(this.transform.setOrthogra
vendor: 5,729 bytes, line 2
2phicProjectionAtLowPitch("orthographic"===e["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.cZ.convert(t),this.transform):0}setFeatureState(e,t){return e.source&&!this._isValidId(e.source)?this:(this.style.setFeatureState(e,t),this._update())}removeFeatureState(e,t){return e.source&&!this._isValidId(e.source)?this:(this.style.removeFeatureState(e,t),this._update())}getFeatureState(e){return e.source&&!this._isValidId(e.source)?null:this.style.getFeatureState(e)}resetFeatureStates(e){return this.style.resetFeatureStates(e),this._update()}_selectIndoorFloor(e){this.style.indoorManager&&this.style.indoorManager.selectFloor(e)}_setIndoorActiveFloorsVisibility(e){this.style.indoorManager&&this.style.indoorManager.setActiveFloorsVisibility(e)}getIndoorTileOptions(e,t){return this.style&&this.style.isIndoorEnabled()&&this.style.indoorManager?this.style.indoorManager.getIndoorTileOptions(e,t):null}_updateContainerDimensions(){if(!this._container)return;const e=this._container.getBoundingClientRect().width||400,t=this._container.getBoundingClientRect().height||300;let i,n,r,o=this._container;for(;o&&(!n||!r);){const e=window.getComputedStyle(o).transform;e&&"none"!==e&&(i=e.match(tc)[1].split(", "),i[0]&&"0"!==i[0]&&"1"!==i[0]&&(n=i[0]),i[3]&&"0"!==i[3]&&"1"!==i[3]&&(r=i[3])),o=o.parentElement}this._containerWidth=n?Math.abs(e/n):e,this._containerHeight=r?Math.abs(t/r):t}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=a("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=a("div","mapboxgl-canvas-container",e);this._canvas=a("canvas","mapboxgl-canvas",t),this._interactive&&(t.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const i=this._controlContainer=a("div","mapboxgl-control-container",e),n=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(e=>{n[e]=a("div",`mapboxgl-ctrl-${e}`,i)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,i){const n=e.e.devicePixelRatio||1;this._canvas.width=n*Math.ceil(t),this._canvas.height=n*Math.ceil(i),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${i}px`}_addMarker(e){this._markers.push(e)}_removeMarker(e){const t=this._markers.indexOf(e);-1!==t&&this._markers.splice(t,1)}_addPopup(e){this._popups.push(e)}_removePopup(e){const t=this._popups.indexOf(e);-1!==t&&this._popups.splice(t,1)}_setupPainter(){const i={...t,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},n=this._canvas.getContext("webgl2",i);n?(e.eY(n,!0),this.painter=new Va(n,this._contextCreateOptions,this.transform,this._scaleFactor,this._worldview,this._emissiveColorPrecision),this.on("data",e=>{if("source"===e.dataType){const t=this.transform.elevation?this.transform.elevation._source():null;t&&e.sourceCacheId===t.id&&this.style&&this.style._setLabelPlacementStale(),this.style&&e.sourceCacheId&&this.style._buildingIndex.hasLayerForSourceCache(e.sourceCacheId)&&this.style._requestFullLabelPlacement(),this.painter.setTileLoadedFlag(!0)}})):this.fire(new e.f(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.style&&this.style.handleContextLost(),this.fire(new e.h("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style&&(this.style.clearLayers(),this.style.imageManager.destroyAtlasTextures(),this.style.imageManager.imageAtlasCache.destroyTextures(),this.style.reloadModels(),this.style.clearSources()),this._update(),this.fire(new e.h("webglcontextrestored",{originalEvent:t}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_requestDomTask(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}_render(t){let i;this.fire(new e.h("renderstart")),++this._frameId;const n=this.painter.context.extTimerQuery,r=e.e.now(),o=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(i=o.createQuery(),o.beginQuery(n.TIME_ELAPSED_EXT,i)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&
vendor: 12,891 bytes, line 2
2(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const s=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,i=this.transform.pitch,n=e.e.now(),r=new e.aj(t,{now:n,fadeDuration:s,pitch:i,transition:this._loaded?this.style.transition:{duration:0,delay:0},worldview:this._worldview});this.style.update(r)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let a=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),a=this._updateAverageElevation(r),this.style.updateSources(this.transform),this.style.updateImageProviders(),this.isMoving()||this._forceMarkerAndPopupUpdate()):a=this._updateAverageElevation(r),this.style&&(this._placementDirty=this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,s,this._crossSourceCollisions,this.painter.replacementSource,this._placementAlgorithm)),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming,paintStartTimeStamp:t}),this.fire(new e.h("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.eT.mark(e.eU.load),this.fire(new e.h("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&this.style.imageManager.hasPatternsInFlight()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),i){const t=e.e.now()-r;o.endQuery(n.TIME_ELAPSED_EXT),setTimeout(()=>{const n=o.getQueryParameter(i,o.QUERY_RESULT)/1e6;o.deleteQuery(i),this.fire(new e.h("gpu-timing-frame",{cpuTime:t,gpuTime:n}))},50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout(()=>{const i=this.painter.queryGpuTimers(t);this.fire(new e.h("gpu-timing-layer",{layerTimes:i}))},50)}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const i=this.painter.queryGpuTimeDeferredRender(t);this.fire(new e.h("gpu-timing-deferred-render",{gpuTime:i}))},50)}const l=this._sourcesDirty||this._styleDirty||this._placementDirty||a;if(l||this._repaint)this.triggerRepaint();else{const t=this.idle();if(t&&(a=this._updateAverageElevation(r,!0)),a)this.triggerRepaint();else{if(this._triggerFrame(!1),t&&(this.fire(new e.h("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new e.h("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1}t&&this.style&&this.style.handleIdle()}}!this._loaded||this._fullyLoaded||l||(this._fullyLoaded=!0,e.eT.mark(e.eU.fullLoad),this._performanceMetricsCollection&&e.eZ(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:this.painter.style.hasTerrain(),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(e){for(const t of this._markers)e&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!e||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(e,t=!1){const i=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);const n=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(n||(t||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){const t=this.transform.averageElevation;let r=this.transform.sampleAverageElevation();null!=this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(r)?r=0:this._averageElevationLastSampledAt=e;const o=Math.abs(t-r);if(o>1){if(this._isInitialLoad||n)return this._averageElevation.jumpTo(r),i(r);this._averageElevation.easeTo(r,e,300)}else if(o>1e-4)return this._averageElevation.jumpTo(r),i(r)}return!!this._averageElevation.isEasing(e)&&i(this._averageElevation.getValue(e))}_isTokenExpired(){return null!=this._tokenExpiration&&Date.now()>this._tokenExpiration}_revokeAuth(){const t=this.painter.context.gl;e.eY(t,!1),this._logoControl instanceof Wl&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.f(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/")))}_authenticate(){e.e_(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,t=>{t&&(t.message!==e.e$&&401!==t.status||this._revokeAuth())}),this._isTokenExpired()&&this._revokeAuth(),e.f0(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&e.f1(this._requestManager._customAccessToken,{map:this,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_postStyleWithAppearanceEvent(){this.style.globalId&&this.style.hasAppearances()&&e.f2(this._requestManager._customAccessToken)}_postAddingAppearancesToStyleEvent(){e.f3(this._requestManager._customAccessToken)}_updateTerrain(){const e=this._isDragging();this.painter.updateTerrain(this.style,e)}_calculateSpeedIndex(){const e=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const i=this.painter.context.gl,n=i.createFramebuffer();function r(e){i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0);const t=new Uint8Array(i.drawingBufferWidth*i.drawingBufferHeight*4);return i.readPixels(0,0,i.drawingBufferWidth,i.drawingBufferHeight,i.RGBA,i.UNSIGNED_BYTE,t),t}return i.bindFramebuffer(i.FRAMEBUFFER,n),this._canvasPixelComparison(r(e),t.canvasCopies.map(r),t.timeStamps)}_canvasPixelComparison(e,t,i){let n=i[1]-i[0];const r=e.length/4;for(let o=0;o<t.length;o++){const s=t[o];let a=0;for(let t=0;t<s.length;t+=4)s[t]===e[t]&&s[t+1]===e[t+1]&&s[t+2]===e[t+2]&&s[t+3]===e[t+3]&&(a+=1);n+=(i[o+2]-i[o+1])*(1-a/r)}return n}remove(){if(this._removed)return;this._hash&&this._hash.remove();for(const e of this._controls)e.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),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),window.removeEventListener("visibilitychange",this._onVisibilityChange,!1);const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.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),e.f4(this.painter.context.gl),e.f5.remove(),e.f6.remove(),this._removed=!0,this.fire(new e.h("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(t){if(this._renderNextFrame=this._renderNextFrame||t,!this.style||this._frame)return;const i=this._animationFrameProvider;if(!i)return void(this._frame=e.e.frame(e=>{const t=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,t&&this._render(e)}));const n=e=>{const t=!!this._renderNextFrame;this._renderNextFrame=null;try{t&&this._render(e)}finally{this._frame=null}t&&!this._removed&&Promise.resolve().then(()=>this._triggerFrame(!1))};let r=null;this._frame={cancel:()=>{null!==r&&i.cancelAnimationFrame(r)}};try{r=i.requestAnimationFrame(n)}catch(e){throw this._frame=null,e}}_preloadTiles(t){const i=this.style?this.style.getSourceCaches():[];return e.bU(i,(e,i)=>e._preloadTiles(t,i),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,e&&vt(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(e){this._showParseStatus!==e&&(this._showParseStatus=e,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(e){this._showLayers2DWireframe!==e&&(this._showLayers2DWireframe=e,this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(e){this._showLayers3DWireframe!==e&&(this._showLayers3DWireframe=e,this._update())}get showElevationIdDebug(){return!!this.painter&&this.painter._debugParams.showElevationIdDebug}set showElevationIdDebug(e){this.painter&&this.painter._debugParams.showElevationIdDebug!==e&&(this.painter._debugParams.showElevationIdDebug=e,this.style&&e?this.style._reloadSources():this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(e){this._speedIndexTiming!==e&&(this._speedIndexTiming=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,e&&vt(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e&&vt(),this.style&&e?this.style._reloadSources():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(e){this._showTileAABBs!==e&&(this._showTileAABBs=e,e&&this._update())}_setCacheLimits(t,i){e.f7(t,i)}get version(){return e.f8}},NavigationControl:class{constructor(t={}){this.options={...nc,...t},this._container=a("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(e.aW(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",e=>{this._map&&this._map.zoomIn({},{originalEvent:e})}),a("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",e=>{this._map&&this._map.zoomOut({},{originalEvent:e})}),a("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.aW(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",e=>{const t=this._map;t&&(this.options.visualizePitch?t.resetNorthPitch({},{originalEvent:e}):t.resetNorth({},{originalEvent:e}))}),this._compassIcon=a("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const e=this._map;if(!e)return;
vendor: 4,105 bytes, line 2
2const t=e.getZoom(),i=t===e.getMaxZoom(),n=t===e.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const e=this._map;if(!e)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(e.transform.pitch*(Math.PI/180)),.5)}) rotateX(${e.transform.pitch}deg) rotateZ(${e.transform.angle*(180/Math.PI)}deg)`:`rotate(${e.transform.angle*(180/Math.PI)}deg)`;e._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=t)})}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),e.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&e.on("pitch",this._rotateCompassArrow),e.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new rc(e,this._compass,this.options.visualizePitch)),this._container}onRemove(){const e=this._map;e&&(this._container.remove(),this.options.showZoom&&e.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&e.off("pitch",this._rotateCompassArrow),e.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(e,t){const i=a("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}_setButtonTitle(e,t){if(!this._map)return;const i=this._map._getUIString(`NavigationControl.${t}`);e.setAttribute("aria-label",i),e.firstElementChild&&e.firstElementChild.setAttribute("title",i)}},GeolocateControl:class extends e.E{constructor(t={}){super();const i=navigator.geolocation;this.options={geolocation:i,...fc,...t},e.aW(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Ua(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(e){return this._map=e,this._container=a("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._clearRequestTimeout(),void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(e){const t=(t=!!this.options.geolocation)=>{this._supportsGeolocation=t,e(t)};void 0!==this._supportsGeolocation?e(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(e=>t("denied"!==e.state)).catch(()=>t()):t()}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),i=e.coords;return!!t&&(i.longitude<t.getWest()||i.longitude>t.getEast()||i.latitude<t.getSouth()||i.latitude>t.getNorth())}_setWatchState(e){this._watchState=e;const t=this._geolocateButton.classList;t.remove(...dc);for(const i of uc[e])t.add(hc(i))}_setButtonTitle(e){const t=this._map._getUIString(e);this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":this._setWatchState("ACTIVE_ERROR");break;case"BACKGROUND":this._setWatchState("BACKGROUND_ERROR")}}_onSuccess(t){if(this._map){if(this._clearRequestTimeout(),this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.h("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this._lastKnownPosition=t,this.options.trackUserLocation)switch(this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
2RROR":this._setWatchState(this.options.followUserLocation?"ACTIVE_LOCK":"BACKGROUND");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._setWatchState("BACKGROUND")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.followUserLocation&&(!this.options.trackUserLocation||"ACTIVE_LOCK"===this._watchState)&&this._updateCamera(t),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.h("geolocate",{coords:t.coords,timestamp:t.timestamp,...t.toJSON?{toJSON:t.toJSON.bind(t)}:{}})),this._finish()}}_updateCamera(t){const i=new e.cZ(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,r={bearing:this._map.getBearing(),...this.options.fitBoundsOptions};this._map.fitBounds(i.toBounds(n),r,{geolocateSource:!0})}_updateMarker(t){if(t){const i=new e.cZ(t.coords.longitude,t.coords.latitude);this.options.showAccuracyCircle?this._accuracyCircleMarker.setLngLat(i).addTo(this._map):this._accuracyCircleMarker.remove(),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map.transform,i=e.c4(1,t._center.lat)*t.worldSize,n=Math.ceil(2*this._accuracy*i);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(t){if(this._map){if(this._clearRequestTimeout(),this.options.trackUserLocation)if(1===t.code)this._setWatchState("OFF"),this._geolocateButton.disabled=!0,this._setButtonTitle("GeolocateControl.LocationNotAvailable"),void 0!==this._geolocationWatchID&&this._clearWatch();else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.h("error",{code:t.code,message:t.message,PERMISSION_DENIED:t.PERMISSION_DENIED,POSITION_UNAVAILABLE:t.POSITION_UNAVAILABLE,TIMEOUT:t.TIMEOUT})),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_startRequestTimeout(){this._clearRequestTimeout();const e=this.options.positionOptions.timeout;e&&(this._requestTimeoutId=window.setTimeout(()=>{this._onError({code:3,message:"Geolocation request timed out"})},e))}_clearRequestTimeout(){void 0!==this._requestTimeoutId&&(clearTimeout(this._requestTimeoutId),this._requestTimeoutId=void 0)}_setupUI(t){void 0!==this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=a("button","mapboxgl-ctrl-geolocate",this._container),a("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t?(e.w("Geolocation support is not available so the GeolocateControl will be disabled."),this._geolocateButton.disabled=!0,this._setButtonTitle("GeolocateControl.LocationNotAvailable")):this._setButtonTitle("GeolocateControl.FindMyLocation"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._createUserLocationMarkers(),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.showButton||(this._container.style.display="none"),this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._setWatchState("BACKGROUND"),this.fire(new e.h("trackuserlocationend")))}),this.fire(new e.h("ready")))}_onDeviceOrientation(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._setWatchState("WAITING_ACTIVE"),this.fire(new e.h("trackuserlocationstart"));break;
2case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._setWatchState("OFF"),this.fire(new e.h("trackuserlocationend"));break;case"BACKGROUND":this._setWatchState("ACTIVE_LOCK"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.h("trackuserlocationstart"))}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add(hc("waiting")),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(e={maximumAge:6e5,timeout:0},this._noTimeout=!0):(e=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,e),this._startRequestTimeout(),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._startRequestTimeout(),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}setFollowUserLocation(t){return this.options.followUserLocation=t??fc.followUserLocation,this.options.trackUserLocation&&"OFF"!==this._watchState&&(this.options.followUserLocation?"BACKGROUND"!==this._watchState&&"BACKGROUND_ERROR"!==this._watchState||(this._setWatchState("ACTIVE_LOCK"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.h("trackuserlocationstart"))):"ACTIVE_LOCK"!==this._watchState&&"ACTIVE_ERROR"!==this._watchState||(this._setWatchState("BACKGROUND"),this.fire(new e.h("trackuserlocationend")))),this}setShowAccuracyCircle(t){if(this.options.showAccuracyCircle=t??fc.showAccuracyCircle,!this._accuracyCircleMarker)return this;if(this.options.showAccuracyCircle){if(this.options.showUserLocation&&this._lastKnownPosition){const{longitude:t,latitude:i,accuracy:n}=this._lastKnownPosition.coords;this._accuracy=n,this._accuracyCircleMarker.setLngLat(new e.cZ(t,i)).addTo(this._map),this._updateCircleRadius()}}else this._accuracyCircleMarker.remove();return this}setShowUserHeading(e){return this.options.showUserHeading=e??fc.showUserHeading,this._setup?(this.options.showUserHeading?void 0!==this._geolocationWatchID&&this._addDeviceOrientationListener():(this._removeDeviceOrientationListener(),this._heading=void 0,this._userLocationDotMarker&&this._updateMarkerRotation()),this):this}setFitBoundsOptions(e){return this.options.fitBoundsOptions=e??fc.fitBoundsOptions,this}setShowUserLocation(e){return this.options.showUserLocation=e??fc.showUserLocation,this._setup?(this.options.showUserLocation?(this._userLocationDotMarker||(this._createUserLocationMarkers(),this._map.on("zoom",this._onZoom)),!this._lastKnownPosition||void 0!==this._watchState&&"OFF"===this._watchState||this._updateMarker(this._lastKnownPosition)):(this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this._accuracyCircleMarker&&this._accuracyCircleMarker.remove()),this):this}_addDeviceOrientationListener(){const t=()=>{const e="ondeviceorientationabsolute"in window?"deviceorientationabsolute":"deviceorientation";window.addEventListener(e,this._onDeviceOrientation)},i=DeviceOrientationEvent;"function"==typeof i?.requestPermission?i.requestPermission().then(i=>{"granted"===i?t():e.w("GeolocateControl: permission to use device orientation was denied, so the user heading arrow will not be shown.")}).catch(()=>{e.w("GeolocateControl: could not request device orientation permission. Enable the user heading from a user gesture (click/tap) so the browser can prompt for access.")}):t()}_removeDeviceOrientationListener(){window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation)}_createUserLocationMarkers(){this._dotElement=a("div","mapboxgl-user-location"),this._dotElement.appendChild(a("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(a("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new cc({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=a("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new cc({element:this._circleElement,pitchAlignment:"map"})}_clearWatch(){this._clearRequestTimeout(),this.options.geolocation.clearWatch(this._geolocationWatchID),this._removeDeviceOrientationListener(),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove(hc("waiting")),this._geolocateButton.setAttribute("aria-pressed","fal
2se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:ql,ScaleControl:class{constructor(t={}){this.options={...pc,...t},e.aW(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const e=this.options.maxWidth||100,t=this._map,i=t._containerHeight/2,n=t._containerWidth/2-e/2,r=t.unproject([n,i]),o=t.unproject([n+e,i]),s=r.distanceTo(o);if("imperial"===this.options.unit){const t=3.2808*s;t>5280?this._setScale(e,t/5280,"mile"):this._setScale(e,t,"foot")}else"nautical"===this.options.unit?this._setScale(e,s/1852,"nautical-mile"):s>=1e3?this._setScale(e,s/1e3,"kilometer"):this._setScale(e,s,"meter")}_setScale(e,t,i){this._map._requestDomTask(()=>{const n=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let i=e/t;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(i),t*i}(t),r=n/t;this._container.innerHTML="nautical-mile"!==i?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:i}).format(n):`${n} ${mc[i]}`,this._container.style.width=e*r+"px"})}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=a("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.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(e){this._language=e,this._update()}setUnit(e){this.options.unit=e,this._update()}},FullscreenControl:class{constructor(t={}){this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),e.aW(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=a("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=a("button","mapboxgl-ctrl-fullscreen",this._controlContainer);a("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||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()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},IndoorControl:class{constructor(){e.aW(["_onIndoorUpdate","_onStyleData","_scrollUp","_scrollDown","_toggleIndoor"],this),this._visibleFloorStart=0,this._lastSelectedFloorId=null}onAdd(e){return this._map=e,this._container=a("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.style.display="none",this._map.on("styledata",this._onStyleData),this._map.on("idle",this._onStyleData),this._updateConnection(),this._container}_onStyleData(){this._updateConnection()}_updateConnection(){if(this._map&&this._map.style&&this._map.style.indoorManager){const e=this._map.style.indoorManager;e.off("selector-update",this._onIndoorUpdate),e.on("selector-update",this._onIndoorUpdate),this._onIndoorUpdate(e.getControlState()),this._map.off("idle",this._onStyleData)}}_createButton(e,t){const i=a("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}_setButtonTitle(e,t){e.setAttribute("aria-label",t),e.textContent=t}onRemove(){this._container&&this._container.remove(),this._map&&(this._map.off("styledata",this._onStyleData),this._map.off("idle",this._onStyleData),this._map.style&&this._map.style.indoorManager&&this._map.style.indoorManager.off("selector-update",this._onIndoorUpdate),this._map=null)}getDefaultPosition(){return"top-right"}_onIndoorUpdate(e){if(!e||!e.floors||0===e.floors.length)return this._model=e,void(this._container.style.display="none");const t=this._model;this._model=e,this._container.style.display="inline-block";const i=!t||t.floors.length!==e.floors.length||t.floors.some((t,i)=>t.id!==e.floors[i].id);if(i&&(this._visibleFloorStart=0,this._lastSelectedFloorId=null),e.selectedFloorId){if(e.selectedFloorId!==this._lastSelectedFloorId||i){const t=e.floors.findIndex(t=>t.id===e.selectedFloorId);if(-1!==t){const i=e.floors.length;let n,r;i<=5?(n=0,r=i-1):0===this._visibleFloorStart?(n=0,r=3):this._visibleFloorStart>=i-3?(n=i-3-1,r=i-1):(n=this._visibleFloorStart,r=this._visibleFloorStart+3-1),t<n?this._visibleFloorStart=t:t>r&&(this._visibleFloorStart=t-2)}}this._lastSelectedFloorId=e.selectedFloorId}this._render()}
vendor: 6,057 bytes, line 2
2_render(){if(!this._container||!this._model||!this._model.floors)return;this._container.innerHTML="";const e=this._createButton("mapboxgl-ctrl-indoor-toggle",this._toggleIndoor);a("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),this._model.activeFloorsVisible||e.classList.add("mapboxgl-ctrl-level-button-selected"),this._container.appendChild(e);const t=this._model.floors,i=t.length;if(i<=5)return void t.forEach(e=>this._createFloorButton(e));const n=0===this._visibleFloorStart,r=this._visibleFloorStart>=i-3;if(n)this._createFloorButton(t[0]);else{const e=this._createButton("mapboxgl-ctrl-arrow-up",this._scrollUp);a("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),this._container.appendChild(e)}let o=[];if(o=n?t.slice(1,4):r?t.slice(this._visibleFloorStart-1,this._visibleFloorStart+3-1):t.slice(this._visibleFloorStart,this._visibleFloorStart+3),o.forEach(e=>this._createFloorButton(e)),r)this._createFloorButton(t[i-1]);else{const e=this._createButton("mapboxgl-ctrl-arrow-down",this._scrollDown);a("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),this._container.appendChild(e)}}_createFloorButton(e){const t=this._createButton("mapboxgl-ctrl-level-button",()=>{const t=e.id;this._model&&this._model.selectedFloorId===t&&this._model.activeFloorsVisible||this._map&&(this._model&&!this._model.activeFloorsVisible&&this._map.style&&this._map.style.indoorManager&&this._map.style.indoorManager.setActiveFloorsVisibility(!0),this._map._selectIndoorFloor(t))}),i=(e.name||"").trim(),n=e.zIndex.toString(),r=i?Array.from(i).slice(0,3).join(""):n;this._setButtonTitle(t,r),this._model&&this._model.activeFloorsVisible&&e.id===this._model.selectedFloorId&&t.classList.add("mapboxgl-ctrl-level-button-selected"),this._container&&this._container.appendChild(t)}_toggleIndoor(){this._map&&this._map.style&&this._map.style.indoorManager&&this._model&&this._model.activeFloorsVisible&&this._map.style.indoorManager.setActiveFloorsVisibility(!1)}_scrollUp(){if(this._visibleFloorStart>0){this._visibleFloorStart--,1===this._visibleFloorStart&&(this._visibleFloorStart=0);const e=this._model&&this._model.floors||[];if(e.length>3){const t=e.length-3;this._visibleFloorStart===t-1&&(this._visibleFloorStart=t-2)}this._render()}}_scrollDown(){if(this._model&&this._model.floors){const e=this._model.floors.length-3;this._visibleFloorStart<e&&(this._visibleFloorStart++,1===this._visibleFloorStart&&(this._visibleFloorStart=2),this._visibleFloorStart===e-1&&(this._visibleFloorStart=e),this._visibleFloorStart>e&&(this._visibleFloorStart=e),this._render())}}},Popup:class extends e.E{constructor(t){super(),this.options=Object.assign(Object.create(gc),t),this._altitude=this.options.altitude,e.aW(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(t&&t.className?t.className.trim().split(_c):[])}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new e.h("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new e.h("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=e.cZ.convert(t),this._pos=null,this._trackPointer=!1,this._update();const i=this._map;return i&&(i.on("move",this._update),i.off("mousemove",this._onMouseEvent),i._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}getAltitude(){return this._altitude}setAltitude(e){return this._altitude=e,this._update(),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){const t=document.createDocumentFragment(),i=document.createElement("body");let n;for(i.innerHTML=e;n=i.firstChild,n;)t.appendChild(n);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=a("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){const e=this._closeButton=a("button","mapboxgl-popup-close-button",t);e.type="button",e.setAttribute("aria-label","Close popup"),e.innerHTML='<span aria-hidden="true">×</span>',e.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(e){return this._classList.add(e),this._updateClassList(),this}removeClassName(e){return this._classList.delete(e),this._updateClassList(),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){let t;return this._classList.delete(e)?t=!1:(this._classList.add(e),t=!0),this._updateClassList(),t}_onMouseEvent(e){this._update(e.point)}_getAnchor(e){if(this.options.anchor)return this.options.anchor;const t=this._map,i=this._container,n=this._pos;if(!t||!i||!n)return"bottom";const r=i.offsetWidth,o=i.offsetHeight,s=n.x<r/2,a=n.x>t.transform.width-r/2;
2if(n.y+e<o)return s?"top-left":a?"top-right":"top";if(n.y>t.transform.height-o){if(s)return"bottom-left";if(a)return"bottom-right"}return s?"left":a?"right":"bottom"}_updateClassList(){const e=this._container;if(!e)return;const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),e.className=t.join(" ")}_update(t){const i=this._map,n=this._content;if(!i||!this._lngLat&&!this._trackPointer||!n)return;let r=this._container;if(r||(r=this._container=a("div","mapboxgl-popup",i.getContainer()),this._tip=a("div","mapboxgl-popup-tip",r),r.appendChild(n)),this.options.maxWidth&&r.style.maxWidth!==this.options.maxWidth&&(r.style.maxWidth=this.options.maxWidth),i.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=oc(this._lngLat,this._pos,i.transform)),!this._trackPointer||t){const n=this._pos=this._trackPointer&&t instanceof e.P?t:i.project(this._lngLat,this._altitude),r=vc(this.options.offset),o=this._anchor=this._getAnchor(r.y),s=vc(this.options.offset,o),a=n.add(s).round();i._requestDomTask(()=>{this._container&&o&&(this._container.style.transform=`${sc[o]} translate(${a.x}px,${a.y}px)`)})}if(!this._marker&&i._showingGlobe()){const t=e.f9(i.transform,this._lngLat)?0:1;this._setOpacity(t)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(yc);e&&e.focus()}_onClose(){this.remove()}_setOpacity(e){this._container&&(this._container.style.opacity=`${e}`),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}},Marker:cc,Style:Zs,LngLat:e.cZ,LngLatBounds:e.eI,Point:e.P,MercatorCoordinate:e.bT,FreeCameraOptions:e.ff,Evented:e.E,config:e.eS,prewarm:function(){jo().acquire(Yt)},clearPrewarmedResources:function(){const e=Uo;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(Yt),Uo=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 e.eS.ACCESS_TOKEN},set accessToken(t){e.ft(t)},get baseApiUrl(){return e.eS.API_URL},set baseApiUrl(t){e.fs(t)},get workerCount(){return Xt.workerCount},set workerCount(e){!function(e){Xt.workerCount=e}(e)},get maxParallelImageRequests(){return e.eS.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.fr(t)},clearStorage(t){e.fq(t)},get workerUrl(){return qt.workerUrl},set workerUrl(e){qt.workerUrl=e},get workerClass(){return qt.workerClass},set workerClass(e){qt.workerClass=e},get dracoUrl(){return e.fp()},set dracoUrl(t){e.fo(t)},get meshoptUrl(){return e.fn()},set meshoptUrl(t){e.fm(t)},get buildingGenUrl(){return e.fl()},set buildingGenUrl(t){e.fk(t)},setNow:e.e.setNow,restoreNow:e.e.restoreNow};return bc}),i}()},7496:function(e,t,i){"use strict";i.d(t,{A:function(){return l}});i(2077),i(6467);var n=i(1626),r=i(6330),o=i(1776),s=i(2139),a=n.vUu('<button type="button" class="map-toggle"><!> <span>Show map</span></button>');function l(e,t){n.VCO(t,!1);let i=n._w2(t,"mapContainer",8),l=n.zgK();(0,r.Rc)(()=>{new s.A(n.JtY(l),i())}),n.TsN();var c=a(),u=n.jfp(c);n.qyt(u,()=>(n.iTV(o.A),n.vzK(()=>o.A.map()))),n.K2T(2),n.cLc(c),n.Lcc(c,e=>n.hZp(l,e),()=>n.JtY(l)),n.BCw(e,c),n.uYY()}},5497:function(e,t,i){"use strict";e.exports=i.p+"images/map-marker-em.3c1f2ba1.png"},3454:function(e,t,i){"use strict";e.exports=i.p+"images/map-marker-em.5a8f3333.svg"},5699:function(e,t,i){"use strict";e.exports=i.p+"images/map-marker.10bdd59b.svg"},9306:function(e,t,i){"use strict";var n=i(4901),r=i(6823),o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(r(e)+" is not a function")}},6469:function(e,t,i){"use strict";var n=i(8227),r=i(2360),o=i(4913).f,s=n("unscopables"),a=Array.prototype;void 0===a[s]&&o(a,s,{configurable:!0,value:r(null)}),e.exports=function(e){a[s][e]=!0}},679:function(e,t,i){"use strict";var n=i(1625),r=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new r("Incorrect invocation")}},8551:function(e,t,i){"use strict";var n=i(34),r=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(r(e)+" is not an object")}},9617:function(e,t,i){"use strict";var n=i(5397),r=i(5610),o=i(6198),s=function(e){return function(t,i,s){var a=n(t),l=o(a);if(0===l)return!e&&-1;var c,u=r(s,l);if(e&&i!=i){for(;l>u;)if((c=a[u++])!=c)return!0}else for(;l>u;u++)if((e||u in a)&&a[u]===i)return e||u||0;return!e&&-1}};e.exports={m:s(!0),q:s(!1)}},4527:function(e,t,i){"use strict";var n=i(3724),r=i(4376),o=TypeError,s=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(r(e)&&!s(e,"length").writable)throw new o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},6319:function(e,t,i){"use strict";var n=i(8551),r=i(9539);e.exports=function(e,t,i,o){try{return o?t(n(i)[0],i[1]):t(i)}catch(t){r(e,"throw",t)}}},2195:function(e,t,i){"use strict";var n=i(9504),r=n({}.toString),o=n("".slice);e.exports=function(e){return o(r(e),8,-1)}},7740:function(e,t,i){"use strict";var n=i(9297),r=i(5031),o=i(7347),s=i(4913);e.exports=function(e,t,i){for(var a=r(t),l=s.f,c=o.f,u=0;u<a.length;u++){var h=a[u];n(e,h)||i&&n(i,h)||l(e,h,c(t,h))}}},2211:function(e,t,i){"use strict";var n=i(9039);e.exports=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},2529:function(e){"use strict";e.exports=function(e,t){return{value:e,done:t}}},6699:function(e,t,i){"use strict";var n=i(3724),r=i(4913),o=i(6980);e.exports=n?function(e,t,i){return r.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},6980:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},4659:function(e,t,i){"use strict";var n=i(3724),r=i(4913),o=i(6980);e.exports=function(e,t,i){n?r.f(e,t,o(0,i)):e[t]=i}},2106:function(e,t,i){"use strict";var n=i(283),r=i(4913);e.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}},6840:function(e,t,i){"use strict";var n=i(4901),r=i(4913),o=i(283),s=i(9433);e.exports=function(e,t,i,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;if(n(i)&&o(i,c,a),a.global)l?e[t]=i:s(t,i);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}
vendor: 13,823 bytes, line 2
2l?e[t]=i:r.f(e,t,{value:i,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},6279:function(e,t,i){"use strict";var n=i(6840);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},9433:function(e,t,i){"use strict";var n=i(4576),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},3724:function(e,t,i){"use strict";var n=i(9039);e.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4055:function(e,t,i){"use strict";var n=i(4576),r=i(34),o=n.document,s=r(o)&&r(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},6837:function(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw new t("Maximum allowed index exceeded");return e}},8727:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2839:function(e,t,i){"use strict";var n=i(4576).navigator,r=n&&n.userAgent;e.exports=r?String(r):""},9519:function(e,t,i){"use strict";var n,r,o=i(4576),s=i(2839),a=o.process,l=o.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(r=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(r=+n[1]),e.exports=r},6518:function(e,t,i){"use strict";var n=i(4576),r=i(7347).f,o=i(6699),s=i(6840),a=i(9433),l=i(7740),c=i(2796);e.exports=function(e,t){var i,u,h,d,f,p=e.target,m=e.global,_=e.stat;if(i=m?n:_?n[p]||a(p,{}):n[p]&&n[p].prototype)for(u in t){if(d=t[u],h=e.dontCallGetSet?(f=r(i,u))&&f.value:i[u],!c(m?u:p+(_?".":"#")+u,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(e.sham||h&&h.sham)&&o(d,"sham",!0),s(i,u,d,e)}}},9039:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},6080:function(e,t,i){"use strict";var n=i(7476),r=i(9306),o=i(616),s=n(n.bind);e.exports=function(e,t){return r(e),void 0===t?e:o?s(e,t):function(){return e.apply(t,arguments)}}},616:function(e,t,i){"use strict";var n=i(9039);e.exports=!n(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},9565:function(e,t,i){"use strict";var n=i(616),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},350:function(e,t,i){"use strict";var n=i(3724),r=i(9297),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=r(o,"name"),l=a&&"something"===function(){}.name,c=a&&(!n||n&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:l,i2:c}},7476:function(e,t,i){"use strict";var n=i(2195),r=i(9504);e.exports=function(e){if("Function"===n(e))return r(e)}},9504:function(e,t,i){"use strict";var n=i(616),r=Function.prototype,o=r.call,s=n&&r.bind.bind(o,o);e.exports=n?s:function(e){return function(){return o.apply(e,arguments)}}},7751:function(e,t,i){"use strict";var n=i(4576),r=i(4901);e.exports=function(e,t){return arguments.length<2?(i=n[e],r(i)?i:void 0):n[e]&&n[e][t];var i}},1767:function(e){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},8563:function(e,t,i){"use strict";var n=i(9565),r=i(4901),o=i(8551),s=i(6823),a=i(3085),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?a(e):t;if(r(i))return o(n(i,e));throw new l(s(e)+" is not iterable")}},3085:function(e,t,i){"use strict";var n=i(2195),r=i(4117),o=i(5966),s=i(8227)("iterator"),a=Array.prototype;e.exports=function(e){if(!r(e))return o(e,s)||o(e,"@@iterator")||("Arguments"===n(e)?a[s]:void 0)}},5966:function(e,t,i){"use strict";var n=i(9306),r=i(4117);e.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}},4576:function(e,t,i){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:function(e,t,i){"use strict";var n=i(9504),r=i(8981),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},421:function(e){"use strict";e.exports={}},397:function(e,t,i){"use strict";var n=i(7751);e.exports=n("document","documentElement")},5917:function(e,t,i){"use strict";var n=i(3724),r=i(9039),o=i(4055);e.exports=!n&&!r(function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},7055:function(e,t,i){"use strict";var n=i(9504),r=i(9039),o=i(2195),s=Object,a=n("".split);e.exports=r(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"===o(e)?a(e,""):s(e)}:s},3706:function(e,t,i){"use strict";var n=i(9504),r=i(4901),o=i(7629),s=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},1181:function(e,t,i){"use strict";var n,r,o,s=i(8622),a=i(4576),l=i(34),c=i(6699),u=i(9297),h=i(7629),d=i(6119),f=i(421),p="Object already initialized",m=a.TypeError,_=a.WeakMap;if(s||h.state){var g=h.state||(h.state=new _);g.get=g.get,g.has=g.has,g.set=g.set,n=function(e,t){if(g.has(e))throw new m(p);return t.facade=e,g.set(e,t),t},r=function(e){return g.get(e)||{}},o=function(e){return g.has(e)}}else{var y=d("state");f[y]=!0,n=function(e,t){if(u(e,y))throw new m(p);return t.facade=e,c(e,y,t),t},r=function(e){return u(e,y)?e[y]:{}},o=function(e){return u(e,y)}}e.exports={set:n,get:r,has:o,enforce:function(e){return o(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!l(t)||(i=r(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return i}}}},4209:function(e,t,i){"use strict";var n=i(8227),r=i(6269),o=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||s[o]===e)}},4376:function(e,t,i){"use strict";var n=i(2195);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4901:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},2796:function(e,t,i){"use strict";var n=i(9039),r=i(4901),o=/#|\.prototype\./,s=function(e,t){var i=l[a(e)];return i===u||i!==c&&(r(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",u=s.POLYFILL="P";e.exports=s},4117:function(e){"use strict";e.exports=function(e){return null==e}},34:function(e,t,i){"use strict";var n=i(4901);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},6395:function(e){"use strict";e.exports=!1},757:function(e,t,i){"use strict";var n=i(7751),r=i(4901),o=i(1625),s=i(7040),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&o(t.prototype,a(e))}},2652:function(e,t,i){"use strict";var n=i(6080),r=i(9565),o=i(8551),s=i(6823),a=i(4209),l=i(6198),c=i(1625),u=i(8563),h=i(3085),d=i(9539),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},m=p.prototype;e.exports=function(e,t,i){var _,g,y,v,x,b,w,T=i&&i.that,E=!(!i||!i.AS_ENTRIES),S=!(!i||!i.IS_RECORD),I=!(!i||!i.IS_ITERATOR),A=!(!i||!i.INTERRUPTED),M=n(t,T),C=function(e){var t=_;return _=void 0,t&&d(t,"normal"),new p(!0,e)},D=function(e){return E?(o(e),A?M(e[0],e[1],C):M(e[0],e[1])):A?M(e,C):M(e)};if(S)_=e.iterator;else if(I)_=e;else{if(!(g=h(e)))throw new f(s(e)+" is not iterable");if(a(g)){for(y=0,v=l(e);v>y;y++)if((x=D(e[y]))&&c(m,x))return x;return new p(!1)}_=u(e,g)}for(b=S?e.next:_.next;!(w=r(b,_)).done;){var P=w.value;try{x=D(P)}catch(e){if(!_)throw e;d(_,"throw",e)}if("object"==typeof x&&x&&c(m,x))return x}return new p(!1)}},6859:function(e){"use strict";e.exports=function(e){e.iterator=e.next=e.nextHandler=e.mapper=e.predicate=e.inner=e.iterables=e.iters=e.openIters=e.padding=e.finishResults=e.buffer=null}},1385:function(e,t,i){"use strict";var n=i(9539);e.exports=function(e,t,i){for(var r=e.length-1;r>=0;r--)if(void 0!==e[r])try{i=n(e[r].iterator,t,i)}catch(e){t="throw",i=e}if("throw"===t)throw i;return i}},9539:function(e,t,i){"use strict";var n=i(9565),r=i(8551),o=i(5966);e.exports=function(e,t,i){var s,a;r(e);try{if(!(s=o(e,"return"))){if("throw"===t)throw i;return i}s=n(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw i;if(a)throw s;return r(s),i}},9462:function(e,t,i){"use strict";var n=i(9565),r=i(2360),o=i(6699),s=i(6279),a=i(8227),l=i(1181),c=i(5966),u=i(7657).H,h=i(2529),d=i(9539),f=i(1385),p=i(6859),m=a("toStringTag"),_="IteratorHelper",g="WrapForValidIterator",y="normal",v="throw",x=l.set,b=function(e){var t=l.getterFor(e?g:_);return s(r(u),{next:function(){var i=t(this);if(e)return i.nextHandler();if(i.done)return h(void 0,!0);try{var n=i.nextHandler();return i.done&&p(i),i.returnHandlerResult?n:h(n,i.done)}catch(e){throw i.done=!0,p(i),e}},return:function(){var i=t(this),r=i.iterator,o=i.inner,s=i.openIters,a=i.done;if(i.done=!0,e){var l=c(r,"return");return l?n(l,r):h(void 0,!0)}if(p(i),a)return h(void 0,!0);if(o)try{d(o.iterator,y)}catch(e){return d(r,v,e)}if(s)try{f(s,y)}catch(e){if(r)return d(r,v,e);throw e}return r&&d(r,y),h(void 0,!0)}})},w=b(!0),T=b(!1);o(T,m,"Iterator Helper"),e.exports=function(e,t,i){var n=function(n,r){r?(r.iterator=n.iterator,r.next=n.next):r=n,r.type=t?g:_,r.returnHandlerResult=!!i,r.nextHandler=e,r.counter=0,r.done=!1,x(this,r)};return n.prototype=t?w:T,n}},684:function(e){"use strict";e.exports=function(e,t){var i="function"==typeof Iterator&&Iterator.prototype[e];if(i)try{i.call({next:null},t).next()}catch(e){return!0}}},4549:function(e,t,i){"use strict";var n=i(4576);e.exports=function(e,t){var i=n.Iterator,r=i&&i.prototype,o=r&&r[e],s=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){s=!0}},-1)}catch(e){e instanceof t||(s=!1)}if(!s)return o}},7657:function(e,t,i){"use strict";var n,r,o,s=i(9039),a=i(4901),l=i(34),c=i(2360),u=i(2787),h=i(6840),d=i(8227),f=i(6395),p=d("iterator"),m=!1;[].keys&&("next"in(o=[].keys())?(r=u(u(o)))!==Object.prototype&&(n=r):m=!0),!l(n)||s(function(){var e={};return n[p].call(e)!==e})?n={}:f&&(n=c(n)),a(n[p])||h(n,p,function(){return this}),e.exports={H:n,BUGGY_SAFARI_ITERATORS:m}},6269:function(e){"use strict";e.exports=Object.create?Object.create(null):{}},6198:function(e,t,i){"use strict";var n=i(8014);e.exports=function(e){return n(e.length)}},283:function(e,t,i){"use strict";var n=i(9504),r=i(9039),o=i(4901),s=i(9297),a=i(3724),l=i(350).i2,c=i(3706),u=i(1181),h=u.enforce,d=u.get,f=String,p=Object.defineProperty,m=n("".slice),_=n("".replace),g=n([].join),y=a&&!r(function(){return 8!==p(function(){},"length",{value:8}).length}),v=String(String).split("String"),x=e.exports=function(e,t,i){"Symbol("===m(f(t),0,7)&&(t="["+_(f(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!s(e,"name")||l&&e.name!==t)&&(a?p(e,"name",{value:t,configurable:!0}):e.name=t),y&&i&&s(i,"arity")&&e.length!==i.arity&&p(e,"length",{value:i.arity});try{i&&s(i,"constructor")&&i.constructor?a&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);return s(n,"source")||(n.source=g(v,"string"==typeof t?t:"")),e};Function.prototype.toString=x(function(){return o(this)&&d(this).source||c(this)},"toString")},741:function(e){"use strict";var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?i:t)(n)}},2360:function(e,t,i){"use strict";var n,r=i(8551),o=i(6801),s=i(8727),a=i(421),l=i(397),c=i(4055),u=i(6119),h="prototype",d="script",f=u("IE_PROTO"),p=function(){},m=function(e){return"<"+d+">"+e+"</"+d+">"},_=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,i;g="undefined"!=typeof document?document.domain&&n?_(n):(t=c("iframe"),i="java"+d+":",t.style.display="none",l.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):_(n);for(var r=s.length;r--;)delete g[h][s[r]];return g()};a[f]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(p[h]=r(e),i=new p,p[h]=null,i[f]=e):i=g(),void 0===t?i:o.f(i,t)}},6801:function(e,t,i){"use strict";var n=i(3724),r=i(8686),o=i(4913),s=i(8551),a=i(5397),l=i(1072);t.f=n&&!r?Object.defineProperties:function(e,t){s(e);for(var i,n=a(t),r=l(t),c=r.length,u=0;c>u;)o.f(e,i=r[u++],n[i]);return e}},4913:function(e,t,i){"use strict";var n=i(3724),r=i(5917),o=i(8686),s=i(8551),a=i(6969),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",f="writable";t.f=n?o?function(e,t,i){if(s(e),t=a(t),s(i),"function"==typeof e&&"prototype"===t&&"value"in i&&f in i&&!i[f]){var n=u(e,t);n&&n[f]&&(e[t]=i.value,i={configurable:d in i?i[d]:n[d],enumerable:h in i?i[h]:n[h],writable:!1})}return c(e,t,i)}:c:function(e,t,i){if(s(e),t=a(t),s(i),r)try{return c(e,t,i)}catch(e){}if("get"in i||"set"in i)throw new l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},7347:function(e,t,i){"use strict";var n=i(3724),r=i(9565),o=i(8773),s=i(6980),a=i(5397),l=i(6969),c=i(9297),u=i(5917),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=a(e),t=l(t),u)try{return h(e,t)}catch(e){}if(c(e,t))return s(!r(o.f,e,t),e[t])}},8480:function(e,t,i){"use strict";var n=i(1828),r=i(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},3717:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},2787:function(e,t,i){"use strict";var n=i(9297),r=i(4901),o=i(8981),s=i(6119),a=i(2211),l=s("IE_PROTO"),c=Object,u=c.prototype;e.exports=a?c.getPrototypeOf:function(e){var t=o(e);if(n(t,l))return t[l];var i=t.constructor;return r(i)&&t instanceof i?i.prototype:t instanceof c?u:null}},1625:function(e,t,i){"use strict";var n=i(9504);e.exports=n({}.isPrototypeOf)},1828:function(e,t,i){"use strict";
vendor: 4,129 bytes, line 2
2var n=i(9504),r=i(9297),o=i(5397),s=i(9617).q,a=i(421),l=n([].push);e.exports=function(e,t){var i,n=o(e),c=0,u=[];for(i in n)!r(a,i)&&r(n,i)&&l(u,i);for(;t.length>c;)r(n,i=t[c++])&&(~s(u,i)||l(u,i));return u}},1072:function(e,t,i){"use strict";var n=i(1828),r=i(8727);e.exports=Object.keys||function(e){return n(e,r)}},8773:function(e,t){"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},4270:function(e,t,i){"use strict";var n=i(9565),r=i(4901),o=i(34),s=TypeError;e.exports=function(e,t){var i,a;if("string"===t&&r(i=e.toString)&&!o(a=n(i,e)))return a;if(r(i=e.valueOf)&&!o(a=n(i,e)))return a;if("string"!==t&&r(i=e.toString)&&!o(a=n(i,e)))return a;throw new s("Can't convert object to primitive value")}},5031:function(e,t,i){"use strict";var n=i(7751),r=i(9504),o=i(8480),s=i(3717),a=i(8551),l=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),i=s.f;return i?l(t,i(e)):t}},7750:function(e,t,i){"use strict";var n=i(4117),r=TypeError;e.exports=function(e){if(n(e))throw new r("Can't call method on "+e);return e}},6119:function(e,t,i){"use strict";var n=i(5745),r=i(3392),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},7629:function(e,t,i){"use strict";var n=i(6395),r=i(4576),o=i(9433),s="__core-js_shared__",a=e.exports=r[s]||o(s,{});(a.versions||(a.versions=[])).push({version:"3.50.0",mode:n?"pure":"global",copyright:"© 2013â2025 Denis Pushkarev (zloirock.ru), 2025â2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:function(e,t,i){"use strict";var n=i(7629),r=Object.create||Object;e.exports=function(e,t){return n[e]||(n[e]=t||r(null))}},4495:function(e,t,i){"use strict";var n=i(9519),r=i(9039),o=i(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},5610:function(e,t,i){"use strict";var n=i(1291),r=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):o(i,t)}},5397:function(e,t,i){"use strict";var n=i(7055),r=i(7750);e.exports=function(e){return n(r(e))}},1291:function(e,t,i){"use strict";var n=i(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},8014:function(e,t,i){"use strict";var n=i(1291),r=Math.min;e.exports=function(e){var t=n(e);return t>0?r(t,9007199254740991):0}},8981:function(e,t,i){"use strict";var n=i(7750),r=Object;e.exports=function(e){return r(n(e))}},2777:function(e,t,i){"use strict";var n=i(9565),r=i(34),o=i(757),s=i(5966),a=i(4270),l=i(8227),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!r(e)||o(e))return e;var i,l=s(e,u);if(l){if(void 0===t&&(t="default"),i=n(l,e,t),!r(i)||o(i))return i;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},6969:function(e,t,i){"use strict";var n=i(2777),r=i(757);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},6823:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:function(e,t,i){"use strict";var n=i(9504),r=0,o=Math.random(),s=n(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++r+o,36)}},7040:function(e,t,i){"use strict";var n=i(4495);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:function(e,t,i){"use strict";var n=i(3724),r=i(9039);e.exports=n&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8622:function(e,t,i){"use strict";var n=i(4576),r=i(4901),o=n.WeakMap;e.exports=r(o)&&/native code/.test(String(o))},8227:function(e,t,i){"use strict";var n=i(4576),r=i(5745),o=i(9297),s=i(3392),a=i(4495),l=i(7040),c=n.Symbol,u=r("wks"),h=l?c.for||c:c&&c.withoutSetter||s;e.exports=function(e){return o(u,e)||(u[e]=a&&o(c,e)?c[e]:h("Symbol."+e)),u[e]}},4423:function(e,t,i){"use strict";var n=i(6518),r=i(9617).m,o=i(9039),s=i(6469),a=o(function(){return!Array(1).includes()}
2),l=o(function(){return[,1].includes(void 0,1)});n({target:"Array",proto:!0,forced:a||l},{includes:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),s("includes")},4114:function(e,t,i){"use strict";var n=i(6518),r=i(8981),o=i(6198),s=i(4527),a=i(6837);n({target:"Array",proto:!0,arity:1,forced:i(9039)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=r(this),i=o(t),n=arguments.length;a(i+n);for(var l=0;l<n;l++)t[i]=arguments[l],i++;return s(t,i),i}})},8111:function(e,t,i){"use strict";var n=i(6518),r=i(4576),o=i(679),s=i(8551),a=i(4901),l=i(2787),c=i(2106),u=i(4659),h=i(9039),d=i(9297),f=i(8227),p=i(7657).H,m=i(3724),_=i(6395),g="constructor",y="Iterator",v=f("toStringTag"),x=TypeError,b=r[y],w=_||!a(b)||b.prototype!==p||!h(function(){b({})}),T=function(){if(o(this,p),l(this)===p)throw new x("Abstract class Iterator not directly constructable")},E=function(e,t){m?c(p,e,{configurable:!0,get:function(){return t},set:function(t){if(s(this),this===p)throw new x("You can't redefine this property");d(this,e)?this[e]=t:u(this,e,t)}}):p[e]=t};d(p,v)||E(v,y),!w&&d(p,g)&&p[g]!==Object||E(g,T),T.prototype=p,n({global:!0,constructor:!0,forced:w},{Iterator:T})},116:function(e,t,i){"use strict";var n=i(6518),r=i(9565),o=i(2652),s=i(9306),a=i(8551),l=i(1767),c=i(9539),u=i(4549)("find",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:u},{find:function(e){a(this);try{s(e)}catch(e){c(this,"throw",e)}if(u)return r(u,this,e);var t=l(this),i=0;return o(t,function(t,n){if(e(t,i++))return n(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},7588:function(e,t,i){"use strict";var n=i(6518),r=i(9565),o=i(2652),s=i(9306),a=i(8551),l=i(1767),c=i(9539),u=i(4549)("forEach",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:u},{forEach:function(e){a(this);try{s(e)}catch(e){c(this,"throw",e)}if(u)return r(u,this,e);var t=l(this),i=0;o(t,function(t){e(t,i++)},{IS_RECORD:!0})}})},1701:function(e,t,i){"use strict";var n=i(6518),r=i(9565),o=i(9306),s=i(8551),a=i(1767),l=i(9462),c=i(6319),u=i(9539),h=i(684),d=i(4549),f=i(6395),p=!f&&!h("map",function(){}),m=!f&&!p&&d("map",TypeError),_=f||p||m,g=l(function(){var e=this.iterator,t=s(r(this.next,e));if(!(this.done=!!t.done))return c(e,this.mapper,[t.value,this.counter++],!0)});n({target:"Iterator",proto:!0,real:!0,forced:_},{map:function(e){s(this);try{o(e)}catch(e){u(this,"throw",e)}return m?r(m,this,e):new g(a(this),{mapper:e})}})},8992:function(e,t,i){"use strict";i(8111)},2577:function(e,t,i){"use strict";i(116)},3949:function(e,t,i){"use strict";i(7588)},1454:function(e,t,i){"use strict";i(1701)},4763:function(e,t,i){"use strict";const n=Symbol("uninitialized"),r=Symbol("filename");Symbol("hmr");i.d(t,["ON",0,"http://www.w3.org/1998/Math/MathML","UP",0,n,"Uh",0,r,"iW",0,"http://www.w3.org/1999/xhtml","kD",0,{},"pQ",0,"http://www.w3.org/2000/svg"])},6330:function(e,t,i){"use strict";i.d(t,{Or:function(){return l.Or},sA:function(){return u},Rc:function(){return c}});var n=i(896),r=(i(3795),i(1626)),o=i(9527),s=i(2),a=i(8323);i(9325),i(5085);var l=i(6622);i(4691);
2function c(e){null===a.UL&&o.bs("onMount"),s.LM&&null!==a.UL.l?h(a.UL).m.push(e):(0,r.MWq)(()=>{const t=(0,n.vz)(e);if("function"==typeof t)return t})}function u(e){null===a.UL&&o.bs("onDestroy"),c(()=>()=>(0,n.vz)(e))}function h(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}},8549:function(e,t,i){"use strict";const n=Symbol("$state"),r=Symbol("component"),o=Symbol("legacy props"),s=Symbol(""),a=Symbol("proxy path"),l=Symbol("attributes"),c=Symbol("class"),u=Symbol("style"),h=Symbol("text"),d=Symbol("form reset"),f=Symbol("hmr anchor"),p=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},m=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");i.d(t,["Al",0,d,"EY",0,1<<21,"HE",0,h,"In",0,p,"O8",0,f,"Qf",0,a,"Qy",0,1<<24,"VD",0,1<<22,"WL",0,1<<25,"Wr",0,1<<20,"cQ",0,c,"dH",0,1<<23,"df",0,1<<25,"l3",0,o,"mQ",0,s,"r3",0,r,"r6",0,m,"x3",0,n,"z2",0,u,"zV",0,l])},8323:function(e,t,i){"use strict";i.d(t,{DE:function(){return d},De:function(){return c},Mo:function(){return f},O2:function(){return h},UL:function(){return l},VC:function(){return p},hH:function(){return g},lQ:function(){return _},lv:function(){return u},uY:function(){return m}});var n=i(896),r=i(199),o=i(2),s=(i(4763),i(8549)),a=i(3795);let l=null;function c(e){l=e}let u=null;function h(e){u=e}let d=null;function f(e){d=e}function p(e,t=!1,i){l={p:l,i:!1,c:null,e:null,s:e,x:null,r:n.Fg,l:o.LM&&!t?{s:null,u:null,$:[]}:null}}function m(e){var t=l,i=t.e;if(null!==i)for(var n of(t.e=null,i))(0,r.V1)(n);return void 0!==e&&(t.x=e),t.i=!0,l=t.p,_(e)}function _(e={}){return(0,a.Qu)(e,s.r3,{value:!0}),e}function g(){return!o.LM||null!==l&&null===l.l}},3094:function(e,t,i){"use strict";i.d(t,{Ej:function(){return o}});var n=i(7051),r=i(2320);function o(){const e=Array.prototype,t=Array.__svelte_cleanup;t&&t();const{indexOf:i,lastIndexOf:o,includes:s}=e;e.indexOf=function(e,t){const o=i.call(this,e,t);if(-1===o)for(let i=t??0;i<this.length;i+=1)if((0,r.N)(this[i])===e){n.ns("array.indexOf(...)");break}return o},e.lastIndexOf=function(e,t){const i=o.call(this,e,t??this.length-1);if(-1===i)for(let i=0;i<=(t??this.length-1);i+=1)if((0,r.N)(this[i])===e){n.ns("array.lastIndexOf(...)");break}return i},e.includes=function(e,t){const i=s.call(this,e,t);if(!i)for(let t=0;t<this.length;t+=1)if((0,r.N)(this[t])===e){n.ns("array.includes(...)");break}return i},Array.__svelte_cleanup=()=>{e.indexOf=i,e.lastIndexOf=o,e.includes=s}}},7422:function(e,t,i){"use strict";i.d(t,{Tc:function(){return o},_e:function(){return s},ho:function(){return r}});i(4763),i(959);var n=i(8549);i(199),i(896);let r=null;function o(e,t){return e.label=t,s(e.v,t),e}function s(e,t){return e?.[n.Qf]?.(t),e}},9234:function(e,t,i){"use strict";i.d(t,{pP:function(){return _}});i(8549),i(4763);var n=i(8323),r=i(558),o=i(199),s=i(896),a=i(5085),l=i(474),c=i(5345),u=i(7051),h=i(9325),d=i(4871),f=(i(7422),i(7414)),p=i(4157),m=i(3064);function _(e,t,i,n){new g(e,t,i,n)}class g{parent;is_pending=!1;transform_error;#e;#t=a.fE?a.Xb:null;#i;#n;#r;#o=null;#s=null;#a=null;#l=null;#c=0;#u=0;#h=!1;#d=new Set;#f=new Set;#p=null;#m=(0,f.D)(()=>(this.#p=(0,d.sP)(this.#c),()=>{this.#p=null}));constructor(e,t,i,n){this.#e=e,this.#i=t,this.#n=e=>{var t=s.Fg;t.b=this,t.f|=128,i(e)},this.parent=s.Fg.b,this.transform_error=n??this.parent?.transform_error??(e=>e),this.#r=(0,o.om)(()=>{if(a.fE){const e=this.#t;(0,a.E$)();const t="[!"===e.data;if(e.data.startsWith("[?")){const t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#g():this.#y()}else this.#v()},589824),a.fE&&(this.#e=a.Xb)}#y(){try{this.#o=(0,o.tk)(()=>this.#n(this.#e))}catch(e){this.error(e)}}#_(e){const t=this.#i.failed,{reset:i,invoke_onerror:n}=this.#x(e);(0,l.$)(n),t&&(this.#a=(0,o.tk)(()=>{t(this.#e,()=>e,()=>i)}))}#x(e){var t=!1,i=!1;const n=()=>{t?u.CF():(t=!0,i&&c.JJ(),null!==this.#a&&(0,o.r4)(this.#a,()=>{this.#a=null}),this.#b(()=>{this.#v()}))};return{reset:n,invoke_onerror:()=>{try{i=!0,this.#i.onerror?.(e,n),i=!1}catch(e){(0,r.n)(e,this.#r&&this.#r.parent)}}}}#g(){const e=this.#i.pending;e&&(this.is_pending=!0,this.#s=(0,o.tk)(()=>e(this.#e)),(0,l.$)(()=>{var e=this.#l=document.createDocumentFragment(),t=(0,p.Pb)(),i=!1;if(e.append(t),this.#o=this.#b(()=>{try{return(0,o.tk)(()=>this.#n(t))}catch(e){try{this.error(e),i=!0}catch(e){(0,r.n)(e,this.#r.parent)}return null}}),null===this.#o)return this.#l=null,void(i&&this.#w(h.Dr));0===this.#u&&(this.#e.before(e),this.#l=null,(0,o.r4)(this.#s,()=>{this.#s=null}),this.#w(h.Dr))}))}#v(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#c=0,this.#o=(0,o.tk)(()=>{this.#n(this.#e)}),this.#u>0){var e=this.#l=document.createDocumentFragment();(0,o.Ep)(this.#o,e);const t=this.#i.pending;this.#s=(0,o.tk)(()=>t(this.#e))}else this.#w(h.Dr)}catch(e){this.error(e)}}#w(e){this.is_pending=!1,e.transfer_effects(this.#d,this.#f)}defer_effect(e){(0,m.p)(e,this.#d,this.#f)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#i.pending}#b(e){var t=s.Fg,i=s.hp,r=n.UL;(0,s.gU)(this.#r),(0,s.G0)(this.#r),(0,n.De)(this.#r.ctx);try{return h.lP.ensure(),e()}finally{(0,s.gU)(t),(0,s.G0)(i),(0,n.De)(r)}}#T(e,t){this.has_pending_snippet()?(this.#u+=e,0===this.#u&&(this.#w(t),this.#s&&(0,o.r4)(this.#s,()=>{this.#s=null}),this.#l&&(this.#e.before(this.#l),this.#l=null))):this.parent&&this.parent.#T(e,t)}update_pending_count(e,t){this.#T(e,t),this.#c+=e,this.#p&&!this.#h&&(this.#h=!0,(0,l.$)(()=>{this.#h=!1,this.#p&&(0,d.LY)(this.#p,this.#c)}))}get_effect_pending(){return this.#m(),(0,s.Jt)(this.#p)}error(e){if(!this.#i.onerror&&!this.#i.failed)throw e;h.Dr?.is_fork?(this.#o&&h.Dr.skip_effect(this.#o),this.#s&&h.Dr.skip_effect(this.#s),this.#a&&h.Dr.skip_effect(this.#a),h.Dr.oncommit(()=>
2{this.#E(e)})):this.#E(e)}#E(e){this.#o&&((0,o.DI)(this.#o),this.#o=null),this.#s&&((0,o.DI)(this.#s),this.#s=null),this.#a&&((0,o.DI)(this.#a),this.#a=null),a.fE&&((0,a.W0)(this.#t),(0,a.K2)(),(0,a.W0)((0,a.Ub)()));let t=this.#i.failed;const i=e=>{const{reset:i,invoke_onerror:n}=this.#x(e);n(),t&&(this.#a=this.#b(()=>{try{return(0,o.tk)(()=>{var n=s.Fg;n.b=this,n.f|=128,t(this.#e,()=>e,()=>i)})}catch(e){return(0,r.n)(e,this.#r.parent),null}}))};(0,l.$)(()=>{var t;try{t=this.transform_error(e)}catch(e){return void(0,r.n)(e,this.#r&&this.#r.parent)}null!==t&&"object"==typeof t&&"function"==typeof t.then?t.then(i,e=>(0,r.n)(e,this.#r&&this.#r.parent)):i(t)})}}},5372:function(e,t,i){"use strict";i.d(t,{G:function(){return a}});var n=i(9325),r=i(199),o=(i(8549),i(5085)),s=i(4157);class a{anchor;#S=new Map;#I=new Map;#A=new Map;#M=new Set;#C=!0;constructor(e,t=!0){this.anchor=e,this.#C=t}#D=e=>{if(this.#S.has(e)){var t=this.#S.get(e),i=this.#I.get(t);if(i)(0,r.cc)(i),this.#M.delete(t);else{var n=this.#A.get(t);n&&((0,r.cc)(n.effect),this.#I.set(t,n.effect),this.#A.delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[t,i]of this.#S){if(this.#S.delete(t),t===e)break;const n=this.#A.get(i);n&&((0,r.DI)(n.effect),this.#A.delete(i))}for(const[e,n]of this.#I){if(e===t||this.#M.has(e))continue;const o=()=>{if(Array.from(this.#S.values()).includes(e)){var t=document.createDocumentFragment();(0,r.Ep)(n,t),t.append((0,s.Pb)()),this.#A.set(e,{effect:n,fragment:t})}else(0,r.DI)(n);this.#M.delete(e),this.#I.delete(e)};this.#C||!i?(this.#M.add(e),(0,r.r4)(n,o,!1)):o()}}};#P=e=>{this.#S.delete(e);const t=Array.from(this.#S.values());for(const[e,i]of this.#A)t.includes(e)||((0,r.DI)(i.effect),this.#A.delete(e))};ensure(e,t){var i=n.Dr,a=(0,s.eL)();if(t&&!this.#I.has(e)&&!this.#A.has(e))if(a){var l=document.createDocumentFragment(),c=(0,s.Pb)();l.append(c),this.#A.set(e,{effect:(0,r.tk)(()=>t(c)),fragment:l})}else this.#I.set(e,(0,r.tk)(()=>t(this.anchor)));if(this.#S.set(i,e),a){for(const[t,n]of this.#I)t===e?i.unskip_effect(n):i.skip_effect(n);for(const[t,n]of this.#A)t===e?i.unskip_effect(n.effect):i.skip_effect(n.effect);i.oncommit(this.#D),i.ondiscard(this.#P)}else o.fE&&(this.anchor=o.Xb),this.#D(i)}}},4691:function(e,t,i){"use strict";i(8549),i(199),i(8323),i(5085),i(1289),i(3377),i(4157),i(1766),i(5372)},9531:function(e,t,i){"use strict";i.d(t,{$w:function(){return r}});i(199);var n=i(896);i(8549),i(3033);function r(e){var t=n.hp,i=n.Fg;(0,n.G0)(null),(0,n.gU)(null);try{return e()}finally{(0,n.G0)(t),(0,n.gU)(i)}}},992:function(e,t,i){"use strict";i.d(t,{f0:function(){return d},n7:function(){return m}});var n=i(199),r=i(3795),o=(i(5085),i(474)),s=(i(4763),i(896)),a=i(9531);const l=Symbol("events"),c=new Set,u=new Set;function h(e,t,i,n={}){function r(e){if(n.capture||m.call(t,e),!e.cancelBubble)return(0,a.$w)(()=>i?.call(this,e))}return e.startsWith("pointer")||e.startsWith("touch")||"wheel"===e?(r.__removed=!1,(0,o.$)(()=>{r.__removed||t.addEventListener(e,r,n)})):t.addEventListener(e,r,n),r}function d(e,t,i,r,o){var s={capture:r,passive:o},a=h(e,t,i,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&(0,n.zN)(()=>{a.__removed=!0,t.removeEventListener(e,a,s)})}let f=null,p=!1;function m(e){var t=this,i=t.ownerDocument,n=e.type,o=e.composedPath?.()||[],a=o[0]||e.target;f=e,p||(p=!0,setTimeout(()=>{p=!1,f=null}));var c=0,u=f===e&&e[l];if(u){var h=o.indexOf(u);if(-1!==h&&(t===document||t===window))return void(e[l]=t);var d=o.indexOf(t);if(-1===d)return;h<=d&&(c=h)}if((a=o[c]||e.target)!==t){(0,r.Qu)(e,"currentTarget",{configurable:!0,get(){return a||i}});var m=s.hp,_=s.Fg;(0,s.G0)(null),(0,s.gU)(null);try{for(var g,y=[];null!==a&&a!==t;){try{var v=a[l]?.[n];null==v||a.disabled&&e.target!==a||v.call(a,e)}catch(e){g?y.push(e):g=e}if(e.cancelBubble)break;c++,a=c<o.length?o[c]:null}if(g){for(let e of y)queueMicrotask(()=>{throw e});throw g}}finally{e[l]=t,delete e.currentTarget,(0,s.G0)(m),(0,s.gU)(_)}}}i.d(t,["Sr",0,u,"Ts",0,c])},3033:function(e,t,i){"use strict";i.d(t,{qw:function(){return o}});i(5085),i(4157),i(474);var n=i(8549);let r=!1;function o(){r||(r=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>
2{if(!e.defaultPrevented)for(const t of e.target.elements)t[n.Al]?.()})},{capture:!0}))}},5085:function(e,t,i){"use strict";i.d(t,{E$:function(){return u},K2:function(){return d},Ub:function(){return f},W0:function(){return c},Xb:function(){return s},cL:function(){return h},fE:function(){return a},mK:function(){return l},no:function(){return p}});i(8549);var n=i(4763),r=i(7051),o=i(4157);let s,a=!1;function l(e){a=e}function c(e){if(null===e)throw r.eZ(),n.kD;return s=e}function u(){return c((0,o.M$)(s))}function h(e){if(a){if(null!==(0,o.M$)(s))throw r.eZ(),n.kD;s=e}}function d(e=1){if(a){for(var t=e,i=s;t--;)i=(0,o.M$)(i);s=i}}function f(e=!0){for(var t=0,i=s;;){if(8===i.nodeType){var n=i.data;if("]"===n){if(0===t)return i;t-=1}else("["===n||"[!"===n||"["===n[0]&&!isNaN(Number(n.slice(1))))&&(t+=1)}var r=(0,o.M$)(i);e&&i.remove(),i=r}}function p(e){if(!e||8!==e.nodeType)throw r.eZ(),n.kD;return e.data}},4157:function(e,t,i){"use strict";i.d(t,{Ey:function(){return p},Iu:function(){return x},Lo:function(){return r},M$:function(){return g},MC:function(){return w},N4:function(){return S},Pb:function(){return m},Wh:function(){return E},Zj:function(){return _},eL:function(){return T},es:function(){return v},hg:function(){return b},jf:function(){return y}});var n,r,o,s,a=i(5085),l=(i(3094),i(3795)),c=i(896),u=i(2),h=i(8549),d=i(9325),f=i(4763);function p(){if(void 0===n){n=window,document,r=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,i=Text.prototype;o=(0,l.J8)(t,"firstChild").get,s=(0,l.J8)(t,"nextSibling").get,(0,l.ZZ)(e)&&(e[h.cQ]=void 0,e[h.zV]=null,e[h.z2]=void 0,e.__e=void 0),(0,l.ZZ)(i)&&(i[h.HE]=void 0)}}function m(e=""){return document.createTextNode(e)}function _(e){return o.call(e)}function g(e){return s.call(e)}function y(e,t){if(!a.fE)return _(e);var i=_(a.Xb);if(null===i)i=a.Xb.appendChild(m());else if(t&&3!==i.nodeType){var n=m();return i?.before(n),(0,a.W0)(n),n}return t&&S(i),(0,a.W0)(i),i}function v(e,t=!1){if(!a.fE){var i=_(e);return i instanceof Comment&&""===i.data?g(i):i}if(t){if(3!==a.Xb?.nodeType){var n=m();return a.Xb?.before(n),(0,a.W0)(n),n}S(a.Xb)}return a.Xb}function x(e,t=!1){if(!a.fE)return _(e);var i=y(e,t);return(0,a.cL)(e),i}function b(e,t=1,i=!1){let n=a.fE?a.Xb:e;for(var r;t--;)r=n,n=g(n);if(!a.fE)return n;if(i){if(3!==n?.nodeType){var o=m();return null===n?r?.after(o):n.before(o),(0,a.W0)(o),o}S(n)}return(0,a.W0)(n),n}function w(e){e.textContent=""}function T(){return!!u.I0&&(null===d.es&&!!(32768&c.Fg.f))}function E(e,t,i){return null==t||t===f.iW?i?document.createElement(e,{is:i}):document.createElement(e):i?document.createElementNS(t,e,{is:i}):document.createElementNS(t,e)}function S(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;null!==t&&3===t.nodeType;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}},1289:function(e,t,i){"use strict";i.d(t,{L:function(){return o}});var n=i(4157);const r=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function o(e){var t=(0,n.Wh)("template");return t.innerHTML=function(e){return r?.createHTML(e)??e}(e.replaceAll("<!>","\x3c!----\x3e")),t.content}},474:function(e,t,i){"use strict";i.d(t,{$:function(){return a},e:function(){return l}});var n=i(3795),r=i(9325);let o=[];function s(){var e=o;o=[],(0,n.oO)(e)}function a(e){if(0===o.length&&!r.OH){var t=o;queueMicrotask(()=>{t===o&&s()})}o.push(e)}function l(){for(;o.length>0;)s()}},3377:function(e,t,i){"use strict";i.d(t,{BC:function(){return h},Im:function(){return u},Qq:function(){return c},mX:function(){return a},vU:function(){return l}});var n=i(5085),r=i(4157),o=i(1289),s=i(896);i(4763),i(8549);function a(e,t){var i=s.Fg;null===i.nodes&&(i.nodes={start:e,end:t,a:null,t:null})}function l(e,t){var i,s=!!(1&t),l=!!(2&t),c=!e.startsWith("<!>");return()=>{if(n.fE)return a(n.Xb,null),n.Xb;void 0===i&&(i=(0,o.L)(c?e:"<!>"+e),s||(i=(0,r.Zj)(i)));var t=l||r.Lo?document.importNode(i,!0):i.cloneNode(!0);s?a((0,r.Zj)(t),t.lastChild):a(t,t);return t}}function c(e=""){if(!n.fE){var t=(0,r.Pb)(e+"");return a(t,t),t}var i=n.Xb;return 3!==i.nodeType?(i.before(i=(0,r.Pb)()),(0,n.W0)(i)):(0,r.N4)(i),a(i,i),i}function u(){if(n.fE)return a(n.Xb,null),n.Xb;var e=document.createDocumentFragment(),t=document.createComment(""),i=(0,r.Pb)();return e.append(t,i),a(t,i),e}function h(e,t){if(n.fE){var i=s.Fg;return 32768&i.f&&null!==i.nodes.end||(i.nodes.end=n.Xb),void(0,n.E$)()}null!==e&&e.before(t)}},558:function(e,t,i){"use strict";i.d(t,{i:function(){return o},n:function(){return s}});i(4763),i(4157);var n=i(8549),r=(i(3795),i(896));new WeakMap;function o(e){var t=r.Fg;if(null===t)return r.hp.f|=n.dH,e;if(!(32768&t.f||4&t.f))throw e;s(e,t)}function s(e,t){if(!(null!==t&&16384&t.f)){for(;null!==t;){if(128&t.f&&!(t.f&(16384|n.df))){if(!(32768&t.f))throw e;try{return void t.b.error(e)}catch(t){e=t}}t=t.parent}throw e}}},5345:function(e,t,i){"use strict";function n(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function r(){throw new Error("https://svelte.dev/e/derived_references_self")}function o(e,t,i){throw new Error("https://svelte.dev/e/each_key_duplicate")}function s(e,t,i){throw new Error("https://svelte.dev/e/each_key_volatile")}function a(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function l(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function c(e){throw new Error("https://svelte.dev/e/effect_orphan")}function u(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function h(){throw new Error("https://svelte.dev/e/hydration_failed")}function d(e){throw new Error("https://svelte.dev/e/props_invali
2d_value")}function f(e){throw new Error("https://svelte.dev/e/rune_outside_svelte")}function p(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function m(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function _(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function g(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}i.d(t,{BT:function(){return a},Cl:function(){return u},JJ:function(){return g},R0:function(){return s},Uw:function(){return p},Vv:function(){return h},YY:function(){return m},aQ:function(){return n},cN:function(){return r},fi:function(){return l},rZ:function(){return _},sI:function(){return o},tB:function(){return c},vo:function(){return d},xU:function(){return f}})},1626:function(e,t,i){"use strict";i.d(t,{BCw:function(){return d.BC},Ekk:function(){return ie},Lcc:function(){return re},jfp:function(){return v.jf},$z$:function(){return k},Imx:function(){return d.Im},s9R:function(){return R},iTV:function(){return a.iT},unG:function(){return b.eO},Xdt:function(){return b.Xd},__1:function(){return S},f0J:function(){return L.f0},esp:function(){return v.es},vUu:function(){return d.vU},JtY:function(){return a.Jt},qyt:function(){return P},if:function(){return _},Pe0:function(){return T},TsN:function(){return oe},Ebd:function(){return y},M3l:function(){return r.M3},iqF:function(){return r.iq},zgK:function(){return c.zg},Tk$:function(){return c.Tk},K2T:function(){return l.K2},IuP:function(){return v.Iu},uYY:function(){return o.uY},_w2:function(){return ge},VCO:function(){return o.VC},R0j:function(){return Y},cLc:function(){return l.cL},hZp:function(){return c.hZ},aIK:function(){return K},BYB:function(){return J},ysU:function(){return U},hgi:function(){return G},jax:function(){return u.j},to4:function(){return X},DZI:function(){return pe},hg4:function(){return v.hg},Hzn:function(){return de},fTr:function(){return fe},vNg:function(){return r.vN},Qq7:function(){return d.Qq},_Nj:function(){return h._N},vzK:function(){return a.vz},MWq:function(){return r.MW}});var n=i(4763),r=(i(6330),i(199));var o=i(8323),s=i(8549),a=(i(6955),i(896));new Map;var l=i(5085);var c=i(4871),u=i(6622);var h=i(3795);i(7422),i(959),i(4533);i(4381);var d=i(3377);var f=i(474),p=i(9325),m=i(5372);function _(e,t,i=!1){var n;l.fE&&(n=l.Xb,(0,l.E$)());var o=new m.G(e),s=i?65536:0;function a(e,t){if(l.fE){var i=(0,l.no)(n);if(e!==parseInt(i.substring(1))){var r=(0,l.Ub)();return(0,l.W0)(r),o.anchor=r,(0,l.mK)(!1),o.ensure(e,t),void(0,l.mK)(!0)}}o.ensure(e,t)}(0,r.om)(()=>{var e=!1;t((t,i=0)=>{e=!0,a(i,t)}),e||a(-1,null)},s)}const g=Symbol("NaN");function y(e,t,i){l.fE&&(0,l.E$)();var n=new m.G(e),s=!(0,o.hH)();(0,r.om)(()=>{var e=t();e!=e&&(e=g),s&&null!==e&&"object"==typeof e&&(e={}),n.ensure(e,i)})}var v=i(4157);var x,b=i(4223),w=i(5345);function T(e,t){return t}function E(e,t,i=!0){var n;if(e.pending.size>0){n=new Set;for(const t of e.pending.values())for(const i of t)n.add(e.items.get(i).e)}for(var o=0;o<t.length;o++){var a=t[o];if(n?.has(a)){a.f|=s.WL;const e=document.createDocumentFragment();(0,r.Ep)(a,e)}else(0,r.DI)(t[o],i)}}function S(e,t,i,n,o,u=null){var d=e,m=new Map;if(!!(4&t)){var _=e;d=l.fE?(0,l.W0)((0,v.Zj)(_)):_.appendChild((0,v.Pb)())}l.fE&&(0,l.E$)();var g,y=null,T=(0,b.Xd)(()=>{var e=i();return(0,h.PI)(e)?e:null==e?[]:(0,h.bg)(e)});var S=new Map,D=!0;function P(e){16384&z.effect.f||(z.pending.delete(e),z.fallback=y,function(e,t,i,n,o){var a,l,c,u,d,p=!!(8&n),m=t.length,_=e.items,g=I(e.effect.first),y=null,x=[],b=[];if(p)for(d=0;d<m;d+=1)c=o(t[d],d),0===((u=_.get(c).e).f&s.WL)&&(u.nodes?.a?.measure(),(l??=new Set).add(u));for(d=0;d<m;d+=1){if(c=o(t[d],d),u=_.get(c).e,null!==e.outrogroups)for(const t of e.outrogroups)t.pending.delete(u),t.done.delete(u);if(8192&u.f&&((0,r.cc)(u),p&&(u.nodes?.a?.unfix(),(l??=new Set).delete(u))),0!==(u.f&s.WL)){if(u.f^=s.WL,u!==g){var w=y?y.next:g;u===e.effect.last&&(e.effect.last=u.prev),u.prev&&(u.prev.next=u.next),u.next&&(u.next.prev=u.prev),C(e,y,u),C(e,u,w),M(u,w,i),x=[],b=[],g=I((y=u).next);continue}M(u,null,i)}if(u!==g){if(void 0!==a&&a.has(u)){if(x.length<b.length){var T,S=b[0];y=S.prev;var A=x[0],D=x[x.length-1];for(T=0;T<x.length;T+=1)M(x[T],S,i);for(T=0;T<b.length;T+=1)a.delete(b[T]);C(e,A.prev,D.next),C(e,y,A),C(e,D,S),g=S,y=D,d-=1,x=[],b=[]}else a.delete(u),M(u,g,i),C(e,u.prev,u.next),C(e,u,null===y?e.effect.first:y.next),C(e,y,u),y=u;continue}for(x=[],b=[];null!==g&&g!==u;)(a??=new Set).add(g),b.push(g),g=I(g.next);if(null===g)continue}0===(u.f&s.WL)&&x.push(u),y=u,g=I(u.next)}if(null!==e.outrogroups){for(const t of e.outrogroups)0===t.pending.size&&(E(e,(0,h.bg)(t.done)),e.outrogroups?.delete(t));0===e.outrogroups.size&&(e.outrogroups=null)}if(null!==g||void 0!==a){var P=[];if(void 0!==a)for(u of a)8192&u.f||P.push(u);for(;null!==g;)8192&g.f||g===e.fallback||P.push(g),g=I(g.next);var R=P.length;if(R>0){var L=4&n&&0===m?i:null;if(p){for(d=0;d<R;d+=1)P[d].nodes?.a?.measure();for(d=0;d<R;d+=1)P[d].nodes?.a?.fix()}!function(e,t,i){for(var n,o=t.length,s=t.length,a=0;a<o;a++){let i=t[a];(0,r.r4)(i,()=>{if(n){if(n.pending.delete(i),n.done.add(i),0===n.pending.size){var t=e.outrogroups;E(e,(0,h.bg)(n.done)),t.delete(n),0===t.size&&(e.outrogroups=null)}}else s-=1},!1)}if(0===s){var l=null!==i&&0===e.pending.size;if(l){var c=i,u=c.parentNode;(0,v.MC)(u),u.append(c),e.items.clear()}E(e,t,!l)}else n={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(n)}(e,P,L)}}p&&(0,f.$)(()=>
2{if(void 0!==l)for(u of l)u.nodes?.a?.apply()})}(z,g,d,t,n),null!==y&&(0===g.length?0===(y.f&s.WL)?(0,r.cc)(y):(y.f^=s.WL,M(y,null,d)):(0,r.r4)(y,()=>{y=null})))}function R(e){z.pending.delete(e)}var L=(0,r.om)(()=>{var e=(g=(0,a.Jt)(T)).length;let h=!1;l.fE&&("[!"===(0,l.no)(d)!==(0===e)&&(d=(0,l.Ub)(),(0,l.W0)(d),(0,l.mK)(!1),h=!0));for(var f=new Set,_=p.Dr,b=(0,v.eL)(),E=0;E<e;E+=1){l.fE&&8===l.Xb.nodeType&&"]"===l.Xb.data&&(d=l.Xb,h=!0,(0,l.mK)(!1));var I=g[E],M=n(I,E),C=D?null:m.get(M);C?(C.v&&(0,c.LY)(C.v,I),C.i&&(0,c.LY)(C.i,E),b&&_.unskip_effect(C.e)):(C=A(m,D?d:x??=(0,v.Pb)(),I,M,E,o,t,i),D||(C.e.f|=s.WL),m.set(M,C)),f.add(M)}if(0===e&&u&&!y&&(D?y=(0,r.tk)(()=>u(d)):(y=(0,r.tk)(()=>u(x??=(0,v.Pb)()))).f|=s.WL),e>f.size&&w.sI("","",""),l.fE&&e>0&&(0,l.W0)((0,l.Ub)()),!D)if(S.set(_,f),b){for(const[e,t]of m)f.has(e)||_.skip_effect(t.e);_.oncommit(P),_.ondiscard(R)}else P(_);h&&(0,l.mK)(!0),(0,a.Jt)(T)}),z={effect:L,flags:t,items:m,pending:S,outrogroups:null,fallback:y};D=!1,l.fE&&(d=l.Xb)}function I(e){for(;null!==e&&!(32&e.f);)e=e.next;return e}function A(e,t,i,n,o,s,a,l){var u=1&a?16&a?(0,c.sP)(i):(0,c.zg)(i,!1,!1):null,h=2&a?(0,c.sP)(o):null;return{v:u,i:h,e:(0,r.tk)(()=>(s(t,u??i,h??o,l),()=>{e.delete(n)}))}}function M(e,t,i){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end,o=t&&0===(t.f&s.WL)?t.nodes.start:i;null!==n;){var a=(0,v.M$)(n);if(o.before(n),n===r)return;n=a}}function C(e,t,i){null===t?e.effect.first=i:t.next=i,null===i?e.effect.last=t:i.prev=t}var D=i(7051);function P(e,t,i=!1,o=!1,s=!1,c=!1){var u=e,h="";if(i){var f=e;l.fE&&(u=(0,l.W0)((0,v.Zj)(f)))}(0,r.vN)(()=>{var e=a.Fg;if(h!==(h=t()??"")){if(i&&!l.fE)return e.nodes=null,f.innerHTML=h,void(""!==h&&(0,d.mX)((0,v.Zj)(f),f.lastChild));if(null!==e.nodes&&((0,r.mk)(e.nodes.start,e.nodes.end),e.nodes=null),""!==h){if(l.fE){l.Xb.data;for(var c=(0,l.E$)(),p=c;null!==c&&(8!==c.nodeType||""!==c.data);)p=c,c=(0,v.M$)(c);if(null===c)throw D.eZ(),n.kD;return(0,d.mX)(l.Xb,p),void(u=(0,l.W0)(c))}var m=o?n.pQ:s?n.ON:void 0,_=(0,v.Wh)(o?"svg":s?"math":"template",m);_.innerHTML=h;var g=o||s?_:_.content;if((0,d.mX)((0,v.Zj)(g),g.lastChild),o||s)for(;(0,v.Zj)(g);)u.before((0,v.Zj)(g));else u.before(g)}}else l.fE&&(0,l.E$)()})}i(4691);function R(e,t,i){var n;l.fE&&(n=l.Xb,(0,l.E$)());var o=new m.G(e);(0,r.om)(()=>{var e=t()??null;if(l.fE&&"["===(0,l.no)(n)!==(null!==e)){var r=(0,l.Ub)();return(0,l.W0)(r),o.anchor=r,(0,l.mK)(!1),o.ensure(e,e&&(t=>i(t,e))),void(0,l.mK)(!0)}o.ensure(e,e&&(t=>i(t,e)))},65536)}new Set;i(9531);var L=i(992),z=i(3033);function F(e){var t,i,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(i=F(e[t]))&&(n&&(n+=" "),n+=i)}else for(i in e)e[i]&&(n&&(n+=" "),n+=i);return n}function O(){for(var e,t,i=0,n="",r=arguments.length;i<r;i++)(e=arguments[i])&&(t=F(e))&&(n&&(n+=" "),n+=t);return n}new Map([[!0,"yes"],[!1,"no"]]);function k(e){return"object"==typeof e?O(e):e??""}const B=[..." \t\n\r\f \v\ufeff"];function N(e,t=!1){var i=t?" !important;":";",n="";for(var r of Object.keys(e)){var o=e[r];null!=o&&""!==o&&(n+=" "+r+": "+o+i)}return n}function V(e){return"-"!==e[0]||"-"!==e[1]?e.toLowerCase():e}function U(e,t,i,n,r,o){var a=e[s.cQ];if(l.fE||a!==i||void 0===a){var c=function(e,t,i){var n=null==e?"":""+e;if(t&&(n=n?n+" "+t:t),i)for(var r of Object.keys(i))if(i[r])n=n?n+" "+r:r;else if(n.length)for(var o=r.length,s=0;(s=n.indexOf(r,s))>=0;){var a=s+o;0!==s&&!B.includes(n[s-1])||a!==n.length&&!B.includes(n[a])?s=a:n=(0===s?"":n.substring(0,s))+n.substring(a+1)}return""===n?null:n}(i,n,o);l.fE&&c===e.getAttribute("class")||(null==c?e.removeAttribute("class"):t?e.className=c:e.setAttribute("class",c)),e[s.cQ]=i}else if(o&&r!==o)for(var u in o){var h=!!o[u];null!=r&&h===!!r[u]||e.classList.toggle(u,h)}return o}function j(e,t={},i,n){for(var r in i){var o=i[r];t[r]!==o&&(null==i[r]?e.style.removeProperty(r):e.style.setProperty(r,o,n))}}function G(e,t,i,n){var r=e[s.z2];if(l.fE||r!==t){var o=function(e,t){if(t){var i,n,r="";if(Array.isArray(t)?(i=t[0],n=t[1]):i=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,"").trim();var o=!1,s=0,a=!1,l=[];i&&l.push(...Object.keys(i).map(V)),n&&l.push(...Object.keys(n).map(V));var c=0,u=-1;const t=e.length;for(var h=0;h<t;h++){var d=e[h];if(a?"/"===d&&"*"===e[h-1]&&(a=!1):o?o===d&&(o=!1):"/"===d&&"*"===e[h+1]?a=!0:'"'===d||"'"===d?o=d:"("===d?s++:")"===d&&s--,!a&&!1===o&&0===s)if(":"===d&&-1===u)u=h;else if(";"===d||h===t-1){if(-1!==u){var f=V(e.substring(c,u).trim());l.includes(f)||(";"!==d&&h++,r+=" "+e.substring(c,h).trim()+";")}c=h+1,u=-1}}}return i&&(r+=N(i)),n&&(r+=N(n,!0)),""===(r=r.trim())?null:r}return null==e?null:String(e)}(t,n);l.fE&&o===e.getAttribute("style")||(null==o?e.removeAttribute("style"):e.style.cssText=o),e[s.z2]=t}else n&&(Array.isArray(n)?(j(e,i?.[0],n[0]),j(e,i?.[1],n[1],"important")):j(e,i,n));return n}var $=i(2320);Symbol("class"),Symbol("style");const H=Symbol("is custom element"),Z=Symbol("is html"),q=s.r6?"link":"LINK",W=s.r6?"progress":"PROGRESS";function Y(e){if(l.fE){var t=!1,i=()=>
2{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;K(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var n=e.checked;K(e,"checked",null),e.checked=n}}};e[s.Al]=i,(0,f.$)(i),(0,z.qw)()}}function X(e,t){var i=Q(e);i.value!==(i.value=t??void 0)&&(e.value!==t||0===t&&e.nodeName===W)&&(e.value=t??"")}function J(e,t){var i=Q(e);i.checked!==(i.checked=t??void 0)&&(e.checked=t)}function K(e,t,i,n){var r=Q(e);l.fE&&(r[t]=e.getAttribute(t),"src"===t||"srcset"===t||"href"===t&&e.nodeName===q)||r[t]!==(r[t]=i)&&("loading"===t&&(e[s.mQ]=i),null==i?e.removeAttribute(t):"string"!=typeof i&&te(e).has(t)?e[t]=i:e.setAttribute(t,i))}function Q(e){return e[s.zV]??={[H]:e.nodeName.includes("-"),[Z]:e.namespaceURI===n.iW}}var ee=new Map;function te(e){var t,i=e.getAttribute("is")||e.nodeName,n=ee.get(i);if(n)return n;ee.set(i,n=new Set);for(var r=e,o=Element.prototype;o!==r;){for(var s in t=(0,h.CL)(r))t[s].set&&"innerHTML"!==s&&"textContent"!==s&&"innerText"!==s&&n.add(s);r=(0,h.Oh)(r)}return n}i(1289);new Set;function ie(e,t,i){var n=(0,h.J8)(e,t);n&&n.set&&(e[t]=i,(0,r.zN)(()=>{e[t]=null}))}new WeakMap;function ne(e,t){return e===t||e?.[s.x3]===t}function re(e=(0,o.lQ)(),t,i,n){var l=o.UL.r,c=a.Fg;return(0,r.QZ)(()=>{var o,u;return(0,r.VB)(()=>{o=u,u=n?.()||[],(0,a.vz)(()=>{ne(i(...u),e)||(t(e,...u),o&&ne(i(...o),e)&&t(null,...o))})}),()=>{let n=c;for(;n!==l&&null!==n.parent&&n.parent.f&s.df;)n=n.parent;const r=n.teardown;n.teardown=()=>{u&&ne(i(...u),e)&&t(null,...u),r?.()}}}),e}function oe(e=!1){const t=o.UL,i=t.l.u;if(!i)return;let n=()=>(0,a.iT)(t.s);if(e){let e=0,i={};const r=(0,b.un)(()=>{let n=!1;const r=t.s;for(const e in r)r[e]!==i[e]&&(i[e]=r[e],n=!0);return n&&e++,e});n=()=>(0,a.Jt)(r)}i.b.length&&(0,r.Go)(()=>{se(t,n),(0,h.oO)(i.b)}),(0,r.MW)(()=>{const e=(0,a.vz)(()=>i.m.map(h.eF));return()=>{for(const t of e)"function"==typeof t&&t()}}),i.a.length&&(0,r.MW)(()=>{se(t,n),(0,h.oO)(i.a)})}function se(e,t){if(e.l.s)for(const t of e.l.s)(0,a.Jt)(t);t()}var ae=i(3773),le=i(9048);let ce=!1,ue=!1,he=Symbol("unmounted");function de(e,t,i){const n=i[t]??={store:null,source:(0,c.zg)(void 0),unsubscribe:h.lQ};if(n.store!==e&&!(he in i))if(n.unsubscribe(),n.store=e??null,null==e)n.source.v=void 0,n.unsubscribe=h.lQ;else{var r=!0;n.unsubscribe=(0,ae.T)(e,e=>{r?n.source.v=e:(0,c.hZ)(n.source,e)}),r=!1}return e&&he in i?(0,le.Jt)(e):(0,a.Jt)(n.source)}function fe(e,t){return me(e,t),t}function pe(){const e={};return[e,function(){(0,r.zN)(()=>{for(var t in e){e[t].unsubscribe()}(0,h.Qu)(e,he,{enumerable:!1,value:!0})})}]}function me(e,t){ce=!0;try{e.set(t)}finally{ce=!1}}var _e=i(2);function ge(e,t,i,n){var r=!_e.LM||!!(2&i),o=!!(8&i),l=!!(16&i),u=n,d=!0,f=void 0,p=()=>l&&r?(f??=(0,b.un)(n),(0,a.Jt)(f)):(d&&(d=!1,u=l?(0,a.vz)(n):n),u);let m;if(o){var _=s.x3 in e||s.l3 in e;m=(0,h.J8)(e,t)?.set??(_&&t in e?i=>e[t]=i:void 0)}var g,y,v=!1;if(o?[g,v]=function(e){var t=ue;try{return ue=!1,[e(),ue]}finally{ue=t}}(()=>e[t]):g=e[t],void 0===g&&void 0!==n&&(g=p(),m&&(r&&w.vo(t),m(g))),y=r?()=>{var i=e[t];return void 0===i?p():(d=!0,i)}:()=>{var i=e[t];return void 0!==i&&(u=void 0),void 0===i?u:i},r&&!(4&i))return y;if(m){var x=e.$$legacy;return function(e,t){return arguments.length>0?(r&&t&&!x&&!v||m(t?y():e),e):y()}}var T=!1,E=(1&i?b.un:b.Xd)(()=>(T=!1,y()));o&&(0,a.Jt)(E);var S=a.Fg;return function(e,t){if(arguments.length>0){const i=t?(0,a.Jt)(E):r&&o?(0,$.B)(e):e;return(0,c.hZ)(E,i),T=!0,void 0!==u&&(u=i),e}return a.WI&&T||16384&S.f?E.v:(0,a.Jt)(E)}}i(9234),i(737);i(63);class ye{#R;#L;constructor(e){var t=new Map,i=(e,i)=>{var n=(0,c.zg)(i,!1,!1);return t.set(e,n),n};const n=new Proxy({...e.props||{},$$events:{}},{get(e,n){return(0,a.Jt)(t.get(n)??i(n,Reflect.get(e,n)))},has(e,n){return n===s.l3||((0,a.Jt)(t.get(n)??i(n,Reflect.get(e,n))),Reflect.has(e,n))},set(e,n,r){return(0,c.hZ)(t.get(n)??i(n,r),r),Reflect.set(e,n,r)}});this.#L=(e.hydrate?u.Qv:u.Or)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),_e.I0||e?.props?.$$host&&!1!==e.sync||(0,p.qX)(),this.#R=n.$$events;for(const e of Object.keys(this.#L))"$set"!==e&&"$destroy"!==e&&"$on"!==e&&(0,h.Qu)(this,e,{get(){return this.#L[e]},set(t){this.#L[e]=t},enumerable:!0});this.#L.$set=e=>{Object.assign(n,e)},this.#L.$destroy=()=>{(0,u.vs)(this.#L)}}$set(e){this.#L.$set(e)}$on(e,t){this.#R[e]=this.#R[e]||[];const i=(...e)=>t.call(this,...e);return this.#R[e].push(i),()=>{this.#R[e]=this.#R[e].filter(e=>e!==i)}}$destroy(){this.#L.$destroy()}}let ve;function xe(e,t,i,n){const r=i[e]?.type;if(t="Boolean"===r&&"boolean"!=typeof t?null!=t:t,!n||!i[e])return t;if("toAttribute"===n)switch(r){case"Object":case"Array":return null==t?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return null==t?null:t;default:return t}else switch(r){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":default:return t;case"Number":return null!=t?+t:t}}"function"==typeof HTMLElement&&(ve=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;
2constructor(e,t,i){super(),this.$$ctor=e,this.$$s=t,i&&(this.$$shadowRoot=this.attachShadow(i))}addEventListener(e,t,i){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const i=this.$$c.$on(e,t);this.$$l_u.set(t,i)}super.addEventListener(e,t,i)}removeEventListener(e,t,i){if(super.removeEventListener(e,t,i),this.$$c){const e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function t(e){return t=>{const i=(0,v.Wh)("slot");"default"!==e&&(i.name=e),(0,d.BC)(t,i)}}const i={},n=function(e){const t={};return e.childNodes.forEach(e=>{t[e.slot||"default"]=!0}),t}(this);for(const o of this.$$s)o in n&&("default"!==o||this.$$d.children?i[o]=t(o):(this.$$d.children=t(o),i.default=!0));for(const s of this.attributes){const a=this.$$g_p(s.name);a in this.$$d||(this.$$d[a]=xe(a,s.value,this.$$p_d,"toProp"))}for(const l in this.$$p_d)l in this.$$d||void 0===this[l]||(this.$$d[l]=this[l],delete this[l]);this.$$c=(e={component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:i,$$host:this}},new ye(e)),this.$$me=(0,r.Fc)(()=>{(0,r.VB)(()=>{this.$$r=!0;for(const e of(0,h.d$)(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];const t=xe(e,this.$$d[e],this.$$p_d,"toAttribute");null==t?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(const c in this.$$l)for(const u of this.$$l[c]){const f=this.$$c.$on(c,u);this.$$l_u.set(u,f)}this.$$l={}}var e}attributeChangedCallback(e,t,i){this.$$r||(e=this.$$g_p(e),this.$$d[e]=xe(e,i,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return(0,h.d$)(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});i(1766),i(3094)},737:function(e,t,i){"use strict";i.d(t,{J:function(){return n}});i(4871),i(896);let n=null},2320:function(e,t,i){"use strict";i.d(t,{B:function(){return c},N:function(){return u}});var n=i(896),r=i(3795),o=i(4871),s=i(8549),a=i(4763),l=i(5345);i(7422),i(4533),i(2);function c(e){if("object"!=typeof e||null===e||s.x3 in e||s.r3 in e)return e;const t=(0,r.Oh)(e);if(t!==r.N7&&t!==r.ve)return e;var i=new Map,u=(0,r.PI)(e),h=(0,o.wk)(0),d=null,f=n.pJ,p=e=>{if(n.pJ===f)return e();var t=n.hp,i=n.pJ;(0,n.G0)(null),(0,n.eB)(f);var r=e();return(0,n.G0)(t),(0,n.eB)(i),r};u&&i.set("length",(0,o.wk)(e.length,d));return new Proxy(e,{defineProperty(e,t,n){"value"in n&&!1!==n.configurable&&!1!==n.enumerable&&!1!==n.writable||l.Uw();var r=i.get(t);return void 0===r?p(()=>{var e=(0,o.wk)(n.value,d);return i.set(t,e),e}):(0,o.hZ)(r,n.value,!0),!0},deleteProperty(e,t){var n=i.get(t);if(void 0===n){if(t in e){const e=p(()=>(0,o.wk)(a.UP,d));i.set(t,e),(0,o.GV)(h)}}else(0,o.hZ)(n,a.UP),(0,o.GV)(h);return!0},get(t,l,u){if(l===s.x3)return e;var h=i.get(l),f=l in t;if(void 0!==h||f&&!(0,r.J8)(t,l)?.writable||(h=p(()=>{var e=c(f?t[l]:a.UP),i=(0,o.wk)(e,d);return i}),i.set(l,h)),void 0!==h){var m=(0,n.Jt)(h);return m===a.UP?void 0:m}return Reflect.get(t,l,u)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),o=i.get(t);if(void 0!==o){var s=(0,n.Jt)(o);if(s===a.UP)return;if(!r||!("value"in r))return{enumerable:!0,configurable:!0,value:s,writable:!0};r.value=s}return r},has(e,t){if(t===s.x3)return!0;var l=i.get(t),u=void 0!==l&&l.v!==a.UP||Reflect.has(e,t);if((void 0!==l||null!==n.Fg&&(!u||(0,r.J8)(e,t)?.writable))&&(void 0===l&&(l=p(()=>{var i=u?c(e[t]):a.UP,n=(0,o.wk)(i,d);return n}),i.set(t,l)),(0,n.Jt)(l)===a.UP))return!1;return u},set(e,t,n,s){var l=i.get(t),f=t in e;if(u&&"length"===t)for(var m=n;m<l.v;m+=1){var _=i.get(m+"");void 0!==_?(0,o.hZ)(_,a.UP):m in e&&(_=p(()=>(0,o.wk)(a.UP,d)),i.set(m+"",_))}if(void 0===l)f&&!(0,r.J8)(e,t)?.writable||(l=p(()=>(0,o.wk)(void 0,d)),(0,o.hZ)(l,c(n)),i.set(t,l));else{f=l.v!==a.UP;var g=p(()=>c(n));(0,o.hZ)(l,g)}var y=Reflect.getOwnPropertyDescriptor(e,t);if(y?.set&&y.set.call(s,n),!f){if(u&&"string"==typeof t){var v=i.get("length"),x=Number(t);Number.isInteger(x)&&x>=v.v&&(0,o.hZ)(v,x+1)}(0,o.GV)(h)}return!0},ownKeys(e){(0,n.Jt)(h);var t=Reflect.ownKeys(e).filter(e=>{var t=i.get(e);return void 0===t||t.v!==a.UP});for(var[r,o]of i)o.v===a.UP||r in e||t.push(r);return t},setPrototypeOf(){l.YY()}})}function u(e){try{if(null!==e&&"object"==typeof e&&s.x3 in e)return e[s.x3]}catch{}return e}new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"])},4381:function(e,t,i){"use strict";i.d(t,{Bq:function(){return l},gW:function(){return h},sO:function(){return u}});i(8549);var n=i(8323),r=i(558),o=i(896),s=i(9325),a=i(4223);i(199);function l(e,t,i,s){const l=(0,n.hH)()?a.un:a.Xd;var d=e.filter(e=>!e.settled),f=t.map(l);if(0!==i.length||0!==d.length){var p=o.Fg,m=c(),_=1===d.length?d[0].promise:d.length>1?Promise.all(d.map(e=>e.promise)):null,g=h();0!==i.length?_?_.then(()=>{m(),v(),u()}):v():_.then(()=>y([])).finally(g)}else s(f);function y(e){if(!(16384&p.f)){m();try{s([...f,...e])}catch(e){(0,r.n)(e,p)}u()}}function v(){Promise.all(i.map(e=>(0,a.zx)(e))).then(y).catch(e=>(0,r.n)(e,p)).finally(g)}}function c(){var e=o.Fg,t=o.hp,i=n.UL,r=s.Dr;return function(s=!0){(0,o.gU)(e),(0,o.G0)(t),(0,n.De)(i),!s||16384&e.f||(r?.activate(),r?.apply())}}function u(e=!0){(0,o.gU)(null),(0,o.G0)(null),(0,n.De)(null),e&&s.Dr?.deactivate()}function h(){var e=o.Fg,t=e.b,i=s.Dr,n=!!t?.is_rendered();return t?.update_pending_count(1,i),i.increment(n,e),()=>
2{t?.update_pending_count(-1,i),i.decrement(n,e)}}},9325:function(e,t,i){"use strict";i.d(t,{lP:function(){return M},iv:function(){return x},bD:function(){return E},Dr:function(){return y},es:function(){return P},qX:function(){return C},OH:function(){return w},nI:function(){return S},Pu:function(){return v},ec:function(){return F}});var n=i(8549),r=i(2),o=i(3795),s=i(896),a=i(5345),l=i(474),c=i(558),u=i(4871),h=i(199),d=i(3064),f=i(4763),p=i(63);i(4533),i(959);var m=i(4223);let _=null,g=null,y=null,v=null,x=null,b=null,w=!1,T=!1,E=null,S=null;var I=0;new Set;let A=1;class M{id=A++;#z=!1;linked=!0;#F=null;#O=null;async_deriveds=new Map;current=new Map;previous=new Map;#k=new Set;#B=new Set;#N=0;#V=new Map;#U=null;#j=[];#G=[];#d=new Set;#f=new Set;#$=new Map;#H=new Set;is_fork=!1;#Z=!1;constructor(){null===g?_=g=this:(g.#O=this,this.#F=g),g=this}#q(){if(this.is_fork)return!0;for(const i of this.#V.keys()){for(var e=i,t=!1;null!==e.parent;){if(this.#$.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#$.has(e)||this.#$.set(e,{d:[],m:[]}),this.#H.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var i=this.#$.get(e);if(i){for(var n of(this.#$.delete(e),i.d))(0,p.T)(n,2048),t(n);for(n of i.m)(0,p.T)(n,4096),t(n)}this.#H.add(e)}#w(){var e=[];for(const r of this.#j)if(!(16384&r.f)&&6144&r.f){for(var t=r,i=!1;null!==t.parent;){var n=(t=t.parent).f;if(96&n){if(!(1024&n)){i=!0;break}t.f^=1024}}i||e.push(t)}return this.#j=[],e}#W(){this.#z=!0;for(const e of this.#d)this.#f.delete(e),(0,p.T)(e,2048),this.schedule(e);for(const e of this.#f)(0,p.T)(e,4096),this.schedule(e);this.apply();for(var e=E=[],t=[],i=S=[];this.#j.length>0;){I++>1e3&&(this.#Y(),D());for(const i of this.#w())try{this.#X(i,e,t)}catch(e){throw k(i),this.#q()||this.discard(),e}}if(y=null,i.length>0){var n=M.ensure();for(const e of i)n.schedule(e)}if(E=null,S=null,this.#q()){this.#J(t),this.#J(e);for(const[e,t]of this.#$)O(e,t);return void(i.length>0&&y.#W())}const o=this.#K();if(o)return this.#J(t),this.#J(e),void o.#Q(this);this.#d.clear(),this.#f.clear();for(const e of this.#k)e(this);this.#k.clear(),v=this,R(t),R(e),v=null,this.#U?.resolve();var s=y;if(0!==this.#N||0!==this.#j.length&&null===s||(this.#Y(),r.I0&&(this.#D(),y=s)),this.#j.length>0)if(null!==s){for(const e of this.#j)s.#j.push(e);this.#j=[]}else s=this;null!==s&&(u.bJ.clear(),s.#W())}#X(e,t,i){e.f^=1024;for(var o=e.first;null!==o;){var a=o.f,l=!!(96&a);if(!(l&&!!(1024&a)||!!(8192&a)||this.#$.has(o))&&null!==o.fn){l?o.f^=1024:4&a?t.push(o):r.I0&&a&(8|n.Qy)?i.push(o):(0,s.Kj)(o)&&(16&a&&this.#f.add(o),(0,s.gJ)(o));var c=o.first;if(null!==c){o=c;continue}}for(;null!==o;){var u=o.next;if(null!==u){o=u;break}o=o.parent}}}#K(){for(var e=this.#F;null!==e;){if(!e.is_fork)for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e;e=e.#F}return null}#Q(e){for(const[t,i]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,i);for(const[t,i]of e.async_deriveds){const e=this.async_deriveds.get(t);e&&i.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#d,e.#f);const t=e=>{var i=e.reactions;if(null!==i&&(!(2&e.f)||6144&e.f))for(const e of i){var r=e.f;if(2&r)t(e);else{var o=e;r&(16|n.VD)&&!this.async_deriveds.has(o)&&(this.#f.delete(o),(0,p.T)(o,2048),this.schedule(o))}}};for(const e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#Y(),y=this,this.#W()}#J(e){for(var t=0;t<e.length;t+=1)(0,d.p)(e[t],this.#d,this.#f)}capture(e,t,i=!1){e.v===f.UP||this.previous.has(e)||this.previous.set(e,e.v),0===(e.f&n.dH)&&(this.current.set(e,[t,i]),x?.set(e,t)),this.is_fork||(e.v=t)}activate(){y=this}deactivate(){y=null,x=null}flush(){try{0,T=!0,y=this,this.#W()}finally{I=0,b=null,E=null,S=null,T=!1,y=null,x=null,u.bJ.clear()}}discard(){for(const e of this.#B)e(this);this.#B.clear();for(const e of this.async_deriveds.values())e.reject(m.gQ);this.#Y(),this.#U?.resolve()}register_created_effect(e){this.#G.push(e)}#D(){for(let h=_;null!==h;h=h.#O){var e=h.id<this.id,t=[];for(const[n,[r,o]]of this.current){if(h.current.has(n)){var i=h.current.get(n)[0];if(!e||r===i)continue;h.current.set(n,[r,o])}t.push(n)}if(e)for(const[e,t]of this.async_deriveds){const i=h.async_deriveds.get(e);
2i&&t.promise.then(i.resolve).catch(i.reject)}var r=[...h.current.keys()].filter(e=>!h.current.get(e)[1]);if(h.#z&&0!==r.length){var o=r.filter(e=>!this.current.has(e));if(0===o.length)e&&h.discard();else if(t.length>0){if(e)for(const e of this.#H)h.unskip_effect(e,e=>{e.f&(16|n.VD)?h.schedule(e):h.#J([e])});h.activate();var s=new Set,a=new Map;for(var l of t)L(l,o,s,a);a=new Map;var c=[...h.current].filter(([e,t])=>{const i=this.current.get(e);return!i||(i[0]!==t[0]||i[1]!==t[1])}).map(([e])=>e);if(c.length>0)for(const e of this.#G)155648&e.f||!z(e,c,a)||(e.f&(16|n.VD)?((0,p.T)(e,2048),h.schedule(e)):h.#d.add(e));if(h.#j.length>0&&!h.#Z)for(var u of(h.apply(),h.#w()))h.#X(u,[],[]);h.deactivate()}}}}increment(e,t){if(this.#N+=1,e){let e=this.#V.get(t)??0;this.#V.set(t,e+1)}}decrement(e,t){if(this.#N-=1,e){let e=this.#V.get(t)??0;1===e?this.#V.delete(t):this.#V.set(t,e-1)}this.#Z||(this.#Z=!0,(0,l.$)(()=>{this.#Z=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(const t of e)this.#d.add(t);for(const e of t)this.#f.add(e);e.clear(),t.clear()}oncommit(e){this.#k.add(e)}ondiscard(e){this.#B.add(e)}settled(){return(this.#U??=(0,o.yX)()).promise}static ensure(){if(null===y){const e=y=new M;T||w||(0,l.$)(()=>{e.#z||e.flush()})}return y}apply(){if(r.I0&&(this.is_fork||null!==this.#F||null!==this.#O)){x=new Map;for(const[e,[t]]of this.current)x.set(e,t);for(let t=_;null!==t;t=t.#O)if(t!==this&&!t.is_fork){var e=!1;if(t.id<this.id)for(const[i,[,n]]of t.current)if(!n&&this.current.has(i)){e=!0;break}if(!e)for(const[e,i]of t.previous)x.has(e)||x.set(e,i)}}else x=null}schedule(e){b=e,!(e.b?.is_pending&&e.f&(12|n.Qy))||32768&e.f?this.#j.push(e):e.b.defer_effect(e)}#Y(){if(this.linked){var e=this.#F,t=this.#O;null===e?_=t:e.#O=t,null===t?g=e:t.#F=e,this.linked=!1}}}function C(e){var t=w;w=!0;try{var i;for(e&&(null===y||y.is_fork||y.flush(),i=e());;){if((0,l.e)(),null===y)return i;y.flush()}}finally{w=t}}function D(){try{a.Cl()}catch(e){0,(0,c.n)(e,b)}}let P=null;function R(e){var t=e.length;if(0!==t){for(var i=0;i<t;){var n=e[i++];if(!(24576&n.f)&&(0,s.Kj)(n)&&(P=new Set,(0,s.gJ)(n),null===n.deps&&null===n.first&&null===n.nodes&&null===n.teardown&&null===n.ac&&(0,h.qX)(n),P?.size>0)){u.bJ.clear();for(const e of P){if(24576&e.f)continue;const t=[e];let i=e.parent;for(;null!==i;)P.has(i)&&(P.delete(i),t.push(i)),i=i.parent;for(let e=t.length-1;e>=0;e--){const i=t[e];24576&i.f||(0,s.gJ)(i)}}P.clear()}}P=null}}function L(e,t,i,r){if(!i.has(e)&&(i.add(e),null!==e.reactions))for(const o of e.reactions){const e=o.f;2&e?L(o,t,i,r):e&(16|n.VD)&&!(2048&e)&&z(o,t,r)&&((0,p.T)(o,2048),F(o))}}function z(e,t,i){const n=i.get(e);if(void 0!==n)return n;if(null!==e.deps)for(const n of e.deps){if(o.mK.call(t,n))return!0;if(2&n.f&&z(n,t,i))return i.set(n,!0),!0}return i.set(e,!1),!1}function F(e){y.schedule(e)}new Map;function O(e,t){if(!(32&e.f&&1024&e.f)){2048&e.f?t.d.push(e):4096&e.f&&t.m.push(e),(0,p.T)(e,1024);for(var i=e.first;null!==i;)O(i,t),i=i.next}}function k(e){(0,p.T)(e,1024);for(var t=e.first;null!==t;)k(t),t=t.next}},4223:function(e,t,i){"use strict";i.d(t,{Mm:function(){return y},Ne:function(){return v},Xd:function(){return S},c2:function(){return M},eO:function(){return E},ef:function(){return D},gQ:function(){return w},hM:function(){return C},kX:function(){return x},un:function(){return b},w6:function(){return A},zx:function(){return T}});var n=i(8549),r=i(896),o=i(9531),s=i(2621),a=i(5345),l=i(7051),c=i(199),u=i(4871),h=(i(4533),i(2)),d=i(8323),f=i(4763),p=i(9325),m=i(4381),_=i(3795),g=i(63);let y=null;function v(e){y=e}const x=new Set;function b(e){null!==r.Fg&&(r.Fg.f|=524288);const t={ctx:d.UL,deps:null,effects:null,equals:s.aI,f:2050,fn:e,reactions:null,rv:0,v:f.UP,wv:0,parent:r.Fg,ac:null};return t}const w=Symbol("obsolete");function T(e,t,i){let o=r.Fg;null===o&&a.aQ();var s=void 0,l=(0,u.sP)(f.UP);var h=!r.hp,d=new Set;return(0,c.NQ)(()=>{var t=r.Fg;var i=(0,_.yX)();s=i.promise;try{Promise.resolve(e()).then(i.resolve,e=>{e!==n.In&&i.reject(e)}).finally(m.sO)}catch(e){i.reject(e),(0,m.sO)()}var a=p.Dr;if(h){if(32768&t.f)var c=(0,m.gW)();if(o.b?.is_rendered())a.async_deriveds.get(t)?.reject(w);else for(const e of d.values())e.reject(w);d.add(i),a.async_deriveds.set(t,i)}const f=(e,t=void 0)=>{c?.(),d.delete(i),t!==w&&(a.activate(),t?(l.f|=n.dH,(0,u.LY)(l,t)):(0!==(l.f&n.dH)&&(l.f^=n.dH),(0,u.LY)(l,e)),a.deactivate())};i.promise.then(f,e=>f(null,e||"unknown"))}),(0,c.zN)(()=>{for(const e of d)e.reject(w)}),new Promise(e=>{!function t(i){function n(){i===s?e(l):t(s)}i.then(n,n)}(s)})}function E(e){const t=b(e);return h.I0||(0,r.tT)(t),t}function S(e){const t=b(e);return t.equals=s.Og,t}function I(e){var t=e.effects;if(null!==t){e.effects=null;for(var i=0;i<t.length;i+=1)(0,c.DI)(t[i])}}function A(e){var t,i=r.Fg,n=e.parent;if(!r.WI&&null!==n&&e.v!==f.UP&&24576&n.f)return l.Fg(),e.v;
2(0,r.gU)(n);try{I(e),t=(0,r.mj)(e)}finally{(0,r.gU)(i)}return t}function M(e){var t=A(e);e.equals(t)||(e.wv=(0,r.Fq)(),p.Dr?.is_fork&&null!==e.deps||(null!==p.Dr?(p.Dr.capture(e,t,!0),p.Pu?.capture(e,t,!0)):e.v=t,null!==e.deps))?r.WI||(null!==p.iv?((0,c.oJ)()||p.Dr?.is_fork)&&p.iv.set(e,t):(0,g.x)(e)):(0,g.T)(e,1024)}function C(e){if(null!==e.effects)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),null!==t.ac&&(0,o.$w)(()=>{t.ac.abort(n.In),t.ac=null}),null!==t.fn&&(t.teardown=_.lQ),(0,r.yR)(t,0),(0,c.F3)(t))}function D(e){if(null!==e.effects)for(const t of e.effects)t.teardown&&null!==t.fn&&(0,r.gJ)(t)}},199:function(e,t,i){"use strict";i.d(t,{DI:function(){return L},Ep:function(){return V},F3:function(){return P},Fc:function(){return x},Go:function(){return v},M3:function(){return T},MW:function(){return g},NQ:function(){return S},Nq:function(){return D},QZ:function(){return w},V1:function(){return y},VB:function(){return I},cc:function(){return B},iq:function(){return E},mk:function(){return z},oJ:function(){return m},om:function(){return M},pk:function(){return R},qX:function(){return F},r4:function(){return O},tk:function(){return C},vN:function(){return A},x4:function(){return b},zN:function(){return _}});var n=i(896),r=i(8549),o=i(558),s=i(5345),a=(i(3795),i(4157)),l=i(8323),c=i(9325),u=i(4381),h=i(9531),d=i(63);function f(e){null===n.Fg&&(null===n.hp&&s.tB(e),s.fi()),n.WI&&s.BT(e)}function p(e,t){var i=n.Fg;null!==i&&8192&i.f&&(e|=8192);var r={ctx:l.UL,deps:null,nodes:null,f:2560|e,first:null,fn:t,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};c.Dr?.register_created_effect(r);var o=r;if(4&e)null!==c.bD?c.bD.push(r):c.lP.ensure().schedule(r);else if(null!==t){try{(0,n.gJ)(r)}catch(o){throw L(r),o}null!==o.deps||null!==o.teardown||null!==o.nodes||o.first!==o.last||524288&o.f||(o=o.first,16&e&&65536&e&&null!==o&&(o.f|=65536))}if(null!==o&&(o.parent=i,null!==i&&function(e,t){var i=t.last;null===i?t.last=t.first=e:(i.next=e,e.prev=i,t.last=e)}(o,i),null!==n.hp&&2&n.hp.f&&!(64&e))){var s=n.hp;(s.effects??=[]).push(o)}return r}function m(){return null!==n.hp&&!n.LW}function _(e){const t=p(8,null);return(0,d.T)(t,1024),t.teardown=e,t}function g(e){f("$effect");var t=n.Fg.f;if(!(!n.hp&&!!(32&t)&&null!==l.UL&&!l.UL.i))return y(e);var i=l.UL;(i.e??=[]).push(e)}function y(e){return p(4|r.Wr,e)}function v(e){return f("$effect.pre"),p(8|r.Wr,e)}function x(e){c.lP.ensure();const t=p(524352,e);return()=>{L(t)}}function b(e){c.lP.ensure();const t=p(524352,e);return(e={})=>new Promise(i=>{e.outro?O(t,()=>{L(t),i(void 0)}):(L(t),i(void 0))})}function w(e){return p(4,e)}function T(e,t){var i=l.UL,r={effect:null,ran:!1,deps:e};i.l.$.push(r),r.effect=I(()=>{if(e(),!r.ran){r.ran=!0;var i=n.Fg;try{(0,n.gU)(i.parent),(0,n.vz)(t)}finally{(0,n.gU)(i)}}})}function E(){var e=l.UL;I(()=>{for(var t of e.l.$){t.deps();var i=t.effect;1024&i.f&&null!==i.deps&&(0,d.T)(i,4096),(0,n.Kj)(i)&&(0,n.gJ)(i),t.ran=!1}})}function S(e){return p(524288|r.VD,e)}function I(e,t=0){return p(8|t,e)}function A(e,t=[],i=[],r=[]){(0,u.Bq)(r,t,i,t=>{p(8,()=>{e(...t.map(n.Jt))})})}function M(e,t=0){var i=p(16|t,e);return i}function C(e){return p(524320,e)}function D(e){var t=e.teardown;
2if(null!==t){const i=n.WI,r=n.hp;(0,n.fT)(!0),(0,n.G0)(null);try{t.call(null)}catch(t){(0,o.n)(t,e.parent)}finally{(0,n.fT)(i),(0,n.G0)(r)}}}function P(e,t=!1){var i=e.first;for(e.first=e.last=null;null!==i;){const e=i.ac;null!==e&&(0,h.$w)(()=>{e.abort(r.In)});var n=i.next;64&i.f?i.parent=null:L(i,t),i=n}}function R(e){for(var t=e.first;null!==t;){var i=t.next;32&t.f||L(t),t=i}}function L(e,t=!0){var i=!1;(t||262144&e.f)&&null!==e.nodes&&null!==e.nodes.end&&(z(e.nodes.start,e.nodes.end),i=!0),e.f|=r.df,P(e,t&&!i),(0,n.yR)(e,0);var o=e.nodes&&e.nodes.t;if(null!==o)for(const e of o)e.stop();D(e),e.f^=r.df,e.f|=16384;var s=e.parent;null!==s&&null!==s.first&&F(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function z(e,t){for(;null!==e;){var i=e===t?null:(0,a.M$)(e);e.remove(),e=i}}function F(e){var t=e.parent,i=e.prev,n=e.next;null!==i&&(i.next=n),null!==n&&(n.prev=i),null!==t&&(t.first===e&&(t.first=n),t.last===e&&(t.last=i))}function O(e,t,i=!0){var n=[];e.f|=256,k(e,n,!0);var r=()=>{i&&L(e),t&&t()},o=n.length;if(o>0){var s=()=>--o||r();for(var a of n)a.out(s)}else r()}function k(e,t,i){if(!(8192&e.f)){e.f^=8192;var n=e.nodes&&e.nodes.t;if(null!==n)for(const e of n)(e.is_global||i)&&t.push(e);for(var r=e.first;null!==r;){var o=r.next;if(!(64&r.f))k(r,t,!!(!!(65536&r.f)||!!(32&r.f)&&!!(16&e.f))&&i);r=o}}}function B(e){e.f&=-257,N(e,!0)}function N(e,t){if(!(256&e.f)&&8192&e.f){e.f^=8192,1024&e.f||((0,d.T)(e,2048),c.lP.ensure().schedule(e));for(var i=e.first;null!==i;){var n=i.next;N(i,!!(!!(65536&i.f)||!!(32&i.f))&&t),i=n}var r=e.nodes&&e.nodes.t;if(null!==r)for(const e of r)(e.is_global||t)&&e.in()}}function V(e,t){if(e.nodes)for(var i=e.nodes.start,n=e.nodes.end;null!==i;){var r=i===n?null:(0,a.M$)(i);t.append(i),i=r}}},2621:function(e,t,i){"use strict";function n(e){return e===this.v}function r(e,t){return e!=e?t==t:e!==t||null!==e&&"object"==typeof e||"function"==typeof e}function o(e){return!r(e,this.v)}i.d(t,{Og:function(){return o},aI:function(){return n},jX:function(){return r}})},4871:function(e,t,i){"use strict";i.d(t,{GV:function(){return A},Hv:function(){return g},LY:function(){return S},Tk:function(){return b},YM:function(){return f},bJ:function(){return p},fJ:function(){return m},hZ:function(){return w},nG:function(){return I},sP:function(){return y},wk:function(){return v},zg:function(){return x}});var n=i(896),r=i(2621),o=i(8549),s=i(5345),a=i(2),l=(i(7422),i(4533),i(8323)),c=i(9325),u=i(2320),h=i(4223),d=i(63);let f=new Set;const p=new Map;function m(e){f=e}let _=!1;function g(){_=!0}function y(e,t){var i={f:0,v:e,reactions:null,equals:r.aI,rv:0,wv:0};return i}function v(e,t){const i=y(e);return(0,n.tT)(i),i}function x(e,t=!1,i=!0){const n=y(e);return t||(n.equals=r.Og),a.LM&&i&&null!==l.UL&&null!==l.UL.l&&(l.UL.l.s??=[]).push(n),n}function b(e,t){return w(e,(0,n.vz)(()=>(0,n.Jt)(e))),t}function w(e,t,i=!1){null!==n.hp&&(!n.LW||131072&n.hp.f)&&(0,l.hH)()&&n.hp.f&(131090|o.VD)&&(null===n.Bj||!n.Bj.has(e))&&s.rZ();let r=i?(0,u.B)(t):t;return S(e,r,c.nI)}var T=null,E=0;function S(e,t,i=null){if(!e.equals(t)){n.WI?p.set(e,t):p.has(e)||p.set(e,e.v);var r=c.lP.ensure();if(r.capture(e,t),2&e.f){const t=e;2048&e.f&&(0,h.w6)(t),null===c.iv&&(0,d.x)(t)}e.wv=(0,n.Fq)(),T=null,E=0,M(e,2048,i),T=null,(0,l.hH)()&&null!==n.Fg&&1024&n.Fg.f&&!(96&n.Fg.f)&&(null===n.l_?(0,n.S0)([e]):n.l_.push(e)),!r.is_fork&&f.size>0&&!_&&I()}return t}function I(){_=!1;for(const e of f){let t;1024&e.f&&(0,d.T)(e,4096);try{t=(0,n.Kj)(e)}catch{t=!0}t&&(0,n.gJ)(e)}f.clear()}function A(e){w(e,e.v+1)}function M(e,t,i){var r=e.reactions;if(null!==r){var o=(0,l.hH)(),s=r.length;if((E+=s)>1e5&&null===T&&(T=new Set),null!==T){if(T.has(e))return;T.add(e)}for(var a=0;a<s;a++){var u=r[a],h=u.f;if(o||u!==n.Fg){var p=!(2048&h);if(p&&(0,d.T)(u,t),131072&h)f.add(u);else if(2&h){var m=u;c.iv?.delete(m),M(m,4096,i)}else if(p){var _=u;16&h&&null!==c.es&&c.es.add(_),null!==i?i.push(_):(0,c.ec)(_)}}}}}},63:function(e,t,i){"use strict";i.d(t,{T:function(){return r},x:function(){return o}});i(8549);const n=-7169;function r(e,t){e.f=e.f&n|t}function o(e){512&e.f||null===e.deps?r(e,1024):r(e,4096)}},3064:function(e,t,i){"use strict";i.d(t,{p:function(){return r}});i(8549);var n=i(63);function r(e,t,i){2048&e.f?t.add(e):4096&e.f&&i.add(e),(0,n.T)(e,1024)}},6622:function(e,t,i){"use strict";i.d(t,{Or:function(){return v},Qv:function(){return x},j:function(){return y},vs:function(){return E}});var n=i(4157),r=i(4763),o=i(896),s=i(8323),a=i(199),l=i(5085),c=i(3795),u=i(992),h=i(7051),d=i(5345),f=i(3377),p=i(6955),m=i(8549),_=i(9234);let g=!0;function y(e,t){var i=null==t?"":"object"==typeof t?`${t}`:t;i!==(e[m.HE]??=e.nodeValue)&&(e[m.HE]=i,e.nodeValue=`${i}`)}function v(e,t){return w(e,t)}function x(e,t){(0,n.Ey)(),t.intro=t.intro??!1;const i=t.target,o=l.fE,s=l.Xb;try{for(var a=(0,n.Zj)(i);a&&(8!==a.nodeType||"["!==a.data);)a=(0,n.M$)(a);if(!a)throw r.kD;(0,l.mK)(!0),(0,l.W0)(a);const o=w(e,{...t,anchor:a});return(0,l.mK)(!1),o}catch(o){if(o instanceof Error&&o.message.split("\n").some(e=>e.startsWith("https://svelte.dev/e/")))throw o;return o!==r.kD&&console.warn("Failed to hydrate: ",o),!1===t.recover&&d.Vv(),(0,n.Ey)(),(0,n.MC)(i),(0,l.mK)(!1),v(e,t)}finally{(0,l.mK)(o),(0,l.W0)(s)}}const b=new Map;function w(e,{target:t,anchor:i,props:d={},events:m,context:y,intro:v=!0,transformError:x}){(0,n.Ey)();var w=void 0,E=(0,a.x4)(()=>{var a=i??t.appendChild((0,n.Pb)());(0,_.pP)(a,{pending:()=>{}},t=>{(0,s.VC)({});var i=s.UL;if(y&&(i.c=y),m&&(d.$$events=m),l.fE&&(0,f.mX)(t,null),g=v,w=e(t,d)||(0,s.lQ)(),g=!0,l.fE&&(o.Fg.nodes.end=l.Xb,null===l.Xb||8!==l.Xb.nodeType||"]"!==l.Xb.data))throw h.eZ(),r.kD;(0,s.uY)()},x);var T=new Set,E=e=>{for(var i=0;i<e.length;i++){var n=e[i];if(!T.has(n)){T.add(n);var r=(0,p.GY)(n);for(const e of[t,document]){var o=b.get(e);void 0===o&&(o=new Map,b.set(e,o));var s=o.get(n);void 0===s?(e.addEventListener(n,u.n7,{passive:r}),o.set(n,1)):o.set(n,s+1)}}}};return E((0,c.bg)(u.Ts)),u.Sr.add(E),()=>{for(var e of T)for(const i of[t,document]){var n=b.get(i),r=n.get(e);0==--r?(i.removeEventListener(e,u.n7),n.delete(e),0===n.size&&b.delete(i)):n.set(e,r)}u.Sr.delete(E),a!==i&&a.parentNode?.removeChild(a)}});
2return T.set(w,E),w}let T=new WeakMap;function E(e,t){const i=T.get(e);return i?(T.delete(e),i(t)):Promise.resolve()}},896:function(e,t,i){"use strict";i.d(t,{Bj:function(){return E},Fg:function(){return w},Fq:function(){return z},G0:function(){return b},Jt:function(){return j},Kj:function(){return F},LW:function(){return x},S0:function(){return C},WI:function(){return g},cu:function(){return A},eB:function(){return L},fT:function(){return y},gJ:function(){return U},gU:function(){return T},hp:function(){return v},iT:function(){return Z},l_:function(){return M},mj:function(){return k},oz:function(){return I},pJ:function(){return R},tT:function(){return S},vz:function(){return H},yR:function(){return V}});var n=i(3795),r=i(199),o=i(8549),s=i(4871),a=i(4223),l=i(2),c=(i(7422),i(4533),i(8323)),u=i(9325),h=i(558),d=i(4763),f=i(737),p=i(9531),m=i(63);let _=!1,g=!1;function y(e){g=e}let v=null,x=!1;function b(e){v=e}let w=null;function T(e){w=e}let E=null;function S(e){null!==v&&(!l.I0&&0!==(v.f&o.EY)||2&v.f)&&(E??=new Set).add(e)}let I=null,A=0,M=null;function C(e){M=e}let D=1,P=0,R=P;function L(e){R=e}function z(){return++D}function F(e){var t=e.f;if(2048&t)return!0;if(4096&t){for(var i=e.deps,n=i.length,r=0;r<n;r++){var o=i[r];if(F(o)&&(0,a.c2)(o),o.wv>e.wv)return!0}512&t&&null===u.iv&&(0,m.T)(e,1024)}return!1}function O(e,t,i=!0){var n=e.reactions;if(null!==n&&(l.I0||null===E||!E.has(e)))for(var r=0;r<n.length;r++){var o=n[r];2&o.f?O(o,t,!1):t===o&&(i?(0,m.T)(o,2048):1024&o.f&&(0,m.T)(o,4096),(0,u.ec)(o))}}function k(e){var t=I,i=A,n=M,r=v,s=E,a=c.UL,l=x,u=R,d=e.f;I=null,A=0,M=null,v=96&d?null:e,E=null,(0,c.De)(e.ctx),x=!1,R=++P,null!==e.ac&&((0,p.$w)(()=>{e.ac.abort(o.In)}),e.ac=null);try{e.f|=o.EY;var f=(0,e.fn)();e.f|=32768;var m=B(e);if((0,c.hH)()&&null!==M&&!x&&null!==m&&!(6146&e.f))for(var _=0;_<M.length;_++)O(M[_],e);if(null!==r&&r!==e){if(P++,null!==r.deps)for(let e=0;e<i;e+=1)r.deps[e].rv=P;if(null!==t)for(const e of t)e.rv=P;null!==M&&(null===n?n=M:n.push(...M))}return 0!==(e.f&o.dH)&&(e.f^=o.dH),f}catch(t){return B(e),(0,h.i)(t)}finally{e.f^=o.EY,I=t,A=i,M=n,v=r,E=s,(0,c.De)(a),x=l,R=u}}function B(e){var t=e.deps,i=u.Dr?.is_fork;if(null!==I){var n;if(i||V(e,A),null!==t&&A>0)for(t.length=A+I.length,n=0;n<I.length;n++)t[A+n]=I[n];else e.deps=t=I;if((0,r.oJ)()&&512&e.f)for(n=A;n<t.length;n++)(t[n].reactions??=[]).push(e)}else!i&&null!==t&&A<t.length&&(V(e,A),t.length=A);return t}function N(e,t){let i=t.reactions;if(null!==i){var r=n.lc.call(i,e);if(-1!==r){var s=i.length-1;0===s?i=t.reactions=null:(i[r]=i[s],i.pop())}}if(null===i&&2&t.f&&(null===I||!n.mK.call(I,t))){var l=t;512&l.f&&(l.f^=512),l.v!==d.UP&&(0,m.x)(l),null!==l.ac&&(0,p.$w)(()=>{l.ac.abort(o.In),l.ac=null,(0,m.T)(l,2048)}),(0,a.hM)(l),V(l,0)}}function V(e,t){var i=e.deps;if(null!==i)for(var n=t;n<i.length;n++)N(e,i[n])}function U(e){var t=e.f;if(!(16384&t)){(0,m.T)(e,1024);var i=w,n=_;w=e,_=!(96&t);try{t&(16|o.Qy)?(0,r.pk)(e):(0,r.F3)(e),(0,r.Nq)(e);var s=k(e);e.teardown="function"==typeof s?s:null,e.wv=D}finally{_=n,w=i}}}function j(e){var t=!!(2&e.f);if((f.J?.add(e),null!==v&&!x)&&!(null!==w&&!!(16384&w.f)||null!==E&&E.has(e))){var i=v.deps;if(0!==(v.f&o.EY))e.rv<P&&(e.rv=P,null===I&&null!==i&&i[A]===e?A++:null===I?I=[e]:I.push(e));else{v.deps??=[],n.mK.call(v.deps,e)||v.deps.push(e);var r=e.reactions;null===r?e.reactions=[v]:n.mK.call(r,v)||r.push(v)}}if(g&&s.bJ.has(e))return s.bJ.get(e);if(t){var l=e;if(g){var c=l.v;return(1024&l.f||null===l.reactions)&&!$(l)||(c=(0,a.w6)(l)),s.bJ.set(l,c),c}var h=!(512&l.f)&&!x&&null!==v&&(_||!!(512&v.f)),d=!(32768&l.f);F(l)&&(h&&(l.f|=512),(0,a.c2)(l)),h&&!d&&((0,a.ef)(l),G(l))}if(u.iv?.has(e))return u.iv.get(e);if(0!==(e.f&o.dH))throw e.v;return e.v}function G(e){if(e.f|=512,null!==e.deps)for(const t of e.deps)(t.reactions??=[]).push(e),2&t.f&&!(512&t.f)&&((0,a.ef)(t),G(t))}function $(e){if(e.v===d.UP)return!0;if(null===e.deps)return!1;for(const t of e.deps){if(s.bJ.has(t))return!0;if(2&t.f&&$(t))return!0}return!1}function H(e){var t=x;try{return x=!0,e()}finally{x=t}}function Z(e){if("object"==typeof e&&e&&!(e instanceof EventTarget))if(o.x3 in e)q(e);else if(!Array.isArray(e))for(let t in e){const i=e[t];"object"==typeof i&&i&&o.x3 in i&&q(i)}}function q(e,t=new Set){if(!("object"!=typeof e||null===e||e instanceof EventTarget||t.has(e))){t.add(e),e instanceof Date&&e.getTime();for(let i in e)try{q(e[i],t)}catch(e){}const i=(0,n.Oh)(e);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){const t=(0,n.CL)(i);for(let i in t){const n=t[i].get;if(n)try{n.call(e)}catch(e){}}}}}},7051:function(e,t,i){"use strict";i.d(t,{CF:function(){return h},Cy:function(){return r},Fg:function(){return o},Y9:function(){return a},YY:function(){return c},_2:function(){return n},eZ:function(){return l},ns:function(){return u},zn:function(){return s}});function n(e){console.warn("https://svelte.dev/e/await_reactivity_loss")}function r(e,t){console.warn("https://svelte.dev/e/await_waterfall")}function o(){console.warn("https://svelte.dev/e/derived_inert")}function s(e,t,i){console.warn("https://svelte.dev/e/hydration_attribute_changed")}function a(e){console.warn("https://svelte.dev/e/hydration_html_changed")}function l(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function c(){console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function u(e){console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function h(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}},2077:function(){"use strict";"undefined"!=typeof window&&((window.__svelte??={}).v??=new Set).add("5")},2:function(e,t,i){"use strict";i.d(t,{I0:function(){return n},LM:function(){return r},Ny:function(){return s},_G:function(){return o}});let n=!1,r=!1,o=!1;function s(){r=!0}},6467:function(e,t,i){"use strict";(0,i(2).Ny)()},959:function(e,t,i){"use strict";i(3795)},4533:function(e,t,i){"use strict";i.d(t,{V1:function(){return o},g2:function(){return r}});var n=i(3795);i(9527);function r(e){const t=new Error,i=function(){const e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;const t=(new Error).stack;if(Error.stackTraceLimit=e,!t)return[];const i=t.split("\n"),n=[];for(let e=0;e<i.length;e++){const t=i[e],r=t.replaceAll("\\","/");if("Error"!==t.trim()){if(t.includes("validate_each_keys"))return[];r.includes("svelte/src/internal")||r.includes("node_modules/.vite")||n.push(t)}}return n}();return 0===i.length?null:(i.unshift("\n"),(0,n.Qu)(t,"stack",{value:i.join("\n")}
2),(0,n.Qu)(t,"name",{value:e}),t)}function o(e,t){throw new Error("invariant(...) was not guarded by if (DEV)")}},9527:function(e,t,i){"use strict";function n(e){throw new Error("https://svelte.dev/e/invariant_violation")}function r(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}i.d(t,{LU:function(){return n},bs:function(){return r}})},3795:function(e,t,i){"use strict";i.d(t,{CL:function(){return u},J8:function(){return c},N7:function(){return h},Oh:function(){return f},PI:function(){return n},Qu:function(){return l},ZZ:function(){return p},_N:function(){return y},bg:function(){return s},d$:function(){return a},eF:function(){return m},lc:function(){return r},mK:function(){return o},oO:function(){return _},ve:function(){return d},yX:function(){return g}});var n=Array.isArray,r=Array.prototype.indexOf,o=Array.prototype.includes,s=Array.from,a=Object.keys,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyDescriptors,h=Object.prototype,d=Array.prototype,f=Object.getPrototypeOf,p=Object.isExtensible;Object.prototype.hasOwnProperty;function m(e){return e()}function _(e){for(var t=0;t<e.length;t++)e[t]()}function g(){var e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}}function y(e,t){if(Array.isArray(e))return e;if(void 0===t||!(Symbol.iterator in e))return Array.from(e);const i=[];for(const n of e)if(i.push(n),i.length===t)break;return i}i.d(t,["lQ",0,()=>{}])},1766:function(e,t,i){"use strict";i(6955)},7414:function(e,t,i){"use strict";i.d(t,{D:function(){return a}});var n=i(896),r=i(199),o=i(4871),s=(i(7422),i(474));function a(e){let t,i=0,a=(0,o.sP)(0);return()=>{(0,r.oJ)()&&((0,n.Jt)(a),(0,r.VB)(()=>(0===i&&(t=(0,n.vz)(()=>e(()=>(0,o.GV)(a)))),i+=1,()=>{(0,s.$)(()=>{i-=1,0===i&&(t?.(),t=void 0,(0,o.GV)(a))})})))}}},9048:function(e,t,i){"use strict";i.d(t,{Jt:function(){return l},T5:function(){return a}});var n=i(3795),r=i(2621),o=i(3773);const s=[];function a(e,t=n.lQ){let i=null;const o=new Set;function a(t){if((0,r.jX)(e,t)&&(e=t,i)){const t=!s.length;for(const t of o)t[1](),s.push(t,e);if(t){for(let e=0;e<s.length;e+=2)s[e][0](s[e+1]);s.length=0}}}function l(t){a(t(e))}return{set:a,update:l,subscribe:function(r,s=n.lQ){const c=[r,s];return o.add(c),1===o.size&&(i=t(a,l)||n.lQ),r(e),()=>{o.delete(c),0===o.size&&i&&(i(),i=null)}}}}function l(e){let t;return(0,o.T)(e,e=>t=e)(),t}},3773:function(e,t,i){"use strict";i.d(t,{T:function(){return o}});var n=i(896),r=i(3795);function o(e,t,i){if(null==e)return t(void 0),i&&i(void 0),r.lQ;const o=(0,n.vz)(()=>e.subscribe(t,i));return o.unsubscribe?()=>o.unsubscribe():o}}
2,6955:function(e,t,i){"use strict";i.d(t,{GY:function(){return a},If:function(){return c},tW:function(){return r}});const n=/\r/g;function r(e){let t=5381,i=(e=e.replace(n,"")).length;for(;i--;)t=(t<<5)-t^e.charCodeAt(i);return(t>>>0).toString(36)}const o=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];const s=["touchstart","touchmove"];function a(e){return s.includes(e)}const l=["$state","$state.raw","$derived","$derived.by"];function c(e){return e?.replace(/\//g,"/â")}}},function(e){e(3132)}]);
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.