PageSourceSearch

https://www.jazunah.at/app/themes/framework-lemontec/public/build/assets/app-CgcTXhLW.js

js jazunah.at collected 2026-10-06 23:54:31 UTC 2,037,380 bytes, 2,712 lines download raw bytes

1import{g as getDocument,a as getSlideTransformEl,e as elementTransitionEnd,c as createElement,b as getRotateFix,d as g$1,S as Swiper,N as Navigation,P as Pagination,h as hero,f as categories}from"./categoryslider-DlhmtMKw.js";function ownKeys(D,O){var q=Object.keys(D);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(D);O&&(J=J.filter(function(ie){return Object.getOwnPropertyDescriptor(D,ie).enumerable})),q.push.apply(q,J)}return q}function _objectSpread2(D){for(var O=1;O<arguments.length;O++){var q=arguments[O]!=null?arguments[O]:{};O%2?ownKeys(Object(q),!0).forEach(function(J){_defineProperty(D,J,q[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(q)):ownKeys(Object(q)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor(q,J))})}return D}function asyncGeneratorStep(D,O,q,J,ie,le,_e){try{var o=D[le](_e),Te=o.value}catch(Pe){return void q(Pe)}o.done?O(Te):Promise.resolve(Te).then(J,ie)}function _asyncToGenerator(D){return function(){var O=this,q=arguments;return new Promise(function(J,ie){var le=D.apply(O,q);function _e(Te){asyncGeneratorStep(le,J,ie,_e,o,"next",Te)}function o(Te){asyncGeneratorStep(le,J,ie,_e,o,"throw",Te)}_e(void 0)})}}function _defineProperty(D,O,q){return O in D?Object.defineProperty(D,O,{value:q,enumerable:!0,configurable:!0,writable:!0}):D[O]=q,D}function _taggedTemplateLiteral(D,O){return O||(O=D.slice(0)),Object.freeze(Object.defineProperties(D,{raw:{value:Object.freeze(O)}}))}function __decorate(D,O,q,J){var ie,le=arguments.length,_e=le<3?O:J;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_e=Reflect.decorate(D,O,q,J);else for(var o=D.length-1;o>=0;o--)(ie=D[o])&&(_e=(le<3?ie(_e):le>3?ie(O,q,_e):ie(O,q))||_e);return le>3&&_e&&Object.defineProperty(O,q,_e),_e}var t$3=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e$8=Symbol(),n$5=new Map;class s$3{constructor(O,q){if(this._$cssResult$=!0,q!==e$8)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=O}get styleSheet(){var O=n$5.get(this.cssText);return t$3&&O===void 0&&(n$5.set(this.cssText,O=new CSSStyleSheet),O.replaceSync(this.cssText)),O}toString(){return this.cssText}}var o$5=D=>
1new s$3(typeof D=="string"?D:D+"",e$8),r$3=function(D){for(var O=arguments.length,q=new Array(O>1?O-1:0),J=1;J<O;J++)q[J-1]=arguments[J];var ie=D.length===1?D[0]:q.reduce((le,_e,o)=>le+(Te=>{if(Te._$cssResult$===!0)return Te.cssText;if(typeof Te=="number")return Te;throw Error("Value passed to 'css' function must be a 'css' function result: "+Te+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(_e)+D[o+1],D[0]);return new s$3(ie,e$8)},i$3=(D,O)=>{t$3?D.adoptedStyleSheets=O.map(q=>q instanceof CSSStyleSheet?q:q.styleSheet):O.forEach(q=>{var J=document.createElement("style"),ie=window.litNonce;ie!==void 0&&J.setAttribute("nonce",ie),J.textContent=q.cssText,D.appendChild(J)})},S$1=t$3?D=>D:D=>D instanceof CSSStyleSheet?(O=>{var q="";for(var J of O.cssRules)q+=J.cssText;return o$5(q)})(D):D,s$2,e$7=window.trustedTypes,r$2=e$7?e$7.emptyScript:"",h$2=window.reactiveElementPolyfillSupport,o$4={toAttribute(D,O){switch(O){case Boolean:D=D?r$2:null;break;case Object:case Array:D=D==null?D:JSON.stringify(D)}return D},fromAttribute(D,O){var q=D;switch(O){case Boolean:q=D!==null;break;case Number:q=D===null?null:Number(D);break;case Object:case Array:try{q=JSON.parse(D)}catch{q=null}}return q}},n$4=(D,O)=>O!==D&&(O==O||D==D),l$3={attribute:!0,type:String,converter:o$4,reflect:!1,hasChanged:n$4},t$2;class a$1 extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(O){var q;(q=this.l)!==null&&q!==void 0||(this.l=[]),this.l.push(O)}static get observedAttributes(){this.finalize();var O=[];return this.elementProperties.forEach((q,J)=>{var ie=this._$Eh(J,q);ie!==void 0&&(this._$Eu.set(ie,J),O.push(ie))}),O}static createProperty(O){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l$3;if(q.state&&(q.attribute=!1),this.finalize(),this.elementProperties.set(O,q),!q.noAccessor&&!this.prototype.hasOwnProperty(O)){var J=typeof O=="symbol"?Symbol():"__"+O,ie=this.getPropertyDescriptor(O,J,q);ie!==void 0&&Object.defineProperty(this.prototype,O,ie)}}static getPropertyDescriptor(O,q,J){return{get(){return this[q]},set(ie){var le=this[O];this[q]=ie,this.requestUpdate(O,le,J)},configurable:!0,enumerable:!0}}static getPropertyOptions(O){return this.elementProperties.get(O)||l$3}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;var O=Object.getPrototypeOf(this);if(O.finalize(),this.elementProperties=new Map(O.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){var q=this.properties,J=[...Object.getOwnPropertyNames(q),...Object.getOwnPropertySymbols(q)];for(var ie of J)this.createProperty(ie,q[ie])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(O){var q=[];if(Array.isArray(O)){var J=new Set(O.flat(1/0).reverse());for(var ie of J)q.unshift(S$1(ie))}else O!==void 0&&q.push(S$1(O));return q}static _$Eh(O,q){var J=q.attribute;return J===!1?void 0:typeof J=="string"?J:typeof O=="string"?O.toLowerCase():void 0}o(){var O;this._$Ep=new Promise(q=>this.enableUpdating=q),this._$AL=new Map,this._$Em(),this.requestUpdate(),(O=this.constructor.l)===null||O===void 0||O.forEach(q=>q(this))}addController(O){var q,J;((q=this._$Eg)!==null&&q!==void 0?q:this._$Eg=[]).push(O),this.renderRoot!==void 0&&this.isConnected&&((J=O.hostConnected)===null||J===void 0||J.call(O))}removeController(O){var q;(q=this._$Eg)===null||q===void 0||q.splice(this._$Eg.indexOf(O)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((O,q)=>{this.hasOwnProperty(q)&&(this._$Et.set(q,this[q]),delete this[q])})}createRenderRoot(){var O,q=(O=this.shadowRoot)!==null&&O!==void 0?O:this.attachShadow(this.constructor.shadowRootOptions);return i$3(q,this.constructor.elementStyles),q}connectedCallback(){var O;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(O=this._$Eg)===null||O===void 0||O.forEach(q=>{var J;return(J=q.hostConnected)===null||J===void 0?void 0:J.call(q)})}enableUpdating(O){}disconnectedCallback(){var O;(O=this._$Eg)===null||O===void 0||O.forEach(q=>{var J;return(J=q.hostDisconnected)===null||J===void 0?void 0:J.call(q)})}attributeChangedCallback(O,q,J){this._$AK(O,J)}_$ES(O,q){var J,ie,le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l$3,_e=this.constructor._$Eh(O,le);if(_e!==void 0&&le.reflect===!0){var o=((ie=(J=le.converter)===null||J===void 0?void 0:J.toAttribute)!==null&&ie!==void 0?ie:o$4.toAttribute)(q,le.type);this._$Ei=O,o==null?this.removeAttribute(_e):this.setAttribute(_e,o),this._$Ei=null}}_$AK(O,q){var J,ie,le,_e=this.constructor,o=_e._$Eu.get(O);if(o!==void 0&&this._$Ei!==o){var Te=_e.getPropertyOptions(o),Pe=Te.converter,ve=(le=(ie=(J=Pe)===null||J===void 0?void 0:J.fromAttribute)!==null&&ie!==void 0?ie:typeof Pe=="function"?Pe:null)!==null&&le!==void 0?le:o$4.fromAttribute;this._$Ei=o,this[o]=ve(q,Te.type),this._$Ei=null}}requestUpdate(O,q,J){var ie=!0;O!==void 0&&(((J=J||this.constructor.getPropertyOptions(O)).hasChanged||n$4)(this[O],q)?(this._$AL.has(O)||this._$AL.set(O,q),J.reflect===!0&&this._$Ei!==O&&(this._$E_===void 0&&(this._$E_=new Map),this._$E_.set(O,J))):ie=!1),!this.isUpdatePending&&ie&&(this._$Ep=this._$EC())}_$EC(){var O=this;return _asyncToGenerator(function*(){O.isUpdatePending=!0;try{yield O._$Ep}catch(J){Promise.reject(J)}var q=O.scheduleUpdate();
1return q!=null&&(yield q),!O.isUpdatePending})()}scheduleUpdate(){return this.performUpdate()}performUpdate(){var O;if(this.isUpdatePending){this.hasUpdated,this._$Et&&(this._$Et.forEach((ie,le)=>this[le]=ie),this._$Et=void 0);var q=!1,J=this._$AL;try{(q=this.shouldUpdate(J))?(this.willUpdate(J),(O=this._$Eg)===null||O===void 0||O.forEach(ie=>{var le;return(le=ie.hostUpdate)===null||le===void 0?void 0:le.call(ie)}),this.update(J)):this._$EU()}catch(ie){throw q=!1,this._$EU(),ie}q&&this._$AE(J)}}willUpdate(O){}_$AE(O){var q;(q=this._$Eg)===null||q===void 0||q.forEach(J=>{var ie;return(ie=J.hostUpdated)===null||ie===void 0?void 0:ie.call(J)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(O)),this.updated(O)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(O){return!0}update(O){this._$E_!==void 0&&(this._$E_.forEach((q,J)=>this._$ES(J,this[J],q)),this._$E_=void 0),this._$EU()}updated(O){}firstUpdated(O){}}a$1.finalized=!0,a$1.elementProperties=new Map,a$1.elementStyles=[],a$1.shadowRootOptions={mode:"open"},h$2==null||h$2({ReactiveElement:a$1}),((s$2=globalThis.reactiveElementVersions)!==null&&s$2!==void 0?s$2:globalThis.reactiveElementVersions=[]).push("1.2.1");var i$2=globalThis.trustedTypes,s$1=i$2?i$2.createPolicy("lit-html",{createHTML:D=>D}):void 0,e$6="lit$".concat((Math.random()+"").slice(9),"$"),o$3="?"+e$6,n$3="<".concat(o$3,">"),l$2=document,h$1=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return l$2.createComment(D)},r$1=D=>D===null||typeof D!="object"&&typeof D!="function",d=Array.isArray,u=D=>{var O;return d(D)||typeof((O=D)===null||O===void 0?void 0:O[Symbol.iterator])=="function"},c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,a=/>/g,f=/>|[ 	\n�\r](?:([^\s"'>=/]+)([ 	\n�\r]*=[ 	\n�\r]*(?:[^ 	\n�\r"'`<>=]|("|')|))|$)/g,_=/'/g,m=/"/g,g=/^(?:script|style|textarea)$/i,p=D=>function(O){for(var q=arguments.length,J=new Array(q>1?q-1:0),ie=1;ie<q;ie++)J[ie-1]=arguments[ie];return{_$litType$:D,strings:O,values:J}},$=p(1),b=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),T=new WeakMap,x=(D,O,q)=>{var J,ie,le=(J=q==null?void 0:q.renderBefore)!==null&&J!==void 0?J:O,_e=le._$litPart$;if(_e===void 0){var o=(ie=q==null?void 0:q.renderBefore)!==null&&ie!==void 0?ie:null;le._$litPart$=_e=new N(O.insertBefore(h$1(),o),o,void 0,q??{})}return _e._$AI(D),_e},A=l$2.createTreeWalker(l$2,129,null,!1),C=(D,O)=>{for(var q,J=D.length-1,ie=[],le=O===2?"<svg>":"",_e=c,o=0;o<J;o++){for(var Te=D[o],Pe=void 0,ve=void 0,Ae=-1,Ee=0;Ee<Te.length&&(_e.lastIndex=Ee,(ve=_e.exec(Te))!==null);)Ee=_e.lastIndex,_e===c?ve[1]==="!--"?_e=v:ve[1]!==void 0?_e=a:ve[2]!==void 0?(g.test(ve[2])&&(q=RegExp("</"+ve[2],"g")),_e=f):ve[3]!==void 0&&(_e=f):_e===f?ve[0]===">"?(_e=q??c,Ae=-1):ve[1]===void 0?Ae=-2:(Ae=_e.lastIndex-ve[2].length,Pe=ve[1],_e=ve[3]===void 0?f:ve[3]==='"'?m:_):_e===m||_e===_?_e=f:_e===v||_e===a?_e=c:(_e=f,q=void 0);var Ie=_e===f&&D[o+1].startsWith("/>")?" ":"";le+=_e===c?Te+n$3:Ae>=0?(ie.push(Pe),Te.slice(0,Ae)+"$lit$"+Te.slice(Ae)+e$6+Ie):Te+e$6+(Ae===-2?(ie.push(void 0),o):Ie)}var ye=le+(D[J]||"<?>")+(O===2?"</svg>":"");if(!Array.isArray(D)||!D.hasOwnProperty("raw"))throw Error("invalid template strings array");return[s$1!==void 0?s$1.createHTML(ye):ye,ie]};class E{constructor(O,q){var J,{strings:ie,_$litType$:le}=O;this.parts=[];var _e=0,o=0,Te=ie.length-1,Pe=this.parts,[ve,Ae]=C(ie,le);if(this.el=E.createElement(ve,q),A.currentNode=this.el.content,le===2){var Ee=this.el.content,Ie=Ee.firstChild;Ie.remove(),Ee.append(...Ie.childNodes)}for(;(J=A.nextNode())!==null&&Pe.length<Te;){if(J.nodeType===1){if(J.hasAttributes()){var ye=[];for(var ge of J.getAttributeNames())if(ge.endsWith("$lit$")||ge.startsWith(e$6)){var Se=Ae[o++];if(ye.push(ge),Se!==void 0){var Ce=J.getAttribute(Se.toLowerCase()+"$lit$").split(e$6),Ve=/([.?@])?(.*)/.exec(Se);Pe.push({type:1,index:_e,name:Ve[2],strings:Ce,ctor:Ve[1]==="."?M:Ve[1]==="?"?H:Ve[1]==="@"?I:S})}else Pe.push({type:6,index:_e})}for(var at of ye)J.removeAttribute(at)}if(g.test(J.tagName)){var et=J.textContent.split(e$6),Mt=et.length-1;if(Mt>0){J.textContent=i$2?i$2.emptyScript:"";for(var jt=0;jt<Mt;jt++)J.append(et[jt],h$1()),A.nextNode(),Pe.push({type:2,index:++_e});J.append(et[Mt],h$1())}}}else if(J.nodeType===8)if(J.data===o$3)Pe.push({type:2,index:_e});else for(var St=-1;(St=J.data.indexOf(e$6,St+1))!==-1;)Pe.push({type:7,index:_e}),St+=e$6.length-1;_e++}}static createElement(O,q){var J=l$2.createElement("template");return J.innerHTML=O,J}}function P(D,O){var q,J,ie,le,_e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:D,o=arguments.length>3?arguments[3]:void 0;if(O===b)return O;var Te=o!==void 0?(q=_e._$Cl)===null||q===void 0?void 0:q[o]:_e._$Cu,Pe=r$1(O)?void 0:O._$litDirective$;return(Te==null?void 0:Te.constructor)!==Pe&&((J=Te==null?void 0:Te._$AO)===null||J===void 0||J.call(Te,!1),Pe===void 0?Te=void 0:(Te=new Pe(D))._$AT(D,_e,o),o!==void 0?((ie=(le=_e)._$Cl)!==null&&ie!==void 0?ie:le._$Cl=[])[o]=Te:_e._$Cu=Te),Te!==void 0&&(O=P(D,Te._$AS(D,O.values),Te,o)),O}class V{constructor(O,q){this.v=[],this._$AN=void 0,this._$AD=O,this._$AM=q}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(O){var q,{el:{content:J},parts:ie}=this._$AD,le=((q=O==null?void 0:O.creationScope)!==null&&q!==void 0?q:l$2).importNode(J,!0);A.currentNode=le;for(var _e=A.nextNode(),o=0,Te=0,Pe=ie[0];Pe!==void 0;){if(o===Pe.index){var ve=void 0;Pe.type===2?ve=new N(_e,_e.nextSibling,this,O):Pe.type===1?ve=new Pe.ctor(_e,Pe.name,Pe.strings,this,O):Pe.type===6&&(ve=new L(_e,this,O)),this.v.push(ve),Pe=ie[++Te]}o!==(Pe==null?void 0:Pe.index)&&(_e=A.nextNode(),o++)}return le}m(O){var q=0;for(var J of this.v)J!==void 0&&(J.strings!==void 0?(J._$AI(O,J,q),q+=J.strings.length-2):J._$AI(O[q])),q++}}class N{constructor(O,q,J,ie){var le;this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=O,this._$AB=q,this._$AM=J,this.options=ie,this._$Cg=(le=ie==null?void 0:ie.isConnected)===null||le===void 0||le}get _$AU(){var O,q;return(q=(O=this._$AM)===null||O===void 0?void 0:O._$AU)!==null&&q!==void 0?q:this._$Cg}get parentNode(){var O=this._$AA.parentNode,q=this._$AM;return q!==void 0&&O.nodeType===11&&(O=q.parentNode),O}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(O){O=P(this,O,arguments.length>1&&arguments[1]!==void 0?arguments[1]:this),r$1(O)?O===w||O==null||O===""?(this._$AH!==w&&this._$AR(),this._$AH=w):O!==this._$AH&&O!==b&&this.$(O):O._$litType$!==void 0?this.T(O):O.nodeType!==void 0?this.S(O):u(O)?this.A(O):this.$(O)}M(O){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._$AB;return this._$AA.parentNode.insertBefore(O,q)}S(O){this._$AH!==O&&(this._$AR(),this._$AH=this.M(O))}$(O){this._$AH!==w&&r$1(this._$AH)?this._$AA.nextSibling.data=O:this.S(l$2.createTextNode(O)),this._$AH=O}T(O){var q,{values:J,_$litType$:ie}=O,le=typeof ie=="number"?this._$AC(O):(ie.el===void 0&&(ie.el=E.createElement(ie.h,this.options)),ie);if(((q=this._$AH)===null||q===void 0?void 0:q._$AD)===le)this._$AH.m(J);else{var _e=new V(le,this),o=_e.p(this.options);_e.m(J),this.S(o),this._$AH=_e}}_$AC(O){var q=T.get(O.strings);return q===void 0&&T.set(O.strings,q=new E(O)),q}A(O){d(this._$AH)||(this._$AH=[],this._$AR());var q,J=this._$AH,ie=0;for(var le of O)ie===J.length?J.push(q=new N(this.M(h$1()),this.M(h$1()),this,this.options)):q=J[ie],q._$AI(le),ie++;ie<J.length&&(this._$AR(q&&q._$AB.nextSibling,ie),J.length=ie)}_$AR(){var O,q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._$AA.nextSibling,J=arguments.length>1?arguments[1]:void 0;
1for((O=this._$AP)===null||O===void 0||O.call(this,!1,!0,J);q&&q!==this._$AB;){var ie=q.nextSibling;q.remove(),q=ie}}setConnected(O){var q;this._$AM===void 0&&(this._$Cg=O,(q=this._$AP)===null||q===void 0||q.call(this,O))}}class S{constructor(O,q,J,ie,le){this.type=1,this._$AH=w,this._$AN=void 0,this.element=O,this.name=q,this._$AM=ie,this.options=le,J.length>2||J[0]!==""||J[1]!==""?(this._$AH=Array(J.length-1).fill(new String),this.strings=J):this._$AH=w}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(O){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this,J=arguments.length>2?arguments[2]:void 0,ie=arguments.length>3?arguments[3]:void 0,le=this.strings,_e=!1;if(le===void 0)O=P(this,O,q,0),(_e=!r$1(O)||O!==this._$AH&&O!==b)&&(this._$AH=O);else{var o,Te,Pe=O;for(O=le[0],o=0;o<le.length-1;o++)(Te=P(this,Pe[J+o],q,o))===b&&(Te=this._$AH[o]),_e||(_e=!r$1(Te)||Te!==this._$AH[o]),Te===w?O=w:O!==w&&(O+=(Te??"")+le[o+1]),this._$AH[o]=Te}_e&&!ie&&this.k(O)}k(O){O===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,O??"")}}class M extends S{constructor(){super(...arguments),this.type=3}k(O){this.element[this.name]=O===w?void 0:O}}var k=i$2?i$2.emptyScript:"";class H extends S{constructor(){super(...arguments),this.type=4}k(O){O&&O!==w?this.element.setAttribute(this.name,k):this.element.removeAttribute(this.name)}}class I extends S{constructor(O,q,J,ie,le){super(O,q,J,ie,le),this.type=5}_$AI(O){var q;if((O=(q=P(this,O,arguments.length>1&&arguments[1]!==void 0?arguments[1]:this,0))!==null&&q!==void 0?q:w)!==b){var J=this._$AH,ie=O===w&&J!==w||O.capture!==J.capture||O.once!==J.once||O.passive!==J.passive,le=O!==w&&(J===w||ie);ie&&this.element.removeEventListener(this.name,this,J),le&&this.element.addEventListener(this.name,this,O),this._$AH=O}}handleEvent(O){var q,J;typeof this._$AH=="function"?this._$AH.call((J=(q=this.options)===null||q===void 0?void 0:q.host)!==null&&J!==void 0?J:this.element,O):this._$AH.handleEvent(O)}}class L{constructor(O,q,J){this.element=O,this.type=6,this._$AN=void 0,this._$AM=q,this.options=J}get _$AU(){return this._$AM._$AU}_$AI(O){P(this,O)}}var z=window.litHtmlPolyfillSupport,l$1,o$2;z==null||z(E,N),((t$2=globalThis.litHtmlVersions)!==null&&t$2!==void 0?t$2:globalThis.litHtmlVersions=[]).push("2.1.2");class s extends a$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var O,q,J=super.createRenderRoot();return(O=(q=this.renderOptions).renderBefore)!==null&&O!==void 0||(q.renderBefore=J.firstChild),J}update(O){var q=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(O),this._$Dt=x(q,this.renderRoot,this.renderOptions)}connectedCallback(){var O;super.connectedCallback(),(O=this._$Dt)===null||O===void 0||O.setConnected(!0)}disconnectedCallback(){var O;super.disconnectedCallback(),(O=this._$Dt)===null||O===void 0||O.setConnected(!1)}render(){return b}}s.finalized=!0,s._$litElement$=!0,(l$1=globalThis.litElementHydrateSupport)===null||l$1===void 0||l$1.call(globalThis,{LitElement:s});var n$2=globalThis.litElementPolyfillSupport;n$2==null||n$2({LitElement:s});((o$2=globalThis.litElementVersions)!==null&&o$2!==void 0?o$2:globalThis.litElementVersions=[]).push("3.1.2");/**
2 * @license
3 * Copyright 2017 Google LLC
4 * SPDX-License-Identifier: BSD-3-Clause
5 */var n$1=D=>O=>typeof O=="function"?((q,J)=>(window.customElements.define(q,J),J))(D,O):((q,J)=>{var{kind:ie,elements:le}=J;return{kind:ie,elements:le,finisher(_e){window.customElements.define(q,_e)}}})(D,O),i$1=(D,O)=>O.kind==="method"&&O.descriptor&&!("value"in O.descriptor)?_objectSpread2(_objectSpread2({},O),{},{finisher(q){q.createProperty(O.key,D)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:O.key,initializer(){typeof O.initializer=="function"&&(this[O.key]=O.initializer.call(this))},finisher(q){q.createProperty(O.key,D)}};function e$5(D){return(O,q)=>q!==void 0?((J,ie,le)=>{ie.constructor.createProperty(le,J)})(D,O,q):i$1(D,O)}/**
6 * @license
7 * Copyright 2017 Google LLC
8 * SPDX-License-Identifier: BSD-3-Clause
9 */var o$1=D=>{var{finisher:O,descriptor:q}=D;return(J,ie)=>{var le;if(ie===void 0){var _e=(le=J.originalKey)!==null&&le!==void 0?le:J.key,o=q!=null?{kind:"method",placement:"prototype",key:_e,descriptor:q(J.key)}
vendor: 7,519 bytes, lines 9-17
9:_objectSpread2(_objectSpread2({},J),{},{key:_e});return O!=null&&(o.finisher=function(Pe){O(Pe,_e)}),o}var Te=J.constructor;q!==void 0&&Object.defineProperty(J,ie,q(ie)),O==null||O(Te,ie)}},n;/**
10 * @license
11 * Copyright 2017 Google LLC
12 * SPDX-License-Identifier: BSD-3-Clause
13 */function i(D,O){return o$1({descriptor:q=>{var J={get(){var ie,le;return(le=(ie=this.renderRoot)===null||ie===void 0?void 0:ie.querySelector(D))!==null&&le!==void 0?le:null},enumerable:!0,configurable:!0};return J}})}/**
14 * @license
15 * Copyright 2021 Google LLC
16 * SPDX-License-Identifier: BSD-3-Clause
17 */((n=window.HTMLSlotElement)===null||n===void 0?void 0:n.prototype.assignedElements)!=null;var lottie$1={exports:{}};(function(module,exports){var factory;typeof navigator<"u"&&(factory=function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(D){_useWebWorker=!!D},getWebWorker=function(){return _useWebWorker},setLocationHref=function(D){locationHref=D},getLocationHref=function(){return locationHref};function createTag(D){return document.createElement(D)}function extendPrototype(D,O){var q,J,ie=D.length;for(q=0;q<ie;q+=1)for(var le in J=D[q].prototype)Object.prototype.hasOwnProperty.call(J,le)&&(O.prototype[le]=J[le])}function getDescriptor(D,O){return Object.getOwnPropertyDescriptor(D,O)}function createProxyFunction(D){function O(){}return O.prototype=D,O}var audioControllerFactory=function(){function D(O){this.audios=[],this.audioFactory=O,this._volume=1,this._isMuted=!1}return D.prototype={addAudio:function(O){this.audios.push(O)},pause:function(){var O,q=this.audios.length;for(O=0;O<q;O+=1)this.audios[O].pause()},resume:function(){var O,q=this.audios.length;for(O=0;O<q;O+=1)this.audios[O].resume()},setRate:function(O){var q,J=this.audios.length;for(q=0;q<J;q+=1)this.audios[q].setRate(O)},createAudio:function(O){return this.audioFactory?this.audioFactory(O):window.Howl?new window.Howl({src:[O]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(O){this.audioFactory=O},setVolume:function(O){this._volume=O,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var O,q=this.audios.length;for(O=0;O<q;O+=1)this.audios[O].volume(this._volume*(this._isMuted?0:1))}},function(){return new D}}(),createTypedArray=function(){function D(O,q){var J,ie=0,le=[];switch(O){case"int16":case"uint8c":J=1;break;default:J=1.1}for(ie=0;ie<q;ie+=1)le.push(J);return le}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?function(O,q){return O==="float32"?new Float32Array(q):O==="int16"?new Int16Array(q):O==="uint8c"?new Uint8ClampedArray(q):D(O,q)}:D}();function createSizedArray(D){return Array.apply(null,{length:D})}function _typeof$6(D){return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},_typeof$6(D)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var D,O=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],q=O.length;for(D=0;D<q;D+=1)BMMath[O[D]]=Math[O[D]]})(),BMMath.random=Math.random,BMMath.abs=function(D){if(_typeof$6(D)==="object"&&D.length){var O,q=createSizedArray(D.length),J=D.length;for(O=0;O<J;O+=1)q[O]=Math.abs(D[O]);return q}return Math.abs(D)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(D){D.style.position="absolute",D.style.top=0,D.style.left=0,D.style.display="block",D.style.transformOrigin="0 0",D.style.webkitTransformOrigin="0 0",D.style.backfaceVisibility="visible",D.style.webkitBackfaceVisibility="visible",D.style.transformStyle="preserve-3d",D.style.webkitTransformStyle="preserve-3d",D.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(D,O,q,J){this.type=D,this.currentTime=O,this.totalTime=q,this.direction=J<0?-1:1}function BMCompleteEvent(D,O){this.type=D,this.direction=O<0?-1:1}function BMCompleteLoopEvent(D,O,q,J){this.type=D,this.currentLoop=q,this.totalLoops=O,this.direction=J<0?-1:1}function BMSegmentStartEvent(D,O,q){this.type=D,this.firstFrame=O,this.totalFrames=q}function BMDestroyEvent(D,O){this.type=D,this.target=O}function BMRenderFrameErrorEvent(D,O){this.type="renderFrameError",this.nativeError=D,this.currentTime=O}function BMConfigErrorEvent(D){this.type="configError",this.nativeError=D}var createElementID=(_count=0,function(){return idPrefix$1+"__lottie_element_"+(_count+=1)}),_count;function HSVtoRGB(D,O,q){var J,ie,le,_e,o,Te,Pe,ve;switch(Te=q*(1-O),Pe=q*(1-(o=6*D-(_e=Math.floor(6*D)))*O),ve=q*(1-(1-o)*O),_e%6){case 0:J=q,ie=ve,le=Te;break;case 1:J=Pe,ie=q,le=Te;break;case 2:J=Te,ie=q,le=ve;break;case 3:J=Te,ie=Pe,le=q;break;case 4:J=ve,ie=Te,le=q;break;case 5:J=q,ie=Te,le=Pe}return[J,ie,le]}function RGBtoHSV(D,O,q){var J,ie=Math.max(D,O,q),le=Math.min(D,O,q),_e=ie-le,o=ie===0?0:_e/ie,Te=ie/255;switch(ie){case le:J=0;break;case D:J=O-q+_e*(O<q?6:0),J/=6*_e;break;case O:J=q-D+2*_e,J/=6*_e;break;case q:J=D-O+4*_e,J/=6*_e}return[J,o,Te]}function addSaturationToRGB(D,O){var q=RGBtoHSV(255*D[0],255*D[1],255*D[2]);return q[1]+=O,q[1]>1?q[1]=1:q[1]<=0&&(q[1]=0),HSVtoRGB(q[0],q[1],q[2])}function addBrightnessToRGB(D,O){var q=RGBtoHSV(255*D[0],255*D[1],255*D[2]);return q[2]+=O,q[2]>1?q[2]=1:q[2]<0&&(q[2]=0),HSVtoRGB(q[0],q[1],q[2])}function addHueToRGB(D,O){var q=RGBtoHSV(255*D[0],255*D[1],255*D[2]);return q[0]+=O/360,q[0]>1?q[0]-=1:q[0]<0&&(q[0]+=1),HSVtoRGB(q[0],q[1],q[2])}var rgbToHex=function(){var D,O,q=[];for(D=0;D<256;D+=1)O=D.toString(16),q[D]=O.length===1?"0"+O:O;return function(J,ie,le){return J<0&&(J=0),ie<0&&(ie=0),le<0&&(le=0),"#"+q[J]+q[ie]+q[le]}}(),setSubframeEnabled=function(D){subframeEnabled=!!D},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(D){expressionsPlugin=D},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(D){expressionsInterfaces=D},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(D){defaultCurveSegments=D},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(D){idPrefix$1=D};function createNS(D){return document.createElementNS(svgNS,D)}function _typeof$5(D){return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},_typeof$5(D)}var dataManager=function(){var D,O,q=1,J=[],ie={onmessage:function(){},postMessage:function(Te){D({data:Te})}},le={postMessage:function(Te){ie.onmessage({data:Te})}};function _e(){O||(O=function(Te){if(window.Worker&&window.Blob&&getWebWorker()){var Pe=new Blob(["var _workerSelf = self;
17 self.onmessage = ",Te.toString()],{type:"text/javascript"}),ve=URL.createObjectURL(Pe);return new Worker(ve)}return D=Te,ie}(function(Te){if(le.dataManager||(le.dataManager=function(){function ve(St,Bt){var Zt,xt,wt,Je,ut,lt,Ye=St.length;for(xt=0;xt<Ye;xt+=1)if("ks"in(Zt=St[xt])&&!Zt.completed){if(Zt.completed=!0,Zt.hasMask){var pi=Zt.masksProperties;for(Je=pi.length,wt=0;wt<Je;wt+=1)if(pi[wt].pt.k.i)Ie(pi[wt].pt.k);else for(lt=pi[wt].pt.k.length,ut=0;ut<lt;ut+=1)pi[wt].pt.k[ut].s&&Ie(pi[wt].pt.k[ut].s[0]),pi[wt].pt.k[ut].e&&Ie(pi[wt].pt.k[ut].e[0])}Zt.ty===0?(Zt.layers=Ae(Zt.refId,Bt),ve(Zt.layers,Bt)):Zt.ty===4?Ee(Zt.shapes):Zt.ty===5&&Mt(Zt)}}function Ae(St,Bt){var Zt=function(xt,wt){for(var Je=0,ut=wt.length;Je<ut;){if(wt[Je].id===xt)return wt[Je];Je+=1}return null}(St,Bt);return Zt?Zt.layers.__used?JSON.parse(JSON.stringify(Zt.layers)):(Zt.layers.__used=!0,Zt.layers):null}function Ee(St){var Bt,Zt,xt;for(Bt=St.length-1;Bt>=0;Bt-=1)if(St[Bt].ty==="sh")if(St[Bt].ks.k.i)Ie(St[Bt].ks.k);else for(xt=St[Bt].ks.k.length,Zt=0;Zt<xt;Zt+=1)St[Bt].ks.k[Zt].s&&Ie(St[Bt].ks.k[Zt].s[0]),St[Bt].ks.k[Zt].e&&Ie(St[Bt].ks.k[Zt].e[0]);else St[Bt].ty==="gr"&&Ee(St[Bt].it)}function Ie(St){var Bt,Zt=St.i.length;for(Bt=0;Bt<Zt;Bt+=1)St.i[Bt][0]+=St.v[Bt][0],St.i[Bt][1]+=St.v[Bt][1],St.o[Bt][0]+=St.v[Bt][0],St.o[Bt][1]+=St.v[Bt][1]}function ye(St,Bt){var Zt=Bt?Bt.split("."):[100,100,100];return St[0]>Zt[0]||!(Zt[0]>St[0])&&(St[1]>Zt[1]||!(Zt[1]>St[1])&&(St[2]>Zt[2]||!(Zt[2]>St[2])&&null))}var ge,Se=function(){var St=[4,4,14];function Bt(Zt){var xt,wt,Je,ut=Zt.length;for(xt=0;xt<ut;xt+=1)Zt[xt].ty===5&&(Je=void 0,Je=(wt=Zt[xt]).t.d,wt.t.d={k:[{s:Je,t:0}]})}return function(Zt){if(ye(St,Zt.v)&&(Bt(Zt.layers),Zt.assets)){var xt,wt=Zt.assets.length;for(xt=0;xt<wt;xt+=1)Zt.assets[xt].layers&&Bt(Zt.assets[xt].layers)}}}(),Ce=(ge=[4,7,99],function(St){if(St.chars&&!ye(ge,St.v)){var Bt,Zt=St.chars.length;for(Bt=0;Bt<Zt;Bt+=1){var xt=St.chars[Bt];xt.data&&xt.data.shapes&&(Ee(xt.data.shapes),xt.data.ip=0,xt.data.op=99999,xt.data.st=0,xt.data.sr=1,xt.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},St.chars[Bt].t||(xt.data.shapes.push({ty:"no"}),xt.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}),Ve=function(){var St=[5,7,15];function Bt(Zt){var xt,wt,Je=Zt.length;for(xt=0;xt<Je;xt+=1)Zt[xt].ty===5&&(wt=void 0,typeof(wt=Zt[xt].t.p).a=="number"&&(wt.a={a:0,k:wt.a}),typeof wt.p=="number"&&(wt.p={a:0,k:wt.p}),typeof wt.r=="number"&&(wt.r={a:0,k:wt.r}))}return function(Zt){if(ye(St,Zt.v)&&(Bt(Zt.layers),Zt.assets)){var xt,wt=Zt.assets.length;for(xt=0;xt<wt;xt+=1)Zt.assets[xt].layers&&Bt(Zt.assets[xt].layers)}}}(),at=function(){var St=[4,1,9];function Bt(xt){var wt,Je,ut,lt=xt.length;for(wt=0;wt<lt;wt+=1)if(xt[wt].ty==="gr")Bt(xt[wt].it);else if(xt[wt].ty==="fl"||xt[wt].ty==="st")if(xt[wt].c.k&&xt[wt].c.k[0].i)for(ut=xt[wt].c.k.length,Je=0;Je<ut;Je+=1)xt[wt].c.k[Je].s&&(xt[wt].c.k[Je].s[0]/=255,xt[wt].c.k[Je].s[1]/=255,xt[wt].c.k[Je].s[2]/=255,xt[wt].c.k[Je].s[3]/=255),xt[wt].c.k[Je].e&&(xt[wt].c.k[Je].e[0]/=255,xt[wt].c.k[Je].e[1]/=255,xt[wt].c.k[Je].e[2]/=255,xt[wt].c.k[Je].e[3]/=255);else xt[wt].c.k[0]/=255,xt[wt].c.k[1]/=255,xt[wt].c.k[2]/=255,xt[wt].c.k[3]/=255}function Zt(xt){var wt,Je=xt.length;for(wt=0;wt<Je;wt+=1)xt[wt].ty===4&&Bt(xt[wt].shapes)}return function(xt){if(ye(St,xt.v)&&(Zt(xt.layers),xt.assets)){var wt,Je=xt.assets.length;for(wt=0;wt<Je;wt+=1)xt.assets[wt].layers&&Zt(xt.assets[wt].layers)}}}(),et=function(){var St=[4,4,18];function Bt(xt){var wt,Je,ut;for(wt=xt.length-1;wt>=0;wt-=1)if(xt[wt].ty==="sh")if(xt[wt].ks.k.i)xt[wt].ks.k.c=xt[wt].closed;else for(ut=xt[wt].ks.k.length,Je=0;Je<ut;Je+=1)xt[wt].ks.k[Je].s&&(xt[wt].ks.k[Je].s[0].c=xt[wt].closed),xt[wt].ks.k[Je].e&&(xt[wt].ks.k[Je].e[0].c=xt[wt].closed);else xt[wt].ty==="gr"&&Bt(xt[wt].it)}function Zt(xt){var wt,Je,ut,lt,Ye,pi,si=xt.length;for(Je=0;Je<si;Je+=1){if((wt=xt[Je]).hasMask){var rt=wt.masksProperties;for(lt=rt.length,ut=0;ut<lt;ut+=1)if(rt[ut].pt.k.i)rt[ut].pt.k.c=rt[ut].cl;else for(pi=rt[ut].pt.k.length,Ye=0;Ye<pi;Ye+=1)rt[ut].pt.k[Ye].s&&(rt[ut].pt.k[Ye].s[0].c=rt[ut].cl),rt[ut].pt.k[Ye].e&&(rt[ut].pt.k[Ye].e[0].c=rt[ut].cl)}wt.ty===4&&Bt(wt.shapes)}}return function(xt){if(ye(St,xt.v)&&(Zt(xt.layers),xt.assets)){var wt,Je=xt.assets.length;for(wt=0;
17wt<Je;wt+=1)xt.assets[wt].layers&&Zt(xt.assets[wt].layers)}}}();function Mt(St){St.t.a.length===0&&St.t.p}var jt={completeData:function(St){St.__complete||(at(St),Se(St),Ce(St),Ve(St),et(St),ve(St.layers,St.assets),function(Bt,Zt){if(Bt){var xt=0,wt=Bt.length;for(xt=0;xt<wt;xt+=1)Bt[xt].t===1&&(Bt[xt].data.layers=Ae(Bt[xt].data.refId,Zt),ve(Bt[xt].data.layers,Zt))}}(St.chars,St.assets),St.__complete=!0)}};return jt.checkColors=at,jt.checkChars=Ce,jt.checkPathProperties=Ve,jt.checkShapes=et,jt.completeLayers=ve,jt}()),le.assetLoader||(le.assetLoader=function(){function ve(Ae){var Ee=Ae.getResponseHeader("content-type");return Ee&&Ae.responseType==="json"&&Ee.indexOf("json")!==-1||Ae.response&&_typeof$5(Ae.response)==="object"?Ae.response:Ae.response&&typeof Ae.response=="string"?JSON.parse(Ae.response):Ae.responseText?JSON.parse(Ae.responseText):null}return{load:function(Ae,Ee,Ie,ye){var ge,Se=new XMLHttpRequest;try{Se.responseType="json"}catch{}Se.onreadystatechange=function(){if(Se.readyState===4)if(Se.status===200)ge=ve(Se),Ie(ge);else try{ge=ve(Se),Ie(ge)}catch(Ce){ye&&ye(Ce)}};try{Se.open(["G","E","T"].join(""),Ae,!0)}catch{Se.open(["G","E","T"].join(""),Ee+"/"+Ae,!0)}Se.send()}}}()),Te.data.type==="loadAnimation")le.assetLoader.load(Te.data.path,Te.data.fullPath,function(ve){le.dataManager.completeData(ve),le.postMessage({id:Te.data.id,payload:ve,status:"success"})},function(){le.postMessage({id:Te.data.id,status:"error"})});else if(Te.data.type==="complete"){var Pe=Te.data.animation;le.dataManager.completeData(Pe),le.postMessage({id:Te.data.id,payload:Pe,status:"success"})}else Te.data.type==="loadData"&&le.assetLoader.load(Te.data.path,Te.data.fullPath,function(ve){le.postMessage({id:Te.data.id,payload:ve,status:"success"})},function(){le.postMessage({id:Te.data.id,status:"error"})})}),O.onmessage=function(Te){var Pe=Te.data,ve=Pe.id,Ae=J[ve];J[ve]=null,Pe.status==="success"?Ae.onComplete(Pe.payload):Ae.onError&&Ae.onError()})}function o(Te,Pe){var ve="processId_"+(q+=1);return J[ve]={onComplete:Te,onError:Pe},ve}return{loadAnimation:function(Te,Pe,ve){_e();var Ae=o(Pe,ve);O.postMessage({type:"loadAnimation",path:Te,fullPath:window.location.origin+window.location.pathname,id:Ae})},loadData:function(Te,Pe,ve){_e();var Ae=o(Pe,ve);O.postMessage({type:"loadData",path:Te,fullPath:window.location.origin+window.location.pathname,id:Ae})},completeAnimation:function(Te,Pe,ve){_e();var Ae=o(Pe,ve);O.postMessage({type:"complete",animation:Te,id:Ae})}}}(),ImagePreloader=function(){var D=function(){var o=createTag("canvas");o.width=1,o.height=1;var Te=o.getContext("2d");return Te.fillStyle="rgba(0,0,0,0)",Te.fillRect(0,0,1,1),o}();function O(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function q(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function J(o,Te,Pe){var ve="";if(o.e)ve=o.p;else if(Te){var Ae=o.p;Ae.indexOf("images/")!==-1&&(Ae=Ae.split("/")[1]),ve=Te+Ae}else ve=Pe,ve+=o.u?o.u:"",ve+=o.p;return ve}function ie(o){var Te=0,Pe=setInterval((function(){(o.getBBox().width||Te>500)&&(this._imageLoaded(),clearInterval(Pe)),Te+=1}).bind(this),50)}function le(o){var Te={assetData:o},Pe=J(o,this.assetsPath,this.path);return dataManager.loadData(Pe,(function(ve){Te.img=ve,this._footageLoaded()}).bind(this),(function(){Te.img={},this._footageLoaded()}).bind(this)),Te}function _e(){this._imageLoaded=O.bind(this),this._footageLoaded=q.bind(this),this.testImageLoaded=ie.bind(this),this.createFootageData=le.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return _e.prototype={loadAssets:function(o,Te){var Pe;this.imagesLoadedCb=Te;var ve=o.length;for(Pe=0;Pe<ve;Pe+=1)o[Pe].layers||(o[Pe].t&&o[Pe].t!=="seq"?o[Pe].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(o[Pe]))):(this.totalImages+=1,this.images.push(this._createImageData(o[Pe]))))},setAssetsPath:function(o){this.assetsPath=o||""},setPath:function(o){this.path=o||""},loadedImages:function(){return this.totalImages===this.loadedAssets},loadedFootages:function(){return this.totalFootages===this.loadedFootagesCount},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getAsset:function(o){for(var Te=0,Pe=this.images.length;Te<Pe;){if(this.images[Te].assetData===o)return this.images[Te].img;Te+=1}return null},createImgData:function(o){var Te=J(o,this.assetsPath,this.path),Pe=createTag("img");Pe.crossOrigin="anonymous",Pe.addEventListener("load",this._imageLoaded,!1),Pe.addEventListener("error",(function(){ve.img=D,this._imageLoaded()}).bind(this),!1),Pe.src=Te;var ve={img:Pe,assetData:o};return ve},createImageData:function(o){var Te=J(o,this.assetsPath,this.path),Pe=createNS("image");isSafari?this.testImageLoaded(Pe):Pe.addEventListener("load",this._imageLoaded,!1),Pe.addEventListener("error",(function(){ve.img=D,this._imageLoaded()}).bind(this),!1),Pe.setAttributeNS("http://www.w3.org/1999/xlink","href",Te),this._elementHelper.append?this._elementHelper.append(Pe):this._elementHelper.appendChild(Pe);var ve={img:Pe,assetData:o};return ve},imageLoaded:O,footageLoaded:q,setCacheType:function(o,Te){o==="svg"?(this._elementHelper=Te,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}},_e}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(D,O){if(this._cbs[D])for(var q=this._cbs[D],J=0;J<q.length;J+=1)q[J](O)},addEventListener:function(D,O){return this._cbs[D]||(this._cbs[D]=[]),this._cbs[D].push(O),(function(){this.removeEventListener(
vendor: 5,035 bytes, lines 17-18
17D,O)}).bind(this)},removeEventListener:function(D,O){if(O){if(this._cbs[D]){for(var q=0,J=this._cbs[D].length;q<J;)this._cbs[D][q]===O&&(this._cbs[D].splice(q,1),q-=1,J-=1),q+=1;this._cbs[D].length||(this._cbs[D]=null)}}else this._cbs[D]=null}};var markerParser=function(){function D(O){for(var q,J=O.split(`\r
18`),ie={},le=0,_e=0;_e<J.length;_e+=1)(q=J[_e].split(":")).length===2&&(ie[q[0]]=q[1].trim(),le+=1);if(le===0)throw new Error;return ie}return function(O){for(var q=[],J=0;J<O.length;J+=1){var ie=O[J],le={time:ie.tm,duration:ie.dr};try{le.payload=JSON.parse(O[J].cm)}catch{try{le.payload=D(O[J].cm)}catch{le.payload={name:O[J].cm}}}q.push(le)}return q}}(),ProjectInterface=function(){function D(O){this.compositions.push(O)}return function(){function O(q){for(var J=0,ie=this.compositions.length;J<ie;){if(this.compositions[J].data&&this.compositions[J].data.nm===q)return this.compositions[J].prepareFrame&&this.compositions[J].data.xt&&this.compositions[J].prepareFrame(this.currentFrame),this.compositions[J].compInterface;J+=1}return null}return O.compositions=[],O.currentFrame=0,O.registerComposition=D,O}}(),renderers={},registerRenderer=function(D,O){renderers[D]=O};function getRenderer(D){return renderers[D]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var D in renderers)if(renderers[D])return D;return""}function _typeof$4(D){return _typeof$4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},_typeof$4(D)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(D){(D.wrapper||D.container)&&(this.wrapper=D.wrapper||D.container);var O="svg";D.animType?O=D.animType:D.renderer&&(O=D.renderer);var q=getRenderer(O);this.renderer=new q(this,D.rendererSettings),this.imagePreloader.setCacheType(O,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=O,D.loop===""||D.loop===null||D.loop===void 0||D.loop===!0?this.loop=!0:D.loop===!1?this.loop=!1:this.loop=parseInt(D.loop,10),this.autoplay=!("autoplay"in D)||D.autoplay,this.name=D.name?D.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(D,"autoloadSegments")||D.autoloadSegments,this.assetsPath=D.assetsPath,this.initialSegment=D.initialSegment,D.audioFactory&&this.audioController.setAudioFactory(D.audioFactory),D.animationData?this.setupAnimation(D.animationData):D.path&&(D.path.lastIndexOf("\\")!==-1?this.path=D.path.substr(0,D.path.lastIndexOf("\\")+1):this.path=D.path.substr(0,D.path.lastIndexOf("/")+1),this.fileName=D.path.substr(D.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(D.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(D){dataManager.completeAnimation(D,this.configAnimation)},AnimationItem.prototype.setData=function(D,O){O&&_typeof$4(O)!=="object"&&(O=JSON.parse(O));var q={wrapper:D,animationData:O},J=D.attributes;q.path=J.getNamedItem("data-animation-path")?J.getNamedItem("data-animation-path").value:J.getNamedItem("data-bm-path")?J.getNamedItem("data-bm-path").value:J.getNamedItem("bm-path")?J.getNamedItem("bm-path").value:"",q.animType=J.getNamedItem("data-anim-type")?J.getNamedItem("data-anim-type").value:J.getNamedItem("data-bm-type")?J.getNamedItem("data-bm-type").value:J.getNamedItem("bm-type")?J.getNamedItem("bm-type").value:J.getNamedItem("data-bm-renderer")?J.getNamedItem("data-bm-renderer").value:J.getNamedItem("bm-renderer")?J.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var ie=J.getNamedItem("data-anim-loop")?J.getNamedItem("data-anim-loop").value:J.getNamedItem("data-bm-loop")?J.getNamedItem("data-bm-loop").value:J.getNamedItem("bm-loop")?J.getNamedItem("bm-loop").value:"";ie==="false"?q.loop=!1:ie==="true"?q.loop=!0:ie!==""&&(q.loop=parseInt(ie,10));
vendor: 4,653 bytes, line 18
18var le=J.getNamedItem("data-anim-autoplay")?J.getNamedItem("data-anim-autoplay").value:J.getNamedItem("data-bm-autoplay")?J.getNamedItem("data-bm-autoplay").value:!J.getNamedItem("bm-autoplay")||J.getNamedItem("bm-autoplay").value;q.autoplay=le!=="false",q.name=J.getNamedItem("data-name")?J.getNamedItem("data-name").value:J.getNamedItem("data-bm-name")?J.getNamedItem("data-bm-name").value:J.getNamedItem("bm-name")?J.getNamedItem("bm-name").value:"",(J.getNamedItem("data-anim-prerender")?J.getNamedItem("data-anim-prerender").value:J.getNamedItem("data-bm-prerender")?J.getNamedItem("data-bm-prerender").value:J.getNamedItem("bm-prerender")?J.getNamedItem("bm-prerender").value:"")==="false"&&(q.prerender=!1),q.path?this.setParams(q):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(D){D.op>this.animationData.op&&(this.animationData.op=D.op,this.totalFrames=Math.floor(D.op-this.animationData.ip));var O,q,J=this.animationData.layers,ie=J.length,le=D.layers,_e=le.length;for(q=0;q<_e;q+=1)for(O=0;O<ie;){if(J[O].id===le[q].id){J[O]=le[q];break}O+=1}if((D.chars||D.fonts)&&(this.renderer.globalData.fontManager.addChars(D.chars),this.renderer.globalData.fontManager.addFonts(D.fonts,this.renderer.globalData.defs)),D.assets)for(ie=D.assets.length,O=0;O<ie;O+=1)this.animationData.assets.push(D.assets[O]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(D){this.animationData=D;var O=getExpressionsPlugin();O&&O.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var D=this.animationData.segments;if(!D||D.length===0||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var O=D.shift();this.timeCompleted=O.time*this.frameRate;var q=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(q,this.includeLayers.bind(this),(function(){this.trigger("data_failed")}).bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(D){if(this.renderer)try{this.animationData=D,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(D),D.assets||(D.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(D.assets),this.markers=markerParser(D.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(O){this.triggerConfigError(O)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var D=getExpressionsPlugin();D&&D.initExpressions(this),this.renderer.initItems(),setTimeout((function(){this.trigger("DOMLoaded")}).bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(D,O){var q=typeof D=="number"?D:void 0,J=typeof O=="number"?O:void 0;this.renderer.updateContainerSize(q,J)},AnimationItem.prototype.setSubframe=function(D){this.isSubframeEnabled=!!D},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(this.isLoaded!==!1&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame
vendor: 4,167 bytes, line 18
18(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(D){this.triggerRenderFrameError(D)}},AnimationItem.prototype.play=function(D){D&&this.name!==D||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(D){D&&this.name!==D||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(D){D&&this.name!==D||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(D){D&&this.name!==D||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(D){for(var O,q=0;q<this.markers.length;q+=1)if((O=this.markers[q]).payload&&O.payload.name===D)return O;return null},AnimationItem.prototype.goToAndStop=function(D,O,q){if(!q||this.name===q){var J=Number(D);if(isNaN(J)){var ie=this.getMarkerData(D);ie&&this.goToAndStop(ie.time,!0)}else O?this.setCurrentRawFrameValue(D):this.setCurrentRawFrameValue(D*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(D,O,q){if(!q||this.name===q){var J=Number(D);if(isNaN(J)){var ie=this.getMarkerData(D);ie&&(ie.duration?this.playSegments([ie.time,ie.time+ie.duration],!0):this.goToAndStop(ie.time,!0))}else this.goToAndStop(J,O,q);this.play()}},AnimationItem.prototype.advanceTime=function(D){if(this.isPaused!==!0&&this.isLoaded!==!1){var O=this.currentRawFrame+D*this.frameModifier,q=!1;O>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?O>=this.totalFrames?(this.playCount+=1,this.checkSegments(O%this.totalFrames)||(this.setCurrentRawFrameValue(O%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(O):this.checkSegments(O>this.totalFrames?O%this.totalFrames:0)||(q=!0,O=this.totalFrames-1):O<0?this.checkSegments(O%this.totalFrames)||(!this.loop||this.playCount--<=0&&this.loop!==!0?(q=!0,O=0):(this.setCurrentRawFrameValue(this.totalFrames+O%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(O),q&&(this.setCurrentRawFrameValue(O),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(D,O){this.playCount=0,D[1]<D[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=D[0]-D[1],this.timeCompleted=this.totalFrames,this.firstFrame=D[1],this.setCurrentRawFrameValue(this.totalFrames-.001-O)):D[1]>D[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=D[1]-D[0],this.timeCompleted=this.totalFrames,this.firstFrame=D[0],this.setCurrentRawFrameValue(.001+O)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(D,O){var q=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<D?q=D:this.currentRawFrame+this.firstFrame>O&&(q=O-D)),this.firstFrame=D,this.totalFrames=O-D,this.timeCompleted=this.totalFrames,q!==-1&&this.goToAndStop(q,!0)},AnimationItem.prototype.playSegments=function(D,O){if(O&&(this.segments.length=0),_typeof$4(D[0])==="object"){var q,J=D.length;for(q=0;q<J;q+=1)this.segments.push(D[q])}else this.segments.push(D);this.segments.length&&O&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(D){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),D&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(D){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),D),!0)},AnimationItem.prototype.destroy=function(D){D&&this.name!==D||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)}
vendor: 5,304 bytes, line 18
18,AnimationItem.prototype.setCurrentRawFrameValue=function(D){this.currentRawFrame=D,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(D){this.playSpeed=D,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(D){this.playDirection=D<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(D){this.loop=D},AnimationItem.prototype.setVolume=function(D,O){O&&this.name!==O||this.audioController.setVolume(D)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(D){D&&this.name!==D||this.audioController.mute()},AnimationItem.prototype.unmute=function(D){D&&this.name!==D||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(D){var O="";if(D.e)O=D.p;else if(this.assetsPath){var q=D.p;q.indexOf("images/")!==-1&&(q=q.split("/")[1]),O=this.assetsPath+q}else O=this.path,O+=D.u?D.u:"",O+=D.p;return O},AnimationItem.prototype.getAssetData=function(D){for(var O=0,q=this.assets.length;O<q;){if(D===this.assets[O].id)return this.assets[O];O+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(D){return D?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(D,O,q){try{this.renderer.getElementByPath(D).updateDocumentData(O,q)}catch{}},AnimationItem.prototype.trigger=function(D){if(this._cbs&&this._cbs[D])switch(D){case"enterFrame":this.triggerEvent(D,new BMEnterFrameEvent(D,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(D,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(D,new BMCompleteLoopEvent(D,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(D,new BMCompleteEvent(D,this.frameMult));break;case"segmentStart":this.triggerEvent(D,new BMSegmentStartEvent(D,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(D,new BMDestroyEvent(D,this));break;default:this.triggerEvent(D)}D==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(D,this.currentFrame,this.totalFrames,this.frameMult)),D==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(D,this.loop,this.playCount,this.frameMult)),D==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(D,this.frameMult)),D==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(D,this.firstFrame,this.totalFrames)),D==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(D,this))},AnimationItem.prototype.triggerRenderFrameError=function(D){var O=new BMRenderFrameErrorEvent(D,this.currentFrame);this.triggerEvent("error",O),this.onError&&this.onError.call(this,O)},AnimationItem.prototype.triggerConfigError=function(D){var O=new BMConfigErrorEvent(D,this.currentFrame);this.triggerEvent("error",O),this.onError&&this.onError.call(this,O)};var animationManager=function(){var D={},O=[],q=0,J=0,ie=0,le=!0,_e=!1;function o(ge){for(var Se=0,Ce=ge.target;Se<J;)O[Se].animation===Ce&&(O.splice(Se,1),Se-=1,J-=1,Ce.isPaused||ve()),Se+=1}function Te(ge,Se){if(!ge)return null;for(var Ce=0;Ce<J;){if(O[Ce].elem===ge&&O[Ce].elem!==null)return O[Ce].animation;Ce+=1}var Ve=new AnimationItem;return Ae(Ve,ge),Ve.setData(ge,Se),Ve}function Pe(){ie+=1,ye()}function ve(){ie-=1}function Ae(ge,Se){ge.addEventListener("destroy",o),ge.addEventListener("_active",Pe),ge.addEventListener("_idle",ve),O.push({elem:Se,animation:ge}),J+=1}function Ee(ge){var Se,Ce=ge-q;for(Se=0;Se<J;Se+=1)O[Se].animation.advanceTime(Ce);q=ge,ie&&!_e?window.requestAnimationFrame(Ee):le=!0}function Ie(ge){q=ge,window.requestAnimationFrame(Ee)}function ye(){!_e&&ie&&le&&(window.requestAnimationFrame(Ie),le=!1)}return D.registerAnimation=Te,D.loadAnimation=function(ge){var Se=new AnimationItem;return Ae(Se,null),Se.setParams(ge),Se},D.setSpeed=function(ge,Se){var Ce;for(Ce=0;Ce<J;Ce+=1)O[Ce].animation.setSpeed(ge,Se)},D.setDirection=function(ge,Se){var Ce;for(Ce=0;Ce<J;Ce+=1)O[Ce].animation.setDirection(ge,Se)},D.play=function(ge){var Se;for(Se=0;Se<J;Se+=1)O[Se].animation.play(ge)},D.pause=function(ge){var Se;for(Se=0;Se<J;Se+=1)O[Se].animation.pause(ge)},D.stop=function(ge){var Se;for(Se=0;Se<J;Se+=1)O[Se].animation.stop(ge)},D.togglePause=function(ge){var Se;for(Se=0;Se<J;Se+=1)O[Se].animation.togglePause(ge)},D.searchAnimations=function(ge,Se,Ce){var Ve,at=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),et=at.length;for(Ve=0;Ve<et;Ve+=1)Ce&&at[Ve].setAttribute("data-bm-type",Ce),Te(at[Ve],ge);if(Se&&et===0){Ce||(Ce="svg");var Mt=document.getElementsByTagName("body")[0];Mt.innerText="";var jt=createTag("div");
vendor: 4,248 bytes, line 18
18jt.style.width="100%",jt.style.height="100%",jt.setAttribute("data-bm-type",Ce),Mt.appendChild(jt),Te(jt,ge)}},D.resize=function(){var ge;for(ge=0;ge<J;ge+=1)O[ge].animation.resize()},D.goToAndStop=function(ge,Se,Ce){var Ve;for(Ve=0;Ve<J;Ve+=1)O[Ve].animation.goToAndStop(ge,Se,Ce)},D.destroy=function(ge){var Se;for(Se=J-1;Se>=0;Se-=1)O[Se].animation.destroy(ge)},D.freeze=function(){_e=!0},D.unfreeze=function(){_e=!1,ye()},D.setVolume=function(ge,Se){var Ce;for(Ce=0;Ce<J;Ce+=1)O[Ce].animation.setVolume(ge,Se)},D.mute=function(ge){var Se;for(Se=0;Se<J;Se+=1)O[Se].animation.mute(ge)},D.unmute=function(ge){var Se;for(Se=0;Se<J;Se+=1)O[Se].animation.unmute(ge)},D.getRegisteredAnimations=function(){var ge,Se=O.length,Ce=[];for(ge=0;ge<Se;ge+=1)Ce.push(O[ge].animation);return Ce},D}(),BezierFactory=function(){var D={getBezierEasing:function(ve,Ae,Ee,Ie,ye){var ge=ye||("bez_"+ve+"_"+Ae+"_"+Ee+"_"+Ie).replace(/\./g,"p");if(O[ge])return O[ge];var Se=new Pe([ve,Ae,Ee,Ie]);return O[ge]=Se,Se}},O={},q=.1,J=typeof Float32Array=="function";function ie(ve,Ae){return 1-3*Ae+3*ve}function le(ve,Ae){return 3*Ae-6*ve}function _e(ve){return 3*ve}function o(ve,Ae,Ee){return((ie(Ae,Ee)*ve+le(Ae,Ee))*ve+_e(Ae))*ve}function Te(ve,Ae,Ee){return 3*ie(Ae,Ee)*ve*ve+2*le(Ae,Ee)*ve+_e(Ae)}function Pe(ve){this._p=ve,this._mSampleValues=J?new Float32Array(11):new Array(11),this._precomputed=!1,this.get=this.get.bind(this)}return Pe.prototype={get:function(ve){var Ae=this._p[0],Ee=this._p[1],Ie=this._p[2],ye=this._p[3];return this._precomputed||this._precompute(),Ae===Ee&&Ie===ye?ve:ve===0?0:ve===1?1:o(this._getTForX(ve),Ee,ye)},_precompute:function(){var ve=this._p[0],Ae=this._p[1],Ee=this._p[2],Ie=this._p[3];this._precomputed=!0,ve===Ae&&Ee===Ie||this._calcSampleValues()},_calcSampleValues:function(){for(var ve=this._p[0],Ae=this._p[2],Ee=0;Ee<11;++Ee)this._mSampleValues[Ee]=o(Ee*q,ve,Ae)},_getTForX:function(ve){for(var Ae=this._p[0],Ee=this._p[2],Ie=this._mSampleValues,ye=0,ge=1;ge!==10&&Ie[ge]<=ve;++ge)ye+=q;var Se=ye+(ve-Ie[--ge])/(Ie[ge+1]-Ie[ge])*q,Ce=Te(Se,Ae,Ee);return Ce>=.001?function(Ve,at,et,Mt){for(var jt=0;jt<4;++jt){var St=Te(at,et,Mt);if(St===0)return at;at-=(o(at,et,Mt)-Ve)/St}return at}(ve,Se,Ae,Ee):Ce===0?Se:function(Ve,at,et,Mt,jt){var St,Bt,Zt=0;do(St=o(Bt=at+(et-at)/2,Mt,jt)-Ve)>0?et=Bt:at=Bt;while(Math.abs(St)>1e-7&&++Zt<10);return Bt}(ve,ye,ye+q,Ae,Ee)}},D}(),pooling={double:function(D){return D.concat(createSizedArray(D.length))}},poolFactory=function(D,O,q){var J=0,ie=D,le=createSizedArray(ie);return{newElement:function(){return J?le[J-=1]:O()},release:function(_e){J===ie&&(le=pooling.double(le),ie*=2),q&&q(_e),le[J]=_e,J+=1}}},bezierLengthPool=poolFactory(8,function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}),segmentsLengthPool=poolFactory(8,function(){return{lengths:[],totalLength:0}},function(D){var O,q=D.lengths.length;for(O=0;O<q;O+=1)bezierLengthPool.release(D.lengths[O]);D.lengths.length=0});function bezFunction(){var D=Math;function O(Pe,ve,Ae,Ee,Ie,ye){var ge=Pe*Ee+ve*Ie+Ae*ye-Ie*Ee-ye*Pe-Ae*ve;return ge>-.001&&ge<.001}var q=function(Pe,ve,Ae,Ee){var Ie,ye,ge,Se,Ce,Ve,at=getDefaultCurveSegments(),et=0,Mt=[],jt=[],St=bezierLengthPool.newElement();for(ge=Ae.length,Ie=0;Ie<at;Ie+=1){for(Ce=Ie/(at-1),Ve=0,ye=0;ye<ge;ye+=1)Se=bmPow(1-Ce,3)*Pe[ye]+3*bmPow(1-Ce,2)*Ce*Ae[ye]+3*(1-Ce)*bmPow(Ce,2)*Ee[ye]+bmPow(Ce,3)*ve[ye],Mt[ye]=Se,jt[ye]!==null&&(Ve+=bmPow(Mt[ye]-jt[ye],2)),jt[ye]=Mt[ye];Ve&&(et+=Ve=bmSqrt(Ve)),St.percents[Ie]=Ce,St.lengths[Ie]=et}return St.addedLength=et,St};function J(Pe){this.segmentLength=0,this.points=new Array(Pe)}function ie(Pe,ve){this.partialLength=Pe,this.point=ve}var le,_e=(le={},function(Pe,ve,Ae,Ee){var Ie=(Pe[0]+"_"+Pe[1]+"_"+ve[0]+"_"+ve[1]+"_"+Ae[0]+"_"+Ae[1]+"_"+Ee[0]+"_"+Ee[1]).replace(/\./g,"p");if(!le[Ie]){var ye,ge,Se,Ce,Ve,at,et,Mt=getDefaultCurveSegments(),jt=0,St=null;Pe.length===2&&(Pe[0]!==ve[0]||Pe[1]!==ve[1])&&O(Pe[0],Pe[1],ve[0],ve[1],Pe[0]+Ae[0],Pe[1]+Ae[1])&&O(Pe[0],Pe[1],ve[0],ve[1],ve[0]+Ee[0],ve[1]+Ee[1])&&(Mt=2);var Bt=new J(Mt);for(Se=Ae.length,ye=0;ye<Mt;ye+=1){for(et=createSizedArray(Se),Ve=ye/(Mt-1),at=0,ge=0;ge<Se;
vendor: 1,449 bytes, line 18
18ge+=1)Ce=bmPow(1-Ve,3)*Pe[ge]+3*bmPow(1-Ve,2)*Ve*(Pe[ge]+Ae[ge])+3*(1-Ve)*bmPow(Ve,2)*(ve[ge]+Ee[ge])+bmPow(Ve,3)*ve[ge],et[ge]=Ce,St!==null&&(at+=bmPow(et[ge]-St[ge],2));jt+=at=bmSqrt(at),Bt.points[ye]=new ie(at,et),St=et}Bt.segmentLength=jt,le[Ie]=Bt}return le[Ie]});function o(Pe,ve){var Ae=ve.percents,Ee=ve.lengths,Ie=Ae.length,ye=bmFloor((Ie-1)*Pe),ge=Pe*ve.addedLength,Se=0;if(ye===Ie-1||ye===0||ge===Ee[ye])return Ae[ye];for(var Ce=Ee[ye]>ge?-1:1,Ve=!0;Ve;)if(Ee[ye]<=ge&&Ee[ye+1]>ge?(Se=(ge-Ee[ye])/(Ee[ye+1]-Ee[ye]),Ve=!1):ye+=Ce,ye<0||ye>=Ie-1){if(ye===Ie-1)return Ae[ye];Ve=!1}return Ae[ye]+(Ae[ye+1]-Ae[ye])*Se}var Te=createTypedArray("float32",8);return{getSegmentsLength:function(Pe){var ve,Ae=segmentsLengthPool.newElement(),Ee=Pe.c,Ie=Pe.v,ye=Pe.o,ge=Pe.i,Se=Pe._length,Ce=Ae.lengths,Ve=0;for(ve=0;ve<Se-1;ve+=1)Ce[ve]=q(Ie[ve],Ie[ve+1],ye[ve],ge[ve+1]),Ve+=Ce[ve].addedLength;return Ee&&Se&&(Ce[ve]=q(Ie[ve],Ie[0],ye[ve],ge[0]),Ve+=Ce[ve].addedLength),Ae.totalLength=Ve,Ae},getNewSegment:function(Pe,ve,Ae,Ee,Ie,ye,ge){Ie<0?Ie=0:Ie>1&&(Ie=1);var Se,Ce=o(Ie,ge),Ve=o(ye=ye>1?1:ye,ge),at=Pe.length,et=1-Ce,Mt=1-Ve,jt=et*et*et,St=Ce*et*et*3,Bt=Ce*Ce*et*3,Zt=Ce*Ce*Ce,xt=et*et*Mt,wt=Ce*et*Mt+et*Ce*Mt+et*et*Ve,Je=Ce*Ce*Mt+et*Ce*Ve+Ce*et*Ve,ut=Ce*Ce*Ve,lt=et*Mt*Mt,Ye=Ce*Mt*Mt+et*Ve*Mt+et*Mt*Ve,pi=Ce*Ve*Mt+et*Ve*Ve+Ce*Mt*Ve,si=Ce*Ve*Ve,rt=Mt*Mt*Mt,kt=Ve*Mt*Mt+Mt*Ve*Mt+Mt*Mt*Ve,_i=Ve*Ve*Mt+Mt*Ve*Ve+Ve*Mt*Ve,Yi=Ve*Ve*Ve;for(Se=0;Se<at;
vendor: 12,538 bytes, line 18
18Se+=1)Te[4*Se]=D.round(1e3*(jt*Pe[Se]+St*Ae[Se]+Bt*Ee[Se]+Zt*ve[Se]))/1e3,Te[4*Se+1]=D.round(1e3*(xt*Pe[Se]+wt*Ae[Se]+Je*Ee[Se]+ut*ve[Se]))/1e3,Te[4*Se+2]=D.round(1e3*(lt*Pe[Se]+Ye*Ae[Se]+pi*Ee[Se]+si*ve[Se]))/1e3,Te[4*Se+3]=D.round(1e3*(rt*Pe[Se]+kt*Ae[Se]+_i*Ee[Se]+Yi*ve[Se]))/1e3;return Te},getPointInSegment:function(Pe,ve,Ae,Ee,Ie,ye){var ge=o(Ie,ye),Se=1-ge;return[D.round(1e3*(Se*Se*Se*Pe[0]+(ge*Se*Se+Se*ge*Se+Se*Se*ge)*Ae[0]+(ge*ge*Se+Se*ge*ge+ge*Se*ge)*Ee[0]+ge*ge*ge*ve[0]))/1e3,D.round(1e3*(Se*Se*Se*Pe[1]+(ge*Se*Se+Se*ge*Se+Se*Se*ge)*Ae[1]+(ge*ge*Se+Se*ge*ge+ge*Se*ge)*Ee[1]+ge*ge*ge*ve[1]))/1e3]},buildBezierData:_e,pointOnLine2D:O,pointOnLine3D:function(Pe,ve,Ae,Ee,Ie,ye,ge,Se,Ce){if(Ae===0&&ye===0&&Ce===0)return O(Pe,ve,Ee,Ie,ge,Se);var Ve,at=D.sqrt(D.pow(Ee-Pe,2)+D.pow(Ie-ve,2)+D.pow(ye-Ae,2)),et=D.sqrt(D.pow(ge-Pe,2)+D.pow(Se-ve,2)+D.pow(Ce-Ae,2)),Mt=D.sqrt(D.pow(ge-Ee,2)+D.pow(Se-Ie,2)+D.pow(Ce-ye,2));return(Ve=at>et?at>Mt?at-et-Mt:Mt-et-at:Mt>et?Mt-et-at:et-at-Mt)>-1e-4&&Ve<1e-4}}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(D,O){var q,J=this.offsetTime;this.propType==="multidimensional"&&(q=createTypedArray("float32",this.pv.length));for(var ie,le,_e,o,Te,Pe,ve,Ae,Ee,Ie=O.lastIndex,ye=Ie,ge=this.keyframes.length-1,Se=!0;Se;){if(ie=this.keyframes[ye],le=this.keyframes[ye+1],ye===ge-1&&D>=le.t-J){ie.h&&(ie=le),Ie=0;break}if(le.t-J>D){Ie=ye;break}ye<ge-1?ye+=1:(Ie=0,Se=!1)}_e=this.keyframesMetadata[ye]||{};var Ce,Ve=le.t-J,at=ie.t-J;if(ie.to){_e.bezierData||(_e.bezierData=bez.buildBezierData(ie.s,le.s||ie.e,ie.to,ie.ti));var et=_e.bezierData;if(D>=Ve||D<at){var Mt=D>=Ve?et.points.length-1:0;for(Te=et.points[Mt].point.length,o=0;o<Te;o+=1)q[o]=et.points[Mt].point[o]}else{_e.__fnct?Ee=_e.__fnct:(Ee=BezierFactory.getBezierEasing(ie.o.x,ie.o.y,ie.i.x,ie.i.y,ie.n).get,_e.__fnct=Ee),Pe=Ee((D-at)/(Ve-at));var jt,St=et.segmentLength*Pe,Bt=O.lastFrame<D&&O._lastKeyframeIndex===ye?O._lastAddedLength:0;for(Ae=O.lastFrame<D&&O._lastKeyframeIndex===ye?O._lastPoint:0,Se=!0,ve=et.points.length;Se;){if(Bt+=et.points[Ae].partialLength,St===0||Pe===0||Ae===et.points.length-1){for(Te=et.points[Ae].point.length,o=0;o<Te;o+=1)q[o]=et.points[Ae].point[o];break}if(St>=Bt&&St<Bt+et.points[Ae+1].partialLength){for(jt=(St-Bt)/et.points[Ae+1].partialLength,Te=et.points[Ae].point.length,o=0;o<Te;o+=1)q[o]=et.points[Ae].point[o]+(et.points[Ae+1].point[o]-et.points[Ae].point[o])*jt;break}Ae<ve-1?Ae+=1:Se=!1}O._lastPoint=Ae,O._lastAddedLength=Bt-et.points[Ae].partialLength,O._lastKeyframeIndex=ye}}else{var Zt,xt,wt,Je,ut;if(ge=ie.s.length,Ce=le.s||ie.e,this.sh&&ie.h!==1)D>=Ve?(q[0]=Ce[0],q[1]=Ce[1],q[2]=Ce[2]):D<=at?(q[0]=ie.s[0],q[1]=ie.s[1],q[2]=ie.s[2]):quaternionToEuler(q,slerp(createQuaternion(ie.s),createQuaternion(Ce),(D-at)/(Ve-at)));else for(ye=0;ye<ge;ye+=1)ie.h!==1&&(D>=Ve?Pe=1:D<at?Pe=0:(ie.o.x.constructor===Array?(_e.__fnct||(_e.__fnct=[]),_e.__fnct[ye]?Ee=_e.__fnct[ye]:(Zt=ie.o.x[ye]===void 0?ie.o.x[0]:ie.o.x[ye],xt=ie.o.y[ye]===void 0?ie.o.y[0]:ie.o.y[ye],wt=ie.i.x[ye]===void 0?ie.i.x[0]:ie.i.x[ye],Je=ie.i.y[ye]===void 0?ie.i.y[0]:ie.i.y[ye],Ee=BezierFactory.getBezierEasing(Zt,xt,wt,Je).get,_e.__fnct[ye]=Ee)):_e.__fnct?Ee=_e.__fnct:(Zt=ie.o.x,xt=ie.o.y,wt=ie.i.x,Je=ie.i.y,Ee=BezierFactory.getBezierEasing(Zt,xt,wt,Je).get,ie.keyframeMetadata=Ee),Pe=Ee((D-at)/(Ve-at)))),Ce=le.s||ie.e,ut=ie.h===1?ie.s[ye]:ie.s[ye]+(Ce[ye]-ie.s[ye])*Pe,this.propType==="multidimensional"?q[ye]=ut:q=ut}return O.lastIndex=Ie,q}function slerp(D,O,q){var J,ie,le,_e,o,Te=[],Pe=D[0],ve=D[1],Ae=D[2],Ee=D[3],Ie=O[0],ye=O[1],ge=O[2],Se=O[3];return(ie=Pe*Ie+ve*ye+Ae*ge+Ee*Se)<0&&(ie=-ie,Ie=-Ie,ye=-ye,ge=-ge,Se=-Se),1-ie>1e-6?(J=Math.acos(ie),le=Math.sin(J),_e=Math.sin((1-q)*J)/le,o=Math.sin(q*J)/le):(_e=1-q,o=q),Te[0]=_e*Pe+o*Ie,Te[1]=_e*ve+o*ye,Te[2]=_e*Ae+o*ge,Te[3]=_e*Ee+o*Se,Te}function quaternionToEuler(D,O){var q=O[0],J=O[1],ie=O[2],le=O[3],_e=Math.atan2(2*J*le-2*q*ie,1-2*J*J-2*ie*ie),o=Math.asin(2*q*J+2*ie*le),Te=Math.atan2(2*q*le-2*J*ie,1-2*q*q-2*ie*ie);D[0]=_e/degToRads,D[1]=o/degToRads,D[2]=Te/degToRads}function createQuaternion(D){var O=D[0]*degToRads,q=D[1]*degToRads,J=D[2]*degToRads,ie=Math.cos(O/2),le=Math.cos(q/2),_e=Math.cos(J/2),o=Math.sin(O/2),Te=Math.sin(q/2),Pe=Math.sin(J/2);return[o*Te*_e+ie*le*Pe,o*le*_e+ie*Te*Pe,ie*Te*_e-o*le*Pe,ie*le*_e-o*Te*Pe]}function getValueAtCurrentTime(){var D=this.comp.renderedFrame-this.offsetTime,O=this.keyframes[0].t-this.offsetTime,q=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(D===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=q&&D>=q||this._caching.lastFrame<O&&D<O))){this._caching.lastFrame>=D&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var J=this.interpolateValue(D,this._caching);this.pv=J}return this._caching.lastFrame=D,this.pv}function setVValue(D){var O;if(this.propType==="unidimensional")O=D*this.mult,mathAbs(this.v-O)>1e-5&&(this.v=O,this._mdf=!0);else for(var q=0,J=this.v.length;q<J;)O=D[q]*this.mult,mathAbs(this.v[q]-O)>1e-5&&(this.v[q]=O,this._mdf=!0),q+=1}function processEffectsSequence(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var D;this.lock=!0,this._mdf=this._isFirstFrame;var O=this.effectsSequence.length,q=this.kf?this.pv:this.data.k;for(D=0;D<O;D+=1)q=this.effectsSequence[D](q);this.setVValue(q),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(D){this.effectsSequence.push(D),this.container.addDynamicProperty(this)}function ValueProperty(D,O,q,J){this.propType="unidimensional",this.mult=q||1,this.data=O,this.v=q?O.k*q:O.k,this.pv=O.k,this._mdf=!1,this.elem=D,this.container=J,this.comp=D.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(D,O,q,J){var ie;this.propType="multidimensional",this.mult=q||1,this.data=O,this._mdf=!1,this.elem=D,this.container=J,this.comp=D.comp,this.k=!1,this.kf=!1,this.frameId=-1;var le=O.k.length;for(this.v=createTypedArray("float32",le),this.pv=createTypedArray("float32",le),this.vel=createTypedArray("float32",le),ie=0;ie<le;ie+=1)this.v[ie]=O.k[ie]*this.mult,this.pv[ie]=O.k[ie];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(D,O,q,J){this.propType="unidimensional",this.keyframes=O.k,this.keyframesMetadata=[],this.offsetTime=D.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=O,this.mult=q||1,this.elem=D,this.container=J,this.comp=D.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(D,O,q,J){var ie;this.propType="multidimensional";var le,_e,o,Te,Pe=O.k.length;for(ie=0;ie<Pe-1;ie+=1)O.k[ie].to&&O.k[ie].s&&O.k[ie+1]&&O.k[ie+1].s&&(le=O.k[ie].s,_e=O.k[ie+1].s,o=O.k[ie].to,Te=O.k[ie].ti,(le.length===2&&(le[0]!==_e[0]||le[1]!==_e[1])&&bez.pointOnLine2D(le[0],le[1],_e[0],_e[1],le[0]+o[0],le[1]+o[1])&&bez.pointOnLine2D(le[0],le[1],_e[0],_e[1],_e[0]+Te[0],_e[1]+Te[1])||le.length===3&&(le[0]!==_e[0]||le[1]!==_e[1]||le[2]!==_e[2])&&bez.pointOnLine3D(le[0],le[1],le[2],_e[0],_e[1],_e[2],le[0]+o[0],le[1]+o[1],le[2]+o[2])&&bez.pointOnLine3D(le[0],le[1],le[2],_e[0],_e[1],_e[2],_e[0]+Te[0],_e[1]+Te[1],_e[2]+Te[2]))&&(O.k[ie].to=null,O.k[ie].ti=null),le[0]===_e[0]&&le[1]===_e[1]&&o[0]===0&&o[1]===0&&Te[0]===0&&Te[1]===0&&(le.length===2||le[2]===_e[2]&&o[2]===0&&Te[2]===0)&&(O.k[ie].to=null,O.k[ie].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=O,this.keyframes=O.k,this.keyframesMetadata=[],this.offsetTime=D.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=q||1,this.elem=D,this.container=J,this.comp=D.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var ve=O.k[0].s.length;for(this.v=createTypedArray("float32",ve),this.pv=createTypedArray("float32",ve),ie=0;ie<ve;ie+=1)this.v[ie]=initFrame,this.pv[ie]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",ve)},this.addEffect=addEffect}var PropertyFactory=(ob={getProp:function(D,O,q,J,ie){var le;if(O.sid&&(O=D.globalData.slotManager.getProp(O)),O.k.length)if(typeof O.k[0]=="number")le=new MultiDimensionalProperty(D,O,J,ie);else switch(q){case 0:le=new KeyframedValueProperty(D,O,J,ie);break;case 1:le=new KeyframedMultidimensionalProperty(D,O,J,ie)}else le=new ValueProperty(D,O,J,ie);return le.effectsSequence.length&&ie.addDynamicProperty(le),le}},ob),ob;function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(D){this.dynamicProperties.indexOf(D)===-1&&(this.dynamicProperties.push(D),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var D;this._mdf=!1;var O=this.dynamicProperties.length;for(D=0;D<O;D+=1)this.dynamicProperties[D].getValue(),this.dynamicProperties[D]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(D){this.container=D,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=poolFactory(8,function(){return createTypedArray("float32",2)});function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(D,O){this.c=D,this.setLength(O);for(var q=0;q<O;)this.v[q]=pointPool.newElement(),this.o[q]=pointPool.newElement(),this.i[q]=pointPool.newElement(),q+=1},ShapePath.prototype.setLength=function(D){for(;this._maxLength<D;)this.doubleArrayLength();this._length=D},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(D,O,q,J,ie){var le;switch(this._length=Math.max(this._length,J+1),this._length>=this._maxLength&&this.doubleArrayLength(),q){case"v":le=this.v;break;case"i":le=this.i;break;case"o":le=this.o;break;default:le=[]}(!le[J]||le[J]&&!ie)&&(le[J]=pointPool.newElement()),le[J][0]=D,le[J][1]=O},ShapePath.prototype.setTripleAt=function(D,O,q,J,ie,le,_e,o){this.setXYAt(D,O,"v",_e,o),this.setXYAt(q,J,"o",_e,o),this.setXYAt(ie,le,"i",_e,o)},ShapePath.prototype.reverse=function(){var D=new ShapePath;D.setPathData(this.c,this._length);var O=this.v,q=this.o,J=this.i,ie=0;this.c&&(D.setTripleAt(O[0][0],O[0][1],J[0][0],J[0][1],q[0][0],q[0][1],0,!1),ie=1);var le,_e=this._length-1,o=this._length;for(le=ie;le<o;le+=1)D.setTripleAt(O[_e][0],O[_e][1],J[_e][0],J[_e][1],q[_e][0],q[_e][1],le,!1),_e-=1;return D},ShapePath.prototype.length=function(){return this._length};var shapePool=(factory=poolFactory(4,function(){return new ShapePath},function(D){var O,q=D._length;for(O=0;O<q;O+=1)pointPool.release(D.v[O]),pointPool.release(D.i[O]),pointPool.release(D.o[O]),D.v[O]=null,D.i[O]=null,D.o[O]=null;D._length=0,D.c=!1}),factory.clone=function(D){var O,q=factory.newElement(),J=D._length===void 0?D.v.length:D._length;for(q.setLength(J),q.c=D.c,O=0;O<J;O+=1)q.setTripleAt(D.v[O][0],D.v[O][1],D.o[O][0],D.o[O][1],D.i[O][0],D.i[O][1],O);return q},factory),factory;function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(D){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=D,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var D;for(D=0;D<this._length;D+=1)shapePool.release(this.shapes[D]);this._length=0};var shapeCollectionPool=function(){var D={newShapeCollection:function(){return O?J[O-=1]:new ShapeCollection},release:function(ie){var le,_e=ie._length;for(le=0;le<_e;le+=1)shapePool.release(ie.shapes[le]);ie._length=0,O===q&&(J=pooling.double(J),q*=2),J[O]=ie,O+=1}},O=0,q=4,J=createSizedArray(q);return D}(),ShapePropertyFactory=function(){var D=-999999;
vendor: 5,522 bytes, line 18
18function O(Ie,ye,ge){var Se,Ce,Ve,at,et,Mt,jt,St,Bt,Zt=ge.lastIndex,xt=this.keyframes;if(Ie<xt[0].t-this.offsetTime)Se=xt[0].s[0],Ve=!0,Zt=0;else if(Ie>=xt[xt.length-1].t-this.offsetTime)Se=xt[xt.length-1].s?xt[xt.length-1].s[0]:xt[xt.length-2].e[0],Ve=!0;else{for(var wt,Je,ut,lt=Zt,Ye=xt.length-1,pi=!0;pi&&(wt=xt[lt],!((Je=xt[lt+1]).t-this.offsetTime>Ie));)lt<Ye-1?lt+=1:pi=!1;if(ut=this.keyframesMetadata[lt]||{},Zt=lt,!(Ve=wt.h===1)){if(Ie>=Je.t-this.offsetTime)St=1;else if(Ie<wt.t-this.offsetTime)St=0;else{var si;ut.__fnct?si=ut.__fnct:(si=BezierFactory.getBezierEasing(wt.o.x,wt.o.y,wt.i.x,wt.i.y).get,ut.__fnct=si),St=si((Ie-(wt.t-this.offsetTime))/(Je.t-this.offsetTime-(wt.t-this.offsetTime)))}Ce=Je.s?Je.s[0]:wt.e[0]}Se=wt.s[0]}for(Mt=ye._length,jt=Se.i[0].length,ge.lastIndex=Zt,at=0;at<Mt;at+=1)for(et=0;et<jt;et+=1)Bt=Ve?Se.i[at][et]:Se.i[at][et]+(Ce.i[at][et]-Se.i[at][et])*St,ye.i[at][et]=Bt,Bt=Ve?Se.o[at][et]:Se.o[at][et]+(Ce.o[at][et]-Se.o[at][et])*St,ye.o[at][et]=Bt,Bt=Ve?Se.v[at][et]:Se.v[at][et]+(Ce.v[at][et]-Se.v[at][et])*St,ye.v[at][et]=Bt}function q(){var Ie=this.comp.renderedFrame-this.offsetTime,ye=this.keyframes[0].t-this.offsetTime,ge=this.keyframes[this.keyframes.length-1].t-this.offsetTime,Se=this._caching.lastFrame;return Se!==D&&(Se<ye&&Ie<ye||Se>ge&&Ie>ge)||(this._caching.lastIndex=Se<Ie?this._caching.lastIndex:0,this.interpolateShape(Ie,this.pv,this._caching)),this._caching.lastFrame=Ie,this.pv}function J(){this.paths=this.localShapeCollection}function ie(Ie){(function(ye,ge){if(ye._length!==ge._length||ye.c!==ge.c)return!1;var Se,Ce=ye._length;for(Se=0;Se<Ce;Se+=1)if(ye.v[Se][0]!==ge.v[Se][0]||ye.v[Se][1]!==ge.v[Se][1]||ye.o[Se][0]!==ge.o[Se][0]||ye.o[Se][1]!==ge.o[Se][1]||ye.i[Se][0]!==ge.i[Se][0]||ye.i[Se][1]!==ge.i[Se][1])return!1;return!0})(this.v,Ie)||(this.v=shapePool.clone(Ie),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function le(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var Ie,ye;this.lock=!0,this._mdf=!1,Ie=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var ge=this.effectsSequence.length;for(ye=0;ye<ge;ye+=1)Ie=this.effectsSequence[ye](Ie);this.setVValue(Ie),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function _e(Ie,ye,ge){this.propType="shape",this.comp=Ie.comp,this.container=Ie,this.elem=Ie,this.data=ye,this.k=!1,this.kf=!1,this._mdf=!1;var Se=ge===3?ye.pt.k:ye.ks.k;this.v=shapePool.clone(Se),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=J,this.effectsSequence=[]}function o(Ie){this.effectsSequence.push(Ie),this.container.addDynamicProperty(this)}function Te(Ie,ye,ge){this.propType="shape",this.comp=Ie.comp,this.elem=Ie,this.container=Ie,this.offsetTime=Ie.data.st,this.keyframes=ge===3?ye.pt.k:ye.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var Se=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,Se),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=D,this.reset=J,this._caching={lastFrame:D,lastIndex:0},this.effectsSequence=[q.bind(this)]}_e.prototype.interpolateShape=O,_e.prototype.getValue=le,_e.prototype.setVValue=ie,_e.prototype.addEffect=o,Te.prototype.getValue=le,Te.prototype.interpolateShape=O,Te.prototype.setVValue=ie,Te.prototype.addEffect=o;var Pe=function(){var Ie=roundCorner;function ye(ge,Se){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=Se.d,this.elem=ge,this.comp=ge.comp,this.frameId=-1,this.initDynamicPropertyContainer(ge),this.p=PropertyFactory.getProp(ge,Se.p,1,0,this),this.s=PropertyFactory.getProp(ge,Se.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return ye.prototype={reset:J,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var ge=this.p.v[0],Se=this.p.v[1],Ce=this.s.v[0]/2,Ve=this.s.v[1]/2,at=this.d!==3,et=this.v;et.v[0][0]=ge,et.v[0][1]=Se-Ve,et.v[1][0]=at?ge+Ce:ge-Ce,et.v[1][1]=Se,et.v[2][0]=ge,et.v[2][1]=Se+Ve,et.v[3][0]=at?ge-Ce:ge+Ce,et.v[3][1]=Se,et.i[0][0]=at?ge-Ce*Ie:ge+Ce*Ie,et.i[0][1]=Se-Ve,et.i[1][0]=at?ge+Ce:ge-Ce,et.i[1][1]=Se-Ve*Ie,et.i[2][0]=at?ge+Ce*Ie:ge-Ce*Ie,et.i[2][1]=Se+Ve,et.i[3][0]=at?ge-Ce:ge+Ce,et.i[3][1]=Se+Ve*Ie,et.o[0][0]=at?ge+Ce*Ie:ge-Ce*Ie,et.o[0][1]=Se-Ve,et.o[1][0]=at?ge+Ce:ge-Ce,et.o[1][1]=Se+Ve*Ie,et.o[2][0]=at?ge-Ce*Ie:ge+Ce*Ie,et.o[2][1]=Se+Ve,et.o[3][0]=at?ge-Ce:ge+Ce,et.o[3][1]=Se-Ve*Ie}},extendPrototype([DynamicPropertyContainer],ye),ye}(),ve=function(){function Ie(ye,ge){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=ye,this.comp=ye.comp,this.data=ge,this.frameId=-1,this.d=ge.d,this.initDynamicPropertyContainer(ye),ge.sy===1?(this.ir=PropertyFactory.getProp(ye,ge.ir,0,0,this),this.is=PropertyFactory.getProp(ye,ge.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=Pro
vendor: 5,082 bytes, line 18
18pertyFactory.getProp(ye,ge.pt,0,0,this),this.p=PropertyFactory.getProp(ye,ge.p,1,0,this),this.r=PropertyFactory.getProp(ye,ge.r,0,degToRads,this),this.or=PropertyFactory.getProp(ye,ge.or,0,0,this),this.os=PropertyFactory.getProp(ye,ge.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return Ie.prototype={reset:J,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var ye,ge,Se,Ce,Ve=2*Math.floor(this.pt.v),at=2*Math.PI/Ve,et=!0,Mt=this.or.v,jt=this.ir.v,St=this.os.v,Bt=this.is.v,Zt=2*Math.PI*Mt/(2*Ve),xt=2*Math.PI*jt/(2*Ve),wt=-Math.PI/2;wt+=this.r.v;var Je=this.data.d===3?-1:1;for(this.v._length=0,ye=0;ye<Ve;ye+=1){Se=et?St:Bt,Ce=et?Zt:xt;var ut=(ge=et?Mt:jt)*Math.cos(wt),lt=ge*Math.sin(wt),Ye=ut===0&&lt===0?0:lt/Math.sqrt(ut*ut+lt*lt),pi=ut===0&&lt===0?0:-ut/Math.sqrt(ut*ut+lt*lt);ut+=+this.p.v[0],lt+=+this.p.v[1],this.v.setTripleAt(ut,lt,ut-Ye*Ce*Se*Je,lt-pi*Ce*Se*Je,ut+Ye*Ce*Se*Je,lt+pi*Ce*Se*Je,ye,!0),et=!et,wt+=at*Je}},convertPolygonToPath:function(){var ye,ge=Math.floor(this.pt.v),Se=2*Math.PI/ge,Ce=this.or.v,Ve=this.os.v,at=2*Math.PI*Ce/(4*ge),et=.5*-Math.PI,Mt=this.data.d===3?-1:1;for(et+=this.r.v,this.v._length=0,ye=0;ye<ge;ye+=1){var jt=Ce*Math.cos(et),St=Ce*Math.sin(et),Bt=jt===0&&St===0?0:St/Math.sqrt(jt*jt+St*St),Zt=jt===0&&St===0?0:-jt/Math.sqrt(jt*jt+St*St);jt+=+this.p.v[0],St+=+this.p.v[1],this.v.setTripleAt(jt,St,jt-Bt*at*Ve*Mt,St-Zt*at*Ve*Mt,jt+Bt*at*Ve*Mt,St+Zt*at*Ve*Mt,ye,!0),et+=Se*Mt}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],Ie),Ie}(),Ae=function(){function Ie(ye,ge){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=ye,this.comp=ye.comp,this.frameId=-1,this.d=ge.d,this.initDynamicPropertyContainer(ye),this.p=PropertyFactory.getProp(ye,ge.p,1,0,this),this.s=PropertyFactory.getProp(ye,ge.s,1,0,this),this.r=PropertyFactory.getProp(ye,ge.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return Ie.prototype={convertRectToPath:function(){var ye=this.p.v[0],ge=this.p.v[1],Se=this.s.v[0]/2,Ce=this.s.v[1]/2,Ve=bmMin(Se,Ce,this.r.v),at=Ve*(1-roundCorner);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt(ye+Se,ge-Ce+Ve,ye+Se,ge-Ce+Ve,ye+Se,ge-Ce+at,0,!0),this.v.setTripleAt(ye+Se,ge+Ce-Ve,ye+Se,ge+Ce-at,ye+Se,ge+Ce-Ve,1,!0),Ve!==0?(this.v.setTripleAt(ye+Se-Ve,ge+Ce,ye+Se-Ve,ge+Ce,ye+Se-at,ge+Ce,2,!0),this.v.setTripleAt(ye-Se+Ve,ge+Ce,ye-Se+at,ge+Ce,ye-Se+Ve,ge+Ce,3,!0),this.v.setTripleAt(ye-Se,ge+Ce-Ve,ye-Se,ge+Ce-Ve,ye-Se,ge+Ce-at,4,!0),this.v.setTripleAt(ye-Se,ge-Ce+Ve,ye-Se,ge-Ce+at,ye-Se,ge-Ce+Ve,5,!0),this.v.setTripleAt(ye-Se+Ve,ge-Ce,ye-Se+Ve,ge-Ce,ye-Se+at,ge-Ce,6,!0),this.v.setTripleAt(ye+Se-Ve,ge-Ce,ye+Se-at,ge-Ce,ye+Se-Ve,ge-Ce,7,!0)):(this.v.setTripleAt(ye-Se,ge+Ce,ye-Se+at,ge+Ce,ye-Se,ge+Ce,2),this.v.setTripleAt(ye-Se,ge-Ce,ye-Se,ge-Ce+at,ye-Se,ge-Ce,3))):(this.v.setTripleAt(ye+Se,ge-Ce+Ve,ye+Se,ge-Ce+at,ye+Se,ge-Ce+Ve,0,!0),Ve!==0?(this.v.setTripleAt(ye+Se-Ve,ge-Ce,ye+Se-Ve,ge-Ce,ye+Se-at,ge-Ce,1,!0),this.v.setTripleAt(ye-Se+Ve,ge-Ce,ye-Se+at,ge-Ce,ye-Se+Ve,ge-Ce,2,!0),this.v.setTripleAt(ye-Se,ge-Ce+Ve,ye-Se,ge-Ce+Ve,ye-Se,ge-Ce+at,3,!0),this.v.setTripleAt(ye-Se,ge+Ce-Ve,ye-Se,ge+Ce-at,ye-Se,ge+Ce-Ve,4,!0),this.v.setTripleAt(ye-Se+Ve,ge+Ce,ye-Se+Ve,ge+Ce,ye-Se+at,ge+Ce,5,!0),this.v.setTripleAt(ye+Se-Ve,ge+Ce,ye+Se-at,ge+Ce,ye+Se-Ve,ge+Ce,6,!0),this.v.setTripleAt(ye+Se,ge+Ce-Ve,ye+Se,ge+Ce-Ve,ye+Se,ge+Ce-at,7,!0)):(this.v.setTripleAt(ye-Se,ge-Ce,ye-Se+at,ge-Ce,ye-Se,ge-Ce,1,!0),this.v.setTripleAt(ye-Se,ge+Ce,ye-Se,ge+Ce-at,ye-Se,ge+Ce,2,!0),this.v.setTripleAt(ye+Se,ge+Ce,ye+Se-at,ge+Ce,ye+Se,ge+Ce,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:J},extendPrototype([DynamicPropertyContainer],Ie),Ie}(),Ee={getShapeProp:function(Ie,ye,ge){var Se;return ge===3||ge===4?Se=(ge===3?ye.pt:ye.ks).k.length?new Te(Ie,ye,ge):new _e(Ie,ye,ge):ge===5?Se=new Ae(Ie,ye):ge===6?Se=new Pe(Ie,ye):ge===7&&(Se=new ve(Ie,ye)),Se.k&&Ie.addDynamicProperty(Se),Se},getConstructorFunction:function(){return _e},getKeyframedConstructorFunction:function(){return Te}};return Ee}(),Matrix=function(){var D=Math.cos,O=Math.sin,q=Math.tan,J=Math.round;function ie(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function le(rt){if(rt===0)return this;var kt=D(rt),_i=O(rt);
vendor: 5,609 bytes, line 18
18return this._t(kt,-_i,0,0,_i,kt,0,0,0,0,1,0,0,0,0,1)}function _e(rt){if(rt===0)return this;var kt=D(rt),_i=O(rt);return this._t(1,0,0,0,0,kt,-_i,0,0,_i,kt,0,0,0,0,1)}function o(rt){if(rt===0)return this;var kt=D(rt),_i=O(rt);return this._t(kt,0,_i,0,0,1,0,0,-_i,0,kt,0,0,0,0,1)}function Te(rt){if(rt===0)return this;var kt=D(rt),_i=O(rt);return this._t(kt,-_i,0,0,_i,kt,0,0,0,0,1,0,0,0,0,1)}function Pe(rt,kt){return this._t(1,kt,rt,1,0,0)}function ve(rt,kt){return this.shear(q(rt),q(kt))}function Ae(rt,kt){var _i=D(kt),Yi=O(kt);return this._t(_i,Yi,0,0,-Yi,_i,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,q(rt),1,0,0,0,0,1,0,0,0,0,1)._t(_i,-Yi,0,0,Yi,_i,0,0,0,0,1,0,0,0,0,1)}function Ee(rt,kt,_i){return _i||_i===0||(_i=1),rt===1&&kt===1&&_i===1?this:this._t(rt,0,0,0,0,kt,0,0,0,0,_i,0,0,0,0,1)}function Ie(rt,kt,_i,Yi,Lr,Ii,en,Rr,Jr,kr,Pr,An,pt,pn,Mn,fn){return this.props[0]=rt,this.props[1]=kt,this.props[2]=_i,this.props[3]=Yi,this.props[4]=Lr,this.props[5]=Ii,this.props[6]=en,this.props[7]=Rr,this.props[8]=Jr,this.props[9]=kr,this.props[10]=Pr,this.props[11]=An,this.props[12]=pt,this.props[13]=pn,this.props[14]=Mn,this.props[15]=fn,this}function ye(rt,kt,_i){return _i=_i||0,rt!==0||kt!==0||_i!==0?this._t(1,0,0,0,0,1,0,0,0,0,1,0,rt,kt,_i,1):this}function ge(rt,kt,_i,Yi,Lr,Ii,en,Rr,Jr,kr,Pr,An,pt,pn,Mn,fn){var Ht=this.props;if(rt===1&&kt===0&&_i===0&&Yi===0&&Lr===0&&Ii===1&&en===0&&Rr===0&&Jr===0&&kr===0&&Pr===1&&An===0)return Ht[12]=Ht[12]*rt+Ht[15]*pt,Ht[13]=Ht[13]*Ii+Ht[15]*pn,Ht[14]=Ht[14]*Pr+Ht[15]*Mn,Ht[15]*=fn,this._identityCalculated=!1,this;var on=Ht[0],tn=Ht[1],Kn=Ht[2],Xi=Ht[3],Gr=Ht[4],Hr=Ht[5],Rn=Ht[6],Nn=Ht[7],Le=Ht[8],Ue=Ht[9],bt=Ht[10],It=Ht[11],Yt=Ht[12],ai=Ht[13],li=Ht[14],di=Ht[15];return Ht[0]=on*rt+tn*Lr+Kn*Jr+Xi*pt,Ht[1]=on*kt+tn*Ii+Kn*kr+Xi*pn,Ht[2]=on*_i+tn*en+Kn*Pr+Xi*Mn,Ht[3]=on*Yi+tn*Rr+Kn*An+Xi*fn,Ht[4]=Gr*rt+Hr*Lr+Rn*Jr+Nn*pt,Ht[5]=Gr*kt+Hr*Ii+Rn*kr+Nn*pn,Ht[6]=Gr*_i+Hr*en+Rn*Pr+Nn*Mn,Ht[7]=Gr*Yi+Hr*Rr+Rn*An+Nn*fn,Ht[8]=Le*rt+Ue*Lr+bt*Jr+It*pt,Ht[9]=Le*kt+Ue*Ii+bt*kr+It*pn,Ht[10]=Le*_i+Ue*en+bt*Pr+It*Mn,Ht[11]=Le*Yi+Ue*Rr+bt*An+It*fn,Ht[12]=Yt*rt+ai*Lr+li*Jr+di*pt,Ht[13]=Yt*kt+ai*Ii+li*kr+di*pn,Ht[14]=Yt*_i+ai*en+li*Pr+di*Mn,Ht[15]=Yt*Yi+ai*Rr+li*An+di*fn,this._identityCalculated=!1,this}function Se(rt){var kt=rt.props;return this.transform(kt[0],kt[1],kt[2],kt[3],kt[4],kt[5],kt[6],kt[7],kt[8],kt[9],kt[10],kt[11],kt[12],kt[13],kt[14],kt[15])}function Ce(){return this._identityCalculated||(this._identity=!(this.props[0]!==1||this.props[1]!==0||this.props[2]!==0||this.props[3]!==0||this.props[4]!==0||this.props[5]!==1||this.props[6]!==0||this.props[7]!==0||this.props[8]!==0||this.props[9]!==0||this.props[10]!==1||this.props[11]!==0||this.props[12]!==0||this.props[13]!==0||this.props[14]!==0||this.props[15]!==1),this._identityCalculated=!0),this._identity}function Ve(rt){for(var kt=0;kt<16;){if(rt.props[kt]!==this.props[kt])return!1;kt+=1}return!0}function at(rt){var kt;for(kt=0;kt<16;kt+=1)rt.props[kt]=this.props[kt];return rt}function et(rt){var kt;for(kt=0;kt<16;kt+=1)this.props[kt]=rt[kt]}function Mt(rt,kt,_i){return{x:rt*this.props[0]+kt*this.props[4]+_i*this.props[8]+this.props[12],y:rt*this.props[1]+kt*this.props[5]+_i*this.props[9]+this.props[13],z:rt*this.props[2]+kt*this.props[6]+_i*this.props[10]+this.props[14]}}function jt(rt,kt,_i){return rt*this.props[0]+kt*this.props[4]+_i*this.props[8]+this.props[12]}function St(rt,kt,_i){return rt*this.props[1]+kt*this.props[5]+_i*this.props[9]+this.props[13]}function Bt(rt,kt,_i){return rt*this.props[2]+kt*this.props[6]+_i*this.props[10]+this.props[14]}function Zt(){var rt=this.props[0]*this.props[5]-this.props[1]*this.props[4],kt=this.props[5]/rt,_i=-this.props[1]/rt,Yi=-this.props[4]/rt,Lr=this.props[0]/rt,Ii=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/rt,en=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/rt,Rr=new Matrix;return Rr.props[0]=kt,Rr.props[1]=_i,Rr.props[4]=Yi,Rr.props[5]=Lr,Rr.props[12]=Ii,Rr.props[13]=en,Rr}function xt(rt){return this.getInverseMatrix().applyToPointArray(rt[0],rt[1],rt[2]||0)}function wt(rt){var kt,_i=rt.length,Yi=[];for(kt=0;kt<_i;kt+=1)Yi[kt]=xt(rt[kt]);return Yi}function Je(rt,kt,_i){var Yi=createTypedArray("float32",6);if(this.isIdentity())Yi[0]=rt[0],Yi[1]=rt[1],Yi[2]=kt[0],Yi[3]=kt[1],Yi[4]=_i[0],Yi[5]=_i[1];else{var Lr=this.props[0],Ii=this.props[1],en=this.props[4],Rr=this.props[5],Jr=this.props[12],kr=this.props[13];Yi[0]=rt[0]*Lr+rt[1]*en+Jr,Yi[1]=rt[0]*Ii+rt[1]*Rr+kr,Yi[2]=kt[0]*Lr+kt[1]*en+Jr,Yi[3]=kt[0]*Ii+kt[1]*Rr+kr,Yi[4]=_i[0]*Lr+_i[1]*en+Jr,Yi[5]=_i[0]*Ii+_i[1]*Rr+kr}return Yi}function ut(rt,kt,_i){return this.isIdentity()?[rt,kt,_i]:[rt*this.props[0]+kt*this.props[4]+_i*this.props[8]+this.props[12],rt*this.props[1]+kt*this.props[5]+_i*this.props[9]+this.props[13],rt*this.props[2]+kt*this.props[6]+_i*this.props[10]+this.props[14]]}function lt(rt,kt){if(this.isIdentity())return rt+","+kt;var _i=this.props;return Math.round(100*(rt*_i[0]+kt*_i[4]+_i[12]))/100+","+Math.round(100*(rt*_i[1]+kt*_i[5]+_i[13]))/100}function Ye(){for(var rt=0,kt=this.props,_i="matrix3d(";rt<16;)_i+=J(1e4*kt[rt])/1e4,_i+=rt===15?")":",",rt+=1;return _i}function pi(rt){return rt<1e-6&&rt>0||rt>-1e-6&&rt<0?J(1e4*rt)/1e4:rt}function si(){var rt=this.props;return"matrix("+pi(rt[0])+","+pi(rt[1])+","+pi(rt[4])+","+pi(rt[5])+","+pi(rt[12])+","+pi(rt[13])+")"}return function(){this.reset=ie,this.rotate=le,this.rotateX=_e,this.rotateY=o,this.rotateZ=Te,this.skew=ve,this.skewFromAxis=Ae,this.shear=Pe,this.scale=Ee,this.setTransform=Ie,this.translate=ye,this.transform=ge,this.multiply=Se,this.applyToPoint=
vendor: 4,511 bytes, line 18
18Mt,this.applyToX=jt,this.applyToY=St,this.applyToZ=Bt,this.applyToPointArray=ut,this.applyToTriplePoints=Je,this.applyToPointStringified=lt,this.toCSS=Ye,this.to2dCSS=si,this.clone=at,this.cloneFromProps=et,this.equals=Ve,this.inversePoints=wt,this.inversePoint=xt,this.getInverseMatrix=Zt,this._t=this.transform,this.isIdentity=Ce,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(D){return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},_typeof$3(D)}var lottie={};function setLocation(D){setLocationHref(D)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(D){setSubframeEnabled(D)}function setPrefix(D){setIdPrefix(D)}function loadAnimation(D){return animationManager.loadAnimation(D)}function setQuality(D){if(typeof D=="string")switch(D){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(D)&&D>1&&setDefaultCurveSegments(D)}function inBrowser(){return typeof navigator<"u"}function installPlugin(D,O){D==="expressions"&&setExpressionsPlugin(O)}function getFactory(D){switch(D){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(D){for(var O=queryString.split("&"),q=0;q<O.length;q+=1){var J=O[q].split("=");if(decodeURIComponent(J[0])==D)return decodeURIComponent(J[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";var queryString="";{var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);try{_typeof$3(exports)!=="object"&&(window.bodymovin=lottie)}catch(D){}var ShapeModifiers=function(){var D={},O={};return D.registerModifier=function(q,J){O[q]||(O[q]=J)},D.getModifier=function(q,J,ie){return new O[q](J,ie)},D}();function ShapeModifier(){}function TrimModifier(){}function PuckerAndBloatModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(D){if(!this.closed){D.sh.container.addDynamicProperty(D.sh);var O={shape:D.sh,data:D,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(O),this.addShapeToModifier(O),this._isAnimated&&D.setAsAnimated()}},ShapeModifier.prototype.init=function(D,O){this.shapes=[],this.elem=D,this.initDynamicPropertyContainer(D),this.initModifierProperties(D,O),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(D,O){this.s=PropertyFactory.getProp(D,O.s,0,.01,this),this.e=Pro
vendor: 5,938 bytes, line 18
18pertyFactory.getProp(D,O.e,0,.01,this),this.o=PropertyFactory.getProp(D,O.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=O.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(D){D.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(D,O,q,J,ie){var le=[];O<=1?le.push({s:D,e:O}):D>=1?le.push({s:D-1,e:O-1}):(le.push({s:D,e:1}),le.push({s:0,e:O-1}));var _e,o,Te=[],Pe=le.length;for(_e=0;_e<Pe;_e+=1){var ve,Ae;(o=le[_e]).e*ie<J||o.s*ie>J+q||(ve=o.s*ie<=J?0:(o.s*ie-J)/q,Ae=o.e*ie>=J+q?1:(o.e*ie-J)/q,Te.push([ve,Ae]))}return Te.length||Te.push([0,0]),Te},TrimModifier.prototype.releasePathsData=function(D){var O,q=D.length;for(O=0;O<q;O+=1)segmentsLengthPool.release(D[O]);return D.length=0,D},TrimModifier.prototype.processShapes=function(D){var O,q,J,ie;if(this._mdf||D){var le=this.o.v%360/360;if(le<0&&(le+=1),(O=this.s.v>1?1+le:this.s.v<0?0+le:this.s.v+le)>(q=this.e.v>1?1+le:this.e.v<0?0+le:this.e.v+le)){var _e=O;O=q,q=_e}O=1e-4*Math.round(1e4*O),q=1e-4*Math.round(1e4*q),this.sValue=O,this.eValue=q}else O=this.sValue,q=this.eValue;var o,Te,Pe,ve,Ae,Ee=this.shapes.length,Ie=0;if(q===O)for(ie=0;ie<Ee;ie+=1)this.shapes[ie].localShapeCollection.releaseShapes(),this.shapes[ie].shape._mdf=!0,this.shapes[ie].shape.paths=this.shapes[ie].localShapeCollection,this._mdf&&(this.shapes[ie].pathsData.length=0);else if(q===1&&O===0||q===0&&O===1){if(this._mdf)for(ie=0;ie<Ee;ie+=1)this.shapes[ie].pathsData.length=0,this.shapes[ie].shape._mdf=!0}else{var ye,ge,Se=[];for(ie=0;ie<Ee;ie+=1)if((ye=this.shapes[ie]).shape._mdf||this._mdf||D||this.m===2){if(Te=(J=ye.shape.paths)._length,Ae=0,!ye.shape._mdf&&ye.pathsData.length)Ae=ye.totalShapeLength;else{for(Pe=this.releasePathsData(ye.pathsData),o=0;o<Te;o+=1)ve=bez.getSegmentsLength(J.shapes[o]),Pe.push(ve),Ae+=ve.totalLength;ye.totalShapeLength=Ae,ye.pathsData=Pe}Ie+=Ae,ye.shape._mdf=!0}else ye.shape.paths=ye.localShapeCollection;var Ce,Ve=O,at=q,et=0;for(ie=Ee-1;ie>=0;ie-=1)if((ye=this.shapes[ie]).shape._mdf){for((ge=ye.localShapeCollection).releaseShapes(),this.m===2&&Ee>1?(Ce=this.calculateShapeEdges(O,q,ye.totalShapeLength,et,Ie),et+=ye.totalShapeLength):Ce=[[Ve,at]],Te=Ce.length,o=0;o<Te;o+=1){Ve=Ce[o][0],at=Ce[o][1],Se.length=0,at<=1?Se.push({s:ye.totalShapeLength*Ve,e:ye.totalShapeLength*at}):Ve>=1?Se.push({s:ye.totalShapeLength*(Ve-1),e:ye.totalShapeLength*(at-1)}):(Se.push({s:ye.totalShapeLength*Ve,e:ye.totalShapeLength}),Se.push({s:0,e:ye.totalShapeLength*(at-1)}));var Mt=this.addShapes(ye,Se[0]);if(Se[0].s!==Se[0].e){if(Se.length>1)if(ye.shape.paths.shapes[ye.shape.paths._length-1].c){var jt=Mt.pop();this.addPaths(Mt,ge),Mt=this.addShapes(ye,Se[1],jt)}else this.addPaths(Mt,ge),Mt=this.addShapes(ye,Se[1]);this.addPaths(Mt,ge)}}ye.shape.paths=ge}}},TrimModifier.prototype.addPaths=function(D,O){var q,J=D.length;for(q=0;q<J;q+=1)O.addShape(D[q])},TrimModifier.prototype.addSegment=function(D,O,q,J,ie,le,_e){ie.setXYAt(O[0],O[1],"o",le),ie.setXYAt(q[0],q[1],"i",le+1),_e&&ie.setXYAt(D[0],D[1],"v",le),ie.setXYAt(J[0],J[1],"v",le+1)},TrimModifier.prototype.addSegmentFromArray=function(D,O,q,J){O.setXYAt(D[1],D[5],"o",q),O.setXYAt(D[2],D[6],"i",q+1),J&&O.setXYAt(D[0],D[4],"v",q),O.setXYAt(D[3],D[7],"v",q+1)},TrimModifier.prototype.addShapes=function(D,O,q){var J,ie,le,_e,o,Te,Pe,ve,Ae=D.pathsData,Ee=D.shape.paths.shapes,Ie=D.shape.paths._length,ye=0,ge=[],Se=!0;for(q?(o=q._length,ve=q._length):(q=shapePool.newElement(),o=0,ve=0),ge.push(q),J=0;J<Ie;J+=1){for(Te=Ae[J].lengths,q.c=Ee[J].c,le=Ee[J].c?Te.length:Te.length+1,ie=1;ie<le;ie+=1)if(ye+(_e=Te[ie-1]).addedLength<O.s)ye+=_e.addedLength,q.c=!1;else{if(ye>O.e){q.c=!1;break}O.s<=ye&&O.e>=ye+_e.addedLength?(this.addSegment(Ee[J].v[ie-1],Ee[J].o[ie-1],Ee[J].i[ie],Ee[J].v[ie],q,o,Se),Se=!1):(Pe=bez.getNewSegment(Ee[J].v[ie-1],Ee[J].v[ie],Ee[J].o[ie-1],Ee[J].i[ie],(O.s-ye)/_e.addedLength,(O.e-ye)/_e.addedLength,Te[ie-1]),this.addSegmentFromArray(Pe,q,o,Se),Se=!1,q.c=!1),ye+=_e.addedLength,o+=1}if(Ee[J].c&&Te.length){if(_e=Te[ie-1],ye<=O.e){var Ce=Te[ie-1].addedLength;O.s<=ye&&O.e>=ye+Ce?(this.addSegment(Ee[J].v[ie-1],Ee[J].o[ie-1],Ee[J].i[0],Ee[J].v[0],q,o,Se),Se=!1):(Pe=bez.getNewSegment(Ee[J].v[ie-1],Ee[J].v[0],Ee[J].o[ie-1],Ee[J].i[0],(O.s-ye)/Ce,(O.e-ye)/Ce,Te[ie-1]),this.addSegmentFromArray(Pe,q,o,Se),Se=!1,q.c=!1)}else q.c=!1;ye+=_e.addedLength,o+=1}if(q._length&&(q.setXYAt(q.v[ve][0],q.v[ve][1],"i",ve),q.setXYAt(q.v[q._length-1][0],q.v[q._length-1][1],"o",q._length-1)),ye>O.e)break;J<Ie-1&&(q=shapePool.newElement(),Se=!0,ge.push(q),o=0)}return ge},extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(D,O){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(D,O.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(D,O){var q=O/100,J=[0,0],ie=D._length,le=0;for(le=0;le<ie;le+=1)J[0]+=D.v[le][0],J[1]+=D.v[le][1];J[0]/=ie,J[1]/=ie;var _e,o,Te,Pe,ve,Ae,Ee=shapePool.newElement();for(Ee.c=D.c,le=0;le<ie;le+=1)_e=D.v[le][0]+(J[0]-D.v[le][0])*q,o=D.v[le][1]+(J[1]-D.v[le][1])*q,Te=D.o[le][0]+(J[0]-D.o[le][0])*-q,Pe=D.o[le][1]+(J[1]-D.o[le][1])*-q,ve=D.i[le][0]+(J[0]-D.i[le][0])*-q,Ae=D.i[le][1]+(J[1]-D.i[le][1])*-q,Ee.setTripleAt(_e,o,Te,Pe,ve,Ae,le);return Ee},PuckerAndBloatModifier.prototype.processShapes=function(D){var O,q,J,ie,le,_e,o=this.shapes.length,Te=this.amount.v;if(Te!==0)for(q=0;q<o;q+=1){if(_e=(le=this.shapes[q]).localShapeCollection,le.shape._mdf||this._mdf||D)for(_e.releaseShapes(),le.shape._mdf=!0,O=le.shape.paths.shapes,ie=le.shape.paths._length,J=0;J<ie;J+=1)_e.addShape(this.processPath(O[J],Te));le.shape.paths=le.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=function(){var D=[0,0];
vendor: 7,569 bytes, line 18
18function O(q,J,ie){if(this.elem=q,this.frameId=-1,this.propType="transform",this.data=J,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(ie||q),J.p&&J.p.s?(this.px=PropertyFactory.getProp(q,J.p.x,0,0,this),this.py=PropertyFactory.getProp(q,J.p.y,0,0,this),J.p.z&&(this.pz=PropertyFactory.getProp(q,J.p.z,0,0,this))):this.p=PropertyFactory.getProp(q,J.p||{k:[0,0,0]},1,0,this),J.rx){if(this.rx=PropertyFactory.getProp(q,J.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(q,J.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(q,J.rz,0,degToRads,this),J.or.k[0].ti){var le,_e=J.or.k.length;for(le=0;le<_e;le+=1)J.or.k[le].to=null,J.or.k[le].ti=null}this.or=PropertyFactory.getProp(q,J.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(q,J.r||{k:0},0,degToRads,this);J.sk&&(this.sk=PropertyFactory.getProp(q,J.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(q,J.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(q,J.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(q,J.s||{k:[100,100,100]},1,.01,this),J.o?this.o=PropertyFactory.getProp(q,J.o,0,.01,q):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return O.prototype={applyToMatrix:function(q){var J=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||J,this.a&&q.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&q.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&q.skewFromAxis(-this.sk.v,this.sa.v),this.r?q.rotate(-this.r.v):q.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?q.translate(this.px.v,this.py.v,-this.pz.v):q.translate(this.px.v,this.py.v,0):q.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(q){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||q){var J;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var ie,le;if(J=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(ie=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/J,0),le=this.p.getValueAtTime(this.p.keyframes[0].t/J,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(ie=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/J,0),le=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/J,0)):(ie=this.p.pv,le=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/J,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){ie=[],le=[];var _e=this.px,o=this.py;_e._caching.lastFrame+_e.offsetTime<=_e.keyframes[0].t?(ie[0]=_e.getValueAtTime((_e.keyframes[0].t+.01)/J,0),ie[1]=o.getValueAtTime((o.keyframes[0].t+.01)/J,0),le[0]=_e.getValueAtTime(_e.keyframes[0].t/J,0),le[1]=o.getValueAtTime(o.keyframes[0].t/J,0)):_e._caching.lastFrame+_e.offsetTime>=_e.keyframes[_e.keyframes.length-1].t?(ie[0]=_e.getValueAtTime(_e.keyframes[_e.keyframes.length-1].t/J,0),ie[1]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/J,0),le[0]=_e.getValueAtTime((_e.keyframes[_e.keyframes.length-1].t-.01)/J,0),le[1]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/J,0)):(ie=[_e.pv,o.pv],le[0]=_e.getValueAtTime((_e._caching.lastFrame+_e.offsetTime-.01)/J,_e.offsetTime),le[1]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/J,o.offsetTime))}else ie=le=D;this.v.rotate(-Math.atan2(ie[1]-le[1],ie[0]-le[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],O),O.prototype.addDynamicProperty=function(q){this._addDynamicProperty(q),this.elem.addDynamicProperty(q),this._isDirty=!0},O.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(q,J,ie){return new O(q,J,ie)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(D,O){return 1e5*Math.abs(D-O)<=Math.min(Math.abs(D),Math.abs(O))}function floatZero(D){return Math.abs(D)<=1e-5}function lerp(D,O,q){return D*(1-q)+O*q}function lerpPoint(D,O,q){return[lerp(D[0],O[0],q),lerp(D[1],O[1],q)]}function quadRoots(D,O,q){if(D===0)return[];var J=O*O-4*D*q;if(J<0)return[];var ie=-O/(2*D);if(J===0)return[ie];var le=Math.sqrt(J)/(2*D);return[ie-le,ie+le]}function polynomialCoefficients(D,O,q,J){return[3*O-D-3*q+J,3*D-6*O+3*q,-3*D+3*O,D]}function singlePoint(D){return new PolynomialBezier(D,D,D,D,!1)}function PolynomialBezier(D,O,q,J,ie){ie&&pointEqual(D,O)&&(O=lerpPoint(D,J,1/3)),ie&&pointEqual(q,J)&&(q=lerpPoint(D,J,2/3));var le=polynomialCoefficients(D[0],O[0],q[0],J[0]),_e=polynomialCoefficients(D[1],O[1],q[1],J[1]);this.a=[le[0],_e[0]],this.b=[le[1],_e[1]],this.c=[le[2],_e[2]],this.d=[le[3],_e[3]],this.points=[D,O,q,J]}function extrema(D,O){var q=D.points[0][O],J=D.points[D.points.length-1][O];if(q>J){var ie=J;J=q,q=ie}for(var le=quadRoots(3*D.a[O],2*D.b[O],D.c[O]),_e=0;_e<le.length;_e+=1)if(le[_e]>0&&le[_e]<1){var o=D.point(le[_e])[O];o<q?q=o:o>J&&(J=o)}return{min:q,max:J}}function intersectData(D,O,q){var J=D.boundingBox();return{cx:J.cx,cy:J.cy,width:J.width,height:J.height,bez:D,t:(O+q)/2,t1:O,t2:q}}function splitData(D){var O=D.bez.split(.5);return[intersectData(O[0],D.t1,D.t),intersectData(O[1],D.t,D.t2)]}function boxIntersect(D,O){return 2*Math.abs(D.cx-O.cx)<D.width+O.width&&2*Math.abs(D.cy-O.cy)<D.height+O.height}function intersectsImpl(D,O,q,J,ie,le){if(boxIntersect(D,O))if(q>=le||D.width<=J&&D.height<=J&&O.width<=J&&O.height<=J)ie.push([D.t,O.t]);else{var _e=splitData(D),o=splitData(O);intersectsImpl(_e[0],o[0],q+1,J,ie,le),intersectsImpl(_e[0],o[1],q+1,J,ie,le),intersectsImpl(_e[1],o[0],q+1,J,ie,le),intersectsImpl(_e[1],o[1],q+1,J,ie,le)}}function crossProduct(D,O){return[D[1]*O[2]-D[2]*O[1],D[2]*O[0]-D[0]
vendor: 6,552 bytes, line 18
18*O[2],D[0]*O[1]-D[1]*O[0]]}function lineIntersection(D,O,q,J){var ie=[D[0],D[1],1],le=[O[0],O[1],1],_e=[q[0],q[1],1],o=[J[0],J[1],1],Te=crossProduct(crossProduct(ie,le),crossProduct(_e,o));return floatZero(Te[2])?null:[Te[0]/Te[2],Te[1]/Te[2]]}function polarOffset(D,O,q){return[D[0]+Math.cos(O)*q,D[1]-Math.sin(O)*q]}function pointDistance(D,O){return Math.hypot(D[0]-O[0],D[1]-O[1])}function pointEqual(D,O){return floatEqual(D[0],O[0])&&floatEqual(D[1],O[1])}function ZigZagModifier(){}function setPoint(D,O,q,J,ie,le,_e){var o=q-Math.PI/2,Te=q+Math.PI/2,Pe=O[0]+Math.cos(q)*J*ie,ve=O[1]-Math.sin(q)*J*ie;D.setTripleAt(Pe,ve,Pe+Math.cos(o)*le,ve-Math.sin(o)*le,Pe+Math.cos(Te)*_e,ve-Math.sin(Te)*_e,D.length())}function getPerpendicularVector(D,O){var q=[O[0]-D[0],O[1]-D[1]],J=.5*-Math.PI;return[Math.cos(J)*q[0]-Math.sin(J)*q[1],Math.sin(J)*q[0]+Math.cos(J)*q[1]]}function getProjectingAngle(D,O){var q=O===0?D.length()-1:O-1,J=(O+1)%D.length(),ie=getPerpendicularVector(D.v[q],D.v[J]);return Math.atan2(0,1)-Math.atan2(ie[1],ie[0])}function zigZagCorner(D,O,q,J,ie,le,_e){var o=getProjectingAngle(O,q),Te=O.v[q%O._length],Pe=O.v[q===0?O._length-1:q-1],ve=O.v[(q+1)%O._length],Ae=le===2?Math.sqrt(Math.pow(Te[0]-Pe[0],2)+Math.pow(Te[1]-Pe[1],2)):0,Ee=le===2?Math.sqrt(Math.pow(Te[0]-ve[0],2)+Math.pow(Te[1]-ve[1],2)):0;setPoint(D,O.v[q%O._length],o,_e,J,Ee/(2*(ie+1)),Ae/(2*(ie+1)))}function zigZagSegment(D,O,q,J,ie,le){for(var _e=0;_e<J;_e+=1){var o=(_e+1)/(J+1),Te=ie===2?Math.sqrt(Math.pow(O.points[3][0]-O.points[0][0],2)+Math.pow(O.points[3][1]-O.points[0][1],2)):0,Pe=O.normalAngle(o);setPoint(D,O.point(o),Pe,le,q,Te/(2*(J+1)),Te/(2*(J+1))),le=-le}return le}function linearOffset(D,O,q){var J=Math.atan2(O[0]-D[0],O[1]-D[1]);return[polarOffset(D,J,q),polarOffset(O,J,q)]}function offsetSegment(D,O){var q,J,ie,le,_e,o,Te;q=(Te=linearOffset(D.points[0],D.points[1],O))[0],J=Te[1],ie=(Te=linearOffset(D.points[1],D.points[2],O))[0],le=Te[1],_e=(Te=linearOffset(D.points[2],D.points[3],O))[0],o=Te[1];var Pe=lineIntersection(q,J,ie,le);Pe===null&&(Pe=J);var ve=lineIntersection(_e,o,ie,le);return ve===null&&(ve=_e),new PolynomialBezier(q,Pe,ve,o)}function joinLines(D,O,q,J,ie){var le=O.points[3],_e=q.points[0];if(J===3||pointEqual(le,_e))return le;if(J===2){var o=-O.tangentAngle(1),Te=-q.tangentAngle(0)+Math.PI,Pe=lineIntersection(le,polarOffset(le,o+Math.PI/2,100),_e,polarOffset(_e,o+Math.PI/2,100)),ve=Pe?pointDistance(Pe,le):pointDistance(le,_e)/2,Ae=polarOffset(le,o,2*ve*roundCorner);return D.setXYAt(Ae[0],Ae[1],"o",D.length()-1),Ae=polarOffset(_e,Te,2*ve*roundCorner),D.setTripleAt(_e[0],_e[1],_e[0],_e[1],Ae[0],Ae[1],D.length()),_e}var Ee=lineIntersection(pointEqual(le,O.points[2])?O.points[0]:O.points[2],le,_e,pointEqual(_e,q.points[1])?q.points[3]:q.points[1]);return Ee&&pointDistance(Ee,le)<ie?(D.setTripleAt(Ee[0],Ee[1],Ee[0],Ee[1],Ee[0],Ee[1],D.length()),Ee):le}function getIntersection(D,O){var q=D.intersections(O);return q.length&&floatEqual(q[0][0],1)&&q.shift(),q.length?q[0]:null}function pruneSegmentIntersection(D,O){var q=D.slice(),J=O.slice(),ie=getIntersection(D[D.length-1],O[0]);return ie&&(q[D.length-1]=D[D.length-1].split(ie[0])[0],J[0]=O[0].split(ie[1])[1]),D.length>1&&O.length>1&&(ie=getIntersection(D[0],O[O.length-1]))?[[D[0].split(ie[0])[0]],[O[O.length-1].split(ie[1])[1]]]:[q,J]}function pruneIntersections(D){for(var O,q=1;q<D.length;q+=1)O=pruneSegmentIntersection(D[q-1],D[q]),D[q-1]=O[0],D[q]=O[1];return D.length>1&&(O=pruneSegmentIntersection(D[D.length-1],D[0]),D[D.length-1]=O[0],D[0]=O[1]),D}function offsetSegmentSplit(D,O){var q,J,ie,le,_e=D.inflectionPoints();if(_e.length===0)return[offsetSegment(D,O)];if(_e.length===1||floatEqual(_e[1],1))return q=(ie=D.split(_e[0]))[0],J=ie[1],[offsetSegment(q,O),offsetSegment(J,O)];q=(ie=D.split(_e[0]))[0];var o=(_e[1]-_e[0])/(1-_e[0]);return le=(ie=ie[1].split(o))[0],J=ie[1],[offsetSegment(q,O),offsetSegment(le,O),offsetSegment(J,O)]}function OffsetPathModifier(){}function getFontProperties(D){for(var O=D.fStyle?D.fStyle.split(" "):[],q="normal",J="normal",ie=O.length,le=0;le<ie;le+=1)switch(O[le].toLowerCase()){case"italic":J="italic";break;case"bold":q="700";break;case"black":q="900";break;case"medium":q="500";break;case"regular":case"normal":q="400";break;case"light":case"thin":q="200"}return{style:J,weight:D.fWeight||q}}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(D,O){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(D,O.c,0,null,this),this.o=PropertyFactory.getProp(D,O.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(D,O.tr,this),this.so=PropertyFactory.getProp(D,O.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(D,O.tr.eo,0,.01,this),this.data=O,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(D,O,q,J,ie,le){var _e=le?-1:1,o=J.s.v[0]+(1-J.s.v[0])*(1-ie),Te=J.s.v[1]+(1-J.s.v[1])*(1-ie);D.translate(J.p.v[0]*_e*ie,J.p.v[1]*_e*ie,J.p.v[2]),O.translate(-J.a.v[0],-J.a.v[1],J.a.v[2]),O.rotate(-J.r.v*_e*ie),O.translate(J.a.v[0],J.a.v[1],J.a.v[2]),q.translate(-J.a.v[0],-J.a.v[1],J.a.v[2]),q.scale(le?1/o:o,le?1/Te:Te),q.translate(J.a.v[0],J.a.v[1],J.a.v[2])},RepeaterModifier.prototype.init=function(D,O,q,J){for(this.elem=D,this.arr=O,this.pos=q,this.elemsData=J,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(D),this.initModifierProperties(D,O[q]);q>0;)q-=1,this._elements.unshift(O[q]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(D){var O,q=D.length;for(O=0;O<q;O+=1)D[O]._processed=!1,D[O].ty==="gr"&&this.resetElements(D[O].it)},RepeaterModifier.prototype.cloneElements=function(D){var O=JSON.parse(JSON.stringify(D));return this.resetElements(O),O},RepeaterModifier.prototype.changeGroupRender=function(D,O){var q,J=D.length;for(q=0;q<J;q+=1)D[q]._render=O,D[q].ty==="gr"&&this.changeGroupRender(D[q].it,O)},RepeaterModifier.prototype.processShapes=function(D){var O,q,J,ie,le,_e=!1;if(this._mdf||D){var o,Te=Math.ceil(this.c.v);if(this._groups.length<Te){for(;this._groups.length<Te;){var Pe={it:this.cloneElements(this._elements),ty:"gr"};Pe.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]}
vendor: 7,944 bytes, line 18
18,s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,Pe),this._groups.splice(0,0,Pe),this._currentCopies+=1}this.elem.reloadShapes(),_e=!0}for(le=0,J=0;J<=this._groups.length-1;J+=1){if(o=le<Te,this._groups[J]._render=o,this.changeGroupRender(this._groups[J].it,o),!o){var ve=this.elemsData[J].it,Ae=ve[ve.length-1];Ae.transform.op.v!==0?(Ae.transform.op._mdf=!0,Ae.transform.op.v=0):Ae.transform.op._mdf=!1}le+=1}this._currentCopies=Te;var Ee=this.o.v,Ie=Ee%1,ye=Ee>0?Math.floor(Ee):Math.ceil(Ee),ge=this.pMatrix.props,Se=this.rMatrix.props,Ce=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var Ve,at,et=0;if(Ee>0){for(;et<ye;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),et+=1;Ie&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,Ie,!1),et+=Ie)}else if(Ee<0){for(;et>ye;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),et-=1;Ie&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-Ie,!0),et-=Ie)}for(J=this.data.m===1?0:this._currentCopies-1,ie=this.data.m===1?1:-1,le=this._currentCopies;le;){if(at=(q=(O=this.elemsData[J].it)[O.length-1].transform.mProps.v.props).length,O[O.length-1].transform.mProps._mdf=!0,O[O.length-1].transform.op._mdf=!0,O[O.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(J/(this._currentCopies-1)),et!==0){for((J!==0&&ie===1||J!==this._currentCopies-1&&ie===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(Se[0],Se[1],Se[2],Se[3],Se[4],Se[5],Se[6],Se[7],Se[8],Se[9],Se[10],Se[11],Se[12],Se[13],Se[14],Se[15]),this.matrix.transform(Ce[0],Ce[1],Ce[2],Ce[3],Ce[4],Ce[5],Ce[6],Ce[7],Ce[8],Ce[9],Ce[10],Ce[11],Ce[12],Ce[13],Ce[14],Ce[15]),this.matrix.transform(ge[0],ge[1],ge[2],ge[3],ge[4],ge[5],ge[6],ge[7],ge[8],ge[9],ge[10],ge[11],ge[12],ge[13],ge[14],ge[15]),Ve=0;Ve<at;Ve+=1)q[Ve]=this.matrix.props[Ve];this.matrix.reset()}else for(this.matrix.reset(),Ve=0;Ve<at;Ve+=1)q[Ve]=this.matrix.props[Ve];et+=1,le-=1,J+=ie}}else for(le=this._currentCopies,J=0,ie=1;le;)q=(O=this.elemsData[J].it)[O.length-1].transform.mProps.v.props,O[O.length-1].transform.mProps._mdf=!1,O[O.length-1].transform.op._mdf=!1,le-=1,J+=ie;return _e},RepeaterModifier.prototype.addShape=function(){},extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(D,O){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(D,O.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(D,O){var q,J=shapePool.newElement();J.c=D.c;var ie,le,_e,o,Te,Pe,ve,Ae,Ee,Ie,ye,ge,Se=D._length,Ce=0;for(q=0;q<Se;q+=1)ie=D.v[q],_e=D.o[q],le=D.i[q],ie[0]===_e[0]&&ie[1]===_e[1]&&ie[0]===le[0]&&ie[1]===le[1]?q!==0&&q!==Se-1||D.c?(o=q===0?D.v[Se-1]:D.v[q-1],Pe=(Te=Math.sqrt(Math.pow(ie[0]-o[0],2)+Math.pow(ie[1]-o[1],2)))?Math.min(Te/2,O)/Te:0,ve=ye=ie[0]+(o[0]-ie[0])*Pe,Ae=ge=ie[1]-(ie[1]-o[1])*Pe,Ee=ve-(ve-ie[0])*roundCorner,Ie=Ae-(Ae-ie[1])*roundCorner,J.setTripleAt(ve,Ae,Ee,Ie,ye,ge,Ce),Ce+=1,o=q===Se-1?D.v[0]:D.v[q+1],Pe=(Te=Math.sqrt(Math.pow(ie[0]-o[0],2)+Math.pow(ie[1]-o[1],2)))?Math.min(Te/2,O)/Te:0,ve=Ee=ie[0]+(o[0]-ie[0])*Pe,Ae=Ie=ie[1]+(o[1]-ie[1])*Pe,ye=ve-(ve-ie[0])*roundCorner,ge=Ae-(Ae-ie[1])*roundCorner,J.setTripleAt(ve,Ae,Ee,Ie,ye,ge,Ce),Ce+=1):(J.setTripleAt(ie[0],ie[1],_e[0],_e[1],le[0],le[1],Ce),Ce+=1):(J.setTripleAt(D.v[q][0],D.v[q][1],D.o[q][0],D.o[q][1],D.i[q][0],D.i[q][1],Ce),Ce+=1);return J},RoundCornersModifier.prototype.processShapes=function(D){var O,q,J,ie,le,_e,o=this.shapes.length,Te=this.rd.v;if(Te!==0)for(q=0;q<o;q+=1){if(_e=(le=this.shapes[q]).localShapeCollection,le.shape._mdf||this._mdf||D)for(_e.releaseShapes(),le.shape._mdf=!0,O=le.shape.paths.shapes,ie=le.shape.paths._length,J=0;J<ie;J+=1)_e.addShape(this.processPath(O[J],Te));le.shape.paths=le.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},PolynomialBezier.prototype.point=function(D){return[((this.a[0]*D+this.b[0])*D+this.c[0])*D+this.d[0],((this.a[1]*D+this.b[1])*D+this.c[1])*D+this.d[1]]},PolynomialBezier.prototype.derivative=function(D){return[(3*D*this.a[0]+2*this.b[0])*D+this.c[0],(3*D*this.a[1]+2*this.b[1])*D+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(D){var O=this.derivative(D);return Math.atan2(O[1],O[0])},PolynomialBezier.prototype.normalAngle=function(D){var O=this.derivative(D);return Math.atan2(O[0],O[1])},PolynomialBezier.prototype.inflectionPoints=function(){var D=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(D))return[];var O=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/D,q=O*O-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/D;if(q<0)return[];var J=Math.sqrt(q);return floatZero(J)?J>0&&J<1?[O]:[]:[O-J,O+J].filter(function(ie){return ie>0&&ie<1})},PolynomialBezier.prototype.split=function(D){if(D<=0)return[singlePoint(this.points[0]),this];if(D>=1)return[this,singlePoint(this.points[this.points.length-1])];var O=lerpPoint(this.points[0],this.points[1],D),q=lerpPoint(this.points[1],this.points[2],D),J=lerpPoint(this.points[2],this.points[3],D),ie=lerpPoint(O,q,D),le=lerpPoint(q,J,D),_e=lerpPoint(ie,le,D);return[new PolynomialBezier(this.points[0],O,ie,_e,!0),new PolynomialBezier(_e,le,J,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var D=this.bounds();return{left:D.x.min,right:D.x.max,top:D.y.min,bottom:D.y.max,width:D.x.max-D.x.min,height:D.y.max-D.y.min,cx:(D.x.max+D.x.min)/2,cy:(D.y.max+D.y.min)/2}},PolynomialBezier.prototype.intersections=function(D,O,q){O===void 0&&(O=2),q===void 0&&(q=7);var J=[];return intersectsImpl(intersectData(this,0,1),intersectData(D,0,1),0,O,J,q),J},PolynomialBezier.shapeSegment=function(D,O){var q=(O+1)%D.length();return new PolynomialBezier(D.v[O],D.o[O],D.i[q],D.v[q],!0)},PolynomialBezier.shapeSegmentInverted=function(D,O){var q=(O+1)%D.length();return new PolynomialBezier(D.v[q],D.i[q],D.o[O],D.v[O],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(D,O){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(D,O.s,0,null,this),this.frequency=PropertyFactory.getProp(D,O.r,0,null,this),this.pointsType=PropertyFactory.getProp(D,O.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0},ZigZagModifier.prototype.processPath=function(D,O,q,J){var ie=D._length,le=shapePool.newElement();if(le.c=D.c,D.c||(ie-=1),ie===0)return le;var _e=-1,o=PolynomialBezier.shapeSegment(D,0);zigZagCorner(le,D,0,O,q,J,_e);for(var Te=0;Te<ie;Te+=1)_e=zigZagSegment(le,o,O,q,J,-_e),o=Te!==ie-1||D.c?PolynomialBezier.shapeSegment(D,(Te+1)%ie):null,zigZagCorner(le,D,Te+1,O,q,J,_e);return le},ZigZagModifier.prototype.processShapes=function(D){var O,q,J,ie,le,_e,o=this.shapes.length,Te=this.amplitude.v,Pe=Math.max(0,Math.round(this.frequency.v)),ve=this.pointsType.v;if(Te!==0)for(q=0;q<o;q+=1){if(_e=(le=this.shapes[q]).localShapeCollection,le.shape._mdf||this._mdf||D)for(_e.releaseShapes(),le.shape._mdf=!0,O=le.shape.paths.shapes,ie=le.shape.paths._length,J=0;J<ie;J+=1)_e.addShape(this.processPath(O[J],Te,Pe,ve));le.shape.paths=le.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(D,O){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(D,O.a,0,null,this),this.miterLimit=PropertyFactory.getProp(D,O.ml,0,null,this),this.lineJoin=O.lj,this._isAnimated=this.amount.effectsSequence.length!==0},OffsetPathModifier.prototype.processPath=function(D,O,q,J){var ie=sh
vendor: 8,021 bytes, line 18
18apePool.newElement();ie.c=D.c;var le,_e,o,Te=D.length();D.c||(Te-=1);var Pe=[];for(le=0;le<Te;le+=1)o=PolynomialBezier.shapeSegment(D,le),Pe.push(offsetSegmentSplit(o,O));if(!D.c)for(le=Te-1;le>=0;le-=1)o=PolynomialBezier.shapeSegmentInverted(D,le),Pe.push(offsetSegmentSplit(o,O));Pe=pruneIntersections(Pe);var ve=null,Ae=null;for(le=0;le<Pe.length;le+=1){var Ee=Pe[le];for(Ae&&(ve=joinLines(ie,Ae,Ee[0],q,J)),Ae=Ee[Ee.length-1],_e=0;_e<Ee.length;_e+=1)o=Ee[_e],ve&&pointEqual(o.points[0],ve)?ie.setXYAt(o.points[1][0],o.points[1][1],"o",ie.length()-1):ie.setTripleAt(o.points[0][0],o.points[0][1],o.points[1][0],o.points[1][1],o.points[0][0],o.points[0][1],ie.length()),ie.setTripleAt(o.points[3][0],o.points[3][1],o.points[3][0],o.points[3][1],o.points[2][0],o.points[2][1],ie.length()),ve=o.points[3]}return Pe.length&&joinLines(ie,Ae,Pe[0][0],q,J),ie},OffsetPathModifier.prototype.processShapes=function(D){var O,q,J,ie,le,_e,o=this.shapes.length,Te=this.amount.v,Pe=this.miterLimit.v,ve=this.lineJoin;if(Te!==0)for(q=0;q<o;q+=1){if(_e=(le=this.shapes[q]).localShapeCollection,le.shape._mdf||this._mdf||D)for(_e.releaseShapes(),le.shape._mdf=!0,O=le.shape.paths.shapes,ie=le.shape.paths._length,J=0;J<ie;J+=1)_e.addShape(this.processPath(O[J],Te,ve,Pe));le.shape.paths=le.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var FontManager=function(){var D={w:0,size:0,shapes:[],data:{shapes:[]}},O=[];O=O.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var q=127988,J=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function ie(ve,Ae){var Ee=createTag("span");Ee.setAttribute("aria-hidden",!0),Ee.style.fontFamily=Ae;var Ie=createTag("span");Ie.innerText="giItT1WQy@!-/#",Ee.style.position="absolute",Ee.style.left="-10000px",Ee.style.top="-10000px",Ee.style.fontSize="300px",Ee.style.fontVariant="normal",Ee.style.fontStyle="normal",Ee.style.fontWeight="normal",Ee.style.letterSpacing="0",Ee.appendChild(Ie),document.body.appendChild(Ee);var ye=Ie.offsetWidth;return Ie.style.fontFamily=function(ge){var Se,Ce=ge.split(","),Ve=Ce.length,at=[];for(Se=0;Se<Ve;Se+=1)Ce[Se]!=="sans-serif"&&Ce[Se]!=="monospace"&&at.push(Ce[Se]);return at.join(",")}(ve)+", "+Ae,{node:Ie,w:ye,parent:Ee}}function le(ve,Ae){var Ee,Ie=document.body&&Ae?"svg":"canvas",ye=getFontProperties(ve);if(Ie==="svg"){var ge=createNS("text");ge.style.fontSize="100px",ge.setAttribute("font-family",ve.fFamily),ge.setAttribute("font-style",ye.style),ge.setAttribute("font-weight",ye.weight),ge.textContent="1",ve.fClass?(ge.style.fontFamily="inherit",ge.setAttribute("class",ve.fClass)):ge.style.fontFamily=ve.fFamily,Ae.appendChild(ge),Ee=ge}else{var Se=new OffscreenCanvas(500,500).getContext("2d");Se.font=ye.style+" "+ye.weight+" 100px "+ve.fFamily,Ee=Se}return{measureText:function(Ce){return Ie==="svg"?(Ee.textContent=Ce,Ee.getComputedTextLength()):Ee.measureText(Ce).width}}}function _e(ve){var Ae=0,Ee=ve.charCodeAt(0);if(Ee>=55296&&Ee<=56319){var Ie=ve.charCodeAt(1);Ie>=56320&&Ie<=57343&&(Ae=1024*(Ee-55296)+Ie-56320+65536)}return Ae}function o(ve){var Ae=_e(ve);return Ae>=127462&&Ae<=127487}var Te=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};Te.isModifier=function(ve,Ae){var Ee=ve.toString(16)+Ae.toString(16);return J.indexOf(Ee)!==-1},Te.isZeroWidthJoiner=function(ve){return ve===8205},Te.isFlagEmoji=function(ve){return o(ve.substr(0,2))&&o(ve.substr(2,2))},Te.isRegionalCode=o,Te.isCombinedCharacter=function(ve){return O.indexOf(ve)!==-1},Te.isRegionalFlag=function(ve,Ae){var Ee=_e(ve.substr(Ae,2));if(Ee!==q)return!1;var Ie=0;for(Ae+=2;Ie<5;){if((Ee=_e(ve.substr(Ae,2)))<917601||Ee>917626)return!1;Ie+=1,Ae+=2}return _e(ve.substr(Ae,2))===917631},Te.isVariationSelector=function(ve){return ve===65039},Te.BLACK_FLAG_CODE_POINT=q;var Pe={addChars:function(ve){if(ve){var Ae;this.chars||(this.chars=[]);var Ee,Ie,ye=ve.length,ge=this.chars.length;for(Ae=0;Ae<ye;Ae+=1){for(Ee=0,Ie=!1;Ee<ge;)this.chars[Ee].style===ve[Ae].style&&this.chars[Ee].fFamily===ve[Ae].fFamily&&this.chars[Ee].ch===ve[Ae].ch&&(Ie=!0),Ee+=1;Ie||(this.chars.push(ve[Ae]),ge+=1)}}},addFonts:function(ve,Ae){if(ve){if(this.chars)return this.isLoaded=!0,void(this.fonts=ve.list);if(!document.body)return this.isLoaded=!0,ve.list.forEach(function(jt){jt.helper=le(jt),jt.cache={}}),void(this.fonts=ve.list);var Ee,Ie=ve.list,ye=Ie.length,ge=ye;for(Ee=0;Ee<ye;Ee+=1){var Se,Ce,Ve=!0;if(Ie[Ee].loaded=!1,Ie[Ee].monoCase=ie(Ie[Ee].fFamily,"monospace"),Ie[Ee].sansCase=ie(Ie[Ee].fFamily,"sans-serif"),Ie[Ee].fPath){if(Ie[Ee].fOrigin==="p"||Ie[Ee].origin===3){if((Se=document.querySelectorAll('style[f-forigin="p"][f-family="'+Ie[Ee].fFamily+'"], style[f-origin="3"][f-family="'+Ie[Ee].fFamily+'"]')).length>0&&(Ve=!1),Ve){var at=createTag("style");at.setAttribute("f-forigin",Ie[Ee].fOrigin),at.setAttribute("f-origin",Ie[Ee].origin),at.setAttribute("f-family",Ie[Ee].fFamily),at.type="text/css",at.innerText="@font-face {font-family: "+Ie[Ee].fFamily+"; font-style: normal; src: url('"+Ie[Ee].fPath+"');}",Ae.appendChild(at)}}else if(Ie[Ee].fOrigin==="g"||Ie[Ee].origin===1){for(Se=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Ce=0;Ce<Se.length;Ce+=1)Se[Ce].href.indexOf(Ie[Ee].fPath)!==-1&&(Ve=!1);if(Ve){var et=createTag("link");et.setAttribute("f-forigin",Ie[Ee].fOrigin),et.setAttribute("f-origin",Ie[Ee].origin),et.type="text/css",et.rel="stylesheet",et.href=Ie[Ee].fPath,document.body.appendChild(et)}}else if(Ie[Ee].fOrigin==="t"||Ie[Ee].origin===2){for(Se=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),Ce=0;Ce<Se.length;Ce+=1)Ie[Ee].fPath===Se[Ce].src&&(Ve=!1);if(Ve){var Mt=createTag("link");Mt.setAttribute("f-forigin",Ie[Ee].fOrigin),Mt.setAttribute("f-origin",Ie[Ee].origin),Mt.setAttribute("rel","stylesheet"),Mt.setAttribute("href",Ie[Ee].fPath),Ae.appendChild(Mt)}}}else Ie[Ee].loaded=!0,ge-=1;Ie[Ee].helper=le(Ie[Ee],Ae),Ie[Ee].cache={},this.fonts.push(Ie[Ee])}ge===0?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(ve,Ae,Ee){for(var Ie=0,ye=this.chars.length;Ie<ye;){if(this.chars[Ie].ch===ve&&this.chars[Ie].style===Ae&&this.chars[Ie].fFamily===Ee)return this.chars[Ie];Ie+=1}return(typeof ve=="string"&&ve.charCodeAt(0)!==13||!ve)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",ve,Ae,Ee)),D},getFontByName:function(ve){for(var Ae=0,Ee=this.fonts.length;Ae<Ee;){if(this.fonts[Ae].fName===ve)return this.fonts[Ae];Ae+=1}return this.fonts[0]},measureText:function(ve,Ae,Ee){var Ie=this.getFontByName(Ae),ye=ve;if(!Ie.cache[ye]){var ge=Ie.helper;if(ve===" "){var Se=ge.measureText("|"+ve+"|"),Ce=ge.measureText("||");Ie.cache[ye]=(Se-Ce)/100}else Ie.cache[ye]=ge.measureText(ve)/100}return Ie.cache[ye]*Ee},checkLoadedFonts:function(){var ve,Ae,Ee,Ie=this.fonts.length,ye=Ie;for(ve=0;ve<Ie;ve+=1)this.fonts[ve].loaded?ye-=1:this.fonts[ve].fOrigin==="n"||this.fonts[ve].origin===0?this.fonts[ve].loaded=!0:(Ae=this.fonts[ve].monoCase.node,Ee=this.fonts[ve].monoCase.w,Ae.offsetWidth!==Ee?(ye-=1,this.fonts[ve].loaded=!0):(Ae=this.fonts[ve].sansCase.node,Ee=this.fonts[ve].sansCase.w,Ae.offsetWidth!==Ee&&(ye-=1,this.fonts[ve].loaded=!0)),this.fonts[ve].loaded&&(this.fonts[ve].sansCase.parent.parentNode.removeChild(this.fonts[ve].sansCase.parent),this.fonts[ve].monoCase.parent.parentNode.removeChild(this.fonts[ve].monoCase.parent)));ye!==0&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}};return Te.prototype=Pe,Te}();function SlotManager(D){this.animationData=D}function slotFactory(D){return new SlotManager(D)}
vendor: 4,696 bytes, line 18
18function RenderableElement(){}SlotManager.prototype.getProp=function(D){return this.animationData.slots&&this.animationData.slots[D.sid]?Object.assign(D,this.animationData.slots[D.sid].p):D},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(D){this.renderableComponents.indexOf(D)===-1&&this.renderableComponents.push(D)},removeRenderableComponent:function(D){this.renderableComponents.indexOf(D)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(D),1)},prepareRenderableFrame:function(D){this.checkLayerLimits(D)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(D){this.data.ip-this.data.st<=D&&this.data.op-this.data.st>D?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var D,O=this.renderableComponents.length;for(D=0;D<O;D+=1)this.renderableComponents[D].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return this.data.ty===5?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=(blendModeEnums={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(D){return blendModeEnums[D]||""}),blendModeEnums;function SliderEffect(D,O,q){this.p=PropertyFactory.getProp(O,D.v,0,0,q)}function AngleEffect(D,O,q){this.p=PropertyFactory.getProp(O,D.v,0,0,q)}function ColorEffect(D,O,q){this.p=PropertyFactory.getProp(O,D.v,1,0,q)}function PointEffect(D,O,q){this.p=PropertyFactory.getProp(O,D.v,1,0,q)}function LayerIndexEffect(D,O,q){this.p=PropertyFactory.getProp(O,D.v,0,0,q)}function MaskIndexEffect(D,O,q){this.p=PropertyFactory.getProp(O,D.v,0,0,q)}function CheckboxEffect(D,O,q){this.p=PropertyFactory.getProp(O,D.v,0,0,q)}function NoValueEffect(){this.p={}}function EffectsManager(D,O){var q,J=D.ef||[];this.effectElements=[];var ie,le=J.length;for(q=0;q<le;q+=1)ie=new GroupEffect(J[q],O),this.effectElements.push(ie)}function GroupEffect(D,O){this.init(D,O)}function BaseElement(){}function FrameElement(){}function FootageElement(D,O,q){this.initFrame(),this.initRenderable(),this.assetData=O.getAssetData(D.refId),this.footageData=O.imageLoader.getAsset(this.assetData),this.initBaseData(D,O,q)}function AudioElement(D,O,q){this.initFrame(),this.initRenderable(),this.assetData=O.getAssetData(D.refId),this.initBaseData(D,O,q),this._isPlaying=!1,this._canPlay=!1;var J=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(J),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=D.tm?PropertyFactory.getProp(this,D.tm,0,O.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,D.au&&D.au.lv?D.au.lv:{k:[100]},1,.01,this)}function BaseRenderer(){}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(D,O){var q;this.data=D,this.effectElements=[],this.initDynamicPropertyContainer(O);var J,ie=this.data.ef.length,le=this.data.ef;for(q=0;q<ie;q+=1){switch(J=null,le[q].ty){case 0:J=new SliderEffect(le[q],O,this);break;case 1:J=new AngleEffect(le[q],O,this);break;case 2:J=new ColorEffect(le[q],O,this);break;case 3:J=new PointEffect(le[q],O,this);break;case 4:case 7:J=new CheckboxEffect(le[q],O,this);break;case 10:J=new LayerIndexEffect(le[q],O,this);break;case 11:J=new MaskIndexEffect(le[q],O,this);break;case 5:J=new EffectsManager(le[q],O);break;default:J=new NoValueEffect(le[q])}J&&this.effectElements.push(J)}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var D=0,O=this.data.masksProperties.length;D<O;){if(this.data.masksProperties[D].mode!=="n"&&this.data.masksProperties[D].cl!==!1)return!0;D+=1}return!1},initExpressions:function(){var D=getExpressionInterfaces();if(D){var O=D("layer"),q=D("effects"),J=D("shape"),ie=D("text"),le=D("comp");this.layerInterface=O(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);
vendor: 7,093 bytes, line 18
18var _e=q.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(_e),this.data.ty===0||this.data.xt?this.compInterface=le(this):this.data.ty===4?(this.layerInterface.shapeInterface=J(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):this.data.ty===5&&(this.layerInterface.textInterface=ie(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function(){var D=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=D},initBaseData:function(D,O,q){this.globalData=O,this.comp=q,this.data=D,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(D,O){var q,J=this.dynamicProperties.length;for(q=0;q<J;q+=1)(O||this._isParent&&this.dynamicProperties[q].propType==="transform")&&(this.dynamicProperties[q].getValue(),this.dynamicProperties[q]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(D){this.dynamicProperties.indexOf(D)===-1&&this.dynamicProperties.push(D)}},FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var D=getExpressionInterfaces();if(D){var O=D("footage");this.layerInterface=O(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(D){if(this.prepareRenderableFrame(D,!0),this.prepareProperties(D,!0),this.tm._placeholder)this._currentTime=D/this.data.sr;else{var O=this.tm.v;this._currentTime=O}this._volume=this.lv.v[0];var q=this._volume*this._volumeMultiplier;this._previousVolume!==q&&(this._previousVolume=q,this.audio.volume(q))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(D){this.audio.rate(D)},AudioElement.prototype.volume=function(D){this._volumeMultiplier=D,this._previousVolume=D*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(D){var O,q,J=this.layers.length;for(this.completeLayers=!0,O=J-1;O>=0;O-=1)this.elements[O]||(q=this.layers[O]).ip-q.st<=D-this.layers[O].st&&q.op-q.st>D-this.layers[O].st&&this.buildItem(O),this.completeLayers=!!this.elements[O]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(D){switch(D.ty){case 2:return this.createImage(D);case 0:return this.createComp(D);case 1:return this.createSolid(D);case 3:default:return this.createNull(D);case 4:return this.createShape(D);case 5:return this.createText(D);case 6:return this.createAudio(D);case 13:return this.createCamera(D);case 15:return this.createFootage(D)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(D){return new AudioElement(D,this.globalData,this)},BaseRenderer.prototype.createFootage=function(D){return new FootageElement(D,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var D,O=this.layers.length;for(D=0;D<O;D+=1)this.buildItem(D);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(D){var O;this.completeLayers=!1;var q,J=D.length,ie=this.layers.length;for(O=0;O<J;O+=1)for(q=0;q<ie;){if(this.layers[q].id===D[O].id){this.layers[q]=D[O];break}q+=1}},BaseRenderer.prototype.setProjectInterface=function(D){this.globalData.projectInterface=D},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(D,O,q){for(var J=this.elements,ie=this.layers,le=0,_e=ie.length;le<_e;)ie[le].ind==O&&(J[le]&&J[le]!==!0?(q.push(J[le]),J[le].setAsParent(),ie[le].parent!==void 0?this.buildElementParenting(D,ie[le].parent,q):D.setHierarchy(q)):(this.buildItem(le),this.addPendingElement(D))),le+=1},BaseRenderer.prototype.addPendingElement=function(D){this.pendingElements.push(D)},BaseRenderer.prototype.searchExtraCompositions=function(D){var O,q=D.length;for(O=0;O<q;O+=1)if(D[O].xt){var J=this.createComp(D[O]);J.initExpressions(),this.globalData.projectInterface.registerComposition(J)}},BaseRenderer.prototype.getElementById=function(D){var O,q=this.elements.length;for(O=0;O<q;O+=1)if(this.elements[O].data.ind===D)return this.elements[O];return null},BaseRenderer.prototype.getElementByPath=function(D){var O,q=D.shift();if(typeof q=="number")O=this.elements[q];else{var J,ie=this.elements.length;for(J=0;J<ie;J+=1)if(this.elements[J].data.nm===q){O=this.elements[J];break}}return D.length===0?O:O.getElementByPath(D)},BaseRenderer.prototype.setupGlobalData=function(D,O){this.globalData.fontManager=new FontManager,this.globalData.slotManager=slotFactory(D),this.globalData.fontManager.addChars(D.chars),this.globalData.fontManager.addFonts(D.fonts,O),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=D.fr,this.globalData.nm=D.nm,this.globalData.compSize={w:D.w,h:D.h}};var effectTypes={TRANSFORM_EFFECT:"transformEFfect"};function TransformElement(){}function MaskElement(D,O,q){this.data=D,this.element=O,this.globalData=q,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var J,ie,le=this.globalData.defs,_e=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(_e),this.solidPath="";var o,Te,Pe,ve,Ae,Ee,Ie=this.masksProperties,ye=0,ge=[],Se=createElementID(),Ce="clipPath",Ve="clip-path";
vendor: 4,112 bytes, line 18
18for(J=0;J<_e;J+=1)if((Ie[J].mode!=="a"&&Ie[J].mode!=="n"||Ie[J].inv||Ie[J].o.k!==100||Ie[J].o.x)&&(Ce="mask",Ve="mask"),Ie[J].mode!=="s"&&Ie[J].mode!=="i"||ye!==0?Pe=null:((Pe=createNS("rect")).setAttribute("fill","#ffffff"),Pe.setAttribute("width",this.element.comp.data.w||0),Pe.setAttribute("height",this.element.comp.data.h||0),ge.push(Pe)),ie=createNS("path"),Ie[J].mode==="n")this.viewData[J]={op:PropertyFactory.getProp(this.element,Ie[J].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,Ie[J],3),elem:ie,lastPath:""},le.appendChild(ie);else{var at;if(ye+=1,ie.setAttribute("fill",Ie[J].mode==="s"?"#000000":"#ffffff"),ie.setAttribute("clip-rule","nonzero"),Ie[J].x.k!==0?(Ce="mask",Ve="mask",Ee=PropertyFactory.getProp(this.element,Ie[J].x,0,null,this.element),at=createElementID(),(ve=createNS("filter")).setAttribute("id",at),(Ae=createNS("feMorphology")).setAttribute("operator","erode"),Ae.setAttribute("in","SourceGraphic"),Ae.setAttribute("radius","0"),ve.appendChild(Ae),le.appendChild(ve),ie.setAttribute("stroke",Ie[J].mode==="s"?"#000000":"#ffffff")):(Ae=null,Ee=null),this.storedData[J]={elem:ie,x:Ee,expan:Ae,lastPath:"",lastOperator:"",filterId:at,lastRadius:0},Ie[J].mode==="i"){Te=ge.length;var et=createNS("g");for(o=0;o<Te;o+=1)et.appendChild(ge[o]);var Mt=createNS("mask");Mt.setAttribute("mask-type","alpha"),Mt.setAttribute("id",Se+"_"+ye),Mt.appendChild(ie),le.appendChild(Mt),et.setAttribute("mask","url("+getLocationHref()+"#"+Se+"_"+ye+")"),ge.length=0,ge.push(et)}else ge.push(ie);Ie[J].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[J]={elem:ie,lastPath:"",op:PropertyFactory.getProp(this.element,Ie[J].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,Ie[J],3),invRect:Pe},this.viewData[J].prop.k||this.drawPath(Ie[J],this.viewData[J].prop.v,this.viewData[J])}for(this.maskElement=createNS(Ce),_e=ge.length,J=0;J<_e;J+=1)this.maskElement.appendChild(ge[J]);ye>0&&(this.maskElement.setAttribute("id",Se),this.element.maskedElement.setAttribute(Ve,"url("+getLocationHref()+"#"+Se+")"),le.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}TransformElement.prototype={initTransform:function(){var D=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:D,localMat:D,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var D,O=this.finalTransform.mat,q=0,J=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;q<J;){if(this.hierarchy[q].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}q+=1}if(this.finalTransform._matMdf)for(D=this.finalTransform.mProp.v.props,O.cloneFromProps(D),q=0;q<J;q+=1)O.multiply(this.hierarchy[q].finalTransform.mProp.v)}this.finalTransform._matMdf&&(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var D=0,O=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;D<O;)this.localTransforms[D]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[D]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),D+=1;if(this.finalTransform._localMatMdf){var q=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(q),D=1;D<O;D+=1){var J=this.localTransforms[D].matrix;q.multiply(J)}q.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var ie=this.finalTransform.localOpacity;for(D=0;D<O;D+=1)ie*=.01*this.localTransforms[D].opacity;this.finalTransform.localOpacity=ie}}}
vendor: 4,341 bytes, line 18
18,searchEffectTransforms:function(){if(this.renderableEffectsManager){var D=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);if(D.length){this.localTransforms=[],this.finalTransform.localMat=new Matrix;var O=0,q=D.length;for(O=0;O<q;O+=1)this.localTransforms.push(D[O])}}},globalToLocal:function(D){var O=[];O.push(this.finalTransform);for(var q,J=!0,ie=this.comp;J;)ie.finalTransform?(ie.data.hasMask&&O.splice(0,0,ie.finalTransform),ie=ie.comp):J=!1;var le,_e=O.length;for(q=0;q<_e;q+=1)le=O[q].mat.applyToPointArray(0,0,0),D=[D[0]-le[0],D[1]-le[1],0];return D},mHelper:new Matrix},MaskElement.prototype.getMaskProperty=function(D){return this.viewData[D].prop},MaskElement.prototype.renderFrame=function(D){var O,q=this.element.finalTransform.mat,J=this.masksProperties.length;for(O=0;O<J;O+=1)if((this.viewData[O].prop._mdf||D)&&this.drawPath(this.masksProperties[O],this.viewData[O].prop.v,this.viewData[O]),(this.viewData[O].op._mdf||D)&&this.viewData[O].elem.setAttribute("fill-opacity",this.viewData[O].op.v),this.masksProperties[O].mode!=="n"&&(this.viewData[O].invRect&&(this.element.finalTransform.mProp._mdf||D)&&this.viewData[O].invRect.setAttribute("transform",q.getInverseMatrix().to2dCSS()),this.storedData[O].x&&(this.storedData[O].x._mdf||D))){var ie=this.storedData[O].expan;this.storedData[O].x.v<0?(this.storedData[O].lastOperator!=="erode"&&(this.storedData[O].lastOperator="erode",this.storedData[O].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[O].filterId+")")),ie.setAttribute("radius",-this.storedData[O].x.v)):(this.storedData[O].lastOperator!=="dilate"&&(this.storedData[O].lastOperator="dilate",this.storedData[O].elem.setAttribute("filter",null)),this.storedData[O].elem.setAttribute("stroke-width",2*this.storedData[O].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var D="M0,0 ";return D+=" h"+this.globalData.compSize.w,D+=" v"+this.globalData.compSize.h,D+=" h-"+this.globalData.compSize.w,D+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(D,O,q){var J,ie,le=" M"+O.v[0][0]+","+O.v[0][1];for(ie=O._length,J=1;J<ie;J+=1)le+=" C"+O.o[J-1][0]+","+O.o[J-1][1]+" "+O.i[J][0]+","+O.i[J][1]+" "+O.v[J][0]+","+O.v[J][1];if(O.c&&ie>1&&(le+=" C"+O.o[J-1][0]+","+O.o[J-1][1]+" "+O.i[0][0]+","+O.i[0][1]+" "+O.v[0][0]+","+O.v[0][1]),q.lastPath!==le){var _e="";q.elem&&(O.c&&(_e=D.inv?this.solidPath+le:le),q.elem.setAttribute("d",_e)),q.lastPath=le}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var D={createFilter:function(O,q){var J=createNS("filter");return J.setAttribute("id",O),q!==!0&&(J.setAttribute("filterUnits","objectBoundingBox"),J.setAttribute("x","0%"),J.setAttribute("y","0%"),J.setAttribute("width","100%"),J.setAttribute("height","100%")),J},createAlphaToLuminanceFilter:function(){var O=createNS("feColorMatrix");return O.setAttribute("type","matrix"),O.setAttribute("color-interpolation-filters","sRGB"),O.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),O}};return D}(),featureSupport=function(){var D={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(D.maskType=!1),/firefox/i.test(navigator.userAgent)&&(D.svgLumaHidden=!1),D}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(D){var O,q,J="SourceGraphic",ie=D.data.ef?D.data.ef.length:0,le=createElementID(),_e=filtersFactory.createFilter(le,!0),o=0;for(this.filters=[],O=0;O<ie;O+=1){q=null;var Te=D.data.ef[O].ty;registeredEffects$1[Te]&&(q=new registeredEffects$1[Te].effect(_e,D.effectsManager.effectElements[O],D,idPrefix+o,J),J=idPrefix+o,registeredEffects$1[Te].countsAsEffect&&(o+=1)),q&&this.filters.push(q)}o&&(D.globalData.defs.appendChild(_e),D.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+le+")")),this.filters.length&&D.addRenderableComponent(this)}function registerEffect$1(D,O,q){registeredEffects$1[D]={effect:O,countsAsEffect:q}}function SVGBaseElement(){}function HierarchyElement(){}
vendor: 12,523 bytes, line 18
18function RenderableDOMElement(){}function IImageElement(D,O,q){this.assetData=O.getAssetData(D.refId),this.assetData&&this.assetData.sid&&(this.assetData=O.slotManager.getProp(this.assetData)),this.initElement(D,O,q),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ProcessedElement(D,O){this.elem=D,this.pos=O}function IShapeElement(){}SVGEffects.prototype.renderFrame=function(D){var O,q=this.filters.length;for(O=0;O<q;O+=1)this.filters[O].renderFrame(D)},SVGEffects.prototype.getEffects=function(D){var O,q=this.filters.length,J=[];for(O=0;O<q;O+=1)this.filters[O].type===D&&J.push(this.filters[O]);return J},SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var D=null;if(this.data.td){this.matteMasks={};var O=createNS("g");O.setAttribute("id",this.layerId),O.appendChild(this.layerElement),D=O,this.globalData.defs.appendChild(O)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),D=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.ty===0&&!this.data.hd){var q=createNS("clipPath"),J=createNS("path");J.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var ie=createElementID();if(q.setAttribute("id",ie),q.appendChild(J),this.globalData.defs.appendChild(q),this.checkMasks()){var le=createNS("g");le.setAttribute("clip-path","url("+getLocationHref()+"#"+ie+")"),le.appendChild(this.layerElement),this.transformedElement=le,D?D.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+ie+")")}this.data.bm!==0&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this),this.searchEffectTransforms()},getMatte:function(D){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[D]){var O,q,J,ie,le=this.layerId+"_"+D;if(D===1||D===3){var _e=createNS("mask");_e.setAttribute("id",le),_e.setAttribute("mask-type",D===3?"luminance":"alpha"),(J=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),_e.appendChild(J),this.globalData.defs.appendChild(_e),featureSupport.maskType||D!==1||(_e.setAttribute("mask-type","luminance"),O=createElementID(),q=filtersFactory.createFilter(O),this.globalData.defs.appendChild(q),q.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(ie=createNS("g")).appendChild(J),_e.appendChild(ie),ie.setAttribute("filter","url("+getLocationHref()+"#"+O+")"))}else if(D===2){var o=createNS("mask");o.setAttribute("id",le),o.setAttribute("mask-type","alpha");var Te=createNS("g");o.appendChild(Te),O=createElementID(),q=filtersFactory.createFilter(O);var Pe=createNS("feComponentTransfer");Pe.setAttribute("in","SourceGraphic"),q.appendChild(Pe);var ve=createNS("feFuncA");ve.setAttribute("type","table"),ve.setAttribute("tableValues","1.0 0.0"),Pe.appendChild(ve),this.globalData.defs.appendChild(q);var Ae=createNS("rect");Ae.setAttribute("width",this.comp.data.w),Ae.setAttribute("height",this.comp.data.h),Ae.setAttribute("x","0"),Ae.setAttribute("y","0"),Ae.setAttribute("fill","#ffffff"),Ae.setAttribute("opacity","0"),Te.setAttribute("filter","url("+getLocationHref()+"#"+O+")"),Te.appendChild(Ae),(J=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),Te.appendChild(J),featureSupport.maskType||(o.setAttribute("mask-type","luminance"),q.appendChild(filtersFactory.createAlphaToLuminanceFilter()),ie=createNS("g"),Te.appendChild(Ae),ie.appendChild(this.layerElement),Te.appendChild(ie)),this.globalData.defs.appendChild(o)}this.matteMasks[D]=le}return this.matteMasks[D]},setMatte:function(D){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+D+")")}},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(D){this.hierarchy=D},setAsParent:function(){this._isParent=!0},checkParenting:function(){this.data.parent!==void 0&&this.comp.buildElementParenting(this,this.data.parent,[])}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(D,O,q){this.initFrame(),this.initBaseData(D,O,q),this.initTransform(D,O,q),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(D){this._mdf=!1,this.prepareRenderableFrame(D),this.prepareProperties(D,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var D=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",D),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},IShapeElement.prototype={addShapeToModifiers:function(D){var O,q=this.shapeModifiers.length;for(O=0;O<q;O+=1)this.shapeModifiers[O].addShape(D)},isShapeInAnimatedModifiers:function(D){for(var O=this.shapeModifiers.length;0<O;)if(this.shapeModifiers[0].isAnimatedWithShape(D))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var D,O=this.shapes.length;for(D=0;D<O;D+=1)this.shapes[D].sh.reset();for(D=(O=this.shapeModifiers.length)-1;D>=0&&!this.shapeModifiers[D].processShapes(this._isFirstFrame);D-=1);}},searchProcessedElement:function(D){for(var O=this.processedElements,q=0,J=O.length;q<J;){if(O[q].elem===D)return O[q].pos;q+=1}return 0},addProcessedElement:function(D,O){for(var q=this.processedElements,J=q.length;J;)if(q[J-=1].elem===D)return void(q[J].pos=O);q.push(new ProcessedElement(D,O))},prepareFrame:function(D){this.prepareRenderableFrame(D),this.prepareProperties(D,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(D,O,q){this.caches=[],this.styles=[],this.transformers=D,this.lStr="",this.sh=q,this.lvl=O,this._isAnimated=!!q.k;for(var J=0,ie=D.length;J<ie;){if(D[J].mProps.dynamicProperties.length){this._isAnimated=!0;break}J+=1}}function SVGStyleData(D,O){this.data=D,this.type=D.ty,this.d="",this.lvl=O,this._mdf=!1,this.closed=D.hd===!0,this.pElem=createNS("path"),this.msElem=null}function DashProperty(D,O,q,J){var ie;this.elem=D,this.frameId=-1,this.dataProps=createSizedArray(O.length),this.renderer=q,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",O.length?O.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(J);var le,_e=O.length||0;for(ie=0;ie<_e;ie+=1)le=PropertyFactory.getProp(D,O[ie].v,0,0,this),this.k=le.k||this.k,this.dataProps[ie]={n:O[ie].n,p:le};this.k||this.getValue(!0),this._isAnimated=this.k}function SVGStrokeStyleData(D,O,q){this.initDynamicPropertyContainer(D),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(D,O.o,0,.01,this),this.w=PropertyFactory.getProp(D,O.w,0,null,this),this.d=new DashProperty(D,O.d||{},"svg",this),this.c=PropertyFactory.getProp(D,O.c,1,255,this),this.style=q,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(D,O,q){this.initDynamicPropertyContainer(D),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(D,O.o,0,.01,this),this.c=PropertyFactory.getProp(D,O.c,1,255,this),this.style=q}function SVGNoStyleData(D,O,q){this.initDynamicPropertyContainer(D),this.getValue=this.iterateDynamicProperties,this.style=q}function GradientProperty(D,O,q){this.data=O,this.c=createTypedArray("uint8c",4*O.p);var J=O.k.k[0].s?O.k.k[0].s.length-4*O.p:O.k.k.length-4*O.p;this.o=createTypedArray("float32",J),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=J,this.initDynamicPropertyContainer(q),this.prop=PropertyFactory.getProp(D,O.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function SVGGradientFillStyleData(D,O,q){this.initDynamicPropertyContainer(D),this.getValue=this.iterateDynamicProperties,this.initGradientData(D,O,q)}function SVGGradientStrokeStyleData(D,O,q){this.initDynamicPropertyContainer(D),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(D,O.w,0,null,this),this.d=new DashProperty(D,O.d||{},"svg",this),this.initGradientData(D,O,q),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(D,O,q){this.transform={mProps:D,op:O,container:q},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},DashProperty.prototype.getValue=function(D){if((this.elem.globalData.frameId!==this.frameId||D)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||D,this._mdf)){var O=0,q=this.dataProps.length;for(this.renderer==="svg"&&(this.dashStr=""),O=0;O<q;O+=1)this.dataProps[O].n!=="o"?this.renderer==="svg"?this.dashStr+=" "+this.dataProps[O].p.v:this.dashArray[O]=this.dataProps[O].p.v:this.dashoffset[0]=this.dataProps[O].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),extendPrototype([DynamicPropertyContainer],SVGNoStyleData),GradientProperty.prototype.comparePoints=function(D,O){for(var q=0,J=this.o.length/2;q<J;){if(Math.abs(D[4*q]-D[4*O+2*q])>.01)return!1;q+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var D=0,O=this.data.k.k.length;D<O;){if(!this.comparePoints(this.data.k.k[D].s,this.data.p))return!1;D+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(D){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||D){var O,q,J,ie=4*this.data.p;for(O=0;O<ie;O+=1)q=O%4==0?100:255,J=Math.round(this.prop.v[O]*q),this.c[O]!==J&&(this.c[O]=J,this._cmdf=!D);if(this.o.length)for(ie=this.prop.v.length,O=4*this.data.p;O<ie;O+=1)q=O%2==0?100:1,J=O%2==0?Math.round(100*this.prop.v[O]):this.prop.v[O],this.o[O-4*this.data.p]!==J&&(this.o[O-4*this.data.p]=J,this._omdf=!D);this._mdf=!D}},extendPrototype([DynamicPropertyContainer],GradientProperty),SVGGradientFillStyleData.prototype.initGradientData=function(D,O,q){this.o=PropertyFactory.getProp(D,O.o,0,.01,this),this.s=PropertyFactory.getProp(D,O.s,1,null,this),this.e=Pro
vendor: 21,281 bytes, line 18
18pertyFactory.getProp(D,O.e,1,null,this),this.h=PropertyFactory.getProp(D,O.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(D,O.a||{k:0},0,degToRads,this),this.g=new GradientProperty(D,O.g,this),this.style=q,this.stops=[],this.setGradientData(q.pElem,O),this.setGradientOpacity(O,q),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(D,O){var q=createElementID(),J=createNS(O.t===1?"linearGradient":"radialGradient");J.setAttribute("id",q),J.setAttribute("spreadMethod","pad"),J.setAttribute("gradientUnits","userSpaceOnUse");var ie,le,_e,o=[];for(_e=4*O.g.p,le=0;le<_e;le+=4)ie=createNS("stop"),J.appendChild(ie),o.push(ie);D.setAttribute(O.ty==="gf"?"fill":"stroke","url("+getLocationHref()+"#"+q+")"),this.gf=J,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(D,O){if(this.g._hasOpacity&&!this.g._collapsable){var q,J,ie,le=createNS("mask"),_e=createNS("path");le.appendChild(_e);var o=createElementID(),Te=createElementID();le.setAttribute("id",Te);var Pe=createNS(D.t===1?"linearGradient":"radialGradient");Pe.setAttribute("id",o),Pe.setAttribute("spreadMethod","pad"),Pe.setAttribute("gradientUnits","userSpaceOnUse"),ie=D.g.k.k[0].s?D.g.k.k[0].s.length:D.g.k.k.length;var ve=this.stops;for(J=4*D.g.p;J<ie;J+=2)(q=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),Pe.appendChild(q),ve.push(q);_e.setAttribute(D.ty==="gf"?"fill":"stroke","url("+getLocationHref()+"#"+o+")"),D.ty==="gs"&&(_e.setAttribute("stroke-linecap",lineCapEnum[D.lc||2]),_e.setAttribute("stroke-linejoin",lineJoinEnum[D.lj||2]),D.lj===1&&_e.setAttribute("stroke-miterlimit",D.ml)),this.of=Pe,this.ms=le,this.ost=ve,this.maskId=Te,O.msElem=_e}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var buildShapeString=function(D,O,q,J){if(O===0)return"";var ie,le=D.o,_e=D.i,o=D.v,Te=" M"+J.applyToPointStringified(o[0][0],o[0][1]);for(ie=1;ie<O;ie+=1)Te+=" C"+J.applyToPointStringified(le[ie-1][0],le[ie-1][1])+" "+J.applyToPointStringified(_e[ie][0],_e[ie][1])+" "+J.applyToPointStringified(o[ie][0],o[ie][1]);return q&&O&&(Te+=" C"+J.applyToPointStringified(le[ie-1][0],le[ie-1][1])+" "+J.applyToPointStringified(_e[0][0],_e[0][1])+" "+J.applyToPointStringified(o[0][0],o[0][1]),Te+="z"),Te},SVGElementsRenderer=function(){var D=new Matrix,O=new Matrix;function q(Pe,ve,Ae){(Ae||ve.transform.op._mdf)&&ve.transform.container.setAttribute("opacity",ve.transform.op.v),(Ae||ve.transform.mProps._mdf)&&ve.transform.container.setAttribute("transform",ve.transform.mProps.v.to2dCSS())}function J(){}function ie(Pe,ve,Ae){var Ee,Ie,ye,ge,Se,Ce,Ve,at,et,Mt,jt=ve.styles.length,St=ve.lvl;for(Ce=0;Ce<jt;Ce+=1){if(ge=ve.sh._mdf||Ae,ve.styles[Ce].lvl<St){for(at=O.reset(),et=St-ve.styles[Ce].lvl,Mt=ve.transformers.length-1;!ge&&et>0;)ge=ve.transformers[Mt].mProps._mdf||ge,et-=1,Mt-=1;if(ge)for(et=St-ve.styles[Ce].lvl,Mt=ve.transformers.length-1;et>0;)at.multiply(ve.transformers[Mt].mProps.v),et-=1,Mt-=1}else at=D;if(Ie=(Ve=ve.sh.paths)._length,ge){for(ye="",Ee=0;Ee<Ie;Ee+=1)(Se=Ve.shapes[Ee])&&Se._length&&(ye+=buildShapeString(Se,Se._length,Se.c,at));ve.caches[Ce]=ye}else ye=ve.caches[Ce];ve.styles[Ce].d+=Pe.hd===!0?"":ye,ve.styles[Ce]._mdf=ge||ve.styles[Ce]._mdf}}function le(Pe,ve,Ae){var Ee=ve.style;(ve.c._mdf||Ae)&&Ee.pElem.setAttribute("fill","rgb("+bmFloor(ve.c.v[0])+","+bmFloor(ve.c.v[1])+","+bmFloor(ve.c.v[2])+")"),(ve.o._mdf||Ae)&&Ee.pElem.setAttribute("fill-opacity",ve.o.v)}function _e(Pe,ve,Ae){o(Pe,ve,Ae),Te(0,ve,Ae)}function o(Pe,ve,Ae){var Ee,Ie,ye,ge,Se,Ce=ve.gf,Ve=ve.g._hasOpacity,at=ve.s.v,et=ve.e.v;if(ve.o._mdf||Ae){var Mt=Pe.ty==="gf"?"fill-opacity":"stroke-opacity";ve.style.pElem.setAttribute(Mt,ve.o.v)}if(ve.s._mdf||Ae){var jt=Pe.t===1?"x1":"cx",St=jt==="x1"?"y1":"cy";Ce.setAttribute(jt,at[0]),Ce.setAttribute(St,at[1]),Ve&&!ve.g._collapsable&&(ve.of.setAttribute(jt,at[0]),ve.of.setAttribute(St,at[1]))}if(ve.g._cmdf||Ae){Ee=ve.cst;var Bt=ve.g.c;for(ye=Ee.length,Ie=0;Ie<ye;Ie+=1)(ge=Ee[Ie]).setAttribute("offset",Bt[4*Ie]+"%"),ge.setAttribute("stop-color","rgb("+Bt[4*Ie+1]+","+Bt[4*Ie+2]+","+Bt[4*Ie+3]+")")}if(Ve&&(ve.g._omdf||Ae)){var Zt=ve.g.o;for(ye=(Ee=ve.g._collapsable?ve.cst:ve.ost).length,Ie=0;Ie<ye;Ie+=1)ge=Ee[Ie],ve.g._collapsable||ge.setAttribute("offset",Zt[2*Ie]+"%"),ge.setAttribute("stop-opacity",Zt[2*Ie+1])}if(Pe.t===1)(ve.e._mdf||Ae)&&(Ce.setAttribute("x2",et[0]),Ce.setAttribute("y2",et[1]),Ve&&!ve.g._collapsable&&(ve.of.setAttribute("x2",et[0]),ve.of.setAttribute("y2",et[1])));else if((ve.s._mdf||ve.e._mdf||Ae)&&(Se=Math.sqrt(Math.pow(at[0]-et[0],2)+Math.pow(at[1]-et[1],2)),Ce.setAttribute("r",Se),Ve&&!ve.g._collapsable&&ve.of.setAttribute("r",Se)),ve.e._mdf||ve.h._mdf||ve.a._mdf||Ae){Se||(Se=Math.sqrt(Math.pow(at[0]-et[0],2)+Math.pow(at[1]-et[1],2)));var xt=Math.atan2(et[1]-at[1],et[0]-at[0]),wt=ve.h.v;wt>=1?wt=.99:wt<=-1&&(wt=-.99);var Je=Se*wt,ut=Math.cos(xt+ve.a.v)*Je+at[0],lt=Math.sin(xt+ve.a.v)*Je+at[1];Ce.setAttribute("fx",ut),Ce.setAttribute("fy",lt),Ve&&!ve.g._collapsable&&(ve.of.setAttribute("fx",ut),ve.of.setAttribute("fy",lt))}}function Te(Pe,ve,Ae){var Ee=ve.style,Ie=ve.d;Ie&&(Ie._mdf||Ae)&&Ie.dashStr&&(Ee.pElem.setAttribute("stroke-dasharray",Ie.dashStr),Ee.pElem.setAttribute("stroke-dashoffset",Ie.dashoffset[0])),ve.c&&(ve.c._mdf||Ae)&&Ee.pElem.setAttribute("stroke","rgb("+bmFloor(ve.c.v[0])+","+bmFloor(ve.c.v[1])+","+bmFloor(ve.c.v[2])+")"),(ve.o._mdf||Ae)&&Ee.pElem.setAttribute("stroke-opacity",ve.o.v),(ve.w._mdf||Ae)&&(Ee.pElem.setAttribute("stroke-width",ve.w.v),Ee.msElem&&Ee.msElem.setAttribute("stroke-width",ve.w.v))}return{createRenderFunction:function(Pe){switch(Pe.ty){case"fl":return le;case"gf":return o;case"gs":return _e;case"st":return Te;case"sh":case"el":case"rc":case"sr":return ie;case"tr":return q;case"no":return J;default:return null}}}}();function SVGShapeElement(D,O,q){this.shapes=[],this.shapesData=D.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(D,O,q),this.prevViewData=[]}function LetterProps(D,O,q,J,ie,le){this.o=D,this.sw=O,this.sc=q,this.fc=J,this.m=ie,this.p=le,this._mdf={o:!0,sw:!!O,sc:!!q,fc:!!J,m:!0,p:!0}}function TextProperty(D,O){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,O.d&&O.d.sid&&(O.d=D.globalData.slotManager.getProp(O.d)),this.data=O,this.elem=D,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var D,O,q,J,ie=this.shapes.length,le=this.stylesList.length,_e=[],o=!1;for(q=0;q<le;q+=1){for(J=this.stylesList[q],o=!1,_e.length=0,D=0;D<ie;D+=1)(O=this.shapes[D]).styles.indexOf(J)!==-1&&(_e.push(O),o=O._isAnimated||o);_e.length>1&&o&&this.setShapesAsAnimated(_e)}},SVGShapeElement.prototype.setShapesAsAnimated=function(D){var O,q=D.length;for(O=0;O<q;O+=1)D[O].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(D,O){var q,J=new SVGStyleData(D,O),ie=J.pElem;return D.ty==="st"?q=new SVGStrokeStyleData(this,D,J):D.ty==="fl"?q=new SVGFillStyleData(this,D,J):D.ty==="gf"||D.ty==="gs"?(q=new(D.ty==="gf"?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,D,J),this.globalData.defs.appendChild(q.gf),q.maskId&&(this.globalData.defs.appendChild(q.ms),this.globalData.defs.appendChild(q.of),ie.setAttribute("mask","url("+getLocationHref()+"#"+q.maskId+")"))):D.ty==="no"&&(q=new SVGNoStyleData(this,D,J)),D.ty!=="st"&&D.ty!=="gs"||(ie.setAttribute("stroke-linecap",lineCapEnum[D.lc||2]),ie.setAttribute("stroke-linejoin",lineJoinEnum[D.lj||2]),ie.setAttribute("fill-opacity","0"),D.lj===1&&ie.setAttribute("stroke-miterlimit",D.ml)),D.r===2&&ie.setAttribute("fill-rule","evenodd"),D.ln&&ie.setAttribute("id",D.ln),D.cl&&ie.setAttribute("class",D.cl),D.bm&&(ie.style["mix-blend-mode"]=getBlendMode(D.bm)),this.stylesList.push(J),this.addToAnimatedContents(D,q),q},SVGShapeElement.prototype.createGroupElement=function(D){var O=new ShapeGroupData;return D.ln&&O.gr.setAttribute("id",D.ln),D.cl&&O.gr.setAttribute("class",D.cl),D.bm&&(O.gr.style["mix-blend-mode"]=getBlendMode(D.bm)),O},SVGShapeElement.prototype.createTransformElement=function(D,O){var q=TransformPropertyFactory.getTransformProperty(this,D,this),J=new SVGTransformData(q,q.o,O);return this.addToAnimatedContents(D,J),J},SVGShapeElement.prototype.createShapeElement=function(D,O,q){var J=4;D.ty==="rc"?J=5:D.ty==="el"?J=6:D.ty==="sr"&&(J=7);var ie=new SVGShapeData(O,q,ShapePropertyFactory.getShapeProp(this,D,J,this));return this.shapes.push(ie),this.addShapeToModifiers(ie),this.addToAnimatedContents(D,ie),ie},SVGShapeElement.prototype.addToAnimatedContents=function(D,O){for(var q=0,J=this.animatedContents.length;q<J;){if(this.animatedContents[q].element===O)return;q+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(D),element:O,data:D})},SVGShapeElement.prototype.setElementStyles=function(D){var O,q=D.styles,J=this.stylesList.length;for(O=0;O<J;O+=1)this.stylesList[O].closed||q.push(this.stylesList[O])},SVGShapeElement.prototype.reloadShapes=function(){var D;this._isFirstFrame=!0;var O=this.itemsData.length;for(D=0;D<O;D+=1)this.prevViewData[D]=this.itemsData[D];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),O=this.dynamicProperties.length,D=0;D<O;D+=1)this.dynamicProperties[D].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(D,O,q,J,ie,le,_e){var o,Te,Pe,ve,Ae,Ee,Ie=[].concat(le),ye=D.length-1,ge=[],Se=[];for(o=ye;o>=0;o-=1){if((Ee=this.searchProcessedElement(D[o]))?O[o]=q[Ee-1]:D[o]._render=_e,D[o].ty==="fl"||D[o].ty==="st"||D[o].ty==="gf"||D[o].ty==="gs"||D[o].ty==="no")Ee?O[o].style.closed=!1:O[o]=this.createStyleElement(D[o],ie),D[o]._render&&O[o].style.pElem.parentNode!==J&&J.appendChild(O[o].style.pElem),ge.push(O[o].style);else if(D[o].ty==="gr"){if(Ee)for(Pe=O[o].it.length,Te=0;Te<Pe;Te+=1)O[o].prevViewData[Te]=O[o].it[Te];else O[o]=this.createGroupElement(D[o]);this.searchShapes(D[o].it,O[o].it,O[o].prevViewData,O[o].gr,ie+1,Ie,_e),D[o]._render&&O[o].gr.parentNode!==J&&J.appendChild(O[o].gr)}else D[o].ty==="tr"?(Ee||(O[o]=this.createTransformElement(D[o],J)),ve=O[o].transform,Ie.push(ve)):D[o].ty==="sh"||D[o].ty==="rc"||D[o].ty==="el"||D[o].ty==="sr"?(Ee||(O[o]=this.createShapeElement(D[o],Ie,ie)),this.setElementStyles(O[o])):D[o].ty==="tm"||D[o].ty==="rd"||D[o].ty==="ms"||D[o].ty==="pb"||D[o].ty==="zz"||D[o].ty==="op"?(Ee?(Ae=O[o]).closed=!1:((Ae=ShapeModifiers.getModifier(D[o].ty)).init(this,D[o]),O[o]=Ae,this.shapeModifiers.push(Ae)),Se.push(Ae)):D[o].ty==="rp"&&(Ee?(Ae=O[o]).closed=!0:(Ae=ShapeModifiers.getModifier(D[o].ty),O[o]=Ae,Ae.init(this,D,o,O),this.shapeModifiers.push(Ae),_e=!1),Se.push(Ae));this.addProcessedElement(D[o],o+1)}for(ye=ge.length,o=0;o<ye;o+=1)ge[o].closed=!0;for(ye=Se.length,o=0;o<ye;o+=1)Se[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var D;this.renderModifiers();var O=this.stylesList.length;for(D=0;D<O;D+=1)this.stylesList[D].reset();for(this.renderShape(),D=0;D<O;D+=1)(this.stylesList[D]._mdf||this._isFirstFrame)&&(this.stylesList[D].msElem&&(this.stylesList[D].msElem.setAttribute("d",this.stylesList[D].d),this.stylesList[D].d="M0 0"+this.stylesList[D].d),this.stylesList[D].pElem.setAttribute("d",this.stylesList[D].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var D,O,q=this.animatedContents.length;for(D=0;D<q;D+=1)O=this.animatedContents[D],(this._isFirstFrame||O.element._isAnimated)&&O.data!==!0&&O.fn(O.data,O.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},LetterProps.prototype.update=function(D,O,q,J,ie,le){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var _e=!1;return this.o!==D&&(this.o=D,this._mdf.o=!0,_e=!0),this.sw!==O&&(this.sw=O,this._mdf.sw=!0,_e=!0),this.sc!==q&&(this.sc=q,this._mdf.sc=!0,_e=!0),this.fc!==J&&(this.fc=J,this._mdf.fc=!0,_e=!0),this.m!==ie&&(this.m=ie,this._mdf.m=!0,_e=!0),!le.length||this.p[0]===le[0]&&this.p[1]===le[1]&&this.p[4]===le[4]&&this.p[5]===le[5]&&this.p[12]===le[12]&&this.p[13]===le[13]||(this.p=le,this._mdf.p=!0,_e=!0),_e},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(D,O){for(var q in O)Object.prototype.hasOwnProperty.call(O,q)&&(D[q]=O[q]);return D},TextProperty.prototype.setCurrentData=function(D){D.__complete||this.completeTextData(D),this.currentData=D,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(D){this.effectsSequence.push(D),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(D){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||D){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var O=this.currentData,q=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var J;this.lock=!0,this._mdf=!1;var ie=this.effectsSequence.length,le=D||this.data.d.k[this.keysIndex].s;for(J=0;J<ie;J+=1)le=q!==this.keysIndex?this.effectsSequence[J](le,le.t):this.effectsSequence[J](this.currentData,le.t);O!==le&&this.setCurrentData(le),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var D=this.data.d.k,O=this.elem.comp.renderedFrame,q=0,J=D.length;q<=J-1&&!(q===J-1||D[q+1].t>O);)q+=1;return this.keysIndex!==q&&(this.keysIndex=q),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(D){for(var O,q,J=[],ie=0,le=D.length,_e=!1,o=!1,Te="";ie<le;)_e=o,o=!1,O=D.charCodeAt(ie),Te=D.charAt(ie),FontManager.isCombinedCharacter(O)?_e=!0:O>=55296&&O<=56319?FontManager.isRegionalFlag(D,ie)?Te=D.substr(ie,14):(q=D.charCodeAt(ie+1))>=56320&&q<=57343&&(FontManager.isModifier(O,q)?(Te=D.substr(ie,2),_e=!0):Te=FontManager.isFlagEmoji(D.substr(ie,4))?D.substr(ie,4):D.substr(ie,2)):O>56319?(q=D.charCodeAt(ie+1),FontManager.isVariationSelector(O)&&(_e=!0)):FontManager.isZeroWidthJoiner(O)&&(_e=!0,o=!0),_e?(J[J.length-1]+=Te,_e=!1):J.push(Te),ie+=Te.length;return J},TextProperty.prototype.completeTextData=function(D){D.__complete=!0;var O,q,J,ie,le,_e,o,Te=this.elem.globalData.fontManager,Pe=this.data,ve=[],Ae=0,Ee=Pe.m.g,Ie=0,ye=0,ge=0,Se=[],Ce=0,Ve=0,at=Te.getFontByName(D.f),et=0,Mt=getFontProperties(at);D.fWeight=Mt.weight,D.fStyle=Mt.style,D.finalSize=D.s,D.finalText=this.buildFinalText(D.t),q=D.finalText.length,D.finalLineHeight=D.lh;var jt,St=D.tr/1e3*D.finalSize;if(D.sz)for(var Bt,Zt,xt=!0,wt=D.sz[0],Je=D.sz[1];xt;){Bt=0,Ce=0,q=(Zt=this.buildFinalText(D.t)).length,St=D.tr/1e3*D.finalSize;var ut=-1;for(O=0;O<q;O+=1)jt=Zt[O].charCodeAt(0),J=!1,Zt[O]===" "?ut=O:jt!==13&&jt!==3||(Ce=0,J=!0,Bt+=D.finalLineHeight||1.2*D.finalSize),Te.chars?(o=Te.getCharData(Zt[O],at.fStyle,at.fFamily),et=J?0:o.w*D.finalSize/100):et=Te.measureText(Zt[O],D.f,D.finalSize),Ce+et>wt&&Zt[O]!==" "?(ut===-1?q+=1:O=ut,Bt+=D.finalLineHeight||1.2*D.finalSize,Zt.splice(O,ut===O?1:0,"\r"),ut=-1,Ce=0):(Ce+=et,Ce+=St);Bt+=at.ascent*D.finalSize/100,this.canResize&&D.finalSize>this.minimumFontSize&&Je<Bt?(D.finalSize-=1,D.finalLineHeight=D.finalSize*D.lh/D.s):(D.finalText=Zt,q=D.finalText.length,xt=!1)}Ce=-St,et=0;var lt,Ye=0;for(O=0;O<q;O+=1)if(J=!1,(jt=(lt=D.finalText[O]).charCodeAt(0))===13||jt===3?(Ye=0,Se.push(Ce),Ve=Ce>Ve?Ce:Ve,Ce=-2*St,ie="",J=!0,ge+=1):ie=lt,Te.chars?(o=Te.getCharData(lt,at.fStyle,Te.getFontByName(D.f).fFamily),et=J?0:o.w*D.finalSize/100):et=Te.measureText(ie,D.f,D.finalSize),lt===" "?Ye+=et+St:(Ce+=et+St+Ye,Ye=0),ve.push({l:et,an:et,add:Ie,n:J,anIndexes:[],val:ie,line:ge,animatorJustifyOffset:0}),Ee==2){if(Ie+=et,ie===""||ie===" "||O===q-1){for(ie!==""&&ie!==" "||(Ie-=et);ye<=O;)ve[ye].an=Ie,ve[ye].ind=Ae,ve[ye].extra=et,ye+=1;Ae+=1,Ie=0}}else if(Ee==3){if(Ie+=et,ie===""||O===q-1){for(ie===""&&(Ie-=et);ye<=O;)ve[ye].an=Ie,ve[ye].ind=Ae,ve[ye].extra=et,ye+=1;Ie=0,Ae+=1}}else ve[Ae].ind=Ae,ve[Ae].extra=0,Ae+=1;if(D.l=ve,Ve=Ce>Ve?Ce:Ve,Se.push(Ce),D.sz)D.boxWidth=D.sz[0],D.justifyOffset=0;else switch(D.boxWidth=Ve,D.j){case 1:D.justifyOffset=-D.boxWidth;break;case 2:D.justifyOffset=-D.boxWidth/2;break;default:D.justifyOffset=0}D.lineWidths=Se;var pi,si,rt,kt,_i=Pe.a;_e=_i.length;var Yi=[];for(le=0;le<_e;le+=1){for((pi=_i[le]).a.sc&&(D.strokeColorAnim=!0),pi.a.sw&&(D.strokeWidthAnim=!0),(pi.a.fc||pi.a.fh||pi.a.fs||pi.a.fb)&&(D.fillColorAnim=!0),kt=0,rt=pi.s.b,O=0;O<q;O+=1)(si=ve[O]).anIndexes[le]=kt,(rt==1&&si.val!==""||rt==2&&si.val!==""&&si.val!==" "||rt==3&&(si.n||si.val==" "||O==q-1)||rt==4&&(si.n||O==q-1))&&(pi.s.rn===1&&Yi.push(kt),kt+=1);Pe.a[le].s.totalChars=kt;var Lr,Ii=-1;if(pi.s.rn===1)for(O=0;O<q;O+=1)Ii!=(si=ve[O]).anIndexes[le]&&(Ii=si.anIndexes[le],Lr=Yi.splice(Math.floor(Math.random()*Yi.length),1)[0]),si.anIndexes[le]=Lr}D.yOffset=D.finalLineHeight||1.2*D.finalSize,D.ls=D.ls||0,D.ascent=at.ascent*D.finalSize/100},TextProperty.prototype.updateDocumentData=function(D,O){O=O===void 0?this.keysIndex:O;var q=this.copyData({},this.data.d.k[O].s);q=this.copyData(q,D),this.data.d.k[O].s=q,this.recalculate(O),this.setCurrentData(q),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(D){var O=this.data.d.k[D].s;O.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(O)},TextProperty.prototype.canResizeFont=function(D){this.canResize=D,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(D){this.minimumFontSize=Math.floor(D)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var D=Math.max,O=Math.min,q=Math.floor;function J(ie,le){this._currentTextLength=-1,this.k=!1,this.data=le,this.elem=ie,this.comp=ie.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(ie),this.s=PropertyFactory.getProp(ie,le.s||{k:0},0,0,this),this.e="e"in le?PropertyFactory.getProp(ie,le.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(ie,le.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(ie,le.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(ie,le.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(ie,le.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(ie,le.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return J.prototype={getMult:function(ie){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var le=0,_e=0,o=1,Te=1;this.ne.v>0?le=this.ne.v/100:_e=-this.ne.v/100,this.xe.v>0?o=1-this.xe.v/100:Te=1+this.xe.v/100;var Pe=BezierFactory.getBezierEasing(le,_e,o,Te).get,ve=0,Ae=this.finalS,Ee=this.finalE,Ie=this.data.sh;if(Ie===2)ve=Pe(ve=Ee===Ae?ie>=Ee?1:0:D(0,O(.5/(Ee-Ae)+(ie-Ae)/(Ee-Ae),1)));else if(Ie===3)ve=Pe(ve=Ee===Ae?ie>=Ee?0:1:1-D(0,O(.5/(Ee-Ae)+(ie-Ae)/(Ee-Ae),1)));else if(Ie===4)Ee===Ae?ve=0:(ve=D(0,O(.5/(Ee-Ae)+(ie-Ae)/(Ee-Ae),1)))<.5?ve*=2:ve=1-2*(ve-.5),ve=Pe(ve);else if(Ie===5){if(Ee===Ae)ve=0;else{var ye=Ee-Ae,ge=-ye/2+(ie=O(D(0,ie+.5-Ae),Ee-Ae)),Se=ye/2;ve=Math.sqrt(1-ge*ge/(Se*Se))}ve=Pe(ve)}else Ie===6?(Ee===Ae?ve=0:(ie=O(D(0,ie+.5-Ae),Ee-Ae),ve=(1+Math.cos(Math.PI+2*Math.PI*ie/(Ee-Ae)))/2),ve=Pe(ve)):(ie>=q(Ae)&&(ve=D(0,O(ie-Ae<0?O(Ee,1)-(Ae-ie):Ee-ie,1))),ve=Pe(ve));if(this.sm.v!==100){var Ce=.01*this.sm.v;Ce===0&&(Ce=1e-8);var Ve=.5-.5*Ce;ve<Ve?ve=0:(ve=(ve-Ve)/Ce)>1&&(ve=1)}return ve*this.a.v},getValue:function(ie){this.iterateDynamicProperties(),this._mdf=ie||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,ie&&this.data.r===2&&(this.e.v=this._currentTextLength);var le=this.data.r===2?1:100/this.data.totalChars,_e=this.o.v/le,o=this.s.v/le+_e,Te=this.e.v/le+_e;if(o>Te){var Pe=o;o=Te,Te=Pe}this.finalS=o,this.finalE=Te}},extendPrototype([DynamicPropertyContainer],J),{getTextSelectorProp:function(ie,le,_e){return new J
vendor: 4,686 bytes, line 18
18(ie,le)}}}();function TextAnimatorDataProperty(D,O,q){var J={propType:!1},ie=PropertyFactory.getProp,le=O.a;this.a={r:le.r?ie(D,le.r,0,degToRads,q):J,rx:le.rx?ie(D,le.rx,0,degToRads,q):J,ry:le.ry?ie(D,le.ry,0,degToRads,q):J,sk:le.sk?ie(D,le.sk,0,degToRads,q):J,sa:le.sa?ie(D,le.sa,0,degToRads,q):J,s:le.s?ie(D,le.s,1,.01,q):J,a:le.a?ie(D,le.a,1,0,q):J,o:le.o?ie(D,le.o,0,.01,q):J,p:le.p?ie(D,le.p,1,0,q):J,sw:le.sw?ie(D,le.sw,0,0,q):J,sc:le.sc?ie(D,le.sc,1,0,q):J,fc:le.fc?ie(D,le.fc,1,0,q):J,fh:le.fh?ie(D,le.fh,0,0,q):J,fs:le.fs?ie(D,le.fs,0,.01,q):J,fb:le.fb?ie(D,le.fb,0,.01,q):J,t:le.t?ie(D,le.t,0,0,q):J},this.s=TextSelectorProp.getTextSelectorProp(D,O.s,q),this.s.t=O.s.t}function TextAnimatorProperty(D,O,q){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=D,this._renderType=O,this._elem=q,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(q)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var D,O,q=this._textData.a.length,J=PropertyFactory.getProp;for(D=0;D<q;D+=1)O=this._textData.a[D],this._animatorsData[D]=new TextAnimatorDataProperty(this._elem,O,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:J(this._elem,this._textData.p.a,0,0,this),f:J(this._elem,this._textData.p.f,0,0,this),l:J(this._elem,this._textData.p.l,0,0,this),r:J(this._elem,this._textData.p.r,0,0,this),p:J(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=J(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(D,O){if(this.lettersChangedFlag=O,this._mdf||this._isFirstFrame||O||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var q,J,ie,le,_e,o,Te,Pe,ve,Ae,Ee,Ie,ye,ge,Se,Ce,Ve,at,et,Mt=this._moreOptions.alignment.v,jt=this._animatorsData,St=this._textData,Bt=this.mHelper,Zt=this._renderType,xt=this.renderedLetters.length,wt=D.l;if(this._hasMaskedPath){if(et=this._pathData.m,!this._pathData.n||this._pathData._mdf){var Je,ut=et.v;for(this._pathData.r.v&&(ut=ut.reverse()),_e={tLength:0,segments:[]},le=ut._length-1,Ce=0,ie=0;ie<le;ie+=1)Je=bez.buildBezierData(ut.v[ie],ut.v[ie+1],[ut.o[ie][0]-ut.v[ie][0],ut.o[ie][1]-ut.v[ie][1]],[ut.i[ie+1][0]-ut.v[ie+1][0],ut.i[ie+1][1]-ut.v[ie+1][1]]),_e.tLength+=Je.segmentLength,_e.segments.push(Je),Ce+=Je.segmentLength;ie=le,et.v.c&&(Je=bez.buildBezierData(ut.v[ie],ut.v[0],[ut.o[ie][0]-ut.v[ie][0],ut.o[ie][1]-ut.v[ie][1]],[ut.i[0][0]-ut.v[0][0],ut.i[0][1]-ut.v[0][1]]),_e.tLength+=Je.segmentLength,_e.segments.push(Je),Ce+=Je.segmentLength),this._pathData.pi=_e}if(_e=this._pathData.pi,o=this._pathData.f.v,Ee=0,Ae=1,Pe=0,ve=!0,ge=_e.segments,o<0&&et.v.c)for(_e.tLength<Math.abs(o)&&(o=-Math.abs(o)%_e.tLength),Ae=(ye=ge[Ee=ge.length-1].points).length-1;o<0;)o+=ye[Ae].partialLength,(Ae-=1)<0&&(Ae=(ye=ge[Ee-=1].points).length-1);Ie=(ye=ge[Ee].points)[Ae-1],Se=(Te=ye[Ae]).partialLength}le=wt.length,q=0,J=0;var lt,Ye,pi,si,rt,kt=1.2*D.finalSize*.714,_i=!0;pi=jt.length;var Yi,Lr,Ii,en,Rr,Jr,kr,Pr,An,pt,pn,Mn,fn=-1,Ht=o,on=Ee,tn=Ae,Kn=-1,Xi="",Gr=this.defaultPropsArray;if(D.j===2||D.j===1){var Hr=0,Rn=0,Nn=D.j===2?-.5:-1,Le=0,Ue=!0;for(ie=0;ie<le;ie+=1)if(wt[ie].n){for(Hr&&(Hr+=Rn);Le<ie;)wt[Le].animatorJustifyOffset=Hr,Le+=1;Hr=0,Ue=!0}else{for(Ye=0;Ye<pi;Ye+=1)(lt=jt[Ye].a).t.propType&&(Ue&&D.j===2&&(Rn+=lt.t.v*Nn),(rt=jt[Ye].s.getMult(wt[ie].anIndexes[Ye],St.a[Ye].s.totalChars)).length?Hr+=lt.t.v*rt[0]*Nn:Hr+=lt.t.v*rt*Nn);Ue=!1}for(Hr&&(Hr+=Rn);Le<ie;)wt[Le].animatorJustifyOffset=Hr,Le+=1}for(ie=0;ie<le;ie+=1){if(Bt.reset(),en=1,wt[ie].n)q=0,J+=D.yOffset,J+=_i?1:0,o=Ht,_i=!1,this._hasMaskedPath&&(Ae=tn,Ie=(ye=ge[Ee=on].points)[Ae-1],Se=(Te=ye[Ae]).partialLength,Pe=0),Xi="",pn="",An="",Mn="",Gr=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Kn!==wt[ie].line){switch(D.j){case 1:o+=Ce-D.lineWidths[wt[ie].line];break;case 2:o+=(Ce-D.lineWidths[wt[ie].line])/2}Kn=wt[ie].line}fn!==wt[ie].ind&&(wt[fn]&&(o+=wt[fn].extra),o+=wt[ie].an/2,fn=wt[ie].ind),o+=Mt[0]*wt[ie].an*.005;var bt=0;for(Ye=0;Ye<pi;Ye+=1)(lt=jt[Ye].a).p.propType&&((rt=jt[Ye].s.getMult(wt[ie].anIndexes[Ye],St.a[Ye].s.totalChars)).length?bt+=lt.p.v[0]*rt[0]:bt+=lt.p.v[0]*rt),lt.a.propType&&((rt=jt[Ye].s.getMult(wt[ie].anIndexes[Ye],St.a[Ye].s.totalChars)).length?bt+=lt.a.v[0]*rt[0]:bt+=lt.a.v[0]*rt);for(ve=!0,this._pathData.a.v&&(o=.5*wt[0].an+(Ce-this._pathData.f.v-.5*wt[0].an-.5*wt[wt.length-1].an)*fn/(le-1),o+=this._pathData.f.v);ve;)Pe+Se>
vendor: 13,984 bytes, line 18
18=o+bt||!ye?(Ve=(o+bt-Pe)/Te.partialLength,Lr=Ie.point[0]+(Te.point[0]-Ie.point[0])*Ve,Ii=Ie.point[1]+(Te.point[1]-Ie.point[1])*Ve,Bt.translate(-Mt[0]*wt[ie].an*.005,-Mt[1]*kt*.01),ve=!1):ye&&(Pe+=Te.partialLength,(Ae+=1)>=ye.length&&(Ae=0,ge[Ee+=1]?ye=ge[Ee].points:et.v.c?(Ae=0,ye=ge[Ee=0].points):(Pe-=Te.partialLength,ye=null)),ye&&(Ie=Te,Se=(Te=ye[Ae]).partialLength));Yi=wt[ie].an/2-wt[ie].add,Bt.translate(-Yi,0,0)}else Yi=wt[ie].an/2-wt[ie].add,Bt.translate(-Yi,0,0),Bt.translate(-Mt[0]*wt[ie].an*.005,-Mt[1]*kt*.01,0);for(Ye=0;Ye<pi;Ye+=1)(lt=jt[Ye].a).t.propType&&(rt=jt[Ye].s.getMult(wt[ie].anIndexes[Ye],St.a[Ye].s.totalChars),q===0&&D.j===0||(this._hasMaskedPath?rt.length?o+=lt.t.v*rt[0]:o+=lt.t.v*rt:rt.length?q+=lt.t.v*rt[0]:q+=lt.t.v*rt));for(D.strokeWidthAnim&&(Jr=D.sw||0),D.strokeColorAnim&&(Rr=D.sc?[D.sc[0],D.sc[1],D.sc[2]]:[0,0,0]),D.fillColorAnim&&D.fc&&(kr=[D.fc[0],D.fc[1],D.fc[2]]),Ye=0;Ye<pi;Ye+=1)(lt=jt[Ye].a).a.propType&&((rt=jt[Ye].s.getMult(wt[ie].anIndexes[Ye],St.a[Ye].s.totalChars)).length?Bt.translate(-lt.a.v[0]*rt[0],-lt.a.v[1]*rt[1],lt.a.v[2]*rt[2]):Bt.translate(-lt.a.v[0]*rt,-lt.a.v[1]*rt,lt.a.v[2]*rt));for(Ye=0;Ye<pi;Ye+=1)(lt=jt[Ye].a).s.propType&&((rt=jt[Ye].s.getMult(wt[ie].anIndexes[Ye],St.a[Ye].s.totalChars)).length?Bt.scale(1+(lt.s.v[0]-1)*rt[0],1+(lt.s.v[1]-1)*rt[1],1):Bt.scale(1+(lt.s.v[0]-1)*rt,1+(lt.s.v[1]-1)*rt,1));for(Ye=0;Ye<pi;Ye+=1){if(lt=jt[Ye].a,rt=jt[Ye].s.getMult(wt[ie].anIndexes[Ye],St.a[Ye].s.totalChars),lt.sk.propType&&(rt.length?Bt.skewFromAxis(-lt.sk.v*rt[0],lt.sa.v*rt[1]):Bt.skewFromAxis(-lt.sk.v*rt,lt.sa.v*rt)),lt.r.propType&&(rt.length?Bt.rotateZ(-lt.r.v*rt[2]):Bt.rotateZ(-lt.r.v*rt)),lt.ry.propType&&(rt.length?Bt.rotateY(lt.ry.v*rt[1]):Bt.rotateY(lt.ry.v*rt)),lt.rx.propType&&(rt.length?Bt.rotateX(lt.rx.v*rt[0]):Bt.rotateX(lt.rx.v*rt)),lt.o.propType&&(rt.length?en+=(lt.o.v*rt[0]-en)*rt[0]:en+=(lt.o.v*rt-en)*rt),D.strokeWidthAnim&&lt.sw.propType&&(rt.length?Jr+=lt.sw.v*rt[0]:Jr+=lt.sw.v*rt),D.strokeColorAnim&&lt.sc.propType)for(Pr=0;Pr<3;Pr+=1)rt.length?Rr[Pr]+=(lt.sc.v[Pr]-Rr[Pr])*rt[0]:Rr[Pr]+=(lt.sc.v[Pr]-Rr[Pr])*rt;if(D.fillColorAnim&&D.fc){if(lt.fc.propType)for(Pr=0;Pr<3;Pr+=1)rt.length?kr[Pr]+=(lt.fc.v[Pr]-kr[Pr])*rt[0]:kr[Pr]+=(lt.fc.v[Pr]-kr[Pr])*rt;lt.fh.propType&&(kr=rt.length?addHueToRGB(kr,lt.fh.v*rt[0]):addHueToRGB(kr,lt.fh.v*rt)),lt.fs.propType&&(kr=rt.length?addSaturationToRGB(kr,lt.fs.v*rt[0]):addSaturationToRGB(kr,lt.fs.v*rt)),lt.fb.propType&&(kr=rt.length?addBrightnessToRGB(kr,lt.fb.v*rt[0]):addBrightnessToRGB(kr,lt.fb.v*rt))}}for(Ye=0;Ye<pi;Ye+=1)(lt=jt[Ye].a).p.propType&&(rt=jt[Ye].s.getMult(wt[ie].anIndexes[Ye],St.a[Ye].s.totalChars),this._hasMaskedPath?rt.length?Bt.translate(0,lt.p.v[1]*rt[0],-lt.p.v[2]*rt[1]):Bt.translate(0,lt.p.v[1]*rt,-lt.p.v[2]*rt):rt.length?Bt.translate(lt.p.v[0]*rt[0],lt.p.v[1]*rt[1],-lt.p.v[2]*rt[2]):Bt.translate(lt.p.v[0]*rt,lt.p.v[1]*rt,-lt.p.v[2]*rt));if(D.strokeWidthAnim&&(An=Jr<0?0:Jr),D.strokeColorAnim&&(pt="rgb("+Math.round(255*Rr[0])+","+Math.round(255*Rr[1])+","+Math.round(255*Rr[2])+")"),D.fillColorAnim&&D.fc&&(pn="rgb("+Math.round(255*kr[0])+","+Math.round(255*kr[1])+","+Math.round(255*kr[2])+")"),this._hasMaskedPath){if(Bt.translate(0,-D.ls),Bt.translate(0,Mt[1]*kt*.01+J,0),this._pathData.p.v){at=(Te.point[1]-Ie.point[1])/(Te.point[0]-Ie.point[0]);var It=180*Math.atan(at)/Math.PI;Te.point[0]<Ie.point[0]&&(It+=180),Bt.rotate(-It*Math.PI/180)}Bt.translate(Lr,Ii,0),o-=Mt[0]*wt[ie].an*.005,wt[ie+1]&&fn!==wt[ie+1].ind&&(o+=wt[ie].an/2,o+=.001*D.tr*D.finalSize)}else{switch(Bt.translate(q,J,0),D.ps&&Bt.translate(D.ps[0],D.ps[1]+D.ascent,0),D.j){case 1:Bt.translate(wt[ie].animatorJustifyOffset+D.justifyOffset+(D.boxWidth-D.lineWidths[wt[ie].line]),0,0);break;case 2:Bt.translate(wt[ie].animatorJustifyOffset+D.justifyOffset+(D.boxWidth-D.lineWidths[wt[ie].line])/2,0,0)}Bt.translate(0,-D.ls),Bt.translate(Yi,0,0),Bt.translate(Mt[0]*wt[ie].an*.005,Mt[1]*kt*.01,0),q+=wt[ie].l+.001*D.tr*D.finalSize}Zt==="html"?Xi=Bt.toCSS():Zt==="svg"?Xi=Bt.to2dCSS():Gr=[Bt.props[0],Bt.props[1],Bt.props[2],Bt.props[3],Bt.props[4],Bt.props[5],Bt.props[6],Bt.props[7],Bt.props[8],Bt.props[9],Bt.props[10],Bt.props[11],Bt.props[12],Bt.props[13],Bt.props[14],Bt.props[15]],Mn=en}xt<=ie?(si=new LetterProps(Mn,An,pt,pn,Xi,Gr),this.renderedLetters.push(si),xt+=1,this.lettersChangedFlag=!0):(si=this.renderedLetters[ie],this.lettersChangedFlag=si.update(Mn,An,pt,pn,Xi,Gr)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),ITextElement.prototype.initElement=function(D,O,q){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(D,O,q),this.textProperty=new TextProperty(this,D.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(D.t,this.renderType,this),this.initTransform(D,O,q),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(D){this._mdf=!1,this.prepareRenderableFrame(D),this.prepareProperties(D,this.isInRange)},ITextElement.prototype.createPathShape=function(D,O){var q,J,ie=O.length,le="";for(q=0;q<ie;q+=1)O[q].ty==="sh"&&(J=O[q].ks.k,le+=buildShapeString(J,J.i.length,!0,D));return le},ITextElement.prototype.updateDocumentData=function(D,O){this.textProperty.updateDocumentData(D,O)},ITextElement.prototype.canResizeFont=function(D){this.textProperty.canResizeFont(D)},ITextElement.prototype.setMinimumFontSize=function(D){this.textProperty.setMinimumFontSize(D)},ITextElement.prototype.applyTextPropertiesToMatrix=function(D,O,q,J,ie){switch(D.ps&&O.translate(D.ps[0],D.ps[1]+D.ascent,0),O.translate(0,-D.ls,0),D.j){case 1:O.translate(D.justifyOffset+(D.boxWidth-D.lineWidths[q]),0,0);break;case 2:O.translate(D.justifyOffset+(D.boxWidth-D.lineWidths[q])/2,0,0)}O.translate(J,ie,0)},ITextElement.prototype.buildColor=function(D){return"rgb("+Math.round(255*D[0])+","+Math.round(255*D[1])+","+Math.round(255*D[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},ITextElement.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var emptyShapeData={shapes:[]};function SVGTextLottieElement(D,O,q){this.textSpans=[],this.renderType="svg",this.initElement(D,O,q)}function ISolidElement(D,O,q){this.initElement(D,O,q)}function NullElement(D,O,q){this.initFrame(),this.initBaseData(D,O,q),this.initFrame(),this.initTransform(D,O,q),this.initHierarchy()}function SVGRendererBase(){}function ICompElement(){}function SVGCompElement(D,O,q){this.layers=D.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(D,O,q),this.tm=D.tm?PropertyFactory.getProp(this,D.tm,0,O.frameRate,this):{_placeholder:!0}}function SVGRenderer(D,O){this.animationItem=D,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var q="";if(O&&O.title){var J=createNS("title"),ie=createElementID();J.setAttribute("id",ie),J.textContent=O.title,this.svgElement.appendChild(J),q+=ie}if(O&&O.description){var le=createNS("desc"),_e=createElementID();le.setAttribute("id",_e),le.textContent=O.description,this.svgElement.appendChild(le),q+=" "+_e}q&&this.svgElement.setAttribute("aria-labelledby",q);var o=createNS("defs");this.svgElement.appendChild(o);var Te=createNS("g");this.svgElement.appendChild(Te),this.layerElement=Te,this.renderConfig={preserveAspectRatio:O&&O.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:O&&O.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:O&&O.contentVisibility||"visible",progressiveLoad:O&&O.progressiveLoad||!1,hideOnTransparent:!(O&&O.hideOnTransparent===!1),viewBoxOnly:O&&O.viewBoxOnly||!1,viewBoxSize:O&&O.viewBoxSize||!1,className:O&&O.className||"",id:O&&O.id||"",focusable:O&&O.focusable,filterSize:{width:O&&O.filterSize&&O.filterSize.width||"100%",height:O&&O.filterSize&&O.filterSize.height||"100%",x:O&&O.filterSize&&O.filterSize.x||"0%",y:O&&O.filterSize&&O.filterSize.y||"0%"},width:O&&O.width,height:O&&O.height,runExpressions:!O||O.runExpressions===void 0||O.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(D){for(var O=0,q=D.length,J=[],ie="";O<q;)D[O]==="\r"||D[O]==="�"?(J.push(ie),ie=""):ie+=D[O],O+=1;return J.push(ie),J},SVGTextLottieElement.prototype.buildShapeData=function(D,O){if(D.shapes&&D.shapes.length){var q=D.shapes[0];if(q.it){var J=q.it[q.it.length-1];J.s&&(J.s.k[0]=O,J.s.k[1]=O)}}return D},SVGTextLottieElement.prototype.buildNewText=function(){var D,O;this.addDynamicProperty(this);var q=this.textProperty.currentData;this.renderedLetters=createSizedArray(q?q.l.length:0),q.fc?this.layerElement.setAttribute("fill",this.buildColor(q.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),q.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(q.sc)),this.layerElement.setAttribute("stroke-width",q.sw)),this.layerElement.setAttribute("font-size",q.finalSize);var J=this.globalData.fontManager.getFontByName(q.f);if(J.fClass)this.layerElement.setAttribute("class",J.fClass);else{this.layerElement.setAttribute("font-family",J.fFamily);var ie=q.fWeight,le=q.fStyle;this.layerElement.setAttribute("font-style",le),this.layerElement.setAttribute("font-weight",ie)}this.layerElement.setAttribute("aria-label",q.t);var _e,o=q.l||[],Te=!!this.globalData.fontManager.chars;O=o.length;var Pe=this.mHelper,ve=this.data.singleShape,Ae=0,Ee=0,Ie=!0,ye=.001*q.tr*q.finalSize;if(!ve||Te||q.sz){var ge,Se=this.textSpans.length;for(D=0;D<O;D+=1){if(this.textSpans[D]||(this.textSpans[D]={span:null,childSpan:null,glyph:null}),!Te||!ve||D===0){if(_e=Se>D?this.textSpans[D].span:createNS(Te?"g":"text"),Se<=D){if(_e.setAttribute("stroke-linecap","butt"),_e.setAttribute("stroke-linejoin","round"),_e.setAttribute("stroke-miterlimit","4"),this.textSpans[D].span=_e,Te){var Ce=createNS("g");_e.appendChild(Ce),this.textSpans[D].childSpan=Ce}this.textSpans[D].span=_e,this.layerElement.appendChild(_e)}_e.style.display="inherit"}if(Pe.reset(),ve&&(o[D].n&&(Ae=-ye,Ee+=q.yOffset,Ee+=Ie?1:0,Ie=!1),this.applyTextPropertiesToMatrix(q,Pe,o[D].line,Ae,Ee),Ae+=o[D].l||0,Ae+=ye),Te){var Ve;if((ge=this.globalData.fontManager.getCharData(q.finalText[D],J.fStyle,this.globalData.fontManager.getFontByName(q.f).fFamily)).t===1)Ve=new SVGCompElement(ge.data,this.globalData,this);else{var at=emptyShapeData;ge.data&&ge.data.shapes&&(at=this.buildShapeData(ge.data,q.finalSize)),Ve=new SVGShapeElement(at,this.globalData,this)}if(this.textSpans[D].glyph){var et=this.textSpans[D].glyph;this.textSpans[D].childSpan.removeChild(et.layerElement),et.destroy()}this.textSpans[D].glyph=Ve,Ve._debug=!0,Ve.prepareFrame(0),Ve.renderFrame(),this.textSpans[D].childSpan.appendChild(Ve.layerElement),ge.t===1&&this.textSpans[D].childSpan.setAttribute("transform","scale("+q.finalSize/100+","+q.finalSize/100+")")}else ve&&_e.setAttribute("transform","translate("+Pe.props[12]+","+Pe.props[13]+")"),_e.textContent=o[D].val,_e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}ve&&_e&&_e.setAttribute("d","")}else{var Mt=this.textContainer,jt="start";switch(q.j){case 1:jt="end";break;case 2:jt="middle";break;default:jt="start"}Mt.setAttribute("text-anchor",jt),Mt.setAttribute("letter-spacing",ye);var St=this.buildTextContents(q.finalText);for(O=St.length,Ee=q.ps?q.ps[1]+q.ascent:0,D=0;D<O;D+=1)(_e=this.textSpans[D].span||createNS("tspan")).textContent=St[D],_e.setAttribute("x",0),_e.setAttribute("y",Ee),_e.style.display="inherit",Mt.appendChild(_e),this.textSpans[D]||(this.textSpans[D]={span:null,glyph:null}),this.textSpans[D].span=_e,Ee+=q.finalLineHeight;this.layerElement.appendChild(Mt)}for(;D<this.textSpans.length;)this.textSpans[D].span.style.display="none",D+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var D=this.layerElement.getBBox();this.bbox={top:D.y,left:D.x,width:D.width,height:D.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var D,O,q=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,D=0;D<q;D+=1)(O=this.textSpans[D].glyph)&&(O.prepareFrame(this.comp.renderedFrame-this.data.st),O._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var D,O;this._sizeChanged=!0;var q,J,ie,le=this.textAnimator.renderedLetters,_e=this.textProperty.currentData.l;for(O=_e.length,D=0;D<O;D+=1)_e[D].n||(q=le[D],J=this.textSpans[D].span,(ie=this.textSpans[D].glyph)&&ie.renderFrame(),q._mdf.m&&J.setAttribute("transform",q.m),q._mdf.o&&J.setAttribute("op
18acity",q.o),q._mdf.sw&&J.setAttribute("stroke-width",q.sw),q._mdf.sc&&J.setAttribute("stroke",q.sc),q._mdf.fc&&J.setAttribute("fill",q.fc))}},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var D=createNS("rect");D.setAttribute("width",this.data.sw),D.setAttribute("height",this.data.sh),D.setAttribute("fill",this.data.sc),this.layerElement.appendChild(D)},NullElement.prototype.prepareFrame=function(D){this.prepareProperties(D,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(D){return new NullElement(D,this.globalData,this)},SVGRendererBase.prototype.createShape=function(D){return new SVGShapeElement(D,this.globalData,this)},SVGRendererBase.prototype.createText=function(D){return new SVGTextLottieElement(D,this.globalData,this)},SVGRendererBase.prototype.createImage=function(D){return new IImageElement(D,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(D){return new ISolidElement(D,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(D){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+D.w+" "+D.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",D.w),this.svgElement.setAttribute("height",D.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),this.renderConfig.focusable!==void 0&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var O=this.globalData.defs;this.setupGlobalData(D,O),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=D;var q=createNS("clipPath"),J=createNS("rect");J.setAttribute("width",D.w),J.setAttribute("height",D.h),J.setAttribute("x",0),J.setAttribute("y",0);var ie=createElementID();q.setAttribute("id",ie),q.appendChild(J),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+ie+")"),O.appendChild(q),this.layers=D.layers,this.elements=createSizedArray(D.layers.length)},SVGRendererBase.prototype.destroy=function(){var D;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var O=this.layers?this.layers.length:0;for(D=0;D<O;D+=1)this.elements[D]&&this.elements[D].destroy&&this.elements[D].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(D){var O=0,q=this.layers.length;for(O=0;O<q;O+=1)if(this.layers[O].ind===D)return O;return-1},SVGRendererBase.prototype.buildItem=function(D){var O=this.elements;if(!O[D]&&this.layers[D].ty!==99){O[D]=!0;var q=this.createItem(this.layers[D]);if(O[D]=q,getExpressionsPlugin()&&(this.layers[D].ty===0&&this.globalData.projectInterface.registerComposition(q),q.initExpressions()),this.appendElementInPos(q,D),this.layers[D].tt){var J="tp"in this.layers[D]?this.findIndexByInd(this.layers[D].tp):D-1;if(J===-1)return;if(this.elements[J]&&this.elements[J]!==!0){var ie=O[J].getMatte(this.layers[D].tt);q.setMatte(ie)}else this.buildItem(J),this.addPendingElement(q)}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var D=this.pendingElements.pop();if(D.checkParenting(),D.data.tt)for(var O=0,q=this.elements.length;O<q;){if(this.elements[O]===D){var J="tp"in D.data?this.findIndexByInd(D.data.tp):O-1,ie=this.elements[J].getMatte(this.layers[O].tt);D.setMatte(ie);break}O+=1}}},SVGRendererBase.prototype.renderFrame=function(D){if(this.renderedFrame!==D&&!this.destroyed){var O;D===null?D=this.renderedFrame:this.renderedFrame=D,this.globalData.frameNum=D,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=D,this.globalData._mdf=!1;var q=this.layers.length;for(this.completeLayers||this.checkLayers(D),O=q-1;O>=0;O-=1)(this.completeLayers||this.elements[O])&&this.elements[O].prepareFrame(D-this.layers[O].st);if(this.globalData._mdf)for(O=0;O<q;O+=1)(this.completeLayers||this.elements[O])&&this.elements[O].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(D,O){var q=D.getBaseElement();if(q){for(var J,ie=0;ie<O;)this.elements[ie]&&this.elements[ie]!==!0&&this.elements[ie].getBaseElement()&&
vendor: 3,662 bytes, line 18
18(J=this.elements[ie].getBaseElement()),ie+=1;J?this.layerElement.insertBefore(q,J):this.layerElement.appendChild(q)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(D,O,q){this.initFrame(),this.initBaseData(D,O,q),this.initTransform(D,O,q),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&O.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(D){if(this._mdf=!1,this.prepareRenderableFrame(D),this.prepareProperties(D,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=D/this.data.sr;else{var O=this.tm.v;O===this.data.op&&(O=this.data.op-1),this.renderedFrame=O}var q,J=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),q=J-1;q>=0;q-=1)(this.completeLayers||this.elements[q])&&(this.elements[q].prepareFrame(this.renderedFrame-this.layers[q].st),this.elements[q]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var D,O=this.layers.length;for(D=0;D<O;D+=1)(this.completeLayers||this.elements[D])&&this.elements[D].renderFrame()},ICompElement.prototype.setElements=function(D){this.elements=D},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var D,O=this.layers.length;for(D=0;D<O;D+=1)this.elements[D]&&this.elements[D].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(D){return new SVGCompElement(D,this.globalData,this)},extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(D){return new SVGCompElement(D,this.globalData,this)},ShapeTransformManager.prototype={addTransformSequence:function(D){var O,q=D.length,J="_";for(O=0;O<q;O+=1)J+=D[O].transform.key+"_";var ie=this.sequences[J];return ie||(ie={transforms:[].concat(D),finalTransform:new Matrix,_mdf:!1},this.sequences[J]=ie,this.sequenceList.push(ie)),ie},processSequence:function(D,O){for(var q=0,J=D.transforms.length,ie=O;q<J&&!O;){if(D.transforms[q].transform.mProps._mdf){ie=!0;break}q+=1}if(ie)for(D.finalTransform.reset(),q=J-1;q>=0;q-=1)D.finalTransform.multiply(D.transforms[q].transform.mProps.v);D._mdf=ie},processSequences:function(D){var O,q=this.sequenceList.length;for(O=0;O<q;O+=1)this.processSequence(this.sequenceList[O],D)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function(){var D="__lottie_element_luma_buffer",O=null,q=null,J=null;function ie(){var le,_e,o;O||(le=createNS("svg"),_e=createNS("filter"),o=createNS("feColorMatrix"),_e.setAttribute("id",D),o.setAttribute("type","matrix"),o.setAttribute("color-interpolation-filters","sRGB"),o.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),_e.appendChild(o),le.appendChild(_e),le.setAttribute("id",D+"_svg"),featureSupport.svgLumaHidden&&(le.style.display="none"),J=le,document.body.appendChild(J),O=createTag("canvas"),(q=O.getContext("2d")).filter="url(#"+D+")",q.fillStyle="rgba(0,0,0,0)",q.fillRect(0,0,1,1))}return{load:ie,get:function(le){return O||ie(),O.width=le.width,O.height=le.height,q.filter="url
18(#"+D+")",O}}};function createCanvas(D,O){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(D,O);var q=createTag("canvas");return q.width=D,q.height=O,q}var assetLoader={loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas},registeredEffects={};function CVEffects(D){var O,q,J=D.data.ef?D.data.ef.length:0;for(this.filters=[],O=0;O<J;O+=1){q=null;var ie=D.data.ef[O].ty;registeredEffects[ie]&&(q=new registeredEffects[ie].effect(D.effectsManager.effectElements[O],D)),q&&this.filters.push(q)}this.filters.length&&D.addRenderableComponent(this)}function registerEffect(D,O){registeredEffects[D]={effect:O}}function CVMaskElement(D,O){var q;this.data=D,this.element=O,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var J=this.masksProperties.length,ie=!1;for(q=0;q<J;q+=1)this.masksProperties[q].mode!=="n"&&(ie=!0),this.viewData[q]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[q],3);this.hasMasks=ie,ie&&this.element.addRenderableComponent(this)}function CVBaseElement(){}CVEffects.prototype.renderFrame=function(D){var O,q=this.filters.length;for(O=0;O<q;O+=1)this.filters[O].renderFrame(D)},CVEffects.prototype.getEffects=function(D){var O,q=this.filters.length,J=[];for(O=0;O<q;O+=1)this.filters[O].type===D&&J.push(this.filters[O]);return J},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var D,O,q,J,ie=this.element.finalTransform.mat,le=this.element.canvasContext,_e=this.masksProperties.length;for(le.beginPath(),D=0;D<_e;D+=1)if(this.masksProperties[D].mode!=="n"){var o;this.masksProperties[D].inv&&(le.moveTo(0,0),le.lineTo(this.element.globalData.compSize.w,0),le.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),le.lineTo(0,this.element.globalData.compSize.h),le.lineTo(0,0)),J=this.viewData[D].v,O=ie.applyToPointArray(J.v[0][0],J.v[0][1],0),le.moveTo(O[0],O[1]);var Te=J._length;for(o=1;o<Te;o+=1)q=ie.applyToTriplePoints(J.o[o-1],J.i[o],J.v[o]),le.bezierCurveTo(q[0],q[1],q[2],q[3],q[4],q[5]);q=ie.applyToTriplePoints(J.o[o-1],J.i[0],J.v[0]),le.bezierCurveTo(q[0],q[1],q[2],q[3],q[4],q[5])}this.element.globalData.renderer.save(!0),le.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};function CVShapeData(D,O,q,J){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var ie,le=4;O.ty==="rc"?le=5:O.ty==="el"?le=6:O.ty==="sr"&&(le=7),this.sh=ShapePropertyFactory.getShapeProp(D,O,le,D);var _e,o=q.length;for(ie=0;ie<o;ie+=1)q[ie].closed||(_e={transforms:J.addTransformSequence(q[ie].transforms),trNodes:[]},this.styledShapes.push(_e),q[ie].elements.push(_e))}function CVShapeElement(D,O,q){this.shapes=[],this.shapesData=D.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(D,O,q)}function CVTextElement(D,O,q){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(D,O,q)}function CVImageElement(D,O,q){this.assetData=O.getAssetData(D.refId),this.img=O.imageLoader.getAsset(this.assetData),this.initElement(D,O,q)}function CVSolidElement(D,O,q){this.initElement(D,O,q)}function CanvasRendererBase(){}function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){var D;for(this.stack=[],this.cArrPos=0,this.cTr=new Matrix,D=0;D<15;D+=1){var O=new CanvasContext;this.stack[D]=O}
vendor: 1,467 bytes, line 18
18this._length=15,this.nativeContext=null,this.transformMat=new Matrix,this.currentOpacity=1,this.currentFillStyle="",this.appliedFillStyle="",this.currentStrokeStyle="",this.appliedStrokeStyle="",this.currentLineWidth="",this.appliedLineWidth="",this.currentLineCap="",this.appliedLineCap="",this.currentLineJoin="",this.appliedLineJoin="",this.appliedMiterLimit="",this.currentMiterLimit=""}function CVCompElement(D,O,q){this.completeLayers=!1,this.layers=D.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(D,O,q),this.tm=D.tm?PropertyFactory.getProp(this,D.tm,0,O.frameRate,this):{_placeholder:!0}}function CanvasRenderer(D,O){this.animationItem=D,this.renderConfig={clearCanvas:!O||O.clearCanvas===void 0||O.clearCanvas,context:O&&O.context||null,progressiveLoad:O&&O.progressiveLoad||!1,preserveAspectRatio:O&&O.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:O&&O.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:O&&O.contentVisibility||"visible",className:O&&O.className||"",id:O&&O.id||"",runExpressions:!O||O.runExpressions===void 0||O.runExpressions},this.renderConfig.dpr=O&&O.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=O&&O.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=ne
vendor: 8,754 bytes, line 18
18w Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}function HBaseElement(){}function HSolidElement(D,O,q){this.initElement(D,O,q)}function HShapeElement(D,O,q){this.shapes=[],this.shapesData=D.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(D,O,q),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(D,O,q){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(D,O,q)}function HCameraElement(D,O,q){this.initFrame(),this.initBaseData(D,O,q),this.initHierarchy();var J=PropertyFactory.getProp;if(this.pe=J(this,D.pe,0,0,this),D.ks.p.s?(this.px=J(this,D.ks.p.x,1,0,this),this.py=J(this,D.ks.p.y,1,0,this),this.pz=J(this,D.ks.p.z,1,0,this)):this.p=J(this,D.ks.p,1,0,this),D.ks.a&&(this.a=J(this,D.ks.a,1,0,this)),D.ks.or.k.length&&D.ks.or.k[0].to){var ie,le=D.ks.or.k.length;for(ie=0;ie<le;ie+=1)D.ks.or.k[ie].to=null,D.ks.or.k[ie].ti=null}this.or=J(this,D.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=J(this,D.ks.rx,0,degToRads,this),this.ry=J(this,D.ks.ry,0,degToRads,this),this.rz=J(this,D.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HImageElement(D,O,q){this.assetData=O.getAssetData(D.refId),this.initElement(D,O,q)}function HybridRendererBase(D,O){this.animationItem=D,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:O&&O.className||"",imagePreserveAspectRatio:O&&O.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(O&&O.hideOnTransparent===!1),filterSize:{width:O&&O.filterSize&&O.filterSize.width||"400%",height:O&&O.filterSize&&O.filterSize.height||"400%",x:O&&O.filterSize&&O.filterSize.x||"-100%",y:O&&O.filterSize&&O.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function HCompElement(D,O,q){this.layers=D.layers,this.supports3d=!D.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(D,O,q),this.tm=D.tm?PropertyFactory.getProp(this,D.tm,0,O.frameRate,this):{_placeholder:!0}}function HybridRenderer(D,O){this.animationItem=D,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:O&&O.className||"",imagePreserveAspectRatio:O&&O.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(O&&O.hideOnTransparent===!1),filterSize:{width:O&&O.filterSize&&O.filterSize.width||"400%",height:O&&O.filterSize&&O.filterSize.height||"400%",x:O&&O.filterSize&&O.filterSize.x||"-100%",y:O&&O.filterSize&&O.filterSize.y||"-100%"},runExpressions:!O||O.runExpressions===void 0||O.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){if(this.data.tt>=1){this.buffers=[];var D=this.globalData.canvasContext,O=assetLoader.createCanvas(D.canvas.width,D.canvas.height);this.buffers.push(O);var q=assetLoader.createCanvas(D.canvas.width,D.canvas.height);this.buffers.push(q),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var D=this.globalData;if(D.blendMode!==this.data.bm){D.blendMode=this.data.bm;var O=getBlendMode(this.data.bm);D.canvasContext.globalCompositeOperation=O}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(D){D.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var D=this.buffers[0].getContext("2d");this.clearCanvas(D),D.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var D=this.buffers[1],O=D.getContext("2d");if(this.clearCanvas(O),O.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var q=assetLoader.getLumaCanvas(this.canvasContext.canvas);q.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(q,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(D,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(D){if(!this.hidden&&!this.data.hd&&(this.data.td!==1||D)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var O=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(O),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(O),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(D,O){var q={data:D,type:D.ty,preTransforms:this.transformsManager.addTransformSequence(O),transforms:[],elements:[],closed:D.hd===!0},J={};if(D.ty==="fl"||D.ty==="st"?(J.c=PropertyFactory.getProp(this,D.c,1,255,this),J.c.k||(q.co="rgb("+bmFloor(J.c.v[0])+","+bmFloor(J.c.v[1])+","+bmFloor(J.c.v[2])+")")):D.ty!=="gf"&&D.ty!=="gs"||(J.s=PropertyFactory.getProp(this,D.s,1,null,this),J.e=PropertyFactory.getProp(this,D.e,1,null,this),J.h=PropertyFactory.getProp(this,D.h||{k:0},0,.01,this),J.a=PropertyFactory.getProp(this,D.a||{k:0},0,degToRads,this),J.g=new GradientProperty(this,D.g,this)),J.o=PropertyFactory.getProp(this,D.o,
vendor: 24,051 bytes, line 18
180,.01,this),D.ty==="st"||D.ty==="gs"){if(q.lc=lineCapEnum[D.lc||2],q.lj=lineJoinEnum[D.lj||2],D.lj==1&&(q.ml=D.ml),J.w=PropertyFactory.getProp(this,D.w,0,null,this),J.w.k||(q.wi=J.w.v),D.d){var ie=new DashProperty(this,D.d,"canvas",this);J.d=ie,J.d.k||(q.da=J.d.dashArray,q.do=J.d.dashoffset[0])}}else q.r=D.r===2?"evenodd":"nonzero";return this.stylesList.push(q),J.style=q,J},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(D){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,D.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,D,this)}}},CVShapeElement.prototype.createShapeElement=function(D){var O=new CVShapeData(this,D,this.stylesList,this.transformsManager);return this.shapes.push(O),this.addShapeToModifiers(O),O},CVShapeElement.prototype.reloadShapes=function(){var D;this._isFirstFrame=!0;var O=this.itemsData.length;for(D=0;D<O;D+=1)this.prevViewData[D]=this.itemsData[D];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),O=this.dynamicProperties.length,D=0;D<O;D+=1)this.dynamicProperties[D].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(D){var O,q=this.stylesList.length;for(O=0;O<q;O+=1)this.stylesList[O].closed||this.stylesList[O].transforms.push(D)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var D,O=this.stylesList.length;for(D=0;D<O;D+=1)this.stylesList[D].closed||this.stylesList[D].transforms.pop()},CVShapeElement.prototype.closeStyles=function(D){var O,q=D.length;for(O=0;O<q;O+=1)D[O].closed=!0},CVShapeElement.prototype.searchShapes=function(D,O,q,J,ie){var le,_e,o,Te,Pe,ve,Ae=D.length-1,Ee=[],Ie=[],ye=[].concat(ie);for(le=Ae;le>=0;le-=1){if((Te=this.searchProcessedElement(D[le]))?O[le]=q[Te-1]:D[le]._shouldRender=J,D[le].ty==="fl"||D[le].ty==="st"||D[le].ty==="gf"||D[le].ty==="gs")Te?O[le].style.closed=!1:O[le]=this.createStyleElement(D[le],ye),Ee.push(O[le].style);else if(D[le].ty==="gr"){if(Te)for(o=O[le].it.length,_e=0;_e<o;_e+=1)O[le].prevViewData[_e]=O[le].it[_e];else O[le]=this.createGroupElement(D[le]);this.searchShapes(D[le].it,O[le].it,O[le].prevViewData,J,ye)}else D[le].ty==="tr"?(Te||(ve=this.createTransformElement(D[le]),O[le]=ve),ye.push(O[le]),this.addTransformToStyleList(O[le])):D[le].ty==="sh"||D[le].ty==="rc"||D[le].ty==="el"||D[le].ty==="sr"?Te||(O[le]=this.createShapeElement(D[le])):D[le].ty==="tm"||D[le].ty==="rd"||D[le].ty==="pb"||D[le].ty==="zz"||D[le].ty==="op"?(Te?(Pe=O[le]).closed=!1:((Pe=ShapeModifiers.getModifier(D[le].ty)).init(this,D[le]),O[le]=Pe,this.shapeModifiers.push(Pe)),Ie.push(Pe)):D[le].ty==="rp"&&(Te?(Pe=O[le]).closed=!0:(Pe=ShapeModifiers.getModifier(D[le].ty),O[le]=Pe,Pe.init(this,D,le,O),this.shapeModifiers.push(Pe),J=!1),Ie.push(Pe));this.addProcessedElement(D[le],le+1)}for(this.removeTransformFromStyleList(),this.closeStyles(Ee),Ae=Ie.length,le=0;le<Ae;le+=1)Ie[le].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(D,O){(D._opMdf||O.op._mdf||this._isFirstFrame)&&(O.opacity=D.opacity,O.opacity*=O.op.v,O._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var D,O,q,J,ie,le,_e,o,Te,Pe=this.stylesList.length,ve=this.globalData.renderer,Ae=this.globalData.canvasContext;for(D=0;D<Pe;D+=1)if(((o=(Te=this.stylesList[D]).type)!=="st"&&o!=="gs"||Te.wi!==0)&&Te.data._shouldRender&&Te.coOp!==0&&this.globalData.currentGlobalAlpha!==0){for(ve.save(),le=Te.elements,o==="st"||o==="gs"?(ve.ctxStrokeStyle(o==="st"?Te.co:Te.grd),ve.ctxLineWidth(Te.wi),ve.ctxLineCap(Te.lc),ve.ctxLineJoin(Te.lj),ve.ctxMiterLimit(Te.ml||0)):ve.ctxFillStyle(o==="fl"?Te.co:Te.grd),ve.ctxOpacity(Te.coOp),o!=="st"&&o!=="gs"&&Ae.beginPath(),ve.ctxTransform(Te.preTransforms.finalTransform.props),q=le.length,O=0;O<q;O+=1){for(o!=="st"&&o!=="gs"||(Ae.beginPath(),Te.da&&(Ae.setLineDash(Te.da),Ae.lineDashOffset=Te.do)),ie=(_e=le[O].trNodes).length,J=0;J<ie;J+=1)_e[J].t==="m"?Ae.moveTo(_e[J].p[0],_e[J].p[1]):_e[J].t==="c"?Ae.bezierCurveTo(_e[J].pts[0],_e[J].pts[1],_e[J].pts[2],_e[J].pts[3],_e[J].pts[4],_e[J].pts[5]):Ae.closePath();o!=="st"&&o!=="gs"||(ve.ctxStroke(),Te.da&&Ae.setLineDash(this.dashResetter))}o!=="st"&&o!=="gs"&&this.globalData.renderer.ctxFill(Te.r),ve.restore()}},CVShapeElement.prototype.renderShape=function(D,O,q,J){var ie,le;for(le=D,ie=O.length-1;ie>=0;ie-=1)O[ie].ty==="tr"?(le=q[ie].transform,this.renderShapeTransform(D,le)):O[ie].ty==="sh"||O[ie].ty==="el"||O[ie].ty==="rc"||O[ie].ty==="sr"?this.renderPath(O[ie],q[ie]):O[ie].ty==="fl"?this.renderFill(O[ie],q[ie],le):O[ie].ty==="st"?this.renderStroke(O[ie],q[ie],le):O[ie].ty==="gf"||O[ie].ty==="gs"?this.renderGradientFill(O[ie],q[ie],le):O[ie].ty==="gr"?this.renderShape(le,O[ie].it,q[ie].it):O[ie].ty;J&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(D,O){if(this._isFirstFrame||O._mdf||D.transforms._mdf){var q,J,ie,le=D.trNodes,_e=O.paths,o=_e._length;le.length=0;var Te=D.transforms.finalTransform;for(ie=0;ie<o;ie+=1){var Pe=_e.shapes[ie];if(Pe&&Pe.v){for(J=Pe._length,q=1;q<J;q+=1)q===1&&le.push({t:"m",p:Te.applyToPointArray(Pe.v[0][0],Pe.v[0][1],0)}),le.push({t:"c",pts:Te.applyToTriplePoints(Pe.o[q-1],Pe.i[q],Pe.v[q])});J===1&&le.push({t:"m",p:Te.applyToPointArray(Pe.v[0][0],Pe.v[0][1],0)}),Pe.c&&J&&(le.push({t:"c",pts:Te.applyToTriplePoints(Pe.o[q-1],Pe.i[0],Pe.v[0])}),le.push({t:"z"}))}}D.trNodes=le}},CVShapeElement.prototype.renderPath=function(D,O){if(D.hd!==!0&&D._shouldRender){var q,J=O.styledShapes.length;for(q=0;q<J;q+=1)this.renderStyledShape(O.styledShapes[q],O.sh)}},CVShapeElement.prototype.renderFill=function(D,O,q){var J=O.style;(O.c._mdf||this._isFirstFrame)&&(J.co="rgb("+bmFloor(O.c.v[0])+","+bmFloor(O.c.v[1])+","+bmFloor(O.c.v[2])+")"),(O.o._mdf||q._opMdf||this._isFirstFrame)&&(J.coOp=O.o.v*q.opacity)},CVShapeElement.prototype.renderGradientFill=function(D,O,q){var J,ie=O.style;if(!ie.grd||O.g._mdf||O.s._mdf||O.e._mdf||D.t!==1&&(O.h._mdf||O.a._mdf)){var le,_e=this.globalData.canvasContext,o=O.s.v,Te=O.e.v;if(D.t===1)J=_e.createLinearGradient(o[0],o[1],Te[0],Te[1]);else{var Pe=Math.sqrt(Math.pow(o[0]-Te[0],2)+Math.pow(o[1]-Te[1],2)),ve=Math.atan2(Te[1]-o[1],Te[0]-o[0]),Ae=O.h.v;Ae>=1?Ae=.99:Ae<=-1&&(Ae=-.99);var Ee=Pe*Ae,Ie=Math.cos(ve+O.a.v)*Ee+o[0],ye=Math.sin(ve+O.a.v)*Ee+o[1];J=_e.createRadialGradient(Ie,ye,0,o[0],o[1],Pe)}var ge=D.g.p,Se=O.g.c,Ce=1;for(le=0;le<ge;le+=1)O.g._hasOpacity&&O.g._collapsable&&(Ce=O.g.o[2*le+1]),J.addColorStop(Se[4*le]/100,"rgba("+Se[4*le+1]+","+Se[4*le+2]+","+Se[4*le+3]+","+Ce+")");ie.grd=J}ie.coOp=O.o.v*q.opacity},CVShapeElement.prototype.renderStroke=function(D,O,q){var J=O.style,ie=O.d;ie&&(ie._mdf||this._isFirstFrame)&&(J.da=ie.dashArray,J.do=ie.dashoffset[0]),(O.c._mdf||this._isFirstFrame)&&(J.co="rgb("+bmFloor(O.c.v[0])+","+bmFloor(O.c.v[1])+","+bmFloor(O.c.v[2])+")"),(O.o._mdf||q._opMdf||this._isFirstFrame)&&(J.coOp=O.o.v*q.opacity),(O.w._mdf||this._isFirstFrame)&&(J.wi=O.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var D=this.textProperty.currentData;this.renderedLetters=createSizedArray(D.l?D.l.length:0);var O=!1;D.fc?(O=!0,this.values.fill=this.buildColor(D.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=O;var q=!1;D.sc&&(q=!0,this.values.stroke=this.buildColor(D.sc),this.values.sWidth=D.sw);var J,ie,le,_e,o,Te,Pe,ve,Ae,Ee,Ie,ye,ge=this.globalData.fontManager.getFontByName(D.f),Se=D.l,Ce=this.mHelper;this.stroke=q,this.values.fValue=D.finalSize+"px "+this.globalData.fontManager.getFontByName(D.f).fFamily,ie=D.finalText.length;var Ve=this.data.singleShape,at=.001*D.tr*D.finalSize,et=0,Mt=0,jt=!0,St=0;for(J=0;J<ie;J+=1){_e=(le=this.globalData.fontManager.getCharData(D.finalText[J],ge.fStyle,this.globalData.fontManager.getFontByName(D.f).fFamily))&&le.data||{},Ce.reset(),Ve&&Se[J].n&&(et=-at,Mt+=D.yOffset,Mt+=jt?1:0,jt=!1),Ae=(Pe=_e.shapes?_e.shapes[0].it:[]).length,Ce.scale(D.finalSize/100,D.finalSize/100),Ve&&this.applyTextPropertiesToMatrix(D,Ce,Se[J].line,et,Mt),Ie=createSizedArray(Ae-1);var Bt=0;for(ve=0;ve<Ae;ve+=1)if(Pe[ve].ty==="sh"){for(Te=Pe[ve].ks.k.i.length,Ee=Pe[ve].ks.k,ye=[],o=1;o<Te;o+=1)o===1&&ye.push(Ce.applyToX(Ee.v[0][0],Ee.v[0][1],0),Ce.applyToY(Ee.v[0][0],Ee.v[0][1],0)),ye.push(Ce.applyToX(Ee.o[o-1][0],Ee.o[o-1][1],0),Ce.applyToY(Ee.o[o-1][0],Ee.o[o-1][1],0),Ce.applyToX(Ee.i[o][0],Ee.i[o][1],0),Ce.applyToY(Ee.i[o][0],Ee.i[o][1],0),Ce.applyToX(Ee.v[o][0],Ee.v[o][1],0),Ce.applyToY(Ee.v[o][0],Ee.v[o][1],0));ye.push(Ce.applyToX(Ee.o[o-1][0],Ee.o[o-1][1],0),Ce.applyToY(Ee.o[o-1][0],Ee.o[o-1][1],0),Ce.applyToX(Ee.i[0][0],Ee.i[0][1],0),Ce.applyToY(Ee.i[0][0],Ee.i[0][1],0),Ce.applyToX(Ee.v[0][0],Ee.v[0][1],0),Ce.applyToY(Ee.v[0][0],Ee.v[0][1],0)),Ie[Bt]=ye,Bt+=1}Ve&&(et+=Se[J].l,et+=at),this.textSpans[St]?this.textSpans[St].elem=Ie:this.textSpans[St]={elem:Ie},St+=1}},CVTextElement.prototype.renderInnerContent=function(){var D,O,q,J,ie,le;this.validateText(),this.canvasContext.font=this.values.fValue,this.globalData.renderer.ctxLineCap("butt"),this.globalData.renderer.ctxLineJoin("miter"),this.globalData.renderer.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var _e,o=this.textAnimator.renderedLetters,Te=this.textProperty.currentData.l;O=Te.length;var Pe,ve,Ae=null,Ee=null,Ie=null,ye=this.globalData.renderer;for(D=0;D<O;D+=1)if(!Te[D].n){if((_e=o[D])&&(ye.save(),ye.ctxTransform(_e.p),ye.ctxOpacity(_e.o)),this.fill){for(_e&&_e.fc?Ae!==_e.fc&&(ye.ctxFillStyle(_e.fc),Ae=_e.fc):Ae!==this.values.fill&&(Ae=this.values.fill,ye.ctxFillStyle(this.values.fill)),J=(Pe=this.textSpans[D].elem).length,this.globalData.canvasContext.beginPath(),q=0;q<J;q+=1)for(le=(ve=Pe[q]).length,this.globalData.canvasContext.moveTo(ve[0],ve[1]),ie=2;ie<le;ie+=6)this.globalData.canvasContext.bezierCurveTo(ve[ie],ve[ie+1],ve[ie+2],ve[ie+3],ve[ie+4],ve[ie+5]);this.globalData.canvasContext.closePath(),ye.ctxFill()}if(this.stroke){for(_e&&_e.sw?Ie!==_e.sw&&(Ie=_e.sw,ye.ctxLineWidth(_e.sw)):Ie!==this.values.sWidth&&(Ie=this.values.sWidth,ye.ctxLineWidth(this.values.sWidth)),_e&&_e.sc?Ee!==_e.sc&&(Ee=_e.sc,ye.ctxStrokeStyle(_e.sc)):Ee!==this.values.stroke&&(Ee=this.values.stroke,ye.ctxStrokeStyle(this.values.stroke)),J=(Pe=this.textSpans[D].elem).length,this.globalData.canvasContext.beginPath(),q=0;q<J;q+=1)for(le=(ve=Pe[q]).length,this.globalData.canvasContext.moveTo(ve[0],ve[1]),ie=2;ie<le;ie+=6)this.globalData.canvasContext.bezierCurveTo(ve[ie],ve[ie+1],ve[ie+2],ve[ie+3],ve[ie+4],ve[ie+5]);this.globalData.canvasContext.closePath(),ye.ctxStroke()}_e&&this.globalData.renderer.restore()}},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var D=createTag("canvas");D.width=this.assetData.w,D.height=this.assetData.h;var O,q,J=D.getContext("2d"),ie=this.img.width,le=this.img.height,_e=ie/le,o=this.assetData.w/this.assetData.h,Te=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;_e>o&&Te==="xMidYMid slice"||_e<o&&Te!=="xMidYMid slice"?O=(q=le)*o:q=(O=ie)/o,J.drawImage(this.img,(ie-O)/2,(le-q)/2,O,q,0,0,this.assetData.w,this.assetData.h),this.img=D}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(D){return new CVShapeElement(D,this.globalData,this)},CanvasRendererBase.prototype.createText=function(D){return new CVTextElement(D,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(D){return new CVImageElement(D,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(D){return new CVSolidElement(D,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(D){D[0]===1&&D[1]===0&&D[4]===0&&D[5]===1&&D[12]===0&&D[13]===0||this.canvasContext.transform(D[0],D[1],D[4],D[5],D[12],D[13])},CanvasRendererBase.prototype.ctxOpacity=function(D){this.canvasContext.globalAlpha*=D<0?0:D},CanvasRendererBase.prototype.ctxFillStyle=function(D){this.canvasContext.fillStyle=D},CanvasRendererBase.prototype.ctxStrokeStyle=function(D){this.canvasContext.strokeStyle=D},CanvasRendererBase.prototype.ctxLineWidth=function(D){this.canvasContext.lineWidth=D},CanvasRendererBase.prototype.ctxLineCap=function(D){this.canvasContext.lineCap=D},CanvasRendererBase.prototype.ctxLineJoin=function(D){this.canvasContext.lineJoin=D},CanvasRendererBase.prototype.ctxMiterLimit=function(D){this.canvasContext.miterLimit=D},CanvasRendererBase.prototype.ctxFill=function(D){this.canvasContext.fill(D)},CanvasRendererBase.prototype.ctxFillRect=function(D,O,q,J){this.canvasContext.fillRect(D,O,q,J)},CanvasRendererBase.prototype.ctxStroke=function(){this.canvasContext.stroke()},CanvasRendererBase.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRendererBase.prototype.save=function(){this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(D){this.renderConfig.clearCanvas?(D&&(this.globalData.blendMode="source-over"),this.contextData.restore(D)):this.canvasContext.restore()},CanvasRendererBase.prototype.configAnimation=function(D){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var O=this.animationItem.container.style;O.width="100%",O.height="100%";var q="0px 0px 0px";O.transformOrigin=q,O.mozTransformOrigin=q,O.webkitTransformOrigin=q,O["-webkit-transform"]=q,O.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.contextData.setContext(this.canvasContext),this.data=D,this.layers=D.layers,this.transformCanvas={w:D.w,h:D.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(D,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(D.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(D,O){var q,J,ie,le;if(this.reset(),D?(q=D,J=O,this.canvasContext.canvas.width=q,this.canvasContext.canvas.height=J):(this.animationItem.wrapper&&this.animationItem.container?(q=this.animationItem.wrapper.offsetWidth,J=this.animationItem.wrapper.offsetHeight):(q=this.canvasContext.canvas.width,J=this.canvasContext.canvas.height),this.canvasContext.canvas.width=q*this.renderConfig.dpr,this.canvasContext.canvas.height=J*this.renderConfig.dpr),this.renderConfig.preserveAspectRatio.indexOf("meet")!==-1||this.renderConfig.preserveAspectRatio.indexOf("slice")!==-1){var _e=this.renderConfig.preserveAspectRatio.split(" "),o=_e[1]||"meet",Te=_e[0]||"xMidYMid",Pe=Te.substr(0,4),ve=Te.substr(4);ie=q/J,(le=this.transformCanvas.w/this.transformCanvas.h)>ie&&o==="meet"||le<ie&&o==="slice"?(this.transformCanvas.sx=q/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=q/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=J/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=J/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx=Pe==="xMid"&&(le<ie&&o==="meet"||le>ie&&o==="slice")?(q-this.transformCanvas.w*(J/this.transformCanvas.h))/2*this.renderConfig.dpr:Pe==="xMax"&&(le<ie&&o==="meet"||le>ie&&o==="slice")?(q-this.transformCanvas.w*(J/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty=ve==="YMid"&&(le>ie&&o==="meet"||le<ie&&o==="slice")?(J-this.transformCanvas.h*(q/this.transformCanvas.w))/2*this.renderConfig.dpr:ve==="YMax"&&(le>ie&&o==="meet"||le<ie&&o==="slice")?(J-this.transformCanvas.h*(q/this.transformCanvas.w))*this.renderConfig.dpr:0}else this.renderConfig.preserveAspectRatio==="none"?(this.transformCanvas.sx=q/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=J/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){var D;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),D=(this.layers?this.layers.length:0)-1;D>=0;D-=1)this.elements[D]&&this.elements[D].destroy&&this.elements[D].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(D,O){if((this.renderedFrame!==D||this.renderConfig.clearCanvas!==!0||O)&&!this.destroyed&&D!==-1){var q;this.renderedFrame=D,this.globalData.frameNum=D-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||O,this.globalData.projectInterface.currentFrame=D;var J=this.layers.length;for(this.completeLayers||this.checkLayers(D),q=J-1;q>=0;q-=1)(this.completeLayers||this.elements[q])&&this.elements[q].prepareFrame(D-this.layers[q].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),q=J-1;q>=0;q-=1)(this.completeLayers||this.elements[q])&&this.elements[q].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(D){var O=this.elements;if(!O[D]&&this.layers[D].ty!==99){var q=this.createItem(this.layers[D],this,this.globalData);O[D]=q,q.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},CVContextData.prototype.duplicate=function(){var D=2*this._length,O=0;for(O=this._length;O<D;O+=1)this.stack[O]=new CanvasContext;this._length=D},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.stack[this.cArrPos].opacity=1},CVContextData.prototype.restore=function(D){this.cArrPos-=1;var O,q=this.stack[this.cArrPos],J=q.transform,ie=this.cTr.props;for(O=0;O<16;O+=1)ie[O]=J[O];if(D){this.nativeContext.restore();var le=this.stack[this.cArrPos+1];this.appliedFillStyle=le.fillStyle,this.appliedStrokeStyle=le.strokeStyle,this.appliedLineWidth=le.lineWidth,this.appliedLineCap=le.lineCap,this.appliedLineJoin=le.lineJoin,this.appliedMiterLimit=le.miterLimit}this.nativeContext.setTransform(J[0],J[1],J[4],J[5],J[12],J[13]),(D||q.opacity!==-1&&this.currentOpacity!==q.opacity)&&(this.nativeContext.globalAlpha=q.opacity,this.currentOpacity=q.opacity),this.currentFillStyle=q.fillStyle,this.currentStrokeStyle=q.strokeStyle,this.currentLineWidth=q.lineWidth,this.currentLineCap=q.lineCap,this.currentLineJoin=q.lineJoin,this.currentMiterLimit=q.miterLimit},CVContextData.prototype.save=function(D){D&&this.nativeContext.save();var O=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var q,J=this.stack[this.cArrPos];for(q=0;q<16;q+=1)J.transform[q]=O[q];this.cArrPos+=1;var ie=this.stack[this.cArrPos];ie.opacity=J.opacity,ie.fillStyle=J.fillStyle,ie.strokeStyle=J.strokeStyle,ie.lineWidth=J.lineWidth,ie.lineCap=J.lineCap,ie.lineJoin=J.lineJoin,ie.miterLimit=J.miterLimit},CVContextData.prototype.setOpacity=function(D){this.stack[this.cArrPos].opacity=D},CVContextData.prototype.setContext=function(D){this.nativeContext=D},CVContextData.prototype.fillStyle=function(D){this.stack[this.cArrPos].fillStyle!==D&&(this.currentFillStyle=D,this.stack[this.cArrPos].fillStyle=D)},CVContextData.prototype.strokeStyle=function(D){this.stack[this.cArrPos].strokeStyle!==D&&(this.currentStrokeStyle=D,this.stack[this.cArrPos].strokeStyle=D)},CVContextData.prototype.lineWidth=function(D){this.stack[this.cArrPos].lineWidth!==D&&(this.currentLineWidth=D,this.stack[this.cArrPos].lineWidth=D)},CVContextData.prototype.lineCap=function(D){this.stack[this.cArrPos].lineCap!==D&&(this.currentLineCap=D,this.stack[this.cArrPos].lineCap=D)},CVContextData.prototype.lineJoin=function(D){this.stack[this.cArrPos].lineJoin!==D&&(this.currentLineJoin=D,this.stack[this.cArrPos].lineJoin=D)},CVContextData.prototype.miterLimit=function(D){this.stack[this.cArrPos].miterLimit!==D&&(this.currentMiterLimit=D,this.stack[this.cArrPos].miterLimit=D)},CVContextData.prototype.transform=function(D){this.transformMat.cloneFromProps(D);var O=this.cTr;this.transformMat.multiply(O),O.cloneFromProps(this.transformMat.props);var q=O.props;this.nativeContext.setTransform(q[0],q[1],q[4],q[5],q[12],q[13])},CVContextData.prototype.opacity=function(D){var O=this.stack[this.cArrPos].opacity;O*=D<0?0:D,this.stack[this.cArrPos].opacity!==O&&(this.currentOpacity!==D&&(this.nativeContext.globalAlpha=D,this.currentOpacity=D),this.stack[this.cArrPos].opacity=O)},CVContextData.prototype.fill=function(D){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fill(D)},CVContextData.prototype.fillRect=function(D,O,q,J){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fillRect(D,O,q,J)},CVContextData.prototype.stroke=function(){this.appliedStrokeStyle!==this.currentStrokeStyle&&(this.appliedStrokeStyle=this.currentStrokeStyle,this.nativeContext.strokeStyle=this.appliedStrokeStyle),this.appliedLineWi
vendor: 10,684 bytes, line 18
18dth!==this.currentLineWidth&&(this.appliedLineWidth=this.currentLineWidth,this.nativeContext.lineWidth=this.appliedLineWidth),this.appliedLineCap!==this.currentLineCap&&(this.appliedLineCap=this.currentLineCap,this.nativeContext.lineCap=this.appliedLineCap),this.appliedLineJoin!==this.currentLineJoin&&(this.appliedLineJoin=this.currentLineJoin,this.nativeContext.lineJoin=this.appliedLineJoin),this.appliedMiterLimit!==this.currentMiterLimit&&(this.appliedMiterLimit=this.currentMiterLimit,this.nativeContext.miterLimit=this.appliedMiterLimit),this.nativeContext.stroke()},extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var D,O=this.canvasContext;for(O.beginPath(),O.moveTo(0,0),O.lineTo(this.data.w,0),O.lineTo(this.data.w,this.data.h),O.lineTo(0,this.data.h),O.lineTo(0,0),O.clip(),D=this.layers.length-1;D>=0;D-=1)(this.completeLayers||this.elements[D])&&this.elements[D].renderFrame()},CVCompElement.prototype.destroy=function(){var D;for(D=this.layers.length-1;D>=0;D-=1)this.elements[D]&&this.elements[D].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(D){return new CVCompElement(D,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(D){return new CVCompElement(D,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode()},renderElement:function(){var D=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var O=this.finalTransform.mat.toCSS();D.transform=O,D.webkitTransform=O}this.finalTransform._opMdf&&(D.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var D;this.data.hasMask?((D=createNS("rect")).setAttribute("width",this.data.sw),D.setAttribute("height",this.data.sh),D.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((D=createTag("div")).style.width=this.data.sw+"px",D.style.height=this.data.sh+"px",D.style.backgroundColor=this.data.sc),this.layerElement.appendChild(D)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var D;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),D=this.svgElement;else{D=createNS("svg");var O=this.comp.data?this.comp.data:this.globalData.compSize;D.setAttribute("width",O.w),D.setAttribute("height",O.h),D.appendChild(this.shapesContainer),this.layerElement.appendChild(D)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=D},HShapeElement.prototype.getTransformedPoint=function(D,O){var q,J=D.length;for(q=0;q<J;q+=1)O=D[q].mProps.v.applyToPointArray(O[0],O[1],0);return O},HShapeElement.prototype.calculateShapeBoundingBox=function(D,O){var q,J,ie,le,_e,o=D.sh.v,Te=D.transformers,Pe=o._length;if(!(Pe<=1)){for(q=0;q<Pe-1;q+=1)J=this.getTransformedPoint(Te,o.v[q]),ie=this.getTransformedPoint(Te,o.o[q]),le=this.getTransformedPoint(Te,o.i[q+1]),_e=this.getTransformedPoint(Te,o.v[q+1]),this.checkBounds(J,ie,le,_e,O);o.c&&(J=this.getTransformedPoint(Te,o.v[q]),ie=this.getTransformedPoint(Te,o.o[q]),le=this.getTransformedPoint(Te,o.i[0]),_e=this.getTransformedPoint(Te,o.v[0]),this.checkBounds(J,ie,le,_e,O))}},HShapeElement.prototype.checkBounds=function(D,O,q,J,ie){this.getBoundsOfCurve(D,O,q,J);var le=this.shapeBoundingBox;ie.x=bmMin(le.left,ie.x),ie.xMax=bmMax(le.right,ie.xMax),ie.y=bmMin(le.top,ie.y),ie.yMax=bmMax(le.bottom,ie.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(D,O,q,J){for(var ie,le,_e,o,Te,Pe,ve,Ae=[[D[0],J[0]],[D[1],J[1]]],Ee=0;Ee<2;++Ee)le=6*D[Ee]-12*O[Ee]+6*q[Ee],ie=-3*D[Ee]+9*O[Ee]-9*q[Ee]+3*J[Ee],_e=3*O[Ee]-3*D[Ee],le|=0,_e|=0,(ie|=0)==0&&le===0||(ie===0?(o=-_e/le)>0&&o<1&&Ae[Ee].push(this.calculateF(o,D,O,q,J,Ee)):(Te=le*le-4*_e*ie)>=0&&((Pe=(-le+bmSqrt(Te))/(2*ie))>0&&Pe<1&&Ae[Ee].push(this.calculateF(Pe,D,O,q,J,Ee)),(ve=(-le-bmSqrt(Te))/(2*ie))>0&&ve<1&&Ae[Ee].push(this.calculateF(ve,D,O,q,J,Ee))));this.shapeBoundingBox.left=bmMin.apply(null,Ae[0]),this.shapeBoundingBox.top=bmMin.apply(null,Ae[1]),this.shapeBoundingBox.right=bmMax.apply(null,Ae[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,Ae[1])},HShapeElement.prototype.calculateF=function(D,O,q,J,ie,le){return bmPow(1-D,3)*O[le]+3*bmPow(1-D,2)*D*q[le]+3*(1-D)*bmPow(D,2)*J[le]+bmPow(D,3)*ie[le]},HShapeElement.prototype.calculateBoundingBox=function(D,O){var q,J=D.length;for(q=0;q<J;q+=1)D[q]&&D[q].sh?this.calculateShapeBoundingBox(D[q],O):D[q]&&D[q].it?this.calculateBoundingBox(D[q].it,O):D[q]&&D[q].style&&D[q].w&&this.expandStrokeBoundingBox(D[q].w,O)},HShapeElement.prototype.expandStrokeBoundingBox=function(D,O){var q=0;if(D.keyframes){for(var J=0;J<D.keyframes.length;J+=1){var ie=D.keyframes[J].s;ie>q&&(q=ie)}q*=D.mult}else q=D.v*D.mult;O.x-=q,O.xMax+=q,O.y-=q,O.yMax+=q},HShapeElement.prototype.currentBoxContains=function(D){return this.currentBBox.x<=D.x&&this.currentBBox.y<=D.y&&this.currentBBox.width+this.currentBBox.x>=D.x+D.width&&this.currentBBox.height+this.currentBBox.y>=D.y+D.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var D=this.tempBoundingBox,O=999999;if(D.x=O,D.xMax=-O,D.y=O,D.yMax=-O,this.calculateBoundingBox(this.itemsData,D),D.width=D.xMax<D.x?0:D.xMax-D.x,D.height=D.yMax<D.y?0:D.yMax-D.y,this.currentBoxContains(D))return;var q=!1;if(this.currentBBox.w!==D.width&&(this.currentBBox.w=D.width,this.shapeCont.setAttribute("width",D.width),q=!0),this.currentBBox.h!==D.height&&(this.currentBBox.h=D.height,this.shapeCont.setAttribute("height",D.height),q=!0),q||this.currentBBox.x!==D.x||this.currentBBox.y!==D.y){this.currentBBox.w=D.width,this.currentBBox.h=D.height,this.currentBBox.x=D.x,this.currentBBox.y=D.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var J=this.shapeCont.style,ie="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";J.transform=ie,J.webkitTransform=ie}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var D=createNS("g");this.maskedElement.appendChild(D),this.innerElem=D}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var D=this.textProperty.currentData;this.renderedLetters=createSizedArray(D.l?D.l.length:0);var O=this.innerElem.style,q=D.fc?this.buildColor(D.fc):"rgba(0,0,0,0)";O.fill=q,O.color=q,D.sc&&(O.stroke=this.buildColor(D.sc),O.strokeWidth=D.sw+"px");var J,ie,le=this.globalData.fontManager.getFontByName(D.f);if(!this.globalData.fontManager.chars)if(O.fontSize=D.finalSize+"px",O.lineHeight=D.finalSize+"px",le.fClass)this.innerElem.className=le.fClass;else{O.fontFamily=le.fFamily;var _e=D.fWeight,o=D.fStyle;O.fontStyle=o,O.fontWeight=_e}var Te,Pe,ve,Ae=D.l;ie=Ae.length;var Ee,Ie=this.mHelper,ye="",ge=0;for(J=0;J<ie;J+=1){if(this.globalData.fontManager.chars?(this.textPaths[ge]?Te=this.textPaths[ge]:((Te=createNS("path")).setAttribute("stroke-linecap",lineCapEnum[1]),Te.setAttribute("stroke-linejoin",lineJoinEnum[2]),Te.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[ge]?ve=(Pe=this.textSpans[ge]).children[0]:((Pe=createTag("div")).style.lineHeight=0,(ve=createNS("svg")).appendChild(Te),styleDiv(Pe)))):this.isMasked?Te=this.textPaths[ge]?this.textPaths[ge]:createNS("text"):this.textSpans[ge]?(Pe=this.textSpans[ge],Te=this.textPaths[ge]):(styleDiv(Pe=createTag("span")),styleDiv(Te=createTag("span")),Pe.appendChild(Te)),this.globalData.fontManager.chars){var Se,Ce=this.globalData.fontManager.getCharData(D.finalText[J],le.fStyle,this.globalData.fontManager.getFontByName(D.f).fFamily);if(Se=Ce?Ce.data:null,Ie.reset(),Se&&Se.shapes&&Se.shapes.length&&(Ee=Se.shapes[0].it,Ie.scale(D.finalSize/100,D.finalSize/100),ye=this.createPathShape(Ie,Ee),Te.setAttribute("d",ye)),this.isMasked)this.innerElem.appendChild(Te);else{if(this.innerElem.appendChild(Pe),Se&&Se.shapes){document.body.appendChild(ve);var Ve=ve.getBBox();ve.setAttribute("width",Ve.width+2),ve.setAttribute("height",Ve.height+2),ve.setAttribute("viewBox",Ve.x-1+" "+(Ve.y-1)+" "+(Ve.width+2)+" "+(Ve.he
vendor: 14,577 bytes, line 18
18ight+2));var at=ve.style,et="translate("+(Ve.x-1)+"px,"+(Ve.y-1)+"px)";at.transform=et,at.webkitTransform=et,Ae[J].yOffset=Ve.y-1}else ve.setAttribute("width",1),ve.setAttribute("height",1);Pe.appendChild(ve)}}else if(Te.textContent=Ae[J].val,Te.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(Te);else{this.innerElem.appendChild(Pe);var Mt=Te.style,jt="translate3d(0,"+-D.finalSize/1.2+"px,0)";Mt.transform=jt,Mt.webkitTransform=jt}this.isMasked?this.textSpans[ge]=Te:this.textSpans[ge]=Pe,this.textSpans[ge].style.display="block",this.textPaths[ge]=Te,ge+=1}for(;ge<this.textSpans.length;)this.textSpans[ge].style.display="none",ge+=1},HTextElement.prototype.renderInnerContent=function(){var D;if(this.validateText(),this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),D=this.svgElement.style;var O="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";D.transform=O,D.webkitTransform=O}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var q,J,ie,le,_e,o=0,Te=this.textAnimator.renderedLetters,Pe=this.textProperty.currentData.l;for(J=Pe.length,q=0;q<J;q+=1)Pe[q].n?o+=1:(le=this.textSpans[q],_e=this.textPaths[q],ie=Te[o],o+=1,ie._mdf.m&&(this.isMasked?le.setAttribute("transform",ie.m):(le.style.webkitTransform=ie.m,le.style.transform=ie.m)),le.style.opacity=ie.o,ie.sw&&ie._mdf.sw&&_e.setAttribute("stroke-width",ie.sw),ie.sc&&ie._mdf.sc&&_e.setAttribute("stroke",ie.sc),ie.fc&&ie._mdf.fc&&(_e.setAttribute("fill",ie.fc),_e.style.color=ie.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var ve=this.innerElem.getBBox();if(this.currentBBox.w!==ve.width&&(this.currentBBox.w=ve.width,this.svgElement.setAttribute("width",ve.width)),this.currentBBox.h!==ve.height&&(this.currentBBox.h=ve.height,this.svgElement.setAttribute("height",ve.height)),this.currentBBox.w!==ve.width+2||this.currentBBox.h!==ve.height+2||this.currentBBox.x!==ve.x-1||this.currentBBox.y!==ve.y-1){this.currentBBox.w=ve.width+2,this.currentBBox.h=ve.height+2,this.currentBBox.x=ve.x-1,this.currentBBox.y=ve.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),D=this.svgElement.style;var Ae="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";D.transform=Ae,D.webkitTransform=Ae}}}},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var D,O,q,J,ie=this.comp.threeDElements.length;for(D=0;D<ie;D+=1)if((O=this.comp.threeDElements[D]).type==="3d"){q=O.perspectiveElem.style,J=O.container.style;var le=this.pe.v+"px",_e="0px 0px 0px",o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";q.perspective=le,q.webkitPerspective=le,J.transformOrigin=_e,J.mozTransformOrigin=_e,J.webkitTransformOrigin=_e,q.transform=o,q.webkitTransform=o}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var D,O,q=this._isFirstFrame;if(this.hierarchy)for(O=this.hierarchy.length,D=0;D<O;D+=1)q=this.hierarchy[D].finalTransform.mProp._mdf||q;if(q||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(D=O=this.hierarchy.length-1;D>=0;D-=1){var J=this.hierarchy[D].finalTransform.mProp;this.mat.translate(-J.p.v[0],-J.p.v[1],J.p.v[2]),this.mat.rotateX(-J.or.v[0]).rotateY(-J.or.v[1]).rotateZ(J.or.v[2]),this.mat.rotateX(-J.rx.v).rotateY(-J.ry.v).rotateZ(J.rz.v),this.mat.scale(1/J.s.v[0],1/J.s.v[1],1/J.s.v[2]),this.mat.translate(J.a.v[0],J.a.v[1],J.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var ie;ie=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var le=Math.sqrt(Math.pow(ie[0],2)+Math.pow(ie[1],2)+Math.pow(ie[2],2)),_e=[ie[0]/le,ie[1]/le,ie[2]/le],o=Math.sqrt(_e[2]*_e[2]+_e[0]*_e[0]),Te=Math.atan2(_e[1],o),Pe=Math.atan2(_e[0],-_e[2]);this.mat.rotateY(Pe).rotateX(-Te)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var ve=!this._prevMat.equals(this.mat);if((ve||this.pe._mdf)&&this.comp.threeDElements){var Ae,Ee,Ie;for(O=this.comp.threeDElements.length,D=0;D<O;D+=1)if((Ae=this.comp.threeDElements[D]).type==="3d"){if(ve){var ye=this.mat.toCSS();(Ie=Ae.container.style).transform=ye,Ie.webkitTransform=ye}this.pe._mdf&&((Ee=Ae.perspectiveElem.style).perspective=this.pe.v+"px",Ee.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(D){this.prepareProperties(D,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var D=this.globalData.getAssetsPath(this.assetData),O=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",D),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(O),O.crossOrigin="anonymous",O.src=D,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},HybridRendererBase.prototype.appendElementInPos=function(D,O){var q=D.getBaseElement();if(q){var J=this.layers[O];if(J.ddd&&this.supports3d)this.addTo3dContainer(q,O);else if(this.threeDElements)this.addTo3dContainer(q,O);else{for(var ie,le,_e=0;_e<O;)this.elements[_e]&&this.elements[_e]!==!0&&this.elements[_e].getBaseElement&&(le=this.elements[_e],ie=(this.layers[_e].ddd?this.getThreeDContainerByPos(_e):le.getBaseElement())||ie),_e+=1;ie?J.ddd&&this.supports3d||this.layerElement.insertBefore(q,ie):J.ddd&&this.supports3d||this.layerElement.appendChild(q)}}},HybridRendererBase.prototype.createShape=function(D){return this.supports3d?new HShapeElement(D,this.globalData,this):new SVGShapeElement(D,this.globalData,this)},HybridRendererBase.prototype.createText=function(D){return this.supports3d?new HTextElement(D,this.globalData,this):new SVGTextLottieElement(D,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(D){return this.camera=new HCameraElement(D,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(D){return this.supports3d?new HImageElement(D,this.globalData,this):new IImageElement(D,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(D){return this.supports3d?new HSolidElement(D,this.globalData,this):new ISolidElement(D,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(D){for(var O=0,q=this.threeDElements.length;O<q;){if(this.threeDElements[O].startPos<=D&&this.threeDElements[O].endPos>=D)return this.threeDElements[O].perspectiveElem;O+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(D,O){var q,J,ie=createTag("div");styleDiv(ie);var le=createTag("div");if(styleDiv(le),O==="3d"){(q=ie.style).width=this.globalData.compSize.w+"px",q.height=this.globalData.compSize.h+"px";var _e="50% 50%";q.webkitTransformOrigin=_e,q.mozTransformOrigin=_e,q.transformOrigin=_e;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(J=le.style).transform=o,J.webkitTransform=o}ie.appendChild(le);var Te={container:le,perspectiveElem:ie,startPos:D,endPos:D,type:O};return this.threeDElements.push(Te),Te},HybridRendererBase.prototype.build3dContainers=function(){var D,O,q=this.layers.length,J="";for(D=0;D<q;D+=1)this.layers[D].ddd&&this.layers[D].ty!==3?(J!=="3d"&&(J="3d",O=this.createThreeDContainer(D,"3d")),O.endPos=Math.max(O.endPos,D)):(J!=="2d"&&(J="2d",O=this.createThreeDContainer(D,"2d")),O.endPos=Math.max(O.endPos,D));for(D=(q=this.threeDElements.length)-1;D>=0;D-=1)this.resizerElem.appendChild(this.threeDElements[D].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(D,O){for(var q=0,J=this.threeDElements.length;q<J;){if(O<=this.threeDElements[q].endPos){for(var ie,le=this.threeDElements[q].startPos;le<O;)this.elements[le]&&this.elements[le].getBaseElement&&(ie=this.elements[le].getBaseElement()),le+=1;ie?this.threeDElements[q].container.insertBefore(D,ie):this.threeDElements[q].container.appendChild(D);break}q+=1}},HybridRendererBase.prototype.configAnimation=function(D){var O=createTag("div"),q=this.animationItem.wrapper,J=O.style;J.width=D.w+"px",J.height=D.h+"px",this.resizerElem=O,styleDiv(O),J.transformStyle="flat",J.mozTransformStyle="flat",J.webkitTransformStyle="flat",this.renderConfig.className&&O.setAttribute("class",this.renderConfig.className),q.appendChild(O),J.overflow="hidden";var ie=createNS("svg");ie.setAttribute("width","1"),ie.setAttribute("height","1"),styleDiv(ie),this.resizerElem.appendChild(ie);var le=createNS("defs");ie.appendChild(le),this.data=D,this.setupGlobalData(D,ie),this.globalData.defs=le,this.layers=D.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){var D;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var O=this.layers?this.layers.length:0;for(D=0;D<O;D+=1)this.elements[D]&&this.elements[D].destroy&&this.elements[D].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var D,O,q,J,ie=this.animationItem.wrapper.offsetWidth,le=this.animationItem.wrapper.offsetHeight,_e=ie/le;this.globalData.compSize.w/this.globalData.compSize.h>_e?(D=ie/this.globalData.compSize.w,O=ie/this.globalData.compSize.w,q=0,J=(le-this.globalData.compSize.h*(ie/this.globalData.compSize.w))/2):(D=le/this.globalData.compSize.h,O=le/this.globalData.compSize.h,q=(ie-this.globalData.compSize.w*(le/this.globalData.compSize.h))/2,J=0);var o=this.resizerElem.style;o.webkitTransform="matrix3d("+D+",0,0,0,0,"+O+",0,0,0,0,1,0,"+q+","+J+",0,1)",o.transform=o.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var D,O=this.globalData.compSize.w,q=this.globalData.compSize.h,J=this.threeDElements.length;for(D=0;D<J;D+=1){var ie=this.threeDElements[D].perspectiveElem.style;ie.webkitPerspective=Math.sqrt(Math.pow(O,2)+Math.pow(q,2))+"px",ie.perspective=ie.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(D){var O,q=D.length,J=createTag("div");for(O=0;O<q;O+=1)if(D[O].xt){var ie=this.createComp(D[O],J,this.globalData.comp,null);ie.initExpressions(),this.globalData.projectInterface.registerComposition(ie)}},extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(D,O){for(var q,J=0;J<O;)this.elements[J]&&this.elements[J].getBaseElement&&(q=this.elements[J].getBaseElement()),J+=1;q?this.layerElement.insertBefore(D,q):this.layerElement.appendChild(D)},HCompElement.prototype.createComp=function(D){return this.supports3d?new HCompElement(D,this.globalData,this):new SVGCompElement(D,this.globalData,this)},extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(D){return this.supports3d?new HCompElement(D,this.globalData,this):new SVGCompElement(D,this.globalData,this)};var CompExpressionInterface=function(D){function O(q){for(var J=0,ie=D.layers.length;J<ie;){if(D.layers[J].nm===q||D.layers[J].ind===q)return D.elements[J].layerInterface;J+=1}return null}return Object.defineProperty(O,"_name",{value:D.data.nm}),O.layer=O,O.pixelAspect=1,O.height=D.data.h||D.globalData.compSize.h,O.width=D.data.w||D.globalData.compSize.w,O.pixelAspect=1,O.frameDuration=1/D.globalData.frameRate,O.displayStartTime=0,O.numLayers=D.layers.length,O};function _typeof$2(D){return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},_typeof$2(D)}function seedRandom(D,O){var q=this,J=256,ie=O.pow(J,6),le=O.pow(2,52),_e=2*le,o=255;function Te(Ie){var ye,ge=Ie.length,Se=this,Ce=0,Ve=Se.i=Se.j=0,at=Se.S=[];for(ge||(Ie=[ge++]);Ce<J;)at[Ce]=Ce++;for(Ce=0;Ce<J;Ce++)at[Ce]=at[Ve=o&Ve+Ie[Ce%ge]+(ye=at[Ce])],at[Ve]=ye;Se.g=function(et){for(var Mt,jt=0,St=Se.i,Bt=Se.j,Zt=Se.S;et--;)Mt=Zt[St=o&St+1],jt=jt*J+Zt[o&(Zt[St]=Zt[Bt=o&Bt+Mt])+(Zt[Bt]=Mt)];return Se.i=St,Se.j=Bt,jt}}function Pe(Ie,ye){return ye.i=Ie.i,ye.j=Ie.j,ye.S=Ie.S.slice(),ye}function ve(Ie,ye){var ge,Se=[],Ce=_typeof$2(Ie);
18if(ye&&Ce=="object")for(ge in Ie)try{Se.push(ve(Ie[ge],ye-1))}catch{}return Se.length?Se:Ce=="string"?Ie:Ie+"\0"}function Ae(Ie,ye){for(var ge,Se=Ie+"",Ce=0;Ce<Se.length;)ye[o&Ce]=o&(ge^=19*ye[o&Ce])+Se.charCodeAt(Ce++);return Ee(ye)}function Ee(Ie){return String.fromCharCode.apply(0,Ie)}O.seedrandom=function(Ie,ye,ge){var Se=[],Ce=Ae(ve((ye=ye===!0?{entropy:!0}:ye||{}).entropy?[Ie,Ee(D)]:Ie===null?function(){try{var et=new Uint8Array(J);return(q.crypto||q.msCrypto).getRandomValues(et),Ee(et)}catch{var Mt=q.navigator,jt=Mt&&Mt.plugins;return[+new Date,q,jt,q.screen,Ee(D)]}}():Ie,3),Se),Ve=new Te(Se),at=function(){for(var et=Ve.g(6),Mt=ie,jt=0;et<le;)et=(et+jt)*J,Mt*=J,jt=Ve.g(1);for(;et>=_e;)et/=2,Mt/=2,jt>>>=1;return(et+jt)/Mt};return at.int32=function(){return 0|Ve.g(4)},at.quick=function(){return Ve.g(4)/4294967296},at.double=at,Ae(Ee(Ve.S),D),(ye.pass||ge||function(et,Mt,jt,St){return St&&(St.S&&Pe(St,Ve),et.state=function(){return Pe(Ve,{})}),jt?(O.random=et,Mt):et})(at,Ce,"global"in ye?ye.global:this==O,ye.state)},Ae(O.random(),D)}function initialize$2(D){seedRandom([],D)}var propTypes={SHAPE:"shape"};function _typeof$1(D){return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},_typeof$1(D)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(D){return D.constructor===Array||D.constructor===Float32Array}function isNumerable(D,O){return D==="number"||O instanceof Number||D==="boolean"||D==="string"}function $bm_neg(D){var O=_typeof$1(D);if(O==="number"||D instanceof Number||O==="boolean")return-D;if($bm_isInstanceOfArray(D)){var q,J=D.length,ie=[];for(q=0;q<J;q+=1)ie[q]=-D[q];return ie}return D.propType?D.v:-D}initialize$2(BMMath);var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(D,O){var q=_typeof$1(D),J=_typeof$1(O);if(isNumerable(q,D)&&isNumerable(J,O)||q==="string"||J==="string")return D+O;if($bm_isInstanceOfArray(D)&&isNumerable(J,O))return(D=D.slice(0))[0]+=O,D;if(isNumerable(q,D)&&$bm_isInstanceOfArray(O))return(O=O.slice(0))[0]=D+O[0],O;if($bm_isInstanceOfArray(D)&&$bm_isInstanceOfArray(O)){for(var ie=0,le=D.length,_e=O.length,o=[];ie<le||ie<_e;)(typeof D[ie]=="number"||D[ie]instanceof Number)&&(typeof O[ie]=="number"||O[ie]instanceof Number)?o[ie]=D[ie]+O[ie]:o[ie]=O[ie]===void 0?D[ie]:D[ie]||O[ie],ie+=1;return o}return 0}var add=sum;function sub(D,O){var q=_typeof$1(D),J=_typeof$1(O);if(isNumerable(q,D)&&isNumerable(J,O))return q==="string"&&(D=parseInt(D,10)),J==="string"&&(O=parseInt(O,10)),D-O;if($bm_isInstanceOfArray(D)&&isNumerable(J,O))return(D=D.slice(0))[0]-=O,D;if(isNumerable(q,D)&&$bm_isInstanceOfArray(O))return(O=O.slice(0))[0]=D-O[0],O;if($bm_isInstanceOfArray(D)&&$bm_isInstanceOfArray(O)){for(var ie=0,le=D.length,_e=O.length,o=[];ie<le||ie<_e;)(typeof D[ie]=="number"||D[ie]instanceof Number)&&(typeof O[ie]=="number"||O[ie]instanceof Number)?o[ie]=D[ie]-O[ie]:o[ie]=O[ie]===void 0?D[ie]:D[ie]||O[ie],ie+=1;return o}return 0}function mul(D,O){var q,J,ie,le=_typeof$1(D),_e=_typeof$1(O);if(isNumerable(le,D)&&isNumerable(_e,O))return D*O;if($bm_isInstanceOfArray(D)&&isNumerable(_e,O)){for(ie=D.length,q=createTypedArray("float32",ie),J=0;J<ie;J+=1)q[J]=D[J]*O;return q}if(isNumerable(le,D)&&$bm_isInstanceOfArray(O)){for(ie=O.length,q=createTypedArray("float32",ie),J=0;J<ie;J+=1)q[J]=D*O[J];return q}return 0}function div(D,O){var q,J,ie,le=_typeof$1(D),_e=_typeof$1(O);if(isNumerable(le,D)&&isNumerable(_e,O))return D/O;if($bm_isInstanceOfArray(D)&&isNumerable(_e,O)){for(ie=D.length,q=createTypedArray("float32",ie),J=0;J<ie;J+=1)q[J]=D[J]/O;return q}if(isNumerable(le,D)&&$bm_isInstanceOfArray(O)){for(ie=O.length,q=createTypedArray("float32",ie),J=0;J<ie;J+=1)q[J]=D/O[J];return q}return 0}
vendor: 1,601 bytes, line 18
18function mod(D,O){return typeof D=="string"&&(D=parseInt(D,10)),typeof O=="string"&&(O=parseInt(O,10)),D%O}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(D,O,q){if(O>q){var J=q;q=O,O=J}return Math.min(Math.max(D,O),q)}function radiansToDegrees(D){return D/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(D){return D*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(D,O){if(typeof D=="number"||D instanceof Number)return O=O||0,Math.abs(D-O);var q;O||(O=helperLengthArray);var J=Math.min(D.length,O.length),ie=0;for(q=0;q<J;q+=1)ie+=Math.pow(O[q]-D[q],2);return Math.sqrt(ie)}function normalize(D){return div(D,length(D))}function rgbToHsl(D){var O,q,J=D[0],ie=D[1],le=D[2],_e=Math.max(J,ie,le),o=Math.min(J,ie,le),Te=(_e+o)/2;if(_e===o)O=0,q=0;else{var Pe=_e-o;switch(q=Te>.5?Pe/(2-_e-o):Pe/(_e+o),_e){case J:O=(ie-le)/Pe+(ie<le?6:0);break;case ie:O=(le-J)/Pe+2;break;case le:O=(J-ie)/Pe+4}O/=6}return[O,q,Te,D[3]]}function hue2rgb(D,O,q){return q<0&&(q+=1),q>1&&(q-=1),q<1/6?D+6*(O-D)*q:q<.5?O:q<2/3?D+(O-D)*(2/3-q)*6:D}function hslToRgb(D){var O,q,J,ie=D[0],le=D[1],_e=D[2];if(le===0)O=_e,J=_e,q=_e;else{var o=_e<.5?_e*(1+le):_e+le-_e*le,Te=2*_e-o;O=hue2rgb(Te,o,ie+1/3),q=hue2rgb(Te,o,ie),J=hue2rgb(Te,o,ie-1/3)}return[O,q,J,D[3]]}function linear(D,O,q,J,ie){if(J!==void 0&&ie!==void 0||(J=O,ie=q,O=0,q=1),q<O){var le=q;q=O,O=le}if(D<=O)return J;if(D>=q)return ie;var _e,o=q===O?0:(D-O)/(q-O);if(!J.length)return J+(ie-J)*o;var Te=J.length,Pe=createTypedArray("float32",Te);for(_e=0;_e<Te;
vendor: 5,699 bytes, line 18
18_e+=1)Pe[_e]=J[_e]+(ie[_e]-J[_e])*o;return Pe}function random(D,O){if(O===void 0&&(D===void 0?(D=0,O=1):(O=D,D=void 0)),O.length){var q,J=O.length;D||(D=createTypedArray("float32",J));var ie=createTypedArray("float32",J),le=BMMath.random();for(q=0;q<J;q+=1)ie[q]=D[q]+le*(O[q]-D[q]);return ie}return D===void 0&&(D=0),D+BMMath.random()*(O-D)}function createPath(D,O,q,J){var ie,le=D.length,_e=shapePool.newElement();_e.setPathData(!!J,le);var o,Te,Pe=[0,0];for(ie=0;ie<le;ie+=1)o=O&&O[ie]?O[ie]:Pe,Te=q&&q[ie]?q[ie]:Pe,_e.setTripleAt(D[ie][0],D[ie][1],Te[0]+D[ie][0],Te[1]+D[ie][1],o[0]+D[ie][0],o[1]+D[ie][1],ie,!0);return _e}function initiateExpression(elem,data,property){function noOp(D){return D}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=val.indexOf("random")!==-1,elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||this.data.hd!==!0,wiggle=(function(D,O){var q,J,ie=this.pv.length?this.pv.length:1,le=createTypedArray("float32",ie),_e=Math.floor(5*time);for(q=0,J=0;q<_e;){for(J=0;J<ie;J+=1)le[J]+=-O+2*O*BMMath.random();q+=1}var o=5*time,Te=o-Math.floor(o),Pe=createTypedArray("float32",ie);if(ie>1){for(J=0;J<ie;J+=1)Pe[J]=this.pv[J]+le[J]+(-O+2*O*BMMath.random())*Te;return Pe}return this.pv+le[0]+(-O+2*O*BMMath.random())*Te}).bind(this);function loopInDuration(D,O){return loopIn(D,O,!0)}function loopOutDuration(D,O){return loopOut(D,O,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(D,O){var q=[O[0]-D[0],O[1]-D[1],O[2]-D[2]],J=Math.atan2(q[0],Math.sqrt(q[1]*q[1]+q[2]*q[2]))/degToRads;return[-Math.atan2(q[1],q[2])/degToRads,J,0]}function easeOut(D,O,q,J,ie){return applyEase(easeOutBez,D,O,q,J,ie)}function easeIn(D,O,q,J,ie){return applyEase(easeInBez,D,O,q,J,ie)}function ease(D,O,q,J,ie){return applyEase(easeInOutBez,D,O,q,J,ie)}function applyEase(D,O,q,J,ie,le){ie===void 0?(ie=q,le=J):O=(O-q)/(J-q),O>1?O=1:O<0&&(O=0);var _e=D(O);if($bm_isInstanceOfArray(ie)){var o,Te=ie.length,Pe=createTypedArray("float32",Te);for(o=0;o<Te;o+=1)Pe[o]=(le[o]-ie[o])*_e+ie[o];return Pe}return(le-ie)*_e+ie}function nearestKey(D){var O,q,J,ie=data.k.length;if(data.k.length&&typeof data.k[0]!="number")if(q=-1,(D*=elem.comp.globalData.frameRate)<data.k[0].t)q=1,J=data.k[0].t;else{for(O=0;O<ie-1;O+=1){if(D===data.k[O].t){q=O+1,J=data.k[O].t;break}if(D>data.k[O].t&&D<data.k[O+1].t){D-data.k[O].t>data.k[O+1].t-D?(q=O+2,J=data.k[O+1].t):(q=O+1,J=data.k[O].t);break}}q===-1&&(q=O+1,J=data.k[O].t)}else q=0,J=0;var le={};return le.index=q,le.time=J/elem.comp.globalData.frameRate,le}function key(D){var O,q,J;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+D);D-=1,O={time:data.k[D].t/elem.comp.globalData.frameRate,value:[]};var ie=Object.prototype.hasOwnProperty.call(data.k[D],"s")?data.k[D].s:data.k[D-1].e;for(J=ie.length,q=0;q<J;q+=1)O[q]=ie[q],O.value[q]=ie[q];return O}function framesToTime(D,O){return O||(O=elem.comp.globalData.frameRate),D/O}function timeToFrames(D,O){return D||D===0||(D=time),O||(O=elem.comp.globalData.frameRate),D*O}function seedRandom(D){BMMath.seedrandom(randSeed+D)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(D,O){return typeof value=="string"?O===void 0?value.substring(D):value.substring(D,O):""}function substr(D,O){return typeof value=="string"?O===void 0?value.substr(D):value.substr(D,O):""}function posterizeTime(D){time=D===0?0:Math.floor(time*D)/D,value=valueAtTime(time)}var index=elem.data.ind;!elem.hierarchy||elem.hierarchy.length;var parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(D){return value=D,this.frameExpressionId===elem.globalData.frameId&&this.propType!=="textSelector"?value:(this.propType==="textSelector"&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),elemType!==4||c
vendor: 21,039 bytes, line 18
18ontent||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),!(!elem.hierarchy||!elem.hierarchy.length)&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath,_lottieGlobal],ob.resetFrame=resetFrame,ob}(),Expressions=function(){var D={initExpressions:function(O){var q=0,J=[];O.renderer.compInterface=CompExpressionInterface(O.renderer),O.renderer.globalData.projectInterface.registerComposition(O.renderer),O.renderer.globalData.pushExpression=function(){q+=1},O.renderer.globalData.popExpression=function(){(q-=1)==0&&function(){var ie,le=J.length;for(ie=0;ie<le;ie+=1)J[ie].release();J.length=0}()},O.renderer.globalData.registerExpressionProperty=function(ie){J.indexOf(ie)===-1&&J.push(ie)}}};return D.resetFrame=ExpressionManager.resetFrame,D}(),MaskManagerInterface=function(){function D(O,q){this._mask=O,this._data=q}return Object.defineProperty(D.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(D.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}}),function(O){var q,J=createSizedArray(O.viewData.length),ie=O.viewData.length;for(q=0;q<ie;q+=1)J[q]=new D(O.viewData[q],O.masksProperties[q]);return function(le){for(q=0;q<ie;){if(O.masksProperties[q].nm===le)return J[q];q+=1}return null}}}(),ExpressionPropertyInterface=function(){var D={pv:0,v:0,mult:1},O={pv:[0,0,0],v:[0,0,0],mult:1};function q(ie,le,_e){Object.defineProperty(ie,"velocity",{get:function(){return le.getVelocityAtTime(le.comp.currentFrame)}}),ie.numKeys=le.keyframes?le.keyframes.length:0,ie.key=function(o){if(!ie.numKeys)return 0;var Te="";Te="s"in le.keyframes[o-1]?le.keyframes[o-1].s:"e"in le.keyframes[o-2]?le.keyframes[o-2].e:le.keyframes[o-2].s;var Pe=_e==="unidimensional"?new Number(Te):Object.assign({},Te);return Pe.time=le.keyframes[o-1].t/le.elem.comp.globalData.frameRate,Pe.value=_e==="unidimensional"?Te[0]:Te,Pe},ie.valueAtTime=le.getValueAtTime,ie.speedAtTime=le.getSpeedAtTime,ie.velocityAtTime=le.getVelocityAtTime,ie.propertyGroup=le.propertyGroup}function J(){return D}return function(ie){return ie?ie.propType==="unidimensional"?function(le){le&&"pv"in le||(le=D);var _e=1/le.mult,o=le.pv*_e,Te=new Number(o);return Te.value=o,q(Te,le,"unidimensional"),function(){return le.k&&le.getValue(),o=le.v*_e,Te.value!==o&&((Te=new Number(o)).value=o,q(Te,le,"unidimensional")),Te}}(ie):function(le){le&&"pv"in le||(le=O);var _e=1/le.mult,o=le.data&&le.data.l||le.pv.length,Te=createTypedArray("float32",o),Pe=createTypedArray("float32",o);return Te.value=Pe,q(Te,le,"multidimensional"),function(){le.k&&le.getValue();for(var ve=0;ve<o;ve+=1)Pe[ve]=le.v[ve]*_e,Te[ve]=Pe[ve];return Te}}(ie):J}}(),TransformExpressionInterface=function(D){function O(_e){switch(_e){case"scale":case"Scale":case"ADBE Scale":case 6:return O.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return O.rotation;case"ADBE Rotate X":return O.xRotation;case"ADBE Rotate Y":return O.yRotation;case"position":case"Position":case"ADBE Position":case 2:return O.position;case"ADBE Position_0":return O.xPosition;case"ADBE Position_1":return O.yPosition;case"ADBE Position_2":return O.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return O.anchorPoint;case"opacity":case"Opacity":case 11:return O.opacity;default:return null}}var q,J,ie,le;return Object.defineProperty(O,"rotation",{get:ExpressionPropertyInterface(D.r||D.rz)}),Object.defineProperty(O,"zRotation",{get:ExpressionPropertyInterface(D.rz||D.r)}),Object.defineProperty(O,"xRotation",{get:ExpressionPropertyInterface(D.rx)}),Object.defineProperty(O,"yRotation",{get:ExpressionPropertyInterface(D.ry)}),Object.defineProperty(O,"scale",{get:ExpressionPropertyInterface(D.s)}),D.p?le=ExpressionPropertyInterface(D.p):(q=ExpressionPropertyInterface(D.px),J=ExpressionPropertyInterface(D.py),D.pz&&(ie=ExpressionPropertyInterface(D.pz))),Object.defineProperty(O,"position",{get:function(){return D.p?le():[q(),J(),ie?ie():0]}}),Object.defineProperty(O,"xPosition",{get:ExpressionPropertyInterface(D.px)}),Object.defineProperty(O,"yPosition",{get:ExpressionPropertyInterface(D.py)}),Object.defineProperty(O,"zPosition",{get:ExpressionPropertyInterface(D.pz)}),Object.defineProperty(O,"anchorPoint",{get:ExpressionPropertyInterface(D.a)}),Object.defineProperty(O,"opacity",{get:ExpressionPropertyInterface(D.o)}),Object.defineProperty(O,"skew",{get:ExpressionPropertyInterface(D.sk)}),Object.defineProperty(O,"skewAxis",{get:ExpressionPropertyInterface(D.sa)}),Object.defineProperty(O,"orientation",{get:ExpressionPropertyInterface(D.or)}),O},LayerExpressionInterface=function(){function D(Pe){var ve=new Matrix;return Pe!==void 0?this._elem.finalTransform.mProp.getValueAtTime(Pe).clone(ve):this._elem.finalTransform.mProp.applyToMatrix(ve),ve}function O(Pe,ve){var Ae=this.getMatrix(ve);return Ae.props[12]=0,Ae.props[13]=0,Ae.props[14]=0,this.applyPoint(Ae,Pe)}function q(Pe,ve){var Ae=this.getMatrix(ve);return this.applyPoint(Ae,Pe)}function J(Pe,ve){var Ae=this.getMatrix(ve);return Ae.props[12]=0,Ae.props[13]=0,Ae.props[14]=0,this.invertPoint(Ae,Pe)}function ie(Pe,ve){var Ae=this.getMatrix(ve);return this.invertPoint(Ae,Pe)}function le(Pe,ve){if(this._elem.hierarchy&&this._elem.hierarchy.length){var Ae,Ee=this._elem.hierarchy.length;for(Ae=0;Ae<Ee;Ae+=1)this._elem.hierarchy[Ae].finalTransform.mProp.applyToMatrix(Pe)}return Pe.applyToPointArray(ve[0],ve[1],ve[2]||0)}function _e(Pe,ve){if(this._elem.hierarchy&&this._elem.hierarchy.length){var Ae,Ee=this._elem.hierarchy.length;for(Ae=0;Ae<Ee;Ae+=1)this._elem.hierarchy[Ae].finalTransform.mProp.applyToMatrix(Pe)}return Pe.inversePoint(ve)}function o(Pe){var ve=new Matrix;if(ve.reset(),this._elem.finalTransform.mProp.applyToMatrix(ve),this._elem.hierarchy&&this._elem.hierarchy.length){var Ae,Ee=this._elem.hierarchy.length;for(Ae=0;Ae<Ee;Ae+=1)this._elem.hierarchy[Ae].finalTransform.mProp.applyToMatrix(ve);return ve.inversePoint(Pe)}return ve.inversePoint(Pe)}function Te(){return[1,1,1,1]}return function(Pe){var ve;function Ae(Ie){switch(Ie){case"ADBE Root Vectors Group":case"Contents":case 2:return Ae.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return ve;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return Ae.effect;case"ADBE Text Properties":return Ae.textInterface;default:return null}}Ae.getMatrix=D,Ae.invertPoint=_e,Ae.applyPoint=le,Ae.toWorld=q,Ae.toWorldVec=O,Ae.fromWorld=ie,Ae.fromWorldVec=J,Ae.toComp=q,Ae.fromComp=o,Ae.sampleImage=Te,Ae.sourceRectAtTime=Pe.sourceRectAtTime.bind(Pe),Ae._elem=Pe;var Ee=getDescriptor(ve=TransformExpressionInterface(Pe.finalTransform.mProp),"anchorPoint");return Object.defineProperties(Ae,{hasParent:{get:function(){return Pe.hierarchy.length}},parent:{get:function(){return Pe.hierarchy[0].layerInterface}},rotation:getDescriptor(ve,"rotation"),scale:getDescriptor(ve,"scale"),position:getDescriptor(ve,"position"),opacity:getDescriptor(ve,"opacity"),anchorPoint:Ee,anchor_point:Ee,transform:{get:function(){return ve}},active:{get:function(){return Pe.isInRange}}}),Ae.startTime=Pe.data.st,Ae.index=Pe.data.ind,Ae.source=Pe.data.refId,Ae.height=Pe.data.ty===0?Pe.data.h:100,Ae.width=Pe.data.ty===0?Pe.data.w:100,Ae.inPoint=Pe.data.ip/Pe.comp.globalData.frameRate,Ae.outPoint=Pe.data.op/Pe.comp.globalData.frameRate,Ae._name=Pe.data.nm,Ae.registerMaskInterface=function(Ie){Ae.mask=new MaskManagerInterface(Ie,Pe)},Ae.registerEffectsInterface=function(Ie){Ae.effect=Ie},Ae}}(),propertyGroupFactory=function(D,O){return function(q){return(q=q===void 0?1:q)<=0?D:O(q-1)}},PropertyInterface=function(D,O){var q={_name:D};return function(J){return(J=J===void 0?1:J)<=0?q:O(J-1)}},EffectsExpressionInterface=function(){var D={createEffectsInterface:function(J,ie){if(J.effectsManager){var le,_e=[],o=J.data.ef,Te=J.effectsManager.effectElements.length;for(le=0;le<Te;le+=1)_e.push(O(o[le],J.effectsManager.effectElements[le],ie,J));var Pe=J.data.ef||[],ve=function(Ae){for(le=0,Te=Pe.length;le<Te;){if(Ae===Pe[le].nm||Ae===Pe[le].mn||Ae===Pe[le].ix)return _e[le];le+=1}return null};return Object.defineProperty(ve,"numProperties",{get:function(){return Pe.length}}),ve}return null}};function O(J,ie,le,_e){function o(Ee){for(var Ie=J.ef,ye=0,ge=Ie.length;ye<ge;){if(Ee===Ie[ye].nm||Ee===Ie[ye].mn||Ee===Ie[ye].ix)return Ie[ye].ty===5?ve[ye]:ve[ye]();ye+=1}throw new Error}var Te,Pe=propertyGroupFactory(o,le),ve=[],Ae=J.ef.length;for(Te=0;Te<Ae;Te+=1)J.ef[Te].ty===5?ve.push(O(J.ef[Te],ie.effectElements[Te],ie.effectElements[Te].propertyGroup,_e)):ve.push(q(ie.effectElements[Te],J.ef[Te].ty,_e,Pe));return J.mn==="ADBE Color Control"&&Object.defineProperty(o,"color",{get:function(){return ve[0]()}}),Object.defineProperties(o,{numProperties:{get:function(){return J.np}},_name:{value:J.nm},propertyGroup:{value:Pe}}),o.enabled=J.en!==0,o.active=o.enabled,o}function q(J,ie,le,_e){var o=ExpressionPropertyInterface(J.p);return J.p.setGroupProperty&&J.p.setGroupProperty(PropertyInterface("",_e)),function(){return ie===10?le.comp.compInterface(J.p.v):o()}}return D}(),ShapePathInterface=function(D,O,q){var J=O.sh;function ie(_e){return _e==="Shape"||_e==="shape"||_e==="Path"||_e==="path"||_e==="ADBE Vector Shape"||_e===2?ie.path:null}var le=propertyGroupFactory(ie,q);return J.setGroupProperty(PropertyInterface("Path",le)),Object.defineProperties(ie,{path:{get:function(){return J.k&&J.getValue(),J}},shape:{get:function(){return J.k&&J.getValue(),J}},_name:{value:D.nm},ix:{value:D.ix},propertyIndex:{value:D.ix},mn:{value:D.mn},propertyGroup:{value:q}}),ie},ShapeExpressionInterface=function(){function D(Ee,Ie,ye){var ge,Se=[],Ce=Ee?Ee.length:0;for(ge=0;ge<Ce;ge+=1)Ee[ge].ty==="gr"?Se.push(O(Ee[ge],Ie[ge],ye)):Ee[ge].ty==="fl"?Se.push(q(Ee[ge],Ie[ge],ye)):Ee[ge].ty==="st"?Se.push(ie(Ee[ge],Ie[ge],ye)):Ee[ge].ty==="tm"?Se.push(le(Ee[ge],Ie[ge],ye)):Ee[ge].ty==="tr"||(Ee[ge].ty==="el"?Se.push(o(Ee[ge],Ie[ge],ye)):Ee[ge].ty==="sr"?Se.push(Te(Ee[ge],Ie[ge],ye)):Ee[ge].ty==="sh"?Se.push(ShapePathInterface(Ee[ge],Ie[ge],ye)):Ee[ge].ty==="rc"?Se.push(Pe(Ee[ge],Ie[ge],ye)):Ee[ge].ty==="rd"?Se.push(ve(Ee[ge],Ie[ge],ye)):Ee[ge].ty==="rp"?Se.push(Ae(Ee[ge],Ie[ge],ye)):Ee[ge].ty==="gf"?Se.push(J(Ee[ge],Ie[ge],ye)):Se.push((Ee[ge],Ie[ge],function(){return null})));return Se}function O(Ee,Ie,ye){var ge=function(Ve){switch(Ve){case"ADBE Vectors Group":case"Contents":case 2:return ge.content;default:return ge.transform}};ge.propertyGroup=propertyGroupFactory(ge,ye);var Se=function(Ve,at,et){var Mt,jt=function(Bt){for(var Zt=0,xt=Mt.length;Zt<xt;){if(Mt[Zt]._name===Bt||Mt[Zt].mn===Bt||Mt[Zt].propertyIndex===Bt||Mt[Zt].ix===Bt||Mt[Zt].ind===Bt)return Mt[Zt];Zt+=1}return typeof Bt=="number"?Mt[Bt-1]:null};jt.propertyGroup=propertyGroupFactory(jt,et),Mt=D(Ve.it,at.it,jt.propertyGroup),jt.numProperties=Mt.length;var St=_e(Ve.it[Ve.it.length-1],at.it[at.it.length-1],jt.propertyGroup);return jt.transform=St,jt.propertyIndex=Ve.cix,jt._name=Ve.nm,jt}(Ee,Ie,ge.propertyGroup),Ce=_e(Ee.it[Ee.it.length-1],Ie.it[Ie.it.length-1],ge.propertyGroup);return ge.content=Se,ge.transform=Ce,Object.defineProperty(ge,"_name",{get:function(){return Ee.nm}}),ge.numProperties=Ee.np,ge.propertyIndex=Ee.ix,ge.nm=Ee.nm,ge.mn=Ee.mn,ge}function q(Ee,Ie,ye){function ge(Se){return Se==="Color"||Se==="color"?ge.color:Se==="Opacity"||Se==="opacity"?ge.opacity:null}return Object.defineProperties(ge,{color:{get:ExpressionPropertyInterface(Ie.c)},opacity:{get:ExpressionPropertyInterface(Ie.o)},_name:{value:Ee.nm},mn:{value:Ee.mn}}),Ie.c.setGroupProperty(PropertyInterface("Color",ye)),Ie.o.setGroupProperty(PropertyInterface("Opacity",ye)),ge}function J(Ee,Ie,ye){function ge(Se){return Se==="Start Point"||Se==="start point"?ge.startPoint:Se==="End Point"||Se==="end point"?ge.endPoint:Se==="Opacity"||Se==="opacity"?ge.opacity:null}return Object.defineProperties(ge,{startPoint:{get:ExpressionPropertyInterface(Ie.s)},endPoint:{get:ExpressionPropertyInterface(Ie.e)},opacity:{get:ExpressionPropertyInterface(Ie.o)},type:{get:function(){return"a"}},_name:{value:Ee.nm},mn:{value:Ee.mn}}),Ie.s.setGroupProperty(PropertyInterface("Start Point",ye)),Ie.e.setGroupProperty(PropertyInterface("End Point",ye)),Ie.o.setGroupProperty(PropertyInterface("Opacity",ye)),ge}function ie(Ee,Ie,ye){var ge,Se=propertyGroupFactory(Mt,ye),Ce=propertyGroupFactory(et,Se);function Ve(jt){Object.defineProperty(et,Ee.d[jt].nm,{get:ExpressionPropertyInterface(Ie.d.dataProps[jt].p)})}var at=Ee.d?Ee.d.length:0,et={};for(ge=0;ge<at;ge+=1)Ve(ge),Ie.d.dataProps[ge].p.setGroupProperty(Ce);function Mt(jt){return jt==="Color"||jt==="color"?Mt.color:jt==="Opacity"||jt==="opacity"?Mt.opacity:jt==="Stroke Width"||jt==="stroke width"?Mt.strokeWidth:null}return Object.defineProperties(Mt,{color:{get:ExpressionPropertyInterface(Ie.c)},opacity:{get:ExpressionPropertyInterface(Ie.o)},strokeWidth:{get:ExpressionPropertyInterface(Ie.w)},dash:{get:function(){return et}},_name:{value:Ee.nm},mn:{value:Ee.mn}}),Ie.c.setGroupProperty(PropertyInterface("Color",Se)),Ie.o.setGroupProperty(PropertyInterface("Opacity",Se)),Ie.w.setGroupProperty(PropertyInterface("Stroke Width",Se)),Mt}function le(Ee,Ie,ye){function ge(Ce){return Ce===Ee.e.ix||Ce==="End"||Ce==="end"?ge.end:Ce===Ee.s.ix?ge.start:Ce===Ee.o.ix?ge.offset:null}var Se=propertyGroupFactory(ge,ye);return ge.propertyIndex=Ee.ix,Ie.s.setGroupProperty(PropertyInterface("Start",Se)),Ie.e.setGroupProperty(PropertyInterface("End",Se)),Ie.o.setGroupProperty(PropertyInterface("Offset",Se)),ge.propertyIndex=Ee.ix,ge.propertyGroup=ye,Object.defineProperties(ge,{start:{get:ExpressionPropertyInterface(Ie.s)},end:{get:ExpressionPropertyInterface(Ie.e)},offset:{get:ExpressionPropertyInterface(Ie.o)},_name:{value:Ee.nm}}),ge.mn=Ee.mn,ge}function _e(Ee,Ie,ye){function ge(Ce){return Ee.a.ix===Ce||Ce==="Anchor Point"?ge.anchorPoint:Ee.o.ix===Ce||Ce==="Opacity"?ge.opacity:Ee.p.ix===Ce||Ce==="Position"?ge.position:Ee.r.ix===Ce||Ce==="Rotation"||Ce==="ADBE Vector Rotation"?ge.rotation:Ee.s.ix===Ce||Ce==="Scale"?ge.scale:Ee.sk&&Ee.sk.ix===Ce||Ce==="Skew"?ge.skew:Ee.sa&&Ee.sa.ix===Ce||Ce==="Skew Axis"?ge.skewAxis:null}var Se=propertyGroupFactory(ge,ye);return Ie.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",Se)),Ie.transform.mProps.p.setGroupProperty(PropertyInterface("Position",Se)),Ie.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",Se)),Ie.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",Se)),Ie.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",Se)),Ie.transform.mProps.sk&&(Ie.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",Se)),Ie.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",Se))),Ie.transform.op.setGroupProperty(PropertyInterface("Opacity",Se)),Object.defineProperties(ge,{opacity:{get:ExpressionPropertyInterface(Ie.transform.mProps.o)},position:{get:ExpressionPropertyInterface(Ie.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(Ie.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(Ie.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(Ie.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(Ie.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(Ie.transform.mProps.sa)},_name:{value:Ee.nm}}),ge.ty="tr",ge.mn=Ee.mn,ge.propertyGroup=ye,ge}function o(Ee,Ie,ye){function ge(Ve){return Ee.p.ix===Ve?ge.position:Ee.s.ix===Ve?ge.size:null}var Se=propertyGroupFactory(ge,ye);ge.propertyIndex=Ee.ix;var Ce=Ie.sh.ty==="tm"?Ie.sh.prop:Ie.sh;return Ce.s.setGroupProperty(PropertyInterface("Size",Se)),Ce.p.setGroupProperty(PropertyInterface("Position",Se)),Object.defineProperties(ge,{size:{get:ExpressionPropertyInterface(Ce.s)},position:{get:ExpressionPropertyInterface(Ce.p)},_name:{value:Ee.nm}}),ge.mn=Ee.mn,ge}function Te(Ee,Ie,ye){function ge(Ve){return Ee.p.ix===Ve?ge.position:Ee.r.ix===Ve?ge.rotation:Ee.pt.ix===Ve?ge.points:Ee.or.ix===Ve||Ve==="ADBE Vector Star Outer Radius"?ge.outerRadius:Ee.os.ix===Ve?ge.outerRoundness:!Ee.ir||Ee.ir.ix!==Ve&&Ve!=="ADBE Vector Star Inner Radius"?Ee.is&&Ee.is.ix===Ve?ge.innerRoundness:null:ge.innerRadius}var Se=propertyGroupFactory(ge,ye),Ce=Ie.sh.ty==="tm"?Ie.sh.prop:Ie.sh;return ge.propertyIndex=Ee.ix,Ce.or.setGroupProperty(PropertyInterface("Outer Radius",Se)),Ce.os.setGroupProperty(PropertyInterface("Outer Roundness",Se)),Ce.pt.setGroupProperty(PropertyInterface("Points",Se)),Ce.p.setGroupProperty(PropertyInterface("Position",Se)),Ce.r.setGroupProperty(PropertyInterface("Rotation",Se)),Ee.ir&&(Ce.ir.setGroupProperty(PropertyInterface("Inner Radius",Se)),Ce.is.setGroupProperty(PropertyInterface("Inner Roundness",Se))),Object.defineProperties(ge,{position:{get:ExpressionPropertyInterface(Ce.p)},rotation:{get:ExpressionPropertyInterface(Ce.r)},points:{get:ExpressionPropertyInterface(Ce.pt)},outerRadius:{get:ExpressionPropertyInterface(Ce.or)},outerRoundness:{get:ExpressionPropertyInterface(Ce.os)},innerRadius:{get:ExpressionPropertyInterface(Ce.ir)},innerRoundness:{get:ExpressionPropertyInterface(Ce.is)},_name:{value:Ee.nm}}),ge.mn=Ee.mn,ge}function Pe(Ee,Ie,ye){function ge(Ve){return Ee.p.ix===Ve?ge.position:Ee.r.ix===Ve?ge.roundness:Ee.s.ix===Ve||Ve==="Size"||Ve==="ADBE Vector Rect Size"?ge.size:null}var Se=propertyGroupFactory(ge,ye),Ce=Ie.sh.ty==="tm"?Ie.sh.prop:Ie.sh;return ge.propertyIndex=Ee.ix,Ce.p.setGroupProperty(PropertyInterface("Position",Se)),Ce.s.setGroupProperty(PropertyInterface("Size",Se)),Ce.r.setGroupProperty(PropertyInterface("Rotation",Se)),Object.defineProperties(ge,{position:{get:ExpressionPropertyInterface(Ce.p)},roundness:{get:ExpressionPropertyInterface(Ce.r)},size:{get:ExpressionPropertyInterface(Ce.s)},_name:{value:Ee.nm}}),ge.mn=Ee.mn,ge}function ve(Ee,Ie,ye){function ge(Ve){return Ee.r.ix===Ve||Ve==="Round Corners 1"?ge.radius:null}var Se=propertyGroupFactory(ge,ye),Ce=Ie;return ge.propertyIndex=Ee.ix,Ce.rd.setGroupProperty(PropertyInterface("Radius",Se)),Object.defineProperties(ge,{radius:{get:ExpressionPropertyInterface(Ce.rd)},_name:{value:Ee.nm}}),ge.mn=Ee.mn,ge}function Ae(Ee,Ie,ye){function ge(Ve){return Ee.c.ix===Ve||Ve==="Copies"?ge.copies:Ee.o.ix===Ve||Ve==="Offset"?ge.offset:null}var Se=propertyGroupFactory(ge,ye),Ce=Ie;return ge.propertyIndex=Ee.ix,Ce.c.setGroupProperty(PropertyInterface("Copies",Se)),Ce.o.setGroupProperty(PropertyInterface("Offset",Se)),Object.defineProperties(ge,{copies:{get:ExpressionPropertyInterface(Ce.c)},offset:{get:ExpressionPropertyInterface(Ce.o)},_name:{value:Ee.nm}}),ge.mn=Ee.mn,ge}return function(Ee,Ie,ye){var ge;function Se(Ce){if(typeof Ce=="number")return(Ce=Ce===void 0?1:Ce)===0?ye:ge[Ce-1];for(var Ve=0,at=ge.length;Ve<at;){if(ge[Ve]._name===Ce)return ge[Ve];Ve+=1}return null}return Se.propertyGroup=propertyGroupFactory(Se,function(){return ye}),ge=D(Ee,Ie,Se.propertyGroup),Se.numProperties=ge.length,Se._name="Contents",Se}}(),TextExpressionInterface=function(D){var O;function q(J){return J==="ADBE Text Document"?q.sourceText:null}return Object.defineProperty(q,"sourceText",{get:function(){D.textProperty.getValue();var J=D.textProperty.currentData.t;return O&&J===O.value||((O=new String(J)).value=J||new String(J),Object.defineProperty(O,"style",{get:function(){return{fillColor:D.textProperty.currentData.fc}}})),O}}),q};function _typeof(D){return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},_typeof(D)}var FootageInterface=(dataInterfaceFactory=function(D){function O(q){return q==="Outline"?O.outlineInterface():null}return O._name="Outline",O.outlineInterface=function(q){var J="",ie=q.getFootageData();function le(_e){if(ie[_e])return J=_e,_typeof(ie=ie[_e])==="object"?le:ie;var o=_e.indexOf(J);
vendor: 14,833 bytes, line 18
18if(o!==-1){var Te=parseInt(_e.substr(o+J.length),10);return _typeof(ie=ie[Te])==="object"?le:ie}return""}return function(){return J="",ie=q.getFootageData(),le}}(D),O},function(D){function O(q){return q==="Data"?O.dataInterface:null}return O._name="Data",O.dataInterface=dataInterfaceFactory(D),O}),dataInterfaceFactory,interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(D){return interfaces[D]||null}var expressionHelpers={searchExpressions:function(D,O,q){O.x&&(q.k=!0,q.x=!0,q.initiateExpression=ExpressionManager.initiateExpression,q.effectsSequence.push(q.initiateExpression(D,O,q).bind(q)))},getSpeedAtTime:function(D){var O=this.getValueAtTime(D),q=this.getValueAtTime(D+-.01),J=0;if(O.length){var ie;for(ie=0;ie<O.length;ie+=1)J+=Math.pow(q[ie]-O[ie],2);J=100*Math.sqrt(J)}else J=0;return J},getVelocityAtTime:function(D){if(this.vel!==void 0)return this.vel;var O,q,J=-.001,ie=this.getValueAtTime(D),le=this.getValueAtTime(D+J);if(ie.length)for(O=createTypedArray("float32",ie.length),q=0;q<ie.length;q+=1)O[q]=(le[q]-ie[q])/J;else O=(le-ie)/J;return O},getValueAtTime:function(D){return D*=this.elem.globalData.frameRate,(D-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<D?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(D,this._cachingAtTime),this._cachingAtTime.lastFrame=D),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(D){this.propertyGroup=D}};function addPropertyDecorator(){function D(Ae,Ee,Ie){if(!this.k||!this.keyframes)return this.pv;Ae=Ae?Ae.toLowerCase():"";var ye,ge,Se,Ce,Ve,at=this.comp.renderedFrame,et=this.keyframes,Mt=et[et.length-1].t;if(at<=Mt)return this.pv;if(Ie?ge=Mt-(ye=Ee?Math.abs(Mt-this.elem.comp.globalData.frameRate*Ee):Math.max(0,Mt-this.elem.data.ip)):((!Ee||Ee>et.length-1)&&(Ee=et.length-1),ye=Mt-(ge=et[et.length-1-Ee].t)),Ae==="pingpong"){if(Math.floor((at-ge)/ye)%2!=0)return this.getValueAtTime((ye-(at-ge)%ye+ge)/this.comp.globalData.frameRate,0)}else{if(Ae==="offset"){var jt=this.getValueAtTime(ge/this.comp.globalData.frameRate,0),St=this.getValueAtTime(Mt/this.comp.globalData.frameRate,0),Bt=this.getValueAtTime(((at-ge)%ye+ge)/this.comp.globalData.frameRate,0),Zt=Math.floor((at-ge)/ye);if(this.pv.length){for(Ce=(Ve=new Array(jt.length)).length,Se=0;Se<Ce;Se+=1)Ve[Se]=(St[Se]-jt[Se])*Zt+Bt[Se];return Ve}return(St-jt)*Zt+Bt}if(Ae==="continue"){var xt=this.getValueAtTime(Mt/this.comp.globalData.frameRate,0),wt=this.getValueAtTime((Mt-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(Ce=(Ve=new Array(xt.length)).length,Se=0;Se<Ce;Se+=1)Ve[Se]=xt[Se]+(xt[Se]-wt[Se])*((at-Mt)/this.comp.globalData.frameRate)/5e-4;return Ve}return xt+(at-Mt)/.001*(xt-wt)}}return this.getValueAtTime(((at-ge)%ye+ge)/this.comp.globalData.frameRate,0)}function O(Ae,Ee,Ie){if(!this.k)return this.pv;Ae=Ae?Ae.toLowerCase():"";var ye,ge,Se,Ce,Ve,at=this.comp.renderedFrame,et=this.keyframes,Mt=et[0].t;if(at>=Mt)return this.pv;if(Ie?ge=Mt+(ye=Ee?Math.abs(this.elem.comp.globalData.frameRate*Ee):Math.max(0,this.elem.data.op-Mt)):((!Ee||Ee>et.length-1)&&(Ee=et.length-1),ye=(ge=et[Ee].t)-Mt),Ae==="pingpong"){if(Math.floor((Mt-at)/ye)%2==0)return this.getValueAtTime(((Mt-at)%ye+Mt)/this.comp.globalData.frameRate,0)}else{if(Ae==="offset"){var jt=this.getValueAtTime(Mt/this.comp.globalData.frameRate,0),St=this.getValueAtTime(ge/this.comp.globalData.frameRate,0),Bt=this.getValueAtTime((ye-(Mt-at)%ye+Mt)/this.comp.globalData.frameRate,0),Zt=Math.floor((Mt-at)/ye)+1;if(this.pv.length){for(Ce=(Ve=new Array(jt.length)).length,Se=0;Se<Ce;Se+=1)Ve[Se]=Bt[Se]-(St[Se]-jt[Se])*Zt;return Ve}return Bt-(St-jt)*Zt}if(Ae==="continue"){var xt=this.getValueAtTime(Mt/this.comp.globalData.frameRate,0),wt=this.getValueAtTime((Mt+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(Ce=(Ve=new Array(xt.length)).length,Se=0;Se<Ce;Se+=1)Ve[Se]=xt[Se]+(xt[Se]-wt[Se])*(Mt-at)/.001;return Ve}return xt+(xt-wt)*(Mt-at)/.001}}return this.getValueAtTime((ye-((Mt-at)%ye+Mt))/this.comp.globalData.frameRate,0)}function q(Ae,Ee){if(!this.k)return this.pv;if(Ae=.5*(Ae||.4),(Ee=Math.floor(Ee||5))<=1)return this.pv;var Ie,ye,ge=this.comp.renderedFrame/this.comp.globalData.frameRate,Se=ge-Ae,Ce=Ee>1?(ge+Ae-Se)/(Ee-1):1,Ve=0,at=0;for(Ie=this.pv.length?createTypedArray("float32",this.pv.length):0;Ve<Ee;){if(ye=this.getValueAtTime(Se+Ve*Ce),this.pv.length)for(at=0;at<this.pv.length;at+=1)Ie[at]+=ye[at];else Ie+=ye;Ve+=1}if(this.pv.length)for(at=0;at<this.pv.length;at+=1)Ie[at]/=Ee;else Ie/=Ee;return Ie}function J(Ae){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var Ee=this._transformCachingAtTime.v;if(Ee.cloneFromProps(this.pre.props),this.appliedTransformations<1){var Ie=this.a.getValueAtTime(Ae);Ee.translate(-Ie[0]*this.a.mult,-Ie[1]*this.a.mult,Ie[2]*this.a.mult)}if(this.appliedTransformations<2){var ye=this.s.getValueAtTime(Ae);Ee.scale(ye[0]*this.s.mult,ye[1]*this.s.mult,ye[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var ge=this.sk.getValueAtTime(Ae),Se=this.sa.getValueAtTime(Ae);Ee.skewFromAxis(-ge*this.sk.mult,Se*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var Ce=this.r.getValueAtTime(Ae);Ee.rotate(-Ce*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var Ve=this.rz.getValueAtTime(Ae),at=this.ry.getValueAtTime(Ae),et=this.rx.getValueAtTime(Ae),Mt=this.or.getValueAtTime(Ae);Ee.rotateZ(-Ve*this.rz.mult).rotateY(at*this.ry.mult).rotateX(et*this.rx.mult).rotateZ(-Mt[2]*this.or.mult).rotateY(Mt[1]*this.or.mult).rotateX(Mt[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var jt=this.px.getValueAtTime(Ae),St=this.py.getValueAtTime(Ae);if(this.data.p.z){var Bt=this.pz.getValueAtTime(Ae);Ee.translate(jt*this.px.mult,St*this.py.mult,-Bt*this.pz.mult)}else Ee.translate(jt*this.px.mult,St*this.py.mult,0)}else{var Zt=this.p.getValueAtTime(Ae);Ee.translate(Zt[0]*this.p.mult,Zt[1]*this.p.mult,-Zt[2]*this.p.mult)}return Ee}function ie(){return this.v.clone(new Matrix)}var le=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(Ae,Ee,Ie){var ye=le(Ae,Ee,Ie);return ye.dynamicProperties.length?ye.getValueAtTime=J.bind(ye):ye.getValueAtTime=ie.bind(ye),ye.setGroupProperty=expressionHelpers.setGroupProperty,ye};var _e=PropertyFactory.getProp;PropertyFactory.getProp=function(Ae,Ee,Ie,ye,ge){var Se=_e(Ae,Ee,Ie,ye,ge);Se.kf?Se.getValueAtTime=expressionHelpers.getValueAtTime.bind(Se):Se.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(Se),Se.setGroupProperty=expressionHelpers.setGroupProperty,Se.loopOut=D,Se.loopIn=O,Se.smooth=q,Se.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(Se),Se.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(Se),Se.numKeys=Ee.a===1?Ee.k.length:0,Se.propertyIndex=Ee.ix;var Ce=0;return Ie!==0&&(Ce=createTypedArray("float32",Ee.a===1?Ee.k[0].s.length:Ee.k.length)),Se._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:Ce},expressionHelpers.searchExpressions(Ae,Ee,Se),Se.k&&ge.addDynamicProperty(Se),Se};var o=ShapePropertyFactory.getConstructorFunction(),Te=ShapePropertyFactory.getKeyframedConstructorFunction();function Pe(){}Pe.prototype={vertices:function(Ae,Ee){this.k&&this.getValue();var Ie,ye=this.v;Ee!==void 0&&(ye=this.getValueAtTime(Ee,0));var ge=ye._length,Se=ye[Ae],Ce=ye.v,Ve=createSizedArray(ge);for(Ie=0;Ie<ge;Ie+=1)Ve[Ie]=Ae==="i"||Ae==="o"?[Se[Ie][0]-Ce[Ie][0],Se[Ie][1]-Ce[Ie][1]]:[Se[Ie][0],Se[Ie][1]];return Ve},points:function(Ae){return this.vertices("v",Ae)},inTangents:function(Ae){return this.vertices("i",Ae)},outTangents:function(Ae){return this.vertices("o",Ae)},isClosed:function(){return this.v.c},pointOnPath:function(Ae,Ee){var Ie=this.v;Ee!==void 0&&(Ie=this.getValueAtTime(Ee,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(Ie));for(var ye,ge=this._segmentsLength,Se=ge.lengths,Ce=ge.totalLength*Ae,Ve=0,at=Se.length,et=0;Ve<at;){if(et+Se[Ve].addedLength>Ce){var Mt=Ve,jt=Ie.c&&Ve===at-1?0:Ve+1,St=(Ce-et)/Se[Ve].addedLength;ye=bez.getPointInSegment(Ie.v[Mt],Ie.v[jt],Ie.o[Mt],Ie.i[jt],St,Se[Ve]);break}et+=Se[Ve].addedLength,Ve+=1}return ye||(ye=Ie.c?[Ie.v[0][0],Ie.v[0][1]]:[Ie.v[Ie._length-1][0],Ie.v[Ie._length-1][1]]),ye},vectorOnPath:function(Ae,Ee,Ie){Ae==1?Ae=this.v.c:Ae==0&&(Ae=.999);var ye=this.pointOnPath(Ae,Ee),ge=this.pointOnPath(Ae+.001,Ee),Se=ge[0]-ye[0],Ce=ge[1]-ye[1],Ve=Math.sqrt(Math.pow(Se,2)+Math.pow(Ce,2));return Ve===0?[0,0]:Ie==="tangent"?[Se/Ve,Ce/Ve]:[-Ce/Ve,Se/Ve]},tangentOnPath:function(Ae,Ee){return this.vectorOnPath(Ae,Ee,"tangent")},normalOnPath:function(Ae,Ee){return this.vectorOnPath(Ae,Ee,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([Pe],o),extendPrototype([Pe],Te),Te.prototype.getValueAtTime=function(Ae){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),Ae*=this.elem.globalData.frameRate,(Ae-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<Ae?this._caching.lastIndex:0,this._cachingAtTime.lastTime=Ae,this.interpolateShape(Ae,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},Te.prototype.initiateExpression=ExpressionManager.initiateExpression;var ve=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(Ae,Ee,Ie,ye,ge){var Se=ve(Ae,Ee,Ie,ye,ge);return Se.propertyIndex=Ee.ix,Se.lock=!1,Ie===3?expressionHelpers.searchExpressions(Ae,Ee.pt,Se):Ie===4&&expressionHelpers.searchExpressions(Ae,Ee.ks,Se),Se.k&&Ae.addDynamicProperty(Se),Se}}function initialize$1(){addPropertyDecorator()}function addDecorator(){TextProperty.prototype.getExpressionValue=function(D,O){var q=this.calculateExpression(O);if(D.t!==q){var J={};return this.copyData(J,D),J.t=q.toString(),J.__complete=!1,J}return D},TextProperty.prototype.searchProperty=function(){var D=this.searchKeyframes(),O=this.searchExpressions();return this.kf=D||O,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function(D,O){var q,J,ie=createNS("feMerge");for(ie.setAttribute("result",D),J=0;J<O.length;J+=1)(q=createNS("feMergeNode")).setAttribute("in",O[J]),ie.appendChild(q),ie.appendChild(q);return ie}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(D,O,q,J,ie){this.filterManager=O;var le=createNS("feColorMatrix");le.setAttribute("type","matrix"),le.setAttribute("color-interpolation-filters","linearRGB"),le.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=le,le.setAttribute("result",J+"_tint_1"),D.appendChild(le),(le=createNS("feColorMatrix")).setAttribute("type","matrix"),le.setAttribute("color-interpolation-filters","sRGB"),le.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),le.setAttribute("result",J+"_tint_2"),D.appendChild(le),this.matrixFilter=le;var _e=this.createMergeNode(J,[ie,J+"_tint_1",J+"_tint_2"]);D.appendChild(_e)}function SVGFillFilter(D,O,q,J){this.filterManager=O;var ie=createNS("feColorMatrix");ie.setAttribute("type","matrix"),ie.setAttribute("color-interpolation-filters","sRGB"),ie.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),ie.setAttribute("result",J),D.appendChild(ie),this.matrixFilter=ie}function SVGStrokeEffect(D,O,q){this.initialized=!1,this.filterManager=O,this.elem=q,this.paths=[]}function SVGTritoneFilter(D,O,q,J){this.filterManager=O;var ie=createNS("feColorMatrix");ie.setAttribute("type","matrix"),ie.setAttribute("color-interpolation-filters","linearRGB"),ie.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),D.appendChild(ie);var le=createNS("feComponentTransfer");le.setAttribute("color-interpolation-filters","sRGB"),le.setAttribute("result",J),this.matrixFilter=le;var _e=createNS("feFuncR");_e.setAttribute("type","table"),le.appendChild(_e),this.feFuncR=_e;var o=createNS("feFuncG");o.setAttribute("type","table"),le.appendChild(o),this.feFuncG=o;var Te=createNS("feFuncB");Te.setAttribute("type","table"),le.appendChild(Te),this.feFuncB=Te,D.appendChild(le)}function SVGProLevelsFilter(D,O,q,J){this.filterManager=O;var ie=this.filterManager.effectElements,le=createNS("feComponentTransfer");(ie[10].p.k||ie[10].p.v!==0||ie[11].p.k||ie[11].p.v!==1||ie[12].p.k||ie[12].p.v!==1||ie[13].p.k||ie[13].p.v!==0||ie[14].p.k||ie[14].p.v!==1)&&(this.feFuncR=this.createFeFunc("feFuncR",le)),(ie[17].p.k||ie[17].p.v!==0||ie[18].p.k||ie[18].p.v!==1||ie[19].p.k||ie[19].p.v!==1||ie[20].p.k||ie[20].p.v!==0||ie[21].p.k||ie[21].p.v!==1)&&(this.feFuncG=this.createFeFunc("feFuncG",le)),(ie[24].p.k||ie[24].p.v!==0||ie[25].p.k||ie[25].p.v!==1||ie[26].p.k||ie[26].p.v!==1||ie[27].p.k||ie[27].p.v!==0||ie[28].p.k||ie[28].p.v!==1)&&(this.feFuncB=this.createFeFunc("feFuncB",le)),(ie[31].p.k||ie[31].p.v!==0||ie[32].p.k||ie[32].p.v!==1||ie[33].p.k||ie[33].p.v!==1||ie[34].p.k||ie[34].p.v!==0||ie[35].p.k||ie[35].p.v!==1)&&(this.feFuncA=this.createFeFunc("feFuncA",le)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(le.setAttribute("color-interpolation-filters","sRGB"),D.appendChild(le)),(ie[3].p.k||ie[3].p.v!==0||ie[4].p.k||ie[4].p.v!==1||ie[5].p.k||ie[5].p.v!==1||ie[6].p.k||ie[6].p.v!==0||ie[7].p.k||ie[7].p.v!==1)&&((le=createNS("feComponentTransfer")).setAttribute("color-interpolation-filters","sRGB"),le.setAttribute("result",J),D.appendChild(le),this.feFuncRComposed=this.createFeFunc("feFuncR",le),this.feFuncGComposed=this.createFeFunc("feFuncG",le),this.feFuncBComposed=this.createFeFunc("feFuncB",le))}function SVGDropShadowEffect(D,O,q,J,ie){var le=O.container.globalData.renderConfig.filterSize,_e=O.data.fs||le;D.setAttribute("x",_e.x||le.x),D.setAttribute("y",_e.y||le.y),D.setAttribute("width",_e.width||le.width),D.setAttribute("height",_e.height||le.height),this.filterManager=O;var o=createNS("feGaussianBlur");o.setAttribute("in","SourceAlpha"),o.setAttribute("result",J+"_drop_shadow_1"),o.setAttribute("stdDeviation","0"),this.feGaussianBlur=o,D.appendChild(o);var Te=createNS("feOffset");Te.setAttribute("dx","25"),Te.setAttribute("dy","0"),Te.setAttribute("in",J+"_drop_shadow_1"),Te.setAttribute("result",J+"_drop_shadow_2"),this.feOff
vendor: 7,428 bytes, line 18
18set=Te,D.appendChild(Te);var Pe=createNS("feFlood");Pe.setAttribute("flood-color","#00ff00"),Pe.setAttribute("flood-opacity","1"),Pe.setAttribute("result",J+"_drop_shadow_3"),this.feFlood=Pe,D.appendChild(Pe);var ve=createNS("feComposite");ve.setAttribute("in",J+"_drop_shadow_3"),ve.setAttribute("in2",J+"_drop_shadow_2"),ve.setAttribute("operator","in"),ve.setAttribute("result",J+"_drop_shadow_4"),D.appendChild(ve);var Ae=this.createMergeNode(J,[J+"_drop_shadow_4",ie]);D.appendChild(Ae)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(D){if(D||this.filterManager._mdf){var O=this.filterManager.effectElements[0].p.v,q=this.filterManager.effectElements[1].p.v,J=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+J+" 0"),this.matrixFilter.setAttribute("values",q[0]-O[0]+" 0 0 0 "+O[0]+" "+(q[1]-O[1])+" 0 0 0 "+O[1]+" "+(q[2]-O[2])+" 0 0 0 "+O[2]+" 0 0 0 1 0")}},SVGFillFilter.prototype.renderFrame=function(D){if(D||this.filterManager._mdf){var O=this.filterManager.effectElements[2].p.v,q=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+O[0]+" 0 0 0 0 "+O[1]+" 0 0 0 0 "+O[2]+" 0 0 0 "+q+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var D,O,q,J,ie=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(this.filterManager.effectElements[1].p.v===1?(J=this.elem.maskManager.masksProperties.length,q=0):J=1+(q=this.filterManager.effectElements[0].p.v-1),(O=createNS("g")).setAttribute("fill","none"),O.setAttribute("stroke-linecap","round"),O.setAttribute("stroke-dashoffset",1);q<J;q+=1)D=createNS("path"),O.appendChild(D),this.paths.push({p:D,m:q});if(this.filterManager.effectElements[10].p.v===3){var le=createNS("mask"),_e=createElementID();le.setAttribute("id",_e),le.setAttribute("mask-type","alpha"),le.appendChild(O),this.elem.globalData.defs.appendChild(le);var o=createNS("g");for(o.setAttribute("mask","url("+getLocationHref()+"#"+_e+")");ie[0];)o.appendChild(ie[0]);this.elem.layerElement.appendChild(o),this.masker=le,O.setAttribute("stroke","#fff")}else if(this.filterManager.effectElements[10].p.v===1||this.filterManager.effectElements[10].p.v===2){if(this.filterManager.effectElements[10].p.v===2)for(ie=this.elem.layerElement.children||this.elem.layerElement.childNodes;ie.length;)this.elem.layerElement.removeChild(ie[0]);this.elem.layerElement.appendChild(O),this.elem.layerElement.removeAttribute("mask"),O.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=O},SVGStrokeEffect.prototype.renderFrame=function(D){var O;this.initialized||this.initialize();var q,J,ie=this.paths.length;for(O=0;O<ie;O+=1)if(this.paths[O].m!==-1&&(q=this.elem.maskManager.viewData[this.paths[O].m],J=this.paths[O].p,(D||this.filterManager._mdf||q.prop._mdf)&&J.setAttribute("d",q.lastPath),D||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||q.prop._mdf)){var le;if(this.filterManager.effectElements[7].p.v!==0||this.filterManager.effectElements[8].p.v!==100){var _e=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),o=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),Te=J.getTotalLength();le="0 0 0 "+Te*_e+" ";var Pe,ve=Te*(o-_e),Ae=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,Ee=Math.floor(ve/Ae);for(Pe=0;Pe<Ee;Pe+=1)le+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";le+="0 "+10*Te+" 0 0"}else le="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;J.setAttribute("stroke-dasharray",le)}if((D||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(D||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(this.filterManager.effectElements[10].p.v===1||this.filterManager.effectElements[10].p.v===2)&&(D||this.filterManager.effectElements[3].p._mdf)){var Ie=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*Ie[0])+","+bmFloor(255*Ie[1])+","+bmFloor(255*Ie[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(D){if(D||this.filterManager._mdf){var O=this.filterManager.effectElements[0].p.v,q=this.filterManager.effectElements[1].p.v,J=this.filterManager.effectElements[2].p.v,ie=J[0]+" "+q[0]+" "+O[0],le=J[1]+" "+q[1]+" "+O[1],_e=J[2]+" "+q[2]+" "+O[2];this.feFuncR.setAttribute("tableValues",ie),this.feFuncG.setAttribute("tableValues",le),this.feFuncB.setAttribute("tableValues",_e)}},SVGProLevelsFilter.prototype.createFeFunc=function(D,O){var q=createNS(D);return q.setAttribute("type","table"),O.appendChild(q),q},SVGProLevelsFilter.prototype.getTableValue=function(D,O,q,J,ie){for(var le,_e,o=0,Te=Math.min(D,O),Pe=Math.max(D,O),ve=Array.call(null,{length:256}),Ae=0,Ee=ie-J,Ie=O-D;o<=256;)_e=(le=o/256)<=Te?Ie<0?ie:J:le>=Pe?Ie<0?J:ie:J+Ee*Math.pow((le-D)/Ie,1/q),ve[Ae]=_e,Ae+=1,o+=256/255;return ve.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(D){if(D||this.filterManager._mdf){var O,q=this.filterManager.effectElements;this.feFuncRComposed&&(D||q[3].p._mdf||q[4].p._mdf||q[5].p._mdf||q[6].p._mdf||q[7].p._mdf)&&(O=this.getTableValue(q[3].p.v,q[4].p.v,q[5].p.v,q[6].p.v,q[7].p.v),this.feFuncRComposed.setAttribute("tableValues",O),this.feFuncGComposed.setAttribute("tableValues",O),this.feFuncBComposed.setAttribute("tableValues",O)),this.feFuncR&&(D||q[10].p._mdf||q[11].p._mdf||q[12].p._mdf||q[13].p._mdf||q[14].p._mdf)&&(O=this.getTableValue(q[10].p.v,q[11].p.v,q[12].p.v,q[13].p.v,q[14].p.v),this.feFuncR.setAttribute("tableValues",O)),this.feFuncG&&(D||q[17].p._mdf||q[18].p._mdf||q[19].p._mdf||q[20].p._mdf||q[21].p._mdf)&&(O=this.getTableValue(q[17].p.v,q[18].p.v,q[19].p.v,q[20].p.v,q[21].p.v),this.feFuncG.setAttribute("tableValues",O)),this.feFuncB&&(D||q[24].p._mdf||q[25].p._mdf||q[26].p._mdf||q[27].p._mdf||q[28].p._mdf)&&(O=this.getTableValue(q[24].p.v,q[25].p.v,q[26].p.v,q[27].p.v,q[28].p.v),this.feFuncB.setAttribute("tableValues",O)),this.feFuncA&&(D||q[31].p._mdf||q[32].p._mdf||q[33].p._mdf||q[34].p._mdf||q[35].p._mdf)&&(O=this.getTableValue(q[31].p.v,q[32].p.v,q[33].p.v,q[34].p.v,q[35].p.v),this.feFuncA.setAttribute("tableValues",O))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(D){if(D||this.filterManager._mdf){if((D||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),D||this.filterManager.effectElements[0].p._mdf){var O=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*O[0]),Math.round(255*O[1]),Math.round(255*O[2])))}if((D||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),D||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var q=this.filterManager.effectElements[3].p.v,J=(this.filterManager.effectElements[2].p.v-90)*degToRads,ie=q*Math.cos(J),le=q*Math.sin(J);
vendor: 4,246 bytes, line 18
18this.feOffset.setAttribute("dx",ie),this.feOffset.setAttribute("dy",le)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(D,O,q){this.initialized=!1,this.filterManager=O,this.filterElem=D,this.elem=q,q.matteElement=createNS("g"),q.matteElement.appendChild(q.layerElement),q.matteElement.appendChild(q.transformedElement),q.baseElement=q.matteElement}function SVGGaussianBlurEffect(D,O,q,J){D.setAttribute("x","-100%"),D.setAttribute("y","-100%"),D.setAttribute("width","300%"),D.setAttribute("height","300%"),this.filterManager=O;var ie=createNS("feGaussianBlur");ie.setAttribute("result",J),D.appendChild(ie),this.feGaussianBlur=ie}function TransformEffect(){}function SVGTransformEffect(D,O){this.init(O)}function CVTransformEffect(D){this.init(D)}return SVGMatte3Effect.prototype.findSymbol=function(D){for(var O=0,q=_svgMatteSymbols.length;O<q;){if(_svgMatteSymbols[O]===D)return _svgMatteSymbols[O];O+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(D,O){var q=D.layerElement.parentNode;if(q){for(var J,ie=q.children,le=0,_e=ie.length;le<_e&&ie[le]!==D.layerElement;)le+=1;le<=_e-2&&(J=ie[le+1]);var o=createNS("use");o.setAttribute("href","#"+O),J?q.insertBefore(o,J):q.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(D,O){if(!this.findSymbol(O)){var q=createElementID(),J=createNS("mask");J.setAttribute("id",O.layerId),J.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(O);var ie=D.globalData.defs;ie.appendChild(J);var le=createNS("symbol");le.setAttribute("id",q),this.replaceInParent(O,q),le.appendChild(O.layerElement),ie.appendChild(le);var _e=createNS("use");_e.setAttribute("href","#"+q),J.appendChild(_e),O.data.hd=!1,O.show()}D.setMatte(O.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var D=this.filterManager.effectElements[0].p.v,O=this.elem.comp.elements,q=0,J=O.length;q<J;)O[q]&&O[q].data.ind===D&&this.setElementAsMask(this.elem,O[q]),q+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGGaussianBlurEffect.prototype.renderFrame=function(D){if(D||this.filterManager._mdf){var O=.3*this.filterManager.effectElements[0].p.v,q=this.filterManager.effectElements[1].p.v,J=q==3?0:O,ie=q==2?0:O;this.feGaussianBlur.setAttribute("stdDeviation",J+" "+ie);var le=this.filterManager.effectElements[2].p.v==1?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",le)}},TransformEffect.prototype.init=function(D){this.effectsManager=D,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1},TransformEffect.prototype.renderFrame=function(D){if(this._opMdf=!1,this._mdf=!1,D||this.effectsManager._mdf){var O=this.effectsManager.effectElements,q=O[0].p.v,J=O[1].p.v,ie=O[2].p.v===1,le=O[3].p.v,_e=ie?le:O[4].p.v,o=O[5].p.v,Te=O[6].p.v,Pe=O[7].p.v;this.matrix.reset(),this.matrix.translate(-q[0],-q[1],q[2]),this.matrix.scale(.01*_e,.01*le,1),this.matrix.rotate(-Pe*degToRads),this.matrix.skewFromAxis(-o*degToRads,(Te+90)*degToRads),this.matrix.translate(J[0],J[1],0),this._mdf=!0,this.opacity!==O[8].p.v&&(this.opacity=O[8].p.v,this._opMdf=!0)}},extendPrototype([TransformEffect],SVGTransformEffect),extendPrototype([TransformEffect],CVTransformEffect),registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect$1(20,SVGTintFilter,!0),registerEffect$1(21,SVGFillFilter,!0),registerEffect$1(22,SVGStrokeEffect,!1),registerEffect$1(23,SVGTritoneFilter,!0),registerEffect$1(24,SVGProLevelsFilter,!0),registerEffect$1(25,SVGDropShadowEffect,!0),registerEffect$1(28,SVGMatte3Effect,!1),registerEffect$1(29,SVGGaussianBlurEffect,!0),registerEffect$1(35,SVGTransformEffect,!1),registerEffect(35,CVTransformEffect),lottie},module.exports=factory())}
18)(lottie$1,lottie$1.exports);var _templateObject$1,styles=r$3(_templateObject$1||(_templateObject$1=_taggedTemplateLiteral([`
19  * {
20    box-sizing: border-box;
21  }
22
23  :host {
24    --lottie-player-toolbar-height: 35px;
25    --lottie-player-toolbar-background-color: transparent;
26    --lottie-player-toolbar-icon-color: #999;
27    --lottie-player-toolbar-icon-hover-color: #222;
28    --lottie-player-toolbar-icon-active-color: #555;
29    --lottie-player-seeker-track-color: #ccc;
30    --lottie-player-seeker-thumb-color: rgba(0, 107, 120, 0.8);
31    --lottie-player-seeker-display: block;
32
33    display: block;
34    width: 100%;
35    height: 100%;
36  }
37
38  .main {
39    display: flex;
40    flex-direction: column;
41    height: 100%;
42    width: 100%;
43  }
44
45  .animation {
46    width: 100%;
47    height: 100%;
48    display: flex;
49  }
50  .animation.controls {
51    height: calc(100% - 35px);
52  }
53
54  .toolbar {
55    display: flex;
56    align-items: center;
57    justify-items: center;
58    background-color: var(--lottie-player-toolbar-background-color);
59    margin: 0 5px;
60    height: 35px;
61  }
62
63  .toolbar button {
64    cursor: pointer;
65    fill: var(--lottie-player-toolbar-icon-color);
66    display: flex;
67    background: none;
68    border: 0;
69    padding: 0;
70    outline: none;
71    height: 100%;
72  }
73
74  .toolbar button:hover {
75    fill: var(--lottie-player-toolbar-icon-hover-color);
76  }
77
78  .toolbar button.active {
79    fill: var(--lottie-player-toolbar-icon-active-color);
80  }
81
82  .toolbar button.active:hover {
83    fill: var(--lottie-player-toolbar-icon-hover-color);
84  }
85
86  .toolbar button:focus {
87    outline: 1px dotted var(--lottie-player-toolbar-icon-active-color);
88  }
89
90  .toolbar button svg {
91  }
92
93  .toolbar button.disabled svg {
94    display: none;
95  }
96
97  .seeker {
98    -webkit-appearance: none;
99    width: 95%;
100    outline: none;
101    background-color: var(--lottie-player-toolbar-background-color);
102    display: var(--lottie-player-seeker-display);
103  }
104
105  .seeker::-webkit-slider-runnable-track {
106    width: 100%;
107    height: 5px;
108    cursor: pointer;
109    background: var(--lottie-player-seeker-track-color);
110    border-radius: 3px;
111  }
112  .seeker::-webkit-slider-thumb {
113    height: 15px;
114    width: 15px;
115    border-radius: 50%;
116    background: var(--lottie-player-seeker-thumb-color);
117    cursor: pointer;
118    -webkit-appearance: none;
119    margin-top: -5px;
120  }
121  .seeker:focus::-webkit-slider-runnable-track {
122    background: #999;
123  }
124  .seeker::-moz-range-track {
125    width: 100%;
126    height: 5px;
127    cursor: pointer;
128    background: var(--lottie-player-seeker-track-color);
129    border-radius: 3px;
130  }
131  .seeker::-moz-range-thumb {
132    height: 15px;
133    width: 15px;
134    border-radius: 50%;
135    background: var(--lottie-player-seeker-thumb-color);
136    cursor: pointer;
137  }
138  .seeker::-ms-track {
139    width: 100%;
140    height: 5px;
141    cursor: pointer;
142    background: transparent;
143    border-color: transparent;
144    color: transparent;
145  }
146  .seeker::-ms-fill-lower {
147    background: var(--lottie-player-seeker-track-color);
148    border-radius: 3px;
149  }
150  .seeker::-ms-fill-upper {
151    background: var(--lottie-player-seeker-track-color);
152    border-radius: 3px;
153  }
154  .seeker::-ms-thumb {
155    border: 0;
156    height: 15px;
157    width: 15px;
158    border-radius: 50%;
159    background: var(--lottie-player-seeker-thumb-color);
160    cursor: pointer;
161  }
162  .seeker:focus::-ms-fill-lower {
163    background: var(--lottie-player-seeker-track-color);
164  }
165  .seeker:focus::-ms-fill-upper {
166    background: var(--lottie-player-seeker-track-color);
167  }
168
169  .error {
170    display: flex;
171    justify-content: center;
172    height: 100%;
173    align-items: center;
174  }
175`]))),version="2.0.12",dependencies={"lottie-web":"^5.12.2"},_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,PlayerState,PlayMode,PlayerEvents;function parseSrc(D){if(typeof D=="object")return D;try{return JSON.parse(D)}catch{return new URL(D,window.location.href).toString()}}function isLottie(D){return["v","ip","op","layers","fr","w","h"].every(O=>Object.prototype.hasOwnProperty.call(D,O))}function fromURL(D){return _fromURL.apply(this,arguments)}function _fromURL(){return(_fromURL=_asyncToGenerator(function*(D){if(typeof D!="string")throw new Error("The url value must be a string");var O;try{var q=new URL(D),J=yield fetch(q.toString());O=yield J.json()}catch{throw new Error("An error occurred while trying to load the Lottie file from URL")}return O})).apply(this,arguments)}(function(D){D.Destroyed="destroyed",D.Error="error",D.Frozen="frozen",D.Loading="loading",D.Paused="paused",D.Playing="playing",D.Stopped="stopped"})(PlayerState||(PlayerState={})),function(D){D.Bounce="bounce",D.Normal="normal"}(PlayMode||(PlayMode={})),function(D){D.Complete="complete",D.Destroyed="destroyed",D.Error="error",D.Frame="frame",D.Freeze="freeze",D.Load="load",D.Loop="loop",D.Pause="pause",D.Play="play",D.Ready="ready",D.Rendered="rendered",D.Stop="stop"}(PlayerEvents||(PlayerEvents={}));var LottiePlayer=class extends s{constructor(){super(...arguments),this.autoplay=!1,this.background="transparent",this.controls=!1,this.currentState=PlayerState.Loading,this.description="Lottie animation",this.direction=1,this.disableCheck=!1,this.disableShadowDOM=!1,this.hover=!1,this.intermission=1,this.loop=!1,this.mode=PlayMode.Normal,this.preserveAspectRatio="xMidYMid meet",this.renderer="svg",this.speed=1,this._io=void 0,this._counter=1,this._onVisibilityChange=()=>{document.hidden===!0&&this.currentState===PlayerState.Playing?this.freeze():this.currentState===PlayerState.Frozen&&this.play()}}load(D){var O=this;return _asyncToGenerator(function*(){var q={container:O.container,loop:!1,autoplay:!1,renderer:O.renderer,rendererSettings:Object.assign({preserveAspectRatio:O.preserveAspectRatio,clearCanvas:!1,progressiveLoad:!0,hideOnTransparent:!0},O.viewBoxSize&&{viewBoxSize:O.viewBoxSize})};try{var J=parseSrc(D),ie={},le=typeof J=="string"?"path":"animationData";O._lottie&&O._lottie.destroy(),O.webworkers&&lottie$1.exports.useWebWorker(!0),O._lottie=lottie$1.exports.loadAnimation(Object.assign(Object.assign({},q),{[le]:J})),O._attachEventListeners(),O.disableCheck||(le==="path"?(ie=yield fromURL(J),le="animationData"):ie
175=J,isLottie(ie)||(O.currentState=PlayerState.Error,O.dispatchEvent(new CustomEvent(PlayerEvents.Error))))}catch{O.currentState=PlayerState.Error,O.dispatchEvent(new CustomEvent(PlayerEvents.Error))}})()}getLottie(){return this._lottie}getVersions(){return{lottieWebVersion:dependencies["lottie-web"],lottiePlayerVersion:version}}play(){this._lottie&&(this._lottie.play(),this.currentState=PlayerState.Playing,this.dispatchEvent(new CustomEvent(PlayerEvents.Play)))}pause(){this._lottie&&(this._lottie.pause(),this.currentState=PlayerState.Paused,this.dispatchEvent(new CustomEvent(PlayerEvents.Pause)))}stop(){this._lottie&&(this._counter=1,this._lottie.stop(),this.currentState=PlayerState.Stopped,this.dispatchEvent(new CustomEvent(PlayerEvents.Stop)))}destroy(){this._lottie&&(this._lottie.destroy(),this._lottie=null,this.currentState=PlayerState.Destroyed,this.dispatchEvent(new CustomEvent(PlayerEvents.Destroyed)),this.remove())}seek(D){if(this._lottie){var O=/^(\d+)(%?)$/.exec(D.toString());if(O){var q=O[2]==="%"?this._lottie.totalFrames*Number(O[1])/100:Number(O[1]);this.seeker=q,this.currentState===PlayerState.Playing?this._lottie.goToAndPlay(q,!0):(this._lottie.goToAndStop(q,!0),this._lottie.pause())}}}
175snapshot(){var D=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];if(this.shadowRoot){var O=this.shadowRoot.querySelector(".animation svg"),q=new XMLSerializer().serializeToString(O);if(D){var J=document.createElement("a");J.href="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(q)),J.download="download_".concat(this.seeker,".svg"),document.body.appendChild(J),J.click(),document.body.removeChild(J)}return q}}setSpeed(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this._lottie&&this._lottie.setSpeed(D)}setDirection(D){this._lottie&&this._lottie.setDirection(D)}setLooping(D){this._lottie&&(this.loop=D,this._lottie.loop=D)}togglePlay(){return this.currentState===PlayerState.Playing?this.pause():this.play()}toggleLooping(){this.setLooping(!this.loop)}resize(){this._lottie&&this._lottie.resize()}static get styles(){return styles}disconnectedCallback(){this.isConnected||(this._io&&(this._io.disconnect(),this._io=void 0),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.destroy())}render(){var D=this.controls?"main controls":"main",O=this.controls?"animation controls":"animation";return $(_templateObject||(_templateObject=_taggedTemplateLiteral([` <div
176      id="animation-container"
177      class=`,`
178      lang="en"
179      aria-label=`,`
180      role="img"
181    >
182      <div
183        id="animation"
184        class=`,`
185        style="background:`,`;"
186      >
187        `,`
188      </div>
189      `,`
190    </div>`])),D,this.description,O,this.background,this.currentState===PlayerState.Error?$(_templateObject2||(_templateObject2=_taggedTemplateLiteral(['<div class="error">⚠️</div>']))):void 0,this.controls&&!this.disableShadowDOM?this.renderControls():void 0)}createRenderRoot(){return this.disableShadowDOM&&(this.style.display="block"),this.disableShadowDOM?this:super.createRenderRoot()}firstUpdated(){"IntersectionObserver"in window&&(this._io=new IntersectionObserver(D=>{D[0].isIntersecting?this.currentState===PlayerState.Frozen&&this.play():this.currentState===PlayerState.Playing&&this.freeze()}),this._io.observe(this.container)),document.hidden!==void 0&&document.addEventListener("visibilitychange",this._onVisibilityChange),this.src&&this.load(this.src),this.dispatchEvent(new CustomEvent(PlayerEvents.Rendered))}renderControls(){var D=this.currentState===PlayerState.Playing,O=this.currentState===PlayerState.Paused,q=this.currentState===PlayerState.Stopped;return $(_templateObject3||(_templateObject3=_taggedTemplateLiteral([`
191      <div
192        id="lottie-controls"
193        aria-label="lottie-animation-controls"
194        class="toolbar"
195      >
196        <button
197          id="lottie-play-button"
198          @click=`,`
199          class=`,`
200          style="align-items:center;"
201          tabindex="0"
202          aria-label="play-pause"
203        >
204          `,`
205        </button>
206        <button
207          id="lottie-stop-button"
208          @click=`,`
209          class=`,`
210          style="align-items:center;"
211          tabindex="0"
212          aria-label="stop"
213        >
214          <svg width="24" height="24" aria-hidden="true" focusable="false">
215            <path d="M6 6h12v12H6V6z" />
216          </svg>
217        </button>
218        <input
219          id="lottie-seeker-input"
220          class="seeker"
221          type="range"
222          min="0"
223          step="1"
224          max="100"
225          .value=`,`
226          @input=`,`
227          @mousedown=`,`
228          @mouseup=`,`
229          aria-valuemin="1"
230          aria-valuemax="100"
231          role="slider"
232          aria-valuenow=`,`
233          tabindex="0"
234          aria-label="lottie-seek-input"
235        />
236        <button
237          id="lottie-loop-toggle"
238          @click=`,`
239          class=`,`
240          style="align-items:center;"
241          tabindex="0"
242          aria-label="loop-toggle"
243        >
244          <svg width="24" height="24" aria-hidden="true" focusable="false">
245            <path
246              d="M17.016 17.016v-4.031h1.969v6h-12v3l-3.984-3.984 3.984-3.984v3h10.031zM6.984 6.984v4.031H5.015v-6h12v-3l3.984 3.984-3.984 3.984v-3H6.984z"
247            />
248          </svg>
249        </button>
250      </div>
251    `])),this.togglePlay,D||O?"active":"",$(D?_templateObject4||(_templateObject4=_taggedTemplateLiteral([`<svg
252                width="24"
253                height="24"
254                aria-hidden="true"
255                focusable="false"
256              >
257                <path
258                  d="M14.016 5.016H18v13.969h-3.984V5.016zM6 18.984V5.015h3.984v13.969H6z"
259                />
260              </svg>`])):_templateObject5||(_templateObject5=_taggedTemplateLiteral([`<svg
261                width="24"
262                height="24"
263                aria-hidden="true"
264                focusable="false"
265              >
266                <path d="M8.016 5.016L18.985 12 8.016 18.984V5.015z" />
267              </svg>`]))),this.stop,q?"active":"",this.seeker,this._handleSeekChange,()=>{this._prevState=this.currentState,this.freeze()},()=>{this._prevState===PlayerState.Playing&&this.play()},this.seeker,this.toggleLooping,this.loop?"active":"")}_handleSeekChange(D){if(this._lottie&&!isNaN(D.target.value)){var O=D.target.value/100*this._lottie.totalFrames;this.seek(O)}}_attachEventListeners(){this._lottie.addEventListener("enterFrame",()=>{this.seeker=this._lottie.currentFrame/this._lottie.totalFrames*100,this.dispatchEvent(new CustomEvent(PlayerEvents.Frame,{detail:{frame:this._lottie.currentFrame,seeker:this.seeker}}))}),this._lottie.addEventListener("complete",()=>{if(this.currentState===PlayerState.Playing){if((!this.loop||this.count&&this._counter>=this.count)&&(this.dispatchEvent(new CustomEvent(PlayerEvents.Complete)),this.mode!==PlayMode.Bounce||this._lottie.currentFrame===0))return;this.mode===PlayMode.Bounce?(this.count&&(this._counter+=.5),setTimeout(()=>{this.dispatchEvent(new CustomEvent(PlayerEvents.Loop)),this.currentState===PlayerState.Playing&&(this._lottie.setDirection(-1*this._lottie.playDirection),this._lottie.play())},this.intermission)):(this.count&&(this._counter+=1),window.setTimeout(()=>{this.dispatchEvent(new CustomEvent(PlayerEvents.Loop)),this.currentState===PlayerState.Playing&&(this.direction===-1?(this.seek("99%"),this.play()):(this._lottie.stop(),this._lottie.play()))},this.intermission))}else this.dispatchEvent(new CustomEvent(PlayerEvents.Complete))}),this._lottie.addEventListener("DOMLoaded",()=>{this.setSpeed(this.speed),this.setDirection(this.direction),this.autoplay&&(this.direction===-1&&this.seek("100%"),this.play()),this.dispatchEvent(new CustomEvent(PlayerEvents.Ready))}),this._lottie.addEventListener("data_ready",()=>{this.dispatchEvent(new CustomEvent(PlayerEvents.Load))}),this._lottie.addEventListener("data_failed",()=>{this.currentState=PlayerState.Error,this.dispatchEvent(new CustomEvent(PlayerEvents.Error))}),this.container.addEventListener("mouseenter",()=>{this.hover&&this.currentState!==PlayerState.Playing&&this.play()}),this.container.addEventListener("mouseleave",()=>{this.hover&&this.currentState===PlayerState.Playing&&this.stop()})}freeze(){this._lottie&&(this._lottie.pause(),this.currentState=PlayerState.Frozen,this.dispatchEvent(new CustomEvent(PlayerEvents.Freeze)))}};__decorate([e$5({type:Boolean})],LottiePlayer.prototype,"autoplay",void 0),__decorate([e$5({type:String,reflect:!0})],LottiePlayer.prototype,"background",void 0),__decorate([e$5({type:Boolean})],LottiePlayer.prototype,"controls",void 0),__decorate([e$5({type:Number})],LottiePlayer.prototype,"count",void 0),__decorate([e$5({type:String})],LottiePlayer.prototype,"currentState",void 0),__decorate([e$5({type:String})],LottiePlayer.prototype,"description",void 0),__decorate([e$5({type:Number})],LottiePlayer.prototype,"direction",void 0),__decorate([e$5({type:Boolean})],LottiePlayer.prototype,"disableCheck",void 0),__decorate([e$5({type:Boolean})],LottiePlayer.prototype,"disableShadowDOM",void 0),__decorate([e$5({type:Boolean})],LottiePlayer.prototype,"hover",void 0),__decorate([e$5()],LottiePlayer.prototype,"intermission",void 0),__decorate([e$5({type:Boolean,reflect:!0})],LottiePlayer.prototype,"loop",void 0),__decorate([e$5()],LottiePlayer.prototype,"mode",void 0),__decorate([e$5({type:String})],LottiePlayer.prototype,"preserveAspectRatio",void 0),__decorate([e$5({type:String})],LottiePlayer.prototype,"renderer",void 0),__decorate([e$5({type:String})],LottiePlayer.prototype,"viewBoxSize",void 0),__decorate([e$5()],LottiePlayer.prototype,"seeker",void 0),__decorate([e$5({type:Number})],LottiePlayer.prototype,"speed",void 0),__decorate([e$5({type:String})],LottiePlayer.prototype,"src",void 0),__decorate([e$5({type:Boolean})],LottiePlayer.prototype,"webworkers",void 0),__decorate([i(".animation")],LottiePlayer.prototype,"container",void 0),LottiePlayer=__decorate([n$1("lottie-player")],LottiePlayer);function mobilemenu(){var D=document.getElementById("js-mobile-btn"),O=document.getElementById("js-navigation-mobile");D.addEventListener("click",function(){D.classList.toggle("active"),O.classList.toggle("active"),D.classList.toggle("not-active"),O.classList.toggle("not-active")})}function buttonstyle(){const D=document.querySelectorAll(".categories .swiper-slide .category_slide_content, .wp-block-button.is-style-outline .wp-element-button, .wp-block-button .wp-element-button, .farmer-wrapper .farmer-item, .nav.mobile-nav .menu-item:not(.btn-normal):not(.btn-outline), .news-post-page-button a, .btn-outline a, .btn-normal a, .farmermap-wrapper .filter-btn-wrapper .filter:not(.active)");for(const O of D){let Ae=function(){q===null&&Te()},Ee=function(){q!==null&&(cancelAnimationFrame(q),q=null)},q=null,J=0,ie=0,le=0,_e=0;const o=(ye,ge,Se)=>ye+(ge-ye)*Se,Te=()=>{le=o(le,J,.1),_e=o(_e,ie,.1),O.style.setProperty("--x",`${le}px`),O.style.setProperty("--y",`${_e}px`),q=requestAnimationFrame(Te)},Pe=function(ye){O.addEventListener("mousemove",Ie),O.style.setProperty("--x",ye.layerX>O.getBoundingClientRect().width/2?"200%":"-200%"),O.style.setProperty("--y",ye.layerY>O.getBoundingClientRect().height/2?"200%":"-200%"),Ae()},ve=function(ye){Ee(),O.removeEventListener("mousemove",Ie);const ge=ye.clientX-O.getBoundingClientRect().left,Se=ye.clientY-O.getBoundingClientRect().top;O.style.setProperty("--x",ge>O.getBoundingClientRect().width/2?"200%":"-200%"),O.style.setProperty("--y",Se>O.getBoundingClientRect().height/2?"200%":"-200%")},Ie=function(ye){J=ye.offsetX,ie=ye.offsetY};O.addEventListener("mouseenter",Pe,!1),O.addEventListener("mouseleave",ve,!1)}}function Autoplay(D){let{swiper:O,extendParams:q,on:J,emit:ie,params:le}=D;O.autoplay={running:!1,paused:!1,timeLeft:0},q({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let _e,o,Te=le&&le.autoplay?le.autoplay.delay:3e3,Pe=le&&le.autoplay?le.autoplay.delay:3e3,ve,Ae=new Date().getTime(),Ee,Ie,ye,ge,Se,Ce,Ve;function at(rt){!O||O.destroyed||!O.wrapperEl||rt.target===O.wrapperEl&&(O.wrapperEl.removeEventListener("transitionend",at),!(Ve||rt.detail&&rt.detail.bySwiperTouchMove)&&xt())}const et=()=>{if(O.destroyed||!O.autoplay.running)return;O.autoplay.paused?Ee=!0:Ee&&(Pe=ve,Ee=!1);const rt=O.autoplay.paused?ve:Ae+Pe-new Date().getTime();O.autoplay.timeLeft=rt,ie("autoplayTimeLeft",rt,rt/Te),o=requestAnimationFrame(()=>{et()})},Mt=()=>{let rt;return O.virtual&&O.params.virtual.enabled?rt=O.slides.find(_i=>_i.classList.contains("swiper-slide-active")):rt=O.slides[O.activeIndex],rt?parseInt(rt.getAttribute("data-swiper-autoplay"),
vendor: 4,553 bytes, line 267
26710):void 0},jt=rt=>{if(O.destroyed||!O.autoplay.running)return;cancelAnimationFrame(o),et();let kt=typeof rt>"u"?O.params.autoplay.delay:rt;Te=O.params.autoplay.delay,Pe=O.params.autoplay.delay;const _i=Mt();!Number.isNaN(_i)&&_i>0&&typeof rt>"u"&&(kt=_i,Te=_i,Pe=_i),ve=kt;const Yi=O.params.speed,Lr=()=>{!O||O.destroyed||(O.params.autoplay.reverseDirection?!O.isBeginning||O.params.loop||O.params.rewind?(O.slidePrev(Yi,!0,!0),ie("autoplay")):O.params.autoplay.stopOnLastSlide||(O.slideTo(O.slides.length-1,Yi,!0,!0),ie("autoplay")):!O.isEnd||O.params.loop||O.params.rewind?(O.slideNext(Yi,!0,!0),ie("autoplay")):O.params.autoplay.stopOnLastSlide||(O.slideTo(0,Yi,!0,!0),ie("autoplay")),O.params.cssMode&&(Ae=new Date().getTime(),requestAnimationFrame(()=>{jt()})))};return kt>0?(clearTimeout(_e),_e=setTimeout(()=>{Lr()},kt)):requestAnimationFrame(()=>{Lr()}),kt},St=()=>{Ae=new Date().getTime(),O.autoplay.running=!0,jt(),ie("autoplayStart")},Bt=()=>{O.autoplay.running=!1,clearTimeout(_e),cancelAnimationFrame(o),ie("autoplayStop")},Zt=(rt,kt)=>{if(O.destroyed||!O.autoplay.running)return;clearTimeout(_e),rt||(Ce=!0);const _i=()=>{ie("autoplayPause"),O.params.autoplay.waitForTransition?O.wrapperEl.addEventListener("transitionend",at):xt()};if(O.autoplay.paused=!0,kt){Se&&(ve=O.params.autoplay.delay),Se=!1,_i();return}ve=(ve||O.params.autoplay.delay)-(new Date().getTime()-Ae),!(O.isEnd&&ve<0&&!O.params.loop)&&(ve<0&&(ve=0),_i())},xt=()=>{O.isEnd&&ve<0&&!O.params.loop||O.destroyed||!O.autoplay.running||(Ae=new Date().getTime(),Ce?(Ce=!1,jt(ve)):jt(),O.autoplay.paused=!1,ie("autoplayResume"))},wt=()=>{if(O.destroyed||!O.autoplay.running)return;const rt=getDocument();rt.visibilityState==="hidden"&&(Ce=!0,Zt(!0)),rt.visibilityState==="visible"&&xt()},Je=rt=>{rt.pointerType==="mouse"&&(Ce=!0,Ve=!0,!(O.animating||O.autoplay.paused)&&Zt(!0))},ut=rt=>{rt.pointerType==="mouse"&&(Ve=!1,O.autoplay.paused&&xt())},lt=()=>{O.params.autoplay.pauseOnMouseEnter&&(O.el.addEventListener("pointerenter",Je),O.el.addEventListener("pointerleave",ut))},Ye=()=>{O.el&&typeof O.el!="string"&&(O.el.removeEventListener("pointerenter",Je),O.el.removeEventListener("pointerleave",ut))},pi=()=>{getDocument().addEventListener("visibilitychange",wt)},si=()=>{getDocument().removeEventListener("visibilitychange",wt)};J("init",()=>{O.params.autoplay.enabled&&(lt(),pi(),St())}),J("destroy",()=>{Ye(),si(),O.autoplay.running&&Bt()}),J("_freeModeStaticRelease",()=>{(ye||Ce)&&xt()}),J("_freeModeNoMomentumRelease",()=>{O.params.autoplay.disableOnInteraction?Bt():Zt(!0,!0)}),J("beforeTransitionStart",(rt,kt,_i)=>{O.destroyed||!O.autoplay.running||(_i||!O.params.autoplay.disableOnInteraction?Zt(!0,!0):Bt())}),J("sliderFirstMove",()=>{if(!(O.destroyed||!O.autoplay.running)){if(O.params.autoplay.disableOnInteraction){Bt();return}Ie=!0,ye=!1,Ce=!1,ge=setTimeout(()=>{Ce=!0,ye=!0,Zt(!0)},200)}}),J("touchEnd",()=>{if(!(O.destroyed||!O.autoplay.running||!Ie)){if(clearTimeout(ge),clearTimeout(_e),O.params.autoplay.disableOnInteraction){ye=!1,Ie=!1;return}ye&&O.params.cssMode&&xt(),ye=!1,Ie=!1}}),J("slideChange",()=>{O.destroyed||!O.autoplay.running||(Se=!0)}),Object.assign(O.autoplay,{start:St,stop:Bt,pause:Zt,resume:xt})}function effectInit(D){const{effect:O,swiper:q,on:J,setTranslate:ie,setTransition:le,overwriteParams:_e,perspective:o,recreateShadows:Te,getEffectParams:Pe}=D;J("beforeInit",()=>{if(q.params.effect!==O)return;q.classNames.push(`${q.params.containerModifierClass}${O}`),o&&o()&&q.classNames.push(`${q.params.containerModifierClass}3d`);const Ae=_e?_e():{};Object.assign(q.params,Ae),Object.assign(q.originalParams,Ae)}),J("setTranslate",()=>{q.params.effect===O&&ie()}),J("setTransition",(Ae,Ee)=>{q.params.effect===O&&le(Ee)}),J("transitionEnd",()=>{if(q.params.effect===O&&Te){if(!Pe||!Pe().slideShadows)return;q.slides.forEach(Ae=>{Ae.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(Ee=>Ee.remove())}),Te()}});let ve;J("virtualUpdate",()=>{q.params.effect===O&&(q.slides.length||(ve=!0),requestAnimationFrame(()=>{ve&&q.slides&&q.slides.length&&(ie(),ve=!1)}))})}function effectTarget(D,O){const q=getSlideTransformEl(O);return q!==O&&(q.style.backfaceVisibility="hidden",q.style["-webkit-backface-visibility"]="hidden"),q}function effectVirtualTransitionEnd(D){let{swiper:O,duration:q,transformElements:J,allSlides:ie}=D;const{activeIndex:le}=O,_e=o=>o.parentElement?o.parentElement:O.slides.find(Pe=>Pe.shadowRoot&&Pe.shadowRoot===o.parentNode);
267if(O.params.virtualTranslate&&q!==0){let o=!1,Te;ie?Te=J:Te=J.filter(Pe=>{const ve=Pe.classList.contains("swiper-slide-transform")?_e(Pe):Pe;return O.getSlideIndex(ve)===le}),Te.forEach(Pe=>{elementTransitionEnd(Pe,()=>{if(o||!O||O.destroyed)return;o=!0,O.animating=!1;const ve=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});O.wrapperEl.dispatchEvent(ve)})})}}function EffectFade(D){let{swiper:O,extendParams:q,on:J}=D;q({fadeEffect:{crossFade:!1}}),effectInit({effect:"fade",swiper:O,on:J,setTranslate:()=>{const{slides:_e}=O,o=O.params.fadeEffect;for(let Te=0;Te<_e.length;Te+=1){const Pe=O.slides[Te];let Ae=-Pe.swiperSlideOffset;O.params.virtualTranslate||(Ae-=O.translate);let Ee=0;O.isHorizontal()||(Ee=Ae,Ae=0);const Ie=O.params.fadeEffect.crossFade?Math.max(1-Math.abs(Pe.progress),0):1+Math.min(Math.max(Pe.progress,-1),0),ye=effectTarget(o,Pe);ye.style.opacity=Ie,ye.style.transform=`translate3d(${Ae}px, ${Ee}px, 0px)`}},setTransition:_e=>{const o=O.slides.map(Te=>getSlideTransformEl(Te));o.forEach(Te=>{Te.style.transitionDuration=`${_e}ms`}),effectVirtualTransitionEnd({swiper:O,duration:_e,transformElements:o,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!O.params.cssMode})})}function createShadow(D,O,q){const J=`swiper-slide-shadow${` swiper-slide-shadow-${D}`}`,ie=getSlideTransformEl(O);let le=ie.querySelector(`.${J.split(" ").join(".")}`);return le||(le=createElement("div",J.split(" ")),ie.append(le)),le}function EffectCreative(D){let{swiper:O,extendParams:q,on:J}=D;q({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const ie=o=>typeof o=="string"?o:`${o}px`;effectInit({effect:"creative",swiper:O,on:J,setTranslate:()=>{const{slides:o,wrapperEl:Te,slidesSizesGrid:Pe}=O,ve=O.params.creativeEffect,{progressMultiplier:Ae}=ve,Ee=O.params.centeredSlides,Ie=getRotateFix(O);if(Ee){const ye=Pe[0]/2-O.params.slidesOffsetBefore||0;Te.style.transform=`translateX(calc(50% - ${ye}px))`}for(let ye=0;ye<o.length;ye+=1){const ge=o[ye],Se=ge.progress,Ce=Math.min(Math.max(ge.progress,-ve.limitProgress),ve.limitProgress);let Ve=Ce;Ee||(Ve=Math.min(Math.max(ge.originalProgress,-ve.limitProgress),ve.limitProgress));const at=ge.swiperSlideOffset,et=[O.params.cssMode?-at-O.translate:-at,0,0],Mt=[0,0,0];let jt=!1;O.isHorizontal()||(et[1]=et[0],et[0]=0);let St={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};Ce<0?(St=ve.next,jt=!0):Ce>0&&(St=ve.prev,jt=!0),et.forEach((lt,Ye)=>{et[Ye]=`calc(${lt}px + (${ie(St.translate[Ye])} * ${Math.abs(Ce*Ae)}))`}),Mt.forEach((lt,Ye)=>{let pi=St.rotate[Ye]*Math.abs(Ce*Ae);Mt[Ye]=pi}),ge.style.zIndex=-Math.abs(Math.round(Se))+o.length;const Bt=et.join(", "),Zt=`rotateX(${Ie(Mt[0])}deg) rotateY(${Ie(Mt[1])}deg) rotateZ(${Ie(Mt[2])}deg)`,xt=Ve<0?`scale(${1+(1-St.scale)*Ve*Ae})`:`scale(${1-(1-St.scale)*Ve*Ae})`,wt=Ve<0?1+(1-St.opacity)*Ve*Ae:1-(1-St.opacity)*Ve*Ae,Je=`translate3d(${Bt}) ${Zt} ${xt}`;if(jt&&St.shadow||!jt){let lt=ge.querySelector(".swiper-slide-shadow");if(!lt&&St.shadow&&(lt=createShadow("creative",ge)),lt){const Ye=ve.shadowPerProgress?Ce*(1/ve.limitProgress):Ce;lt.style.opacity=Math.min(Math.max(Math.abs(Ye),0),1)}}const ut=effectTarget(ve,ge);ut.style.transform=Je,ut.style.opacity=wt,St.origin&&(ut.style.transformOrigin=St.origin)}},setTransition:o=>{const Te=O.slides.map(Pe=>getSlideTransformEl(Pe));Te.forEach(Pe=>{Pe.style.transitionDuration=`${o}ms`,Pe.querySelectorAll(".swiper-slide-shadow").forEach(ve=>{ve.style.transitionDuration=`${o}ms`})}),effectVirtualTransitionEnd({swiper:O,duration:o,transformElements:Te,allSlides:!0})},perspective:()=>O.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!O.params.cssMode})})}function farmerslider(){const D=document.getElementsByClassName("farmerslider");for(const O of D){const q=new g$1({container:document.querySelector(".farmerslider"),elements_selector:".slide_img"});new Swiper(O,{modules:[Navigation,Pagination],pagination:{el:".swiper-pagination",clickable:!0,dynamicMainBullets:3},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},slidesPerView:1,on:{setTranslate(J,ie){J.wrapperEl.style.transform=`translateX(${ie}px) translateZ(0)`}
267,transitionStart(){q.update()}}})}}function accordion(){const D=document.querySelectorAll("ul#menu-footer-menu-overview > li > a"),O=document.querySelectorAll("ul#menu-footer-menu-overview > li > ul");window.innerWidth<768&&D.forEach(function(J){J.addEventListener("click",function(ie){ie.preventDefault(),this.classList.contains("open")?(this.classList.remove("open"),this.nextElementSibling.style.display="none"):(D.forEach(function(le){le.classList.remove("open")}),this.classList.add("open"),O.forEach(function(le){le.style.display="none"}),this.nextElementSibling.style.display="flex")}),J===D[0]?(J.classList.add("open"),J.nextElementSibling.style.display="flex"):(J.classList.remove("open"),J.nextElementSibling.style.display="none")});let q=document.querySelectorAll(".accordion .accordion-header");if(q.length)for(let J of q)J.addEventListener("click",function(ie){ie.preventDefault(),J.classList.toggle("open"),J.nextElementSibling.classList.toggle("collapse-show")})}function boxes(){const D=document.getElementsByClassName("boxes"),O=new Map,q=new Map,J=1,ie=function(Te,Pe,ve){const Ae=Pe.querySelectorAll(".boxes_image"),Ee=Array.from(Ae).filter(Ve=>+(Ve.dataset.boxIndex<=Te));for(const Ve of Ae)Ve.dataset.boxActive="0";for(const Ve of Ee)Ve.dataset.boxActive="1";const Ie=Pe.querySelectorAll(".boxes_content"),ye=Array.from(Ie).filter(Ve=>+(Ve.dataset.boxIndex<Te)),ge=Array.from(Ie).filter(Ve=>+(Ve.dataset.boxIndex>Te)),Se=Pe.querySelector(".boxes_content[data-box-index='"+Te+"']");for(const Ve of ye)Ve.dataset.boxActive="0";Se.dataset.boxActive="1";for(const Ve of ge)Ve.dataset.boxActive="2";const Ce=Pe.querySelectorAll(".boxes_pagination");for(const Ve of Ce)Ve.dataset.paginationActive="0";ve.dataset.paginationActive="1"},le=function(Te,Pe){const ve=Te.target,Ae=ve.dataset.boxIndex;O.set(Pe,(parseInt(Ae)+1)*J),ie(Ae,Pe,ve)},_e=function(Te){const Pe={threshold:.9},ve=function(Ie){o(Ie,Ee,Te)},Ae=function(Ie){Ie.forEach(ye=>{ye.isIntersecting?(O.has(Te)||O.set(Te,0),window.addEventListener("wheel",ve,{passive:!1})):window.removeEventListener("wheel",ve)})},Ee=new IntersectionObserver(Ae,Pe);Ee.observe(Te)},o=function(Te,Pe,ve){let Ae=O.get(ve)||0;const Ee=Array.from(ve.querySelectorAll(".boxes_image")).length,Ie=Te.deltaMode===0?Math.sign(Te.deltaY):Te.deltaY;if(Ae<0-J||Ae>Ee*J+J){O.set(ve,Math.max(0-J,Math.min(Ee*J+J,Ae)));return}if(q.get(ve))return Te.stopPropagation(),Te.preventDefault(),!1;if(Ae>=J&&Ae%J===0&&Ae<=Ee*J){ve.scrollIntoView({behavior:"smooth",block:"center"});const ye=Ae/J-1,ge=ve.querySelector(".boxes_pagination[data-box-index='"+ye+"']");q.set(ve,!0),ie(ye,ve,ge),setTimeout(function(){q.set(ve,!1)},500)}Ae+=Ie,O.set(ve,Ae),Te.stopPropagation(),Te.preventDefault()};for(const Te of D){const Pe=Te.querySelectorAll(".boxes_pagination__wrapper .boxes_pagination");for(const ve of Pe)ve.addEventListener("click",function(Ae){le(Ae,Te)});window.innerWidth>=1024&&_e(Te)}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function getAugmentedNamespace(D){if(Object.prototype.hasOwnProperty.call(D,"__esModule"))return D;var O=D.default;if(typeof O=="function"){var q=function J(){return this instanceof J?Reflect.construct(O,arguments,this.constructor):O.apply(this,arguments)};q.prototype=O.prototype}else q={};return Object.defineProperty(q,"__esModule",{value:!0}),Object.keys(D).forEach(function(J){var ie=Object.getOwnPropertyDescriptor(D,J);Object.defineProperty(q,J,ie.get?ie:{enumerable:!0,get:function(){return D[J]}})}),q}var mapboxGl$1={exports:{}},mapboxGl=mapboxGl$1.exports,hasRequiredMapboxGl;function requireMapboxGl(){return hasRequiredMapboxGl||(hasRequiredMapboxGl=1,function(D,O){(function(q,J){D.exports=J()})(mapboxGl,function(){var q,J,ie;function le(o,Te){if(!q)q=Te;else if(!J)J=Te;else{var Pe="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 = {}; ("+q+")(sharedChunk); ("+J+")(sharedChunk); self.onerror = null;",ve={};q(ve),ie=Te(ve),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(ie.workerUrl=window.URL.createObjectURL(new Blob([Pe],{type:"text/javascript"})))}}le(["exports"],function(o){function Te(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var Pe,ve={},Ae={};function Ee(){if(Pe)return Ae;
267Pe=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.setMatrixArrayType=function(U){Ae.ARRAY_TYPE=e=U},Ae.toRadian=function(U){return U*y},Ae.equals=function(U,R){return Math.abs(U-R)<=h*Math.max(1,Math.abs(U),Math.abs(R))},Ae.RANDOM=Ae.ARRAY_TYPE=Ae.EPSILON=void 0;var h=1e-6;Ae.EPSILON=h;var e=typeof Float32Array<"u"?Float32Array:Array;Ae.ARRAY_TYPE=e;var r=Math.random;Ae.RANDOM=r;var y=Math.PI/180;return Math.hypot||(Math.hypot=function(){for(var U=0,R=arguments.length;R--;)U+=arguments[R]*arguments[R];return Math.sqrt(U)}),Ae}var Ie,ye={};function ge(){if(Ie)return ye;function h(R){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},h(R)}Ie=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.create=function(){var R=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0),R[0]=1,R[3]=1,R},ye.clone=function(R){var j=new e.ARRAY_TYPE(4);return j[0]=R[0],j[1]=R[1],j[2]=R[2],j[3]=R[3],j},ye.copy=function(R,j){return R[0]=j[0],R[1]=j[1],R[2]=j[2],R[3]=j[3],R},ye.identity=function(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R},ye.fromValues=function(R,j,X,Q){var se=new e.ARRAY_TYPE(4);return se[0]=R,se[1]=j,se[2]=X,se[3]=Q,se},ye.set=function(R,j,X,Q,se){return R[0]=j,R[1]=X,R[2]=Q,R[3]=se,R},ye.transpose=function(R,j){if(R===j){var X=j[1];R[1]=j[2],R[2]=X}else R[0]=j[0],R[1]=j[2],R[2]=j[1],R[3]=j[3];return R},ye.invert=function(R,j){var X=j[0],Q=j[1],se=j[2],W=j[3],ee=X*W-se*Q;return ee?(R[0]=W*(ee=1/ee),R[1]=-Q*ee,R[2]=-se*ee,R[3]=X*ee,R):null},ye.adjoint=function(R,j){var X=j[0];return R[0]=j[3],R[1]=-j[1],R[2]=-j[2],R[3]=X,R},ye.determinant=function(R){return R[0]*R[3]-R[2]*R[1]},ye.multiply=y,ye.rotate=function(R,j,X){var Q=j[0],se=j[1],W=j[2],ee=j[3],ne=Math.sin(X),K=Math.cos(X);return R[0]=Q*K+W*ne,R[1]=se*K+ee*ne,R[2]=Q*-ne+W*K,R[3]=se*-ne+ee*K,R},ye.scale=function(R,j,X){var Q=j[1],se=j[2],W=j[3],ee=X[0],ne=X[1];return R[0]=j[0]*ee,R[1]=Q*ee,R[2]=se*ne,R[3]=W*ne,R},ye.fromRotation=function(R,j){var X=Math.sin(j),Q=Math.cos(j);return R[0]=Q,R[1]=X,R[2]=-X,R[3]=Q,R},ye.fromScaling=function(R,j){return R[0]=j[0],R[1]=0,R[2]=0,R[3]=j[1],R},ye.str=function(R){return"mat2("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+")"},ye.frob=function(R){return Math.hypot(R[0],R[1],R[2],R[3])},ye.LDU=function(R,j,X,Q){return R[2]=Q[2]/Q[0],X[0]=Q[0],X[1]=Q[1],X[3]=Q[3]-R[2]*X[1],[R,j,X]},ye.add=function(R,j,X){return R[0]=j[0]+X[0],R[1]=j[1]+X[1],R[2]=j[2]+X[2],R[3]=j[3]+X[3],R},ye.subtract=U,ye.exactEquals=function(R,j){return R[0]===j[0]&&R[1]===j[1]&&R[2]===j[2]&&R[3]===j[3]},ye.equals=function(R,j){var X=R[0],Q=R[1],se=R[2],W=R[3],ee=j[0],ne=j[1],K=j[2],te=j[3];return Math.abs(X-ee)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(ee))&&Math.abs(Q-ne)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(ne))&&Math.abs(se-K)<=e.EPSILON*Math.max(1,Math.abs(se),Math.abs(K))&&Math.abs(W-te)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs(te))},ye.multiplyScalar=function(R,j,X){return R[0]=j[0]*X,R[1]=j[1]*X,R[2]=j[2]*X,R[3]=j[3]*X,R},ye.multiplyScalarAndAdd=function(R,j,X,Q){return R[0]=j[0]+X[0]*Q,R[1]=j[1]+X[1]*Q,R[2]=j[2]+X[2]*Q,R[3]=j[3]+X[3]*Q,R},ye.sub=ye.mul=void 0;var e=function(R,j){if(R&&R.__esModule)return R;if(R===null||h(R)!=="object"&&typeof R!="function")return{default:R};var X=r(void 0);if(X&&X.has(R))return X.get(R);var Q={},se=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var W in R)if(W!=="default"&&Object.prototype.hasOwnProperty.call(R,W)){var ee=se?Object.getOwnPropertyDescriptor(R,W):null;ee&&(ee.get||ee.set)?Object.defineProperty(Q,W,ee):Q[W]=R[W]}return Q.default=R,X&&X.set(R,Q),Q}(Ee());function r(R){if(typeof WeakMap!="function")return null;var j=new WeakMap,X=new WeakMap;return(r=function(Q){return Q?X:j})(R)}function y(R,j,X){var Q=j[0],se=j[1],W=j[2],ee=j[3],ne=X[0],K=X[1],te=X[2],ae=X[3];return R[0]=Q*ne+W*K,R[1]=se*ne+ee*K,R[2]=Q*te+W*ae,R[3]=se*te+ee*ae,R}function U(R,j,X){return R[0]=j[0]-X[0],R[1]=j[1]-X[1],R[2]=j[2]-X[2],R[3]=j[3]-X[3],R}return ye.mul=y,ye.sub=U,ye}var Se,Ce={};
267function Ve(){if(Se)return Ce;function h(R){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},h(R)}Se=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.create=function(){var R=new e.ARRAY_TYPE(6);return e.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0,R[4]=0,R[5]=0),R[0]=1,R[3]=1,R},Ce.clone=function(R){var j=new e.ARRAY_TYPE(6);return j[0]=R[0],j[1]=R[1],j[2]=R[2],j[3]=R[3],j[4]=R[4],j[5]=R[5],j},Ce.copy=function(R,j){return R[0]=j[0],R[1]=j[1],R[2]=j[2],R[3]=j[3],R[4]=j[4],R[5]=j[5],R},Ce.identity=function(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R[4]=0,R[5]=0,R},Ce.fromValues=function(R,j,X,Q,se,W){var ee=new e.ARRAY_TYPE(6);return ee[0]=R,ee[1]=j,ee[2]=X,ee[3]=Q,ee[4]=se,ee[5]=W,ee},Ce.set=function(R,j,X,Q,se,W,ee){return R[0]=j,R[1]=X,R[2]=Q,R[3]=se,R[4]=W,R[5]=ee,R},Ce.invert=function(R,j){var X=j[0],Q=j[1],se=j[2],W=j[3],ee=j[4],ne=j[5],K=X*W-Q*se;return K?(R[0]=W*(K=1/K),R[1]=-Q*K,R[2]=-se*K,R[3]=X*K,R[4]=(se*ne-W*ee)*K,R[5]=(Q*ee-X*ne)*K,R):null},Ce.determinant=function(R){return R[0]*R[3]-R[1]*R[2]},Ce.multiply=y,Ce.rotate=function(R,j,X){var Q=j[0],se=j[1],W=j[2],ee=j[3],ne=j[4],K=j[5],te=Math.sin(X),ae=Math.cos(X);return R[0]=Q*ae+W*te,R[1]=se*ae+ee*te,R[2]=Q*-te+W*ae,R[3]=se*-te+ee*ae,R[4]=ne,R[5]=K,R},Ce.scale=function(R,j,X){var Q=j[1],se=j[2],W=j[3],ee=j[4],ne=j[5],K=X[0],te=X[1];return R[0]=j[0]*K,R[1]=Q*K,R[2]=se*te,R[3]=W*te,R[4]=ee,R[5]=ne,R},Ce.translate=function(R,j,X){var Q=j[0],se=j[1],W=j[2],ee=j[3],ne=j[4],K=j[5],te=X[0],ae=X[1];return R[0]=Q,R[1]=se,R[2]=W,R[3]=ee,R[4]=Q*te+W*ae+ne,R[5]=se*te+ee*ae+K,R},Ce.fromRotation=function(R,j){var X=Math.sin(j),Q=Math.cos(j);return R[0]=Q,R[1]=X,R[2]=-X,R[3]=Q,R[4]=0,R[5]=0,R},Ce.fromScaling=function(R,j){return R[0]=j[0],R[1]=0,R[2]=0,R[3]=j[1],R[4]=0,R[5]=0,R},Ce.fromTranslation=function(R,j){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R[4]=j[0],R[5]=j[1],R},Ce.str=function(R){return"mat2d("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+", "+R[4]+", "+R[5]+")"},Ce.frob=function(R){return Math.hypot(R[0],R[1],R[2],R[3],R[4],R[5],1)},Ce.add=function(R,j,X){return R[0]=j[0]+X[0],R[1]=j[1]+X[1],R[2]=j[2]+X[2],R[3]=j[3]+X[3],R[4]=j[4]+X[4],R[5]=j[5]+X[5],R},Ce.subtract=U,Ce.multiplyScalar=function(R,j,X){return R[0]=j[0]*X,R[1]=j[1]*X,R[2]=j[2]*X,R[3]=j[3]*X,R[4]=j[4]*X,R[5]=j[5]*X,R},Ce.multiplyScalarAndAdd=function(R,j,X,Q){return R[0]=j[0]+X[0]*Q,R[1]=j[1]+X[1]*Q,R[2]=j[2]+X[2]*Q,R[3]=j[3]+X[3]*Q,R[4]=j[4]+X[4]*Q,R[5]=j[5]+X[5]*Q,R},Ce.exactEquals=function(R,j){return R[0]===j[0]&&R[1]===j[1]&&R[2]===j[2]&&R[3]===j[3]&&R[4]===j[4]&&R[5]===j[5]},Ce.equals=function(R,j){var X=R[0],Q=R[1],se=R[2],W=R[3],ee=R[4],ne=R[5],K=j[0],te=j[1],ae=j[2],ue=j[3],de=j[4],xe=j[5];return Math.abs(X-K)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(K))&&Math.abs(Q-te)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(te))&&Math.abs(se-ae)<=e.EPSILON*Math.max(1,Math.abs(se),Math.abs(ae))&&Math.abs(W-ue)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs(ue))&&Math.abs(ee-de)<=e.EPSILON*Math.max(1,Math.abs(ee),Math.abs(de))&&Math.abs(ne-xe)<=e.EPSILON*Math.max(1,Math.abs(ne),Math.abs(xe))},Ce.sub=Ce.mul=void 0;var e=function(R,j){if(R&&R.__esModule)return R;if(R===null||h(R)!=="object"&&typeof R!="function")return{default:R};var X=r(void 0);if(X&&X.has(R))return X.get(R);var Q={},se=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var W in R)if(W!=="default"&&Object.prototype.hasOwnProperty.call(R,W)){var ee=se?Object.getOwnPropertyDescriptor(R,W):null;ee&&(ee.get||ee.set)?Object.defineProperty(Q,W,ee):Q[W]=R[W]}return Q.default=R,X&&X.set(R,Q),Q}(Ee());function r(R){if(typeof WeakMap!="function")return null;var j=new WeakMap,X=new WeakMap;return(r=function(Q){return Q?X:j})(R)}function y(R,j,X){var Q=j[0],se=j[1],W=j[2],ee=j[3],ne=j[4],K=j[5],te=X[0],ae=X[1],ue=X[2],de=X[3],xe=X[4],we=X[5];return R[0]=Q*te+W*ae,R[1]=se*te+ee*ae,R[2]=Q*ue+W*de,R[3]=se*ue+ee*de,R[4]=Q*xe+W*we+ne,R[5]=se*xe+ee*we+K,R}function U(R,j,X){return R[0]=j[0]-X[0],R[1]=j[1]-X[1],R[2]=j[2]-X[2],R[3]=j[3]-X[3],R[4]=j[4]-X[4],R[5]=j[5]-X[5],R}return Ce.mul=y,Ce.sub=U,Ce}var at,et={};function Mt(){if(at)return et;function h(R){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},h(R)}
267at=1,Object.defineProperty(et,"__esModule",{value:!0}),et.create=function(){var R=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0,R[3]=0,R[5]=0,R[6]=0,R[7]=0),R[0]=1,R[4]=1,R[8]=1,R},et.fromMat4=function(R,j){return R[0]=j[0],R[1]=j[1],R[2]=j[2],R[3]=j[4],R[4]=j[5],R[5]=j[6],R[6]=j[8],R[7]=j[9],R[8]=j[10],R},et.clone=function(R){var j=new e.ARRAY_TYPE(9);return j[0]=R[0],j[1]=R[1],j[2]=R[2],j[3]=R[3],j[4]=R[4],j[5]=R[5],j[6]=R[6],j[7]=R[7],j[8]=R[8],j},et.copy=function(R,j){return R[0]=j[0],R[1]=j[1],R[2]=j[2],R[3]=j[3],R[4]=j[4],R[5]=j[5],R[6]=j[6],R[7]=j[7],R[8]=j[8],R},et.fromValues=function(R,j,X,Q,se,W,ee,ne,K){var te=new e.ARRAY_TYPE(9);return te[0]=R,te[1]=j,te[2]=X,te[3]=Q,te[4]=se,te[5]=W,te[6]=ee,te[7]=ne,te[8]=K,te},et.set=function(R,j,X,Q,se,W,ee,ne,K,te){return R[0]=j,R[1]=X,R[2]=Q,R[3]=se,R[4]=W,R[5]=ee,R[6]=ne,R[7]=K,R[8]=te,R},et.identity=function(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=0,R[4]=1,R[5]=0,R[6]=0,R[7]=0,R[8]=1,R},et.transpose=function(R,j){if(R===j){var X=j[1],Q=j[2],se=j[5];R[1]=j[3],R[2]=j[6],R[3]=X,R[5]=j[7],R[6]=Q,R[7]=se}else R[0]=j[0],R[1]=j[3],R[2]=j[6],R[3]=j[1],R[4]=j[4],R[5]=j[7],R[6]=j[2],R[7]=j[5],R[8]=j[8];return R},et.invert=function(R,j){var X=j[0],Q=j[1],se=j[2],W=j[3],ee=j[4],ne=j[5],K=j[6],te=j[7],ae=j[8],ue=ae*ee-ne*te,de=-ae*W+ne*K,xe=te*W-ee*K,we=X*ue+Q*de+se*xe;return we?(R[0]=ue*(we=1/we),R[1]=(-ae*Q+se*te)*we,R[2]=(ne*Q-se*ee)*we,R[3]=de*we,R[4]=(ae*X-se*K)*we,R[5]=(-ne*X+se*W)*we,R[6]=xe*we,R[7]=(-te*X+Q*K)*we,R[8]=(ee*X-Q*W)*we,R):null},et.adjoint=function(R,j){var X=j[0],Q=j[1],se=j[2],W=j[3],ee=j[4],ne=j[5],K=j[6],te=j[7],ae=j[8];return R[0]=ee*ae-ne*te,R[1]=se*te-Q*ae,R[2]=Q*ne-se*ee,R[3]=ne*K-W*ae,R[4]=X*ae-se*K,R[5]=se*W-X*ne,R[6]=W*te-ee*K,R[7]=Q*K-X*te,R[8]=X*ee-Q*W,R},et.determinant=function(R){var j=R[3],X=R[4],Q=R[5],se=R[6],W=R[7],ee=R[8];return R[0]*(ee*X-Q*W)+R[1]*(-ee*j+Q*se)+R[2]*(W*j-X*se)},et.multiply=y,et.translate=function(R,j,X){var Q=j[0],se=j[1],W=j[2],ee=j[3],ne=j[4],K=j[5],te=j[6],ae=j[7],ue=j[8],de=X[0],xe=X[1];return R[0]=Q,R[1]=se,R[2]=W,R[3]=ee,R[4]=ne,R[5]=K,R[6]=de*Q+xe*ee+te,R[7]=de*se+xe*ne+ae,R[8]=de*W+xe*K+ue,R},et.rotate=function(R,j,X){var Q=j[0],se=j[1],W=j[2],ee=j[3],ne=j[4],K=j[5],te=j[6],ae=j[7],ue=j[8],de=Math.sin(X),xe=Math.cos(X);return R[0]=xe*Q+de*ee,R[1]=xe*se+de*ne,R[2]=xe*W+de*K,R[3]=xe*ee-de*Q,R[4]=xe*ne-de*se,R[5]=xe*K-de*W,R[6]=te,R[7]=ae,R[8]=ue,R},et.scale=function(R,j,X){var Q=X[0],se=X[1];return R[0]=Q*j[0],R[1]=Q*j[1],R[2]=Q*j[2],R[3]=se*j[3],R[4]=se*j[4],R[5]=se*j[5],R[6]=j[6],R[7]=j[7],R[8]=j[8],R},et.fromTranslation=function(R,j){return R[0]=1,R[1]=0,R[2]=0,R[3]=0,R[4]=1,R[5]=0,R[6]=j[0],R[7]=j[1],R[8]=1,R},et.fromRotation=function(R,j){var X=Math.sin(j),Q=Math.cos(j);return R[0]=Q,R[1]=X,R[2]=0,R[3]=-X,R[4]=Q,R[5]=0,R[6]=0,R[7]=0,R[8]=1,R},et.fromScaling=function(R,j){return R[0]=j[0],R[1]=0,R[2]=0,R[3]=0,R[4]=j[1],R[5]=0,R[6]=0,R[7]=0,R[8]=1,R},et.fromMat2d=function(R,j){return R[0]=j[0],R[1]=j[1],R[2]=0,R[3]=j[2],R[4]=j[3],R[5]=0,R[6]=j[4],R[7]=j[5],R[8]=1,R},et.fromQuat=function(R,j){var X=j[0],Q=j[1],se=j[2],W=j[3],ee=X+X,ne=Q+Q,K=se+se,te=X*ee,ae=Q*ee,ue=Q*ne,de=se*ee,xe=se*ne,we=se*K,me=W*ee,Me=W*ne,ke=W*K;return R[0]=1-ue-we,R[3]=ae-ke,R[6]=de+Me,R[1]=ae+ke,R[4]=1-te-we,R[7]=xe-me,R[2]=de-Me,R[5]=xe+me,R[8]=1-te-ue,R},et.normalFromMat4=function(R,j){var X=j[0],Q=j[1],se=j[2],W=j[3],ee=j[4],ne=j[5],K=j[6],te=j[7],ae=j[8],ue=j[9],de=j[10],xe=j[11],we=j[12],me=j[13],Me=j[14],ke=j[15],Be=X*ne-Q*ee,He=X*K-se*ee,$e=X*te-W*ee,qe=Q*K-se*ne,st=Q*te-W*ne,We=se*te-W*K,ct=ae*me-ue*we,ft=ae*Me-de*we,dt=ae*ke-xe*we,_t=ue*Me-de*me,Tt=ue*ke-xe*me,Ct=de*ke-xe*Me,vt=Be*Ct-He*Tt+$e*_t+qe*dt-st*ft+We*ct;return vt?(R[0]=(ne*Ct-K*Tt+te*_t)*(vt=1/vt),R[1]=(K*dt-ee*Ct-te*ft)*vt,R[2]=(ee*Tt-ne*dt+te*ct)*vt,R[3]=(se*Tt-Q*Ct-W*_t)*vt,R[4]=(X*Ct-se*dt+W*ft)*vt,R[5]=(Q*dt-X*Tt-W*ct)*vt,R[6]=(me*We-Me*st+ke*qe)*vt,R[7]=(Me*$e-we*We-ke*He)*vt,R[8]=(we*st-me*$e+ke*Be)*vt,R):null},et.projection=function(R,j,X){return R[0]=2/j,R[1]=0,R[2]=0,R[3]=0,R[4]=-2/X,R[5]=0,R[6]=-1,R[7]=1,R[8]=1,R},et.str=function(R){return"mat3("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+", "+R[4]+", "+R[5]+", "+R[6]+", "+R[7]+", "+R[8]+")"},et.frob=function(R){return Math.hypot(R[0],R[1],R[2],R[3],R[4],R[5],R[6],R[7],R[8])},et.add=function(R,j,X){return R[0]=j[0]+X[0],R[1]=j[1]+X[1],R[2]=j[2]+X[2],R[3]=j[3]+X[3],R[4]=j[4]+X[4],R[5]=j[5]+X[5],R[6]=j[6]+X[6],R[7]=j[7]+X[7],R[8]=j[8]+X[8],R},et.subtract=U,et.multiplyScalar=function(R,j,X){return R[0]=j[0]*X,R[1]=j[1]*X,R[2]=j[2]*X,R[3]=j[3]*X,R[4]=j[4]*X,R[5]=j[5]*X,R[6]=j[6]*X,R[7]=j[7]*X,R[8]=j[8]*X,R}
267,et.multiplyScalarAndAdd=function(R,j,X,Q){return R[0]=j[0]+X[0]*Q,R[1]=j[1]+X[1]*Q,R[2]=j[2]+X[2]*Q,R[3]=j[3]+X[3]*Q,R[4]=j[4]+X[4]*Q,R[5]=j[5]+X[5]*Q,R[6]=j[6]+X[6]*Q,R[7]=j[7]+X[7]*Q,R[8]=j[8]+X[8]*Q,R},et.exactEquals=function(R,j){return R[0]===j[0]&&R[1]===j[1]&&R[2]===j[2]&&R[3]===j[3]&&R[4]===j[4]&&R[5]===j[5]&&R[6]===j[6]&&R[7]===j[7]&&R[8]===j[8]},et.equals=function(R,j){var X=R[0],Q=R[1],se=R[2],W=R[3],ee=R[4],ne=R[5],K=R[6],te=R[7],ae=R[8],ue=j[0],de=j[1],xe=j[2],we=j[3],me=j[4],Me=j[5],ke=j[6],Be=j[7],He=j[8];return Math.abs(X-ue)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(ue))&&Math.abs(Q-de)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(de))&&Math.abs(se-xe)<=e.EPSILON*Math.max(1,Math.abs(se),Math.abs(xe))&&Math.abs(W-we)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs(we))&&Math.abs(ee-me)<=e.EPSILON*Math.max(1,Math.abs(ee),Math.abs(me))&&Math.abs(ne-Me)<=e.EPSILON*Math.max(1,Math.abs(ne),Math.abs(Me))&&Math.abs(K-ke)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(ke))&&Math.abs(te-Be)<=e.EPSILON*Math.max(1,Math.abs(te),Math.abs(Be))&&Math.abs(ae-He)<=e.EPSILON*Math.max(1,Math.abs(ae),Math.abs(He))},et.sub=et.mul=void 0;var e=function(R,j){if(R&&R.__esModule)return R;if(R===null||h(R)!=="object"&&typeof R!="function")return{default:R};var X=r(void 0);if(X&&X.has(R))return X.get(R);var Q={},se=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var W in R)if(W!=="default"&&Object.prototype.hasOwnProperty.call(R,W)){var ee=se?Object.getOwnPropertyDescriptor(R,W):null;ee&&(ee.get||ee.set)?Object.defineProperty(Q,W,ee):Q[W]=R[W]}return Q.default=R,X&&X.set(R,Q),Q}(Ee());function r(R){if(typeof WeakMap!="function")return null;var j=new WeakMap,X=new WeakMap;return(r=function(Q){return Q?X:j})(R)}function y(R,j,X){var Q=j[0],se=j[1],W=j[2],ee=j[3],ne=j[4],K=j[5],te=j[6],ae=j[7],ue=j[8],de=X[0],xe=X[1],we=X[2],me=X[3],Me=X[4],ke=X[5],Be=X[6],He=X[7],$e=X[8];return R[0]=de*Q+xe*ee+we*te,R[1]=de*se+xe*ne+we*ae,R[2]=de*W+xe*K+we*ue,R[3]=me*Q+Me*ee+ke*te,R[4]=me*se+Me*ne+ke*ae,R[5]=me*W+Me*K+ke*ue,R[6]=Be*Q+He*ee+$e*te,R[7]=Be*se+He*ne+$e*ae,R[8]=Be*W+He*K+$e*ue,R}function U(R,j,X){return R[0]=j[0]-X[0],R[1]=j[1]-X[1],R[2]=j[2]-X[2],R[3]=j[3]-X[3],R[4]=j[4]-X[4],R[5]=j[5]-X[5],R[6]=j[6]-X[6],R[7]=j[7]-X[7],R[8]=j[8]-X[8],R}return et.mul=y,et.sub=U,et}var jt,St={};function Bt(){if(jt)return St;function h(W){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ee){return typeof ee}:function(ee){return ee&&typeof Symbol=="function"&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},h(W)}jt=1,Object.defineProperty(St,"__esModule",{value:!0}),St.create=function(){var W=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[11]=0,W[12]=0,W[13]=0,W[14]=0),W[0]=1,W[5]=1,W[10]=1,W[15]=1,W},St.clone=function(W){var ee=new e.ARRAY_TYPE(16);return ee[0]=W[0],ee[1]=W[1],ee[2]=W[2],ee[3]=W[3],ee[4]=W[4],ee[5]=W[5],ee[6]=W[6],ee[7]=W[7],ee[8]=W[8],ee[9]=W[9],ee[10]=W[10],ee[11]=W[11],ee[12]=W[12],ee[13]=W[13],ee[14]=W[14],ee[15]=W[15],ee},St.copy=function(W,ee){return W[0]=ee[0],W[1]=ee[1],W[2]=ee[2],W[3]=ee[3],W[4]=ee[4],W[5]=ee[5],W[6]=ee[6],W[7]=ee[7],W[8]=ee[8],W[9]=ee[9],W[10]=ee[10],W[11]=ee[11],W[12]=ee[12],W[13]=ee[13],W[14]=ee[14],W[15]=ee[15],W},St.fromValues=function(W,ee,ne,K,te,ae,ue,de,xe,we,me,Me,ke,Be,He,$e){var qe=new e.ARRAY_TYPE(16);return qe[0]=W,qe[1]=ee,qe[2]=ne,qe[3]=K,qe[4]=te,qe[5]=ae,qe[6]=ue,qe[7]=de,qe[8]=xe,qe[9]=we,qe[10]=me,qe[11]=Me,qe[12]=ke,qe[13]=Be,qe[14]=He,qe[15]=$e,qe},St.set=function(W,ee,ne,K,te,ae,ue,de,xe,we,me,Me,ke,Be,He,$e,qe){return W[0]=ee,W[1]=ne,W[2]=K,W[3]=te,W[4]=ae,W[5]=ue,W[6]=de,W[7]=xe,W[8]=we,W[9]=me,W[10]=Me,W[11]=ke,W[12]=Be,W[13]=He,W[14]=$e,W[15]=qe,W},St.identity=y,St.transpose=function(W,ee){if(W===ee){var ne=ee[1],K=ee[2],te=ee[3],ae=ee[6],ue=ee[7],de=ee[11];W[1]=ee[4],W[2]=ee[8],W[3]=ee[12],W[4]=ne,W[6]=ee[9],W[7]=ee[13],W[8]=K,W[9]=ae,W[11]=ee[14],W[12]=te,W[13]=ue,W[14]=de}else W[0]=ee[0],W[1]=ee[4],W[2]=ee[8],W[3]=ee[12],W[4]=ee[1],W[5]=ee[5],W[6]=ee[9],W[7]=ee[13],W[8]=ee[2],W[9]=ee[6],W[10]=ee[10],W[11]=ee[14],W[12]=ee[3],W[13]=ee[7],W[14]=ee[11
267],W[15]=ee[15];return W},St.invert=function(W,ee){var ne=ee[0],K=ee[1],te=ee[2],ae=ee[3],ue=ee[4],de=ee[5],xe=ee[6],we=ee[7],me=ee[8],Me=ee[9],ke=ee[10],Be=ee[11],He=ee[12],$e=ee[13],qe=ee[14],st=ee[15],We=ne*de-K*ue,ct=ne*xe-te*ue,ft=ne*we-ae*ue,dt=K*xe-te*de,_t=K*we-ae*de,Tt=te*we-ae*xe,Ct=me*$e-Me*He,vt=me*qe-ke*He,qt=me*st-Be*He,ei=Me*qe-ke*$e,Gt=Me*st-Be*$e,yi=ke*st-Be*qe,mi=We*yi-ct*Gt+ft*ei+dt*qt-_t*vt+Tt*Ct;return mi?(W[0]=(de*yi-xe*Gt+we*ei)*(mi=1/mi),W[1]=(te*Gt-K*yi-ae*ei)*mi,W[2]=($e*Tt-qe*_t+st*dt)*mi,W[3]=(ke*_t-Me*Tt-Be*dt)*mi,W[4]=(xe*qt-ue*yi-we*vt)*mi,W[5]=(ne*yi-te*qt+ae*vt)*mi,W[6]=(qe*ft-He*Tt-st*ct)*mi,W[7]=(me*Tt-ke*ft+Be*ct)*mi,W[8]=(ue*Gt-de*qt+we*Ct)*mi,W[9]=(K*qt-ne*Gt-ae*Ct)*mi,W[10]=(He*_t-$e*ft+st*We)*mi,W[11]=(Me*ft-me*_t-Be*We)*mi,W[12]=(de*vt-ue*ei-xe*Ct)*mi,W[13]=(ne*ei-K*vt+te*Ct)*mi,W[14]=($e*ct-He*dt-qe*We)*mi,W[15]=(me*dt-Me*ct+ke*We)*mi,W):null},St.adjoint=function(W,ee){var ne=ee[0],K=ee[1],te=ee[2],ae=ee[3],ue=ee[4],de=ee[5],xe=ee[6],we=ee[7],me=ee[8],Me=ee[9],ke=ee[10],Be=ee[11],He=ee[12],$e=ee[13],qe=ee[14],st=ee[15];return W[0]=de*(ke*st-Be*qe)-Me*(xe*st-we*qe)+$e*(xe*Be-we*ke),W[1]=-(K*(ke*st-Be*qe)-Me*(te*st-ae*qe)+$e*(te*Be-ae*ke)),W[2]=K*(xe*st-we*qe)-de*(te*st-ae*qe)+$e*(te*we-ae*xe),W[3]=-(K*(xe*Be-we*ke)-de*(te*Be-ae*ke)+Me*(te*we-ae*xe)),W[4]=-(ue*(ke*st-Be*qe)-me*(xe*st-we*qe)+He*(xe*Be-we*ke)),W[5]=ne*(ke*st-Be*qe)-me*(te*st-ae*qe)+He*(te*Be-ae*ke),W[6]=-(ne*(xe*st-we*qe)-ue*(te*st-ae*qe)+He*(te*we-ae*xe)),W[7]=ne*(xe*Be-we*ke)-ue*(te*Be-ae*ke)+me*(te*we-ae*xe),W[8]=ue*(Me*st-Be*$e)-me*(de*st-we*$e)+He*(de*Be-we*Me),W[9]=-(ne*(Me*st-Be*$e)-me*(K*st-ae*$e)+He*(K*Be-ae*Me)),W[10]=ne*(de*st-we*$e)-ue*(K*st-ae*$e)+He*(K*we-ae*de),W[11]=-(ne*(de*Be-we*Me)-ue*(K*Be-ae*Me)+me*(K*we-ae*de)),W[12]=-(ue*(Me*qe-ke*$e)-me*(de*qe-xe*$e)+He*(de*ke-xe*Me)),W[13]=ne*(Me*qe-ke*$e)-me*(K*qe-te*$e)+He*(K*ke-te*Me),W[14]=-(ne*(de*qe-xe*$e)-ue*(K*qe-te*$e)+He*(K*xe-te*de)),W[15]=ne*(de*ke-xe*Me)-ue*(K*ke-te*Me)+me*(K*xe-te*de),W},St.determinant=function(W){var ee=W[0],ne=W[1],K=W[2],te=W[3],ae=W[4],ue=W[5],de=W[6],xe=W[7],we=W[8],me=W[9],Me=W[10],ke=W[11],Be=W[12],He=W[13],$e=W[14],qe=W[15];return(ee*ue-ne*ae)*(Me*qe-ke*$e)-(ee*de-K*ae)*(me*qe-ke*He)+(ee*xe-te*ae)*(me*$e-Me*He)+(ne*de-K*ue)*(we*qe-ke*Be)-(ne*xe-te*ue)*(we*$e-Me*Be)+(K*xe-te*de)*(we*He-me*Be)},St.multiply=U,St.translate=function(W,ee,ne){var K,te,ae,ue,de,xe,we,me,Me,ke,Be,He,$e=ne[0],qe=ne[1],st=ne[2];return ee===W?(W[12]=ee[0]*$e+ee[4]*qe+ee[8]*st+ee[12],W[13]=ee[1]*$e+ee[5]*qe+ee[9]*st+ee[13],W[14]=ee[2]*$e+ee[6]*qe+ee[10]*st+ee[14],W[15]=ee[3]*$e+ee[7]*qe+ee[11]*st+ee[15]):(te=ee[1],ae=ee[2],ue=ee[3],de=ee[4],xe=ee[5],we=ee[6],me=ee[7],Me=ee[8],ke=ee[9],Be=ee[10],He=ee[11],W[0]=K=ee[0],W[1]=te,W[2]=ae,W[3]=ue,W[4]=de,W[5]=xe,W[6]=we,W[7]=me,W[8]=Me,W[9]=ke,W[10]=Be,W[11]=He,W[12]=K*$e+de*qe+Me*st+ee[12],W[13]=te*$e+xe*qe+ke*st+ee[13],W[14]=ae*$e+we*qe+Be*st+ee[14],W[15]=ue*$e+me*qe+He*st+ee[15]),W},St.scale=function(W,ee,ne){var K=ne[0],te=ne[1],ae=ne[2];return W[0]=ee[0]*K,W[1]=ee[1]*K,W[2]=ee[2]*K,W[3]=ee[3]*K,W[4]=ee[4]*te,W[5]=ee[5]*te,W[6]=ee[6]*te,W[7]=ee[7]*te,W[8]=ee[8]*ae,W[9]=ee[9]*ae,W[10]=ee[10]*ae,W[11]=ee[11]*ae,W[12]=ee[12],W[13]=ee[13],W[14]=ee[14],W[15]=ee[15],W},St.rotate=function(W,ee,ne,K){var te,ae,ue,de,xe,we,me,Me,ke,Be,He,$e,qe,st,We,ct,ft,dt,_t,Tt,Ct,vt,qt,ei,Gt=K[0],yi=K[1],mi=K[2],ni=Math.hypot(Gt,yi,mi);return ni<e.EPSILON?null:(Gt*=ni=1/ni,yi*=ni,mi*=ni,te=Math.sin(ne),ae=Math.cos(ne),xe=ee[1],we=ee[2],me=ee[3],ke=ee[5],Be=ee[6],He=ee[7],qe=ee[9],st=ee[10],We=ee[11],ct=Gt*Gt*(ue=1-ae)+ae,_t=Gt*yi*ue-mi*te,Tt=yi*yi*ue+ae,Ct=mi*yi*ue+Gt*te,vt=Gt*mi*ue+yi*te,qt=yi*mi*ue-Gt*te,ei=mi*mi*ue+ae,W[0]=(de=ee[0])*ct+(Me=ee[4])*(ft=yi*Gt*ue+mi*te)+($e=ee[8])*(dt=mi*Gt*ue-yi*te),W[1]=xe*ct+ke*ft+qe*dt,W[2]=we*ct+Be*ft+st*dt,W[3]=me*ct+He*ft+We*dt,W[4]=de*_t+Me*Tt+$e*Ct,W[5]=xe*_t+ke*Tt+qe*Ct,W[6]=we*_t+Be*Tt+st*Ct,W[7]=me*_t+He*Tt+We*Ct,W[8]=de*vt+Me*qt+$e*ei,W[9]=xe*vt+ke*qt+qe*ei,W[10]=we*vt+Be*qt+st*ei,W[11]=me*vt+He*qt+We*ei,ee!==W&&(W[12]=ee[12],W[13]=ee[13],W[14]=ee[14],W[15]=ee[15]),W)},St.rotateX=function(W,ee,ne){var K=Math.sin(ne),te=Math.cos(ne),ae=ee[4],ue=ee[5],de=ee[6],xe=ee[7],we=ee[8],me=ee[9],Me=ee[10],ke=ee[11];return ee!==W&&(W[0]=ee[0],W[1]=ee[1],W[2]=ee[2],W[3]=ee[3],W[12]=ee[12],W[13]=ee[13],W[14]=ee[14],W[15]=ee[15]),W[4]=ae*te+we*K,W[5]=ue*te+me*K,W[6]=de*te+Me*K,W[7]=xe*te+ke*K,W[8]=we*te-ae*K,W[9]=me*te-ue*K,W[10]=Me*te-de*K,W[11]=ke*te-xe*K,W},St.rotateY=function(W,ee,ne){var K=Math.sin(ne),te=Math.cos(ne),ae=ee[0],ue=ee[1],de=ee[2],xe=ee[3],we=ee[8],me=ee[9],Me=ee[10],ke=ee[11];return ee!==W&&(W[4]=ee[4],W[5]=ee[5],W[6]=ee[6],W[7]=ee[7],W[12]=ee[12],W[13]=ee[13],W[14]=ee[14],W[15]=ee[15]),W[0]=ae*te-we*K,W[1]=ue*te-me*K,W[2]=de*te-Me*K,W[3]=xe*te-ke*K,W[8]=ae*K+we*te,W[9]=ue*K+me*te,W[10]=de*K+Me*te,W[11]=xe*K+ke*te,W},St.rotateZ=function(W,ee,ne){var K=Math.sin(ne),te=Math.cos(ne),ae=ee[0],ue=ee[1],de=ee[2],xe=ee[3],we=ee[4],me=ee[5],Me=ee[6],ke=ee[7];return ee!==W&&(W[8]=ee[8],W[9]=ee[9],W[10]=ee[10],W[11]=ee[11],W[12]=ee[12],W[13]=ee[13],W[14]=ee[14],W[15]=ee[15]),W[0]=ae*te+we*K,W[1]=ue*te+me*K,W[2]=de*te+Me*K,W[3]=xe*te+ke*K,W[4]=we*te-ae*K,W[5]=me*te-ue*K,W[6]=Me*te-de*K,W[7]=ke*te-xe*K,W},St.fromTranslation=function(W,ee){return W[0]=1,W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=1,W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[10]=1,W[11]=0,W[12]=ee[0],W[13]=ee[1],W[14]=ee[2],W[15]=1,W},St.fromScaling=function(W,ee){return W[0]=ee[0],W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=ee[1],W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[10]=ee[2],W[11]=0,W[12]=0,W[13]=0,W[14]=0,W[15]=1,W},St.fromRotation=function(W,ee,ne){var K,te,ae,ue=ne[0],de=ne[1],xe=ne[2],we=Math.hypot(ue,de,xe);return we<e.EPSILON?null:(ue*=we=1/we,de*=we,xe*=we,K=Math.sin(ee),te=Math.cos(ee),W[0]=ue*ue*(ae=1-te)+te,W[1]=de*ue*ae+xe*K,W[2]=xe*ue*ae-de*K,W[3]=0,W[4]=ue*de*ae-xe*K,W[5]=de*de*ae+te,W[6]=xe*de*ae+ue*K,W[7]=0,W[8]=ue*xe*ae+de*K,W[9]=de*xe*ae-ue*K,W[10]=xe*xe*ae+te,W[11]=0,W[12]=0,W[13]=0,W[14]=0,W[15]=1,W)},St.fromXRotation=function(W,ee){var ne=Math.sin(ee),K=Math.cos(ee);return W[0]=1,W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=K,W[6]=ne,W[7]=0,W[8]=0,W[9]=-ne,W[10]=K,W[11]=0,W[12]=0,W[13]=0,W[14]=0,W[15]=1,W},St.fromYRotation=function(W,ee){var ne=Math.sin(ee),K=Math.cos(ee);return W[0]=K,W[1]=0,W[2]=-ne,W[3]=0,W[4]=0,W[5]=1,W[6]=0,W[7]=0,W[8]=ne,W[9]=0,W[10]=K,W[11]=0,W[12]=0,W[13]=0,W[14]=0,W[15]=1,W},St.fromZRotation=function(W,ee){var ne=Math.sin(ee),K=Math.cos(ee);return W[0]=K,W[1]=ne,W[2]=0,W[3]=0,W[4]=-ne,W[5]=K,W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[10]=1,W[11]=0,W[12]=0,W[13]=0,W[14]=0,W[15]=1,W},St.fromRotationTranslation=R,St.fromQuat2=function(W,ee){var ne=new e.ARRAY_TYPE(3),K=-ee[0],te=-ee[1],ae=-ee[2],ue=ee[3],de=ee[4],xe=ee[5],we=ee[6],me=ee[7],Me=K*K+te*te+ae*ae+ue*ue;return Me>0?(ne[0]=2*(de*ue+me*K+xe*ae-we*te)/Me,ne[1]=2*(xe*ue+me*te+we*K-de*ae)/
vendor: 3,723 bytes, line 267
267Me,ne[2]=2*(we*ue+me*ae+de*te-xe*K)/Me):(ne[0]=2*(de*ue+me*K+xe*ae-we*te),ne[1]=2*(xe*ue+me*te+we*K-de*ae),ne[2]=2*(we*ue+me*ae+de*te-xe*K)),R(W,ee,ne),W},St.getTranslation=function(W,ee){return W[0]=ee[12],W[1]=ee[13],W[2]=ee[14],W},St.getScaling=j,St.getRotation=function(W,ee){var ne=new e.ARRAY_TYPE(3);j(ne,ee);var K=1/ne[0],te=1/ne[1],ae=1/ne[2],ue=ee[0]*K,de=ee[1]*te,xe=ee[2]*ae,we=ee[4]*K,me=ee[5]*te,Me=ee[6]*ae,ke=ee[8]*K,Be=ee[9]*te,He=ee[10]*ae,$e=ue+me+He,qe=0;return $e>0?(qe=2*Math.sqrt($e+1),W[3]=.25*qe,W[0]=(Me-Be)/qe,W[1]=(ke-xe)/qe,W[2]=(de-we)/qe):ue>me&&ue>He?(qe=2*Math.sqrt(1+ue-me-He),W[3]=(Me-Be)/qe,W[0]=.25*qe,W[1]=(de+we)/qe,W[2]=(ke+xe)/qe):me>He?(qe=2*Math.sqrt(1+me-ue-He),W[3]=(ke-xe)/qe,W[0]=(de+we)/qe,W[1]=.25*qe,W[2]=(Me+Be)/qe):(qe=2*Math.sqrt(1+He-ue-me),W[3]=(de-we)/qe,W[0]=(ke+xe)/qe,W[1]=(Me+Be)/qe,W[2]=.25*qe),W},St.fromRotationTranslationScale=function(W,ee,ne,K){var te=ee[0],ae=ee[1],ue=ee[2],de=ee[3],xe=te+te,we=ae+ae,me=ue+ue,Me=te*xe,ke=te*we,Be=te*me,He=ae*we,$e=ae*me,qe=ue*me,st=de*xe,We=de*we,ct=de*me,ft=K[0],dt=K[1],_t=K[2];return W[0]=(1-(He+qe))*ft,W[1]=(ke+ct)*ft,W[2]=(Be-We)*ft,W[3]=0,W[4]=(ke-ct)*dt,W[5]=(1-(Me+qe))*dt,W[6]=($e+st)*dt,W[7]=0,W[8]=(Be+We)*_t,W[9]=($e-st)*_t,W[10]=(1-(Me+He))*_t,W[11]=0,W[12]=ne[0],W[13]=ne[1],W[14]=ne[2],W[15]=1,W},St.fromRotationTranslationScaleOrigin=function(W,ee,ne,K,te){var ae=ee[0],ue=ee[1],de=ee[2],xe=ee[3],we=ae+ae,me=ue+ue,Me=de+de,ke=ae*we,Be=ae*me,He=ae*Me,$e=ue*me,qe=ue*Me,st=de*Me,We=xe*we,ct=xe*me,ft=xe*Me,dt=K[0],_t=K[1],Tt=K[2],Ct=te[0],vt=te[1],qt=te[2],ei=(1-($e+st))*dt,Gt=(Be+ft)*dt,yi=(He-ct)*dt,mi=(Be-ft)*_t,ni=(1-(ke+st))*_t,ti=(qe+We)*_t,Ai=(He+ct)*Tt,vi=(qe-We)*Tt,wi=(1-(ke+$e))*Tt;return W[0]=ei,W[1]=Gt,W[2]=yi,W[3]=0,W[4]=mi,W[5]=ni,W[6]=ti,W[7]=0,W[8]=Ai,W[9]=vi,W[10]=wi,W[11]=0,W[12]=ne[0]+Ct-(ei*Ct+mi*vt+Ai*qt),W[13]=ne[1]+vt-(Gt*Ct+ni*vt+vi*qt),W[14]=ne[2]+qt-(yi*Ct+ti*vt+wi*qt),W[15]=1,W},St.fromQuat=function(W,ee){var ne=ee[0],K=ee[1],te=ee[2],ae=ee[3],ue=ne+ne,de=K+K,xe=te+te,we=ne*ue,me=K*ue,Me=K*de,ke=te*ue,Be=te*de,He=te*xe,$e=ae*ue,qe=ae*de,st=ae*xe;return W[0]=1-Me-He,W[1]=me+st,W[2]=ke-qe,W[3]=0,W[4]=me-st,W[5]=1-we-He,W[6]=Be+$e,W[7]=0,W[8]=ke+qe,W[9]=Be-$e,W[10]=1-we-Me,W[11]=0,W[12]=0,W[13]=0,W[14]=0,W[15]=1,W},St.frustum=function(W,ee,ne,K,te,ae,ue){var de=1/(ne-ee),xe=1/(te-K),we=1/(ae-ue);return W[0]=2*ae*de,W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=2*ae*xe,W[6]=0,W[7]=0,W[8]=(ne+ee)*de,W[9]=(te+K)*xe,W[10]=(ue+ae)*we,W[11]=-1,W[12]=0,W[13]=0,W[14]=ue*ae*2*we,W[15]=0,W},St.perspectiveNO=X,St.perspectiveZO=function(W,ee,ne,K,te){var ae,ue=1/Math.tan(ee/2);return W[0]=ue/ne,W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=ue,W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[11]=-1,W[12]=0,W[13]=0,W[15]=0,te!=null&&te!==1/0?(W[10]=te*(ae=1/(K-te)),W[14]=te*K*ae):(W[10]=-1,W[14]=-K),W},St.perspectiveFromFieldOfView=function(W,ee,ne,K){var te=Math.tan(ee.upDegrees*Math.PI/180),ae=Math.tan(ee.downDegrees*Math.PI/180),ue=Math.tan(ee.leftDegrees*Math.PI/180),de=Math.tan(ee.rightDegrees*Math.PI/180),xe=2/(ue+de),we=2/(te+ae);return W[0]=xe,W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=we,W[6]=0,W[7]=0,W[8]=-(ue-de)*xe*.5,W[9]=(te-ae)*we*.5,W[10]=K/(ne-K),W[11]=-1,W[12]=0,W[13]=0,W[14]=K*ne/(ne-K),W[15]=0,W},St.orthoNO=Q,St.orthoZO=function(W,ee,ne,K,te,ae,ue){var de=1/(ee-ne),xe=1/(K-te),we=1/(ae-ue);return W[0]=-2*de,W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=-2*xe,W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[10]=we,W[11]=0,W[12]=(ee+ne)*de,W[13]=(te+K)*xe,W[14]=ae*we,W[15]=1,W},St.lookAt=function(W,ee,ne,K){var te,ae,ue,de,xe,we,me,Me,ke,Be,He=ee[0],$e=ee[1],qe=ee[2],st=K[0],We=K[1],ct=K[2],ft=ne[0],dt=ne[1],_t=ne[2];return Math.abs(He-ft)<e.EPSILON&&Math.abs($e-dt)<e.EPSILON&&Math.abs(qe-_t)<e.EPSILON?y(W):(me=He-ft,Me
267=$e-dt,ke=qe-_t,te=We*(ke*=Be=1/Math.hypot(me,Me,ke))-ct*(Me*=Be),ae=ct*(me*=Be)-st*ke,ue=st*Me-We*me,(Be=Math.hypot(te,ae,ue))?(te*=Be=1/Be,ae*=Be,ue*=Be):(te=0,ae=0,ue=0),de=Me*ue-ke*ae,xe=ke*te-me*ue,we=me*ae-Me*te,(Be=Math.hypot(de,xe,we))?(de*=Be=1/Be,xe*=Be,we*=Be):(de=0,xe=0,we=0),W[0]=te,W[1]=de,W[2]=me,W[3]=0,W[4]=ae,W[5]=xe,W[6]=Me,W[7]=0,W[8]=ue,W[9]=we,W[10]=ke,W[11]=0,W[12]=-(te*He+ae*$e+ue*qe),W[13]=-(de*He+xe*$e+we*qe),W[14]=-(me*He+Me*$e+ke*qe),W[15]=1,W)},St.targetTo=function(W,ee,ne,K){var te=ee[0],ae=ee[1],ue=ee[2],de=K[0],xe=K[1],we=K[2],me=te-ne[0],Me=ae-ne[1],ke=ue-ne[2],Be=me*me+Me*Me+ke*ke;Be>0&&(me*=Be=1/Math.sqrt(Be),Me*=Be,ke*=Be);var He=xe*ke-we*Me,$e=we*me-de*ke,qe=de*Me-xe*me;return(Be=He*He+$e*$e+qe*qe)>0&&(He*=Be=1/Math.sqrt(Be),$e*=Be,qe*=Be),W[0]=He,W[1]=$e,W[2]=qe,W[3]=0,W[4]=Me*qe-ke*$e,W[5]=ke*He-me*qe,W[6]=me*$e-Me*He,W[7]=0,W[8]=me,W[9]=Me,W[10]=ke,W[11]=0,W[12]=te,W[13]=ae,W[14]=ue,W[15]=1,W},St.str=function(W){return"mat4("+W[0]+", "+W[1]+", "+W[2]+", "+W[3]+", "+W[4]+", "+W[5]+", "+W[6]+", "+W[7]+", "+W[8]+", "+W[9]+", "+W[10]+", "+W[11]+", "+W[12]+", "+W[13]+", "+W[14]+", "+W[15]+")"},St.frob=function(W){return Math.hypot(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],W[8],W[9],W[10],W[11],W[12],W[13],W[14],W[15])},St.add=function(W,ee,ne){return W[0]=ee[0]+ne[0],W[1]=ee[1]+ne[1],W[2]=ee[2]+ne[2],W[3]=ee[3]+ne[3],W[4]=ee[4]+ne[4],W[5]=ee[5]+ne[5],W[6]=ee[6]+ne[6],W[7]=ee[7]+ne[7],W[8]=ee[8]+ne[8],W[9]=ee[9]+ne[9],W[10]=ee[10]+ne[10],W[11]=ee[11]+ne[11],W[12]=ee[12]+ne[12],W[13]=ee[13]+ne[13],W[14]=ee[14]+ne[14],W[15]=ee[15]+ne[15],W},St.subtract=se,St.multiplyScalar=function(W,ee,ne){return W[0]=ee[0]*ne,W[1]=ee[1]*ne,W[2]=ee[2]*ne,W[3]=ee[3]*ne,W[4]=ee[4]*ne,W[5]=ee[5]*ne,W[6]=ee[6]*ne,W[7]=ee[7]*ne,W[8]=ee[8]*ne,W[9]=ee[9]*ne,W[10]=ee[10]*ne,W[11]=ee[11]*ne,W[12]=ee[12]*ne,W[13]=ee[13]*ne,W[14]=ee[14]*ne,W[15]=ee[15]*ne,W},St.multiplyScalarAndAdd=function(W,ee,ne,K){return W[0]=ee[0]+ne[0]*K,W[1]=ee[1]+ne[1]*K,W[2]=ee[2]+ne[2]*K,W[3]=ee[3]+ne[3]*K,W[4]=ee[4]+ne[4]*K,W[5]=ee[5]+ne[5]*K,W[6]=ee[6]+ne[6]*K,W[7]=ee[7]+ne[7]*K,W[8]=ee[8]+ne[8]*K,W[9]=ee[9]+ne[9]*K,W[10]=ee[10]+ne[10]*K,W[11]=ee[11]+ne[11]*K,W[12]=ee[12]+ne[12]*K,W[13]=ee[13]+ne[13]*K,W[14]=ee[14]+ne[14]*K,W[15]=ee[15]+ne[15]*K,W},St.exactEquals=function(W,ee){return W[0]===ee[0]&&W[1]===ee[1]&&W[2]===ee[2]&&W[3]===ee[3]&&W[4]===ee[4]&&W[5]===ee[5]&&W[6]===ee[6]&&W[7]===ee[7]&&W[8]===ee[8]&&W[9]===ee[9]&&W[10]===ee[10]&&W[11]===ee[11]&&W[12]===ee[12]&&W[13]===ee[13]&&W[14]===ee[14]&&W[15]===ee[15]},St.equals=function(W,ee){var ne=W[0],K=W[1],te=W[2],ae=W[3],ue=W[4],de=W[5],xe=W[6],we=W[7],me=W[8],Me=W[9],ke=W[10],Be=W[11],He=W[12],$e=W[13],qe=W[14],st=W[15],We=ee[0],ct=ee[1],ft=ee[2],dt=ee[3],_t=ee[4],Tt=ee[5],Ct=ee[6],vt=ee[7],qt=ee[8],ei=ee[9],Gt=ee[10],yi=ee[11],mi=ee[12],ni=ee[13],ti=ee[14],Ai=ee[15];return Math.abs(ne-We)<=e.EPSILON*Math.max(1,Math.abs(ne),Math.abs(We))&&Math.abs(K-ct)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(ct))&&Math.abs(te-ft)<=e.EPSILON*Math.max(1,Math.abs(te),Math.abs(ft))&&Math.abs(ae-dt)<=e.EPSILON*Math.max(1,Math.abs(ae),Math.abs(dt))&&Math.abs(ue-_t)<=e.EPSILON*Math.max(1,Math.abs(ue),Math.abs(_t))&&Math.abs(de-Tt)<=e.EPSILON*Math.max(1,Math.abs(de),Math.abs(Tt))&&Math.abs(xe-Ct)<=e.EPSILON*Math.max(1,Math.abs(xe),Math.abs(Ct))&&Math.abs(we-vt)<=e.EPSILON*Math.max(1,Math.abs(we),Math.abs(vt))&&Math.abs(me-qt)<=e.EPSILON*Math.max(1,Math.abs(me),Math.abs(qt))&&Math.abs(Me-ei)<=e.EPSILON*Math.max(1,Math.abs(Me),Math.abs(ei))&&Math.abs(ke-Gt)<=e.EPSILON*Math.max(1,Math.abs(ke),Math.abs(Gt))&&Math.abs(Be-yi)<=e.EPSILON*Math.max(1,Math.abs(Be),Math.abs(yi))&&Math.abs(He-mi)<=e.EPSILON*Math.max(1,Math.abs(He),Math.abs(mi))&&Math.abs($e-ni)<=e.EPSILON*Math.max(1,Math.abs($e),Math.abs(ni))&&Math.abs(qe-ti)<=e.EPSILON*Math.max(1,Math.abs(qe),Math.abs(ti))&&Math.abs(st-Ai)<=e.EPSILON*Math.max(1,Math.abs(st),Math.abs(Ai))},St.sub=St.mul=St.ortho=St.perspective=void 0;var e=function(W,ee){if(W&&W.__esModule)return W;if(W===null||h(W)!=="object"&&typeof W!="function")return{default:W};var ne=r(void 0);if(ne&&ne.has(W))return ne.get(W);var K={},te=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ae in W)if(ae!=="default"&&Object.prototype.hasOwnProperty.call(W,ae)){var ue=te?Ob
267ject.getOwnPropertyDescriptor(W,ae):null;ue&&(ue.get||ue.set)?Object.defineProperty(K,ae,ue):K[ae]=W[ae]}return K.default=W,ne&&ne.set(W,K),K}(Ee());function r(W){if(typeof WeakMap!="function")return null;var ee=new WeakMap,ne=new WeakMap;return(r=function(K){return K?ne:ee})(W)}function y(W){return W[0]=1,W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=1,W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[10]=1,W[11]=0,W[12]=0,W[13]=0,W[14]=0,W[15]=1,W}function U(W,ee,ne){var K=ee[0],te=ee[1],ae=ee[2],ue=ee[3],de=ee[4],xe=ee[5],we=ee[6],me=ee[7],Me=ee[8],ke=ee[9],Be=ee[10],He=ee[11],$e=ee[12],qe=ee[13],st=ee[14],We=ee[15],ct=ne[0],ft=ne[1],dt=ne[2],_t=ne[3];return W[0]=ct*K+ft*de+dt*Me+_t*$e,W[1]=ct*te+ft*xe+dt*ke+_t*qe,W[2]=ct*ae+ft*we+dt*Be+_t*st,W[3]=ct*ue+ft*me+dt*He+_t*We,W[4]=(ct=ne[4])*K+(ft=ne[5])*de+(dt=ne[6])*Me+(_t=ne[7])*$e,W[5]=ct*te+ft*xe+dt*ke+_t*qe,W[6]=ct*ae+ft*we+dt*Be+_t*st,W[7]=ct*ue+ft*me+dt*He+_t*We,W[8]=(ct=ne[8])*K+(ft=ne[9])*de+(dt=ne[10])*Me+(_t=ne[11])*$e,W[9]=ct*te+ft*xe+dt*ke+_t*qe,W[10]=ct*ae+ft*we+dt*Be+_t*st,W[11]=ct*ue+ft*me+dt*He+_t*We,W[12]=(ct=ne[12])*K+(ft=ne[13])*de+(dt=ne[14])*Me+(_t=ne[15])*$e,W[13]=ct*te+ft*xe+dt*ke+_t*qe,W[14]=ct*ae+ft*we+dt*Be+_t*st,W[15]=ct*ue+ft*me+dt*He+_t*We,W}function R(W,ee,ne){var K=ee[0],te=ee[1],ae=ee[2],ue=ee[3],de=K+K,xe=te+te,we=ae+ae,me=K*de,Me=K*xe,ke=K*we,Be=te*xe,He=te*we,$e=ae*we,qe=ue*de,st=ue*xe,We=ue*we;return W[0]=1-(Be+$e),W[1]=Me+We,W[2]=ke-st,W[3]=0,W[4]=Me-We,W[5]=1-(me+$e),W[6]=He+qe,W[7]=0,W[8]=ke+st,W[9]=He-qe,W[10]=1-(me+Be),W[11]=0,W[12]=ne[0],W[13]=ne[1],W[14]=ne[2],W[15]=1,W}function j(W,ee){var ne=ee[4],K=ee[5],te=ee[6],ae=ee[8],ue=ee[9],de=ee[10];return W[0]=Math.hypot(ee[0],ee[1],ee[2]),W[1]=Math.hypot(ne,K,te),W[2]=Math.hypot(ae,ue,de),W}function X(W,ee,ne,K,te){var ae,ue=1/Math.tan(ee/2);return W[0]=ue/ne,W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=ue,W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[11]=-1,W[12]=0,W[13]=0,W[15]=0,te!=null&&te!==1/0?(W[10]=(te+K)*(ae=1/(K-te)),W[14]=2*te*K*ae):(W[10]=-1,W[14]=-2*K),W}function Q(W,ee,ne,K,te,ae,ue){var de=1/(ee-ne),xe=1/(K-te),we=1/(ae-ue);return W[0]=-2*de,W[1]=0,W[2]=0,W[3]=0,W[4]=0,W[5]=-2*xe,W[6]=0,W[7]=0,W[8]=0,W[9]=0,W[10]=2*we,W[11]=0,W[12]=(ee+ne)*de,W[13]=(te+K)*xe,W[14]=(ue+ae)*we,W[15]=1,W}function se(W,ee,ne){return W[0]=ee[0]-ne[0],W[1]=ee[1]-ne[1],W[2]=ee[2]-ne[2],W[3]=ee[3]-ne[3],W[4]=ee[4]-ne[4],W[5]=ee[5]-ne[5],W[6]=ee[6]-ne[6],W[7]=ee[7]-ne[7],W[8]=ee[8]-ne[8],W[9]=ee[9]-ne[9],W[10]=ee[10]-ne[10],W[11]=ee[11]-ne[11],W[12]=ee[12]-ne[12],W[13]=ee[13]-ne[13],W[14]=ee[14]-ne[14],W[15]=ee[15]-ne[15],W}return St.perspective=X,St.ortho=Q,St.mul=U,St.sub=se,St}var Zt,xt={},wt={};function Je(){if(Zt)return wt;function h(te){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ae){return typeof ae}:function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},h(te)}Zt=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.create=y,wt.clone=function(te){var ae=new e.ARRAY_TYPE(3);return ae[0]=te[0],ae[1]=te[1],ae[2]=te[2],ae},wt.length=U,wt.fromValues=function(te,ae,ue){var de=new e.ARRAY_TYPE(3);return de[0]=te,de[1]=ae,de[2]=ue,de},wt.copy=function(te,ae){return te[0]=ae[0],te[1]=ae[1],te[2]=ae[2],te},wt.set=function(te,ae,ue,de){return te[0]=ae,te[1]=ue,te[2]=de,te},wt.add=function(te,ae,ue){return te[0]=ae[0]+ue[0],te[1]=ae[1]+ue[1],te[2]=ae[2]+ue[2],te},wt.subtract=R,wt.multiply=j,wt.divide=X,wt.ceil=function(te,ae){return te[0]=Math.ceil(ae[0]),te[1]=Math.ceil(ae[1]),te[2]=Math.ceil(ae[2]),te},wt.floor=function(te,ae){return te[0]=Math.floor(ae[0]),te[1]=Math.floor(ae[1]),te[2]=Math.floor(ae[2]),te},wt.min=function(te,ae,ue){return te[0]=Math.min(ae[0],ue[0]),te[1]=Math.min(ae[1],ue[1]),te[2]=Math.min(ae[2],ue[2]),te},wt.max=function(te,ae,ue){return te[0]=Math.max(ae[0],ue[0]),te[1]=Math.max(ae[1],ue[1]),te[2]=Math.max(ae[2],ue[2]),te},wt.round=function(te,ae){return te[0]=Math.round(ae[0]),te[1]=Math.round(ae[1]),te[2]=Math.round(ae[2]),te},wt.scale=function(te,ae,ue){return te[0]=ae[0]*ue,te[1]=ae[1]*ue,te[2]=ae[2]*ue,te},wt.scaleAndAdd=function(te,ae,ue,de){return te[0]=ae[0]+ue[0]*de,te[1]=ae[1]+ue[1]*de,te[2]=ae[2]+ue[2]*de,te},wt.distance=Q,wt.squaredDistance=se,wt.squaredLength=W,wt.negate=function(te,ae){return te[0]=-ae[0],te[1]=-ae[1],te[2]=-ae[2],te},wt.inverse=function(te,ae){return te[0]=1/ae[0],te[1]=1/ae[1],te[2]=1/ae[2],te},wt.normalize=function(te,ae){var ue=ae[0],de=ae[1],xe=ae[2],we=ue*ue+de*de+xe*xe;return we>0&&(we=1/Math.sqrt(we)),te[0]=ae[0]*we,te[1]=ae[1]*we,te[2]=ae[2]*we,te},wt.dot=ee,wt.cross=function(te,ae,ue){var de=ae[0],xe=ae[1],we=ae[2],me=ue[0],Me=ue[1],ke=ue[2];return te[0]=xe*ke-we*Me,te[1]=we*me-de*ke,te[2]=de*Me-xe*me,te},wt.lerp=function(te,ae,ue,de){var xe=ae[0],we=ae[1],me=ae[2];return te[0]=xe+de*(ue[0]-xe),te[1]=we+de*(ue[1]-we),te[2]=me+de*(ue[2]-me),te},wt.hermite=function(te,ae,ue,de,xe,we){var me=we*we,Me=me*(2*we-3)+1,ke=me*(we-2)+we,Be=me*(we-1),He=me*(3-2*we);return te[0]=ae[0]*Me+ue[0]*ke+de[0]*Be+xe[0]*He,te[1]=ae[1]*Me+ue[1]*ke+de[1]*Be+xe[1]*He,te[2]=ae[2]*Me+ue[2]*ke+de[2]*Be+xe[2]*He,te},wt.bezier=function(te,ae,ue,de,xe,we){var me=1-we,Me=me*me,ke=we*we,Be=Me*me,He=3*we*Me,$e=3*ke*me,qe=ke*we;return te[0]=ae[0]*Be+ue[0]*He+de[0]*$e+xe[0]*qe,te[1]=ae[1]*Be+ue[1]*He+de[1]*$e+xe[1]*qe,te[2]=ae[2]*Be+ue[2]*He+de[2]*$e+xe[2]*qe,te},wt.random=function(te,ae){ae=ae||1;var ue=2*e.RANDOM()*Math.PI,de=2*e.RANDOM()-1,xe=Math.sqrt(1-de*de)*ae;
267return te[0]=Math.cos(ue)*xe,te[1]=Math.sin(ue)*xe,te[2]=de*ae,te},wt.transformMat4=function(te,ae,ue){var de=ae[0],xe=ae[1],we=ae[2],me=ue[3]*de+ue[7]*xe+ue[11]*we+ue[15];return te[0]=(ue[0]*de+ue[4]*xe+ue[8]*we+ue[12])/(me=me||1),te[1]=(ue[1]*de+ue[5]*xe+ue[9]*we+ue[13])/me,te[2]=(ue[2]*de+ue[6]*xe+ue[10]*we+ue[14])/me,te},wt.transformMat3=function(te,ae,ue){var de=ae[0],xe=ae[1],we=ae[2];return te[0]=de*ue[0]+xe*ue[3]+we*ue[6],te[1]=de*ue[1]+xe*ue[4]+we*ue[7],te[2]=de*ue[2]+xe*ue[5]+we*ue[8],te},wt.transformQuat=function(te,ae,ue){var de=ue[0],xe=ue[1],we=ue[2],me=ae[0],Me=ae[1],ke=ae[2],Be=xe*ke-we*Me,He=we*me-de*ke,$e=de*Me-xe*me,qe=xe*$e-we*He,st=we*Be-de*$e,We=de*He-xe*Be,ct=2*ue[3];return He*=ct,$e*=ct,st*=2,We*=2,te[0]=me+(Be*=ct)+(qe*=2),te[1]=Me+He+st,te[2]=ke+$e+We,te},wt.rotateX=function(te,ae,ue,de){var xe=[],we=[];return xe[0]=ae[0]-ue[0],xe[1]=ae[1]-ue[1],xe[2]=ae[2]-ue[2],we[0]=xe[0],we[1]=xe[1]*Math.cos(de)-xe[2]*Math.sin(de),we[2]=xe[1]*Math.sin(de)+xe[2]*Math.cos(de),te[0]=we[0]+ue[0],te[1]=we[1]+ue[1],te[2]=we[2]+ue[2],te},wt.rotateY=function(te,ae,ue,de){var xe=[],we=[];return xe[0]=ae[0]-ue[0],xe[1]=ae[1]-ue[1],xe[2]=ae[2]-ue[2],we[0]=xe[2]*Math.sin(de)+xe[0]*Math.cos(de),we[1]=xe[1],we[2]=xe[2]*Math.cos(de)-xe[0]*Math.sin(de),te[0]=we[0]+ue[0],te[1]=we[1]+ue[1],te[2]=we[2]+ue[2],te},wt.rotateZ=function(te,ae,ue,de){var xe=[],we=[];return xe[0]=ae[0]-ue[0],xe[1]=ae[1]-ue[1],xe[2]=ae[2]-ue[2],we[0]=xe[0]*Math.cos(de)-xe[1]*Math.sin(de),we[1]=xe[0]*Math.sin(de)+xe[1]*Math.cos(de),we[2]=xe[2],te[0]=we[0]+ue[0],te[1]=we[1]+ue[1],te[2]=we[2]+ue[2],te},wt.angle=function(te,ae){var ue=te[0],de=te[1],xe=te[2],we=ae[0],me=ae[1],Me=ae[2],ke=Math.sqrt(ue*ue+de*de+xe*xe)*Math.sqrt(we*we+me*me+Me*Me),Be=ke&&ee(te,ae)/ke;return Math.acos(Math.min(Math.max(Be,-1),1))},wt.zero=function(te){return te[0]=0,te[1]=0,te[2]=0,te},wt.str=function(te){return"vec3("+te[0]+", "+te[1]+", "+te[2]+")"},wt.exactEquals=function(te,ae){return te[0]===ae[0]&&te[1]===ae[1]&&te[2]===ae[2]},wt.equals=function(te,ae){var ue=te[0],de=te[1],xe=te[2],we=ae[0],me=ae[1],Me=ae[2];return Math.abs(ue-we)<=e.EPSILON*Math.max(1,Math.abs(ue),Math.abs(we))&&Math.abs(de-me)<=e.EPSILON*Math.max(1,Math.abs(de),Math.abs(me))&&Math.abs(xe-Me)<=e.EPSILON*Math.max(1,Math.abs(xe),Math.abs(Me))},wt.forEach=wt.sqrLen=wt.len=wt.sqrDist=wt.dist=wt.div=wt.mul=wt.sub=void 0;
267var e=function(te,ae){if(te&&te.__esModule)return te;if(te===null||h(te)!=="object"&&typeof te!="function")return{default:te};var ue=r(void 0);if(ue&&ue.has(te))return ue.get(te);var de={},xe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var we in te)if(we!=="default"&&Object.prototype.hasOwnProperty.call(te,we)){var me=xe?Object.getOwnPropertyDescriptor(te,we):null;me&&(me.get||me.set)?Object.defineProperty(de,we,me):de[we]=te[we]}return de.default=te,ue&&ue.set(te,de),de}(Ee());function r(te){if(typeof WeakMap!="function")return null;var ae=new WeakMap,ue=new WeakMap;return(r=function(de){return de?ue:ae})(te)}function y(){var te=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(te[0]=0,te[1]=0,te[2]=0),te}function U(te){return Math.hypot(te[0],te[1],te[2])}function R(te,ae,ue){return te[0]=ae[0]-ue[0],te[1]=ae[1]-ue[1],te[2]=ae[2]-ue[2],te}function j(te,ae,ue){return te[0]=ae[0]*ue[0],te[1]=ae[1]*ue[1],te[2]=ae[2]*ue[2],te}function X(te,ae,ue){return te[0]=ae[0]/ue[0],te[1]=ae[1]/ue[1],te[2]=ae[2]/ue[2],te}function Q(te,ae){return Math.hypot(ae[0]-te[0],ae[1]-te[1],ae[2]-te[2])}function se(te,ae){var ue=ae[0]-te[0],de=ae[1]-te[1],xe=ae[2]-te[2];return ue*ue+de*de+xe*xe}function W(te){var ae=te[0],ue=te[1],de=te[2];return ae*ae+ue*ue+de*de}function ee(te,ae){return te[0]*ae[0]+te[1]*ae[1]+te[2]*ae[2]}wt.sub=R,wt.mul=j,wt.div=X,wt.dist=Q,wt.sqrDist=se,wt.len=U,wt.sqrLen=W;var ne,K=(ne=y(),function(te,ae,ue,de,xe,we){var me,Me;for(ae||(ae=3),ue||(ue=0),Me=de?Math.min(de*ae+ue,te.length):te.length,me=ue;me<Me;me+=ae)ne[0]=te[me],ne[1]=te[me+1],ne[2]=te[me+2],xe(ne,ne,we),te[me]=ne[0],te[me+1]=ne[1],te[me+2]=ne[2];return te});return wt.forEach=K,wt}var ut,lt,Ye={};function pi(){if(ut)return Ye;function h(K){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},h(K)}ut=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.create=y,Ye.clone=function(K){var te=new e.ARRAY_TYPE(4);return te[0]=K[0],te[1]=K[1],te[2]=K[2],te[3]=K[3],te},Ye.fromValues=function(K,te,ae,ue){var de=new e.ARRAY_TYPE(4);return de[0]=K,de[1]=te,de[2]=ae,de[3]=ue,de},Ye.copy=function(K,te){return K[0]=te[0],K[1]=te[1],K[2]=te[2],K[3]=te[3],K},Ye.set=function(K,te,ae,ue,de){return K[0]=te,K[1]=ae,K[2]=ue,K[3]=de,K},Ye.add=function(K,te,ae){return K[0]=te[0]+ae[0],K[1]=te[1]+ae[1],K[2]=te[2]+ae[2],K[3]=te[3]+ae[3],K},Ye.subtract=U,Ye.multiply=R,Ye.divide=j,Ye.ceil=function(K,te){return K[0]=Math.ceil(te[0]),K[1]=Math.ceil(te[1]),K[2]=Math.ceil(te[2]),K[3]=Math.ceil(te[3]),K},Ye.floor=function(K,te){return K[0]=Math.floor(te[0]),K[1]=Math.floor(te[1]),K[2]=Math.floor(te[2]),K[3]=Math.floor(te[3]),K},Ye.min=function(K,te,ae){return K[0]=Math.min(te[0],ae[0]),K[1]=Math.min(te[1],ae[1]),K[2]=Math.min(te[2],ae[2]),K[3]=Math.min(te[3],ae[3]),K},Ye.max=function(K,te,ae){return K[0]=Math.max(te[0],ae[0]),K[1]=Math.max(te[1],ae[1]),K[2]=Math.max(te[2],ae[2]),K[3]=Math.max(te[3],ae[3]),K},Ye.round=function(K,te){return K[0]=Math.round(te[0]),K[1]=Math.round(te[1]),K[2]=Math.round(te[2]),K[3]=Math.round(te[3]),K},Ye.scale=function(K,te,ae){return K[0]=te[0]*ae,K[1]=te[1]*ae,K[2]=te[2]*ae,K[3]=te[3]*ae,K},Ye.scaleAndAdd=function(K,te,ae,ue){return K[0]=te[0]+ae[0]*ue,K[1]=te[1]+ae[1]*ue,K[2]=te[2]+ae[2]*ue,K[3]=te[3]+ae[3]*ue,K},Ye.distance=X,Ye.squaredDistance=Q,Ye.length=se,Ye.squaredLength=W,Ye.negate=function(K,te){return K[0]=-te[0],K[1]=-te[1],K[2]=-te[2],K[3]=-te[3],K},Ye.inverse=function(K,te){return K[0]=1/te[0],K[1]=1/te[1],K[2]=1/te[2],K[3]=1/te[3],K},Ye.normalize=function(K,te){var ae=te[0],ue=te[1],de=te[2],xe=te[3],we=ae*ae+ue*ue+de*de+xe*xe;return we>0&&(we=1/Math.sqrt(we)),K[0]=ae*we,K[1]=ue*we,K[2]=de*we,K[3]=xe*we,K},Ye.dot=function(K,te){return K[0]*te[0]+K[1]*te[1]+K[2]*te[2]+K[3]*te[3]},Ye.cross=function(K,te,ae,ue){var de=ae[0]*ue[1]-ae[1]*ue[0],xe=ae[0]*ue[2]-ae[2]*ue[0],we=ae[0]*ue[3]-ae[3]*ue[0],me=ae[1]*ue[2]-ae[2]*ue[1],Me=ae[1]*ue[3]-ae[3]*ue[1],ke=ae[2]*ue[3]-ae[3]*ue[2],Be=te[0],He=te[1],$e=te[2],qe=te[3];return K[0]=He*ke-$e*Me+qe*me,K[1]=-Be*ke+$e*we-qe*xe,K[2]=Be*Me-He*we+qe*de,K[3]=-Be*me+He*xe-$e*de,K},Ye.lerp=function(K,te,ae,ue){var de=te[0],xe=te[1],we=te[2],me=te[3];return K[0]=de+ue*(ae[0]-de),K[1]=xe+ue*(ae[1]-xe),K[2]=we+ue*(ae[2]-we),K[3]=me+ue*(ae[3]-me),K},Ye.random=function(K,te){var ae,ue,de,xe,we,me;te=te||1;do we=(ae=2*e.RANDOM()-1)*ae+(ue=2*e.RANDOM()-1)*ue;while(we>=1);do me=(de=2*e.RANDOM()-1)*de+(xe=2*e.RANDOM()-1)*xe;while(me>=1);var Me=Math.sqrt((1-we)/me);return K[0]=te*ae,K[1]=te*ue,K[2]=te*de*Me,K[3]=te*xe*Me,K},Ye.transformMat4=function(K,te,ae){var ue=te[0],de=te[1],xe=te[2],we=te[3];return K[0]=ae[0]*ue+ae[4]*de+ae[8]*xe+ae[12]*we,K[1]=ae[1]*ue+ae[5]*de+ae[9]*xe+ae[13]*we,K[2]=ae[2]*ue+ae[6]*de+ae[10]*xe+ae[14]*we,K[3]=ae[3]*ue+ae[7]*de+ae[11]*xe+ae[15]*we,K},Ye.transformQuat=function(K,te,ae){var ue=te[0],de=te[1],xe=te[2],we=ae[0],me=ae[1],Me=ae[2],ke=ae[3],Be=ke*ue+me*xe-Me*de,He=ke*de+Me*ue-we*xe,$e=ke*xe+we*de-me*ue,qe=-we*ue-me*de-Me*xe;return K[0]=Be*ke+qe*-we+He*-Me-$e*-me,K[1]=He*ke+qe*-me+$e*-we-Be*-Me,K[2]=$e*ke+qe*-Me+Be*-me-He*-we,K[3]=te[3],K},Ye.zero=function(K){return K[0]=0,K[1]=0,K[2]=0,K[3]=0,K},Ye.str=function(K){return"vec4("+K[0]+", "+K[1]+", "+K[2]+", "+K[3]+")"},Ye.exactEquals=function(K,te){return K[0]===te[0]&&K[1]===te[1]&&K[2]===te[2]&&K[3]===te[3]},Ye.equals=function(K,te){var ae=K[0],ue=K[1],de=K[2],xe=K[3],we=te[0],me=te[1],Me=te[2],ke=te[3];return Math.abs(ae-we)<=e.EPSILON*Math.max(1,Math.abs(ae),Math.abs(we))&&Math.abs(ue-me)<=e.EPSILON*Math.max(1,Math.abs(ue),Math.abs(me))&&Math.abs(de-Me)<=e.EPSILON*Math.max(1,Math.abs(de),Math.abs(Me))&&Math.abs(xe-ke)<=e.EPSILON*Math.max(1,Math.abs(xe),Math.abs(ke))},Ye.forEach=Ye.sqrLen=Ye.len=Ye.sqrDist=Ye.dist=Ye.div=Ye.mul=Ye.sub=void 0;var e=function(K,te){if(K&&K.__esModule)return K;if(K===null||h(K)!=="object"&&typeof K!="function")return{default:K};var ae=r(void 0);if(ae&&ae.has(K))return ae.get(K);var ue={},de=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var xe in K)if(xe!=="default"&&Object.prototype.hasOwnProperty.call(K,xe)){var we=de?Object.getOwnPropertyDescriptor(K,xe):null;we&&(we.get||we.set)?Object.defineProperty(ue,xe,we):ue[xe]=K[xe]}return ue.default=K,ae&&ae.set(K,ue),ue}(Ee());function r(K){if(typeof WeakMap!="function")return null;var te=new WeakMap,ae=new WeakMap;return(r=function(ue){return ue?ae:te})(K)}function y(){var K=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(K[0]=0,K[1]=0,K[2]=0,K[3]=0),K}function U(K,te,ae){return K[0]=te[0]-ae[0],K[1]=te[1]-ae[1],K[2]=te[2]-ae[2],K[3]=te[3]-ae[3],K}function R(K,te,ae){return K[0]=te[0]*ae[0],K[1]=te[1]*ae[1],K[2]=te[2]*ae[2],K[3]=te[3]*ae[3],K}function j(K,te,ae){return K[0]=te[0]/ae[0],K[1]=te[1]/ae[1],K[2]=te[2]/ae[2],K[3]=te[3]/ae[3],K}function X(K,te){return Math.hypot(te[0]-K[0],te[1]-K[1],te[2]-K[2],te[3]-K[3])}function Q(K,te){var ae=te[0]-K[0],ue=te[1]-K[1],de=te[2]-K[2],xe=te[3]-K[3];return ae*ae+ue*ue+de*de+xe*xe}function se(K){return Math.hypot(K[0],K[1],K[2],K[3])}function W(K){var te=K[0],ae=K[1],ue=K[2],de=K[3];return te*te+ae*ae+ue*ue+de*de}Ye.sub=U,Ye.mul=R,Ye.div=j,Ye.dist=X,Ye.sqrDist=Q,Ye.len=se,Ye.sqrLen=W;var ee,ne=(ee=y(),function(K,te,ae,ue,de,xe){var we,me;for(te||(te=4),ae||(ae=0),me=ue?Math.min(ue*te+ae,K.length):K.length,we=ae;we<me;we+=te)ee[0]=K[we],ee[1]=K[we+1],ee[2]=K[we+2],ee[3]=K[we+3],de(ee,ee,xe),K[we]=ee[0],K[we+1]=ee[1],K[we+2]=ee[2],K[we+3]=ee[3];return K});return Ye.forEach=ne,Ye}function si(){if(lt)return xt;function h(We){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ct){return typeof ct}:function(ct){return ct&&typeof Symbol=="function"&&ct.constructor===Symbol&&ct!==Symbol.prototype?"symbol":typeof ct},h(We)}
267lt=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.create=X,xt.identity=function(We){return We[0]=0,We[1]=0,We[2]=0,We[3]=1,We},xt.setAxisAngle=Q,xt.getAxisAngle=function(We,ct){var ft=2*Math.acos(ct[3]),dt=Math.sin(ft/2);return dt>e.EPSILON?(We[0]=ct[0]/dt,We[1]=ct[1]/dt,We[2]=ct[2]/dt):(We[0]=1,We[1]=0,We[2]=0),ft},xt.getAngle=function(We,ct){var ft=ae(We,ct);return Math.acos(2*ft*ft-1)},xt.multiply=se,xt.rotateX=function(We,ct,ft){ft*=.5;var dt=ct[0],_t=ct[1],Tt=ct[2],Ct=ct[3],vt=Math.sin(ft),qt=Math.cos(ft);return We[0]=dt*qt+Ct*vt,We[1]=_t*qt+Tt*vt,We[2]=Tt*qt-_t*vt,We[3]=Ct*qt-dt*vt,We},xt.rotateY=function(We,ct,ft){ft*=.5;var dt=ct[0],_t=ct[1],Tt=ct[2],Ct=ct[3],vt=Math.sin(ft),qt=Math.cos(ft);return We[0]=dt*qt-Tt*vt,We[1]=_t*qt+Ct*vt,We[2]=Tt*qt+dt*vt,We[3]=Ct*qt-_t*vt,We},xt.rotateZ=function(We,ct,ft){ft*=.5;var dt=ct[0],_t=ct[1],Tt=ct[2],Ct=ct[3],vt=Math.sin(ft),qt=Math.cos(ft);return We[0]=dt*qt+_t*vt,We[1]=_t*qt-dt*vt,We[2]=Tt*qt+Ct*vt,We[3]=Ct*qt-Tt*vt,We},xt.calculateW=function(We,ct){var ft=ct[0],dt=ct[1],_t=ct[2];return We[0]=ft,We[1]=dt,We[2]=_t,We[3]=Math.sqrt(Math.abs(1-ft*ft-dt*dt-_t*_t)),We},xt.exp=W,xt.ln=ee,xt.pow=function(We,ct,ft){return ee(We,ct),te(We,We,ft),W(We,We),We},xt.slerp=ne,xt.random=function(We){var ct=e.RANDOM(),ft=e.RANDOM(),dt=e.RANDOM(),_t=Math.sqrt(1-ct),Tt=Math.sqrt(ct);return We[0]=_t*Math.sin(2*Math.PI*ft),We[1]=_t*Math.cos(2*Math.PI*ft),We[2]=Tt*Math.sin(2*Math.PI*dt),We[3]=Tt*Math.cos(2*Math.PI*dt),We},xt.invert=function(We,ct){var ft=ct[0],dt=ct[1],_t=ct[2],Tt=ct[3],Ct=ft*ft+dt*dt+_t*_t+Tt*Tt,vt=Ct?1/Ct:0;return We[0]=-ft*vt,We[1]=-dt*vt,We[2]=-_t*vt,We[3]=Tt*vt,We},xt.conjugate=function(We,ct){return We[0]=-ct[0],We[1]=-ct[1],We[2]=-ct[2],We[3]=ct[3],We},xt.fromMat3=K,xt.fromEuler=function(We,ct,ft,dt){var _t=.5*Math.PI/180;ct*=_t,ft*=_t,dt*=_t;var Tt=Math.sin(ct),Ct=Math.cos(ct),vt=Math.sin(ft),qt=Math.cos(ft),ei=Math.sin(dt),Gt=Math.cos(dt);return We[0]=Tt*qt*Gt-Ct*vt*ei,We[1]=Ct*vt*Gt+Tt*qt*ei,We[2]=Ct*qt*ei-Tt*vt*Gt,We[3]=Ct*qt*Gt+Tt*vt*ei,We},xt.str=function(We){return"quat("+We[0]+", "+We[1]+", "+We[2]+", "+We[3]+")"},xt.setAxes=xt.sqlerp=xt.rotationTo=xt.equals=xt.exactEquals=xt.normalize=xt.sqrLen=xt.squaredLength=xt.len=xt.length=xt.lerp=xt.dot=xt.scale=xt.mul=xt.add=xt.set=xt.copy=xt.fromValues=xt.clone=void 0;var e=j(Ee()),r=j(Mt()),y=j(Je()),U=j(pi());function R(We){if(typeof WeakMap!="function")return null;var ct=new WeakMap,ft=new WeakMap;return(R=function(dt){return dt?ft:ct})(We)}function j(We,ct){if(We&&We.__esModule)return We;if(We===null||h(We)!=="object"&&typeof We!="function")return{default:We};var ft=R(ct);if(ft&&ft.has(We))return ft.get(We);var dt={},_t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Tt in We)if(Tt!=="default"&&Object.prototype.hasOwnProperty.call(We,Tt)){var Ct=_t?Object.getOwnPropertyDescriptor(We,Tt):null;Ct&&(Ct.get||Ct.set)?Object.defineProperty(dt,Tt,Ct):dt[Tt]=We[Tt]}return dt.default=We,ft&&ft.set(We,dt),dt}function X(){var We=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(We[0]=0,We[1]=0,We[2]=0),We[3]=1,We}function Q(We,ct,ft){ft*=.5;var dt=Math.sin(ft);return We[0]=dt*ct[0],We[1]=dt*ct[1],We[2]=dt*ct[2],We[3]=Math.cos(ft),We}function se(We,ct,ft){var dt=ct[0],_t=ct[1],Tt=ct[2],Ct=ct[3],vt=ft[0],qt=ft[1],ei=ft[2],Gt=ft[3];return We[0]=dt*Gt+Ct*vt+_t*ei-Tt*qt,We[1]=_t*Gt+Ct*qt+Tt*vt-dt*ei,We[2]=Tt*Gt+Ct*ei+dt*qt-_t*vt,We[3]=Ct*Gt-dt*vt-_t*qt-Tt*ei,We}function W(We,ct){var ft=ct[0],dt=ct[1],_t=ct[2],Tt=ct[3],Ct=Math.sqrt(ft*ft+dt*dt+_t*_t),vt=Math.exp(Tt),qt=Ct>0?vt*Math.sin(Ct)/Ct:0;return We[0]=ft*qt,We[1]=dt*qt,We[2]=_t*qt,We[3]=vt*Math.cos(Ct),We}function ee(We,ct){var ft=ct[0],dt=ct[1],_t=ct[2],Tt=ct[3],Ct=Math.sqrt(ft*ft+dt*dt+_t*_t),vt=Ct>0?Math.atan2(Ct,Tt)/Ct:0;return We[0]=ft*vt,We[1]=dt*vt,We[2]=_t*vt,We[3]=.5*Math.log(ft*ft+dt*dt+_t*_t+Tt*Tt),We}function ne(We,ct,ft,dt){var _t,Tt,Ct,vt,qt,ei=ct[0],Gt=ct[1],yi=ct[2],mi=ct[3],ni=ft[0],ti=ft[1],Ai=ft[2],vi=ft[3];return(Tt=ei*ni+Gt*ti+yi*Ai+mi*vi)<0&&(Tt=-Tt,ni=-ni,ti=-ti,Ai=-Ai,vi=-vi),1-Tt>e.EPSILON?(_t=Math.acos(Tt),Ct=Math.sin(_t),vt=Math.sin((1-dt)*_t)/Ct,qt=Math.sin(dt*_t)/Ct):(vt=1-dt,qt=dt),We[0]=vt*ei+qt*ni,We[1]=vt*Gt+qt*ti,We[2]=vt*yi+qt*Ai,We[3]=vt*mi+qt*vi,We}function K(We,ct){var ft,dt=ct[0]+ct[4]+ct[8];if(dt>0)ft=Math.sqrt(dt+1),We[3]=.5*ft,We[0]=(ct[5]-ct[7])*(ft=.5/ft),We[1]=(ct[6]-ct[2])*ft,We[2]=(ct[1]-ct[3])*ft;else{var _t=0;ct[4]>ct[0]&&(_t=1),ct[8]>ct[3*_t+_t]&&(_t=2);var Tt=(_t+1)%3,Ct=(_t+2)%3;ft=Math.sqrt(ct[3*_t+_t]-ct[3*Tt+Tt]-ct[3*Ct+Ct]+1),We[_t]=.5*ft,We[3]=(ct[3*Tt+Ct]-ct[3*Ct+Tt])*(ft=.5/ft),We[Tt]=(ct[3*Tt+_t]+ct[3*_t+Tt])*ft,We[Ct]=(ct[3*Ct+_t]+ct[3*_t+Ct])*ft}return We}
267xt.clone=U.clone,xt.fromValues=U.fromValues,xt.copy=U.copy,xt.set=U.set,xt.add=U.add,xt.mul=se;var te=U.scale;xt.scale=te;var ae=U.dot;xt.dot=ae,xt.lerp=U.lerp;var ue=U.length;xt.length=ue,xt.len=ue;var de=U.squaredLength;xt.squaredLength=de,xt.sqrLen=de;var xe=U.normalize;xt.normalize=xe,xt.exactEquals=U.exactEquals,xt.equals=U.equals;var we,me,Me,ke=(we=y.create(),me=y.fromValues(1,0,0),Me=y.fromValues(0,1,0),function(We,ct,ft){var dt=y.dot(ct,ft);return dt<-.999999?(y.cross(we,me,ct),y.len(we)<1e-6&&y.cross(we,Me,ct),y.normalize(we,we),Q(We,we,Math.PI),We):dt>.999999?(We[0]=0,We[1]=0,We[2]=0,We[3]=1,We):(y.cross(we,ct,ft),We[0]=we[0],We[1]=we[1],We[2]=we[2],We[3]=1+dt,xe(We,We))});xt.rotationTo=ke;var Be,He,$e=(Be=X(),He=X(),function(We,ct,ft,dt,_t,Tt){return ne(Be,ct,_t,Tt),ne(He,ft,dt,Tt),ne(We,Be,He,2*Tt*(1-Tt)),We});xt.sqlerp=$e;var qe,st=(qe=r.create(),function(We,ct,ft,dt){return qe[0]=ft[0],qe[3]=ft[1],qe[6]=ft[2],qe[1]=dt[0],qe[4]=dt[1],qe[7]=dt[2],qe[2]=-ct[0],qe[5]=-ct[1],qe[8]=-ct[2],xe(We,K(We,qe))});return xt.setAxes=st,xt}var rt,kt={};function _i(){if(rt)return kt;function h(ne){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},h(ne)}rt=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.create=function(){var ne=new e.ARRAY_TYPE(8);return e.ARRAY_TYPE!=Float32Array&&(ne[0]=0,ne[1]=0,ne[2]=0,ne[4]=0,ne[5]=0,ne[6]=0,ne[7]=0),ne[3]=1,ne},kt.clone=function(ne){var K=new e.ARRAY_TYPE(8);return K[0]=ne[0],K[1]=ne[1],K[2]=ne[2],K[3]=ne[3],K[4]=ne[4],K[5]=ne[5],K[6]=ne[6],K[7]=ne[7],K},kt.fromValues=function(ne,K,te,ae,ue,de,xe,we){var me=new e.ARRAY_TYPE(8);return me[0]=ne,me[1]=K,me[2]=te,me[3]=ae,me[4]=ue,me[5]=de,me[6]=xe,me[7]=we,me},kt.fromRotationTranslationValues=function(ne,K,te,ae,ue,de,xe){var we=new e.ARRAY_TYPE(8);we[0]=ne,we[1]=K,we[2]=te,we[3]=ae;var me=.5*ue,Me=.5*de,ke=.5*xe;return we[4]=me*ae+Me*te-ke*K,we[5]=Me*ae+ke*ne-me*te,we[6]=ke*ae+me*K-Me*ne,we[7]=-me*ne-Me*K-ke*te,we},kt.fromRotationTranslation=j,kt.fromTranslation=function(ne,K){return ne[0]=0,ne[1]=0,ne[2]=0,ne[3]=1,ne[4]=.5*K[0],ne[5]=.5*K[1],ne[6]=.5*K[2],ne[7]=0,ne},kt.fromRotation=function(ne,K){return ne[0]=K[0],ne[1]=K[1],ne[2]=K[2],ne[3]=K[3],ne[4]=0,ne[5]=0,ne[6]=0,ne[7]=0,ne},kt.fromMat4=function(ne,K){var te=r.create();y.getRotation(te,K);var ae=new e.ARRAY_TYPE(3);return y.getTranslation(ae,K),j(ne,te,ae),ne},kt.copy=X,kt.identity=function(ne){return ne[0]=0,ne[1]=0,ne[2]=0,ne[3]=1,ne[4]=0,ne[5]=0,ne[6]=0,ne[7]=0,ne},kt.set=function(ne,K,te,ae,ue,de,xe,we,me){return ne[0]=K,ne[1]=te,ne[2]=ae,ne[3]=ue,ne[4]=de,ne[5]=xe,ne[6]=we,ne[7]=me,ne},kt.getDual=function(ne,K){return ne[0]=K[4],ne[1]=K[5],ne[2]=K[6],ne[3]=K[7],ne},kt.setDual=function(ne,K){return ne[4]=K[0],ne[5]=K[1],ne[6]=K[2],ne[7]=K[3],ne},kt.getTranslation=function(ne,K){var te=K[4],ae=K[5],ue=K[6],de=K[7],xe=-K[0],we=-K[1],me=-K[2],Me=K[3];return ne[0]=2*(te*Me+de*xe+ae*me-ue*we),ne[1]=2*(ae*Me+de*we+ue*xe-te*me),ne[2]=2*(ue*Me+de*me+te*we-ae*xe),ne},kt.translate=function(ne,K,te){var ae=K[0],ue=K[1],de=K[2],xe=K[3],we=.5*te[0],me=.5*te[1],Me=.5*te[2],ke=K[4],Be=K[5],He=K[6],$e=K[7];
267return ne[0]=ae,ne[1]=ue,ne[2]=de,ne[3]=xe,ne[4]=xe*we+ue*Me-de*me+ke,ne[5]=xe*me+de*we-ae*Me+Be,ne[6]=xe*Me+ae*me-ue*we+He,ne[7]=-ae*we-ue*me-de*Me+$e,ne},kt.rotateX=function(ne,K,te){var ae=-K[0],ue=-K[1],de=-K[2],xe=K[3],we=K[4],me=K[5],Me=K[6],ke=K[7],Be=we*xe+ke*ae+me*de-Me*ue,He=me*xe+ke*ue+Me*ae-we*de,$e=Me*xe+ke*de+we*ue-me*ae,qe=ke*xe-we*ae-me*ue-Me*de;return r.rotateX(ne,K,te),ne[4]=Be*(xe=ne[3])+qe*(ae=ne[0])+He*(de=ne[2])-$e*(ue=ne[1]),ne[5]=He*xe+qe*ue+$e*ae-Be*de,ne[6]=$e*xe+qe*de+Be*ue-He*ae,ne[7]=qe*xe-Be*ae-He*ue-$e*de,ne},kt.rotateY=function(ne,K,te){var ae=-K[0],ue=-K[1],de=-K[2],xe=K[3],we=K[4],me=K[5],Me=K[6],ke=K[7],Be=we*xe+ke*ae+me*de-Me*ue,He=me*xe+ke*ue+Me*ae-we*de,$e=Me*xe+ke*de+we*ue-me*ae,qe=ke*xe-we*ae-me*ue-Me*de;return r.rotateY(ne,K,te),ne[4]=Be*(xe=ne[3])+qe*(ae=ne[0])+He*(de=ne[2])-$e*(ue=ne[1]),ne[5]=He*xe+qe*ue+$e*ae-Be*de,ne[6]=$e*xe+qe*de+Be*ue-He*ae,ne[7]=qe*xe-Be*ae-He*ue-$e*de,ne},kt.rotateZ=function(ne,K,te){var ae=-K[0],ue=-K[1],de=-K[2],xe=K[3],we=K[4],me=K[5],Me=K[6],ke=K[7],Be=we*xe+ke*ae+me*de-Me*ue,He=me*xe+ke*ue+Me*ae-we*de,$e=Me*xe+ke*de+we*ue-me*ae,qe=ke*xe-we*ae-me*ue-Me*de;return r.rotateZ(ne,K,te),ne[4]=Be*(xe=ne[3])+qe*(ae=ne[0])+He*(de=ne[2])-$e*(ue=ne[1]),ne[5]=He*xe+qe*ue+$e*ae-Be*de,ne[6]=$e*xe+qe*de+Be*ue-He*ae,ne[7]=qe*xe-Be*ae-He*ue-$e*de,ne},kt.rotateByQuatAppend=function(ne,K,te){var ae=te[0],ue=te[1],de=te[2],xe=te[3],we=K[0],me=K[1],Me=K[2],ke=K[3];return ne[0]=we*xe+ke*ae+me*de-Me*ue,ne[1]=me*xe+ke*ue+Me*ae-we*de,ne[2]=Me*xe+ke*de+we*ue-me*ae,ne[3]=ke*xe-we*ae-me*ue-Me*de,ne[4]=(we=K[4])*xe+(ke=K[7])*ae+(me=K[5])*de-(Me=K[6])*ue,ne[5]=me*xe+ke*ue+Me*ae-we*de,ne[6]=Me*xe+ke*de+we*ue-me*ae,ne[7]=ke*xe-we*ae-me*ue-Me*de,ne},kt.rotateByQuatPrepend=function(ne,K,te){var ae=K[0],ue=K[1],de=K[2],xe=K[3],we=te[0],me=te[1],Me=te[2],ke=te[3];
267return ne[0]=ae*ke+xe*we+ue*Me-de*me,ne[1]=ue*ke+xe*me+de*we-ae*Me,ne[2]=de*ke+xe*Me+ae*me-ue*we,ne[3]=xe*ke-ae*we-ue*me-de*Me,ne[4]=ae*(ke=te[7])+xe*(we=te[4])+ue*(Me=te[6])-de*(me=te[5]),ne[5]=ue*ke+xe*me+de*we-ae*Me,ne[6]=de*ke+xe*Me+ae*me-ue*we,ne[7]=xe*ke-ae*we-ue*me-de*Me,ne},kt.rotateAroundAxis=function(ne,K,te,ae){if(Math.abs(ae)<e.EPSILON)return X(ne,K);var ue=Math.hypot(te[0],te[1],te[2]);ae*=.5;var de=Math.sin(ae),xe=de*te[0]/ue,we=de*te[1]/ue,me=de*te[2]/ue,Me=Math.cos(ae),ke=K[0],Be=K[1],He=K[2],$e=K[3];ne[0]=ke*Me+$e*xe+Be*me-He*we,ne[1]=Be*Me+$e*we+He*xe-ke*me,ne[2]=He*Me+$e*me+ke*we-Be*xe,ne[3]=$e*Me-ke*xe-Be*we-He*me;var qe=K[4],st=K[5],We=K[6],ct=K[7];return ne[4]=qe*Me+ct*xe+st*me-We*we,ne[5]=st*Me+ct*we+We*xe-qe*me,ne[6]=We*Me+ct*me+qe*we-st*xe,ne[7]=ct*Me-qe*xe-st*we-We*me,ne},kt.add=function(ne,K,te){return ne[0]=K[0]+te[0],ne[1]=K[1]+te[1],ne[2]=K[2]+te[2],ne[3]=K[3]+te[3],ne[4]=K[4]+te[4],ne[5]=K[5]+te[5],ne[6]=K[6]+te[6],ne[7]=K[7]+te[7],ne},kt.multiply=Q,kt.scale=function(ne,K,te){return ne[0]=K[0]*te,ne[1]=K[1]*te,ne[2]=K[2]*te,ne[3]=K[3]*te,ne[4]=K[4]*te,ne[5]=K[5]*te,ne[6]=K[6]*te,ne[7]=K[7]*te,ne},kt.lerp=function(ne,K,te,ae){var ue=1-ae;return se(K,te)<0&&(ae=-ae),ne[0]=K[0]*ue+te[0]*ae,ne[1]=K[1]*ue+te[1]*ae,ne[2]=K[2]*ue+te[2]*ae,ne[3]=K[3]*ue+te[3]*ae,ne[4]=K[4]*ue+te[4]*ae,ne[5]=K[5]*ue+te[5]*ae,ne[6]=K[6]*ue+te[6]*ae,ne[7]=K[7]*ue+te[7]*ae,ne},kt.invert=function(ne,K){var te=ee(K);return ne[0]=-K[0]/te,ne[1]=-K[1]/te,ne[2]=-K[2]/te,ne[3]=K[3]/te,ne[4]=-K[4]/te,ne[5]=-K[5]/te,ne[6]=-K[6]/te,ne[7]=K[7]/te,ne},kt.conjugate=function(ne,K){return ne[0]=-K[0],ne[1]=-K[1],ne[2]=-K[2],ne[3]=K[3],ne[4]=-K[4],ne[5]=-K[5],ne[6]=-K[6],ne[7]=K[7],ne},kt.normalize=function(ne,K){var te=ee(K);if(te>0){te=Math.sqrt(te);var ae=K[0]/te,ue=K[1]/te,de=K[2]/te,xe=K[3]/te,we=K[4],me=K[5],Me=K[6],ke=K[7],Be=ae*we+ue*me+de*Me+xe*ke;ne[0]=ae,ne[1]=ue,ne[2]=de,ne[3]=xe,ne[4]=(we-ae*Be)/te,ne[5]=(me-ue*Be)/te,ne[6]=(Me-de*Be)/te,ne[7]=(ke-xe*Be)/te}return ne},kt.str=function(ne){return"quat2("+ne[0]+", "+ne[1]+", "+ne[2]+", "+ne[3]+", "+ne[4]+", "+ne[5]+", "+ne[6]+", "+ne[7]+")"},kt.exactEquals=function(ne,K){return ne[0]===K[0]&&ne[1]===K[1]&&ne[2]===K[2]&&ne[3]===K[3]&&ne[4]===K[4]&&ne[5]===K[5]&&ne[6]===K[6]&&ne[7]===K[7]},kt.equals=function(ne,K){var te=ne[0],ae=ne[1],ue=ne[2],de=ne[3],xe=ne[4],we=ne[5],me=ne[6],Me=ne[7],ke=K[0],Be=K[1],He=K[2],$e=K[3],qe=K[4],st=K[5],We=K[6],ct=K[7];return Math.abs(te-ke)<=e.EPSILON*Math.max(1,Math.abs(te),Math.abs(ke))&&Math.abs(ae-Be)<=e.EPSILON*Math.max(1,Math.abs(ae),Math.abs(Be))&&Math.abs(ue-He)<=e.EPSILON*Math.max(1,Math.abs(ue),Math.abs(He))&&Math.abs(de-$e)<=e.EPSILON*Math.max(1,Math.abs(de),Math.abs($e))&&Math.abs(xe-qe)<=e.EPSILON*Math.max(1,Math.abs(xe),Math.abs(qe))&&Math.abs(we-st)<=e.EPSILON*Math.max(1,Math.abs(we),Math.abs(st))&&Math.abs(me-We)<=e.EPSILON*Math.max(1,Math.abs(me),Math.abs(We))&&Math.abs(Me-ct)<=e.EPSILON*Math.max(1,Math.abs(Me),Math.abs(ct))},kt.sqrLen=kt.squaredLength=kt.len=kt.length=kt.dot=kt.mul=kt.setReal=kt.getReal=void 0;var e=R(Ee()),r=R(si()),y=R(Bt());function U(ne){if(typeof WeakMap!="function")return null;var K=new WeakMap,te=new WeakMap;return(U=function(ae){return ae?te:K})(ne)}function R(ne,K){if(ne&&ne.__esModule)return ne;if(ne===null||h(ne)!=="object"&&typeof ne!="function")return{default:ne};var te=U(K);if(te&&te.has(ne))return te.get(ne);var ae={},ue=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var de in ne)if(de!=="default"&&Object.prototype.hasOwnProperty.call(ne,de)){var xe=ue?Object.getOwnPropertyDescriptor(ne,de):null;xe&&(xe.get||xe.set)?Object.defineProperty(ae,de,xe):ae[de]=ne[de]}return ae.default=ne,te&&te.set(ne,ae),ae}function j(ne,K,te){var ae=.5*te[0],ue=.5*te[1],de=.5*te[2],xe=K[0],we=K[1],me=K[2],Me=K[3];return ne[0]=xe,ne[1]=we,ne[2]=me,ne[3]=Me,ne[4]=ae*Me+ue*me-de*we,ne[5]=ue*Me+de*xe-ae*me,ne[6]=de*Me+ae*we-ue*xe,ne[7]=-ae*xe-ue*we-de*me,ne}function X(ne,K){return ne[0]=K[0],ne[1]=K[1],ne[2]=K[2],ne[3]=K[3],ne[4]=K[4],ne[5]=K[5],ne[6]=K[6],ne[7]=K[7],ne}function Q(ne,K,te){var ae=K[0],ue=K[1],de=K[2],xe=K[3],we=te[4],me=te[5],Me=te[6],ke=te[7],Be=K[4],He=K[5],$e=K[6],qe=K[7],st=te[0],We=te[1],ct=te[2],ft=te[3];return ne[0]=ae*ft+xe*st+ue*ct-de*We,ne[1]=ue*ft+xe*We+de*st-ae*ct,ne[2]=de*ft+xe*ct
267+ae*We-ue*st,ne[3]=xe*ft-ae*st-ue*We-de*ct,ne[4]=ae*ke+xe*we+ue*Me-de*me+Be*ft+qe*st+He*ct-$e*We,ne[5]=ue*ke+xe*me+de*we-ae*Me+He*ft+qe*We+$e*st-Be*ct,ne[6]=de*ke+xe*Me+ae*me-ue*we+$e*ft+qe*ct+Be*We-He*st,ne[7]=xe*ke-ae*we-ue*me-de*Me+qe*ft-Be*st-He*We-$e*ct,ne}kt.getReal=r.copy,kt.setReal=r.copy,kt.mul=Q;var se=r.dot;kt.dot=se;var W=r.length;kt.length=W,kt.len=W;var ee=r.squaredLength;return kt.squaredLength=ee,kt.sqrLen=ee,kt}var Yi,Lr,Ii={};function en(){if(Yi)return Ii;function h(K){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},h(K)}Yi=1,Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.create=y,Ii.clone=function(K){var te=new e.ARRAY_TYPE(2);return te[0]=K[0],te[1]=K[1],te},Ii.fromValues=function(K,te){var ae=new e.ARRAY_TYPE(2);return ae[0]=K,ae[1]=te,ae},Ii.copy=function(K,te){return K[0]=te[0],K[1]=te[1],K},Ii.set=function(K,te,ae){return K[0]=te,K[1]=ae,K},Ii.add=function(K,te,ae){return K[0]=te[0]+ae[0],K[1]=te[1]+ae[1],K},Ii.subtract=U,Ii.multiply=R,Ii.divide=j,Ii.ceil=function(K,te){return K[0]=Math.ceil(te[0]),K[1]=Math.ceil(te[1]),K},Ii.floor=function(K,te){return K[0]=Math.floor(te[0]),K[1]=Math.floor(te[1]),K},Ii.min=function(K,te,ae){return K[0]=Math.min(te[0],ae[0]),K[1]=Math.min(te[1],ae[1]),K},Ii.max=function(K,te,ae){return K[0]=Math.max(te[0],ae[0]),K[1]=Math.max(te[1],ae[1]),K},Ii.round=function(K,te){return K[0]=Math.round(te[0]),K[1]=Math.round(te[1]),K},Ii.scale=function(K,te,ae){return K[0]=te[0]*ae,K[1]=te[1]*ae,K},Ii.scaleAndAdd=function(K,te,ae,ue){return K[0]=te[0]+ae[0]*ue,K[1]=te[1]+ae[1]*ue,K},Ii.distance=X,Ii.squaredDistance=Q,Ii.length=se,Ii.squaredLength=W,Ii.negate=function(K,te){return K[0]=-te[0],K[1]=-te[1],K},Ii.inverse=function(K,te){return K[0]=1/te[0],K[1]=1/te[1],K},Ii.normalize=function(K,te){var ae=te[0],ue=te[1],de=ae*ae+ue*ue;return de>0&&(de=1/Math.sqrt(de)),K[0]=te[0]*de,K[1]=te[1]*de,K},Ii.dot=function(K,te){return K[0]*te[0]+K[1]*te[1]},Ii.cross=function(K,te,ae){var ue=te[0]*ae[1]-te[1]*ae[0];return K[0]=K[1]=0,K[2]=ue,K},Ii.lerp=function(K,te,ae,ue){var de=te[0],xe=te[1];return K[0]=de+ue*(ae[0]-de),K[1]=xe+ue*(ae[1]-xe),K},Ii.random=function(K,te){te=te||1;var ae=2*e.RANDOM()*Math.PI;return K[0]=Math.cos(ae)*te,K[1]=Math.sin(ae)*te,K},Ii.transformMat2=function(K,te,ae){var ue=te[0],de=te[1];return K[0]=ae[0]*ue+ae[2]*de,K[1]=ae[1]*ue+ae[3]*de,K},Ii.transformMat2d=function(K,te,ae){var ue=te[0],de=te[1];return K[0]=ae[0]*ue+ae[2]*de+ae[4],K[1]=ae[1]*ue+ae[3]*de+ae[5],K},Ii.transformMat3=function(K,te,ae){var ue=te[0],de=te[1];return K[0]=ae[0]*ue+ae[3]*de+ae[6],K[1]=ae[1]*ue+ae[4]*de+ae[7],K},Ii.transformMat4=function(K,te,ae){var ue=te[0],de=te[1];return K[0]=ae[0]*ue+ae[4]*de+ae[12],K[1]=ae[1]*ue+ae[5]*de+ae[13],K},Ii.rotate=function(K,te,ae,ue){var de=te[0]-ae[0],xe=te[1]-ae[1],we=Math.sin(ue),me=Math.cos(ue);return K[0]=de*me-xe*we+ae[0],K[1]=de*we+xe*me+ae[1],K},Ii.angle=function(K,te){var ae=K[0],ue=K[1],de=te[0],xe=te[1],we=Math.sqrt(ae*ae+ue*ue)*Math.sqrt(de*de+xe*xe);return Math.acos(Math.min(Math.max(we&&(ae*de+ue*xe)/we,-1),1))},Ii.zero=function(K){return K[0]=0,K[1]=0,K},Ii.str=function(K){return"vec2("+K[0]+", "+K[1]+")"},Ii.exactEquals=function(K,te){return K[0]===te[0]&&K[1]===te[1]},Ii.equals=function(K,te){var ae=K[0],ue=K[1],de=te[0],xe=te[1];return Math.abs(ae-de)<=e.EPSILON*Math.max(1,Math.abs(ae),Math.abs(de))&&Math.abs(ue-xe)<=e.EPSILON*Math.max(1,Math.abs(ue),Math.abs(xe))},Ii.forEach=Ii.sqrLen=Ii.sqrDist=Ii.dist=Ii.div=Ii.mul=Ii.sub=Ii.len=void 0;var e=function(K,te){if(K&&K.__esModule)return K;if(K===null||h(K)!=="object"&&typeof K!="function")return{default:K};var ae=r(void 0);if(ae&&ae.has(K))return ae.get(K);var ue={},de=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var xe in K)if(xe!=="default"&&Object.prototype.hasOwnProperty.call(K,xe)){var we=de?Object.getOwnPropertyDescriptor(K,xe):null;we&&(we.get||we.set)?Object.defineProperty(ue,xe,we):ue[xe]=K[xe]}return ue.default=K,ae&&ae.set(K,ue),ue}(Ee());function r(K){if(typeof WeakMap!="function")return null;var te=new WeakMap,ae=new WeakMap;return(r=function(ue){return ue?ae:te})(K)}function y(){var K=new e.ARRAY_TYPE(2);return e.ARRAY_TYPE!=Float32Array&&(K[0]=0,K[1]=0),K}function U(K,te,ae){return K[0]=te[0]-ae[0],K[1]=te[1]-ae[1],K}function R(K,te,ae){return K[0]=te[0]*ae[0],K[1]=te[1]*ae[1],K}function j(K,te,ae){return K[0]=te[0]/ae[0],K[1]=te[1]/ae[1],K}function X(K,te){return Math.hypot(te[0]-K[0],te[1]-K[1])}function Q(K,te){var ae=te[0]-K[0],ue=te[1]-K[1];return ae*ae+ue*ue}function se(K){return Math.hypot(K[0],K[1])}function W(K){var te=K[0],ae=K[1];return te*te+ae*ae}Ii.len=se,Ii.sub=U,Ii.mul=R,Ii.div=j,Ii.dist=X,Ii.sqrDist=Q,Ii.sqrLen=W;var ee,ne=(ee=y(),function(K,te,ae,ue,de,xe){var we,me;for(te||(te=2),ae||(ae=0),me=ue?Math.min(ue*te+ae,K.length):K.length,we=ae;we<me;we+=te)ee[0]=K[we],ee[1]=K[we+1],de(ee,ee,xe),K[we]=ee[0],K[we+1]=ee[1];return K});return Ii.forEach=ne,Ii}function Rr(){if(Lr)return ve;function h(K){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},h(K)}
267Lr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.vec4=ve.vec3=ve.vec2=ve.quat2=ve.quat=ve.mat4=ve.mat3=ve.mat2d=ve.mat2=ve.glMatrix=void 0;var e=ne(Ee());ve.glMatrix=e;var r=ne(ge());ve.mat2=r;var y=ne(Ve());ve.mat2d=y;var U=ne(Mt());ve.mat3=U;var R=ne(Bt());ve.mat4=R;var j=ne(si());ve.quat=j;var X=ne(_i());ve.quat2=X;var Q=ne(en());ve.vec2=Q;var se=ne(Je());ve.vec3=se;var W=ne(pi());function ee(K){if(typeof WeakMap!="function")return null;var te=new WeakMap,ae=new WeakMap;return(ee=function(ue){return ue?ae:te})(K)}function ne(K,te){if(K&&K.__esModule)return K;if(K===null||h(K)!=="object"&&typeof K!="function")return{default:K};var ae=ee(te);if(ae&&ae.has(K))return ae.get(K);var ue={},de=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var xe in K)if(xe!=="default"&&Object.prototype.hasOwnProperty.call(K,xe)){var we=de?Object.getOwnPropertyDescriptor(K,xe):null;we&&(we.get||we.set)?Object.defineProperty(ue,xe,we):ue[xe]=K[xe]}return ue.default=K,ae&&ae.set(K,ue),ue}return ve.vec4=W,ve}var Jr,kr,Pr,An,pt=Rr(),pn=function(){if(kr)return Jr;function h(e,r,y,U){this.cx=3*e,this.bx=3*(y-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(U-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=y,this.p2y=U}return kr=1,Jr=h,h.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var y=e,U=0;U<8;U++){var R=this.sampleCurveX(y)-e;if(Math.abs(R)<r)return y;var j=this.sampleCurveDerivativeX(y);if(Math.abs(j)<1e-6)break;y-=R/j}var X=0,Q=1;for(y=e,U=0;U<20&&(R=this.sampleCurveX(y),!(Math.abs(R-e)<r));U++)e>R?X=y:Q=y,y=.5*(Q-X)+X;return y},solve:function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))}},Jr}(),Mn=Te(pn);function fn(){if(An)return Pr;function h(e,r){this.x=e,this.y=r}return An=1,Pr=h,h.prototype={clone:function(){return new h(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,r){return this.clone()._rotateAround(e,r)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var r=e.x-this.x,y=e.y-this.y;return r*r+y*y},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,r){return Math.atan2(this.x*r-this.y*e,this.x*e+this.y*r)},_matMult:function(e){var r=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var r=Math.cos(e),y=Math.sin(e),U=y*this.x+r*this.y;return this.x=r*this.x-y*this.y,this.y=U,this},_rotateAround:function(e,r){var y=Math.cos(e),U=Math.sin(e),R=r.y+U*(this.x-r.x)+y*(this.y-r.y);return this.x=r.x+y*(this.x-r.x)-U*(this.y-r.y),this.y=R,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},h.convert=function(e){return e instanceof h?e:Array.isArray(e)?new h(e[0],e[1]):e},Pr}var Ht=Te(fn());function on(h,e){if(Array.isArray(h)){if(!Array.isArray(e)||h.length!==e.length)return!1;for(let r=0;r<h.length;r++)if(!on(h[r],e[r]))return!1;return!0}if(typeof h=="object"&&h!==null&&e!==null){if(typeof e!="object"||Object.keys(h).length!==Object.keys(e).length)return!1;for(const r in h)if(!on(h[r],e[r]))return!1;return!0}return h===e}const tn=Math.PI/180,Kn=180/Math.PI;function Xi(h){return h*tn}function Gr(h){return h*Kn}const Hr=[[0,0],[1,0],[1,1],[0,1]];function Rn(h){if(h<=0)return 0;if(h>=1)return 1;const e=h*h,r=e*h;
267return 4*(h<.5?r:3*(h-e)+r-.75)}function Nn(h,e,r,y){const U=new Mn(h,e,r,y);return function(R){return U.solve(R)}}const Le=Nn(.25,.1,.25,1);function Ue(h,e,r){return Math.min(r,Math.max(e,h))}function bt(h,e,r){return(r=Ue((r-h)/(e-h),0,1))*r*(3-2*r)}function It(h,e,r){const y=r-e,U=((h-e)%y+y)%y+e;return U===e?r:U}function Yt(h,e,r){if(!h.length)return r(null,[]);let y=h.length;const U=new Array(h.length);let R=null;h.forEach((j,X)=>{e(j,(Q,se)=>{Q&&(R=Q),U[X]=se,--y==0&&r(R,U)})})}function ai(h,...e){for(const r of e)for(const y in r)h[y]=r[y];return h}let li=1;function di(){return li++}function Gi(h){return h<=1?1:Math.pow(2,Math.ceil(Math.log(h)/Math.LN2))}function Ni(h,e){h.forEach(r=>{e[r]&&(e[r]=e[r].bind(e))})}function $i(h,e){return h.indexOf(e,h.length-e.length)!==-1}function er(h,e,r){const y={};for(const U in h)y[U]=e.call(this,h[U],U,h);return y}function yr(h,e,r){const y={};for(const U in h)e.call(this,h[U],U,h)&&(y[U]=h[U]);return y}function or(h){return Array.isArray(h)?h.map(or):typeof h=="object"&&h?er(h,or):h}const wr={};function zi(h){wr[h]||(typeof console<"u"&&console.warn(h),wr[h]=!0)}function vn(h,e,r){return(r.y-h.y)*(e.x-h.x)>(e.y-h.y)*(r.x-h.x)}function Vn(h){let e=0;for(let r,y,U=0,R=h.length,j=R-1;U<R;j=U++)r=h[U],y=h[j],e+=(y.x-r.x)*(r.y+y.y);return e}function mn([h,e,r]){const y=Xi(e+90),U=Xi(r);return{x:h*Math.cos(y)*Math.sin(U),y:h*Math.sin(y)*Math.sin(U),z:h*Math.cos(U),azimuthal:e,polar:r}}function rn(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Qn(h){const e={};if(h.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,y,U,R)=>{const j=U||R;return e[y]=!j||j.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}let es=null;
267function Ts(h,e){return[h[4*e],h[4*e+1],h[4*e+2],h[4*e+3]]}function Ds(h,e,r,y){for(;e<r;){const U=e+r>>1;h[U]<y?e=U+1:r=U}return e}function qn(h,e,r,y){for(;e<r;){const U=e+r>>1;h[U]<=y?e=U+1:r=U}return e}function ss(h){return h>0?1/(1.001-h):1+h}function Oa(h){return h>0?1-1/(1.001-h):-h}const ln={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!ln.API_URL)return null;try{const h=new URL(ln.API_URL);return h.hostname==="api.mapbox.cn"?"https://events.mapbox.cn/events/v2":h.hostname==="api.mapbox.com"?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",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:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function Ba(h){return ln.API_URL_REGEX.test(h)}function ra(h){return ln.API_SPRITE_REGEX.test(h)}let Na,mr,nn,Lt,Re,Ne;function je(){return Na==null&&(Na=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&typeof self.createImageBitmap=="function"),Na}const tt={now:()=>Lt!==void 0?Lt:performance.now(),setNow(h){Lt=h},restoreNow(){Lt=void 0},frame(h){const e=requestAnimationFrame(h);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(h,e=0){const{width:r,height:y}=h;Re||(Re=document.createElement("canvas"));const U=Re.getContext("2d",{willReadFrequently:!0});if(!U)throw new Error("failed to create canvas 2d context");return(r>Re.width||y>Re.height)&&(Re.width=r,Re.height=y),U.clearRect(-e,-e,r+2*e,y+2*e),U.drawImage(h,0,0,r,y),U.getImageData(-e,-e,r+2*e,y+2*e)},resolveURL:h=>(mr||(mr=document.createElement("a")),mr.href=h,mr.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(nn==null&&(nn=window.matchMedia("(prefers-reduced-motion: reduce)")),nn.matches)},hasCanvasFingerprintNoise(){if(Ne!==void 0)return Ne;if(!je())return Ne=!1,!1;const h=new OffscreenCanvas(85,1),e=h.getContext("2d",{willReadFrequently:!0});let r=0;for(let U=0;U<h.width;++U)e.fillStyle=`rgba(${r++},${r++},${r++}, 255)`,e.fillRect(U,0,1,1);const y=e.getImageData(0,0,h.width,h.height);r=0;for(let U=0;U<y.data.length;++U)if(U%4!=3&&r++!==y.data[U])return Ne=!0,!0;return Ne=!1,!1}};function ot(h,e){const r=h.indexOf("?");if(r<0)return`${h}?${new URLSearchParams(e).toString()}`;const y=new URLSearchParams(h.slice(r));for(const U in e)y.set(U,e[U]);return`${h.slice(0,r)}?${y.toString()}`}
267function mt(h,e={persistentParams:[]}){const r=h.indexOf("?");if(r<0)return h;const y=new URLSearchParams,U=new URLSearchParams(h.slice(r));for(const j of e.persistentParams){const X=U.get(j);X&&y.set(j,X)}const R=y.toString();return`${h.slice(0,r)}${R.length>0?`?${R}`:""}`}const Pt="mapbox-tiles";let gt=500,Ft=50;const zt=["language","worldview","jobid"];let Ot,Kt;function ui(){try{return caches}catch{}}function fi(){const h=ui();h&&Ot==null&&(Ot=h.open(Pt))}let Di=1/0;const Fi={supported:!1,testSupport:function(h){!lr&&Li&&(dr?gr(h):Oi=h)}};let Oi,Li,lr=!1,dr=!1;const tr=typeof self<"u"?self:{};function gr(h){const e=h.createTexture();h.bindTexture(h.TEXTURE_2D,e);try{if(h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,Li),h.isContextLost())return;Fi.supported=!0}catch{}h.deleteTexture(e),lr=!0}tr.document&&(Li=tr.document.createElement("img"),Li.onload=function(){Oi&&gr(Oi),Oi=null,dr=!0},Li.onerror=function(){lr=!0,Oi=null},Li.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const xr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};typeof Object.freeze=="function"&&Object.freeze(xr);class gn extends Error{constructor(e,r,y){r===401&&Ba(y)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=r,this.url=y}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const Us=rn()?()=>self.worker&&self.worker.referrer:()=>(location.protocol==="blob:"?parent:self).location.href,Tn=function(h,e){if(!(/^file:/.test(r=h.url)||/^file:/.test(Us())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(y,U){const R=new AbortController,j=new Request(y.url,{method:y.method||"GET",body:y.body,credentials:y.credentials,headers:y.headers,referrer:Us(),referrerPolicy:y.referrerPolicy,signal:R.signal});let X=!1,Q=!1;const se=(W=j.url).indexOf("sku=")>0&&Ba(W);var W;y.type==="json"&&j.headers.set("Accept","application/json");const ee=(K,te,ae)=>{if(Q)return;if(K&&K.message!=="SecurityError"&&zi(K.toString()),te&&ae)return ne(te);const ue=Date.now();fetch(j).then(de=>{if(de.ok){const xe=se?de.clone():null;return ne(de,xe,ue)}return U(new gn(de.statusText,de.status,y.url))}).catch(de=>{de.name!=="AbortError"&&U(new Error(`${de.message} ${y.url}`))})},ne=(K,te,ae)=>{(y.type==="arrayBuffer"?K.arrayBuffer():y.type==="json"?K.json():K.text()).then(ue=>{Q||(te&&ae&&function(de,xe,we){if(fi(),Ot==null)return;const me=Qn(xe.headers.get("Cache-Control")||"");if(me["no-store"])return;const Me={status:xe.status,statusText:xe.statusText,headers:new Headers};xe.headers.forEach((He,$e)=>Me.headers.set($e,He)),me["max-age"]&&Me.headers.set("Expires",new Date(we+1e3*me["max-age"]).toUTCString());const ke=Me.headers.get("Expires");if(!ke||new Date(ke).getTime()-we<42e4)return;
267let Be=mt(de.url,{persistentParams:zt});if(xe.status===206){const He=de.headers.get("Range");if(!He)return;Me.status=200,Be=ot(Be,{range:He})}(function(He,$e){if(Kt===void 0)try{new Response(new ReadableStream),Kt=!0}catch{Kt=!1}Kt?$e(He.body):He.blob().then($e)})(xe,He=>{const $e=new Response((qe=xe.status)!==200&&qe!==404&&[101,103,204,205,304].includes(qe)?null:He,Me);var qe;fi(),Ot!=null&&Ot.then(st=>st.put(Be,$e)).catch(st=>zi(st.message))})}(j,te,ae),X=!0,U(null,ue,K.headers.get("Cache-Control"),K.headers.get("Expires")))}).catch(ue=>{Q||U(new Error(ue.message))})};return se?function(K,te){if(fi(),Ot==null)return te(null);Ot.then(ae=>{let ue=mt(K.url,{persistentParams:zt});const de=K.headers.get("Range");de&&(ue=ot(ue,{range:de})),ae.match(ue).then(xe=>{const we=function(me){if(!me)return!1;const Me=new Date(me.headers.get("Expires")||0),ke=Qn(me.headers.get("Cache-Control")||"");return Me>Date.now()&&!ke["no-cache"]}(xe);ae.delete(ue),we&&ae.put(ue,xe.clone()),te(null,xe,we)}).catch(te)}).catch(te)}(j,ee):ee(null,null),{cancel:()=>{Q=!0,X||R.abort()}}}(h,e);if(rn()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",h,e,void 0,!0)}var r;return function(y,U){const R=new XMLHttpRequest;R.open(y.method||"GET",y.url,!0),y.type==="arrayBuffer"&&(R.responseType="arraybuffer");for(const j in y.headers)R.setRequestHeader(j,y.headers[j]);return y.type==="json"&&(R.responseType="text",R.setRequestHeader("Accept","application/json")),R.withCredentials=y.credentials==="include",R.onerror=()=>{U(new Error(R.statusText))},R.onload=()=>{if((R.status>=200&&R.status<300||R.status===0)&&R.response!==null){let j=R.response;if(y.type==="json")try{j=JSON.parse(R.response)}catch(X){return U(X)}U(null,j,R.getResponseHeader("Cache-Control"),R.getResponseHeader("Expires"))}else U(new gn(R.statusText,R.status,y.url))},R.send(y.body),{cancel:()=>R.abort()}}(h,e)},Pn=function(h,e){return Tn(ai(h,{type:"arrayBuffer"}),e)};function ts(h){const e=document.createElement("a");return e.href=h,e.protocol===location.protocol&&e.host===location.host}const $o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let na,Ho;na=[],Ho=0;const eh=function(h,e){if(Fi.supported&&(h.headers||(h.headers={}),h.headers.accept="image/webp,*/*"),Ho>=ln.MAX_PARALLEL_IMAGE_REQUESTS){const R={requestParameters:h,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return na.push(R),R}Ho++;let r=!1;const y=()=>{if(!r)for(r=!0,Ho--;na.length&&Ho<ln.MAX_PARALLEL_IMAGE_REQUESTS;){const R=na.shift(),{requestParameters:j,callback:X,cancelled:Q}=R;Q||(R.cancel=eh(j,X).cancel)}},U=Pn(h,(R,j,X,Q)=>{y(),R?e(R):j&&(self.createImageBitmap?function(se,W){const ee=new Blob([new Uint8Array(se)],{type:"image/png"});createImageBitmap(ee).then(ne=>{W(null,ne)}).catch(ne=>{W(new Error(`Could not load image because of ${ne.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(j,(se,W)=>e(se,W,X,Q)):function(se,W){const ee=new Image;ee.onload=()=>{W(null,ee),URL.revokeObjectURL(ee.src),ee.onload=null,requestAnimationFrame(()=>{ee.src=$o})},ee.onerror=()=>W(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const ne=new Blob([new Uint8Array(se)],{type:"image/png"});ee.src=se.byteLength?URL.createObjectURL(ne):$o}(j,(se,W)=>e(se,W,X,Q)))});return{cancel:()=>{U.cancel(),y()}}};var Ku,th,ih,is={exports:{}},ks={exports:{}},sa={exports:{}},js=function(){if(ih)return is.exports;ih=1;var h=(Ku||(Ku=1,ks.exports=function(r,y){var U,R,j,X,Q,se,W,ee;for(R=r.length-(U=3&r.length),j=y,Q=3432918353,se=461845907,ee=0;ee<R;)W=255&r.charCodeAt(ee)|(255&r.charCodeAt(++ee))<<8|(255&r.charCodeAt(++ee))<<16|(255&r.charCodeAt(++ee))<<24,++ee,j=27492+(65535&(X=5*(65535&(j=(j^=W=(65535&(W=(W=(65535&W)*Q+(((W>>>16)*Q&65535)<<16)&4294967295)<<15|W>>>17))*se+(((W>>>16)*se&65535)<<16)&4294967295)<<13|j>>>19))+((5*(j>
vendor: 6,467 bytes, line 267
267>>16)&65535)<<16)&4294967295))+((58964+(X>>>16)&65535)<<16);switch(W=0,U){case 3:W^=(255&r.charCodeAt(ee+2))<<16;case 2:W^=(255&r.charCodeAt(ee+1))<<8;case 1:j^=W=(65535&(W=(W=(65535&(W^=255&r.charCodeAt(ee)))*Q+(((W>>>16)*Q&65535)<<16)&4294967295)<<15|W>>>17))*se+(((W>>>16)*se&65535)<<16)&4294967295}return j^=r.length,j=2246822507*(65535&(j^=j>>>16))+((2246822507*(j>>>16)&65535)<<16)&4294967295,j=3266489909*(65535&(j^=j>>>13))+((3266489909*(j>>>16)&65535)<<16)&4294967295,(j^=j>>>16)>>>0}),ks.exports),e=(th||(th=1,sa.exports=function(r,y){for(var U,R=r.length,j=y^R,X=0;R>=4;)U=1540483477*(65535&(U=255&r.charCodeAt(X)|(255&r.charCodeAt(++X))<<8|(255&r.charCodeAt(++X))<<16|(255&r.charCodeAt(++X))<<24))+((1540483477*(U>>>16)&65535)<<16),j=1540483477*(65535&j)+((1540483477*(j>>>16)&65535)<<16)^(U=1540483477*(65535&(U^=U>>>24))+((1540483477*(U>>>16)&65535)<<16)),R-=4,++X;switch(R){case 3:j^=(255&r.charCodeAt(X+2))<<16;case 2:j^=(255&r.charCodeAt(X+1))<<8;case 1:j=1540483477*(65535&(j^=255&r.charCodeAt(X)))+((1540483477*(j>>>16)&65535)<<16)}return j=1540483477*(65535&(j^=j>>>13))+((1540483477*(j>>>16)&65535)<<16),(j^=j>>>15)>>>0}),sa.exports);return is.exports=h,is.exports.murmur3=h,is.exports.murmur2=e,is.exports}(),Rs=Te(js);class Gs{constructor(e,...r){ai(this,r[0]||{}),this.type=e}}class Wl extends Gs{constructor(e,r={}){super("error",ai({error:e},r))}}function rh(h,e,r){r[h]&&r[h].indexOf(e)!==-1||(r[h]=r[h]||[],r[h].push(e))}function ba(h,e,r){if(r&&r[h]){const y=r[h].indexOf(e);y!==-1&&r[h].splice(y,1)}}class wa{on(e,r){return this._listeners=this._listeners||{},rh(e,r,this._listeners),this}off(e,r){return ba(e,r,this._listeners),ba(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},rh(e,r,this._oneTimeListeners),this):new Promise(y=>this.once(e,y))}fire(e,r){const y=typeof e=="string"?new Gs(e,r):e,U=y.type;if(this.listens(U)){y.target=this;const R=this._listeners&&this._listeners[U]?this._listeners[U].slice():[];for(const Q of R)Q.call(this,y);const j=this._oneTimeListeners&&this._oneTimeListeners[U]?this._oneTimeListeners[U].slice():[];for(const Q of j)ba(U,Q,this._oneTimeListeners),Q.call(this,y);const X=this._eventedParent;X&&(ai(y,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),X.fire(y))}else y instanceof Wl&&console.error(y.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var Qu,nh={},Es=function(){if(Qu)return nh;Qu=1;var h={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]};
267function e(R){return(R=Math.round(R))<0?0:R>255?255:R}function r(R){return e(R[R.length-1]==="%"?parseFloat(R)/100*255:parseInt(R))}function y(R){return(j=R[R.length-1]==="%"?parseFloat(R)/100:parseFloat(R))<0?0:j>1?1:j;var j}function U(R,j,X){return X<0?X+=1:X>1&&(X-=1),6*X<1?R+(j-R)*X*6:2*X<1?j:3*X<2?R+(j-R)*(2/3-X)*6:R}try{nh.parseCSSColor=function(R){var j,X=R.replace(/ /g,"").toLowerCase();if(X in h)return h[X].slice();if(X[0]==="#")return X.length===4?(j=parseInt(X.substr(1),16))>=0&&j<=4095?[(3840&j)>>4|(3840&j)>>8,240&j|(240&j)>>4,15&j|(15&j)<<4,1]:null:X.length===7&&(j=parseInt(X.substr(1),16))>=0&&j<=16777215?[(16711680&j)>>16,(65280&j)>>8,255&j,1]:null;var Q=X.indexOf("("),se=X.indexOf(")");if(Q!==-1&&se+1===X.length){var W=X.substr(0,Q),ee=X.substr(Q+1,se-(Q+1)).split(","),ne=1;switch(W){case"rgba":if(ee.length!==4)return null;ne=y(ee.pop());case"rgb":return ee.length!==3?null:[r(ee[0]),r(ee[1]),r(ee[2]),ne];case"hsla":if(ee.length!==4)return null;ne=y(ee.pop());case"hsl":if(ee.length!==3)return null;var K=(parseFloat(ee[0])%360+360)%360/360,te=y(ee[1]),ae=y(ee[2]),ue=ae<=.5?ae*(te+1):ae+te-ae*te,de=2*ae-ue;return[e(255*U(de,ue,K+1/3)),e(255*U(de,ue,K)),e(255*U(de,ue,K-1/3)),ne];default:return null}}return null}}catch{}return nh}();class Sr{constructor(e,r,y,U=1){this.r=e,this.g=r,this.b=y,this.a=U}static parse(e){if(!e)return;if(e instanceof Sr)return e;if(typeof e!="string")return;const r=Es.parseCSSColor(e);return r?new Sr(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toStringPremultipliedAlpha(){const[e,r,y,U]=this.a===0?[0,0,0,0]:[255*this.r/this.a,255*this.g/this.a,255*this.b/this.a,this.a];return`rgba(${Math.round(e)},${Math.round(r)},${Math.round(y)},${U})`}toString(){const[e,r,y,U]=[this.r,this.g,this.b,this.a];return`rgba(${Math.round(255*e)},${Math.round(255*r)},${Math.round(255*y)},${U})`}toRenderColor(e){const{r,g:y,b:U,a:R}=this;return new sh(e,r,y,U,R)}clone(){return new Sr(this.r,this.g,this.b,this.a)}}class sh{constructor(e,r,y,U,R){if(e){const j=e.image.height,X=j*j;r=R===0?0:r/R*(j-1),y=R===0?0:y/R*(j-1),U=R===0?0:U/R*(j-1);const Q=Math.floor(r),se=Math.floor(y),W=Math.floor(U),ee=Math.ceil(r),ne=Math.ceil(y),K=Math.ceil(U),te=r-Q,ae=y-se,ue=U-W,de=e.image.data,xe=4*(Q+se*X+W*j),we=4*(Q+se*X+K*j),me=4*(Q+ne*X+W*j),Me=4*(Q+ne*X+K*j),ke=4*(ee+se*X+W*j),Be=4*(ee+se*X+K*j),He=4*(ee+ne*X+W*j),$e=4*(ee+ne*X+K*j);if(xe<0||$e>=de.length)throw new Error("out of range");this.r=Bi(Bi(Bi(de[xe],de[we],ue),Bi(de[me],de[Me],ue),ae),Bi(Bi(de[ke],de[Be],ue),Bi(de[He],de[$e],ue),ae),te)/255*R,this.g=Bi(Bi(Bi(de[xe+1],de[we+1],ue),Bi(de[me+1],de[Me+1],ue),ae),Bi(Bi(de[ke+1],de[Be+1],ue),Bi(de[He+1],de[$e+1],ue),ae),te)/255*R,this.b=Bi(Bi(Bi(de[xe+2],de[we+2],ue),Bi(de[me+2],de[Me+2],ue),ae),Bi(Bi(de[ke+2],de[Be+2],ue),Bi(de[He+2],de[$e+2],ue),ae),te)/255*R,this.a=R}else this.r=r,this.g=y,this.b=U,this.a=R}toArray(){const{r:e,g:r,b:y,a:U}=this;return U===0?[0,0,0,0]:[255*e/U,255*r/U,255*y/U,U]}toHslaArray(){if(this.a===0)return[0,0,0,0];const{r:e,g:r,b:y,a:U}=this,R=Math.min(Math.max(e/U,0),1),j=Math.min(Math.max(r/U,0),1),X=Math.min(Math.max(y/U,0),1),Q=Math.min(R,j,X),se=Math.max(R,j,X),W=(Q+se)/2;if(Q===se)return[0,0,100*W,U];const ee=se-Q,ne=W>.5?ee/(2-se-Q):ee/(se+Q);let K=0;return se===R?K=(j-X)/ee+(j<X?6:0):se===j?K=(X-R)/ee+2:se===X&&(K=(R-j)/ee+4),K*=60,[Math.min(Math.max(K,0),360),Math.min(Math.max(100*ne,0),100),Math.min(Math.max(100*W,0),100),U]}toArray01(){const{r:e,g:r,b:y,a:U}=this;return U===0?[0,0,0,0]:[e/U,r/U,y/U,U]}toArray01Scaled(e){const{r,g:y,b:U,a:R}=this;return R===0?[0,0,0]:[r/R*e,y/R*e,U/R*e]}toArray01PremultipliedAlpha(){const{r:e,g:r,b:y,a:U}=this;return[e,r,y,U]}toArray01Linear(){const{r:e,g:r,b:y,a:U}=this;return U===0?[0,0,0,0]:[Math.pow(e/U,2.2),Math.pow(r/U,2.2),Math.pow(y/U,2.2),U]}}function Bi(h,e,r){return h*(1-r)+e*r}function ed(h,e,r){return h.map((y,U)=>Bi(y,e[U],r))}Sr.black=new Sr(0,0,0,1),Sr.white=new Sr(1,1,1,1),Sr.transparent=new Sr(0,0,0,0),Sr.red=new Sr(1,0,0,1),Sr.blue=new Sr(0,0,1,1);var Zl=Object.freeze({__proto__:null,array:ed,color:function(h,e,r){return new Sr(Bi(h.r,e.r,r),Bi(h.g,e.g,r),Bi(h.b,e.b,r),Bi(h.a,e.a,r))},number:Bi});function Xl(h,...e){for(const r of e)for(const y in r)h[y]=r[y];return h}
267class rr extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class Yl{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[y,U]of r)this.bindings[y]=U}concat(e){return new Yl(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 Va={kind:"null"},Ei={kind:"number"},Ar={kind:"string"},pr={kind:"boolean"},$n={kind:"color"},aa={kind:"object"},vr={kind:"value"},Wo={kind:"collator"},qs={kind:"formatted"},Zo={kind:"resolvedImage"};function zn(h,e){return{kind:"array",itemType:h,N:e}}function sn(h){if(h.kind==="array"){const e=sn(h.itemType);return typeof h.N=="number"?`array<${e}, ${h.N}>`:h.itemType.kind==="value"?"array":`array<${e}>`}return h.kind}const ah=[Va,Ei,Ar,pr,$n,qs,aa,zn(vr),Zo];function as(h,e){if(e.kind==="error")return null;if(h.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!as(h.itemType,e.itemType))&&(typeof h.N!="number"||h.N===e.N))return null}else{if(h.kind===e.kind)return null;if(h.kind==="value"){for(const r of ah)if(!as(r,e))return null}}return`Expected ${sn(h)} but found ${sn(e)} instead.`}function Jl(h,e){return e.some(r=>r.kind===h.kind)}function Xo(h,e){return e.some(r=>r==="null"?h===null:r==="array"?Array.isArray(h):r==="object"?h&&!Array.isArray(h)&&typeof h=="object":r===typeof h)}class Kl{constructor(e,r,y){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=y,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Yo{constructor(e,r,y,U,R){this.text=e.normalize?e.normalize():e,this.image=r,this.scale=y,this.fontStack=U,this.textColor=R}}class Hn{constructor(e){this.sections=e}static fromString(e){return new Hn([new Yo(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.namePrimary)}static factory(e){return e instanceof Hn?e:Hn.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const r of this.sections){if(r.image){e.push(["image",r.image.namePrimary]);continue}e.push(r.text);const y={};r.fontStack&&(y["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(y["font-scale"]=r.scale),r.textColor&&(y["text-color"]=["rgba"].concat(r.textColor.toRenderColor(null).toArray())),e.push(y)}return e}}class $s{constructor(e,r){if(this.id=e,this.options=r||{params:{}},this.options.transform){const{a:y,b:U,c:R,d:j,e:X,f:Q}=this.options.transform;this.options.transform=new DOMMatrix([y,U,R,j,X,Q])}else this.options.transform=new DOMMatrix([1,0,0,1,0,0])}static deserializeId(e){return JSON.parse(e).id}static deserializeFromString(e){const r=JSON.parse(e),{a:y,b:U,c:R,d:j,e:X,f:Q}=r.options.transform;return new DOMMatrix([y,U,R,j,X,Q]),new $s(r.id,r.options)}scaleSelf(e){return this.options.transform=this.options.transform.scale(e),this}serialize(){const e={id:this.id};this.options&&(e.options=this.options);const{a:r,b:y,c:U,d:R,e:j,f:X}=this.options.transform;return e.options.transform={a:r,b:y,c:U,d:R,e:j,f:X},JSON.stringify(e)}}class Un{constructor(e){this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),e.optionsPrimary&&(this.optionsPrimary=e.optionsPrimary),e.optionsSecondary&&(this.optionsSecondary=e.optionsSecondary),this.available=e.available}toString(){return this.namePrimary&&this.nameSecondary?`[${this.namePrimary},${this.nameSecondary}]`:this.namePrimary}getPrimary(){return new $s(this.namePrimary,{params:this.optionsPrimary&&this.optionsPrimary.params||{}})}getSerializedPrimary(){return this.getPrimary().serialize()}getSecondary(){return this.nameSecondary?new $s(this.nameSecondary,{params:this.optionsSecondary&&this.optionsSecondary.params||{}}):null}static from(e){return typeof e=="string"?Un.build(e):e}static build(e,r,y,U){return e?new Un({namePrimary:e,nameSecondary:r,optionsPrimary:y,optionsSecondary:U,available:!1}):null}}function oh(h,e,r,y){return typeof h=="number"&&h>=0&&h<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?y===void 0||typeof y=="number"&&y>=0&&y<=1?null:`Invalid rgba value [${[h,e,r,y].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof y=="number"?[h,e,r,y]:[h,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function oa(h){if(h===null||typeof h=="string"||typeof h=="boolean"||typeof h=="number"||h instanceof Sr||h instanceof Kl||h instanceof Hn||h instanceof Un)return!0;
vendor: 14,705 bytes, line 267
267if(Array.isArray(h)){for(const e of h)if(!oa(e))return!1;return!0}if(typeof h=="object"){for(const e in h)if(!oa(h[e]))return!1;return!0}return!1}function Kr(h){if(h===null)return Va;if(typeof h=="string")return Ar;if(typeof h=="boolean")return pr;if(typeof h=="number")return Ei;if(h instanceof Sr)return $n;if(h instanceof Kl)return Wo;if(h instanceof Hn)return qs;if(h instanceof Un)return Zo;if(Array.isArray(h)){const e=h.length;let r;for(const y of h){const U=Kr(y);if(r){if(r===U)continue;r=vr;break}r=U}return zn(r||vr,e)}return aa}function As(h){const e=typeof h;return h===null?"":e==="string"||e==="number"||e==="boolean"?String(h):h instanceof Sr?h.toStringPremultipliedAlpha():h instanceof Hn||h instanceof Un?h.toString():JSON.stringify(h)}class Ln{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!oa(e[1]))return r.error("invalid value");const y=e[1];let U=Kr(y);const R=r.expectedType;return U.kind!=="array"||U.N!==0||!R||R.kind!=="array"||typeof R.N=="number"&&R.N!==0||(U=R),new Ln(U,y)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Sr?["rgba"].concat(this.value.toRenderColor(null).toArray()):this.value instanceof Hn?this.value.serialize():this.value}}class _n{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Jo={string:Ar,number:Ei,boolean:pr,object:aa};class zs{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let y,U=1;const R=e[0];if(R==="array"){let X,Q;if(e.length>2){const se=e[1];if(typeof se!="string"||!(se in Jo)||se==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);X=Jo[se],U++}else X=vr;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);Q=e[2],U++}y=zn(X,Q)}else y=Jo[R];const j=[];for(;U<e.length;U++){const X=r.parse(e[U],U,vr);if(!X)return null;j.push(X)}return new zs(y,j)}evaluate(e){for(let r=0;r<this.args.length;r++){const y=this.args[r].evaluate(e);if(!as(this.type,Kr(y)))return y;if(r===this.args.length-1)throw new _n(`The expression ${JSON.stringify(this.args[r].serialize())} evaluated to ${sn(Kr(y))} but was expected to be of type ${sn(this.type)}.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,r=[e.kind];if(e.kind==="array"){const y=e.itemType;if(y.kind==="string"||y.kind==="number"||y.kind==="boolean"){r.push(y.kind);const U=e.N;(typeof U=="number"||this.args.length>1)&&r.push(U)}}return r.concat(this.args.map(y=>y.serialize()))}}class Ua{constructor(e){this.type=qs,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const y=e[1];if(!Array.isArray(y)&&typeof y=="object")return r.error("First argument must be an image or text section.");const U=[];let R=!1;for(let j=1;j<=e.length-1;++j){const X=e[j];if(R&&typeof X=="object"&&!Array.isArray(X)){R=!1;let Q=null;if(X["font-scale"]&&(Q=r.parseObjectValue(X["font-scale"],j,"font-scale",Ei),!Q))return null;let se=null;if(X["text-font"]&&(se=r.parseObjectValue(X["text-font"],j,"text-font",zn(Ar)),!se))return null;let W=null;if(X["text-color"]&&(W=r.parseObjectValue(X["text-color"],j,"text-color",$n),!W))return null;const ee=U[U.length-1];ee.scale=Q,ee.font=se,ee.textColor=W}else{const Q=r.parse(e[j],j,vr);if(!Q)return null;const se=Q.type.kind;if(se!=="string"&&se!=="value"&&se!=="null"&&se!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");R=!0,U.push({content:Q,scale:null,font:null,textColor:null})}}return new Ua(U)}evaluate(e){return new Hn(this.sections.map(r=>{const y=r.content.evaluate(e);return Kr(y)===Zo?new Yo("",y,null,null,null):new Yo(As(y),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const r of this.sections){e.push(r.content.serialize());const y={};r.scale&&(y["font-scale"]=r.scale.serialize()),r.font&&(y["text-font"]=r.font.serialize()),r.textColor&&(y["text-color"]=r.textColor.serialize()),e.push(y)}return e}}class Ko{constructor(e,r,y,U){this._imageWarnHistory={},this.type=Zo,this.inputPrimary=e,this.inputSecondary=r,this.inputPrimaryParams=y,this.inputSecondaryParams=U}static parse(e,r){if(e.length<2)return r.error("Expected two or more arguments.");let y=1;const U=[];function R(){if(y<e.length){const X=r.parse(e[y],y++,Ar);return X?(U.push({image:X,options:void 0}),!0):(r.error(U.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return!0}function j(){if(y<e.length){if((X=e[y])===null||typeof X!="object"||Array.isArray(X))return!0;const Q=e[y].params,se=r.concat(y);if(!Q)return y++,!0;if(typeof Q!="object"||Q.constructor!==Object)return se.error('Image options "params" should be an object'),!1;const W={},ee=se.concat(void 0,"params");for(const ne in Q){if(!ne)return ee.error("Image parameter name should be non-empty"),!1;const K=ee.concat(void 0,ne).parse(Q[ne],void 0,$n,void 0,{typeAnnotation:"coerce"});if(!K)return!1;W[ne]=K}return U[U.length-1].options=W,y++,!0}var X;return!0}for(let X=0;X<2;X++)if(!R()||!j())return;return new Ko(U[0].image,U[1]?U[1].image:void 0,U[0].options,U[1]?U[1].options:void 0)}evaluateParams(e,r){const y={};if(r){for(const U in r)if(r[U])try{const R=r[U].evaluate(e),j=`Ignoring image parameter "${U}" with semi-transparent color ${R.toString()}`;if(R.a!==1){this._imageWarnHistory[j]||(console.warn(j),this._imageWarnHistory[j]=!0);continue}y[U]=R}catch{continue}if(Object.keys(y).length!==0)return{params:y}}}evaluate(e){const r=Un.build(this.inputPrimary.evaluate(e),this.inputSecondary?this.inputSecondary.evaluate(e):void 0,this.inputPrimaryParams?this.evaluateParams(e,this.inputPrimaryParams):void 0,this.inputSecondaryParams?this.evaluateParams(e,this.inputSecondaryParams):void 0);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(r.namePrimary)>-1,r.nameSecondary&&r.available&&e.availableImages&&(r.available=e.availableImages.indexOf(r.nameSecondary)>-1)),r}eachChild(e){if(e(this.inputPrimary),this.inputPrimaryParams)for(const r in this.inputPrimaryParams)this.inputPrimaryParams[r]&&e(this.inputPrimaryParams[r]);if(this.inputSecondary&&(e(this.inputSecondary),this.inputSecondaryParams))for(const r in this.inputSecondaryParams)this.inputSecondaryParams[r]&&e(this.inputSecondaryParams[r])}outputDefined(){return!1}serializeParams(e){const r={};if(e){for(const y in e)e[y]&&(r[y]=e[y].serialize());return{params:r}}}serialize(){const e=["image",this.inputPrimary.serialize()];return this.inputPrimaryParams&&e.push(this.serializeParams(this.inputPrimaryParams)),this.inputSecondary&&(e.push(this.inputSecondary.serialize()),this.inputSecondaryParams&&e.push(this.serializeParams(this.inputSecondaryParams))),e}}function Ls(h){return h instanceof Number?"number":h instanceof String?"string":h instanceof Boolean?"boolean":Array.isArray(h)?"array":h===null?"null":typeof h}const lh={"to-boolean":pr,"to-color":$n,"to-number":Ei,"to-string":Ar};class la{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const y=e[0],U=[];let R=Va;if(y==="to-array"){if(!Array.isArray(e[1]))return null;const j=e[1].length;if(r.expectedType){if(r.expectedType.kind!=="array")return r.error(`Expected ${r.expectedType.kind} but found array.`);R=zn(r.expectedType.itemType,j)}else{if(!(j>0&&oa(e[1][0])))return null;R=zn(Kr(e[1][0]),j)}for(let X=0;X<j;X++){const Q=e[1][X];let se;if(Ls(Q)==="array")se=r.parse(Q,void 0,R.itemType);else{const W=Ls(Q);if(W!==R.itemType.kind)return r.error(`Expected ${R.itemType.kind} but found ${W}.`);se=r.registry.literal.parse(["literal",Q===void 0?null:Q],r)}if(!se)return null;U.push(se)}}else{if((y==="to-boolean"||y==="to-string")&&e.length!==2)return r.error("Expected one argument.");R=lh[y];for(let j=1;j<e.length;j++){const X=r.parse(e[j],j,vr);if(!X)return null;U.push(X)}}return new la(R,U)}evaluate(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){let r,y;for(const U of this.args){if(r=U.evaluate(e),y=null,r instanceof Sr)return r;if(typeof r=="string"){const R=e.parseColor(r);if(R)return R}else if(Array.isArray(r)&&(y=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:oh(r[0],r[1],r[2],r[3]),!y))return new Sr(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new _n(y||`Could not parse color from value '${typeof r=="string"?r:String(JSON.stringify(r))}'`)}if(this.type.kind==="number"){let r=null;for(const y of this.args){if(r=y.evaluate(e),r===null)return 0;const U=Number(r);if(!isNaN(U))return U}throw new _n(`Could not convert ${JSON.stringify(r)} to number.`)}return this.type.kind==="formatted"?Hn.fromString(As(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Un.build(As(this.args[0].evaluate(e))):this.type.kind==="array"?this.args.map(r=>r.evaluate(e)):As(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Ua([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Ko(this.args[0]).serialize();const e=this.type.kind==="array"?[]:[`to-${this.type.kind}`];return this.eachChild(r=>{e.push(r.serialize())}),e}}const kp=["Unknown","Point","LineString","Polygon"];class ch{constructor(e,r){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=r}id(){return this.feature&&this.feature.id!==void 0?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?kp[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,r=this.featureDistanceData.scale,{x:y,y:U}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(y*r-e[0])+this.featureDistanceData.bearing[1]*(U*r-e[1])}return 0}parseColor(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=Sr.parse(e)),r}getConfig(e){return this.options?this.options.get(e):null}}class os{constructor(e,r,y,U,R){this.name=e,this.type=r,this._evaluate=y,this.args=U,this._overloadIndex=R}evaluate(e){if(!this._evaluate){const r=os.definitions[this.name];this._evaluate=Array.isArray(r)?r[2]:r.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,r){const y=e[0],U=os.definitions[y];if(!U)return r.error(`Unknown expression "${y}". If you wanted a literal array, use ["literal", [...]].`,0);const R=Array.isArray(U)?U[0]:U.type,j=Array.isArray(U)?[[U[1],U[2]]]:U.overloads,X=[];let Q=null,se=-1;for(const[W,ee]of j){if(Array.isArray(W)&&W.length!==e.length-1)continue;X.push(W),se++,Q=new ll(r.registry,r.path,null,r.scope,void 0,r._scope,r.options);const ne=[];let K=!1;for(let te=1;te<e.length;te++){const ae=e[te],ue=Array.isArray(W)?W[te-1]:W.type,de=Q.parse(ae,1+ne.length,ue);if(!de){K=!0;break}ne.push(de)}if(!K)if(Array.isArray(W)&&W.length!==ne.length)Q.error(`Expected ${W.length} arguments, but found ${ne.length} instead.`);else{for(let te=0;te<ne.length;te++){const ae=Array.isArray(W)?W[te]:W.type,ue=ne[te];Q.concat(te+1).checkSubtype(ae,ue.type)}if(Q.errors.length===0)return new os(y,R,ee,ne,se)}}if(X.length===1)r.errors.push(...Q.errors);else{const W=(X.length?X:j.map(([ne])=>ne)).map(hh).join(" | "),ee=[];for(let ne=1;ne<e.length;ne++){const K=r.parse(e[ne],1+ee.length);if(!K)return null;ee.push(sn(K.type))}r.error(`Expected arguments of type ${W}, but found (${ee.join(", ")}) instead.`)}return null}static register(e,r){os.definitions=r;for(const y in r)e[y]=os}}function hh(h){return Array.isArray(h)?`(${h.map(sn).join(", ")})`:`(${sn(h.type)}...)`}class Ql{constructor(e,r,y){this.type=Wo,this.locale=y,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const y=e[1];if(typeof y!="object"||Array.isArray(y))return r.error("Collator options argument must be an object.");const U=y["case-sensitive"]===void 0?r.parse(!1,1,pr):r.parseObjectValue(y["case-sensitive"],1,"case-sensitive",pr);if(!U)return null;const R=y["diacritic-sensitive"]===void 0?r.parse(!1,1,pr):r.parseObjectValue(y["diacritic-sensitive"],1,"diacritic-sensitive",pr);if(!R)return null;let j=null;return y.locale&&(j=r.parseObjectValue(y.locale,1,"locale",Ar),!j)?null:new Ql(U,R,j)}evaluate(e){return new Kl(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 Qo(h,e,r=0,y=h.length-1,U=Rp){for(;y>r;){if(y-r>600){const Q=y-r+1,se=e-r+1,W=Math.log(Q),ee=.5*Math.exp(2*W/3),ne=.5*Math.sqrt(W*ee*(Q-ee)/Q)*(se-Q/2<0?-1:1);Qo(h,e,Math.max(r,Math.floor(e-se*ee/Q+ne)),Math.min(y,Math.floor(e+(Q-se)*ee/Q+ne)),U)}const R=h[e];let j=r,X=y;for(el(h,r,e),U(h[y],R)>0&&el(h,r,y);j<X;){for(el(h,j,X),j++,X--;U(h[j],R)<0;)j++;for(;U(h[X],R)>0;)X--}U(h[r],R)===0?el(h,r,X):(X++,el(h,X,y)),X<=e&&(r=X+1),e<=X&&(y=X-1)}}function el(h,e,r){const y=h[e];h[e]=h[r],h[r]=y}function Rp(h,e){return h<e?-1:h>e?1:0}function zp(h){let e=0;for(let r,y,U=0,R=h.length,j=R-1;U<R;
267j=U++)r=h[U],y=h[j],e+=(y.x-r.x)*(r.y+y.y);return e}function tl(h,e){h[0]=Math.min(h[0],e[0]),h[1]=Math.min(h[1],e[1]),h[2]=Math.max(h[2],e[0]),h[3]=Math.max(h[3],e[1])}function il(h,e){return!(h[0]<=e[0]||h[2]>=e[2]||h[1]<=e[1]||h[3]>=e[3])}function Lp(h,e,r){const y=h[0]-e[0],U=h[1]-e[1],R=h[0]-r[0],j=h[1]-r[1];return y*j-R*U==0&&y*R<=0&&U*j<=0}function ho(h,e,r=!1){let y=!1;for(let X=0,Q=e.length;X<Q;X++){const se=e[X];for(let W=0,ee=se.length,ne=ee-1;W<ee;ne=W++){const K=se[ne],te=se[W];if(Lp(h,K,te))return r;(R=K)[1]>(U=h)[1]!=(j=te)[1]>U[1]&&U[0]<(j[0]-R[0])*(U[1]-R[1])/(j[1]-R[1])+R[0]&&(y=!y)}}var U,R,j;return y}function uh(h,e,r,y){const U=y[0]-r[0],R=y[1]-r[1],j=(h[0]-r[0])*R-U*(h[1]-r[1]),X=(e[0]-r[0])*R-U*(e[1]-r[1]);return j>0&&X<0||j<0&&X>0}function ca(h,e,r,y){return(U=[y[0]-r[0],y[1]-r[1]])[0]*(R=[e[0]-h[0],e[1]-h[1]])[1]-U[1]*R[0]!=0&&!(!uh(h,e,r,y)||!uh(r,y,h,e));var U,R}const Sa=8192;function Fp(h,e){const r=(180+h[0])/360,y=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+h[1]*Math.PI/360)))/360,U=Math.pow(2,e.z);return[Math.round(r*U*Sa),Math.round(y*U*Sa)]}function dh(h,e){for(let r=0;r<e.length;r++)if(ho(h,e[r]))return!0;return!1}function Op(h,e,r){for(const y of r)for(let U=0,R=y.length,j=R-1;U<R;j=U++)if(ca(h,e,y[j],y[U]))return!0;return!1}function td(h,e){for(let r=0;r<h.length;++r)if(!ho(h[r],e))return!1;for(let r=0;r<h.length-1;++r)if(Op(h[r],h[r+1],e))return!1;return!0}function Bp(h,e){for(let r=0;r<e.length;r++)if(td(h,e[r]))return!0;return!1}function ph(h,e,r){const y=[];for(let U=0;U<h.length;U++){const R=[];for(let j=0;j<h[U].length;j++){const X=Fp(h[U][j],r);tl(e,X),R.push(X)}y.push(R)}return y}function ja(h,e,r){const y=[];for(let U=0;U<h.length;U++){const R=ph(h[U],e,r);y.push(R)}return y}function ir(h,e,r,y){if(h[0]<r[0]||h[0]>r[2]){const U=.5*y;let R=h[0]-r[0]>U?-y:r[0]-h[0]>U?y:0;R===0&&(R=h[0]-r[2]>U?-y:r[2]-h[0]>U?y:0),h[0]+=R}tl(e,h)}function ki(h,e,r,y){const U=Math.pow(2,y.z)*Sa,R=[y.x*Sa,y.y*Sa],j=[];if(!h)return j;for(const X of h)for(const Q of X){const se=[Q.x+R[0],Q.y+R[1]];ir(se,e,r,U),j.push(se)}return j}function ec(h,e,r,y){const U=Math.pow(2,y.z)*Sa,R=[y.x*Sa,y.y*Sa],j=[];if(!h)return j;for(const Q of h){const se=[];for(const W of Q){const ee=[W.x+R[0],W.y+R[1]];tl(e,ee),se.push(ee)}j.push(se)}if(e[2]-e[0]<=U/2){(X=e)[0]=X[1]=1/0,X[2]=X[3]=-1/0;for(const Q of j)for(const se of Q)ir(se,e,r,U)}var X;return j}class Ui{constructor(e,r){this.type=pr,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(oa(e[1])){const y=e[1];if(y.type==="FeatureCollection")for(let U=0;U<y.features.length;++U){const R=y.features[U].geometry.type;if(R==="Polygon"||R==="MultiPolygon")return new Ui(y,y.features[U].geometry)}else if(y.type==="Feature"){const U=y.geometry.type;if(U==="Polygon"||U==="MultiPolygon")return new Ui(y,y.geometry)}else if(y.type==="Polygon"||y.type==="MultiPolygon")return new Ui(y,y)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,y){const U=[1/0,1/0,-1/0,-1/0],R=[1/0,1/0,-1/0,-1/0],j=r.canonicalID();if(!j)return!1;if(y.type==="Polygon"){const X=ph(y.coordinates,R,j),Q=ki(r.geometry(),U,R,j);if(!il(U,R))return!1;for(const se of Q)if(!ho(se,X))return!1}if(y.type==="MultiPolygon"){const X=ja(y.coordinates,R,j),Q=ki(r.geometry(),U,R,j);if(!il(U,R))return!1;for(const se of Q)if(!dh(se,X))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(r,y){const U=[1/0,1/0,-1/0,-1/0],R=[1/0,1/0,-1/0,-1/0],j=r.canonicalID();if(!j)return!1;if(y.type==="Polygon"){const X=ph(y.coordinates,R,j),Q=ec(r.geometry(),U,R,j);if(!il(U,R))return!1;for(const se of Q)if(!td(se,X))return!1}if(y.type==="MultiPolygon"){const X=ja(y.coordinates,R,j),Q=ec(r.geometry(),U,R,j);if(!il(U,R))return!1;for(const se of Q)if(!Bp(se,X))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}const uo={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},tc=1/298.257223563,qi=tc*(2-tc),po=Math.PI/180;class Ga{static fromTile(e,r,y){const U=Math.PI*(1-2*(e+.5)/Math.pow(2,r)),R=Math.atan(.5*(Math.exp(U)-Math.exp(-U)))/po;return new Ga(R,y)}static get units(){return uo}constructor(e,r){if(e===void 0)throw new Error("No latitude given.");if(r&&!uo[r])throw new Error(`Unknown unit ${r}. Use one of: ${Object.keys(uo).join(", ")}`);const y=6378.137*po*(r?uo[r]:1),U=Math.cos(e*po),R=1/(1-qi*(1-U*U)),j=Math.sqrt(R);this.kx=y*j*U,this.ky=y*j*R*(1-qi)}distance(e,r){const y=ls(e[0]-r[0])*this.kx,U=(e[1]-r[1])*this.ky;return Math.sqrt(y*y+U*U)}bearing(e,r){const y=ls(r[0]-e[0])*this.kx;return Math.atan2(y,(r[1]-e[1])*this.ky)/po}destination(e,r,y){const U=y*po;return this.offset(e,Math.sin(U)*r,Math.cos(U)*r)}offset(e,r,y){return[e[0]+r/this.kx,e[1]+y/this.ky]}lineDistance(e){let r=0;for(let y=0;y<e.length-1;
267y++)r+=this.distance(e[y],e[y+1]);return r}area(e){let r=0;for(let y=0;y<e.length;y++){const U=e[y];for(let R=0,j=U.length,X=j-1;R<j;X=R++)r+=ls(U[R][0]-U[X][0])*(U[R][1]+U[X][1])*(y?-1:1)}return Math.abs(r)/2*this.kx*this.ky}along(e,r){let y=0;if(r<=0)return e[0];for(let U=0;U<e.length-1;U++){const R=e[U],j=e[U+1],X=this.distance(R,j);if(y+=X,y>r)return ic(R,j,(r-(y-X))/X)}return e[e.length-1]}pointToSegmentDistance(e,r,y){let[U,R]=r,j=ls(y[0]-U)*this.kx,X=(y[1]-R)*this.ky;if(j!==0||X!==0){const Q=(ls(e[0]-U)*this.kx*j+(e[1]-R)*this.ky*X)/(j*j+X*X);Q>1?(U=y[0],R=y[1]):Q>0&&(U+=j/this.kx*Q,R+=X/this.ky*Q)}return j=ls(e[0]-U)*this.kx,X=(e[1]-R)*this.ky,Math.sqrt(j*j+X*X)}pointOnLine(e,r){let y=1/0,U=e[0][0],R=e[0][1],j=0,X=0;for(let Q=0;Q<e.length-1;Q++){let se=e[Q][0],W=e[Q][1],ee=ls(e[Q+1][0]-se)*this.kx,ne=(e[Q+1][1]-W)*this.ky,K=0;ee===0&&ne===0||(K=(ls(r[0]-se)*this.kx*ee+(r[1]-W)*this.ky*ne)/(ee*ee+ne*ne),K>1?(se=e[Q+1][0],W=e[Q+1][1]):K>0&&(se+=ee/this.kx*K,W+=ne/this.ky*K)),ee=ls(r[0]-se)*this.kx,ne=(r[1]-W)*this.ky;const te=ee*ee+ne*ne;te<y&&(y=te,U=se,R=W,j=Q,X=K)}return{point:[U,R],index:j,t:Math.max(0,Math.min(1,X))}}lineSlice(e,r,y){let U=this.pointOnLine(y,e),R=this.pointOnLine(y,r);if(U.index>R.index||U.index===R.index&&U.t>R.t){const se=U;U=R,R=se}const j=[U.point],X=U.index+1,Q=R.index;!fh(y[X],j[0])&&X<=Q&&j.push(y[X]);for(let se=X+1;se<=Q;se++)j.push(y[se]);return fh(y[Q],R.point)||j.push(R.point),j}lineSliceAlong(e,r,y){let U=0;const R=[];for(let j=0;j<y.length-1;j++){const X=y[j],Q=y[j+1],se=this.distance(X,Q);if(U+=se,U>e&&R.length===0&&R.push(ic(X,Q,(e-(U-se))/se)),U>=r)return R.push(ic(X,Q,(r-(U-se))/se)),R;U>e&&R.push(Q)}return R}bufferPoint(e,r){const y=r/this.ky,U=r/this.kx;return[e[0]-U,e[1]-y,e[0]+U,e[1]+y]}bufferBBox(e,r){const y=r/this.ky,U=r/this.kx;return[e[0]-U,e[1]-y,e[2]+U,e[3]+y]}insideBBox(e,r){return ls(e[0]-r[0])>=0&&ls(e[0]-r[2])<=0&&e[1]>=r[1]&&e[1]<=r[3]}}function fh(h,e){return h[0]===e[0]&&h[1]===e[1]}function ic(h,e,r){const y=ls(e[0]-h[0]);return[h[0]+y*r,h[1]+(e[1]-h[1])*r]}function ls(h){for(;h<-180;)h+=360;for(;h>180;)h-=360;return h}class jn{constructor(e=[],r=(y,U)=>y<U?-1:y>U?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let y=(this.length>>1)-1;y>=0;y--)this._down(y)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:y}=this,U=r[e];for(;e>0;){const R=e-1>>1,j=r[R];if(y(U,j)>=0)break;r[e]=j,e=R}r[e]=U}_down(e){const{data:r,compare:y}=this,U=this.length>>1,R=r[e];for(;e<U;){let j=1+(e<<1);const X=j+1;if(X<this.length&&y(r[X],r[j])<0&&(j=X),y(r[j],R)>=0)break;r[e]=r[j],e=j}r[e]=R}}var gi=8192;function mh(h,e){return e.dist-h.dist}const rc=100,rl=50;function Ta(h){const e=[1/0,1/0,-1/0,-1/0];if(e.length!==h.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==h[r])return!1;return!0}function Fn(h){return h[1]-h[0]+1}function ha(h,e){const r=h[1]>=h[0]&&h[1]<e;return r||console.warn("Distance Expression: Index is out of range"),r}function gh(h,e){if(h[0]>h[1])return[null,null];const r=Fn(h);if(e){if(r===2)return[h,null];const y=Math.floor(r/2);return[[h[0],h[0]+y],[h[0]+y,h[1]]]}{if(r===1)return[h,null];const y=Math.floor(r/2)-1;return[[h[0],h[0]+y],[h[0]+y+1,h[1]]]}}function qa(h,e){const r=[1/0,1/0,-1/0,-1/0];if(!ha(e,h.length))return r;for(let y=e[0];y<=e[1];++y)tl(r,h[y]);return r}function $a(h){const e=[1/0,1/0,-1/0,-1/0];for(let r=0;r<h.length;++r)for(let y=0;y<h[r].length;++y)tl(e,h[r][y]);return e}function Ha(h,e,r){if(Ta(h)||Ta(e))return NaN;let y=0,U=0;return h[2]<e[0]&&(y=e[0]-h[2]),h[0]>e[2]&&(y=h[0]-e[2]),h[1]>e[3]&&(U=h[1]-e[3]),h[3]<e[1]&&(U=e[1]-h[3]),r.distance([0,0],[y,U])}function _h(h){return 360*h-180}function Np(h){return 360/Math.PI*Math.atan(Math.exp((180-360*h)*Math.PI/180))-90}function yh(h,e){const r=Math.pow(2,e.z),y=(h.y/gi+e.y)/r;return[_h((h.x/gi+e.x)/r),Np(y)]}function Vp(h,e){const r=[];for(let y=0;y<h.length;++y)r.push(yh(h[y],e));return r}function id(h,e,r){const y=r.pointOnLine(e,h).point;return r.distance(h,y)}function vh(h,e,r,y,U){const R=r.slice(y[0],y[1]+1);let j=1/0;for(let X=e[0];X<=e[1];++X)if((j=Math.min(j,id(h[X],R,U)))===0)return 0;return j}function xh(h,e,r,y,U){const R=Math.min(U.pointToSegmentDistance(h,r,y),U.pointToSegmentDistance(e,r,y)),j=Math.min(U.pointToSegmentDistance(r,h,e),U.pointToSegmentDistance(y,h,e));return Math.min(R,j)}function Up(h,e,r,y,U){if(!ha(e,h.length)||!ha(y,r.length))return NaN;let R=1/0;for(let j=e[0];j<e[1];++j)for(let X=y[0];X<y[1];++X){if(ca(h[j],h[j+1],r[X],r[X+1]))return 0;R=Math.min(R,xh(h[j],h[j+1],r[X],r[X+1],U))}return R}function rd(h,e,r,y,U){if(!ha(e,h.length)||!ha(y,r.length))return NaN;let R=1/0;for(let j=e[0];j<=e[1];++j)for(let X=y[0];X<=y[1];++X)if((R=Math.min(R,U.distance(h[j],r[X])))===0)return R;return R}function Wa(h,e,r){if(ho(h,e,!0))return 0;let y=1/0;for(const U of e){const R=U.length;if(R<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(U[0]!==U[R-1]&&(y=Math.min(y,r.pointToSegmentDistance(h,U[R-1],U[0])))===0||(y=Math.min(y,id(h,U,r)))===0)return y}return y}function jp(h,e,r,y){if(!ha(e,h.length))return NaN;for(let R=e[0];R<=e[1];++R)if(ho(h[R],r,!0))return 0;let U=1/0;for(let R=e[0];R<e[1];++R)for(const j of r)for(let X=0,Q=j.length,se=Q-1;X<Q;se=X++){if(ca(h[R],h[R+1],j[se],j[X]))return 0;U=Math.min(U,xh(h[R],h[R+1],j[se],j[X],y))}return U}
267function nd(h,e){for(const r of h)for(let y=0;y<=r.length-1;++y)if(ho(r[y],e,!0))return!0;return!1}function bh(h,e,r,y=1/0){const U=$a(h),R=$a(e);if(y!==1/0&&Ha(U,R,r)>=y)return y;if(il(U,R)){if(nd(h,e))return 0}else if(nd(e,h))return 0;let j=y;for(const X of h)for(let Q=0,se=X.length,W=se-1;Q<se;W=Q++)for(const ee of e)for(let ne=0,K=ee.length,te=K-1;ne<K;te=ne++){if(ca(X[W],X[Q],ee[te],ee[ne]))return 0;j=Math.min(j,xh(X[W],X[Q],ee[te],ee[ne],r))}return j}function nl(h,e,r,y,U,R,j){if(R===null||j===null)return;const X=Ha(qa(y,R),qa(U,j),r);X<e&&h.push({dist:X,range1:R,range2:j})}function sd(h,e,r,y,U=1/0){let R=Math.min(y.distance(h[0],r[0][0]),U);if(R===0)return R;const j=new jn([{dist:0,range1:[0,h.length-1],range2:[0,0]}],mh),X=e?rl:rc,Q=$a(r);for(;j.length;){const se=j.pop();if(se.dist>=R)continue;const W=se.range1;if(Fn(W)<=X){if(!ha(W,h.length))return NaN;if(e){const ee=jp(h,W,r,y);if((R=Math.min(R,ee))===0)return R}else for(let ee=W[0];ee<=W[1];++ee){const ne=Wa(h[ee],r,y);if((R=Math.min(R,ne))===0)return R}}else{const ee=gh(W,e);if(ee[0]!==null){const ne=Ha(qa(h,ee[0]),Q,y);ne<R&&j.push({dist:ne,range1:ee[0],range2:[0,0]})}if(ee[1]!==null){const ne=Ha(qa(h,ee[1]),Q,y);ne<R&&j.push({dist:ne,range1:ee[1],range2:[0,0]})}}}return R}function Ms(h,e,r,y,U,R=1/0){let j=Math.min(R,U.distance(h[0],r[0]));if(j===0)return j;const X=new jn([{dist:0,range1:[0,h.length-1],range2:[0,r.length-1]}],mh),Q=e?rl:rc,se=y?rl:rc;for(;X.length;){const W=X.pop();if(W.dist>=j)continue;const ee=W.range1,ne=W.range2;if(Fn(ee)<=Q&&Fn(ne)<=se){if(!ha(ee,h.length)||!ha(ne,r.length))return NaN;if(e&&y?j=Math.min(j,Up(h,ee,r,ne,U)):e||y?e&&!y?j=Math.min(j,vh(r,ne,h,ee,U)):!e&&y&&(j=Math.min(j,vh(h,ee,r,ne,U))):j=Math.min(j,rd(h,ee,r,ne,U)),j===0)return j}else{const K=gh(ee,e),te=gh(ne,y);nl(X,j,U,h,r,K[0],te[0]),nl(X,j,U,h,r,K[0],te[1]),nl(X,j,U,h,r,K[1],te[0]),nl(X,j,U,h,r,K[1],te[1])}}return j}function nc(h,e,r,y,U=1/0){let R=U;const j=qa(h,[0,h.length-1]);for(const X of r)if(!(R!==1/0&&Ha(j,qa(X,[0,X.length-1]),y)>=R)&&(R=Math.min(R,Ms(h,e,X,!0,y,R)),R===0))return R;return R}function sl(h,e,r,y,U=1/0){let R=U;const j=qa(h,[0,h.length-1]);for(const X of r){if(R!==1/0&&Ha(j,$a(X),y)>=R)continue;const Q=sd(h,e,X,y,R);if(isNaN(Q))return Q;if((R=Math.min(R,Q))===0)return R}return R}function sc(h){return h==="Point"||h==="MultiPoint"||h==="LineString"||h==="MultiLineString"||h==="Polygon"||h==="MultiPolygon"}class Ea{constructor(e,r){this.type=Ei,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(oa(e[1])){const y=e[1];if(y.type==="FeatureCollection"){for(let U=0;U<y.features.length;++U)if(sc(y.features[U].geometry.type))return new Ea(y,y.features[U].geometry)}else if(y.type==="Feature"){if(sc(y.geometry.type))return new Ea(y,y.geometry)}else if(sc(y.type))return new Ea(y,y)}return r.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(e){const r=e.geometry(),y=e.canonicalID();if(r!=null&&y!=null){if(e.geometryType()==="Point")return function(U,R,j){const X=[];for(const se of U)for(const W of se)X.push(yh(W,R));const Q=new Ga(X[0][1],"meters");return j.type==="Point"||j.type==="MultiPoint"||j.type==="LineString"?Ms(X,!1,j.type==="Point"?[j.coordinates]:j.coordinates,j.type==="LineString",Q):j.type==="MultiLineString"?nc(X,!1,j.coordinates,Q):j.type==="Polygon"||j.type==="MultiPolygon"?sl(X,!1,j.type==="Polygon"?[j.coordinates]:j.coordinates,Q):null}(r,y,this.geometries);if(e.geometryType()==="LineString")return function(U,R,j){const X=[];for(const se of U){const W=[];for(const ee of se)W.push(yh(ee,R));X.push(W)}const Q=new Ga(X[0][0][1],"meters");if(j.type==="Point"||j.type==="MultiPoint"||j.type==="LineString")return nc(j.type==="Point"?[j.coordinates]:j.coordinates,j.type==="LineString",X,Q);if(j.type==="MultiLineString"){let se=1/0;for(let W=0;W<j.coordinates.length;W++){const ee=nc(j.coordinates[W],!0,X,Q,se);if(isNaN(ee))return ee;if((se=Math.min(se,ee))===0)return se}return se}if(j.type==="Polygon"||j.type==="MultiPolygon"){let se=1/0;for(let W=0;W<X.length;W++){const ee=sl(X[W],!0,j.type==="Polygon"?[j.coordinates]:j.coordinates,Q,se);if(isNaN(ee))return ee;if((se=Math.min(se,ee))===0)return se}return se}return null}(r,y,this.geometries);if(e.geometryType()==="Polygon")return function(U,R,j){const X=[];for(const se of function(W,ee){const ne=W.length;if(ne<=1)return[W];const K=[];let te,ae;for(let ue=0;ue<ne;ue++){const de=zp(W[ue]);de!==0&&(W[ue].area=Math.abs(de),ae===void 0&&(ae=de<0),ae===de<0?(te&&K.push(te),te=[W[ue]]):te.push(W[ue]))}return te&&K.push(te),K}(U)){const W=[];for(let ee=0;ee<se.length;++ee)W.push(Vp(se[ee],R));X.push(W)}const Q=new Ga(X[0][0][0][1],"meters");if(j.type==="Point"||j.type==="MultiPoint"||j.type==="LineString")return sl(j.type==="Point"?[j.coordinates]:j.coordinates,j.type==="LineString",X,Q);if(j.type==="MultiLineString"){let se=1/0;for(let W=0;W<j.coordinates.length;W++){const ee=sl(j.coordinates[W],!0,X,Q,se);if(isNaN(ee))return ee;if((se=Math.min(se,ee))===0)return se}return se}return j.type==="Polygon"||j.type==="MultiPolygon"?function(se,W,ee){let ne=1/0;for(const K of se)for(const te of W){const ae=bh(K,te,ee,ne);
vendor: 6,702 bytes, line 267
267if(isNaN(ae))return ae;if((ne=Math.min(ne,ae))===0)return ne}return ne}(j.type==="Polygon"?[j.coordinates]:j.coordinates,X,Q):null}(r,y,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function ac(h,e){switch(h){case"string":return As(e);case"number":return+e;case"boolean":return!!e;case"color":return Sr.parse(e);case"formatted":return Hn.fromString(As(e));case"resolvedImage":return Un.build(As(e))}return e}function wh(h,e,r,y){return y!==void 0&&(h=y*Math.round(h/y)),e!==void 0&&h<e&&(h=e),r!==void 0&&h>r&&(h=r),h}class Za{constructor(e,r,y){this.type=e,this.key=r,this.scope=y}static parse(e,r){let y=r.expectedType;if(y==null&&(y=vr),e.length<2||e.length>3)return r.error("Invalid number of arguments for 'config' expression.");const U=r.parse(e[1],1);if(!(U instanceof Ln))return r.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){const R=r.parse(e[2],2);return R instanceof Ln?new Za(y,As(U.value),As(R.value)):r.error("Scope of 'config' expression must be a string literal.")}return new Za(y,As(U.value))}evaluate(e){const r=[this.key,this.scope,e.scope].filter(Boolean).join("�"),y=e.getConfig(r);if(!y)return null;const{type:U,value:R,values:j,minValue:X,maxValue:Q,stepValue:se}=y,W=y.default.evaluate(e);let ee=W;if(R){const ne=e.scope;e.scope=(ne||"").split("�").slice(1).join("�"),ee=R.evaluate(e),e.scope=ne}return U&&(ee=ac(U,ee)),ee===void 0||X===void 0&&Q===void 0&&se===void 0||(typeof ee=="number"?ee=wh(ee,X,Q,se):Array.isArray(ee)&&(ee=ee.map(ne=>typeof ne=="number"?wh(ne,X,Q,se):ne))),R!==void 0&&ee!==void 0&&j&&!j.includes(ee)&&(ee=W,U&&(ee=ac(U,ee))),(U&&U!==this.type||ee!==void 0&&Kr(ee)!==this.type)&&(ee=ac(this.type.kind,ee)),ee}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.key),e}}function fo(h){if(h instanceof os&&(h.name==="get"&&h.args.length===1||h.name==="feature-state"||h.name==="has"&&h.args.length===1||h.name==="properties"||h.name==="geometry-type"||h.name==="id"||/^filter-/.test(h.name))||h instanceof Ui||h instanceof Ea)return!1;let e=!0;return h.eachChild(r=>{e&&!fo(r)&&(e=!1)}),e}function al(h){if(h instanceof os&&h.name==="feature-state")return!1;let e=!0;return h.eachChild(r=>{e&&!al(r)&&(e=!1)}),e}function ol(h){if(h instanceof Za)return new Set([h.key]);let e=new Set;return h.eachChild(r=>{e=new Set([...e,...ol(r)])}),e}function Xa(h,e){if(h instanceof os&&e.indexOf(h.name)>=0)return!1;let r=!0;return h.eachChild(y=>{r&&!Xa(y,e)&&(r=!1)}),r}class Ya{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const y=e[1];return r.scope.has(y)?new Ya(y,r.scope.get(y)):r.error(`Unknown variable "${y}". Make sure "${y}" 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 mo{constructor(e,r=[],y,U=new Yl,R=[],j,X){this.registry=e,this.path=r,this.key=r.map(Q=>typeof Q=="string"?`['${Q}']`:`[${Q}]`).join(""),this.scope=U,this.errors=R,this.expectedType=y,this._scope=j,this.options=X}parse(e,r,y,U,R={}){return r||y?this.concat(r,null,y,U)._parse(e,R):this._parse(e,R)}parseObjectValue(e,r,y,U,R,j={}){return this.concat(r,y,U,R)._parse(e,j)}_parse(e,r){function y(U,R,j){return j==="assert"?new zs(R,[U]):j==="coerce"?new la(R,[U]):U}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const U=typeof e[0]=="string"?this.registry[e[0]]:void 0;if(U){let R=U.parse(e,this);if(!R)return null;if(this.expectedType){const j=this.expectedType,X=R.type;if(j.kind!=="string"&&j.kind!=="number"&&j.kind!=="boolean"&&j.kind!=="object"&&j.kind!=="array"||X.kind!=="value")if(j.kind!=="color"&&j.kind!=="formatted"&&j.kind!=="resolvedImage"||X.kind!=="value"&&X.kind!=="string"){if(this.checkSubtype(j,X))return null}else R=y(R,j,r.typeAnnotation||"coerce");else R=y(R,j,r.typeAnnotation||"assert")}if(!(R instanceof Ln)&&R.type.kind!=="resolvedImage"&&oc(R)){const j=new ch(this._scope,this.options);try{R=new Ln(R.type,R.evaluate(j))}catch(X){return this.error(X.message),null}}return R}return la.parse(["to-array",e],this)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,y,U){let R=typeof e=="number"?this.path.concat(e):this.path;R=typeof r=="string"?R.concat(r):R;const j=U?this.scope.concat(U):this.scope;return new mo(this.registry,R,y||null,j,this.errors,this._scope,this.options)}error(e,...r){const y=`${this.key}${r.map(U=>`[${U}]`).join("")}`;this.errors.push(new rr(y,e))}checkSubtype(e,r){const y=as(e,r);return y&&this.error(y),y}}var ll=mo;function oc(h){if(h instanceof Ya)return oc(h.boundExpression);if(h instanceof os&&h.name==="error"||h instanceof Ql||h instanceof Ui||h instanceof Ea||h instanceof Za)return!1;const e=h instanceof la||h instanceof zs;let r=!0;return h.eachChild(y=>{r=e?r&&oc(y):r&&y instanceof Ln}),!!r&&fo(h)&&Xa(h,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function cl(h,e){const r=h.length-1;let y,U,R=0,j=r,X=0;for(;R<=j;)if(X=Math.floor((R+j)/2),y=h[X],U=h[X+1],y<=e){if(X===r||e<U)return X;R=X+1}else{if(!(y>e))throw new _n("Input is not a number.");j=X-1}return 0}class go{constructor(e,r,y){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[U,R]of y)this.labels.push(U),this.outputs.push(R)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const y=r.parse(e[1],1,Ei);if(!y)return null;const U=[];let R=null;r.expectedType&&r.expectedType.kind!=="value"&&(R=r.expectedType);for(let j=1;j<e.length;j+=2){const X=j===1?-1/0:e[j],Q=e[j+1],se=j,W=j+1;if(typeof X!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
267omputed expressions) for the input values.',se);if(U.length&&U[U.length-1][0]>=X)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',se);const ee=r.parse(Q,W,R);if(!ee)return null;R=R||ee.type,U.push([X,ee])}return new go(R,y,U)}evaluate(e){const r=this.labels,y=this.outputs;if(r.length===1)return y[0].evaluate(e);const U=this.input.evaluate(e);if(U<=r[0])return y[0].evaluate(e);const R=r.length;return U>=r[R-1]?y[R-1].evaluate(e):y[cl(r,U)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let r=0;r<this.labels.length;r++)r>0&&e.push(this.labels[r]),e.push(this.outputs[r].serialize());return e}}const Ja=.95047,hr=1.08883,ad=4/29,_o=6/29,od=3*_o*_o,ld=_o*_o*_o,Gp=Math.PI/180,qr=180/Math.PI;function Sh(h){return h>ld?Math.pow(h,1/3):h/od+ad}function Th(h){return h>_o?h*h*h:od*(h-ad)}function Eh(h){return 255*(h<=.0031308?12.92*h:1.055*Math.pow(h,1/2.4)-.055)}function Ah(h){return(h/=255)<=.04045?h/12.92:Math.pow((h+.055)/1.055,2.4)}function cd(h){const e=Ah(h.r),r=Ah(h.g),y=Ah(h.b),U=Sh((.4124564*e+.3575761*r+.1804375*y)/Ja),R=Sh((.2126729*e+.7151522*r+.072175*y)/1);return{l:116*R-16,a:500*(U-R),b:200*(R-Sh((.0193339*e+.119192*r+.9503041*y)/hr)),alpha:h.a}}function hd(h){let e=(h.l+16)/116,r=isNaN(h.a)?e:e+h.a/500,y=isNaN(h.b)?e:e-h.b/200;return e=1*Th(e),r=Ja*Th(r),y=hr*Th(y),new Sr(Eh(3.2404542*r-1.5371385*e-.4985314*y),Eh(-.969266*r+1.8760108*e+.041556*y),Eh(.0556434*r-.2040259*e+1.0572252*y),h.alpha)}function qp(h,e,r){const y=e-h;return h+r*(y>180||y<-180?y-360*Math.round(y/360):y)}const hl={forward:cd,reverse:hd,interpolate:function(h,e,r){return{l:Bi(h.l,e.l,r),a:Bi(h.a,e.a,r),b:Bi(h.b,e.b,r),alpha:Bi(h.alpha,e.alpha,r)}}},ul={forward:function(h){const{l:e,a:r,b:y}=cd(h),U=Math.atan2(y,r)*qr;return{h:U<0?U+360:U,c:Math.sqrt(r*r+y*y),l:e,alpha:h.a}},reverse:function(h){const e=h.h*Gp,r=h.c;return hd({l:h.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:h.alpha})},interpolate:function(h,e,r){return{h:qp(h.h,e.h,r),c:Bi(h.c,e.c,r),l:Bi(h.l,e.l,r),alpha:Bi(h.alpha,e.alpha,r)}}};var ud=Object.freeze({__proto__:null,hcl:ul,lab:hl});class us{constructor(e,r,y,U,R,j){this.type=e,this.operator=r,this.interpolation=y,this.input=U,this.dynamicStops=R,this.labels=[],this.outputs=[];for(const[X,Q]of j)this.labels.push(X),this.outputs.push(Q)}static interpolationFactor(e,r,y,U){let R=0;if(e.name==="exponential")R=Mh(r,e.base,y,U);else if(e.name==="linear")R=Mh(r,1,y,U);else if(e.name==="cubic-bezier"){const j=e.controlPoints;R=new Mn(j[0],j[1],j[2],j[3]).solve(Mh(r,1,y,U))}return R}static parse(e,r){let[y,U,R,...j]=e;if(!Array.isArray(U)||U.length===0)return r.error("Expected an interpolation type expression.",1);if(U[0]==="linear")U={name:"linear"};else if(U[0]==="exponential"){const se=U[1];if(typeof se!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);U={name:"exponential",base:se}}else{if(U[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(U[0])}`,1,0);{const se=U.slice(1);if(se.length!==4||se.some(W=>typeof W!="number"||W<0||W>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);U={name:"cubic-bezier",controlPoints:se}}}if(e.length-1<3)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length-1>3&&(e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(R=r.parse(R,2,Ei),!R)return null;const X=[];let Q=null;if(y==="interpolate-hcl"||y==="interpolate-lab"?Q=$n:r.expectedType&&r.expectedType.kind!=="value"&&(Q=r.expectedType),e.length-1==3){const se=r.parse(j[0],3,vr);return se?new us(Q,y,U,R,se,X):null}for(let se=0;se<j.length;se+=2){const W=j[se],ee=j[se+1],ne=se+3,K=se+4;if(typeof W!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',ne);if(X.length&&X[X.length-1][0]>=W)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ne);const te=r.parse(ee,K,Q);if(!te)return null;Q=Q||te.type,X.push([W,te])}return Q.kind==="number"||Q.kind==="color"||Q.kind==="array"&&Q.itemType.kind==="number"&&typeof Q.N=="number"?new us(Q,y,U,R,null,X):r.error(`Type ${sn(Q)} is not interpolatable.`)}evaluate(e){let r=this.labels,y=this.outputs;if(this.dynamicStops){const W=this.dynamicStops.evaluate(e);if(W.length%2!=0)throw new _n("Expected an even number of arguments.");r=[],y=[];for(let ee=0;ee<W.length;ee+=2){const ne=W[ee],K=new Ln(Ei,W[ee+1]);if(typeof ne!="number")throw new _n('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not c
267omputed expressions) for the input values.');if(r.length&&r[r.length-1]>=ne)throw new _n('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.');r.push(ne),y.push(K)}if(r.length===0)throw new _n("Expected at least one input/output pair.")}if(r.length===1)return y[0].evaluate(e);const U=this.input.evaluate(e);if(U<=r[0])return y[0].evaluate(e);const R=r.length;if(U>=r[R-1])return y[R-1].evaluate(e);const j=cl(r,U),X=us.interpolationFactor(this.interpolation,U,r[j],r[j+1]),Q=y[j].evaluate(e),se=y[j+1].evaluate(e);return this.operator==="interpolate"?Zl[this.type.kind.toLowerCase()](Q,se,X):this.operator==="interpolate-hcl"?ul.reverse(ul.interpolate(ul.forward(Q),ul.forward(se),X)):hl.reverse(hl.interpolate(hl.forward(Q),hl.forward(se),X))}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const r=[this.operator,e,this.input.serialize()];if(this.dynamicStops)r.push(this.dynamicStops.serialize());else for(let y=0;y<this.labels.length;y++)r.push(this.labels[y],this.outputs[y].serialize());return r}}function Mh(h,e,r,y){const U=y-r,R=h-r;return U===0?0:e===1?R/U:(Math.pow(e,R)-1)/(Math.pow(e,U)-1)}class lc{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let y=null;const U=r.expectedType;U&&U.kind!=="value"&&(y=U);const R=[];for(const X of e.slice(1)){const Q=r.parse(X,1+R.length,y,void 0,{typeAnnotation:"omit"});if(!Q)return null;y=y||Q.type,R.push(Q)}const j=U&&R.some(X=>as(U,X.type));return new lc(j?vr:y,R)}evaluate(e){let r,y=null,U=0;for(const R of this.args){if(U++,y=R.evaluate(e),y&&y instanceof Un&&!y.available&&(r||(r=y),y=null,U===this.args.length))return r;if(y!==null)break}return y}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(r=>{e.push(r.serialize())}),e}}class cc{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const y=[];for(let R=1;R<e.length-1;R+=2){const j=e[R];if(typeof j!="string")return r.error(`Expected string, but found ${typeof j} instead.`,R);if(/[^a-zA-Z0-9_]/.test(j))return r.error("Variable names must contain only alphanumeric characters or '_'.",R);const X=r.parse(e[R+1],R+1);if(!X)return null;y.push([j,X])}const U=r.parse(e[e.length-1],e.length-1,r.expectedType,y);return U?new cc(y,U):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[r,y]of this.bindings)e.push(r,y.serialize());return e.push(this.result.serialize()),e}}class Ph{constructor(e,r,y){this.type=e,this.index=r,this.input=y}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const y=r.parse(e[1],1,Ei),U=r.parse(e[2],2,zn(r.expectedType||vr));return y&&U?new Ph(U.type.itemType,y,U):null}evaluate(e){const r=this.index.evaluate(e),y=this.input.evaluate(e);if(r<0)throw new _n(`Array index out of bounds: ${r} < 0.`);if(r>y.length-1)throw new _n(`Array index out of bounds: ${r} > ${y.length-1}.`);if(r===Math.floor(r))return y[r];const U=Math.floor(r),R=Math.ceil(r),j=y[U],X=y[R];if(typeof j!="number"||typeof X!="number")throw new _n(`Cannot interpolate between non-number values at index ${r}.`);const Q=r-U;return j*(1-Q)+X*Q}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Ch{constructor(e,r){this.type=pr,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const y=r.parse(e[1],1,vr),U=r.parse(e[2],2,vr);return y&&U?Jl(y.type,[pr,Ar,Ei,Va,vr])?new Ch(y,U):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${sn(y.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),y=this.haystack.evaluate(e);if(y==null)return!1;if(!Xo(r,["boolean","string","number","null"]))throw new _n(`Expected first argument to be of type boolean, string, number or null, but found ${sn(Kr(r))} instead.`);if(!Xo(y,["string","array"]))throw new _n(`Expected second argument to be of type array or string, but found ${sn(Kr(y))} instead.`);return y.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class hc{constructor(e,r,y){this.type=Ei,this.needle=e,this.haystack=r,this.fromIndex=y}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const y=r.parse(e[1],1,vr),U=r.parse(e[2],2,vr);if(!y||!U)return null;if(!Jl(y.type,[pr,Ar,Ei,Va,vr]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${sn(y.type)} instead`);if(e.length===4){const R=r.parse(e[3],3,Ei);return R?new hc(y,U,R):null}return new hc(y,U)}evaluate(e){const r=this.needle.evaluate(e),y=this.haystack.evaluate(e);if(!Xo(r,["boolean","string","number","null"]))throw new _n(`Expected first argument to be of type boolean, string, number or null, but found ${sn(Kr(r))} instead.`);if(!Xo(y,["string","array"]))throw new _n(`Expected second argument to be of type array or string, but found ${sn(Kr(y))} instead.`);if(this.fromIndex){const U=this.fromIndex.evaluate(e);return y.indexOf(r,U)}return y.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Ih{constructor(e,r,y,U,R,j){this.inputType=e,this.type=r,this.input=y,this.cases=U,this.outputs=R,this.otherwise=j}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let y,U;r.expectedType&&r.expectedType.kind!=="value"&&(U=r.expectedType);const R={},j=[];for(let se=2;se<e.length-1;se+=2){let W=e[se];const ee=e[se+1];Array.isArray(W)||(W=[W]);const ne=r.concat(se);if(W.length===0)return ne.error("Expected at least one branch label.");for(const te of W){if(typeof te!="number"&&typeof te!="string")return ne.error("Branch labels must be numbers or strings.");if(typeof te=="number"&&Math.abs(te)>Number.MAX_SAFE_INTEGER)return ne.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof te=="number"&&Math.floor(te)!==te)return ne.error("Numeric branch labels must be integer values.");if(y){if(ne.checkSubtype(y,Kr(te)))return null}else y=Kr(te);
vendor: 17,653 bytes, line 267
267if(R[String(te)]!==void 0)return ne.error("Branch labels must be unique.");R[String(te)]=j.length}const K=r.parse(ee,se,U);if(!K)return null;U=U||K.type,j.push(K)}const X=r.parse(e[1],1,vr);if(!X)return null;const Q=r.parse(e[e.length-1],e.length-1,U);return Q?X.type.kind!=="value"&&r.concat(1).checkSubtype(y,X.type)?null:new Ih(y,U,X,R,j,Q):null}evaluate(e){const r=this.input.evaluate(e);return(Kr(r)===this.inputType&&this.outputs[this.cases[r]]||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()],r=Object.keys(this.cases).sort(),y=[],U={};for(const j of r){const X=U[this.cases[j]];X===void 0?(U[this.cases[j]]=y.length,y.push([this.cases[j],[j]])):y[X][1].push(j)}const R=j=>this.inputType.kind==="number"?Number(j):j;for(const[j,X]of y)e.push(X.length===1?R(X[0]):X.map(R)),e.push(this.outputs[j].serialize());return e.push(this.otherwise.serialize()),e}}class Dh{constructor(e,r,y){this.type=e,this.branches=r,this.otherwise=y}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let y;r.expectedType&&r.expectedType.kind!=="value"&&(y=r.expectedType);const U=[];for(let j=1;j<e.length-1;j+=2){const X=r.parse(e[j],j,pr);if(!X)return null;const Q=r.parse(e[j+1],j+1,y);if(!Q)return null;U.push([X,Q]),y=y||Q.type}const R=r.parse(e[e.length-1],e.length-1,y);return R?new Dh(y,U,R):null}evaluate(e){for(const[r,y]of this.branches)if(r.evaluate(e))return y.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[r,y]of this.branches)e(r),e(y);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(r=>{e.push(r.serialize())}),e}}class uc{constructor(e,r,y,U){this.type=e,this.input=r,this.beginIndex=y,this.endIndex=U}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const y=r.parse(e[1],1,vr),U=r.parse(e[2],2,Ei);if(!y||!U)return null;if(!Jl(y.type,[zn(vr),Ar,vr]))return r.error(`Expected first argument to be of type array or string, but found ${sn(y.type)} instead`);if(e.length===4){const R=r.parse(e[3],3,Ei);return R?new uc(y.type,y,U,R):null}return new uc(y.type,y,U)}evaluate(e){const r=this.input.evaluate(e),y=this.beginIndex.evaluate(e);if(!Xo(r,["string","array"]))throw new _n(`Expected first argument to be of type array or string, but found ${sn(Kr(r))} instead.`);if(this.endIndex){const U=this.endIndex.evaluate(e);return r.slice(y,U)}return r.slice(y)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function dd(h,e){return h==="=="||h==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function pd(h,e,r,y){return y.compare(e,r)===0}function yo(h,e,r){const y=h!=="=="&&h!=="!=";return class e0{constructor(R,j,X){this.type=pr,this.lhs=R,this.rhs=j,this.collator=X,this.hasUntypedArgument=R.type.kind==="value"||j.type.kind==="value"}static parse(R,j){if(R.length!==3&&R.length!==4)return j.error("Expected two or three arguments.");const X=R[0];let Q=j.parse(R[1],1,vr);if(!Q)return null;if(!dd(X,Q.type))return j.concat(1).error(`"${X}" comparisons are not supported for type '${sn(Q.type)}'.`);let se=j.parse(R[2],2,vr);if(!se)return null;if(!dd(X,se.type))return j.concat(2).error(`"${X}" comparisons are not supported for type '${sn(se.type)}'.`);if(Q.type.kind!==se.type.kind&&Q.type.kind!=="value"&&se.type.kind!=="value")return j.error(`Cannot compare types '${sn(Q.type)}' and '${sn(se.type)}'.`);y&&(Q.type.kind==="value"&&se.type.kind!=="value"?Q=new zs(se.type,[Q]):Q.type.kind!=="value"&&se.type.kind==="value"&&(se=new zs(Q.type,[se])));let W=null;if(R.length===4){if(Q.type.kind!=="string"&&se.type.kind!=="string"&&Q.type.kind!=="value"&&se.type.kind!=="value")return j.error("Cannot use collator to compare non-string types.");if(W=j.parse(R[3],3,Wo),!W)return null}return new e0(Q,se,W)}evaluate(R){const j=this.lhs.evaluate(R),X=this.rhs.evaluate(R);if(y&&this.hasUntypedArgument){const Q=Kr(j),se=Kr(X);if(Q.kind!==se.kind||Q.kind!=="string"&&Q.kind!=="number")throw new _n(`Expected arguments for "${h}" to be (string, string) or (number, number), but found (${Q.kind}, ${se.kind}) instead.`)}if(this.collator&&!y&&this.hasUntypedArgument){const Q=Kr(j),se=Kr(X);if(Q.kind!=="string"||se.kind!=="string")return e(R,j,X)}return this.collator?r(R,j,X,this.collator.evaluate(R)):e(R,j,X)}eachChild(R){R(this.lhs),R(this.rhs),this.collator&&R(this.collator)}outputDefined(){return!0}serialize(){const R=[h];return this.eachChild(j=>{R.push(j.serialize())}),R}}}const $p=yo("==",function(h,e,r){return e===r},pd),Hp=yo("!=",function(h,e,r){return e!==r},function(h,e,r,y){return!pd(0,e,r,y)}),Wp=yo("<",function(h,e,r){return e<r},function(h,e,r,y){return y.compare(e,r)<0}),Zp=yo(">",function(h,e,r){return e>r},function(h,e,r,y){return y.compare(e,r)>0}),Xp=yo("<=",function(h,e,r){return e<=r},function(h,e,r,y){return y.compare(e,r)<=0}),Yp=yo(">=",function(h,e,r){return e>=r},function(h,e,r,y){return y.compare(e,r)>=0});class kh{constructor(e,r,y,U,R,j){this.type=Ar,this.number=e,this.locale=r,this.currency=y,this.unit=U,this.minFractionDigits=R,this.maxFractionDigits=j}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const y=r.parse(e[1],1,Ei);if(!y)return null;const U=e[2];if(typeof U!="object"||Array.isArray(U))return r.error("NumberFormat options argument must be an object.");let R=null;if(U.locale&&(R=r.parseObjectValue(U.locale,2,"locale",Ar),!R))return null;let j=null;if(U.currency&&(j=r.parseObjectValue(U.currency,2,"currency",Ar),!j))return null;let X=null;if(U.unit&&(X=r.parseObjectValue(U.unit,2,"unit",Ar),!X))return null;let Q=null;if(U["min-fraction-digits"]&&(Q=r.parseObjectValue(U["min-fraction-digits"],2,"min-fraction-digits",Ei),!Q))return null;let se=null;return U["max-fraction-digits"]&&(se=r.parseObjectValue(U["max-fraction-digits"],2,"max-fraction-digits",Ei),!se)?null:new kh(y,R,j,X,Q,se)}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 Rh{constructor(e){this.type=Ei,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const y=r.parse(e[1],1);return y?y.type.kind!=="array"&&y.type.kind!=="string"&&y.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${sn(y.type)} instead.`):new Rh(y):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new _n(`Expected value to be of type string or array, but found ${sn(Kr(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(r=>{e.push(r.serialize())}),e}}function dc(h){return function(){h=1831565813+(h|=0)|0;let e=Math.imul(h^h>>>15,1|h);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}const vo={"==":$p,"!=":Hp,">":Zp,"<":Wp,">=":Yp,"<=":Xp,array:zs,at:Ph,boolean:zs,case:Dh,coalesce:lc,collator:Ql,format:Ua,image:Ko,in:Ch,"index-of":hc,interpolate:us,"interpolate-hcl":us,"interpolate-lab":us,length:Rh,let:cc,literal:Ln,match:Ih,number:zs,"number-format":kh,object:zs,slice:uc,step:go,string:zs,"to-boolean":la,"to-color":la,"to-number":la,"to-string":la,var:Ya,within:Ui,distance:Ea,config:Za};function zh(h,[e,r,y,U]){e=e.evaluate(h),r=r.evaluate(h),y=y.evaluate(h);const R=U?U.evaluate(h):1,j=oh(e,r,y,R);if(j)throw new _n(j);return new Sr(e/255*R,r/255*R,y/255*R,R)}function fd(h,[e,r,y,U]){e=e.evaluate(h),r=r.evaluate(h),y=y.evaluate(h);const R=U?U.evaluate(h):1,j=function(se,W,ee,ne){return typeof se=="number"&&se>=0&&se<=360?typeof W=="number"&&W>=0&&W<=100&&typeof ee=="number"&&ee>=0&&ee<=100?ne===void 0||typeof ne=="number"&&ne>=0&&ne<=1?null:`Invalid hsla value [${[se,W,ee,ne].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${(typeof ne=="number"?[se,W,ee,ne]:[se,W,ee]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${(typeof ne=="number"?[se,W,ee,ne]:[se,W,ee]).join(", ")}]: 'h' must be between 0 and 360.`}(e,r,y,R);if(j)throw new _n(j);const X=`hsla(${e}, ${r}%, ${y}%, ${R})`,Q=Sr.parse(X);if(!Q)throw new _n(`Failed to parse HSLA color: ${X}`);return Q}function md(h,e){return h in e}function Lh(h,e){const r=e[h];return r===void 0?null:r}function Aa(h){return{type:h}}function Fh(h){return{result:"success",value:h}}function gs(h){return{result:"error",value:h}}function pc(h,e){return!!h&&!!h.parameters&&h.parameters.indexOf(e)>-1}function dl(h){return h["property-type"]==="data-driven"}function gd(h){return pc(h.expression,"measure-light")}function fc(h){return pc(h.expression,"zoom")}function pl(h){return!!h.expression&&h.expression.interpolated}function Oh(h){return typeof h=="object"&&h!==null&&!Array.isArray(h)}function Jp(h){return h}function Bh(h,e){const r=e.type==="color",y=h.stops&&typeof h.stops[0][0]=="object",U=y||!(y||h.property!==void 0),R=h.type||(pl(e)?"exponential":"interval");if(r&&((h=Xl({},h)).stops&&(h.stops=h.stops.map(se=>[se[0],Sr.parse(se[1])])),h.default=Sr.parse(h.default?h.default:e.default)),h.colorSpace&&h.colorSpace!=="rgb"&&!ud[h.colorSpace])throw new Error(`Unknown color space: ${h.colorSpace}`);let j,X,Q;if(R==="exponential")j=_d;else if(R==="interval")j=Qp;else if(R==="categorical"){j=Kp,X=Object.create(null);for(const se of h.stops)X[se[0]]=se[1];Q=typeof h.stops[0][0]}else{if(R!=="identity")throw new Error(`Unknown function type "${R}"`);j=yd}if(y){const se={},W=[];for(let K=0;K<h.stops.length;K++){const te=h.stops[K],ae=te[0].zoom;se[ae]===void 0&&(se[ae]={zoom:ae,type:h.type,property:h.property,default:h.default,stops:[]},W.push(ae)),se[ae].stops.push([te[0].value,te[1]])}const ee=[];for(const K of W)ee.push([se[K].zoom,Bh(se[K],e)]);const ne={name:"linear"};return{kind:"composite",interpolationType:ne,interpolationFactor:us.interpolationFactor.bind(void 0,ne),zoomStops:ee.map(K=>K[0]),evaluate:({zoom:K},te)=>_d({stops:ee,base:h.base},e,K).evaluate(K,te)}}if(U){const se=R==="exponential"?{name:"exponential",base:h.base!==void 0?h.base:1}:null;return{kind:"camera",interpolationType:se,interpolationFactor:us.interpolationFactor.bind(void 0,se),zoomStops:h.stops.map(W=>W[0]),evaluate:({zoom:W})=>j(h,e,W,X,Q)}}return{kind:"source",evaluate(se,W){const ee=W&&W.properties?W.properties[h.property]:void 0;return ee===void 0?xo(h.default,e.default):j(h,e,ee,X,Q)}}}function xo(h,e,r){return h!==void 0?h:e!==void 0?e:r!==void 0?r:void 0}function Kp(h,e,r,y,U){return xo(typeof r===U?y[r]:void 0,h.default,e.default)}function Qp(h,e,r){if(Ls(r)!=="number")return xo(h.default,e.default);const y=h.stops.length;if(y===1||r<=h.stops[0][0])return h.stops[0][1];if(r>=h.stops[y-1][0])return h.stops[y-1][1];const U=cl(h.stops.map(R=>R[0]),r);return h.stops[U][1]}function _d(h,e,r){const y=h.base!==void 0?h.base:1;if(Ls(r)!=="number")return xo(h.default,e.default);const U=h.stops.length;if(U===1||r<=h.stops[0][0])return h.stops[0][1];if(r>=h.stops[U-1][0])return h.stops[U-1][1];const R=cl(h.stops.map(W=>W[0]),r),j=function(W,ee,ne,K){const te=K-ne,ae=W-ne;return te===0?0:ee===1?ae/te:(Math.pow(ee,ae)-1)/(Math.pow(ee,te)-1)}(r,y,h.stops[R][0],h.stops[R+1][0]),X=h.stops[R][1],Q=h.stops[R+1][1];let se=Zl[e.type]||Jp;if(h.colorSpace&&h.colorSpace!=="rgb"){const W=ud[h.colorSpace];se=(ee,ne)=>W.reverse(W.interpolate(W.forward(ee),W.forward(ne),j))}return typeof X.evaluate=="function"?{evaluate(...W){const ee=X.evaluate.apply(void 0,W),ne=Q.evaluate.apply(void 0,W);if(ee!==void 0&&ne!==void 0)return se(ee,ne,j)}}:se(X,Q,j)}function yd(h,e,r){return e.type==="color"?r=Sr.parse(r):e.type==="formatted"?r=Hn.fromString(r.toString()):e.type==="resolvedImage"?r=Un.build(r.toString()):Ls(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0),xo(r,h.default,e.default)}os.register(vo,{error:[{kind:"error"},[Ar],(h,[e])=>{throw new _n(e.evaluate(h))}],typeof:[Ar,[vr],(h,[e])=>sn(Kr(e.evaluate(h)))],"to-rgba":[zn(Ei,4),[$n],(h,[e])=>e.evaluate(h).toRenderColor(null).toArray()],"to-hsla":[zn(Ei,4),[$n],(h,[e])=>e.evaluate(h).toRenderColor(null).toHslaArray()],rgb:[$n,[Ei,Ei,Ei],zh],rgba:[$n,[Ei,Ei,Ei,Ei],zh],hsl:[$n,[Ei,Ei,Ei],fd],hsla:[$n,[Ei,Ei,Ei,Ei],fd],has:{type:pr,overloads:[[[Ar],(h,[e])=>md(e.evaluate(h),h.properties())],[[Ar,aa],(h,[e,r])=>md(e.evaluate(h),r.evaluate(h))]]},get:{type:vr,overloads:[[[Ar],(h,[e])=>Lh(e.evaluate(h),h.properties())],[[Ar,aa],(h,[e,r])=>Lh(e.evaluate(h),r.evaluate(h))]]},"feature-state":[vr,[Ar],(h,[e])=>Lh(e.evaluate(h),h.featureState||{})],properties:[aa,[],h=>h.properties()],"geometry-type":[Ar,[],h=>h.geometryType()],id:[vr,[],h=>h.id()],zoom:[Ei,[],h=>h.globals.zoom],pitch:[Ei,[],h=>h.globals.pitch||0],"distance-from-center":[Ei,[],h=>h.distanceFromCenter()],"measure-light":[Ei,[Ar],(h,[e])=>h.measureLight(e.evaluate(h))],"heatmap-density":[Ei,[],h=>h.globals.heatmapDensity||0],"line-progress":[Ei,[],h=>h.globals.lineProgress||0],"raster-value":[Ei,[],h=>h.globals.rasterValue||0],"raster-particle-speed":[Ei,[],h=>h.globals.rasterParticleSpeed||0],"sky-radial-progress":[Ei,[],h=>h.globals.skyRadialProgress||0],accumulated:[vr,[],h=>h.globals.accumulated===void 0?null:h.globals.accumulated],"+":[Ei,Aa(Ei),(h,e)=>{let r=0;for(const y of e)r+=y.evaluate(h);return r}],"*":[Ei,Aa(Ei),(h,e)=>{let r=1;for(const y of e)r*=y.evaluate(h);return r}],"-":{type:Ei,overloads:[[[Ei,Ei],(h,[e,r])=>e.evaluate(h)-r.evaluate(h)],[[Ei],(h,[e])=>-e.evaluate(h)]]},"/":[Ei,[Ei,Ei],(h,[e,r])=>e.evaluate(h)/r.evaluate(h)],"%":[Ei,[Ei,Ei],(h,[e,r])=>e.evaluate(h)%r.evaluate(h)],ln2:[Ei,[],()=>Math.LN2],pi:[Ei,[],()=>Math.PI],e:[Ei,[],()=>Math.E],"^":[Ei,[Ei,Ei],(h,[e,r])=>Math.pow(e.evaluate(h),r.evaluate(h))],sqrt:[Ei,[Ei],(h,[e])=>Math.sqrt(e.evaluate(h))],log10:[Ei,[Ei],(h,[e])=>Math.log(e.evaluate(h))/Math.LN10],ln:[Ei,[Ei],(h,[e])=>Math.log(e.evaluate(h))],log2:[Ei,[Ei],(h,[e])=>Math.log(e.evaluate(h))/Math.LN2],sin:[Ei,[Ei],(h,[e])=>Math.sin(e.evaluate(h))],cos:[Ei,[Ei],(h,[e])=>Math.cos(e.evaluate(h))],tan:[Ei,[Ei],(h,[e])=>Math.tan(e.evaluate(h))],asin:[Ei,[Ei],(h,[e])=>Math.asin(e.evaluate(h))],acos:[Ei,[Ei],(h,[e])=>Math.acos(e.evaluate(h))],atan:[Ei,[Ei],(h,[e])=>Math.atan(e.evaluate(h))],min:[Ei,Aa(Ei),(h,e)=>Math.min(...e.map(r=>r.evaluate(h)))],max:[Ei,Aa(Ei),(h,e)=>Math.max(...e.map(r=>r.evaluate(h)))],abs:[Ei,[Ei],(h,[e])=>Math.abs(e.evaluate(h))],round:[Ei,[Ei],(h,[e])=>{const r=e.evaluate(h);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ei,[Ei],(h,[e])=>Math.floor(e.evaluate(h))],ceil:[Ei,[Ei],(h,[e])=>Math.ceil(e.evaluate(h))],"filter-==":[pr,[Ar,vr],(h,[e,r])=>h.properties()[e.value]===r.value],"filter-id-==":[pr,[vr],(h,[e])=>h.id()===e.value],"filter-type-==":[pr,[Ar],(h,[e])=>h.geometryType()===e.value],"filter-<":[pr,[Ar,vr],(h,[e,r])=>{const y=h.properties()[e.value],U=r.value;return typeof y==typeof U&&y<U}],"filter-id-<":[pr,[vr],(h,[e])=>{const r=h.id(),y=e.value;return typeof r==typeof y&&r<y}],"filter->":[pr,[Ar,vr],(h,[e,r])=>{const y=h.properties()[e.value],U=r.value;return typeof y==typeof U&&y>U}],"filter-id->":[pr,[vr],(h,[e])=>{const r=h.id(),y=e.value;return typeof r==typeof y&&r>y}],"filter-<=":[pr,[Ar,vr],(h,[e,r])=>{const y=h.properties()[e.value],U=r.value;return typeof y==typeof U&&y<=U}],"filter-id-<=":[pr,[vr],(h,[e])=>{const r=h.id(),y=e.value;return typeof r==typeof y&&r<=y}],"filter->=":[pr,[Ar,vr],(h,[e,r])=>{const y=h.properties()[e.value],U=r.value;return typeof y==typeof U&&y>=U}],"filter-id->=":[pr,[vr],(h,[e])=>{const r=h.id(),y=e.value;return typeof r==typeof y&&r>=y}],"filter-has":[pr,[vr],(h,[e])=>e.value in h.properties()],"filter-has-id":[pr,[],h=>h.id()!==null&&h.id()!==void 0],"filter-type-in":[pr,[zn(Ar)],(h,[e])=>e.value.indexOf(h.geometryType())>=0],"filter-id-in":[pr,[zn(vr)],(h,[e])=>e.value.indexOf(h.id())>=0],"filter-in-small":[pr,[Ar,zn(vr)],(h,[e,r])=>r.value.indexOf(h.properties()[e.value])>=0],"filter-in-large":[pr,[Ar,zn(vr)],(h,[e,r])=>function(y,U,R,j){for(;R<=j;){const X=R+j>>1;
267if(U[X]===y)return!0;U[X]>y?j=X-1:R=X+1}return!1}(h.properties()[e.value],r.value,0,r.value.length-1)],all:{type:pr,overloads:[[[pr,pr],(h,[e,r])=>e.evaluate(h)&&r.evaluate(h)],[Aa(pr),(h,e)=>{for(const r of e)if(!r.evaluate(h))return!1;return!0}]]},any:{type:pr,overloads:[[[pr,pr],(h,[e,r])=>e.evaluate(h)||r.evaluate(h)],[Aa(pr),(h,e)=>{for(const r of e)if(r.evaluate(h))return!0;return!1}]]},"!":[pr,[pr],(h,[e])=>!e.evaluate(h)],"is-supported-script":[pr,[Ar],(h,[e])=>{const r=h.globals&&h.globals.isSupportedScript;return!r||r(e.evaluate(h))}],upcase:[Ar,[Ar],(h,[e])=>e.evaluate(h).toUpperCase()],downcase:[Ar,[Ar],(h,[e])=>e.evaluate(h).toLowerCase()],concat:[Ar,Aa(vr),(h,e)=>e.map(r=>As(r.evaluate(h))).join("")],"resolved-locale":[Ar,[Wo],(h,[e])=>e.evaluate(h).resolvedLocale()],random:[Ei,[Ei,Ei,vr],(h,e)=>{const[r,y,U]=e.map(j=>j.evaluate(h));if(r>y||r===y)return r;let R;if(typeof U=="string")R=function(j){let X=0;if(j.length===0)return X;for(let Q=0;Q<j.length;Q++)X=(X<<5)-X+j.charCodeAt(Q),X|=0;return X}(U);else{if(typeof U!="number")throw new _n(`Invalid seed input: ${U}`);R=U}return r+dc(R)()*(y-r)}]});class mc{constructor(e,r,y,U){this.expression=e,this._warningHistory={},this._evaluator=new ch(y,U),this._defaultValue=r?function(R){return R.type==="color"&&(Oh(R.default)||Array.isArray(R.default))?new Sr(0,0,0,0):R.type==="color"?Sr.parse(R.default)||null:R.default===void 0?null:R.default}(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this.configDependencies=ol(e)}evaluateWithoutErrorHandling(e,r,y,U,R,j,X,Q){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=y,this._evaluator.canonical=U||null,this._evaluator.availableImages=R||null,this._evaluator.formattedSection=j,this._evaluator.featureTileCoord=X||null,this._evaluator.featureDistanceData=Q||null,this.expression.evaluate(this._evaluator)}evaluate(e,r,y,U,R,j,X,Q){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=y||null,this._evaluator.canonical=U||null,this._evaluator.availableImages=R||null,this._evaluator.formattedSection=j||null,this._evaluator.featureTileCoord=X||null,this._evaluator.featureDistanceData=Q||null;try{const se=this.expression.evaluate(this._evaluator);if(se==null||typeof se=="number"&&se!=se)return this._defaultValue;if(this._enumValues&&!(se in this._enumValues))throw new _n(`Expected value to be one of ${Object.keys(this._enumValues).map(W=>JSON.stringify(W)).join(", ")}, but found ${JSON.stringify(se)} instead.`);return se}catch(se){return this._warningHistory[se.message]||(this._warningHistory[se.message]=!0,typeof console<"u"&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${se.message}`)),this._defaultValue}}}function bo(h){return Array.isArray(h)&&h.length>0&&typeof h[0]=="string"&&h[0]in vo}function wo(h,e,r,y){const U=new ll(vo,[],e?function(j){const X={color:$n,string:Ar,number:Ei,enum:Ar,boolean:pr,formatted:qs,resolvedImage:Zo};return j.type==="array"?zn(X[j.value]||vr,j.length):X[j.type]}(e):void 0,void 0,void 0,r,y),R=U.parse(h,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return R?Fh(new mc(R,e,r,y)):gs(U.errors)}class gc{constructor(e,r,y,U){this.kind=e,this._styleExpression=r,this.isLightConstant=y,this.isLineProgressConstant=U,this.isStateDependent=e!=="constant"&&!al(r.expression),this.configDependencies=ol(r.expression)}evaluateWithoutErrorHandling(e,r,y,U,R,j){return this._styleExpression.evaluateWithoutErrorHandling(e,r,y,U,R,j)}evaluate(e,r,y,U,R,j){return this._styleExpression.evaluate(e,r,y,U,R,j)}}class fl{constructor(e,r,y,U,R,j){this.kind=e,this.zoomStops=y,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!al(r.expression),this.isLightConstant=R,this.isLineProgressConstant=j,this.configDependencies=ol(r.expression),this.interpolationType=U}evaluateWithoutErrorHandling(e,r,y,U,R,j){return this._styleExpression.evaluateWithoutErrorHandling(e,r,y,U,R,j)}evaluate(e,r,y,U,R,j){return this._styleExpression.evaluate(e,r,y,U,R,j)}interpolationFactor(e,r,y){return this.interpolationType?us.interpolationFactor(this.interpolationType,e,r,y):0}}function vd(h,e,r,y){if((h=wo(h,e,r,y)).result==="error")return h;const U=h.value.expression,R=fo(U);if(!R&&!dl(e))return gs([new rr("","data expressions not supported")]);const j=Xa(U,["zoom","pitch","distance-from-center"]);if(!j&&!fc(e))return gs([new rr("","zoom expressions not supported")]);const X=Xa(U,["measure-light"]);if(!X&&!gd(e))return gs([new rr("","measure-light expression not supported")]);const Q=Xa(U,["line-progress"]);if(!Q&&!function(ee){return pc(ee.expression,"line-progress")}(e))return gs([new rr("","line-progress expression not supported")]);const se=e.expression&&e.expression.relaxZoomRestriction,W=gl(U);return W||j||se?W instanceof rr?gs([W]):W instanceof us&&!pl(e)?gs([new rr("",'"interpolate" expressions cannot be used with this property')]):Fh(W?new fl(R&&Q?"camera":"composite",h.value,W.labels,W instanceof us?W.interpolation:void 0,X,Q):new gc(R&&Q?"constant":"source",h.value,X,Q)):gs([new rr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class ml{constructor(e,r){this._parameters=e,this._specification=r,Xl(this,Bh(this._parameters,this._specification))}static deserialize(e){return new ml(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function gl(h){let e=null;if(h instanceof cc)e=gl(h.result);else if(h instanceof lc){for(const r of h.args)if(e=gl(r),e)break}else(h instanceof go||h instanceof us)&&h.input instanceof os&&h.input.name==="zoom"&&(e=h);return e instanceof rr||h.eachChild(r=>{const y=gl(r);y instanceof rr?e=y:e&&y&&e!==y&&(e=new rr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}var Nh,xd,ef=function(){if(xd)return Nh;xd=1,Nh=e;var h=3;function e(r,y,U){var R=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;var j=new Int32Array(this.arrayBuffer);r=j[0],this.d=(y=j[1])+2*(U=j[2]);for(var X=0;X<this.d*this.d;X++){var Q=j[h+X],se=j[h+X+1];R.push(Q===se?null:j.subarray(Q,se))}var W=j[h+R.length+1];this.keys=j.subarray(j[h+R.length],W),this.bboxes=j.subarray(W),this.insert=this._insertReadonly}else{this.d=y+2*U;for(var ee=0;ee<this.d*this.d;ee++)R.push([]);this.keys=[],this.bboxes=[]}this.n=y,this.extent=r,this.padding=U,this.scale=y/r,this.uid=0;var ne=U/y*r;this.min=-ne,this.max=r+ne}
267return e.prototype.insert=function(r,y,U,R,j){this._forEachCell(y,U,R,j,this._insertCell,this.uid++),this.keys.push(r),this.bboxes.push(y),this.bboxes.push(U),this.bboxes.push(R),this.bboxes.push(j)},e.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},e.prototype._insertCell=function(r,y,U,R,j,X){this.cells[j].push(X)},e.prototype.query=function(r,y,U,R,j){var X=this.min,Q=this.max;if(r<=X&&y<=X&&Q<=U&&Q<=R&&!j)return Array.prototype.slice.call(this.keys);var se=[];return this._forEachCell(r,y,U,R,this._queryCell,se,{},j),se},e.prototype._queryCell=function(r,y,U,R,j,X,Q,se){var W=this.cells[j];if(W!==null)for(var ee=this.keys,ne=this.bboxes,K=0;K<W.length;K++){var te=W[K];if(Q[te]===void 0){var ae=4*te;(se?se(ne[ae+0],ne[ae+1],ne[ae+2],ne[ae+3]):r<=ne[ae+2]&&y<=ne[ae+3]&&U>=ne[ae+0]&&R>=ne[ae+1])?(Q[te]=!0,X.push(ee[te])):Q[te]=!1}}},e.prototype._forEachCell=function(r,y,U,R,j,X,Q,se){for(var W=this._convertToCellCoord(r),ee=this._convertToCellCoord(y),ne=this._convertToCellCoord(U),K=this._convertToCellCoord(R),te=W;te<=ne;te++)for(var ae=ee;ae<=K;ae++){var ue=this.d*ae+te;if((!se||se(this._convertFromCellCoord(te),this._convertFromCellCoord(ae),this._convertFromCellCoord(te+1),this._convertFromCellCoord(ae+1)))&&j.call(this,r,y,U,R,ue,X,Q,se))return}},e.prototype._convertFromCellCoord=function(r){return(r-this.padding)/this.scale},e.prototype._convertToCellCoord=function(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))},e.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var r=this.cells,y=h+this.cells.length+1+1,U=0,R=0;R<this.cells.length;R++)U+=this.cells[R].length;var j=new Int32Array(y+U+this.keys.length+this.bboxes.length);j[0]=this.extent,j[1]=this.n,j[2]=this.padding;for(var X=y,Q=0;Q<r.length;Q++){var se=r[Q];j[h+Q]=X,j.set(se,X),X+=se.length}return j[h+r.length]=X,j.set(this.keys,X),j[h+r.length+1]=X+=this.keys.length,j.set(this.bboxes,X),X+=this.bboxes.length,j.buffer},Nh}(),Ka=Te(ef);const _c={};function Ti(h,e,r={}){Object.defineProperty(h,"_classRegistryKey",{value:e,writable:!1}),_c[e]={klass:h,omit:r.omit||[]}}Ti(Object,"Object"),Ka.serialize=function(h,e){const r=h.toArrayBuffer();return e&&e.add(r),{buffer:r}},Ka.deserialize=function(h){return new Ka(h.buffer)},Object.defineProperty(Ka,"name",{value:"Grid"}),Ti(Ka,"Grid"),typeof DOMMatrix<"u"&&Ti(DOMMatrix,"DOMMatrix"),Ti(Sr,"Color"),Ti(Error,"Error"),Ti(Hn,"Formatted"),Ti(Yo,"FormattedSection"),Ti(gn,"AJAXError"),Ti(Un,"ResolvedImage"),Ti(ml,"StylePropertyFunction"),Ti(mc,"StyleExpression",{omit:["_evaluator"]}),Ti($s,"ImageIdWithOptions"),Ti(fl,"ZoomDependentExpression"),Ti(gc,"ZoomConstantExpression"),Ti(os,"CompoundExpression",{omit:["_evaluate"]});for(const h in vo)_c[vo[h]._classRegistryKey]||Ti(vo[h],`Expression${h}`);function Vh(h){return h&&typeof ArrayBuffer<"u"&&(h instanceof ArrayBuffer||h.constructor&&h.constructor.name==="ArrayBuffer")}function Uh(h){return self.ImageBitmap&&h instanceof ImageBitmap}function Ma(h,e){if(h==null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||h instanceof Boolean||h instanceof Number||h instanceof String||h instanceof Date||h instanceof RegExp)return h;if(Vh(h)||Uh(h))return e&&e.add(h),h;if(ArrayBuffer.isView(h))return e&&e.add(h.buffer),h;if(h instanceof ImageData)return e&&e.add(h.data.buffer),h;if(Array.isArray(h)){const r=[];for(const y of h)r.push(Ma(y,e));return r}if(h instanceof Map){const r={$name:"Map"};for(const[y,U]of h.entries())r[y]=Ma(U);return r}if(h instanceof Set){const r={$name:"Set"};let y=0;for(const U of h.values())r[++y]=Ma(U);return r}if(typeof h=="object"){const r=h.constructor,y=r._classRegistryKey;if(!y)throw new Error(`Can't serialize object of unregistered class "${y}".`);const U=r.serialize?r.serialize(h,e):{};if(!r.serialize){for(const R in h)h.hasOwnProperty(R)&&(_c[y].omit.indexOf(R)>=0||(U[R]=Ma(h[R],e)));h instanceof Error&&(U.message=h.message)}if(U.$name)throw new Error("$name property is reserved for worker serialization logic.");return y!=="Object"&&(U.$name=y),U}throw new Error("can't serialize object of type "+typeof h)}function Qa(h){if(h==null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||h instanceof Boolean||h instanceof Number||h instanceof String||h instanceof Date||h instanceof RegExp||Vh(h)||Uh(h)||ArrayBuffer.isView(
267h)||h instanceof ImageData)return h;if(Array.isArray(h))return h.map(Qa);if(typeof h=="object"){const e=h.$name||"Object";if(e==="Map"){const U=new Map;for(const R of Object.keys(h))R!=="$name"&&U.set(R,Qa(h[R]));return U}if(e==="Set"){const U=new Set;for(const R of Object.keys(h))R!=="$name"&&U.add(Qa(h[R]));return U}const{klass:r}=_c[e];if(!r)throw new Error(`Can't deserialize unregistered class "${e}".`);if(r.deserialize)return r.deserialize(h);const y=Object.create(r.prototype);for(const U of Object.keys(h))U!=="$name"&&(y[U]=Qa(h[U]));return y}throw new Error("can't deserialize object of type "+typeof h)}const Mi={"Latin-1 Supplement":h=>h>=128&&h<=255,Arabic:h=>h>=1536&&h<=1791,"Arabic Supplement":h=>h>=1872&&h<=1919,"Arabic Extended-A":h=>h>=2208&&h<=2303,"Hangul Jamo":h=>h>=4352&&h<=4607,"Unified Canadian Aboriginal Syllabics":h=>h>=5120&&h<=5759,Khmer:h=>h>=6016&&h<=6143,"Unified Canadian Aboriginal Syllabics Extended":h=>h>=6320&&h<=6399,"General Punctuation":h=>h>=8192&&h<=8303,"Letterlike Symbols":h=>h>=8448&&h<=8527,"Number Forms":h=>h>=8528&&h<=8591,"Miscellaneous Technical":h=>h>=8960&&h<=9215,"Control Pictures":h=>h>=9216&&h<=9279,"Optical Character Recognition":h=>h>=9280&&h<=9311,"Enclosed Alphanumerics":h=>h>=9312&&h<=9471,"Geometric Shapes":h=>h>=9632&&h<=9727,"Miscellaneous Symbols":h=>h>=9728&&h<=9983,"Miscellaneous Symbols and Arrows":h=>h>=11008&&h<=11263,"CJK Radicals Supplement":h=>h>=11904&&h<=12031,"Kangxi Radicals":h=>h>=12032&&h<=12255,"Ideographic Description Characters":h=>h>=12272&&h<=12287,"CJK Symbols and Punctuation":h=>h>=12288&&h<=12351,Hiragana:h=>h>=12352&&h<=12447,Katakana:h=>h>=12448&&h<=12543,Bopomofo:h=>h>=12544&&h<=12591,"Hangul Compatibility Jamo":h=>h>=12592&&h<=12687,Kanbun:h=>h>=12688&&h<=12703,"Bopomofo Extended":h=>h>=12704&&h<=12735,"CJK Strokes":h=>h>=12736&&h<=12783,"Katakana Phonetic Extensions":h=>h>=12784&&h<=12799,"Enclosed CJK Letters and Months":h=>h>=12800&&h<=13055,"CJK Compatibility":h=>h>=13056&&h<=13311,"CJK Unified Ideographs Extension A":h=>h>=13312&&h<=19903,"Yijing Hexagram Symbols":h=>h>=19904&&h<=19967,"CJK Unified Ideographs":h=>h>=19968&&h<=40959,"Yi Syllables":h=>h>=40960&&h<=42127,"Yi Radicals":h=>h>=42128&&h<=42191,"Hangul Jamo Extended-A":h=>h>=43360&&h<=43391,"Hangul Syllables":h=>h>=44032&&h<=55215,"Hangul Jamo Extended-B":h=>h>=55216&&h<=55295,"Private Use Area":h=>h>=57344&&h<=63743,"CJK Compatibility Ideographs":h=>h>=63744&&h<=64255,"Arabic Presentation Forms-A":h=>h>=64336&&h<=65023,"Vertical Forms":h=>h>=65040&&h<=65055,"CJK Compatibility Forms":h=>h>=65072&&h<=65103,"Small Form Variants":h=>h>=65104&&h<=65135,"Arabic Presentation Forms-B":h=>h>=65136&&h<=65279,"Halfwidth and Fullwidth Forms":h=>h>=65280&&h<=65519,Osage:h=>h>=66736&&h<=66815,"CJK Unified Ideographs Extension B":h=>h>=131072&&h<=173791};function jh(h){for(const e of h)if(yc(e.charCodeAt(0)))return!0;return!1}function tf(h){for(const e of h)if(!rf(e.charCodeAt(0)))return!1;return!0}function rf(h){return!(Mi.Arabic(h)||Mi["Arabic Supplement"](h)||Mi["Arabic Extended-A"](h)||Mi["Arabic Presentation Forms-A"](h)||Mi["Arabic Presentation Forms-B"](h))}function yc(h){return!(h!==746&&h!==747&&(h<4352||!(Mi["Bopomofo Extended"](h)||Mi.Bopomofo(h)||Mi["CJK Compatibility Forms"](h)&&!(h>=65097&&h<=65103)||Mi["CJK Compatibility Ideographs"](h)||Mi["CJK Compatibility"](h)||Mi["CJK Radicals Supplement"](h)||Mi["CJK Strokes"](h)||!(!Mi["CJK Symbols and Punctuation"](h)||h>=12296&&h<=12305||h>=12308&&h<=12319||h===12336)||Mi["CJK Unified Ideographs Extension A"](h)||Mi["CJK Unified Ideographs"](h)||Mi["Enclosed CJK Letters and Months"](h)||Mi["Hangul Compatibility Jamo"](h)||Mi["Hangul Jamo Extended-A"](h)||Mi["Hangul Jamo Extended-B"](h)||Mi["Hangul Jamo"](h)||Mi["Hangul Syllables"](h)||Mi.Hiragana(h)||Mi["Ideographic Description Characters"](h)||Mi.Kanbun(h)||Mi["Kangxi Radicals"](h)||Mi["Katakana Phonetic Extensions"](h)||Mi.Katakana(h)&&h!==12540||!(!Mi["Halfwidth and Fullwidth Forms"](h)||h===65288||h===65289||h===65293||h>=65306&&h<=65310||h===65339||h===65341||h===65343||h>=65371&&h<=65503||h===65507||h>=65512&&h<=65519)||!(!Mi["Small Form Variants"](h)||h>=65112&&h<=65118||h>=65123&&h<=65126)||Mi["Unified Canadian Aboriginal Syllabics"](h)||Mi["Unified Canadian Aboriginal Syllabics Extended"](h)||Mi["Vertical Forms"](h)||Mi["Yijing Hexagram Symbols"](h)||Mi["Yi Syllables"](h)||Mi["Yi Radicals"](h))))}
267function Gh(h){return!(yc(h)||function(e){return!!(Mi["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Mi["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Mi["Letterlike Symbols"](e)||Mi["Number Forms"](e)||Mi["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Mi["Control Pictures"](e)&&e!==9251||Mi["Optical Character Recognition"](e)||Mi["Enclosed Alphanumerics"](e)||Mi["Geometric Shapes"](e)||Mi["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Mi["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Mi["CJK Symbols and Punctuation"](e)||Mi.Katakana(e)||Mi["Private Use Area"](e)||Mi["CJK Compatibility Forms"](e)||Mi["Small Form Variants"](e)||Mi["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(h))}function qh(h){return h>=1424&&h<=2303||Mi["Arabic Presentation Forms-A"](h)||Mi["Arabic Presentation Forms-B"](h)}function bd(h,e){return!(!e&&qh(h)||h>=2304&&h<=3583||h>=3840&&h<=4255||Mi.Khmer(h))}function $h(h){for(const e of h)if(qh(e.charCodeAt(0)))return!0;return!1}const _l="deferred",vc="loading",Hh="loaded";let Hs=null,ds="unavailable",Pa=null;const Wh=function(h){h&&typeof h=="string"&&h.indexOf("NetworkError")>-1&&(ds="error"),Hs&&Hs(h)};function Zh(){So.fire(new Gs("pluginStateChange",{pluginStatus:ds,pluginURL:Pa}))}const So=new wa,xc=function(){return ds},yl=function(){if(ds!==_l||!Pa)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ds=vc,Zh(),Pa&&Pn({url:Pa},h=>{h?Wh(h):(ds=Hh,Zh())})},_s={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>ds===Hh||_s.applyArabicShaping!=null,isLoading:()=>ds===vc,setState(h){ds=h.pluginStatus,Pa=h.pluginURL},isParsed:()=>_s.applyArabicShaping!=null&&_s.processBidirectionalText!=null&&_s.processStyledBidirectionalText!=null,getPluginURL:()=>Pa};class Nr{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.transition=r.transition,this.pitch=r.pitch,this.brightness=r.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(r,y){for(const U of r)if(!bd(U.charCodeAt(0),y))return!1;return!0}(e,_s.isLoaded())}}class bc{constructor(e,r,y,U){this.property=e,this.value=r,this.expression=function(R,j,X,Q){if(Oh(R))return new ml(R,j);if(bo(R)||Array.isArray(R)&&R.length>0){const se=vd(R,j,X,Q);if(se.result==="error")throw new Error(se.value.map(W=>`${W.key}: ${W.message}`).join(", "));return se.value}{let se=R;return typeof R=="string"&&j.type==="color"&&(se=Sr.parse(R)),{kind:"constant",configDependencies:new Set,evaluate:()=>se}}}(r===void 0?e.specification.default:r,e.specification,y,U)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,y){return this.property.possiblyEvaluate(this,e,r,y)}}class vl{constructor(e,r,y){this.property=e,this.value=new bc(e,void 0,r,y)}transitioned(e,r){return new Xh(this.property,this.value,r,ai({},e.transition,this.transition),e.now)}untransitioned(){return new Xh(this.property,this.value,null,{},0)}}class wc{constructor(e,r,y){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=r,this._options=y,this.configDependencies=new Set}getValue(e){return or(this._values[e].value.value)}setValue(e,r){this._values.hasOwnProperty(e)||(this._values[e]=new vl(this._values[e].property,this._scope,this._options)),this._values[e].value=new bc(this._values[e].property,r===null?void 0:or(r),this._scope,this._options),this._values[e].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].value.expression.configDependencies]))}setTransitionOrValue(e,r){r&&(this._options=r);const y=this._properties.properties;if(e)for(const U in e){const R=e[U];if($i(U,"-transition")){const j=U.slice(0,-11);y[j]&&this.setTransition(j,R)}else y.hasOwnProperty(U)&&this.setValue(U,R)}}getTransition(e){return or(this._values[e].transition)}setTransition(e,r){this._values.hasOwnProperty(e)||(this._values[e]=new vl(this._values[e].property)),this._values[e].transition=or(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const y=this.getValue(r);y!==void 0&&(e[r]=y);const U=this.getTransition(r);U!==void 0&&(e[`${r}-transition`]=U)}return e}transitioned(e,r){const y=new xl(this._properties);for(const U of Object.keys(this._values))y._values[U]=this._values[U].transitioned(e,r._values[U]);return y}untransitioned(){const e=new xl(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class Xh{constructor(e,r,y,U,R){const j=U.delay||0,X=U.duration||0;R=R||0,this.property=e,this.value=r,this.begin=R+j,this.end=this.begin+X,e.specification.transition&&(U.delay||U.duration)&&(this.prior=y)}possiblyEvaluate(e,r,y){const U=e.now||0,R=this.value.possiblyEvaluate(e,r,y),j=this.prior;if(j){if(U>this.end)return this.prior=null,R;if(this.value.isDataDriven())return this.prior=null,R;if(U<this.begin)return j.possiblyEvaluate(e,r,y);{const X=(U-this.begin)/(this.end-this.begin);return this.property.interpolate(j.possiblyEvaluate(e,r,y),R,Rn(X))}}return R}}class xl{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,y){const U=new Ao(this._properties);for(const R of Object.keys(this._values))U._values[R]=this._values[R].possiblyEvaluate(e,r,y);return U}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class To{constructor(e,r,y){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=r,this._options=y,this.configDependencies=new Set}getValue(e){return or(this._values[e].value)}setValue(e,r){this._values[e]=new bc(this._values[e].property,r===null?void 0:or(r),this._scope,this._options),this._values[e].expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].expression.configDependencies]))}serialize(){const e={};for(const r of Object.keys(this._values)){const y=this.getValue(r);y!==void 0&&(e[r]=y)}return e}possiblyEvaluate(e,r,y){const U=new Ao(this._properties);for(const R of Object.keys(this._values))U._values[R]=this._values[R].possiblyEvaluate(e,r,y);return U}}class Eo{constructor(e,r,y){this.property=e,this.value=r,this.parameters=y}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,y,U){return this.property.evaluate(this.value,this.parameters,e,r,y,U)}}class Ao{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class oi{constructor(e){this.specification=e}
vendor: 9,069 bytes, line 267
267possiblyEvaluate(e,r){return e.expression.evaluate(r)}interpolate(e,r,y){const U=Zl[this.specification.type];return U?U(e,r,y):e}}class bi{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,y,U){return new Eo(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},y,U)}:e.expression,r)}interpolate(e,r,y){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new Eo(this,{kind:"constant",value:void 0},e.parameters);const U=Zl[this.specification.type];return U?new Eo(this,{kind:"constant",value:U(e.value.value,r.value.value,y)},e.parameters):e}evaluate(e,r,y,U,R,j){return e.kind==="constant"?e.value:e.evaluate(r,y,U,R,j)}}class Mo{constructor(e){this.specification=e}possiblyEvaluate(e,r,y,U){return!!e.expression.evaluate(r,null,{},y,U)}interpolate(){return!1}}class Wr{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const r=new Nr(0,{});for(const y in e){const U=e[y];U.specification.overridable&&this.overridableProperties.push(y);const R=this.defaultPropertyValues[y]=new bc(U,void 0),j=this.defaultTransitionablePropertyValues[y]=new vl(U);this.defaultTransitioningPropertyValues[y]=j.untransitioned(),this.defaultPossiblyEvaluatedValues[y]=R.possiblyEvaluate(r)}}}Ti(bi,"DataDrivenProperty"),Ti(oi,"DataConstantProperty"),Ti(Mo,"ColorRampProperty");var Rt=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"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,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"required":false,"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"snow":{"type":"snow","experimental":true},"rain":{"type":"rain","experimental":true},"camera":{"type":"camera"},"color-theme":{"type":"colorTheme"},"indoor":{"type":"indoor","experimental":true},"imports":{"type":"array","value":"import"},"schema":{"type":"schema"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"},"models":{"type":"models"},"featuresets":{"experimental":true,"type":"featuresets"}},"featuresets":{"experimental":true,"*":{"type":"featureset"}},"featureset":{"experimental":true,"metadata":{"experimental":true,"type":"*"},"selectors":{"experimental":true,"type":"array","value":"selector"}},"selector":{"experimental":true,"layer":{"experimental":true,"type":"string","required":true},"properties":{"experimental":true,"type":"selectorProperty","required":false},"featureNamespace":{"experimental":true,"type":"string","required":false},"_uniqueFeatureID":{"experimental":true,"type":"boolean","private":true,"required":false}},"selectorProperty":{"experimental":true,"*":{"experimental":true,"type":"*"}},"model":{"type":"string","required":true},"import":{"id":{"type":"string","required":true},"url":{"type":"string","required":true},"config":{"type":"config"},"data":{"type":"$root"},"color-theme":{"type":"colorTheme","optional":true}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","property-type":"data-constant","expression":{},"required":true},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"id":{"type":"string","required":true},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"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","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false,"property-type":"data-constant"},"shadow-quality":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"parameters":["zoom"]},"experimental":true},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"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":{"required":true,"type":"enum","values":{"vector":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"experimental":true,"type":{"required":true,"type":"enum","values":{"raster-array":1}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"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,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0}
267,"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":{"required":true,"type":"enum","values":{"video":1}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":1}},"url":{"required":false,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"raster-particle":{"experimental":true},"hillshade":{},"model":{"experimental":true},"background":{},"sky":{},"slot":{},"clip":{}},"required":true},"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"}},"layout":["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_clip":{"clip-layer-types":{"type":"array","value":"enum","values":{"model":1,"symbol":1},"default":[],"expression":{},"property-type":"data-constant"},"clip-layer-scope":{"type":"array","value":"string","default":[],"expression":{},"property-type":"data-constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"fill-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-base":1,"hd-road-markup":1},"default":"none","experimental":true,"private":true,"expression":{},"property-type":"data-constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"circle-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-markup":1},"default":"none","experimental":true,"expression":{},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","experimental":true,"default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","experimental":true,"default":0,"expression":{"parameters":["zoom","feature","line-progress"]},"property-type":"data-driven"},"line-elevation-reference":{"type":"enum","values":{"none":1,"sea":1,"ground":1,"hd-road-markup":1},"default":"none","experimental":true,"expression":{},"property-type":"data-constant"},"line-cross-slope":{"type":"number","experimental":true,"expression":{},"property-type":"constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"line-width-unit":{"type":"enum","values":{"pixels":1,"meters":1},"default":"pixels","experimental":true,"private":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1,"hd-road-markup":1},"default":"ground","experimental":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":0.1,"maximum":10,"experimental":true,"private":true,"expression":{},"property-type":"data-constant"},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}
267,"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":0.1,"maximum":10,"experimental":true,"private":true,"expression":{},"property-type":"data-constant"},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"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"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_hillshade":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster-particle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_clip":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_model":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"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":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"snow":{"density":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"opacity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","property-type":"data-constant","default":"#ffffff","experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"center-thinning":{"type":"number","property-type":"data-constant","default":0.4,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"flake-size":{"type":"number","property-type":"data-constant","default":0.71,"minimum":0,"maximum":5,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"rain":{"density":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"opacity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"center-thinning":{"type":"number","property-type":"data-constant","default":0.57,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"distortion-strength":{"type":"number","property-type":"data-constant","default":0.7,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"colorTheme":{"data":{"type":"string","property-type":"data-constant","expression":{}}},"indoor":{"floorplanFeaturesetId":{"type":"string","experimental":true,"property-type":"data-constant","expression":{}},"buildingFeaturesetId":{"type":"string","experimental":true,"property-type":"data-constant","expression":{}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","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"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":
267{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"fill-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","experimental":true,"values":{"terrain":1,"flat":1},"default":"flat","property-type":"data-constant"},"fill-extrusion-base-alignment":{"type":"enum","experimental":true,"values":{"terrain":1,"flat":1},"default":"terrain","property-type":"data-constant"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","experimental":true,"default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","experimental":true,"default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","experimental":true,"default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"experimental":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true,"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light","line-progress"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"}
267,"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"property-type":"constant"},"line-trim-fade-range":{"type":"array","value":"number","experimental":true,"length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-trim-color":{"type":"color","experimental":true,"default":"transparent","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"property-type":"data-constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"experimental":true,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":[]},"experimental":true,"property-type":"data-constant"},"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":
267{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"property-type":"data-driven"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"*"}}}');function wd(h){return h instanceof Number||h instanceof String||h instanceof Boolean?h.valueOf():h}function Sc(h){if(Array.isArray(h))return h.map(Sc);if(h instanceof Object&&!(h instanceof Number||h instanceof String||h instanceof Boolean)){const e={};for(const r in h)e[r]=Sc(h[r]);return e}return wd(h)}function Yh(h){if(h===!0||h===!1)return!0;
vendor: 5,212 bytes, lines 267-273
267if(!Array.isArray(h)||h.length===0)return!1;switch(h[0]){case"has":return h.length>=2&&h[1]!=="$id"&&h[1]!=="$type";case"in":return h.length>=3&&(typeof h[1]!="string"||Array.isArray(h[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return h.length!==3||Array.isArray(h[1])||Array.isArray(h[2]);case"any":case"all":for(const e of h.slice(1))if(!Yh(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function Sd(h,e="",r=null,y="fill"){if(h==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Yh(h)||(h=Tc(h));const U=h;let R=!0;try{R=function(W){if(!Po(W))return W;let ee=Sc(W);return Ed(ee),ee=Td(ee),ee}(U)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.
268This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md
269and paste the contents of this message in the report.
270Thank you!
271Filter Expression:
272${JSON.stringify(U,null,2)}
273        `)}let j=null,X=null;if(y!=="background"&&y!=="sky"&&y!=="slot"){X=Rt[`filter_${y}`];const W=wo(R,X,e,r);if(W.result==="error")throw new Error(W.value.map(ee=>`${ee.key}: ${ee.message}`).join(", "));j=(ee,ne,K)=>W.value.evaluate(ee,ne,{},K)}let Q=null,se=null;if(R!==U){const W=wo(U,X,e,r);if(W.result==="error")throw new Error(W.value.map(ee=>`${ee.key}: ${ee.message}`).join(", "));Q=(ee,ne,K,te,ae)=>W.value.evaluate(ee,ne,{},K,void 0,void 0,te,ae),se=!fo(W.value.expression)}return{filter:j,dynamicFilter:Q||void 0,needGeometry:Ad(R),needFeature:!!se}}function Td(h){if(!Array.isArray(h))return h;const e=function(r){if(nf.has(r[0])){for(let y=1;y<r.length;y++)if(Po(r[y]))return!0}return r}(h);return e===!0?e:e.map(r=>Td(r))}function Ed(h){let e=!1;const r=[];if(h[0]==="case"){for(let y=1;y<h.length-1;y+=2)e=e||Po(h[y]),r.push(h[y+1]);r.push(h[h.length-1])}else if(h[0]==="match"){e=e||Po(h[1]);for(let y=2;y<h.length-1;y+=2)r.push(h[y+1]);r.push(h[h.length-1])}else if(h[0]==="step"){e=e||Po(h[1]);for(let y=1;y<h.length-1;y+=2)r.push(h[y+1])}e&&(h.length=0,h.push("any",...r));for(let y=1;y<h.length;y++)Ed(h[y])}function Po(h){if(!Array.isArray(h))return!1;if((e=h[0])==="pitch"||e==="distance-from-center")return!0;var e;for(let r=1;r<h.length;r++)if(Po(h[r]))return!0;return!1}const nf=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function sf(h,e){return h<e?-1:h>e?1:0}function Ad(h){if(!Array.isArray(h))return!1;if(h[0]==="within"||h[0]==="distance")return!0;for(let e=1;e<h.length;e++)if(Ad(h[e]))return!0;return!1}function Tc(h){if(!h)return!0;const e=h[0];return h.length<=1?e!=="any":e==="=="?Ca(h[1],h[2],"=="):e==="!="?eo(Ca(h[1],h[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Ca(h[1],h[2],e):e==="any"?(r=h.slice(1),["any"].concat(r.map(Tc))):e==="all"?["all"].concat(h.slice(1).map(Tc)):e==="none"?["all"].concat(h.slice(1).map(Tc).map(eo)):e==="in"?Jh(h[1],h.slice(2)):e==="!in"?eo(Jh(h[1],h.slice(2))):e==="has"?Kh(h[1]):e!=="!has"||eo(Kh(h[1]));var r}function Ca(h,e,r){switch(h){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,h,e]}}function Jh(h,e){if(e.length===0)return!1;switch(h){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",h,["literal",e.sort(sf)]]:["filter-in-small",h,["literal",e]]}}function Kh(h){switch(h){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",h]}}function eo(h){return["!",h]}const Ec="�";function Ws(h,e){return e?`${h}${Ec}${e}`:h}const ua="-transition",Md=new Set(["fill","line","background","hillshade","raster"]);class kn extends wa{constructor(e,r,y,U,R){if(super(),this.id=e.id,this.fqid=Ws(this.id,y),this.type=e.type,this.scope=y,this.lut=U,this.options=R,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.configDependencies=new Set,e.type!=="custom"){if(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type&&e.type!=="background"&&e.type!=="sky"&&e.type!=="slot"){this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter;const j=wo(this.filter,Rt[`filter_${e.type}`]);j.result!=="error"&&(this.configDependencies=new Set([...this.configDependencies,...j.value.configDependencies]))}if(e.slot&&(this.slot=e.slot),r.layout&&(this._unevaluatedLayout=new To(r.layout,this.scope,R),this.configDependencies=new Set([...this.configDependencies,...this._unevaluatedLayout.configDependencies])),r.paint){this._transitionablePaint=new wc(r.paint,this.scope,R);for(const j in e.paint)this.setPaintProperty(j,e.paint[j]);for(const j in e.layout)this.setLayoutProperty(j,e.layout[j]);this.configDependencies=new Set([...this.configDependencies,...this._transitionablePaint.configDependencies]),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ao(r.paint)}}}onAdd(e){}onRemove(e){}isDraped(e){return!this.is3D()&&Md.has(this.type)}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}
273setLayoutProperty(e,r){if(this.type==="custom"&&e==="visibility")return void(this.visibility=r);const y=this._unevaluatedLayout;y._properties.properties[e]&&(y.setValue(e,r),this.configDependencies=new Set([...this.configDependencies,...y.configDependencies]),e==="visibility"&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(e){return $i(e,ua)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r){const y=this._transitionablePaint,U=y._properties.properties;if($i(e,ua)){const ee=e.slice(0,-11);return U[ee]&&y.setTransition(ee,r||void 0),!1}if(!U[e])return!1;const R=y._values[e],j=R.value.isDataDriven(),X=R.value;y.setValue(e,r),this.configDependencies=new Set([...this.configDependencies,...y.configDependencies]),this._handleSpecialPaintPropertyUpdate(e);const Q=y._values[e].value,se=Q.isDataDriven(),W=$i(e,"pattern")||e==="line-dasharray";return se||j||W||this._handleOverridablePaintPropertyUpdate(e,X,Q)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,r,y){return null}_handleOverridablePaintPropertyUpdate(e,r,y){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}
273serialize(){return yr({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()},(e,r)=>!(e===void 0||r==="layout"&&!Object.keys(e).length||r==="paint"&&!Object.keys(e).length))}is3D(){return!1}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(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof Eo&&dl(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}compileFilter(e){this._filterCompiled||(this._featureFilter=Sd(this.filter,this.scope,e),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&(e.renderPass==="shadow"?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,r,y,U,R,j,X,Q,se){}}const af={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class bl{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Vr{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.add(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_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}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_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 Tr(h,e=1){let r=0,y=0;return{members:h.map(U=>{const R=af[U.type].BYTES_PER_ELEMENT,j=r=Pd(r,Math.max(e,R)),X=U.components||1;return y=Math.max(y,R),r+=R*X,{name:U.name,type:U.type,components:X,offset:j}}),size:Pd(r,Math.max(y,e)),alignment:e}}function Pd(h,e){return Math.ceil(h/e)*e}class da extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const y=this.length;return this.resize(y+1),this.emplace(y,e,r)}emplace(e,r,y){const U=2*e;return this.int16[U+0]=r,this.int16[U+1]=y,e}}da.prototype.bytesPerElement=4,Ti(da,"StructArrayLayout2i4");class Co extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,y){const U=this.length;return this.resize(U+1),this.emplace(U,e,r,y)}emplace(e,r,y,U){const R=3*e;return this.int16[R+0]=r,this.int16[R+1]=y,this.int16[R+2]=U,e}}Co.prototype.bytesPerElement=6,Ti(Co,"StructArrayLayout3i6");class pa extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,y,U){const R=this.length;return this.resize(R+1),this.emplace(R,e,r,y,U)}emplace(e,r,y,U,R){const j=4*e;return this.int16[j+0]=r,this.int16[j+1]=y,this.int16[j+2]=U,this.int16[j+3]=R,e}}pa.prototype.bytesPerElement=8,Ti(pa,"StructArrayLayout4i8");class Ac extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R){const j=this.length;return this.resize(j+1),this.emplace(j,e,r,y,U,R)}emplace(e,r,y,U,R,j){const X=5*e;return this.int16[X+0]=r,this.int16[X+1]=y,this.int16[X+2]=U,this.int16[X+3]=R,this.int16[X+4]=j,e}}Ac.prototype.bytesPerElement=10,Ti(Ac,"StructArrayLayout5i10");class wl extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j,X){const Q=this.length;return this.resize(Q+1),this.emplace(Q,e,r,y,U,R,j,X)}emplace(e,r,y,U,R,j,X,Q){const se=6*e,W=12*e,ee=3*e;return this.int16[se+0]=r,this.int16[se+1]=y,this.uint8[W+4]=U,this.uint8[W+5]=R,this.uint8[W+6]=j,this.uint8[W+7]=X,this.float32[ee+2]=Q,e}}wl.prototype.bytesPerElement=12,Ti(wl,"StructArrayLayout2i4ub1f12");class Zs extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y){const U=this.length;return this.resize(U+1),this.emplace(U,e,r,y)}emplace(e,r,y,U){const R=3*e;return this.float32[R+0]=r,this.float32[R+1]=y,this.float32[R+2]=U,e}}Zs.prototype.bytesPerElement=12,Ti(Zs,"StructArrayLayout3f12");class Wn extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R){const j=this.length;return this.resize(j+1),this.emplace(j,e,r,y,U,R)}emplace(e,r,y,U,R,j){const X=6*e,Q=3*e;return this.uint16[X+0]=r,this.uint16[X+1]=y,this.uint16[X+2]=U,this.uint16[X+3]=R,this.float32[Q+2]=j,e}}Wn.prototype.bytesPerElement=12,Ti(Wn,"StructArrayLayout4ui1f12");class Mc extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,y,U){const R=this.length;return this.resize(R+1),this.emplace(R,e,r,y,U)}emplace(e,r,y,U,R){const j=4*e;return this.uint16[j+0]=r,this.uint16[j+1]=y,this.uint16[j+2]=U,this.uint16[j+3]=R,e}}Mc.prototype.bytesPerElement=8,Ti(Mc,"StructArrayLayout4ui8");class Sl extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j){const X=this.length;return this.resize(X+1),this.emplace(X,e,r,y,U,R,j)}emplace(e,r,y,U,R,j,X){const Q=6*e;return this.int16[Q+0]=r,this.int16[Q+1]=y,this.int16[Q+2]=U,this.int16[Q+3]=R,this.int16[Q+4]=j,this.int16[Q+5]=X,e}}Sl.prototype.bytesPerElement=12,Ti(Sl,"StructArrayLayout6i12");class Qh extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j,X,Q,se,W,ee,ne){const K=this.length;return this.resize(K+1),this.emplace(K,e,r,y,U,R,j,X,Q,se,W,ee,ne)}emplace(e,r,y,U,R,j,X,Q,se,W,ee,ne,K){const te=12*e;return this.int16[te+0]=r,this.int16[te+1]=y,this.int16[te+2]=U,this.int16[te+3]=R,this.uint16[te+4]=j,this.uint16[te+5]=X,this.uint16[te+6]=Q,this.uint16[te+7]=se,this.int16[te+8]=W,this.int16[te+9]=ee,this.int16[te+10]=ne,this.int16[te+11]=K,e}}Qh.prototype.bytesPerElement=24,Ti(Qh,"StructArrayLayout4i4ui4i24");class eu extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j){const X=this.length;return this.resize(X+1),this.emplace(X,e,r,y,U,R,j)}emplace(e,r,y,U,R,j,X){const Q=10*e,se=5*e;return this.int16[Q+0]=r,this.int16[Q+1]=y,this.int16[Q+2]=U,this.float32[se+2]=R,this.float32[se+3]=j,this.float32[se+4]=X,e}}eu.prototype.bytesPerElement=20,Ti(eu,"StructArrayLayout3i3f20");class to extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U){const R=this.length;return this.resize(R+1),this.emplace(R,e,r,y,U)}emplace(e,r,y,U,R){const j=4*e;return this.float32[j+0]=r,this.float32[j+1]=y,this.float32[j+2]=U,this.float32[j+3]=R,e}}to.prototype.bytesPerElement=16,Ti(to,"StructArrayLayout4f16");class tu extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}tu.prototype.bytesPerElement=4,Ti(tu,"StructArrayLayout1ul4");class Ia extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const y=this.length;return this.resize(y+1),this.emplace(y,e,r)}emplace(e,r,y){const U=2*e;return this.uint16[U+0]=r,this.uint16[U+1]=y,e}}Ia.prototype.bytesPerElement=4,Ti(Ia,"StructArrayLayout2ui4");class iu extends Vr{_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,r,y,U,R,j,X,Q,se,W,ee,ne,K){const te=this.length;return this.resize(te+1),this.emplace(te,e,r,y,U,R,j,X,Q,se,W,ee,ne,K)}emplace(e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te){const ae=20*e,ue=10*e;
vendor: 13,223 bytes, line 273
273return this.int16[ae+0]=r,this.int16[ae+1]=y,this.int16[ae+2]=U,this.int16[ae+3]=R,this.int16[ae+4]=j,this.float32[ue+3]=X,this.float32[ue+4]=Q,this.float32[ue+5]=se,this.float32[ue+6]=W,this.int16[ae+14]=ee,this.uint32[ue+8]=ne,this.uint16[ae+18]=K,this.uint16[ae+19]=te,e}}iu.prototype.bytesPerElement=40,Ti(iu,"StructArrayLayout5i4f1i1ul2ui40");class Pc extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j,X){const Q=this.length;return this.resize(Q+1),this.emplace(Q,e,r,y,U,R,j,X)}emplace(e,r,y,U,R,j,X,Q){const se=8*e;return this.int16[se+0]=r,this.int16[se+1]=y,this.int16[se+2]=U,this.int16[se+4]=R,this.int16[se+5]=j,this.int16[se+6]=X,this.int16[se+7]=Q,e}}Pc.prototype.bytesPerElement=16,Ti(Pc,"StructArrayLayout3i2i2i16");class ru extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R){const j=this.length;return this.resize(j+1),this.emplace(j,e,r,y,U,R)}emplace(e,r,y,U,R,j){const X=4*e,Q=8*e;return this.float32[X+0]=r,this.float32[X+1]=y,this.float32[X+2]=U,this.int16[Q+6]=R,this.int16[Q+7]=j,e}}ru.prototype.bytesPerElement=16,Ti(ru,"StructArrayLayout2f1f2i16");class nu extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j){const X=this.length;return this.resize(X+1),this.emplace(X,e,r,y,U,R,j)}emplace(e,r,y,U,R,j,X){const Q=20*e,se=5*e;return this.uint8[Q+0]=r,this.uint8[Q+1]=y,this.float32[se+1]=U,this.float32[se+2]=R,this.float32[se+3]=j,this.float32[se+4]=X,e}}nu.prototype.bytesPerElement=20,Ti(nu,"StructArrayLayout2ub4f20");class On extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,y){const U=this.length;return this.resize(U+1),this.emplace(U,e,r,y)}emplace(e,r,y,U){const R=3*e;return this.uint16[R+0]=r,this.uint16[R+1]=y,this.uint16[R+2]=U,e}}On.prototype.bytesPerElement=6,Ti(On,"StructArrayLayout3ui6");class su extends Vr{_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,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue,de,xe,we,me,Me){const ke=this.length;return this.resize(ke+1),this.emplace(ke,e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue,de,xe,we,me,Me)}emplace(e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue,de,xe,we,me,Me,ke){const Be=30*e,He=15*e,$e=60*e;return this.int16[Be+0]=r,this.int16[Be+1]=y,this.int16[Be+2]=U,this.float32[He+2]=R,this.float32[He+3]=j,this.uint16[Be+8]=X,this.uint16[Be+9]=Q,this.uint32[He+5]=se,this.uint32[He+6]=W,this.uint32[He+7]=ee,this.uint16[Be+16]=ne,this.uint16[Be+17]=K,this.uint16[Be+18]=te,this.float32[He+10]=ae,this.float32[He+11]=ue,this.uint8[$e+48]=de,this.uint8[$e+49]=xe,this.uint8[$e+50]=we,this.uint32[He+13]=me,this.int16[Be+28]=Me,this.uint8[$e+58]=ke,e}}su.prototype.bytesPerElement=60,Ti(su,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class au extends Vr{_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,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue,de,xe,we,me,Me,ke,Be,He,$e,qe,st,We,ct,ft,dt,_t){const Tt=this.length;return this.resize(Tt+1),this.emplace(Tt,e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue,de,xe,we,me,Me,ke,Be,He,$e,qe,st,We,ct,ft,dt,_t)}emplace(e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue,de,xe,we,me,Me,ke,Be,He,$e,qe,st,We,ct,ft,dt,_t,Tt){const Ct=20*e,vt=40*e,qt=80*e;return this.float32[Ct+0]=r,this.float32[Ct+1]=y,this.int16[vt+4]=U,this.int16[vt+5]=R,this.int16[vt+6]=j,this.int16[vt+7]=X,this.int16[vt+8]=Q,this.int16[vt+9]=se,this.int16[vt+10]=W,this.int16[vt+11]=ee,this.int16[vt+12]=ne,this.uint16[vt+13]=K,this.uint16[vt+14]=te,this.uint16[vt+15]=ae,this.uint16[vt+16]=ue,this.uint16[vt+17]=de,this.uint16[vt+18]=xe,this.uint16[vt+19]=we,this.uint16[vt+20]=me,this.uint16[vt+21]=Me,this.uint16[vt+22]=ke,this.uint16[vt+23]=Be,this.uint16[vt+24]=He,this.uint16[vt+25]=$e,this.uint16[vt+26]=qe,this.uint16[vt+27]=st,this.uint32[Ct+14]=We,this.float32[Ct+15]=ct,this.float32[Ct+16]=ft,this.float32[Ct+17]=dt,this.float32[Ct+18]=_t,this.uint8[qt+76]=Tt,e}}au.prototype.bytesPerElement=80,Ti(au,"StructArrayLayout2f9i15ui1ul4f1ub80");class Tl extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}Tl.prototype.bytesPerElement=4,Ti(Tl,"StructArrayLayout1f4");class Da extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R){const j=this.length;return this.resize(j+1),this.emplace(j,e,r,y,U,R)}emplace(e,r,y,U,R,j){const X=5*e;return this.float32[X+0]=r,this.float32[X+1]=y,this.float32[X+2]=U,this.float32[X+3]=R,this.float32[X+4]=j,e}}Da.prototype.bytesPerElement=20,Ti(Da,"StructArrayLayout5f20");class Cc extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j,X){const Q=this.length;return this.resize(Q+1),this.emplace(Q,e,r,y,U,R,j,X)}emplace(e,r,y,U,R,j,X,Q){const se=7*e;return this.float32[se+0]=r,this.float32[se+1]=y,this.float32[se+2]=U,this.float32[se+3]=R,this.float32[se+4]=j,this.float32[se+5]=X,this.float32[se+6]=Q,e}}Cc.prototype.bytesPerElement=28,Ti(Cc,"StructArrayLayout7f28");class Xs extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j,X,Q,se,W,ee){const ne=this.length;return this.resize(ne+1),this.emplace(ne,e,r,y,U,R,j,X,Q,se,W,ee)}emplace(e,r,y,U,R,j,X,Q,se,W,ee,ne){const K=11*e;return this.float32[K+0]=r,this.float32[K+1]=y,this.float32[K+2]=U,this.float32[K+3]=R,this.float32[K+4]=j,this.float32[K+5]=X,this.float32[K+6]=Q,this.float32[K+7]=se,this.float32[K+8]=W,this.float32[K+9]=ee,this.float32[K+10]=ne,e}}Xs.prototype.bytesPerElement=44,Ti(Xs,"StructArrayLayout11f44");class Ic extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j,X,Q,se){const W=this.length;return this.resize(W+1),this.emplace(W,e,r,y,U,R,j,X,Q,se)}emplace(e,r,y,U,R,j,X,Q,se,W){const ee=9*e;return this.float32[ee+0]=r,this.float32[ee+1]=y,this.float32[ee+2]=U,this.float32[ee+3]=R,this.float32[ee+4]=j,this.float32[ee+5]=X,this.float32[ee+6]=Q,this.float32[ee+7]=se,this.float32[ee+8]=W,e}}Ic.prototype.bytesPerElement=36,Ti(Ic,"StructArrayLayout9f36");class Io extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const y=this.length;return this.resize(y+1),this.emplace(y,e,r)}emplace(e,r,y){const U=2*e;return this.float32[U+0]=r,this.float32[U+1]=y,e}}Io.prototype.bytesPerElement=8,Ti(Io,"StructArrayLayout2f8");class ou extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,y,U){const R=this.length;return this.resize(R+1),this.emplace(R,e,r,y,U)}emplace(e,r,y,U,R){const j=6*e;return this.uint32[3*e+0]=r,this.uint16[j+2]=y,this.uint16[j+3]=U,this.uint16[j+4]=R,e}}ou.prototype.bytesPerElement=12,Ti(ou,"StructArrayLayout1ul3ui12");class lu extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}lu.prototype.bytesPerElement=2,Ti(lu,"StructArrayLayout1ui2");class El extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue){const de=this.length;return this.resize(de+1),this.emplace(de,e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue)}emplace(e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue,de){const xe=16*e;return this.float32[xe+0]=r,this.float32[xe+1]=y,this.float32[xe+2]=U,this.float32[xe+3]=R,this.float32[xe+4]=j,this.float32[xe+5]=X,this.float32[xe+6]=Q,this.float32[xe+7]=se,this.float32[xe+8]=W,this.float32[xe+9]=ee,this.float32[xe+10]=ne,this.float32[xe+11]=K,this.float32[xe+12]=te,this.float32[xe+13]=ae,this.float32[xe+14]=ue,this.float32[xe+15]=de,e}}El.prototype.bytesPerElement=64,Ti(El,"StructArrayLayout16f64");class Al extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,y,U,R,j,X){const Q=this.length;return this.resize(Q+1),this.emplace(Q,e,r,y,U,R,j,X)}emplace(e,r,y,U,R,j,X,Q){const se=10*e,W=5*e;return this.uint16[se+0]=r,this.uint16[se+1]=y,this.uint16[se+2]=U,this.uint16[se+3]=R,this.float32[W+2]=j,this.float32[W+3]=X,this.float32[W+4]=Q,e}}Al.prototype.bytesPerElement=20,Ti(Al,"StructArrayLayout4ui3f20");class cu extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.int16[1*e+0]=r,e}}cu.prototype.bytesPerElement=2,Ti(cu,"StructArrayLayout1i2");class Dc extends Vr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint8[1*e+0]=r,e}}Dc.prototype.bytesPerElement=1,Ti(Dc,"StructArrayLayout1ub1");class Cd extends bl{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]}}Cd.prototype.size=40;class hu extends iu{get(e){return new Cd(this,e)}}Ti(hu,"CollisionBoxArray");class Ml extends bl{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}}Ml.prototype.size=60;class Id extends su{get(e){return new Ml(this,e)}}Ti(Id,"PlacedSymbolArray");class Dd extends bl{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: 4,354 bytes, line 273
273get 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]}}Dd.prototype.size=80;class kd extends au{get(e){return new Dd(this,e)}}Ti(kd,"SymbolInstanceArray");class Rd extends Tl{getoffsetX(e){return this.float32[1*e+0]}}Ti(Rd,"GlyphOffsetArray");class zd extends da{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Ti(zd,"SymbolLineVertexArray");class Pl extends bl{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]}}Pl.prototype.size=12;class Cl extends ou{get(e){return new Pl(this,e)}}Ti(Cl,"FeatureIndexArray");class ps extends Ia{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Ti(ps,"FillExtrusionCentroidArray");class Il extends bl{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]}}Il.prototype.size=6;class Ld extends Co{get(e){return new Il(this,e)}}Ti(Ld,"FillExtrusionWallArray");const of=Tr([{name:"a_pos",components:2,type:"Int16"}],4),lf=Tr([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class an{constructor(e=[]){this.segments=e}_prepareSegment(e,r,y,U){let R=this.segments[this.segments.length-1];return e>an.MAX_VERTEX_ARRAY_LENGTH&&zi(`Max vertices per segment is ${an.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!R||R.vertexLength+e>an.MAX_VERTEX_ARRAY_LENGTH||R.sortKey!==U)&&(R={vertexOffset:r,primitiveOffset:y,vertexLength:0,primitiveLength:0},U!==void 0&&(R.sortKey=U),this.segments.push(R)),R}prepareSegment(e,r,y,U){return this._prepareSegment(e,r.length,y.length,U)}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,y,U){return new an([{vertexOffset:e,primitiveOffset:r,vertexLength:y,primitiveLength:U,vaos:{},sortKey:0}])}}function kc(h,e){return 256*(h=Ue(Math.floor(h),0,255))+Ue(Math.floor(e),0,255)}an.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ti(an,"SegmentVector");const cf=Tr([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),uu=Tr([{name:"a_dash",components:4,type:"Uint16"}]);class Dl{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}
273add(e,r,y,U){this.ids.push(Fd(e)),this.positions.push(r,y,U)}eachPosition(e,r){const y=Fd(e);let U=0,R=this.ids.length-1;for(;U<R;){const j=U+R>>1;this.ids[j]>=y?R=j:U=j+1}for(;this.ids[U]===y;)r(this.positions[3*U],this.positions[3*U+1],this.positions[3*U+2]),U++}static serialize(e,r){const y=new Float64Array(e.ids),U=new Uint32Array(e.positions);return kl(y,U,0,y.length-1),r&&(r.add(y.buffer),r.add(U.buffer)),{ids:y,positions:U}}static deserialize(e){const r=new Dl;let y;r.ids=e.ids,r.positions=e.positions;for(const U of r.ids)U!==y&&r.uniqueIds.push(U),y=U;return r.indexed=!0,r}}function Fd(h){const e=+h;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:Rs(String(h))}function kl(h,e,r,y){for(;r<y;){const U=h[r+y>>1];let R=r-1,j=y+1;for(;;){do R++;while(h[R]<U);do j--;while(h[j]>U);if(R>=j)break;Rc(h,R,j),Rc(e,3*R,3*j),Rc(e,3*R+1,3*j+1),Rc(e,3*R+2,3*j+2)}j-r<y-j?(kl(h,e,r,j),r=j+1):(kl(h,e,j+1,y),y=j)}}function Rc(h,e,r){const y=h[e];h[e]=h[r],h[r]=y}Ti(Dl,"FeaturePositionMap");class Ys{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,r){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,r),this.initialized=!0),!!this.location}set(e,r,y){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class Rl extends Ys{constructor(e){super(e),this.current=0}set(e,r,y){this.fetchUniformLocation(e,r)&&this.current!==y&&(this.current=y,this.gl.uniform1i(this.location,y))}}class cn extends Ys{constructor(e){super(e),this.current=0}set(e,r,y){this.fetchUniformLocation(e,r)&&this.current!==y&&(this.current=y,this.gl.uniform1f(this.location,y))}}class Ps extends Ys{constructor(e){super(e),this.current=[0,0]}set(e,r,y){this.fetchUniformLocation(e,r)&&(y[0]===this.current[0]&&y[1]===this.current[1]||(this.current=y,this.gl.uniform2f(this.location,y[0],y[1])))}}class Do extends Ys{constructor(e){super(e),this.current=[0,0,0]}set(e,r,y){this.fetchUniformLocation(e,r)&&(y[0]===this.current[0]&&y[1]===this.current[1]&&y[2]===this.current[2]||(this.current=y,this.gl.uniform3f(this.location,y[0],y[1],y[2])))}}class zl extends Ys{constructor(e){super(e),this.current=[0,0,0,0]}set(e,r,y){this.fetchUniformLocation(e,r)&&(y[0]===this.current[0]&&y[1]===this.current[1]&&y[2]===this.current[2]&&y[3]===this.current[3]||(this.current=y,this.gl.uniform4f(this.location,y[0],y[1],y[2],y[3])))}}class Od extends Ys{constructor(e){super(e),this.current=Sr.transparent.toRenderColor(null)}set(e,r,y){this.fetchUniformLocation(e,r)&&(y.r===this.current.r&&y.g===this.current.g&&y.b===this.current.b&&y.a===this.current.a||(this.current=y,this.gl.uniform4f(this.location,y.r,y.g,y.b,y.a)))}}const Bd=new Float32Array(16);class Ll extends Ys{constructor(e){super(e),this.current=Bd}set(e,r,y){if(this.fetchUniformLocation(e,r)){if(y[12]!==this.current[12]||y[0]!==this.current[0])return this.current=y,void this.gl.uniformMatrix4fv(this.location,!1,y);for(let U=1;U<16;U++)if(y[U]!==this.current[U]){this.current=y,this.gl.uniformMatrix4fv(this.location,!1,y);break}}}}const du=new Float32Array(9),hf=new Float32Array(4);class pu extends Ys{constructor(e){super(e),this.current=hf}set(e,r,y){if(this.fetchUniformLocation(e,r)){for(let U=0;U<4;U++)if(y[U]!==this.current[U]){this.current=y,this.gl.uniformMatrix2fv(this.location,!1,y);break}}}}function fu(h){return[kc(255*h.r,255*h.g),kc(255*h.b,255*h.a)]}class io{constructor(e,r,y,U){this.value=e,this.uniformNames=r.map(R=>`u_${R}`),this.type=y,this.context=U}setUniform(e,r,y,U,R){const j=U.constantOr(this.value);r.set(e,R,j instanceof Sr?j.toRenderColor(this.ignoreLut?null:this.context.lut):j)}getBinding(e,r){return this.type==="color"?new Od(e):new cn(e)}}class ro{constructor(e,r){this.uniformNames=r.map(y=>`u_${y}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,r,y,U,R){const j=R==="u_pattern"||R==="u_dash"?this.pattern:R==="u_pixel_ratio"?this.pixelRatio:null;j&&r.set(e,R,j)}getBinding(e,r){return r==="u_pattern"||r==="u_dash"?new zl(e):new cn(e)}}class fa{constructor(e,r,y,U){this.expression=e,this.type=y,this.maxValue=0,this.paintVertexAttributes=r.map(R=>({name:`a_${R}`,type:"Float32",components:y==="color"?2:1,offset:0})),this.paintVertexArray=new U}populatePaintArray(e,r,y,U,R,j,X){const Q=this.paintVertexArray.length,se=this.expression.kind==="composite"||this.expression.kind==="source"?this.expression.evaluate(new Nr(0,{brightness:j}),r,{},R,U,X):this.expression.kind==="constant"&&this.expression.value;!this.lutExpression||this.lutExpression.kind!=="composite"&&this.lutExpression.kind!=="source"||(this.ignoreLut=this.lutExpression.evaluate(new Nr(0,{brightness:j}),r,{},R,U,X)==="none"),this.paintVertexArray.resize(e),this._setPaintValue(Q,e,se,this.context)}updatePaintArray(e,r,y,U,R,j,X){const Q=this.expression.kind==="composite"||this.expression.kind==="source"?this.expression.evaluate({zoom:0,brightness:X},y,U,void 0,R):this.expression.kind==="constant"&&this.expression.value;!this.lutExpression||this.lutExpression.kind!=="composite"&&this.lutExpression.kind!=="source"||(this.ignoreLut=this.lutExpression.evaluate({zoom:0,brightness:X},y,U,void 0,R)==="none"),this._setPaintValue(e,r,Q,this.context)}
273_setPaintValue(e,r,y,U){if(this.type==="color"){const R=fu(y.toRenderColor(this.ignoreLut?null:U.lut));for(let j=e;j<r;j++)this.paintVertexArray.emplace(j,R[0],R[1])}else{for(let R=e;R<r;R++)this.paintVertexArray.emplace(R,y);this.maxValue=Math.max(this.maxValue,Math.abs(y))}}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&&this.lutExpression.kind!=="constant"&&(this.lutExpression.isStateDependent||!this.lutExpression.isLightConstant)||this.expression.kind!=="constant"&&(this.expression.isStateDependent||!this.expression.isLightConstant)))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Fs{constructor(e,r,y,U,R,j){this.expression=e,this.uniformNames=r.map(X=>`u_${X}_t`),this.type=y,this.useIntegerZoom=U,this.context=R,this.maxValue=0,this.paintVertexAttributes=r.map(X=>({name:`a_${X}`,type:"Float32",components:y==="color"?4:2,offset:0})),this.paintVertexArray=new j}populatePaintArray(e,r,y,U,R,j,X){const Q=this.expression.evaluate(new Nr(this.context.zoom,{brightness:j}),r,{},R,U,X),se=this.expression.evaluate(new Nr(this.context.zoom+1,{brightness:j}),r,{},R,U,X);!this.lutExpression||this.lutExpression.kind!=="composite"&&this.lutExpression.kind!=="source"||(this.ignoreLut=this.lutExpression.evaluate(new Nr(this.context.zoom,{brightness:j}),r,{},R,U,X)==="none");const W=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(W,e,Q,se,this.context)}updatePaintArray(e,r,y,U,R,j,X){const Q=this.expression.evaluate({zoom:this.context.zoom,brightness:X},y,U,void 0,R),se=this.expression.evaluate({zoom:this.context.zoom+1,brightness:X},y,U,void 0,R);!this.lutExpression||this.lutExpression.kind!=="composite"&&this.lutExpression.kind!=="source"||(this.ignoreLut=this.lutExpression.evaluate({zoom:this.context.zoom,brightness:X},y,U,void 0,R)==="none"),this._setPaintValue(e,r,Q,se,this.context)}_setPaintValue(e,r,y,U,R){if(this.type==="color"){const j=fu(y.toRenderColor(this.ignoreLut?null:R.lut)),X=fu(y.toRenderColor(this.ignoreLut?null:R.lut));for(let Q=e;Q<r;Q++)this.paintVertexArray.emplace(Q,j[0],j[1],X[0],X[1])}else{for(let j=e;j<r;j++)this.paintVertexArray.emplace(j,y,U);this.maxValue=Math.max(this.maxValue,Math.abs(y),Math.abs(U))}}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,r,y,U,R){const j=this.useIntegerZoom?Math.floor(y.zoom):y.zoom,X=Ue(this.expression.interpolationFactor(j,this.context.zoom,this.context.zoom+1),0,1);r.set(e,R,X)}getBinding(e,r){return new cn(e)}}class ka{constructor(e,r,y,U,R){this.expression=e,this.layerId=R,this.paintVertexAttributes=(y==="array"?uu:cf).members;for(let j=0;j<r.length;++j);this.paintVertexArray=new U}populatePaintArray(e,r,y,U){const R=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(R,e,r.patterns&&r.patterns[this.layerId],y)}updatePaintArray(e,r,y,U,R,j,X){this._setPaintValues(e,r,y.patterns&&y.patterns[this.layerId],j)}_setPaintValues(e,r,y,U){if(!U||!y)return;const R=U[y];if(!R)return;const{tl:j,br:X,pixelRatio:Q}=R;for(let se=e;se<r;se++)this.paintVertexArray.emplace(se,j[0],j[1],X[0],X[1],Q)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class no{constructor(e,r,y=()=>!0){this.binders={},this._buffers=[],this.context=r;const U=[];for(const R in e.paint._values){const j=e.paint.get(R),X=e.paint.get(`${R}-use-theme`);if(R.endsWith("-use-theme")||!y(R)||!(j instanceof Eo&&dl(j.property.specification)))continue;const Q=df(R,e.type),se=j.value,W=j.property.specification.type,ee=!!j.property.useIntegerZoom,ne=R==="line-dasharray"||R.endsWith("pattern"),K=R==="line-dasharray"&&e.layout.get("line-cap").value.kind!=="constant"||X&&X.value.kind!=="constant";if(se.kind!=="constant"||K)if(se.kind==="source"||K||ne){const te=Nd(R,W,"source");this.binders[R]=ne?new ka(se,Q,W,te,e.id):new fa(se,Q,W,te),U.push(`/a_${R}`)}else{const te=Nd(R,W,"composite");this.binders[R]=new Fs(se,Q,W,ee,r,te),U.push(`/z_${R}`)}else this.binders[R]=ne?new ro(se.value,Q):new io(se.value,Q,W,r),U.push(`/u_${R}`);X&&(this.binders[R].ignoreLut=X.constantOr("default")==="none",this.binders[R].lutExpression=X.value,this.binders[R].checkUseTheme=!0)}this.cacheKey=U.sort().join("")}getMaxValue(e){const r=this.binders[e];return r instanceof fa||r instanceof Fs?r.maxValue:0}populatePaintArrays(e,r,y,U,R,j,X){for(const Q in this.binders){const se=this.binders[Q];se.context=this.context,se instanceof fa||se instanceof Fs||se instanceof ka?se.populatePaintArray(e,r,y,U,R,j,X):se.lutExpression&&se instanceof io&&se.lutExpression&&(se.lutExpression.kind==="composite"||se.lutExpression.kind==="source")&&(se.ignoreLut=se.lutExpression.evaluate(new Nr(0,{brightness:j}),r,{},R,U,X)==="none")}}setConstantPatternPositions(e){for(const r in this.binders){const y=this.binders[r];y instanceof ro&&y.setConstantPatternPositions(e)}}updatePaintArrays(e,r,y,U,R,j,X,Q,se){let W=!1;const ee=Object.keys(e),ne=ee.length!==0&&!Q,K=ne?ee:r.uniqueIds;this.context.lut=R.lut;for(const te in this.binders){const ae=this.binders[te];if(ae.context=this.context,(ae instanceof fa||ae instanceof Fs||ae instanceof ka)&&ae.expression&&ae.expression.kind&&ae.expression.kind!=="constant"&&(ae.expression.isStateDependent===!0||ae.expression.isLightConstant===!1)){const ue=R.paint.get(te);ae.expression=ue.value;for(const de of K){const xe=e[de.toString()];r.eachPosition(de,(we,me,Me)=>{const ke=U.feature(we);ae.updatePaintArray(me,Me,ke,xe,j,X,se)})}if(!ne)for(const de of y.uniqueIds){const xe=e[de.toString()];y.eachPosition(de,(we,me,Me)=>{const ke=U.feature(we);ae.updatePaintArray(me,Me,ke,xe,j,X,se)})}W=!0}}return W}
273defines(){const e=[];for(const r in this.binders){const y=this.binders[r];(y instanceof io||y instanceof ro)&&e.push(...y.uniformNames.map(U=>`#define HAS_UNIFORM_${U}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const y=this.binders[r];if(y instanceof fa||y instanceof Fs||y instanceof ka)for(let U=0;U<y.paintVertexAttributes.length;U++)e.push(y.paintVertexAttributes[U].name)}return e}getBinderUniforms(){const e=[];for(const r in this.binders){const y=this.binders[r];if(y instanceof io||y instanceof ro||y instanceof Fs)for(const U of y.uniformNames)e.push(U)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const r=[];for(const y in this.binders){const U=this.binders[y];if(U instanceof io||U instanceof ro||U instanceof Fs)for(const R of U.uniformNames)r.push({name:R,property:y,binding:U.getBinding(e,R)})}return r}setUniforms(e,r,y,U,R){for(const{name:j,property:X,binding:Q}of y){if(this.binders[X].checkUseTheme&&this.binders[X]instanceof io){const se=U.get(`${X}-use-theme`);se.isConstant()&&(this.binders[X].ignoreLut=se.constantOr("default")==="none")}this.binders[X].setUniform(e,Q,R,U.get(X),j)}}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const r=this.binders[e];(r instanceof fa||r instanceof Fs||r instanceof ka)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(const r in this.binders){const y=this.binders[r];(y instanceof fa||y instanceof Fs||y instanceof ka)&&y.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const r=this.binders[e];(r instanceof fa||r instanceof Fs||r instanceof ka)&&r.destroy()}}}class Ra{constructor(e,r,y=()=>!0){this.programConfigurations={};for(const U of e)this.programConfigurations[U.id]=new no(U,r,y);this.needsUpload=!1,this._featureMap=new Dl,this._featureMapWithoutIds=new Dl,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,r,y,U,R,j,X,Q){for(const se in this.programConfigurations)this.programConfigurations[se].populatePaintArrays(e,r,U,R,j,X,Q);r.id!==void 0?this._featureMap.add(r.id,y,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,y,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,y,U,R,j,X){for(const Q of y)this.needsUpload=this.programConfigurations[Q.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,r,Q,U,R,j,X||0)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const uf={"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":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function df(h,e){return uf[h]||[h.replace(`${e}-`,"").replace(/-/g,"_")]}const pf={"line-pattern":{source:Wn,composite:Wn},"fill-pattern":{source:Wn,composite:Wn},"fill-extrusion-pattern":{source:Wn,composite:Wn},"line-dasharray":{source:Mc,composite:Mc}},zc={color:{source:Io,composite:to},number:{source:Tl,composite:Io}};function Nd(h,e,r){const y=pf[h];return y&&y[r]||zc[e][r]}Ti(io,"ConstantBinder"),Ti(ro,"PatternConstantBinder"),Ti(fa,"SourceExpressionBinder"),Ti(ka,"PatternCompositeBinder"),Ti(Fs,"CompositeExpressionBinder"),Ti(no,"ProgramConfiguration",{omit:["_buffers"]}),Ti(Ra,"ProgramConfigurationSet");const rs=gi/Math.PI/2,ko=5,Vd=6,Ud=16383,Ro=64,Lc=[Ro,32,16],ys=-rs,vs=rs;
vendor: 15,885 bytes, line 273
273function zo(h,e,r,y=rs){return r=Xi(r),[h*Math.sin(r)*y,-e*y,h*Math.cos(r)*y]}function so(h,e,r){return zo(Math.cos(Xi(h)),Math.sin(Xi(h)),e,r)}const ao=63710088e-1,mu=2*Math.PI*ao;class _r{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new _r(It(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,y=this.lat*r,U=e.lat*r,R=Math.sin(y)*Math.sin(U)+Math.cos(y)*Math.cos(U)*Math.cos((e.lng-this.lng)*r);return ao*Math.acos(Math.min(R,1))}toBounds(e=0){const r=360*e/40075017,y=r/Math.cos(Math.PI/180*this.lat);return new za({lng:this.lng-y,lat:this.lat-r},{lng:this.lng+y,lat:this.lat+r})}toEcef(e){return so(this.lat,this.lng,rs+e*rs/ao)}static convert(e){if(e instanceof _r)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new _r(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new _r(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 za{constructor(e,r){if(e)if(r)this.setSouthWest(e).setNorthEast(r);else if(e.length===4){const y=e;this.setSouthWest([y[0],y[1]]).setNorthEast([y[2],y[3]])}else{const y=e;this.setSouthWest(y[0]).setNorthEast(y[1])}}setNorthEast(e){return this._ne=e instanceof _r?new _r(e.lng,e.lat):_r.convert(e),this}setSouthWest(e){return this._sw=e instanceof _r?new _r(e.lng,e.lat):_r.convert(e),this}extend(e){const r=this._sw,y=this._ne;let U,R;if(e instanceof _r)U=e,R=e;else{if(!(e instanceof za))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(za.convert(e)):this.extend(_r.convert(e)):typeof e=="object"&&e!==null&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(_r.convert(e)):this;if(U=e._sw,R=e._ne,!U||!R)return this}return r||y?(r.lng=Math.min(U.lng,r.lng),r.lat=Math.min(U.lat,r.lat),y.lng=Math.max(R.lng,y.lng),y.lat=Math.max(R.lat,y.lat)):(this._sw=new _r(U.lng,U.lat),this._ne=new _r(R.lng,R.lat)),this}getCenter(){return new _r((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new _r(this.getWest(),this.getNorth())}getSouthEast(){return new _r(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:r,lat:y}=_r.convert(e);let U=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(U=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=y&&y<=this._ne.lat&&U}static convert(e){if(e)return e instanceof za?e:new za(e)}}const ff=0,mf=25.5;function Fc(h){return mu*Math.cos(h*Math.PI/180)}function Js(h){return(180+h)/360}function Os(h){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+h*Math.PI/360)))/360}function ns(h,e){return h/Fc(e)}function fs(h){return 360*h-180}function Bn(h){return 360/Math.PI*Math.atan(Math.exp((180-360*h)*Math.PI/180))-90}function jd(h,e){return h*Fc(Bn(e))}const cs=85.051129;function gu(h){return Math.cos(Xi(Ue(h,-85.051129,cs)))}function Lo(h,e){const r=Ue(e,ff,mf),y=Math.pow(2,r);return gu(h)*mu/(512*y)}function F(h){return 1/Math.cos(h*Math.PI/180)}function t(h,e=0){const r=Math.exp(Math.PI*(1-(h.y+e/gi)/(1<<h.z)*2));return 80150034*r/(r*r+1)/gi/(1<<h.z)}class l{constructor(e,r,y=0){this.x=+e,this.y=+r,this.z=+y}static fromLngLat(e,r=0){const y=_r.convert(e);return new l(Js(y.lng),Os(y.lat),ns(r,y.lat))}toLngLat(){return new _r(fs(this.x),Bn(this.y))}toAltitude(){return jd(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/mu*F(Bn(this.y))}}function B(h,e,r,y,U,R,j,X,Q){const se=(e+y)/2,W=(r+U)/2,ee=new Ht(se,W);X(ee),function(ne,K,te,ae,ue,de){const xe=te-ue,we=ae-de;return Math.abs((ae-K)*xe-(te-ne)*we)/Math.hypot(xe,we)}(ee.x,ee.y,R.x,R.y,j.x,j.y)>=Q?(B(h,e,r,se,W,R,ee,X,Q),B(h,se,W,y,U,ee,j,X,Q)):h.push(j)}function G(h,e,r){let y=h[0],U=y.x,R=y.y;e(y);const j=[y];for(let X=1;X<h.length;X++){const Q=h[X],{x:se,y:W}=Q;e(Q),B(j,U,R,se,W,y,Q,e,r),U=se,R=W,y=Q}return j}function Z(h,e,r,y){if(y(e,r)){const U=e.add(r)._mult(.5);Z(h,e,U,y),Z(h,U,r,y)}else h.push(r)}function Y(h,e){let r=h[0];const y=[r];for(let U=1;U<h.length;U++){const R=h[U];Z(y,r,R,e),r=R}return y}const re=Math.pow(2,14)-1,oe=-re-1;function ce(h,e){const r=Math.round(h.x*e),y=Math.round(h.y*e);return h.x=Ue(r,oe,re),h.y=Ue(y,oe,re),(r<h.x||r>h.x+1||y<h.y||y>h.y+1)&&zi("Geometry exceeds allowed extent, reduce your vector tile buffer size"),h}function he(h,e,r){const y=h.loadGeometry(),U=h.extent,R=gi/U;if(e&&r&&r.projection.isReprojectedInTileSpace){const j=1<<e.z,{scale:X,x:Q,y:se,projection:W}=r,ee=ne=>{const K=fs((e.x+ne.x/U)/j),te=Bn((e.y+ne.y/U)/j),ae=W.project(K,te);ne.x=(ae.x*X-Q)*U,ne.y=(ae.y*X-se)*U};for(let ne=0;ne<y.length;ne++)if(h.type!==1)y[ne]=G(y[ne],ee,1);else{const K=[];for(const te of y[ne])te.x<0||te.x>=U||te.y<0||te.y>=U||(ee(te),K.push(te));y[ne]=K}}for(const j of y)for(const X of j)ce(X,R);return y}function pe(h,e){return{type:h.type,id:h.id,properties:h.properties,geometry:e?he(h):[]}}function fe(h,e,r,y,U){h.emplaceBack(2*e+(y+1)/2,2*r+(U+1)/2)}function be(h,e,r){h.emplaceBack(e.x,e.y,e.z,r[0]*16384,r[1]*16384,r[2]*16384)}class ze{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.fqid),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new da,this.indexArray=new On,this.segments=new an,this.programConfigurations=new Ra(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}updateFootprints(e,r){}populate(e,r,y,U){const R=this.layers[0],j=[];let X=null;R.type==="circle"&&(X=R.layout.get("circle-sort-key"));for(const{feature:se,id:W,index:ee,sourceLayerIndex:ne}of e){const K=this.layers[0]._featureFilter.needGeometry,te=pe(se,K);if(!this.layers[0]._featureFilter.filter(new Nr(this.zoom),te,y))continue;const ae=X?X.evaluate(te,{},y):void 0,ue={id:W,properties:se.properties,type:se.type,sourceLayerIndex:ne,index:ee,geometry:K?te.geometry:he(se,y,U),patterns:{},sortKey:ae};j.push(ue)}X&&j.sort((se,W)=>se.sortKey-W.sortKey);let Q=null;U.projection.name==="globe"&&(this.globeExtVertexArray=new Sl,Q=U.projection);for(const se of j){const{geometry:W,index:ee,sourceLayerIndex:ne}=se,K=e[ee].feature;this.addFeature(se,W,ee,r.availableImages,y,Q,r.brightness),r.featureIndex.insert(K,W,ee,ne,this.index)}}update(e,r,y,U,R,j,X){this.programConfigurations.updatePaintArrays(e,r,R,y,U,j,X)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,of.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,lf.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,r,y,U,R,j,X){for(const Q of r)for(const se of Q){const W=se.x,ee=se.y;if(W<0||W>=gi||ee<0||ee>=gi)continue;if(j){const te=j.projectTilePoint(W,ee,R),ae=j.upVector(R,W,ee),ue=this.globeExtVertexArray;be(ue,te,ae),be(ue,te,ae),be(ue,te,ae),be(ue,te,ae)}const ne=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),K=ne.vertexLength;fe(this.layoutVertexArray,W,ee,-1,-1),fe(this.layoutVertexArray,W,ee,1,-1),fe(this.layoutVertexArray,W,ee,1,1),fe(this.layoutVertexArray,W,ee,-1,1),this.indexArray.emplaceBack(K,K+1,K+2),this.indexArray.emplaceBack(K,K+2,K+3),ne.vertexLength+=4,ne.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,y,{},U,R,X)}}function De(h,e){for(let r=0;r<h.length;r++)if(Ke(e,h[r]))return!0;for(let r=0;r<e.length;r++)if(Ke(h,e[r]))return!0;return!!Xe(h,e)}function Oe(h,e,r){return!!Ke(h,e)||!!nt(e,h,r)}function Fe(h,e){if(h.length===1)return it(e,h[0]);for(let r=0;r<e.length;r++){const y=e[r];for(let U=0;U<y.length;U++)if(Ke(h,y[U]))return!0}for(let r=0;r<h.length;r++)if(it(e,h[r]))return!0;for(let r=0;r<e.length;r++)if(Xe(h,e[r]))return!0;return!1}function Ge(h,e,r){if(h.length>1){if(Xe(h,e))return!0;for(let y=0;y<e.length;y++)if(nt(e[y],h,r))return!0}for(let y=0;y<h.length;y++)if(nt(h[y],e,r))return!0;return!1}function Xe(h,e){if(h.length===0||e.length===0)return!1;for(let r=0;r<h.length-1;r++){const y=h[r],U=h[r+1];for(let R=0;R<e.length-1;R++)if(Ze(y,U,e[R],e[R+1]))return!0}return!1}function Ze(h,e,r,y){return vn(h,r,y)!==vn(e,r,y)&&vn(h,e,r)!==vn(h,e,y)}function nt(h,e,r){const y=r*r;if(e.length===1)return h.distSqr(e[0])<y;for(let U=1;U<e.length;U++)if(Qe(h,e[U-1],e[U])<y)return!0;return!1}function Qe(h,e,r){const y=e.distSqr(r);if(y===0)return h.distSqr(e);const U=((h.x-e.x)*(r.x-e.x)+(h.y-e.y)*(r.y-e.y))/y;return h.distSqr(U<0?e:U>1?r:r.sub(e)._mult(U)._add(e))}function it(h,e){let r,y,U,R=!1;for(let j=0;j<h.length;j++){r=h[j];for(let X=0,Q=r.length-1;X<r.length;Q=X++)y=r[X],U=r[Q],y.y>e.y!=U.y>e.y&&e.x<(U.x-y.x)*(e.y-y.y)/(U.y-y.y)+y.x&&(R=!R)}return R}function Ke(h,e){let r=!1;for(let y=0,U=h.length-1;y<h.length;U=y++){const R=h[y],j=h[U];R.y>e.y!=j.y>e.y&&e.x<(j.x-R.x)*(e.y-R.y)/(j.y-R.y)+R.x&&(r=!r)}return r}function ht(h,e,r,y,U){for(const j of h)if(e<=j.x&&r<=j.y&&y>=j.x&&U>=j.y)return!0;const R=[new Ht(e,r),new Ht(e,U),new Ht(y,U),new Ht(y,r)];if(h.length>2){for(const j of R)if(Ke(h,j))return!0}for(let j=0;j<h.length-1;j++)if(yt(h[j],h[j+1],R))return!0;return!1}function yt(h,e,r){const y=r[0],U=r[2];if(h.x<y.x&&e.x<y.x||h.x>U.x&&e.x>U.x||h.y<y.y&&e.y<y.y||h.y>U.y&&e.y>U.y)return!1;const R=vn(h,e,r[0]);return R!==vn(h,e,r[1])||R!==vn(h,e,r[2])||R!==vn(h,e,r[3])}function Nt(h,e,r,y,U,R){let j=e.y-h.y,X=h.x-e.x;if(R=R||0){const Q=j*j+X*X;if(Q===0)return!0;const se=Math.sqrt(Q);j/=se,X/=se}return!((r.x-h.x)*j+(r.y-h.y)*X-R<0||(y.x-h.x)*j+(y.y-h.y)*X-R<0||(U.x-h.x)*j+(U.y-h.y)*X-R<0)}function Dt(h,e,r,y,U,R,j){return!(Nt(h,e,y,U,R,j)||Nt(e,r,y,U,R,j)||Nt(r,h,y,U,R,j)||Nt(y,U,h,e,r,j)||Nt(U,R,h,e,r,j)||Nt(R,y,h,e,r,j))}function Wt(h,e,r){const y=e.paint.get(h).value;return y.kind==="constant"?y.value:r.programConfigurations.get(e.id).getMaxValue(h)}function $t(h){return Math.sqrt(h[0]*h[0]+h[1]*h[1])}function At(h,e,r,y,U){if(!e[0]&&!e[1])return h;const R=Ht.convert(e)._mult(U);r==="viewport"&&R._rotate(-y);const j=[];for(let X=0;X<h.length;X++)j.push(h[X].sub(R));return j}function Vt(h,e,r,y){const U=Ht.convert(h)._mult(y);return e==="viewport"&&U._rotate(-r),U}let ii,Et;Ti(ze,"CircleBucket",{omit:["layers"]});var Jt,Ut={exports:{}},hi=(Jt||(Jt=1,function(h,e){(function(r){function y(R,j,X){var Q=U(256*R,256*(j=Math.pow(2,X)-j-1),X),se=U(256*(R+1),256*(j+1),X);return Q[0]+","+Q[1]+","+se[0]+","+se[1]}function U(R,j,X){var Q=2*Math.PI*6378137/256/Math.pow(2,X);return[R*Q-2*Math.PI*6378137/2,j*Q-2*Math.PI*6378137/2]}r.getURL=function(R,j,X,Q,se,W){return W=W||{},R+"?"+["bbox="+y(X,Q,se),"format="+(W.format||"image/png"),"service="+(W.service||"WMS"),"version="+(W.version||"1.1.1"),"request="+(W.request||"GetMap"),"srs="+(W.srs||"EPSG:3857"),"width="+(W.width||256),"height="+(W.height||256),"layers="+j].join("&")},r.getTileBBox=y,r.getMercCoords=U,Object.defineProperty(r,"__esModule",{value:!0})})(e)}(0,Ut.exports)),Ut.exports);class Qt{constructor(e,r,y){this.z=e,this.x=r,this.y=y,this.key=ci(0,e,e,r,y)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r){const y=hi.getTileBBox(this.x,this.y,this.z),U=function(R,j,X){let Q,se="";for(let W=R;W>0;W--)Q=1<<W-1,se+=(j&Q?1:0)+(X&Q?2:0);return se}(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(r==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",U).replace("{bbox-epsg-3857}",y)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Xt{constructor(e,r){this.wrap=e,this.canonical=r,this.key=ci(e,r.z,r.z,r.x,r.y)}}class ri{constructor(e,r,y,U,R){this.overscaledZ=e,this.wrap=r,this.canonical=new Qt(y,+U,+R),this.key=r===0&&e===y?this.canonical.key:ci(r,e,y,U,R)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const r=this.canonical.z-e;return e>this.canonical.z?new ri(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ri(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r=!0){if(this.overscaledZ===e&&r)return this.key;if(e>this.canonical.z)return ci(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y);{const y=this.canonical.z-e;return ci(this.wrap*+r,e,e,this.canonical.x>>y,this.canonical.y>>y)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new ri(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,y=2*this.canonical.x,U=2*this.canonical.y;return[new ri(r,this.wrap,r,y,U),new ri(r,this.wrap,r,y+1,U),new ri(r,this.wrap,r,y,U+1),new ri(r,this.wrap,r,y+1,U+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 ri(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new ri(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 Xt(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function ci(h,e,r,y,U){const R=1<<Math.min(r,22);let j=R*(U%R)+y%R;return h&&r<22&&(j+=R*R*((h<0?-2*h-1:2*h)%(1<<2*(22-r)))),16*(32*j+r)+(e-r)}const xi=[h=>{let e=h.canonical.x-1,r=h.wrap;return e<0&&(e=(1<<h.canonical.z)-1,r--),new ri(h.overscaledZ,r,h.canonical.z,e,h.canonical.y)},h=>{let e=h.canonical.x+1,r=h.wrap;return e===1<<h.canonical.z&&(e=0,r++),new ri(h.overscaledZ,r,h.canonical.z,e,h.canonical.y)},h=>new ri(h.overscaledZ,h.wrap,h.canonical.z,h.canonical.x,(h.canonical.y===0?1<<h.canonical.z:h.canonical.y)-1),h=>new ri(h.overscaledZ,h.wrap,h.canonical.z,h.canonical.x,h.canonical.y===(1<<h.canonical.z)-1?0:h.canonical.y+1)];Ti(Qt,"CanonicalTileID"),Ti(ri,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const Si=Tr([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Vi}=Si,Ci=Tr([{name:"a_pos_3",components:3,type:"Int16"}]);var Ri=Tr([{name:"a_pos",type:"Int16",components:2}]);class Hi{constructor(e,r){this.pos=e,this.dir=r}intersectsPlane(e,r,y){const U=pt.vec3.dot(r,this.dir);if(Math.abs(U)<1e-6)return!1;const R=((e[0]-this.pos[0])*r[0]+(e[1]-this.pos[1])*r[1]+(e[2]-this.pos[2])*r[2])/U;
273return y[0]=this.pos[0]+this.dir[0]*R,y[1]=this.pos[1]+this.dir[1]*R,y[2]=this.pos[2]+this.dir[2]*R,!0}closestPointOnSphere(e,r,y){if(pt.vec3.equals(this.pos,e)||r===0)return y[0]=y[1]=y[2]=0,!1;const[U,R,j]=this.dir,X=this.pos[0]-e[0],Q=this.pos[1]-e[1],se=this.pos[2]-e[2],W=U*U+R*R+j*j,ee=2*(X*U+Q*R+se*j),ne=ee*ee-4*W*(X*X+Q*Q+se*se-r*r);if(ne<0){const K=Math.max(-ee/2,0),te=X+U*K,ae=Q+R*K,ue=se+j*K,de=Math.hypot(te,ae,ue);return y[0]=te*r/de,y[1]=ae*r/de,y[2]=ue*r/de,!1}{const K=(-ee-Math.sqrt(ne))/(2*W);if(K<0){const te=Math.hypot(X,Q,se);return y[0]=X*r/te,y[1]=Q*r/te,y[2]=se*r/te,!1}return y[0]=X+U*K,y[1]=Q+R*K,y[2]=se+j*K,!0}}}class cr{constructor(e,r,y,U,R){this.TL=e,this.TR=r,this.BR=y,this.BL=U,this.horizon=R}static fromInvProjectionMatrix(e,r,y){const U=[-1,1,1],R=[1,1,1],j=[1,-1,1],X=[-1,-1,1],Q=pt.vec3.transformMat4(U,U,e),se=pt.vec3.transformMat4(R,R,e),W=pt.vec3.transformMat4(j,j,e),ee=pt.vec3.transformMat4(X,X,e);return new cr(Q,se,W,ee,r/y)}}function Cr(h,e,r){let y=1/0,U=-1/0;const R=[];for(const j of h){pt.vec3.sub(R,j,e);const X=pt.vec3.dot(R,r);y=Math.min(y,X),U=Math.max(U,X)}return[y,U]}function Yr(h,e){let r=!0;for(let y=0;y<h.planes.length;y++){const U=h.planes[y];let R=0;for(let j=0;j<e.length;j++)R+=pt.vec3.dot(U,e[j])+U[3]>=0;if(R===0)return 0;R!==e.length&&(r=!1)}return r?2:1}function Ur(h,e){for(const r of h.projections){const y=Cr(e,h.points[0],r.axis);if(r.projection[1]<y[0]||r.projection[0]>y[1])return 0}return 1}function Zi(h,e){let r=0;const y=[0,0,0,0];for(let U=0;U<h.length;U++)y[0]=h[U][0],y[1]=h[U][1],y[2]=h[U][2],y[3]=1,pt.vec4.dot(y,e)>=0&&r++;return r}class fr{constructor(e,r){this.points=e||new Array(8).fill([0,0,0]),this.planes=r||new Array(6).fill([0,0,0,0]),this.bounds=Pi.fromPoints(this.points),this.projections=[],this.frustumEdges=[pt.vec3.sub([],this.points[2],this.points[3]),pt.vec3.sub([],this.points[0],this.points[3]),pt.vec3.sub([],this.points[4],this.points[0]),pt.vec3.sub([],this.points[5],this.points[1]),pt.vec3.sub([],this.points[6],this.points[2]),pt.vec3.sub([],this.points[7],this.points[3])];for(const y of this.frustumEdges){const U=[0,-y[2],y[1]],R=[y[2],0,-y[0]];this.projections.push({axis:U,projection:Cr(this.points,this.points[0],U)}),this.projections.push({axis:R,projection:Cr(this.points,this.points[0],R)})}}static fromInvProjectionMatrix(e,r,y,U){const R=Math.pow(2,y),j=[[-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(se=>{const W=pt.vec4.transformMat4([],se,e),ee=1/W[3]/r*R;return pt.vec4.mul(W,W,[ee,ee,U?1/W[3]:ee,ee])}),X=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(se=>{const W=pt.vec3.sub([],j[se[0]],j[se[1]]),ee=pt.vec3.sub([],j[se[2]],j[se[1]]),ne=pt.vec3.normalize([],pt.vec3.cross([],W,ee)),K=-pt.vec3.dot(ne,j[se[1]]);return ne.concat(K)}),Q=[];for(let se=0;se<j.length;se++)Q.push([j[se][0],j[se][1],j[se][2]]);return new fr(Q,X)}intersectsPrecise(e,r,y){for(let U=0;U<r.length;U++)if(!Zi(e,r[U]))return 0;for(let U=0;U<this.planes.length;U++)if(!Zi(e,this.planes[U]))return 0;for(const U of y)for(const R of this.frustumEdges){const j=pt.vec3.cross([],U,R),X=pt.vec3.length(j);if(X===0)continue;pt.vec3.scale(j,j,1/X);const Q=Cr(this.points,this.points[0],j),se=Cr(e,this.points[0],j);if(Q[0]>se[1]||se[0]>Q[1])return 0}return 1}containsPoint(e){for(const r of this.planes){const y=r[3];if(pt.vec3.dot([r[0],r[1],r[2]],e)+y<0)return!1}return!0}}class Pi{static fromPoints(e){const r=[1/0,1/0,1/0],y=[-1/0,-1/0,-1/0];for(const U of e)pt.vec3.min(r,r,U),pt.vec3.max(y,y,U);return new Pi(r,y)}static fromTileIdAndHeight(e,r,y){const U=1<<e.canonical.z,R=e.canonical.x,j=e.canonical.y;return new Pi([R/U,j/U,r],[(R+1)/U,(j+1)/U,y])}static applyTransform(e,r){const y=e.getCorners();for(let U=0;U<y.length;++U)pt.vec3.transformMat4(y[U],y[U],r);return Pi.fromPoints(y)}static applyTransformFast(e,r){const y=[r[12],r[13],r[14]],U=[...y];for(let R=0;R<3;R++)for(let j=0;j<3;j++){const X=r[4*j+R],Q=X*e.min[j],se=X*e.max[j];y[R]+=Math.min(Q,se),U[R]+=Math.max(Q,se)}return new Pi(y,U)}static projectAabbCorners(e,r){const y=e.getCorners();for(let U=0;U<y.length;++U)pt.vec3.transformMat4(y[U],y[U],r);return y}constructor(e,r){this.min=e,this.max=r,this.center=pt.vec3.scale([],pt.vec3.add([],this.min,this.max),.5)}quadrant(e){const r=[e%2==0,e<2],y=pt.vec3.clone(this.min),U=pt.vec3.clone(this.max);for(let R=0;R<r.length;
vendor: 5,837 bytes, line 273
273R++)y[R]=r[R]?this.min[R]:this.center[R],U[R]=r[R]?this.center[R]:this.max[R];return U[2]=this.max[2],new Pi(y,U)}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,r=this.max;return[[e[0],e[1],e[2]],[r[0],e[1],e[2]],[r[0],r[1],e[2]],[e[0],r[1],e[2]],[e[0],e[1],r[2]],[r[0],e[1],r[2]],[r[0],r[1],r[2]],[e[0],r[1],r[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?Yr(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?Yr(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,r){return r||this.intersects(e)?Ur(e,this.getCorners()):0}intersectsPreciseFlat(e,r){return r||this.intersectsFlat(e)?Ur(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 r=0;r<3;++r)if(this.min[r]>e.max[r]||e.min[r]>this.max[r])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 r=0;r<3;r++)this.min[r]=Math.min(this.min[r],e.min[r]),this.max[r]=Math.max(this.max[r],e.max[r])}encapsulatePoint(e){for(let r=0;r<3;r++)this.min[r]=Math.min(this.min[r],e[r]),this.max[r]=Math.max(this.max[r],e[r])}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 ar(h){return h*rs/ao}Ti(Pi,"Aabb");const br=[new Pi([ys,ys,ys],[vs,vs,vs]),new Pi([ys,ys,ys],[0,0,vs]),new Pi([0,ys,ys],[vs,0,vs]),new Pi([ys,0,ys],[0,vs,vs]),new Pi([0,0,ys],[vs,vs,vs])];function Er(h,e,r,y=!0){const U=pt.vec3.scale([],h._camera.position,h.worldSize),R=[e,r,1,1];pt.vec4.transformMat4(R,R,h.pixelMatrixInverse),pt.vec4.scale(R,R,1/R[3]);const j=pt.vec3.sub([],R,U),X=pt.vec3.normalize([],j),Q=h.globeMatrix,se=[Q[12],Q[13],Q[14]],W=pt.vec3.sub([],se,U),ee=pt.vec3.length(W),ne=pt.vec3.normalize([],W),K=h.worldSize/(2*Math.PI),te=pt.vec3.dot(ne,X),ae=Math.asin(K/ee);if(ae<Math.acos(te)){if(!y)return null;const st=[],We=[];pt.vec3.scale(st,X,ee/te),pt.vec3.normalize(We,pt.vec3.sub(We,st,W)),pt.vec3.normalize(X,pt.vec3.add(X,W,pt.vec3.scale(X,We,Math.tan(ae)*ee)))}const ue=[];new Hi(U,X).closestPointOnSphere(se,K,ue);const de=pt.vec3.normalize([],Ts(Q,0)),xe=pt.vec3.normalize([],Ts(Q,1)),we=pt.vec3.normalize([],Ts(Q,2)),me=pt.vec3.dot(de,ue),Me=pt.vec3.dot(xe,ue),ke=pt.vec3.dot(we,ue),Be=Gr(Math.asin(-Me/K));let He=Gr(Math.atan2(me,ke));He=h.center.lng+function(st,We){const ct=(We-st+180)%360-180;return ct<-180?ct+360:ct}(h.center.lng,He);const $e=Js(He),qe=Ue(Os(Be),0,1);return new l($e,qe)}class Zr{constructor(e,r,y){this.a=pt.vec3.sub([],e,y),this.b=pt.vec3.sub([],r,y),this.center=y;const U=pt.vec3.normalize([],this.a),R=pt.vec3.normalize([],this.b);this.angle=Math.acos(pt.vec3.dot(U,R))}}function Cn(h,e){if(h.angle===0)return null;let r;return r=h.a[e]===0?1/h.angle*.5*Math.PI:1/h.angle*Math.atan(h.b[e]/h.a[e]/Math.sin(h.angle)-1/Math.tan(h.angle)),r<0||r>1?null:function(y,U,R,j){const X=Math.sin(R);return y*(Math.sin((1-j)*R)/X)+U*(Math.sin(j*R)/X)}(h.a[e],h.b[e],h.angle,Ue(r,0,1))+h.center[e]}function xn(h){if(h.z<=1)return br[h.z+2*h.y+h.x];const e=Or(Xr(h));return Pi.fromPoints(e)}function bn(h,e,r){return pt.vec3.scale(h,h,1-r),pt.vec3.scaleAndAdd(h,h,e,r)}function xs(h,e,r){for(const y of h)pt.vec3.transformMat4(y,y,e),pt.vec3.scale(y,y,r)}function Zn(h,e,r,y){const U=e/h.worldSize,R=h.globeMatrix;if(r.z<=1){const $e=xn(r).getCorners();return xs($e,R,U),Pi.fromPoints($e)}const j=Xr(r,y),X=Or(j,rs+ar(h._tileCoverLift));xs(X,R,U);const Q=Number.MAX_VALUE,se=[-Q,-Q,-Q],W=[Q,Q,Q];if(j.contains(h.center)){for(const st of X)pt.vec3.min(W,W,st),pt.vec3.max(se,se,st);se[2]=0;const $e=h.point,qe=[$e.x*U,$e.y*U,0];return pt.vec3.min(W,W,qe),pt.vec3.max(se,se,qe),new Pi(W,se)}if(h._tileCoverLift>0){for(const $e of X)pt.vec3.min(W,W,$e),pt.vec3.max(se,se,$e);return new Pi(W,se)}const ee=[R[12]*U,R[13]*U,R[14]*U],ne=j.getCenter(),K=Ue(h.center.lat,-85.051129,cs),te=Ue(ne.lat,-85.051129,cs),ae=Js(h.center.lng),ue=Os(K);let de=ae-Js(ne.lng);const xe=ue-Os(te);de>.5?de-=1:de<-.5&&(de+=1);let we=0;if(Math.abs(de)>Math.abs(xe))we=de>=0?1:3;else{we=xe>=0?0:2;const $e=[R[4]*U,R[5]*U,R[6]*U],qe=-Math.sin(Xi(xe>=0?j.getSouth():j.getNorth()))*rs;pt.vec3.scaleAndAdd(ee,ee,$e,qe)}const me=X[we],Me=X[(we+1)%4],ke=new Zr(me,Me,ee),Be=[Cn(ke,0)||me[0],Cn(ke,1)||me[1],Cn(ke,2)||me[2]],He=hs(h.zoom);if(He>0){const $e=function({x:st,y:We,z:ct},ft,dt,_t,Tt){const Ct=1/(1<<ct);let vt=st*Ct,qt=vt+Ct,ei=We*Ct,Gt=ei+Ct,yi=0;const mi=(vt+qt)/2-_t;return mi>.5?yi=-1:mi<-.5&&(yi=1),vt=((vt+yi)*ft-(_t*=ft))*dt+_t,qt=((qt+yi)*ft-_t)*dt+_t,ei=(ei*ft-(Tt*=ft))*dt+Tt,Gt=(Gt*ft-Tt)*dt+Tt,[[vt,Gt,0],[qt,Gt,0],[qt,ei,0],[vt,ei,0]]}(r,e,h._pixelsPerMercatorPixel,ae,ue);for(let st=0;st<X.length;st++)bn(X[st],$e[st],He);const qe=pt.vec3.add([],$e[we],$e[(we+1)%4]);pt.vec3.scale(qe,qe,.5),bn(Be,qe,He)}for(const $e of X)pt.vec3.min(W,W,$e),pt.vec3.max(se,se,$e);return W[2]=Math.min(me[2],Me[2]),pt.vec3.min(W,W,Be),pt.vec3.max(se,se,Be),new Pi(W,se)}function Xr({x:h,y:e,z:r},y=!1){const U=1/(1<<r),R=new _r(fs(h*U),e===(1<<r)-1&&y?-90:Bn((e+1)*U)),j=new _r(fs((h+1)*U),e===0&&y?90:Bn(e*U));return new za(R,j)}function Or(h,e=rs){const r=Xi(h.getNorth()),y=Xi(h.getSouth()),U=Math.cos(r),R=Math.cos(y),j=Math.sin(r),X=Math.sin(y),Q=h.getWest(),se=h.getEast();return[zo(R,X,Q,e),zo(R,X,se,e),zo(U,j,se,e),zo(U,j,Q,e)]}function zr(h,e,r,y){const U=1<<r.z,R=(h/gi+r.x)/U;return so(Bn((e/gi+r.y)/U),fs(R),y)}function ur({min:h,max:e}
273){return Ud/Math.max(e[0]-h[0],e[1]-h[1],e[2]-h[2])}const hn=new Float64Array(16);function In(h){const e=ur(h),r=pt.mat4.fromScaling(hn,[e,e,e]);return pt.mat4.translate(r,r,pt.vec3.negate([],h.min))}function Fr(h){const e=pt.mat4.fromTranslation(hn,h.min),r=1/ur(h);return pt.mat4.scale(e,e,[r,r,r])}function Xn(h){const e=gi/(2*Math.PI);return h/(2*Math.PI)/e}function Cs(h,e){return gi/(512*Math.pow(2,h))*ur(xn(e))}function ms(h,e,r,y,U){const R=Xn(r),j=[h,e,-r/(2*Math.PI)],X=pt.mat4.identity(new Float64Array(16));return pt.mat4.translate(X,X,j),pt.mat4.scale(X,X,[R,R,R]),pt.mat4.rotateX(X,X,Xi(-U)),pt.mat4.rotateY(X,X,Xi(-y)),X}function hs(h){return bt(ko,Vd,h)}function Ks(h,e){const r=so(e.lat,e.lng),y=function(R){const j=so(R._center.lat,R._center.lng),X=pt.vec3.fromValues(0,1,0);let Q=pt.vec3.cross([],X,j);const se=pt.mat4.fromRotation([],-R.angle,j);Q=pt.vec3.transformMat4(Q,Q,se),pt.mat4.fromRotation(se,-R._pitch,Q);const W=pt.vec3.normalize([],j);return pt.vec3.scale(W,W,ar(R.cameraToCenterDistance/R.pixelsPerMeter)),pt.vec3.transformMat4(W,W,se),pt.vec3.add([],j,W)}(h),U=pt.vec3.subtract([],y,r);return pt.vec3.angle(U,r)}function Is(h,e){return Ks(h,e)>Math.PI/2*1.01}const bs=Xi(85),oo=Math.cos(bs),Qs=Math.sin(bs),lo=pt.mat4.create(),Fo=h=>{const e=[];return h.paint.get("circle-pitch-alignment")==="map"&&e.push("PITCH_WITH_MAP"),h.paint.get("circle-pitch-scale")==="map"&&e.push("SCALE_WITH_MAP"),e};function Oc(h,e,r,y,U,R,j,X,Q){if(R&&h.queryGeometry.isAboveHorizon)return!1;R&&(Q*=h.pixelToTileUnitsFactor);const se=h.tileID.canonical,W=r.projection.upVectorScale(se,r.center.lat,r.worldSize).metersToTile;for(const ee of e)for(const ne of ee){const K=ne.add(X),te=U&&r.elevation?r.elevation.exaggeration()*U.getElevationAt(K.x,K.y,!0):0,ae=r.projection.projectTilePoint(K.x,K.y,se);if(te>0){const we=r.projection.upVector(se,K.x,K.y);ae.x+=we[0]*W*te,ae.y+=we[1]*W*te,ae.z+=we[2]*W*te}const ue=R?K:_u(ae.x,ae.y,ae.z,y),de=R?h.tilespaceRays.map(we=>i0(we,te)):h.queryGeometry.screenGeometry,xe=pt.vec4.transformMat4([],[ae.x,ae.y,ae.z,1],y);if(!j&&R?Q*=xe[3]/r.cameraToCenterDistance:j&&!R&&(Q*=r.cameraToCenterDistance/xe[3]),R){const we=Bn((ne.y/gi+se.y)/(1<<se.z));Q/=r.projection.pixelsPerMeter(we,1)/ns(1,we)}if(Oe(de,ue,Q))return!0}return!1}function _u(h,e,r,y){const U=pt.vec4.transformMat4([],[h,e,r,1],y);return new Ht(U[0]/U[3],U[1]/U[3])}const Dm=pt.vec3.fromValues(0,0,0),t0=pt.vec3.fromValues(0,0,1);function i0(h,e){const r=pt.vec3.create();return Dm[2]=e,h.intersectsPlane(Dm,t0,r),new Ht(r[0],r[1])}class km extends ze{}let Rm,zm,Lm,Fm;function Om(h,{width:e,height:r},y,U){if(U){if(U instanceof Uint8ClampedArray)U=new Uint8Array(U.buffer);else if(U.length!==e*r*y)throw new RangeError("mismatched image size")}else U=new Uint8Array(e*r*y);return h.width=e,h.height=r,h.data=U,h}function Bm(h,e,r){const{width:y,height:U}=e;y===h.width&&U===h.height||(gf(h,e,{x:0,y:0},{x:0,y:0},{width:Math.min(h.width,y),height:Math.min(h.height,U)},r,null),h.width=y,h.height=U,h.data=e.data)}function gf(h,e,r,y,U,R,j,X){if(U.width===0||U.height===0)return e;if(U.width>h.width||U.height>h.height||r.x>h.width-U.width||r.y>h.height-U.height)throw new RangeError("out of range source coordinates for image copy");if(U.width>e.width||U.height>e.height||y.x>e.width-U.width||y.y>e.height-U.height)throw new RangeError("out of range destination coordinates for image copy");const Q=h.data,se=e.data,W=R===4&&X;for(let ee=0;ee<U.height;ee++){const ne=((r.y+ee)*h.width+r.x)*R,K=((y.y+ee)*e.width+y.x)*R;if(W)for(let te=0;te<U.width;te++){const ae=ne+te*R+3,ue=K+te*R;se[ue+0]=255,se[ue+1]=255,se[ue+2]=255,se[ue+3]=Q[ae]}else if(j)for(let te=0;te<U.width;te++){const ae=ne+te*R,ue=K+te*R,de=Q[ae+3],xe=new Sr(Q[ae+0]/255*de,Q[ae+1]/255*de,Q[ae+2]/255*de,de).toRenderColor(j).toArray();se[ue+0]=xe[0],se[ue+1]=xe[1],se[ue+2]=xe[2],se[ue+3]=xe[3]}else for(let te=0;te<U.width*R;te++)se[K+te]=Q[ne+te]}return e}Ti(km,"HeatmapBucket",{omit:["layers"]});class Oo{constructor(e,r){Om(this,e,1,r)}resize(e){Bm(this,new Oo(e),1)}clone(){return new Oo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,y,U,R){gf(e,r,y,U,R,1,null)}}class Gn{constructor(e,r){Om(this,e,4,r)}resize(e){Bm(this,new Gn(e),4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Gn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,y,U,R,j,X){gf(e,r,y,U,R,4,j,X)}}class Nm{constructor(e,r){this.width=e.width,this.height=e.height,this.data=r instanceof Uint8Array?new Float32Array(r.buffer):r}}function yu(h){const e={},r=h.resolution||256,y=h.clips?h.clips.length:1,U=h.image||new Gn({width:r,height:y}),R=(j,X,Q)=>{e[h.evaluationKey]=Q;const se=h.expression.evaluate(e);se&&(U.data[j+X+0]=Math.floor(255*se.r/se.a),U.data[j+X+1]=Math.floor(255*se.g/se.a),U.data[j+X+2]=Math.floor(255*se.b/se.a),U.data[j+X+3]=Math.floor(255*se.a))};if(h.clips)for(let j=0,X=0;j<y;++j,X+=4*r)for(let Q=0,se=0;Q<r;Q++,se+=4){const W=Q/(r-1),{start:ee,end:ne}=h.clips[j];R(X,se,ee*(1-W)+ne*W)}else for(let j=0,X=0;j<r;j++,X+=4)R(0,X,j/(r-1));return U}Ti(Oo,"AlphaImage"),Ti(Gn,"RGBAImage");const r0=Tr([{name:"a_pos",components:2,type:"Int16"}],4),{members:n0}=r0;function vu(h,e,r=2){const y=e&&e.length,U=y?e[0]*r:h.length;let R=Vm(h,0,U,r,!0);const j=[];if(!R||R.next===R.prev)return j;let X,Q,se;if(y&&(R=function(W,ee,ne,K){const te=[];for(let ae=0,ue=ee.length;ae<ue;ae++){const de=Vm(W,ee[ae]*K,ae<ue-1?ee[ae+1]*K:W.length,K,!1);de===de.next&&(de.steiner=!0),te.push(d0(de))}te.sort(c0);for(let ae=0;ae<te.length;ae++)ne=h0(te[ae],ne);return ne}(h,e,R,r)),h.length>80*r){X=1/0,Q=1/0;let W=-1/0,ee=-1/0;for(let ne=r;ne<U;ne+=r){const K=h[ne],te=h[ne+1];K<X&&(X=K),te<Q&&(Q=te),K>W&&(W=K),te>ee&&(ee=te)}se=Math.max(W-X,ee-Q),se=se!==0?32767/se:0}return xu(R,j,r,X,Q,se,0),j}function Vm(h,e,r,y,U){let R;if(U===function(j,X,Q,se){let W=0;for(let ee=X,ne=Q-se;ee<Q;ee+=se)W+=(j[ne]-j[ee])*(j[ee+1]+j[ne+1]),ne=ee;return W}(h,e,r,y)>0)for(let j=e;j<r;j+=y)R=Gm(j/y|0,h[j],h[j+1],R);else for(let j=r-y;j>=e;j-=y)R=Gm(j/y|0,h[j],h[j+1],R);return R&&Gd(R,R.next)&&(wu(R),R=R.next),R}function Fl(h,e){if(!h)return h;e||(e=h);let r,y=h;do if(r=!1,y.steiner||!Gd(y,y.next)&&Dn(y.prev,y,y.next)!==0)y=y.next;else{if(wu(y),y=e=y.prev,y===y.next)break;r=!0}while(r||y!==e);return e}
vendor: 5,554 bytes, line 273
273function xu(h,e,r,y,U,R,j){if(!h)return;!j&&R&&function(Q,se,W,ee){let ne=Q;do ne.z===0&&(ne.z=_f(ne.x,ne.y,se,W,ee)),ne.prevZ=ne.prev,ne.nextZ=ne.next,ne=ne.next;while(ne!==Q);ne.prevZ.nextZ=null,ne.prevZ=null,function(K){let te,ae=1;do{let ue,de=K;K=null;let xe=null;for(te=0;de;){te++;let we=de,me=0;for(let ke=0;ke<ae&&(me++,we=we.nextZ,we);ke++);let Me=ae;for(;me>0||Me>0&&we;)me!==0&&(Me===0||!we||de.z<=we.z)?(ue=de,de=de.nextZ,me--):(ue=we,we=we.nextZ,Me--),xe?xe.nextZ=ue:K=ue,ue.prevZ=xe,xe=ue;de=we}xe.nextZ=null,ae*=2}while(te>1)}(ne)}(h,y,U,R);let X=h;for(;h.prev!==h.next;){const Q=h.prev,se=h.next;if(R?a0(h,y,U,R):s0(h))e.push(Q.i,h.i,se.i),wu(h),h=se.next,X=se.next;else if((h=se)===X){j?j===1?xu(h=o0(Fl(h),e),e,r,y,U,R,2):j===2&&l0(h,e,r,y,U,R):xu(Fl(h),e,r,y,U,R,1);break}}}function s0(h){const e=h.prev,r=h,y=h.next;if(Dn(e,r,y)>=0)return!1;const U=e.x,R=r.x,j=y.x,X=e.y,Q=r.y,se=y.y,W=U<R?U<j?U:j:R<j?R:j,ee=X<Q?X<se?X:se:Q<se?Q:se,ne=U>R?U>j?U:j:R>j?R:j,K=X>Q?X>se?X:se:Q>se?Q:se;let te=y.next;for(;te!==e;){if(te.x>=W&&te.x<=ne&&te.y>=ee&&te.y<=K&&Bc(U,X,R,Q,j,se,te.x,te.y)&&Dn(te.prev,te,te.next)>=0)return!1;te=te.next}return!0}function a0(h,e,r,y){const U=h.prev,R=h,j=h.next;if(Dn(U,R,j)>=0)return!1;const X=U.x,Q=R.x,se=j.x,W=U.y,ee=R.y,ne=j.y,K=X<Q?X<se?X:se:Q<se?Q:se,te=W<ee?W<ne?W:ne:ee<ne?ee:ne,ae=X>Q?X>se?X:se:Q>se?Q:se,ue=W>ee?W>ne?W:ne:ee>ne?ee:ne,de=_f(K,te,e,r,y),xe=_f(ae,ue,e,r,y);let we=h.prevZ,me=h.nextZ;for(;we&&we.z>=de&&me&&me.z<=xe;){if(we.x>=K&&we.x<=ae&&we.y>=te&&we.y<=ue&&we!==U&&we!==j&&Bc(X,W,Q,ee,se,ne,we.x,we.y)&&Dn(we.prev,we,we.next)>=0||(we=we.prevZ,me.x>=K&&me.x<=ae&&me.y>=te&&me.y<=ue&&me!==U&&me!==j&&Bc(X,W,Q,ee,se,ne,me.x,me.y)&&Dn(me.prev,me,me.next)>=0))return!1;me=me.nextZ}for(;we&&we.z>=de;){if(we.x>=K&&we.x<=ae&&we.y>=te&&we.y<=ue&&we!==U&&we!==j&&Bc(X,W,Q,ee,se,ne,we.x,we.y)&&Dn(we.prev,we,we.next)>=0)return!1;we=we.prevZ}for(;me&&me.z<=xe;){if(me.x>=K&&me.x<=ae&&me.y>=te&&me.y<=ue&&me!==U&&me!==j&&Bc(X,W,Q,ee,se,ne,me.x,me.y)&&Dn(me.prev,me,me.next)>=0)return!1;me=me.nextZ}return!0}function o0(h,e){let r=h;do{const y=r.prev,U=r.next.next;!Gd(y,U)&&Um(y,r,r.next,U)&&bu(y,U)&&bu(U,y)&&(e.push(y.i,r.i,U.i),wu(r),wu(r.next),r=h=U),r=r.next}while(r!==h);return Fl(r)}function l0(h,e,r,y,U,R){let j=h;do{let X=j.next.next;for(;X!==j.prev;){if(j.i!==X.i&&p0(j,X)){let Q=jm(j,X);return j=Fl(j,j.next),Q=Fl(Q,Q.next),xu(j,e,r,y,U,R,0),void xu(Q,e,r,y,U,R,0)}X=X.next}j=j.next}while(j!==h)}function c0(h,e){return h.x-e.x}function h0(h,e){const r=function(U,R){let j=R;const X=U.x,Q=U.y;let se,W=-1/0;do{if(Q<=j.y&&Q>=j.next.y&&j.next.y!==j.y){const ae=j.x+(Q-j.y)*(j.next.x-j.x)/(j.next.y-j.y);if(ae<=X&&ae>W&&(W=ae,se=j.x<j.next.x?j:j.next,ae===X))return se}j=j.next}while(j!==R);if(!se)return null;const ee=se,ne=se.x,K=se.y;let te=1/0;j=se;do{if(X>=j.x&&j.x>=ne&&X!==j.x&&Bc(Q<K?X:W,Q,ne,K,Q<K?W:X,Q,j.x,j.y)){const ae=Math.abs(Q-j.y)/(X-j.x);bu(j,U)&&(ae<te||ae===te&&(j.x>se.x||j.x===se.x&&u0(se,j)))&&(se=j,te=ae)}j=j.next}while(j!==ee);return se}(h,e);if(!r)return e;const y=jm(r,h);return Fl(y,y.next),Fl(r,r.next)}function u0(h,e){return Dn(h.prev,h,e.prev)<0&&Dn(e.next,h,h.next)<0}function _f(h,e,r,y,U){return(h=1431655765&((h=858993459&((h=252645135&((h=16711935&((h=(h-r)*U|0)|h<<8))|h<<4))|h<<2))|h<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-y)*U|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function d0(h){let e=h,r=h;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==h);return r}function Bc(h,e,r,y,U,R,j,X){return(U-j)*(e-X)>=(h-j)*(R-X)&&(h-j)*(y-X)>=(r-j)*(e-X)&&(r-j)*(R-X)>=(U-j)*(y-X)}function p0(h,e){return h.next.i!==e.i&&h.prev.i!==e.i&&!function(r,y){let U=r;do{if(U.i!==r.i&&U.next.i!==r.i&&U.i!==y.i&&U.next.i!==y.i&&Um(U,U.next,r,y))return!0;U=U.next}while(U!==r);return!1}(h,e)&&(bu(h,e)&&bu(e,h)&&function(r,y){let U=r,R=!1;const j=(r.x+y.x)/2,X=(r.y+y.y)/2;do U.y>X!=U.next.y>X&&U.next.y!==U.y&&j<(U.next.x-U.x)*(X-U.y)/(U.next.y-U.y)+U.x&&(R=!R),U=U.next;while(U!==r);return R}(h,e)&&(Dn(h.prev,h,e.prev)||Dn(h,e.prev,e))||Gd(h,e)&&Dn(h.prev,h,h.next)>0&&Dn(e.prev,e,e.next)>0)}function Dn(h,e,r){return(e.y-h.y)*(r.x-e.x)-(e.x-h.x)*(r.y-e.y)}function Gd(h,e){return h.x===e.x&&h.y===e.y}function Um(h,e,r,y){const U=$d(Dn(h,e,r)),R=$d(Dn(h,e,y)),j=$d(Dn(r,y,h)),X=$d(Dn(r,y,e));return U!==R&&j!==X||!(U!==0||!qd(h,r,e))||!(R!==0||!qd(h,y,e))||!(j!==0||!qd(r,h,y))||!(X!==0||!qd(r,e,y))}function qd(h,e,r){return e.x<=Math.max(h.x,r.x)&&e.x>=Math.min(h.x,r.x)&&e.y<=Math.max(h.y,r.y)&&e.y>=Math.min(h.y,r.y)}function $d(h){return h>0?1:h<0?-1:0}function bu(h,e){return Dn(h.prev,h,h.next)<0?Dn(h,e,h.next)>=0&&Dn(h,h.prev,e)>=0:Dn(h,e,h.prev)<0||Dn(h,h.next,e)<0}function jm(h,e){const r=yf(h.i,h.x,h.y),y=yf(e.i,e.x,e.y),U=h.next,R=e.prev;return h.next=e,e.prev=h,r.next=U,U.prev=r,y.next=r,r.prev=y,R.next=y,y.prev=R,y}function Gm(h,e,r,y){const U=yf(h,e,r);return y?(U.next=y.next,U.prev=y,y.next.prev=U,y.next=U):(U.prev=U,U.next=U),U}function wu(h){h.next.prev=h.prev,h.prev.next=h.next,h.prevZ&&(h.prevZ.nextZ=h.nextZ),h.nextZ&&(h.nextZ.prevZ=h.prevZ)}function yf(h,e,r){return{i:h,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Hd(h,e){const r=h.length;if(r<=1)return[h];const y=[];let U,R;for(let j=0;j<r;j++){const X=Vn(h[j]);X!==0&&(h[j].area=Math.abs(X),R===void 0&&(R=X<0),R===X<0?(U&&y.push(U),U=[h[j]]):U.push(h[j]))}if(U&&y.push(U),e>1)for(let j=0;j<y.length;j++)y[j].length<=e||(Qo(y[j],e,1,y[j].length-1,f0),y[j]=y[j].slice(0,e));return y}function f0(h,e){return e.area-h.area}
273function qm(h,e,r=1){if(!h)return null;const y=typeof h=="string"?h:h.getPrimary().id;e[y]||(e[y]=[]);const U=Un.from(y).getPrimary().scaleSelf(r);return e[y].push(U),U.serialize()}function vf(h,e,r,y){const U=y.patternDependencies;let R=!1;for(const j of e){const X=j.paint.get(`${h}-pattern`);X.isConstant()||(R=!0),qm(X.constantOr(null),U,r)&&(R=!0)}return R}function xf(h,e,r,y,U,R){const j=R.patternDependencies;for(const X of e){const Q=X.paint.get(`${h}-pattern`).value;if(Q.kind!=="constant"){let se=Q.evaluate({zoom:y},r,{},R.availableImages);se=se&&se.name?se.name:se;const W=qm(se,j,U);W&&(r.patterns[X.id]=W)}}return r}class bf{constructor(e){this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.fqid),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new da,this.indexArray=new On,this.indexArray2=new Ia,this.programConfigurations=new Ra(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new an,this.segments2=new an,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.projection=e.projection}updateFootprints(e,r){}populate(e,r,y,U){this.hasPattern=vf("fill",this.layers,this.pixelRatio,r);const R=this.layers[0].layout.get("fill-sort-key"),j=[];for(const{feature:X,id:Q,index:se,sourceLayerIndex:W}of e){const ee=this.layers[0]._featureFilter.needGeometry,ne=pe(X,ee);if(!this.layers[0]._featureFilter.filter(new Nr(this.zoom),ne,y))continue;const K=R?R.evaluate(ne,{},y,r.availableImages):void 0,te={id:Q,properties:X.properties,type:X.type,sourceLayerIndex:W,index:se,geometry:ee?ne.geometry:he(X,y,U),patterns:{},sortKey:K};j.push(te)}R&&j.sort((X,Q)=>X.sortKey-Q.sortKey);for(const X of j){const{geometry:Q,index:se,sourceLayerIndex:W}=X;if(this.hasPattern){const ee=xf("fill",this.layers,X,this.zoom,this.pixelRatio,r);this.patternFeatures.push(ee)}else this.addFeature(X,Q,se,y,{},r.availableImages,r.brightness,r.elevationFeatures);r.featureIndex.insert(e[se].feature,Q,se,W,this.index)}}update(e,r,y,U,R,j,X){this.programConfigurations.updatePaintArrays(e,r,R,y,U,j,X)}addFeatures(e,r,y,U,R,j){for(const X of this.patternFeatures)this.addFeature(X,X.geometry,X.index,r,y,U,j,e.elevationFeatures)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,n0),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,y,U,R,j=[],X,Q){for(const se of Hd(r,500)){let W=0;for(const ue of se)W+=ue.length;const ee=this.segments.prepareSegment(W,this.layoutVertexArray,this.indexArray),ne=ee.vertexLength,K=[],te=[];for(const ue of se){if(ue.length===0)continue;ue!==se[0]&&te.push(K.length/2);const de=this.segments2.prepareSegment(ue.length,this.layoutVertexArray,this.indexArray2),xe=de.vertexLength;this.layoutVertexArray.emplaceBack(ue[0].x,ue[0].y),this.indexArray2.emplaceBack(xe+ue.length-1,xe),K.push(ue[0].x),K.push(ue[0].y);for(let we=1;we<ue.length;we++)this.layoutVertexArray.emplaceBack(ue[we].x,ue[we].y),this.indexArray2.emplaceBack(xe+we-1,xe+we),K.push(ue[we].x),K.push(ue[we].y);de.vertexLength+=ue.length,de.primitiveLength+=ue.length}const ae=vu(K,te);for(let ue=0;ue<ae.length;ue+=3)this.indexArray.emplaceBack(ne+ae[ue],ne+ae[ue+1],ne+ae[ue+2]);ee.vertexLength+=W,ee.primitiveLength+=ae.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,y,R,j,U,X)}}let $m,Hm,Wm,Zm;Ti(bf,"FillBucket",{omit:["layers","patternFeatures"]});class wf{constructor(e,r,y,U){if(this.triangleCount=r.length/3,this.min=new Ht(0,0),this.max=new Ht(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],this.triangleCount===0||e.length===0)return;const[R,j]=[e[0].clone(),e[0].clone()];for(let ee=1;ee<e.length;++ee){const ne=e[ee];R.x=Math.min(R.x,ne.x),R.y=Math.min(R.y,ne.y),j.x=Math.max(j.x,ne.x),j.y=Math.max(j.y,ne.y)}if(U){const ee=Math.ceil(Math.max(j.x-R.x,j.y-R.y)/U);y=Math.max(y,ee)}if(y===0)return;this.min=R,this.max=j;const X=this.max.sub(this.min);X.x=Math.max(X.x,1),X.y=Math.max(X.y,1);const Q=Math.max(X.x,X.y)/y;this.cellsX=Math.max(1,Math.ceil(X.x/Q)),this.cellsY=Math.max(1,Math.ceil(X.y/Q)),this.xScale=1/Q,this.yScale=1/Q;const se=[];for(let ee=0;ee<this.triangleCount;ee++){const ne=e[r[3*ee+0]].sub(this.min),K=e[r[3*ee+1]].sub(this.min),te=e[r[3*ee+2]].sub(this.min),ae=La(Math.floor(Math.min(ne.x,K.x,te.x)),this.xScale,this.cellsX),ue=La(Math.floor(Math.max(ne.x,K.x,te.x)),this.xScale,this.cellsX),de=La(Math.floor(Math.min(ne.
273y,K.y,te.y)),this.yScale,this.cellsY),xe=La(Math.floor(Math.max(ne.y,K.y,te.y)),this.yScale,this.cellsY),we=new Ht(0,0),me=new Ht(0,0),Me=new Ht(0,0),ke=new Ht(0,0);for(let Be=de;Be<=xe;++Be){we.y=me.y=Be*Q,Me.y=ke.y=(Be+1)*Q;for(let He=ae;He<=ue;++He)we.x=Me.x=He*Q,me.x=ke.x=(He+1)*Q,(Dt(ne,K,te,we,me,ke)||Dt(ne,K,te,we,ke,Me))&&se.push({cellIdx:Be*this.cellsX+He,triIdx:ee})}}if(se.length===0)return;se.sort((ee,ne)=>ee.cellIdx-ne.cellIdx||ee.triIdx-ne.triIdx);let W=0;for(;W<se.length;){const ee=se[W].cellIdx,ne={start:this.payload.length,len:0};for(;W<se.length&&se[W].cellIdx===ee;)++ne.len,this.payload.push(se[W++].triIdx);this.cells[ee]=ne}}_lazyInitLookup(){this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8))),this.lookup.fill(0)}queryPoint(e,r){if(this.triangleCount===0||this.cells.length===0||e.x>this.max.x||this.min.x>e.x||e.y>this.max.y||this.min.y>e.y)return;const y=La(e.x-this.min.x,this.xScale,this.cellsX),U=La(e.y-this.min.y,this.yScale,this.cellsY),R=this.cells[U*this.cellsX+y];if(R){this._lazyInitLookup();for(let j=0;j<R.len;j++){const X=this.payload[R.start+j],Q=Math.floor(X/8),se=1<<X%8;if(!(this.lookup[Q]&se)&&(this.lookup[Q]|=se,r.push(X),r.length===this.triangleCount))return}}}query(e,r,y){if(this.triangleCount===0||this.cells.length===0||e.x>this.max.x||this.min.x>r.x||e.y>this.max.y||this.min.y>r.y)return;this._lazyInitLookup();const U=La(e.x-this.min.x,this.xScale,this.cellsX),R=La(r.x-this.min.x,this.xScale,this.cellsX),j=La(e.y-this.min.y,this.yScale,this.cellsY),X=La(r.y-this.min.y,this.yScale,this.cellsY);for(let Q=j;Q<=X;Q++)for(let se=U;se<=R;se++){const W=this.cells[Q*this.cellsX+se];if(W)for(let ee=0;ee<W.len;ee++){const ne=this.payload[W.start+ee],K=Math.floor(ne/8),te=1<<ne%8;if(!(this.lookup[K]&te)&&(this.lookup[K]|=te,y.push(ne),y.length===this.triangleCount))return}}}}function La(h,e,r){return Math.max(0,Math.min(r-1,Math.floor(h*e)))}Ti(wf,"TriangleGridIndex");class Xm{constructor(e){this.zoom=e.zoom,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.fqid),this.index=e.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.footprints=[]}updateFootprints(e,r){for(const y of this.footprints)r.push({footprint:y,id:e})}populate(e,r,y,U){const R=[];for(const{feature:j,id:X,index:Q,sourceLayerIndex:se}of e){const W=this.layers[0]._featureFilter.needGeometry,ee=pe(j,W);if(!this.layers[0]._featureFilter.filter(new Nr(this.zoom),ee,y))continue;const ne={id:X,properties:j.properties,type:j.type,sourceLayerIndex:se,index:Q,geometry:W?ee.geometry:he(j,y,U),patterns:{}};R.push(ne)}for(const j of R){const{geometry:X,index:Q,sourceLayerIndex:se}=j;this.addFeature(j,X,Q,y,{},r.availableImages,r.brightness),r.featureIndex.insert(e[Q].feature,X,Q,se,this.index)}}isEmpty(){return this.footprints.length===0}uploadPending(){return!1}upload(e){}update(e,r,y,U,R,j,X){}destroy(){}addFeature(e,r,y,U,R,j=[],X){for(const Q of Hd(r,2)){const se=[],W=[],ee=[],ne=new Ht(1/0,1/0),K=new Ht(-1/0,-1/0);for(const ue of Q)if(ue.length!==0){ue!==Q[0]&&ee.push(W.length/2);for(let de=0;de<ue.length;de++)W.push(ue[de].x),W.push(ue[de].y),se.push(ue[de]),ne.x=Math.min(ne.x,ue[de].x),ne.y=Math.min(ne.y,ue[de].y),K.x=Math.max(K.x,ue[de].x),K.y=Math.max(K.y,ue[de].y)}const te=vu(W,ee),ae=new wf(se,te,8,256);this.footprints.push({vertices:se,indices:te,grid:ae,min:ne,max:K})}}}Ti(Xm,"ClipBucket",{omit:["layers"]});const m0=Tr([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),g0=Tr([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),_0=Tr([{name:"a_centroid_pos",components:2,type:"Uint16"}]),y0=Tr([{name:"a_join_normal_inside",components:3,type:"Int16"}]),v0=Tr([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),x0=Tr([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:b0}=m0;var Sf,Ym,Tf,Jm,Ef,Km,Qm,Wd={};function eg(){if(Ym)return Sf;Ym=1;var h=fn();function e(U,R,j,X,Q){this.properties={},this.extent=j,this.type=0,this._pbf=U,this._geometry=-1,this._keys=X,this._values=Q,U.readFields(r,this,R)}function r(U,R,j){U==1?R.id=j.readVarint():U==2?function(X,Q){for(var se=X.readVarint()+X.pos;X.pos<se;){var W=Q._keys[X.readVarint()],ee=Q._values[X.readVarint()];Q.properties[W]=ee}}(j,R):U==3?R.type=j.readVarint():U==4&&(R._geometry=j.pos)}function y(U){for(var R,j,X=0,Q=0,se=U.length,W=se-1;Q<se;W=Q++)X+=((j=U[W]).x-(R=U[Q]).x)*(R.y+j.y);return X}return Sf=e,e.types=["Unknown","Point","LineString","Polygon"],e.prototype.loadGeometry=function(){var U=this._pbf;U.pos=this._geometry;for(var R,j=U.readVarint()+U.pos,X=1,Q=0,se=0,W=0,ee=[];U.pos<j;){if(Q<=0){var ne=U.readVarint();X=7&ne,Q=ne>>3}if(Q--,X===1||X===2)se+=U.readSVarint(),W+=U.readSVarint(),X===1&&(R&&ee.push(R),R=[]),R.push(new h(se,W));else{if(X!==7)throw new Error("unknown command "+X);R&&R.push(R[0].clone())}}return R&&ee.push(R),ee},e.prototype.bbox=function(){var U=this._pbf;U.pos=this._geometry;for(var R=U.readVarint()+U.pos,j=1,X=0,Q=0,se=0,W=1/0,ee=-1/0,ne=1/0,K=-1/0;U.pos<R;){if(X<=0){var te=U.readVarint();j=7&te,X=te>>3}if(X--,j===1||j===2)(Q+=U.readSVarint())<W&&(W=Q),Q>ee&&(ee=Q),(se+=U.readSVarint())<ne&&(ne=se),se>K&&(K=se);else if(j!==7)throw new Error("unknown command "+j)}return[W,ne,ee,K]},e.prototype.toGeoJSON=function(U,R,j){var X,Q,se=this.extent*Math.pow(2,j),W=this.extent*U,ee=this.extent*R,ne=this.loadGeometry(),K=e.types[this.type];function te(de){for(var xe=0;xe<de.length;xe++){var we=de[xe];de[xe]=[360*(we.x+W)/se-180,360/Math.PI*Math.atan(Math.exp((180-360*(we.y+ee)/se)*Math.PI/180)
273)-90]}}switch(this.type){case 1:var ae=[];for(X=0;X<ne.length;X++)ae[X]=ne[X][0];te(ne=ae);break;case 2:for(X=0;X<ne.length;X++)te(ne[X]);break;case 3:for(ne=function(de){var xe=de.length;if(xe<=1)return[de];for(var we,me,Me=[],ke=0;ke<xe;ke++){var Be=y(de[ke]);Be!==0&&(me===void 0&&(me=Be<0),me===Be<0?(we&&Me.push(we),we=[de[ke]]):we.push(de[ke]))}return we&&Me.push(we),Me}(ne),X=0;X<ne.length;X++)for(Q=0;Q<ne[X].length;Q++)te(ne[X][Q])}ne.length===1?ne=ne[0]:K="Multi"+K;var ue={type:"Feature",geometry:{type:K,coordinates:ne},properties:this.properties};return"id"in this&&(ue.id=this.id),ue},Sf}function tg(){if(Jm)return Tf;Jm=1;var h=eg();function e(y,U){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=y,this._keys=[],this._values=[],this._features=[],y.readFields(r,this,U),this.length=this._features.length}function r(y,U,R){y===15?U.version=R.readVarint():y===1?U.name=R.readString():y===5?U.extent=R.readVarint():y===2?U._features.push(R.pos):y===3?U._keys.push(R.readString()):y===4&&U._values.push(function(j){for(var X=null,Q=j.readVarint()+j.pos;j.pos<Q;){var se=j.readVarint()>>3;X=se===1?j.readString():se===2?j.readFloat():se===3?j.readDouble():se===4?j.readVarint64():se===5?j.readVarint():se===6?j.readSVarint():se===7?j.readBoolean():null}return X}(R))}return Tf=e,e.prototype.feature=function(y){if(y<0||y>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[y];var U=this._pbf.readVarint()+this._pbf.pos;return new h(this._pbf,U,this.extent,this._keys,this._values)},Tf}function ig(){return Qm||(Qm=1,Wd.VectorTile=function(){if(Km)return Ef;Km=1;var h=tg();function e(r,y,U){if(r===3){var R=new h(U,U.readVarint()+U.pos);R.length&&(y[R.name]=R)}}return Ef=function(r,y){this.layers=r.readFields(e,{},y)},Ef}(),Wd.VectorTileFeature=eg(),Wd.VectorTileLayer=tg()),Wd}var Nc=ig();class Ol extends Ht{constructor(e,r,y){super(e,r),this.z=y}}class rg extends Ol{constructor(e,r,y,U){super(e,r,y),this.w=U}}function Zd(h,e,r,y){const U=[],R=y===0?(j,X,Q,se,W,ee)=>{j.push(new Ht(ee,Q+(ee-X)/(se-X)*(W-Q)))}:(j,X,Q,se,W,ee)=>{j.push(new Ht(X+(ee-Q)/(W-Q)*(se-X),ee))};for(const j of h){const X=[];for(const Q of j){if(Q.length<=2)continue;const se=[];for(let ne=0;ne<Q.length-1;ne++){const K=Q[ne].x,te=Q[ne].y,ae=Q[ne+1].x,ue=Q[ne+1].y,de=y===0?K:te,xe=y===0?ae:ue;de<e?xe>e&&R(se,K,te,ae,ue,e):de>r?xe<r&&R(se,K,te,ae,ue,r):se.push(Q[ne]),xe<e&&de>=e&&R(se,K,te,ae,ue,e),xe>r&&de<=r&&R(se,K,te,ae,ue,r)}let W=Q[Q.length-1];const ee=y===0?W.x:W.y;ee>=e&&ee<=r&&se.push(W),se.length&&(W=se[se.length-1],se[0].x===W.x&&se[0].y===W.y||se.push(se[0]),X.push(se))}X.length&&U.push(X)}return U}function ng(h,e,r,y){const U=r==="x"?"y":"x",R=(y-h[r])/(e[r]-h[r]);h[U]=h[U]+(e[U]-h[U])*R,h[r]=y,h.hasOwnProperty("z")&&(h.z=Bi(h.z,e.z,R)),h.hasOwnProperty("w")&&(h.w=Bi(h.w,e.w,R))}function sg(h,e,r,y){const U=r,R=y;for(const j of["x","y"]){let X=h,Q=e;X[j]>=Q[j]&&(X=e,Q=h),X[j]<U&&Q[j]>U&&ng(X,Q,j,U),X[j]<R&&Q[j]>R&&ng(Q,X,j,R)}}const Xd=Number.MAX_SAFE_INTEGER;function ag(h,e,r,y){return h.order<e||h.order===Xd||!(h.clipMask&r)||function(U,R){return R.length!==0&&R.find(j=>j===U)===void 0}(y,h.clipScope)}function Yd(h,e){return h.x-e.x||h.y-e.y}function og(h,e){return Yd(h.min,e.min)===0&&Yd(h.max,e.max)===0}function Af(h,e){return!(h.min.x>e.max.x||h.max.x<e.min.x||h.min.y>e.max.y||h.max.y<e.min.y)}function Mf(h,e){if(h.length!==e.length)return!1;for(let r=0;r<h.length;r++)if(h[r].sourceId!==e[r].sourceId||!og(h[r],e[r])||h[r].order!==e[r].order||h[r].clipMask!==e[r].clipMask||!on(h[r].clipScope,e[r].clipScope))return!1;return!0}function lg(h,e,r){const y=1/gi,U=1/(1<<r.canonical.z),R=(e.x*y+r.canonical.x)*U+r.wrap,j=(e.y*y+r.canonical.y)*U;return{min:new Ht((h.x*y+r.canonical.x)*U+r.wrap,(h.y*y+r.canonical.y)*U),max:new Ht(R,j)}}function w0(h,e,r){const y=1<<r.canonical.z,U=((e.x-r.wrap)*y-r.canonical.x)*gi,R=(e.y*y-r.canonical.y)*gi;return{min:new Ht(((h.x-r.wrap)*y-r.canonical.x)*gi,(h.y*y-r.canonical.y)*gi),max:new Ht(U,R)}}function cg(h,e,r,y,U,R,j){const X=h.indices,Q=h.vertices,se=[];for(let W=y;W<y+U;W+=3){const ee=e[r[W+0]+R],ne=e[r[W+1]+R],K=e[r[W+2]+R],te=Math.min(ee.x,ne.x,K.x),ae=Math.max(ee.x,ne.x,K.x),ue=Math.min(ee.y,ne.y,K.y),de=Math.max(ee.y,ne.y,K.y);se.length=0,h.grid.query(new Ht(te,ue),new Ht(ae,de),se);for(let xe=0;xe<se.length;xe++){const we=se[xe];if(Dt(Q[X[3*we+0]],Q[X[3*we+1]],Q[X[3*we+2]],ee,ne,K,j))return!0}}return!1}function hg(h,e,r,y){if(!h||!r)return!1;let U=h.vertices;if(!e.canonical.equals(y.canonical)||e.wrap!==y.wrap){if(r.vertices.length<h.vertices.length)return hg(r,y,h,e);
vendor: 39,616 bytes, line 273
273const R=e.canonical,j=y.canonical,X=Math.pow(2,j.z-R.z);U=h.vertices.map(Q=>new Ht((Q.x+R.x*gi)*X-j.x*gi,(Q.y+R.y*gi)*X-j.y*gi))}return cg(r,U,h.indices,0,h.indices.length,0,0)}function ug(h,e,r,y){const U=Math.pow(2,y.z-r.z);return new Ht((h+r.x*gi)*U-y.x*gi,(e+r.y*gi)*U-y.y*gi)}function dg(h,e){const r=[];e.grid.queryPoint(h,r);const y=e.indices,U=e.vertices;for(let R=0;R<r.length;R++){const j=r[R];if(Ke([U[y[3*j+0]],U[y[3*j+1]],U[y[3*j+2]]],h))return!0}return!1}const Pf=[new Ht(0,0),new Ht(gi,0),new Ht(gi,gi),new Ht(0,gi)];function pg(h,e){const r=[];let y=[];if(!e||h.length<2)return[h];if(h.length===2)return yt(h[0],h[1],Pf)?[h]:[];for(let U=0;U<h.length+2;U++){const R=h[U%h.length],j=h[(U+1)%h.length],X=yt(U===0?h[h.length-1]:h[(U-1)%h.length],R,Pf),Q=yt(R,j,Pf),se=X||Q;se&&y.push(R),se&&Q||y.length>0&&(y.length>1&&r.push(y),y=[])}return y.length>1&&r.push(y),r}const Cf=Nc.VectorTileFeature.types,S0=["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"],T0=["fill-extrusion-flood-light-ground-radius"],E0=Math.pow(2,13),A0=Math.pow(2,15)-1,fg=new Ht(0,1),Bo=2147483648;function Su(h,e,r,y,U,R,j,X){h.emplaceBack((e<<1)+j,(r<<1)+R,(Math.floor(y*E0)<<1)+U,Math.round(X))}function Tu(h,e,r){h.emplaceBack(e.x*gi,e.y*gi,r?1:0)}function Jd(h,e,r,y,U,R){h.emplaceBack(e.x,e.y,(r.x<<1)+y,(r.y<<1)+U,R)}function Eu(h,e,r){h.emplaceBack(e.x,e.y,e.z,r[0]*16384,r[1]*16384,r[2]*16384)}class mg{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class gg{constructor(){this.centroidXY=new Ht(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 Ht(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new Ht(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new Ht(this.max.x-this.min.x,this.max.y-this.min.y)}}class _g{constructor(){this.acc=new Ht(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,r){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=r.x,e.min.y=e.max.y=r.y)}appendEdge(e,r,y){this.accCount++,this.acc._add(r);let U=!!this.borders;r.x<e.min.x?(e.min.x=r.x,U=!0):r.x>e.max.x&&(e.max.x=r.x,U=!0),r.y<e.min.y?(e.min.y=r.y,U=!0):r.y>e.max.y&&(e.max.y=r.y,U=!0),((r.x===0||r.x===gi)&&r.x===y.x)!=((r.y===0||r.y===gi)&&r.y===y.y)&&this.processBorderOverlap(r,y),U&&this.checkBorderIntersection(r,y)}checkBorderIntersection(e,r){r.x<0!=e.x<0&&this.addBorderIntersection(0,Bi(r.y,e.y,(0-r.x)/(e.x-r.x))),r.x>gi!=e.x>gi&&this.addBorderIntersection(1,Bi(r.y,e.y,(gi-r.x)/(e.x-r.x))),r.y<0!=e.y<0&&this.addBorderIntersection(2,Bi(r.x,e.x,(0-r.y)/(e.y-r.y))),r.y>gi!=e.y>gi&&this.addBorderIntersection(3,Bi(r.x,e.x,(gi-r.y)/(e.y-r.y)))}addBorderIntersection(e,r){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 y=this.borders[e];r<y[0]&&(y[0]=r),r>y[1]&&(y[1]=r)}processBorderOverlap(e,r){if(e.x===r.x){if(e.y===r.y)return;const y=e.x===0?0:1;this.addBorderIntersection(y,r.y),this.addBorderIntersection(y,e.y)}else{const y=e.y===0?2:3;this.addBorderIntersection(y,r.x),this.addBorderIntersection(y,e.x)}}centroid(){return this.accCount===0?new Ht(0,0):new Ht(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,r)=>e+ +(r[0]!==Number.MAX_VALUE),0):0}}function yg(h,e){const r=h.add(e)._unit(),y=Ue(h.x*r.x+h.y*r.y,-1,1);var U,R,j;return j=Math.acos(y),Math.min(4,Math.max(-4,Math.tan(j)))/4*A0*((U=h).x*(R=e).y-U.y*R.x<0?-1:1)}const M0=[h=>h.x<0,h=>h.x>gi,h=>h.y<0,h=>h.y>gi];function P0(h,e,r,y){const U=[4];if(y===0)return U;r._mult(y);const R=h.sub(r),j=e.sub(r),X=[h,e,R,j];for(let Q=0;Q<4;Q++)for(const se of X)if(M0[Q](se)){U.push(Q);break}return U}class vg{constructor(e){this.vertexArray=new Ac,this.indexArray=new On,this.programConfigurations=new Ra(e.layers,{zoom:e.zoom,lut:e.lut},r=>T0.includes(r)),this._segments=new an,this.hiddenByLandmarkVertexArray=new Dc,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new an}getDefaultSegment(){return this.regionSegments[4]}hasData(){return this.vertexArray.length!==0}addData(e,r,y,U=!1){const R=e.length;if(R>2){let j=Math.max(0,this._segments.get().length-1);const X=this._segments._prepareSegment(4*R,this.vertexArray.length,2*this._segmentToGroundQuads[j].length);let Q;j!==this._segments.get().length-1&&(j++,this._segmentToGroundQuads[j]=[],this._segmentToRegionTriCounts[j]=[0,0,0,0,0]);{const se=e[0],W=e[1];Q=yg(se.sub(e[R-1])._perp()._unit(),W.sub(se)._perp()._unit())}for(let se=0;se<R;se++){const W=se===R-1?0:se+1,ee=e[se],ne=e[W],K=e[W===R-1?0:W+1],te=ne.sub(ee)._perp()._unit(),ae=yg(te,K.sub(ne)._perp()._unit()),ue=Q,de=ae;if(If(ee,ne,r)||U&&wg(ee,r)&&wg(ne,r)){Q=ae;continue}const xe=X.vertexLength;Jd(this.vertexArray,ee,ne,1,1,ue),Jd(this.vertexArray,ee,ne,1,0,ue),Jd(this.vertexArray,ee,ne,0,1,de),Jd(this.vertexArray,ee,ne,0,0,de),X.vertexLength+=4;const we=P0(ee,ne,te,y);for(const me of we)this._segmentToGroundQuads[j].push({id:xe,region:me}),this._segmentToRegionTriCounts[j][me]+=2,X.primitiveLength+=2;Q=ae}}}prepareBorderSegments(){if(!this.hasData())return;const e=this._segments.get(),r=e.length;for(let y=0;y<r;y++)this._segmentToGroundQuads[y].sort((U,R)=>U.region-R.region);for(let y=0;y<r;y++){const U=this._segmentToGroundQuads[y],R=e[y],j=this._segmentToRegionTriCounts[y];j.reduce((Q,se)=>Q+se,0);let X=0;for(let Q=0;Q<=4;Q++){const se=j[Q];if(se!==0){let W=this.regionSegments[Q];W||(W=this.regionSegments[Q]=new an);const ee={vertexOffset:R.vertexOffset,primitiveOffset:R.primitiveOffset+X,vertexLength:R.vertexLength,primitiveLength:se};W.get().push(ee)}X+=se}for(let Q=0;Q<U.length;Q++){const se=U[Q].id;this.indexArray.emplaceBack(se,se+1,se+3),this.indexArray.emplaceBack(se,se+3,se+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,r,y,U,R,j){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,r,y,U,R,j)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,g0.members),this.indexBuffer=e.createIndexBuffer(this.indexArray))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,r,y,U,R,j,X){this.hasData()&&this.programConfigurations.updatePaintArrays(e,r,y,U,R,j,X)}updateHiddenByLandmark(e){if(!this.hasData())return;const r=e.groundVertexCount+e.groundVertexArrayOffset;if(e.groundVertexCount===0)return;const y=e.flags&Bo?1:0;for(let U=e.groundVertexArrayOffset;U<r;++U)this.hiddenByLandmarkVertexArray.emplace(U,y);this._needsHiddenByLandmarkUpdate=!0}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,v0.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._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const r=this.regionSegments[e];r&&r.destroy()}}}}class Kd{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(r=>r.fqid),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new On,this.footprintVertices=new da,this.footprintSegments=[],this.layoutVertexArray=new pa,this.centroidVertexArray=new ps,this.wallVertexArray=new Ld,this.indexArray=new On,this.programConfigurations=new Ra(e.layers,{zoom:e.zoom,lut:e.lut},r=>S0.includes(r)),this.segments=new an,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.groundEffect=new vg(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}updateFootprints(e,r){}populate(e,r,y,U){this.features=[],this.hasPattern=vf("fill-extrusion",this.layers,this.pixelRatio,r),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=t(y),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1)!==0;for(const{feature:R,id:j,index:X,sourceLayerIndex:Q}of e){const se=this.layers[0]._featureFilter.needGeometry,W=pe(R,se);if(!this.layers[0]._featureFilter.filter(new Nr(this.zoom),W,y))continue;const ee={id:j,sourceLayerIndex:Q,index:X,geometry:se?W.geometry:he(R,y,U),properties:R.properties,type:R.type,patterns:{}},ne=this.layoutVertexArray.length,K=Cf[ee.type]==="Polygon";if(this.hasPattern)this.features.push(xf("fill-extrusion",this.layers,ee,this.zoom,this.pixelRatio,r));else if(this.wallMode)for(const te of ee.geometry)for(const ae of pg(te,K))this.addFeature(ee,[ae],X,y,{},r.availableImages,U,r.brightness);else this.addFeature(ee,ee.geometry,X,y,{},r.availableImages,U,r.brightness);r.featureIndex.insert(R,ee.geometry,X,Q,this.index,ne)}this.sortBorders(),this.projection.name==="mercator"&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,r,y,U,R,j){for(const X of this.features){const Q=Cf[X.type]==="Polygon",{geometry:se}=X;if(this.wallMode)for(const W of se)for(const ee of pg(W,Q))this.addFeature(X,[ee],X.index,r,y,U,R,j);else this.addFeature(X,se,X.index,r,y,U,R,j)}this.sortBorders(),this.projection.name==="mercator"&&this.splitToSubtiles()}update(e,r,y,U,R,j,X){this.programConfigurations.updatePaintArrays(e,r,R,y,U,j,X),this.groundEffect.update(e,r,R,y,U,j,X)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,b0),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.wallVertexBuffer=e.createVertexBuffer(this.wallVertexArray,y0.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,x0.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,_0.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,r,y,U,R,j,X,Q){const se=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(e,{})/this.tileToMeter,W=[new Ht(0,0),new Ht(gi,gi)],ee=X.projection,ne=ee.name==="globe",K=this.wallMode||Cf[e.type]==="Polygon",te=new _g;te.centroidDataIndex=this.centroidData.length;const ae=new gg,ue=this.layers[0].paint.get("fill-extrusion-base").evaluate(e,{},U)<=0,de=this.layers[0].paint.get("fill-extrusion-height").evaluate(e,{},U);let xe;if(ae.height=de,ae.vertexArrayOffset=this.layoutVertexArray.length,ae.groundVertexArrayOffset=this.groundEffect.vertexArray.length,ne&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Sl),this.wallMode){if(ne)return void zi("Non zero fill-extrusion-line-width is not yet supported on globe.");if(r.length!==1)return;xe=function(qe){const st=qe[0].x===qe[qe.length-1].x&&qe[0].y===qe[qe.length-1].y;(function(ni){let ti=0;const Ai=ni.length;for(let vi=0;vi<Ai;vi++)ti+=(ni[(vi+1)%Ai].x-ni[vi].x)*(ni[(vi+1)%Ai].y+ni[vi].y);return ti>=0})(qe)||(qe=qe.reverse());const ct={geometry:[],joinNormals:[],indices:[]},ft=[],dt=[],_t=[];let Tt=qe.length;for(;Tt>=2&&qe[Tt-1].equals(qe[Tt-2]);)Tt--;if(Tt<(st?3:2))return ct;let Ct,vt,qt,ei,Gt,yi=0;for(;yi<Tt-1&&qe[yi].equals(qe[yi+1]);)yi++;st&&(Ct=qe[Tt-2],Gt=qe[yi].sub(Ct)._unit()._perp());for(let ni=yi;ni<Tt;ni++){if(qt=ni===Tt-1?st?qe[yi+1]:void 0:qe[ni+1],qt&&qe[ni].equals(qt))continue;Gt&&(ei=Gt),Ct&&(vt=Ct),Ct=qe[ni],Gt=qt?qt.sub(Ct)._unit()._perp():ei,ei=ei||Gt;let ti=ei.add(Gt);ti.x===0&&ti.y===0||ti._unit();const Ai=ti.x*Gt.x+ti.y*Gt.y,vi=Ai!==0?1/Ai:1/0,wi=ei.x*Gt.y-ei.y*Gt.x>0;let ji="miter";const Ji=2;ji==="miter"&&vi>Ji&&(ji="bevel"),ji==="bevel"&&(vi>100&&(ji="flipbevel"),vi<Ji&&(ji="miter"));const Ki=(Qi,nr,sr,Br)=>{const Dr=new Ht(Qi.x,Qi.y),Wi=new Ht(Qi.x,Qi.y);Dr.x+=nr.x*Br,Dr.y+=nr.y*Br,Wi.x-=nr.x*Math.max(sr,1),Wi.y-=nr.y*Math.max(sr,1),_t.push(nr),ft.push(Dr),dt.push(Wi)};if(ji==="miter")ti._mult(vi),Ki(Ct,ti,0,0);else if(ji==="flipbevel")ti=Gt.mult(-1),Ki(Ct,ti,0,0),Ki(Ct,ti.mult(-1),0,0);else{const Qi=-Math.sqrt(vi*vi-1),nr=wi?Qi:0,sr=wi?0:Qi;vt&&Ki(Ct,ei,nr,sr),qt&&Ki(Ct,Gt,nr,sr)}}ct.geometry=[...ft,...dt.reverse(),ft[0]],ct.joinNormals=[..._t,..._t.reverse(),_t[_t.length-1]];const mi=ct.geometry.length-1;for(let ni=0;ni<mi/2;ni++)if(ni+1<mi/2){let ti=ni,Ai=ni+1,vi=mi-1-ni,wi=mi-2-ni;ti=ti===0?mi-1:ti-1,Ai=Ai===0?mi-1:Ai-1,vi=vi===0?mi-1:vi-1,wi=wi===0?mi-1:wi-1,ct.indices.push(vi),ct.indices.push(Ai),ct.indices.push(ti),ct.indices.push(vi),ct.indices.push(wi),ct.indices.push(Ai)}return ct}(r[0]),r=[xe.geometry]}const we=(qe,st)=>qe<(st.length-1)/2||qe===st.length-1,me=this.wallMode?[r]:Hd(r,500);for(let qe=me.length-1;qe>=0;qe--){const st=me[qe];(st.length===0||(Me=st[0]).every(We=>We.x<=0)||Me.every(We=>We.x>=gi)||Me.every(We=>We.y<=0)||Me.every(We=>We.y>=gi))&&me.splice(qe,1)}var Me;let ke;if(ne)ke=Ag(me,W,U);else{ke=[];for(const qe of me)ke.push({polygon:qe,bounds:W})}const Be=K?this.edgeRadius:0,He=Be>0&&this.zoom<17,$e=(qe,st)=>{if(qe.length===0)return!1;const We=qe[qe.length-1];return st.x===We.x&&st.y===We.y};for(const{polygon:qe,bounds:st}of ke){let We=0,ct=0;for(const Tt of qe)K&&!Tt[0].equals(Tt[Tt.length-1])&&Tt.push(Tt[0]),ct+=K?Tt.length-1:Tt.length;const ft=this.segments.prepareSegment((K?5:4)*ct,this.layoutVertexArray,this.indexArray);ae.footprintSegIdx<0&&(ae.footprintSegIdx=this.footprintSegments.length),ae.polygonSegIdx<0&&(ae.polygonSegIdx=this.polygonSegments.length);const dt={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},_t=new mg;if(_t.vertexOffset=this.footprintVertices.length,_t.indexOffset=3*this.footprintIndices.length,_t.ringIndices=[],K){const Tt=[],Ct=[];We=ft.vertexLength;for(let qt=0;qt<qe.length;qt++){const ei=qe[qt];ei.length&&qt!==0&&Ct.push(Tt.length/2);const Gt=[];let yi,mi;yi=ei[1].sub(ei[0])._perp()._unit(),_t.ringIndices.push(ei.length-1);for(let ni=1;ni<ei.length;ni++){const ti=ei[ni],Ai=ei[ni===ei.length-1?1:ni+1],vi=ti.clone();if(Be){mi=Ai.sub(ti)._perp()._unit();const wi=yi.add(mi)._unit(),ji=Be*Math.min(4,1/(yi.x*wi.x+yi.y*wi.y));vi.x+=ji*wi.x,vi.y+=ji*wi.y,vi.x=Math.round(vi.x),vi.y=Math.round(vi.y),yi=mi}if(!ue||Be!==0&&!He||$e(Gt,vi)||Gt.push(vi),Su(this.layoutVertexArray,vi.x,vi.y,0,0,1,1,0),this.wallMode){const wi=we(ni,ei);Tu(this.wallVertexArray,xe.joinNormals[ni],!wi)}ft.vertexLength++,this.footprintVertices.emplaceBack(ti.x,ti.y),Tt.push(ti.x,ti.y),ne&&Eu(this.layoutVertexExtArray,ee.projectTilePoint(vi.x,vi.y,U),ee.upVector(U,vi.x,vi.y))}ue&&(Be===0||He)&&(Gt.length!==0&&$e(Gt,Gt[0])&&Gt.pop(),this.groundEffect.addData(Gt,st,se))}const vt=this.wallMode?xe.indices:vu(Tt,Ct);for(let qt=0;qt<vt.length;qt+=3)this.footprintIndices.emplaceBack(_t.vertexOffset+vt[qt+0],_t.vertexOffset+vt[qt+1],_t.vertexOffset+vt[qt+2]),this.indexArray.emplaceBack(We+vt[qt],We+vt[qt+2],We+vt[qt+1]),ft.primitiveLength++;_t.indexCount+=vt.length,_t.vertexCount+=this.footprintVertices.length-_t.vertexOffset}for(let Tt=0;Tt<qe.length;Tt++){const Ct=qe[Tt];te.startRing(ae,Ct[0]);let vt=Ct.length>4&&Sg(Ct[Ct.length-2],Ct[0],Ct[1]),qt=Be?C0(Ct[Ct.length-2],Ct[0],Ct[1],Be):0;const ei=[];let Gt,yi,mi;yi=Ct[1].sub(Ct[0])._perp()._unit();let ni=!0;for(let ti=1,Ai=0;ti<Ct.length;ti++){let vi=Ct[ti-1],wi=Ct[ti];const ji=Ct[ti===Ct.length-1?1:ti+1];if(te.appendEdge(ae,wi,vi),If(wi,vi,st)){Be&&(yi=ji.sub(wi)._perp()._unit(),ni=!ni);continue}const Ji=wi.sub(vi)._perp(),Ki=Ji.x/(Math.abs(Ji.x)+Math.abs(Ji.y)),Qi=Ji.y>0?1:0,nr=vi.dist(wi);if(Ai+nr>32768&&(Ai=0),Be){mi=ji.sub(wi)._perp()._unit();let Wi=bg(vi,wi,ji,xg(yi,mi),Be);isNaN(Wi)&&(Wi=0);const Mr=wi.sub(vi)._unit();vi=vi.add(Mr.mult(qt))._round(),wi=wi.add(Mr.mult(-Wi))._round(),qt=Wi,yi=mi,ue&&this.zoom>=17&&($e(ei,vi)||ei.push(vi),$e(ei,wi)||ei.push(wi))}const sr=ft.vertexLength,Br=Ct.length>4&&Sg(vi,wi,ji);let Dr=Tg(Ai,vt,ni);if(Su(this.layoutVertexArray,vi.x,vi.y,Ki,Qi,0,0,Dr),Su(this.layoutVertexArray,vi.x,vi.y,Ki,Qi,0,1,Dr),this.wallMode){const Wi=we(ti-1,Ct),Mr=xe.joinNormals[ti-1];Tu(this.wallVertexArray,Mr,Wi),Tu(this.wallVertexArray,Mr,Wi)}if(Ai+=nr,Dr=Tg(Ai,Br,!ni),vt=Br,Su(this.layoutVertexArray,wi.x,wi.y,Ki,Qi,0,0,Dr),Su(this.layoutVertexArray,wi.x,wi.y,Ki,Qi,0,1,Dr),this.wallMode){const Wi=we(ti,Ct),Mr=xe.joinNormals[ti];Tu(this.wallVertexArray,Mr,Wi),Tu(this.wallVertexArray,Mr,Wi)}if(ft.vertexLength+=4,this.indexArray.emplaceBack(sr+0,sr+1,sr+2),this.indexArray.emplaceBack(sr+1,sr+3,sr+2),ft.primitiveLength+=2,Be){const Wi=We+(ti===1?Ct.length-2:ti-2),Mr=ti===1?We:Wi+1;if(this.indexArray.emplaceBack(sr+1,Wi,sr+3),this.indexArray.emplaceBack(Wi,Mr,sr+3),ft.primitiveLength+=2,Gt===void 0&&(Gt=sr),!If(ji,Ct[ti],st)){const Ir=ti===Ct.length-1?Gt:ft.vertexLength;this.indexArray.emplaceBack(sr+2,sr+3,Ir),this.indexArray.emplaceBack(sr+3,Ir+1,Ir),this.indexArray.emplaceBack(sr+3,Mr,Ir+1),ft.primitiveLength+=3}ni=!ni}if(ne){const Wi=this.layoutVertexExtArray,Mr=ee.projectTilePoint(vi.x,vi.y,U),Ir=ee.projectTilePoint(wi.x,wi.y,U),$r=ee.upVector(U,vi.x,vi.y),un=ee.upVector(U,wi.x,wi.y);Eu(Wi,Mr,$r),Eu(Wi,Mr,$r),Eu(Wi,Ir,un),Eu(Wi,Ir,un)}}K&&(We+=Ct.length-1),ue&&Be&&this.zoom>=17&&(ei.length!==0&&$e(ei,ei[0])&&ei.pop(),this.groundEffect.addData(ei,st,se,Be>0))}this.footprintSegments.push(_t),dt.triangleCount=this.indexArray.length-dt.triangleArrayOffset,this.polygonSegments.push(dt),++ae.footprintSegLen,++ae.polygonSegLen}if(ae.vertexCount=this.layoutVertexArray.length-ae.vertexArrayOffset,ae.groundVertexCount=this.groundEffect.vertexArray.length-ae.groundVertexArrayOffset,ae.vertexCount!==0){if(ae.centroidXY=te.borders?fg:this.encodeCentroid(te,ae),this.centroidData.push(ae),te.borders){this.featuresOnBorder.push(te);const qe=this.featuresOnBorder.length-1;for(let st=0;st<te.borders.length;st++)te.borders[st][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[st].push(qe)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,y,R,j,U,Q),this.groundEffect.addPaintPropertiesData(e,y,R,j,U,Q),this.maxHeight=Math.max(this.maxHeight,de)}}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort((r,y)=>this.featuresOnBorder[r].borders[e][0]-this.featuresOnBorder[y].borders[e][0])}splitToSubtiles(){const e=[];for(let X=0;X<this.centroidData.length;X++){const Q=this.centroidData[X],se=+(Q.min.y+Q.max.y>gi),W=2*se+(+(Q.min.x+Q.max.x>gi)^se);for(let ee=0;ee<Q.polygonSegLen;ee++){const ne=Q.polygonSegIdx+ee;e.push({centroidIdx:X,subtile:W,polygonSegmentIdx:ne,triangleSegmentIdx:this.polygonSegments[ne].triangleSegIdx})}}const r=new On;e.sort((X,Q)=>X.triangleSegmentIdx===Q.triangleSegmentIdx?X.subtile-Q.subtile:X.triangleSegmentIdx-Q.triangleSegmentIdx);let y=0,U=0,R=0;for(const X of e){if(X.triangleSegmentIdx!==y)break;R++}const j=e.length;for(;U!==e.length;){y=e[U].triangleSegmentIdx;let X=0,Q=U,se=U;for(let W=Q;W<R&&e[W].subtile===X;W++)se++;for(;Q!==R;){const W=e[Q];X=W.subtile;const ee=this.centroidData[W.centroidIdx].min.clone(),ne=this.centroidData[W.centroidIdx].max.clone(),K={vertexOffset:this.segments.segments[y].vertexOffset,primitiveOffset:r.length,vertexLength:this.segments.segments[y].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let te=Q;te<se;te++){const ae=e[te],ue=this.polygonSegments[ae.polygonSegmentIdx],de=this.centroidData[ae.centroidIdx].min,xe=this.centroidData[ae.centroidIdx].max,we=this.indexArray.uint16;for(let me=ue.triangleArrayOffset;me<ue.triangleArrayOffset+ue.triangleCount;me++)r.emplaceBack(we[3*me],we[3*me+1],we[3*me+2]);K.primitiveLength+=ue.triangleCount,ee.x=Math.min(ee.x,de.x),ee.y=Math.min(ee.y,de.y),ne.x=Math.max(ne.x,xe.x),ne.y=Math.max(ne.y,xe.y)}K.primitiveLength>0&&this.triangleSubSegments.push({segment:K,min:ee,max:ne}),Q=se;for(let te=Q;te<R&&e[te].subtile===e[Q].subtile;te++)se++}U=R;for(let W=U;W<j&&e[W].triangleSegmentIdx===e[U].triangleSegmentIdx;W++)R++}r._trim(),this.indexArray=r}getVisibleSegments(e,r,y){const U=new an;if(this.wallMode){for(const ae of this.triangleSubSegments)U.segments.push(ae.segment);return U}let R=0,j=0;const X=1<<e.canonical.z;if(r){const ae=r.getMinMaxForTile(e);ae&&(R=ae.min,j=ae.max)}j+=this.maxHeight;const Q=e.toUnwrapped();let se;const W=[Q.canonical.x/X+Q.wrap,Q.canonical.y/X],ee=[(Q.canonical.x+1)/X+Q.wrap,(Q.canonical.y+1)/X],ne=(ae,ue,de)=>[ae[0]*(1-de[0])+ue[0]*de[0],ae[1]*(1-de[1])+ue[1]*de[1]],K=[],te=[];for(const ae of this.triangleSubSegments){K[0]=ae.min.x/gi,K[1]=ae.min.y/gi,te[0]=ae.max.x/gi,te[1]=ae.max.y/gi;const ue=ne(W,ee,K),de=ne(W,ee,te);if(new Pi([ue[0],ue[1],R],[de[0],de[1],j]).intersectsPrecise(y)===0){se&&(U.segments.push(se),se=void 0);continue}const xe=ae.segment;se&&se.vertexOffset!==xe.vertexOffset&&(U.segments.push(se),se=void 0),se?(se.vertexLength+=xe.vertexLength,se.primitiveLength+=xe.primitiveLength):se={vertexOffset:xe.vertexOffset,primitiveLength:xe.primitiveLength,vertexLength:xe.vertexLength,primitiveOffset:xe.primitiveOffset,sortKey:void 0,vaos:{}}}return se&&U.segments.push(se),U}encodeCentroid(e,r){const y=e.centroid(),U=r.span(),R=Math.min(7,Math.round(U.x*this.tileToMeter/10)),j=Math.min(7,Math.round(U.y*this.tileToMeter/10));return new Ht(Ue(y.x,1,gi-1)<<3|R,Ue(y.y,1,gi-1)<<3|j)}encodeBorderCentroid(e){if(!e.borders)return new Ht(0,0);const r=e.borders,y=Number.MAX_VALUE;if(r[0][0]!==y||r[1][0]!==y){const U=r[0][0]!==y?0:1;return new Ht(6|(r[0][0]!==y?0:65528),(r[U][0]+r[U][1])/2<<3|6)}{const U=r[2][0]!==y?2:3;return new Ht((r[U][0]+r[U][1])/2<<3|6,6|(r[2][0]!==y?0:65528))}}showCentroid(e){const r=this.centroidData[e.centroidDataIndex];r.flags&=Bo,r.centroidXY.x=0,r.centroidXY.y=0,this.writeCentroidToBuffer(r)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const r=e.vertexArrayOffset,y=e.vertexCount+e.vertexArrayOffset,U=e.flags&Bo?fg:e.centroidXY,R=this.centroidVertexArray.geta_centroid_pos0(r);if(this.centroidVertexArray.geta_centroid_pos1(r)!==U.y||R!==U.x){for(let j=r;j<y;++j)this.centroidVertexArray.emplace(j,U.x,U.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,r,y){if(r.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=r.updateTime;const U=r.getReplacementRegionsForTile(e.toUnwrapped());if(Mf(this.activeReplacements,U))return;if(this.activeReplacements=U,this.centroidVertexArray.length===0)this.createCentroidsBuffer();else for(const j of this.centroidData)j.flags&=2147483647;const R=[];for(const j of this.activeReplacements){if(j.order<y)continue;const X=Math.max(1,Math.pow(2,j.footprintTileId.canonical.z-e.canonical.z));for(const Q of this.centroidData)if(!(Q.flags&Bo||j.min.x>Q.max.x||Q.min.x>j.max.x||j.min.y>Q.max.y||Q.min.y>j.max.y))for(let se=0;se<Q.footprintSegLen;se++){const W=this.footprintSegments[Q.footprintSegIdx+se];if(R.length=0,I0(this.footprintVertices,W.vertexOffset,W.vertexCount,j.footprintTileId.canonical,e.canonical,R),cg(j.footprint,R,this.footprintIndices.uint16,W.indexOffset,W.indexCount,-W.vertexOffset,-X)){Q.flags|=Bo;break}}}for(const j of this.centroidData)this.writeCentroidToBuffer(j);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,r,y){let U=!1;for(let R=0;R<y.footprintSegLen;R++){const j=this.footprintSegments[y.footprintSegIdx+R];let X=0;for(const Q of j.ringIndices){for(let se=X,W=Q+X-1;se<Q+X;W=se++){const ee=this.footprintVertices.int16[2*(se+j.vertexOffset)+0],ne=this.footprintVertices.int16[2*(se+j.vertexOffset)+1],K=this.footprintVertices.int16[2*(W+j.vertexOffset)+1];ne>r!=K>r&&e<(this.footprintVertices.int16[2*(W+j.vertexOffset)+0]-ee)*(r-ne)/(K-ne)+ee&&(U=!U)}X=Q}}return U}getHeightAtTileCoord(e,r){let y=Number.NEGATIVE_INFINITY,U=!0;const R=4*(e+gi)*gi+(r+gi);if(this.partLookup.hasOwnProperty(R)){const j=this.partLookup[R];return j?{height:j.height,hidden:!!(j.flags&Bo)}:void 0}for(const j of this.centroidData)e>j.max.x||j.min.x>e||r>j.max.y||j.min.y>r||this.footprintContainsPoint(e,r,j)&&j&&j.height>y&&(y=j.height,this.partLookup[R]=j,U=!!(j.flags&Bo));if(y!==Number.NEGATIVE_INFINITY)return{height:y,hidden:U};this.partLookup[R]=void 0}}function xg(h,e){const r=h.add(e)._unit();return h.x*r.x+h.y*r.y}function C0(h,e,r,y){const U=e.sub(h)._perp()._unit(),R=r.sub(e)._perp()._unit();return bg(h,e,r,xg(U,R),y)}function bg(h,e,r,y,U){const R=Math.sqrt(1-y*y);return Math.min(h.dist(e)/3,e.dist(r)/3,U*R/y)}function If(h,e,r){return h.x<r[0].x&&e.x<r[0].x||h.x>r[1].x&&e.x>r[1].x||h.y<r[0].y&&e.y<r[0].y||h.y>r[1].y&&e.y>r[1].y}function wg(h,e){return h.x<e[0].x||h.x>e[1].x||h.y<e[0].y||h.y>e[1].y}function Sg(h,e,r){if(h.x<0||h.x>=gi||e.x<0||e.x>=gi||r.x<0||r.x>=gi)return!1;const y=r.sub(e),U=y.perp(),R=h.sub(e);return(y.x*R.x+y.y*R.y)/Math.sqrt((y.x*y.x+y.y*y.y)*(R.x*R.x+R.y*R.y))>-.866&&U.x*R.x+U.y*R.y<0}function Tg(h,e,r){const y=e?2|h:-3&h;return r?1|y:-2&y}function Eg(){const h=Math.PI/32,e=Math.tan(h),r=ao;return r*Math.sqrt(1+2*e*e)-r}function Ag(h,e,r){const y=1<<r.z,U=fs(r.x/y),R=fs((r.x+1)/y),j=Bn(r.y/y),X=Bn((r.y+1)/y);return function(Q,se,W,ee,ne=0,K){const te=[];if(!Q.length||!W||!ee)return te;const ae=(ke,Be)=>{for(const He of ke)te.push({polygon:He,bounds:Be})},ue=Math.ceil(Math.log2(W)),de=Math.ceil(Math.log2(ee)),xe=ue-de,we=[];for(let ke=0;ke<Math.abs(xe);ke++)we.push(xe>0?0:1);for(let ke=0;ke<Math.min(ue,de);ke++)we.push(0),we.push(1);let me=Q;if(me=Zd(me,se[0].y-ne,se[1].y+ne,1),me=Zd(me,se[0].x-ne,se[1].x+ne,0),!me.length)return te;const Me=[];for(we.length?Me.push({polygons:me,bounds:se,depth:0}):ae(me,se);Me.length;){const ke=Me.pop(),Be=ke.depth,He=we[Be],$e=ke.bounds[0],qe=ke.bounds[1],st=He===0?$e.x:$e.y,We=He===0?qe.x:qe.y,ct=K?K(He,st,We):.5*(st+We),ft=Zd(ke.polygons,st-ne,ct+ne,He),dt=Zd(ke.polygons,ct-ne,We+ne,He);if(ft.length){const _t=[$e,new Ht(He===0?ct:qe.x,He===1?ct:qe.y)];we.length>Be+1?Me.push({polygons:ft,bounds:_t,depth:Be+1}):ae(ft,_t)}if(dt.length){const _t=[new Ht(He===0?ct:$e.x,He===1?ct:$e.y),qe];we.length>Be+1?Me.push({polygons:dt,bounds:_t,depth:Be+1}):ae(dt,_t)}}return te}(h,e,Math.ceil((R-U)/11.25),Math.ceil((j-X)/11.25),1,(Q,se,W)=>{if(Q===0)return .5*(se+W);{const ee=Bn((r.y+se/gi)/y);return(Os(.5*(Bn((r.y+W/gi)/y)+ee))*y-r.y)*gi}})}function I0(h,e,r,y,U,R){const j=Math.pow(2,y.z-U.z);for(let X=0;X<r;X++){let Q=h.int16[2*(X+e)+0],se=h.int16[2*(X+e)+1];Q=(Q+U.x*gi)*j-y.x*gi,se=(se+U.y*gi)*j-y.y*gi,R.push(new Ht(Q,se))}}let Mg,Pg;function Au(h,e){return h.x*e.x+h.y*e.y}function Cg(h,e){if(h.length===1){let r=0;const y=e[r++];let U;for(;!U||y.equals(U);)if(U=e[r++],!U)return 1/0;for(;r<e.length;r++){const R=e[r],j=h[0],X=U.sub(y),Q=R.sub(y),se=j.sub(y),W=Au(X,X),ee=Au(X,Q),ne=Au(Q,Q),K=Au(se,X),te=Au(se,Q),ae=W*ne-ee*ee,ue=(ne*K-ee*te)/ae,de=(W*te-ee*K)/ae,xe=y.z*(1-ue-de)+U.z*ue+R.z*de;if(isFinite(xe))return xe}return 1/0}{let r=1/0;for(const y of e)r=Math.min(r,y.z);return r}}function Ig(h,e,r,y,U,R,j,X){const Q=j*U.getElevationAt(h,e,!0,!0),se=R[0]!==0,W=se?R[1]===0?j*(R[0]/7-450):j*function(ee,ne,K){const te=Math.floor(ne[0]/8),ae=Math.floor(ne[1]/8),ue=10*(ne[0]-8*te),de=10*(ne[1]-8*ae),xe=ee.getElevationAt(te,ae,!0,!0),we=ee.getMeterToDEM(K),me=Math.floor(.5*(ue*we-1)),Me=Math.floor(.5*(de*we-1)),ke=ee.tileCoordToPixel(te,ae),Be=2*me+1,He=2*Me+1,$e=function(dt,_t,Tt,Ct,vt){return[dt.getElevationAtPixel(_t,Tt,!0),dt.getElevationAtPixel(_t+vt,Tt,!0),dt.getElevationAtPixel(_t,Tt+vt,!0),dt.getElevationAtPixel(_t+Ct,Tt+vt,!0)]}(ee,ke.x-me,ke.y-Me,Be,He),qe=Math.abs($e[0]-$e[1]),st=Math.abs($e[2]-$e[3]),We=Math.abs($e[0]-$e[2])+Math.abs($e[1]-$e[3]),ct=Math.min(.25,.5*we*(qe+st)/Be),ft=Math.min(.25,.5*we*We/He);return xe+Math.max(ct*ue,ft*de)}(U,R,X):Q;return{base:Q+(r===0?-1:r),top:se?Math.max(W+y,Q+r+2):Q+y}}Ti(Kd,"FillExtrusionBucket",{omit:["layers","features"]}),Ti(gg,"PartData"),Ti(mg,"FootprintSegment"),Ti(_g,"BorderCentroidData"),Ti(vg,"GroundEffect");const D0=Tr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),k0=Tr([{name:"a_z_offset_width",components:3,type:"Float32"}],4),{members:R0}=D0,z0=Tr([{name:"a_packed",components:3,type:"Float32"}]),{members:L0}=z0,F0=Tr([{name:"a_pattern_data",components:3,type:"Float32"}]),{members:O0}=F0;class Dg{constructor(e,r){this.width=e,this.height=r,this.nextRow=0,this.image=new Oo({width:e,height:r}),this.positions={},this.uploaded=!1}getDash(e,r){const y=this.getKey(e,r);return this.positions[y]}trim(){const e=this.width,r=this.height=Gi(this.nextRow);this.image.resize({width:e,height:r})}getKey(e,r){return e.join(",")+r}getDashRanges(e,r,y){const U=[];let R=e.length%2==1?-e[e.length-1]*y:0,j=e[0]*y,X=!0;U.push({left:R,right:j,isDash:X,zeroLength:e[0]===0});let Q=e[0];for(let se=1;se<e.length;se++){X=!X;const W=e[se];R=Q*y,Q+=W,j=Q*y,U.push({left:R,right:j,isDash:X,zeroLength:W===0})}return U}addRoundDash(e,r,y){const U=r/2;for(let R=-y;R<=y;R++){const j=this.width*(this.nextRow+y+R);let X=0,Q=e[X];for(let se=0;se<this.width;se++){se/Q.right>1&&(Q=e[++X]);const W=Math.abs(se-Q.left),ee=Math.abs(se-Q.right),ne=Math.min(W,ee);let K;const te=R/y*(U+1);if(Q.isDash){const ae=U-Math.abs(te);K=Math.sqrt(ne*ne+ae*ae)}else K=U-Math.sqrt(ne*ne+te*te);this.image.data[j+se]=Math.max(0,Math.min(255,K+128))}}}addRegularDash(e,r){for(let Q=e.length-1;Q>=0;--Q){const se=e[Q],W=e[Q+1];se.zeroLength?e.splice(Q,1):W&&W.isDash===se.isDash&&(W.left=se.left,e.splice(Q,1))}const y=e[0],U=e[e.length-1];y.isDash===U.isDash&&(y.left=U.left-this.width,U.right=y.right+this.width);const R=this.width*this.nextRow;let j=0,X=e[j];for(let Q=0;Q<this.width;Q++){Q/X.right>1&&(X=e[++j]);const se=Math.abs(Q-X.left),W=Math.abs(Q-X.right),ee=Math.min(se,W);this.image.data[R+Q]=Math.max(0,Math.min(255,(X.isDash?ee:-ee)+r+128))}}addDash(e,r){const y=this.getKey(e,r);if(this.positions[y])return this.positions[y];const U=r==="round",R=U?7:0,j=2*R+1;if(this.nextRow+j>this.height)return zi("LineAtlas out of space"),null;e.length===0&&e.push(1);let X=0;for(let W=0;W<e.length;W++)e[W]<0&&(zi("Negative value is found in line dasharray, replacing values with 0"),e[W]=0),X+=e[W];if(X!==0){const W=this.width/X,ee=this.getDashRanges(e,this.width,W);U?this.addRoundDash(ee,W,R):this.addRegularDash(ee,r==="square"?.5*W:0)}const Q=this.nextRow+R;this.nextRow+=j;const se={tl:[Q,R],br:[X,0]};return this.positions[y]=se,se}}Ti(Dg,"LineAtlas");const B0=Nc.VectorTileFeature.types,N0=Math.cos(Math.PI/180*37.5),V0=Math.cos(Math.PI/180*5);class Df{constructor(e){this.evaluationGlobals={zoom:0,lineProgress:void 0},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(r=>r.fqid),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.hasZOffset=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new wl,this.layoutVertexArray2=new Zs,this.patternVertexArray=new Zs,this.indexArray=new On,this.programConfigurations=new Ra(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new an,this.maxLineLength=0,this.zOffsetVertexArray=new Zs,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id),this.tessellationStep=e.tessellationStep?e.tessellationStep:gi/64}updateFootprints(e,r){}populate(e,r,y,U){this.hasPattern=vf("line",this.layers,this.pixelRatio,r);const R=this.layers[0].layout.get("line-sort-key");this.tileToMeter=t(y);const j=this.layers[0].layout.get("line-z-offset"),X=j.isConstant()&&!j.constantOr(0),Q=this.layers[0].layout.get("line-elevation-reference");this.hasZOffset=Q==="sea"||Q==="ground"||!X&&Q==="none",this.hasZOffset&&Q==="none"&&zi(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`);const se=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope=this.hasZOffset&&se!==void 0;const W=[];for(const{feature:te,id:ae,index:ue,sourceLayerIndex:de}of e){const xe=this.layers[0]._featureFilter.needGeometry,we=pe(te,xe);if(!this.layers[0]._featureFilter.filter(new Nr(this.zoom),we,y))continue;const me=R?R.evaluate(we,{},y):void 0,Me={id:ae,properties:te.properties,type:te.type,sourceLayerIndex:de,index:ue,geometry:xe?we.geometry:he(te,y,U),patterns:{},sortKey:me};W.push(Me)}R&&W.sort((te,ae)=>te.sortKey-ae.sortKey);const{lineAtlas:ee,featureIndex:ne}=r,K=this.addConstantDashes(ee);for(const te of W){const{geometry:ae,index:ue,sourceLayerIndex:de}=te;if(K&&this.addFeatureDashes(te,ee),this.hasPattern){const xe=xf("line",this.layers,te,this.zoom,this.pixelRatio,r);this.patternFeatures.push(xe)}else this.addFeature(te,ae,ue,y,ee.positions,r.availableImages,r.brightness);ne.insert(e[ue].feature,ae,ue,de,this.index)}}addConstantDashes(e){let r=!1;for(const y of this.layers){const U=y.paint.get("line-dasharray").value,R=y.layout.get("line-cap").value;if(U.kind!=="constant"||R.kind!=="constant")r=!0;else{const j=R.value,X=U.value;if(!X)continue;e.addDash(X,j)}}return r}addFeatureDashes(e,r){const y=this.zoom;for(const U of this.layers){const R=U.paint.get("line-dasharray").value,j=U.layout.get("line-cap").value;if(R.kind==="constant"&&j.kind==="constant")continue;let X,Q;if(R.kind==="constant"){if(X=R.value,!X)continue}else X=R.evaluate({zoom:y},e);Q=j.kind==="constant"?j.value:j.evaluate({zoom:y},e),r.addDash(X,Q),e.patterns[U.id]=r.getKey(X,Q)}}update(e,r,y,U,R,j,X){this.programConfigurations.updatePaintArrays(e,r,R,y,U,j,X)}addFeatures(e,r,y,U,R,j){for(const X of this.patternFeatures)this.addFeature(X,X.geometry,X.index,r,y,U,j)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,L0)),this.patternVertexArray.length!==0&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,O0)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,k0.members,!0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,R0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,y,U,R,j,X){const Q=this.layers[0].layout,se=Q.get("line-join").evaluate(e,{}),W=Q.get("line-cap").evaluate(e,{}),ee=Q.get("line-miter-limit"),ne=Q.get("line-round-limit");this.lineClips=this.lineFeatureClips(e),this.lineFeature=e,this.zOffsetValue=Q.get("line-z-offset").value;const K=this.layers[0].paint.get("line-width").value;K.kind!=="constant"&&K.isLineProgressConstant===!1&&(this.variableWidthValue=K);for(const te of r)this.addLine(te,e,U,se,W,ee,ne);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,y,R,j,U,X)}addLine(e,r,y,U,R,j,X){this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineSoFar=0,this.currentVertex=void 0;const Q=U==="none";if(this.patternJoinNone=this.hasPattern&&Q,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let we=0;we<e.length-1;we++)this.totalDistance+=e[we].dist(e[we+1]);this.totalFeatureLength=this.totalDistance/(this.lineClips.end-this.lineClips.start),this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const se=B0[r.type]==="Polygon";let W=e.length;for(;W>=2&&e[W-1].equals(e[W-2]);)W--;let ee=0;for(;ee<W-1&&e[ee].equals(e[ee+1]);)ee++;if(W<(se?3:2))return;U==="bevel"&&(j=1.05);const ne=this.segments.prepareSegment(10*W,this.layoutVertexArray,this.indexArray);let K,te,ae,ue,de,xe;this.e1=this.e2=-1,se&&(K=e[W-2],de=e[ee].sub(K)._unit()._perp());for(let we=ee;we<W;we++){if(ae=we===W-1?se?e[ee+1]:void 0:e[we+1],ae&&e[we].equals(ae))continue;de&&(ue=de),K&&(te=K),K=e[we],xe=this.evaluateLineProgressFeatures(te?te.dist(K):0),de=ae?ae.sub(K)._unit()._perp():ue,ue=ue||de;const me=te&&ae;let Me=me?U:se||Q?"butt":R;const ke=ue.x*de.x+ue.y*de.y;if(Q){const ft=function(dt){if(dt.patternJoinNone){const _t=dt.segmentPoints.length/2,Tt=dt.lineSoFar-dt.segmentStart;for(let Ct=0;Ct<_t;++Ct){const vt=dt.segmentPoints[2*Ct+1],qt=Math.round(dt.segmentPoints[2*Ct])+.5+.25*vt;dt.patternVertexArray.emplaceBack(qt,Tt,dt.segmentStart),dt.patternVertexArray.emplaceBack(qt,Tt,dt.segmentStart)}dt.segmentPoints.length=0}dt.e1=dt.e2=-1};if(me&&ke<V0){this.updateDistance(te,K),this.addCurrentVertex(K,ue,1,1,ne,xe),ft(this),this.addCurrentVertex(K,de,-1,-1,ne,xe);continue}if(te){if(!ae){this.updateDistance(te,K),this.addCurrentVertex(K,ue,1,1,ne,xe),ft(this);continue}Me="miter"}}let Be=ue.add(de);Be.x===0&&Be.y===0||Be._unit();const He=Be.x*de.x+Be.y*de.y,$e=He!==0?1/He:1/0,qe=2*Math.sqrt(2-2*He),st=He<N0&&te&&ae,We=ue.x*de.y-ue.y*de.x>0,ct=this.overscaling<=16?15*gi/(512*this.overscaling):0;if(me&&Me==="round"){if($e<X)Me="miter";
273else if($e<=2){const ft=kf(K,-10,gi+10);Me=this.hasZOffset&&(ft||this.hasCrossSlope)?"miter":"fakeround"}}if(Me==="miter"&&$e>j&&(Me="bevel"),Me==="bevel"&&($e>2&&(Me="flipbevel"),$e<j&&(Me="miter")),te&&!(Me==="miter"&&st)&&this.updateDistance(te,K),Me==="miter")if(st){const ft=K.dist(te);if(ft>2*ct){const _t=K.sub(K.sub(te)._mult(ct/ft)._round());this.updateDistance(te,_t),this.addCurrentVertex(_t,ue,0,0,ne,xe),te=_t}this.updateDistance(te,K),Be._mult($e),this.addCurrentVertex(K,Be,0,0,ne,xe);const dt=K.dist(ae);if(dt>2*ct){const _t=K.add(ae.sub(K)._mult(ct/dt)._round());this.updateDistance(K,_t),this.addCurrentVertex(_t,de,0,0,ne,xe),K=_t}}else Be._mult($e),this.addCurrentVertex(K,Be,0,0,ne,xe);else if(Me==="flipbevel"){if($e>100)Be=de.mult(-1);else{const ft=$e*ue.add(de).mag()/ue.sub(de).mag();Be._perp()._mult(ft*(We?-1:1))}this.addCurrentVertex(K,Be,0,0,ne,xe),this.addCurrentVertex(K,Be.mult(-1),0,0,ne,xe)}else if(Me==="bevel"||Me==="fakeround"){xe!=null&&te&&this.addCurrentVertex(K,ue,-1,-1,ne,xe);const ft=K.dist(te)<=2*ct&&Me!=="bevel",dt=Be.mult(We?1:-1);dt._mult($e);const _t=de.mult(We?-1:1),Tt=ue.mult(We?-1:1),Ct=this.evaluateLineProgressFeatures(this.distance);if(xe==null&&(this.addHalfVertex(K,dt.x,dt.y,!1,!We,0,ne,Ct),ft||this.addHalfVertex(K,dt.x+2*Tt.x,dt.y+2*Tt.y,!1,We,0,ne,Ct)),Me==="fakeround"){const vt=Math.round(180*qe/Math.PI/20);this.addHalfVertex(K,Tt.x,Tt.y,!1,We,0,ne,Ct);for(let qt=0;qt<vt;qt++){let ei=qt/vt;if(ei!==.5){const yi=ei-.5;ei+=ei*yi*(ei-1)*((1.0904+ke*(ke*(3.55645-1.43519*ke)-3.2452))*yi*yi+(.848013+ke*(.215638*ke-1.06021)))}const Gt=_t.sub(Tt)._mult(ei)._add(Tt)._unit();this.addHalfVertex(K,Gt.x,Gt.y,!1,We,0,ne,Ct)}this.addHalfVertex(K,_t.x,_t.y,!1,We,0,ne,Ct)}ft||xe!=null||this.addHalfVertex(K,dt.x+2*_t.x,dt.y+2*_t.y,!1,We,0,ne,Ct),xe!=null&&ae&&this.addCurrentVertex(K,de,1,1,ne,xe)}else Me==="butt"?this.addCurrentVertex(K,Be,0,0,ne,xe):Me==="square"?(te||this.addCurrentVertex(K,Be,-1,-1,ne,xe),this.addCurrentVertex(K,Be,0,0,ne,xe),te&&this.addCurrentVertex(K,Be,1,1,ne,xe)):Me==="round"&&(te&&(this.addCurrentVertex(K,ue,0,0,ne,xe),this.addCurrentVertex(K,ue,1,1,ne,xe,!0)),ae&&(this.addCurrentVertex(K,de,-1,-1,ne,xe,!0),this.addCurrentVertex(K,de,0,0,ne,xe)))}}addVerticesTo(e,r,y,U,R,j,X,Q,se,W){const ee=(r.w-e.w)/this.tessellationStep|0;let ne=0;const K=this.scaledDistance;if(ee>1){this.lineSoFar=e.w;const ae=(r.x-e.x)/ee,ue=(r.y-e.y)/ee,de=(r.z-e.z)/ee,xe=(r.w-e.w)/ee;for(let we=1;we<ee;++we){e.x+=ae,e.y+=ue,e.z+=de,this.lineSoFar+=xe,ne+=xe;const me=this.evaluateLineProgressFeatures(this.prevDistance+ne);this.scaledDistance=(this.prevDistance+ne)/this.totalDistance,this.addHalfVertex(e,y,U,W,!1,X,se,me),this.addHalfVertex(e,R,j,W,!0,-Q,se,me)}}this.lineSoFar=r.w,this.scaledDistance=K;const te=this.evaluateLineProgressFeatures(this.distance);this.addHalfVertex(r,y,U,W,!1,X,se,te),this.addHalfVertex(r,R,j,W,!0,-Q,se,te)}evaluateLineProgressFeatures(e){if(!this.variableWidthValue&&!this.hasZOffset)return null;this.evaluationGlobals.lineProgress=0,this.lineClips?this.evaluationGlobals.lineProgress=Math.min(1,(this.totalFeatureLength*this.lineClips.start+e)/this.totalFeatureLength):zi(`line-progress evaluation for ${this.layerIds[0]} requires enabling 'lineMetrics' for the source.`);let r=0;return this.variableWidthValue&&this.variableWidthValue.kind!=="constant"&&(r=this.variableWidthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0),this.hasZOffset?this.zOffsetValue.kind==="constant"?{zOffset:this.zOffsetValue.value,variableWidth:r}:{zOffset:this.zOffsetValue.evaluate(this.evaluationGlobals,this.lineFeature)||0,variableWidth:r}:{zOffset:0,variableWidth:r}}addCurrentVertex(e,r,y,U,R,j,X=!1){const Q=r.x+r.y*y,se=r.y-r.x*y,W=r.y*U-r.x,ee=-r.y-r.x*U;if(j!=null){const ne=this.hasZOffset,K=-10,te=gi+10,ae=j.zOffset,ue=new rg(e.x,e.y,ae,this.lineSoFar),de=!!ne&&kf(e,K,te),xe=this.lineSoFar,we=this.distance;if(this.currentVertex)if(de){const me=this.currentVertexIsOutside,Me=this.currentVertex,ke=new rg(e.x,e.y,ae,this.lineSoFar);if(sg(Me,ke,K,te),!kf(ke,K,te)){if(me){this.e1=this.e2=-1,this.distance-=Me.dist(ue),this.lineS
vendor: 4,397 bytes, line 273
273oFar=Me.w;const Be=this.evaluateLineProgressFeatures(Me.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(Me,Q,se,X,!1,y,R,Be),this.addHalfVertex(Me,W,ee,X,!0,-U,R,Be),this.prevDistance=this.distance}this.distance=this.prevDistance+Me.dist(ke),this.scaledDistance=this.distance/this.totalDistance,this.addVerticesTo(Me,ke,Q,se,W,ee,y,U,R,X),this.distance=we,this.scaledDistance=this.distance/this.totalDistance}}else{const me=this.currentVertex;if(this.currentVertexIsOutside){sg(me,ue,K,te),this.e1=this.e2=-1,this.distance-=me.dist(ue),this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=me.w;const Me=this.evaluateLineProgressFeatures(me.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(me,Q,se,X,!1,y,R,Me),this.addHalfVertex(me,W,ee,X,!0,-U,R,Me),this.prevDistance=this.distance,this.distance=we,this.scaledDistance=this.distance/this.totalDistance}this.addVerticesTo(me,ue,Q,se,W,ee,y,U,R,X)}else de||(this.addHalfVertex(e,Q,se,X,!1,y,R,j),this.addHalfVertex(e,W,ee,X,!0,-U,R,j));this.currentVertex=ue,this.currentVertexIsOutside=de,this.lineSoFar=xe}else this.addHalfVertex(e,Q,se,X,!1,y,R,j),this.addHalfVertex(e,W,ee,X,!0,-U,R,j)}addHalfVertex({x:e,y:r},y,U,R,j,X,Q,se){if(this.patternJoinNone&&(this.segmentPoints.length===0&&(this.segmentStart=this.lineSoFar,this.segmentStartf32=Math.fround(this.lineSoFar)),j||this.segmentPoints.push(this.lineSoFar-this.segmentStart,X)),this.layoutVertexArray.emplaceBack((e<<1)+(R?1:0),(r<<1)+(j?1:0),Math.round(63*y)+128,Math.round(63*U)+128,1+(X===0?0:X<0?-1:1),0,this.lineSoFar-this.segmentStartf32),this.lineClips){const ee=Bi(this.lineClips.start,this.lineClips.end,this.scaledDistance);this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,ee)}const W=Q.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,W),Q.primitiveLength++),j?this.e2=W:this.e1=W,se!=null&&this.zOffsetVertexArray.emplaceBack(se.zOffset,se.variableWidth,se.variableWidth)}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(e,r){this.prevDistance=this.distance,this.distance+=e.dist(r),this.updateScaledDistance()}}function kf(h,e,r){return h.x<e||h.x>r||h.y<e||h.y>r}let kg,Rg;function zg(h,e,r){return e*(gi/(h.tileSize*Math.pow(2,r-h.tileID.overscaledZ)))}Ti(Df,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const Lg=(h,e,r)=>(1-r)*h+r*e;function Fg(h,e){return 1/zg(h,1,e.tileZoom)}function Og(h,e,r,y){return h.translatePosMatrix(y||e.tileID.projMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Bg=h=>{const e=[];Ng(h)&&e.push("RENDER_LINE_DASH"),h.paint.get("line-gradient")&&e.push("RENDER_LINE_GRADIENT");const r=h.paint.get("line-trim-offset");r[0]===0&&r[1]===0||e.push("RENDER_LINE_TRIM_OFFSET"),h.paint.get("line-border-width").constantOr(1)!==0&&e.push("RENDER_LINE_BORDER");const y=h.layout.get("line-join").constantOr("miter")==="none",U=!!h.paint.get("line-pattern").constantOr(1);return y&&U&&e.push("LINE_JOIN_NONE"),e};function Ng(h){const e=h.paint.get("line-dasharray").value;return e.value||e.kind!=="constant"}let Rf;const Vg=()=>Rf||(Rf={layout:kg||(kg=new Wr({"line-cap":new bi(Rt.layout_line["line-cap"]),"line-join":new bi(Rt.layout_line["line-join"]),"line-miter-limit":new oi(Rt.layout_line["line-miter-limit"]),"line-round-limit":new oi(Rt.layout_line["line-round-limit"]),"line-sort-key":new bi(Rt.layout_line["line-sort-key"]),"line-z-offset":new bi(Rt.layout_line["line-z-offset"]),"line-elevation-reference":new oi(Rt.layout_line["line-elevation-reference"]),"line-cross-slope":new oi(Rt.layout_line["line-cross-slope"]),visibility:new oi(Rt.layout_line.visibility),"line-width-unit":new oi(Rt.layout_line["line-width-unit"])})),paint:Rg||(Rg=new Wr({"line-opacity":new bi(Rt.paint_line["line-opacity"]),"line-color":new bi(Rt.paint_line["line-color"]),"line-translate":new oi(Rt.paint_line["line-translate"]),"line-translate-anchor":new oi(Rt.paint_line["line-translate-anchor"]),"line-width":new bi(Rt.paint_line["line-width"]),"line-gap-width":new bi(Rt.paint_line["line-gap-width"]),"line-offset":new bi(Rt.paint_line["line-offset"]),"line-blur"
vendor: 5,357 bytes, line 273
273:new bi(Rt.paint_line["line-blur"]),"line-dasharray":new bi(Rt.paint_line["line-dasharray"]),"line-pattern":new bi(Rt.paint_line["line-pattern"]),"line-gradient":new Mo(Rt.paint_line["line-gradient"]),"line-trim-offset":new oi(Rt.paint_line["line-trim-offset"]),"line-trim-fade-range":new oi(Rt.paint_line["line-trim-fade-range"]),"line-trim-color":new oi(Rt.paint_line["line-trim-color"]),"line-emissive-strength":new oi(Rt.paint_line["line-emissive-strength"]),"line-border-width":new bi(Rt.paint_line["line-border-width"]),"line-border-color":new bi(Rt.paint_line["line-border-color"]),"line-occlusion-opacity":new oi(Rt.paint_line["line-occlusion-opacity"]),"line-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"line-gradient-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},Rf);class U0 extends bi{possiblyEvaluate(e,r){return r=new Nr(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,y,U){return r=ai({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,y,U)}}let Mu;function Ug(h,e){return e>0?e+2*h:h}const j0=Tr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),G0=Tr([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),q0=Tr([{name:"a_projected_pos",components:4,type:"Float32"}],4);Tr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const $0=Tr([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),H0=Tr([{name:"a_texb",components:2,type:"Uint16"}]),W0=Tr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),Z0=Tr([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);Tr([{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 jg=Tr([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),X0=Tr([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Tr([{name:"triangle",components:3,type:"Uint16"}]),Tr([{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"}]),Tr([{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"}]),Tr([{type:"Float32",name:"offsetX"}]),Tr([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Yn=24;const ma=128;function zf(h,e,r,y,U){if(h.kind==="camera")return h.maxSize;if(h.kind==="composite"){const R=e.possiblyEvaluate(new Nr(h.maxZoom),r).evaluate(U,{}
273,r),j=e.possiblyEvaluate(new Nr(h.minZoom),r).evaluate(U,{},r);return Math.max(R,j)}return e.possiblyEvaluate(new Nr(y)).evaluate(U,{},r)}function Lf(h,e){const{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Nr(h+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:y,interpolationType:U}=r;let R=0;for(;R<y.length&&y[R]<=h;)R++;R=Math.max(0,R-1);let j=R;for(;j<y.length&&y[j]<h+1;)j++;j=Math.min(y.length-1,j);const X=y[R],Q=y[j];return r.kind==="composite"?{kind:"composite",minZoom:X,maxZoom:Q,interpolationType:U}:{kind:"camera",minZoom:X,maxZoom:Q,minSize:r.evaluate(new Nr(X)),maxSize:r.evaluate(new Nr(Q)),interpolationType:U}}}function Qd(h,{uSize:e,uSizeT:r},{lowerSize:y,upperSize:U}){return h.kind==="source"?y/ma:h.kind==="composite"?Bi(y/ma,U/ma,r):e}function Vc(h,e,r=1){let y=0,U=0;if(h.kind==="constant")U=h.layoutSize*r;else if(h.kind!=="source"){const{interpolationType:R,minZoom:j,maxZoom:X}=h,Q=R?Ue(us.interpolationFactor(R,e,j,X),0,1):0;h.kind==="camera"?U=Bi(h.minSize,h.maxSize,Q)*r:y=Q*r}return{uSizeT:y,uSize:U}}var Y0=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:ma,evaluateSizeForFeature:Qd,evaluateSizeForZoom:Vc,getRasterizedIconSize:zf,getSizeData:Lf});function J0(h,e,r){return h.sections.forEach(y=>{y.text=function(U,R,j){const X=R.layout.get("text-transform").evaluate(j,{});return X==="uppercase"?U=U.toLocaleUpperCase():X==="lowercase"&&(U=U.toLocaleLowerCase()),_s.applyArabicShaping&&(U=_s.applyArabicShaping(U)),U}(y.text,e,r)}),h}const Pu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};
vendor: 5,054 bytes, line 273
273function K0(h){return h==="︶"||h==="﹈"||h==="︸"||h==="﹄"||h==="﹂"||h==="︾"||h==="︼"||h==="︺"||h==="︘"||h==="﹀"||h==="︐"||h==="︓"||h==="︔"||h==="`"||h===" ̄"||h==="︑"||h==="︒"}function Q0(h){return h==="︵"||h==="﹇"||h==="︷"||h==="﹃"||h==="﹁"||h==="︽"||h==="︻"||h==="︹"||h==="︗"||h==="︿"}var Gg,Ff,qg,Of={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function ev(){return Gg||(Gg=1,Of.read=function(h,e,r,y,U){var R,j,X=8*U-y-1,Q=(1<<X)-1,se=Q>>1,W=-7,ee=r?U-1:0,ne=r?-1:1,K=h[e+ee];for(ee+=ne,R=K&(1<<-W)-1,K>>=-W,W+=X;W>0;R=256*R+h[e+ee],ee+=ne,W-=8);for(j=R&(1<<-W)-1,R>>=-W,W+=y;W>0;j=256*j+h[e+ee],ee+=ne,W-=8);if(R===0)R=1-se;else{if(R===Q)return j?NaN:1/0*(K?-1:1);j+=Math.pow(2,y),R-=se}return(K?-1:1)*j*Math.pow(2,R-y)},Of.write=function(h,e,r,y,U,R){var j,X,Q,se=8*R-U-1,W=(1<<se)-1,ee=W>>1,ne=U===23?Math.pow(2,-24)-Math.pow(2,-77):0,K=y?0:R-1,te=y?1:-1,ae=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(X=isNaN(e)?1:0,j=W):(j=Math.floor(Math.log(e)/Math.LN2),e*(Q=Math.pow(2,-j))<1&&(j--,Q*=2),(e+=j+ee>=1?ne/Q:ne*Math.pow(2,1-ee))*Q>=2&&(j++,Q/=2),j+ee>=W?(X=0,j=W):j+ee>=1?(X=(e*Q-1)*Math.pow(2,U),j+=ee):(X=e*Math.pow(2,ee-1)*Math.pow(2,U),j=0));U>=8;h[r+K]=255&X,K+=te,X/=256,U-=8);for(j=j<<U|X,se+=U;se>0;h[r+K]=255&j,K+=te,j/=256,se-=8);h[r+K-te]|=128*ae}),Of}function $g(){if(qg)return Ff;qg=1,Ff=e;var h=ev();function e(me){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(me)?me:new Uint8Array(me||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var r=4294967296,y=1/r,U=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function R(me){return me.type===e.Bytes?me.readVarint()+me.pos:me.pos+1}function j(me,Me,ke){return ke?4294967296*Me+(me>>>0):4294967296*(Me>>>0)+(me>>>0)}function X(me,Me,ke){var Be=Me<=16383?1:Me<=2097151?2:Me<=268435455?3:Math.floor(Math.log(Me)/(7*Math.LN2));ke.realloc(Be);for(var He=ke.pos-1;He>=me;He--)ke.buf[He+Be]=ke.buf[He]}function Q(me,Me){for(var ke=0;ke<me.length;ke++)Me.writeVarint(me[ke])}function se(me,Me){for(var ke=0;ke<me.length;ke++)Me.writeSVarint(me[ke])}function W(me,Me){for(var ke=0;ke<me.length;ke++)Me.writeFloat(me[ke])}function ee(me,Me){for(var ke=0;ke<me.length;ke++)Me.writeDouble(me[ke])}function ne(me,Me){for(var ke=0;ke<me.length;ke++)Me.writeBoolean(me[ke])}function K(me,Me){for(var ke=0;ke<me.length;ke++)Me.writeFixed32(me[ke])}function te(me,Me){for(var ke=0;ke<me.length;ke++)Me.writeSFixed32(me[ke])}function ae(me,Me){for(var ke=0;ke<me.length;ke++)Me.writeFixed64(me[ke])}function ue(me,Me){for(var ke=0;ke<me.length;ke++)Me.writeSFixed64(me[ke])}function de(me,Me){return(me[Me]|me[Me+1]<<8|me[Me+2]<<16)+16777216*me[Me+3]}function xe(me,Me,ke){me[ke]=Me,me[ke+1]=Me>>>8,me[ke+2]=Me>>>16,me[ke+3]=Me>>>24}function we(me,Me){return(me[Me]|me[Me+1]<<8|me[Me+2]<<16)+(me[Me+3]<<24)}return e.prototype={destroy:function(){this.buf=null},readFields:function(me,Me,ke){for(ke=ke||this.length;this.pos<ke;){var Be=this.readVarint(),He=Be>>3,$e=this.pos;this.type=7&Be,me(He,Me,this),this.pos===$e&&this.skip(Be)}return Me},readMessage:function(me,Me){return this.readFields(me,Me,this.readVarint()+this.pos)},readFixed32:function(){var me=de(this.buf,this.pos);return this.pos+=4,me},readSFixed32:function(){var me=we(this.buf,this.pos);return this.pos+=4,me},readFixed64:function(){var me=de(this.buf,this.pos)+de(this.buf,this.pos+4)*r;return this.pos+=8,me},readSFixed64:function(){var me=de(this.buf,this.pos)+we(this.buf,this.pos+4)*r;return this.pos+=8,me},readFloat:function(){var me=h.read(this.buf,this.pos,!0,23,4);return this.pos+=4,me},readDouble:function(){var me=h.read(this.buf,this.pos,!0,52,8);return this.pos+=8,me},readVarint:function(me){var Me,ke,Be=this.buf;return Me=127&(ke=Be[this.pos++]),ke<128?Me:(Me|=(127&(ke=Be[this.pos++]))<<7,ke<128?Me:(Me|=(127&(ke=Be[this.pos++]))<<14,ke<128?Me:(Me|=(127&(ke=Be[this.pos++]))<<21,ke<128?Me:function(He,$e,qe){var st,We,ct=qe.buf;if(st=(112&(We=ct[qe.pos++]))>>4,We<128||(st|=(127&(We=ct[qe.pos++]))<<3,We<128)||(st|=(127&(We=ct[qe.pos++]))<<10,We<128)||(st|=(127&(We=ct[qe.pos++]))<<17,We<128)||(st|=(127&(We=ct[qe.pos++]))<<24,We<128)||(st|=(1&(We=ct[qe.pos++]))<<31,We<128))return j(He,st,$e);throw new Error("Expected varint not more than 10 bytes")}(Me|=(15&(ke=Be[this.pos]))<<28,me,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var me=this.readVarint();return me%2==1?(me+1)/-2:me/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var me=this.readVarint()+this.pos,Me=this.pos;return this.pos=me,me-Me>=12&&U?function(ke,Be,He){return U.decode(ke.subarray(Be,He))}(this.buf,Me,me):function(ke,Be,He){for(var $e="",qe=Be;qe<He;){var st,We,ct,ft=ke[qe],dt=null,_t=ft>239?4:ft>223?3:ft>191?2:1;if(qe+_t>He)break;_t===1?ft<128&&(dt=ft):_t===2?(192&(st=ke[qe+1]))==128&&(dt=(31&ft)<<6|63&st)<=127&&(dt=null):_t===3?(We=ke[qe+2],(192&(st=ke[qe+1]))==128&&(192&We)==128&&((dt=(1
vendor: 6,510 bytes, line 273
2735&ft)<<12|(63&st)<<6|63&We)<=2047||dt>=55296&&dt<=57343)&&(dt=null)):_t===4&&(We=ke[qe+2],ct=ke[qe+3],(192&(st=ke[qe+1]))==128&&(192&We)==128&&(192&ct)==128&&((dt=(15&ft)<<18|(63&st)<<12|(63&We)<<6|63&ct)<=65535||dt>=1114112)&&(dt=null)),dt===null?(dt=65533,_t=1):dt>65535&&(dt-=65536,$e+=String.fromCharCode(dt>>>10&1023|55296),dt=56320|1023&dt),$e+=String.fromCharCode(dt),qe+=_t}return $e}(this.buf,Me,me)},readBytes:function(){var me=this.readVarint()+this.pos,Me=this.buf.subarray(this.pos,me);return this.pos=me,Me},readPackedVarint:function(me,Me){if(this.type!==e.Bytes)return me.push(this.readVarint(Me));var ke=R(this);for(me=me||[];this.pos<ke;)me.push(this.readVarint(Me));return me},readPackedSVarint:function(me){if(this.type!==e.Bytes)return me.push(this.readSVarint());var Me=R(this);for(me=me||[];this.pos<Me;)me.push(this.readSVarint());return me},readPackedBoolean:function(me){if(this.type!==e.Bytes)return me.push(this.readBoolean());var Me=R(this);for(me=me||[];this.pos<Me;)me.push(this.readBoolean());return me},readPackedFloat:function(me){if(this.type!==e.Bytes)return me.push(this.readFloat());var Me=R(this);for(me=me||[];this.pos<Me;)me.push(this.readFloat());return me},readPackedDouble:function(me){if(this.type!==e.Bytes)return me.push(this.readDouble());var Me=R(this);for(me=me||[];this.pos<Me;)me.push(this.readDouble());return me},readPackedFixed32:function(me){if(this.type!==e.Bytes)return me.push(this.readFixed32());var Me=R(this);for(me=me||[];this.pos<Me;)me.push(this.readFixed32());return me},readPackedSFixed32:function(me){if(this.type!==e.Bytes)return me.push(this.readSFixed32());var Me=R(this);for(me=me||[];this.pos<Me;)me.push(this.readSFixed32());return me},readPackedFixed64:function(me){if(this.type!==e.Bytes)return me.push(this.readFixed64());var Me=R(this);for(me=me||[];this.pos<Me;)me.push(this.readFixed64());return me},readPackedSFixed64:function(me){if(this.type!==e.Bytes)return me.push(this.readSFixed64());var Me=R(this);for(me=me||[];this.pos<Me;)me.push(this.readSFixed64());return me},skip:function(me){var Me=7&me;if(Me===e.Varint)for(;this.buf[this.pos++]>127;);else if(Me===e.Bytes)this.pos=this.readVarint()+this.pos;else if(Me===e.Fixed32)this.pos+=4;else{if(Me!==e.Fixed64)throw new Error("Unimplemented type: "+Me);this.pos+=8}},writeTag:function(me,Me){this.writeVarint(me<<3|Me)},realloc:function(me){for(var Me=this.length||16;Me<this.pos+me;)Me*=2;if(Me!==this.length){var ke=new Uint8Array(Me);ke.set(this.buf),this.buf=ke,this.length=Me}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(me){this.realloc(4),xe(this.buf,me,this.pos),this.pos+=4},writeSFixed32:function(me){this.realloc(4),xe(this.buf,me,this.pos),this.pos+=4},writeFixed64:function(me){this.realloc(8),xe(this.buf,-1&me,this.pos),xe(this.buf,Math.floor(me*y),this.pos+4),this.pos+=8},writeSFixed64:function(me){this.realloc(8),xe(this.buf,-1&me,this.pos),xe(this.buf,Math.floor(me*y),this.pos+4),this.pos+=8},writeVarint:function(me){(me=+me||0)>268435455||me<0?function(Me,ke){var Be,He;if(Me>=0?(Be=Me%4294967296|0,He=Me/4294967296|0):(He=~(-Me/4294967296),4294967295^(Be=~(-Me%4294967296))?Be=Be+1|0:(Be=0,He=He+1|0)),Me>=18446744073709552e3||Me<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");ke.realloc(10),function($e,qe,st){st.buf[st.pos++]=127&$e|128,$e>>>=7,st.buf[st.pos++]=127&$e|128,$e>>>=7,st.buf[st.pos++]=127&$e|128,$e>>>=7,st.buf[st.pos++]=127&$e|128,st.buf[st.pos]=127&($e>>>=7)}(Be,0,ke),function($e,qe){var st=(7&$e)<<4;qe.buf[qe.pos++]|=st|(($e>>>=3)?128:0),$e&&(qe.buf[qe.pos++]=127&$e|(($e>>>=7)?128:0),$e&&(qe.buf[qe.pos++]=127&$e|(($e>>>=7)?128:0),$e&&(qe.buf[qe.pos++]=127&$e|(($e>>>=7)?128:0),$e&&(qe.buf[qe.pos++]=127&$e|(($e>>>=7)?128:0),$e&&(qe.buf[qe.pos++]=127&$e)))))}(He,ke)}(me,this):(this.realloc(4),this.buf[this.pos++]=127&me|(me>127?128:0),me<=127||(this.buf[this.pos++]=127&(me>>>=7)|(me>127?128:0),me<=127||(this.buf[this.pos++]=127&(me>>>=7)|(me>127?128:0),me<=127||(this.buf[this.pos++]=me>>>7&127))))},writeSVarint:function(me){this.writeVarint(me<0?2*-me-1:2*me)},writeBoolean:function(me){this.writeVarint(!!me)},writeString:function(me){me=String(me),this.realloc(4*me.length),this.pos++;var Me=this.pos;this.pos=function(Be,He,$e){for(var qe,st,We=0;We<He.length;We++){if((qe=He.charCodeAt(We))>55295&&qe<57344){if(!st){qe>56319||We+1===He.length?(Be[$e++]=239,Be[$e++]=191,Be[$e++]=189):st=qe;continue}if(qe<56320){Be[$e++]=239,Be[$e++]=191,Be[$e++]=189,st=qe;continue}qe=st-55296<<10|qe-56320|65536,st=null}else st&&(Be[$e++]=239,Be[$e++]=191,Be[$e++]=189,st=null);qe<128?Be[$e++]=qe:(qe<2048?Be[$e++]=qe>>6|192:(qe<65536?Be[$e++]=qe>>12|224:(Be[$e++]=qe>>18|240,Be[$e++]=qe>>12&63|128),Be[$e++]=qe>>6&63|128),Be[$e++]=63&qe|128)}return $e}(this.buf,me,this.pos);var ke=this.pos-Me;ke>=128&&X(Me,ke,this),this.pos=Me-1,this.writeVarint(ke),this.pos+=ke},writeFloat:function(me){this.realloc(4),h.write(this.buf,me,this.pos,!0,23,4),this.pos+=4},writeDouble:function(me){this.realloc(8),h.write(this.buf,me,this.pos,!0,52,8),this.pos+=8},writeBytes:function(me){var Me=me.length;this.writeVarint(Me),this.realloc(Me);for(var ke=0;ke<Me;ke++)this.buf[this.pos++]=me[ke]},writeRawMessage:function(me,Me){this.pos++;var ke=this.pos;me(Me,this);var Be=this.pos-ke;Be>=128&&X(ke,Be,this),this.pos=ke-1,this.writeVarint(Be),this.pos+=Be},writeMessage:function(me,Me,ke){this.writeTag(me,e.Bytes),this.writeRawMessage(Me,ke)},writePackedVarint:function(me,Me){Me.length&&this.writeMessage(me,Q,Me)},writePackedSVarint:function(me,Me){Me.length&&this.writeMessage(me,se,Me)},writePackedBoolean:function(me,Me){Me.length&&this.writeMessage(me,ne,Me)},writePackedFloat:function(me,Me){Me.length&&this.writeMessage(me,W,Me)},writePackedDouble:function(me,Me){Me.length&&this.writeMessage(me,ee,Me)},writePackedFixed32:function(me,Me){Me.length&&this.writeMessage(me,K,Me)},writePackedSFixed32:function(me,Me){Me.length&&this.writeMessage(me,te,Me)},writePackedFixed64:function(me,Me){Me.length&&this.writeMessage(me,ae,Me)},writePackedSFixed64:function(me,Me){Me.length&&this.writeMessage(me,ue,Me)},writeBytesField:function(me,Me){this.writeTag(me,e.Bytes),this.writeBytes(Me)},writeFixed32Field:function(me,Me){this.writeTag(me,e.Fixed32),this.writeFixed32(Me)},writeSFixed32Field:function(me,Me){this.writeTag(me,e.Fixed32),this.writeSFixed32(Me)},writeFixed64Field:function(me,Me){this.writeTag(me,e.Fixed64),this.writeFixed64
273(Me)},writeSFixed64Field:function(me,Me){this.writeTag(me,e.Fixed64),this.writeSFixed64(Me)},writeVarintField:function(me,Me){this.writeTag(me,e.Varint),this.writeVarint(Me)},writeSVarintField:function(me,Me){this.writeTag(me,e.Varint),this.writeSVarint(Me)},writeStringField:function(me,Me){this.writeTag(me,e.Bytes),this.writeString(Me)},writeFloatField:function(me,Me){this.writeTag(me,e.Fixed32),this.writeFloat(Me)},writeDoubleField:function(me,Me){this.writeTag(me,e.Fixed64),this.writeDouble(Me)},writeBooleanField:function(me,Me){this.writeVarintField(me,!!Me)}},Ff}var ep=Te($g());const Bf=3;function tv(h,e,r){e.glyphs=[],h===1&&r.readMessage(iv,e)}function iv(h,e,r){if(h===3){const{id:y,bitmap:U,width:R,height:j,left:X,top:Q,advance:se}=r.readMessage(rv,{});e.glyphs.push({id:y,bitmap:new Oo({width:R+2*Bf,height:j+2*Bf},U),metrics:{width:R,height:j,left:X,top:Q,advance:se}})}else h===4?e.ascender=r.readSVarint():h===5&&(e.descender=r.readSVarint())}function rv(h,e,r){h===1?e.id=r.readVarint():h===2?e.bitmap=r.readBytes():h===3?e.width=r.readVarint():h===4?e.height=r.readVarint():h===5?e.left=r.readSVarint():h===6?e.top=r.readSVarint():h===7&&(e.advance=r.readVarint())}const nv=Bf,Bs={horizontal:1,vertical:2,horizontalOnly:3};class Cu{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(e,r){const y=new Cu;return y.scale=e||1,y.fontStack=r,y}static forImage(e){const r=new Cu;return r.image=e,r}}class Uc{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){const y=new Uc;for(let U=0;U<e.sections.length;U++){const R=e.sections[U];R.image?y.addImageSection(R):y.addTextSection(R,r)}return y}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=function(r,y){let U="";for(let R=0;R<r.length;R++){const j=r.charCodeAt(R+1)||null,X=r.charCodeAt(R-1)||null;U+=!y&&(j&&Gh(j)&&!Pu[r[R+1]]||X&&Gh(X)&&!Pu[r[R-1]])||!Pu[r[R]]?r[R]:Pu[r[R]]}return U}(this.text,e)}trim(){let e=0;for(let y=0;y<this.text.length&&tp[this.text.charCodeAt(y)];y++)e++;let r=this.text.length;for(let y=this.text.length-1;y>=0&&y>=e&&tp[this.text.charCodeAt(y)];y--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const y=new Uc;return y.text=this.text.substring(e,r),y.sectionIndex=this.sectionIndex.slice(e,r),y.sections=this.sections,y}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(Cu.forText(e.scale,e.fontStack||r));const y=this.sections.length-1;for(let U=0;U<e.text.length;++U)this.sectionIndex.push(y)}addImageSection(e){const r=e.image&&e.image.namePrimary?e.image.getPrimary():null;if(!r)return void zi("Can't add FormattedSection with an empty image.");const y=this.getNextImageSectionCharCode();y?(this.text+=String.fromCodePoint(y),this.sections.push(Cu.forImage(r)),this.sectionIndex.push(this.sections.length-1)):zi("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Nf(h,e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te){const ae=Uc.fromFeature(h,U);ee===Bs.vertical&&ae.verticalizePunctuation(ne);let ue=[];const de=function(ke,Be,He,$e,qe,st){if(!ke)return[];const We=[],ct=function(Tt,Ct,vt,qt,ei,Gt){let yi=0;for(let mi=0;mi<Tt.length();mi++){const ni=Tt.getSection(mi);yi+=Hg(Tt.getCodePoint(mi),ni,qt,ei,Ct,Gt)}return yi/Math.max(1,Math.ceil(yi/vt))}(ke,Be,He,$e,qe,st),ft=ke.text.indexOf("​")>=0;let dt=0;for(let Tt=0;Tt<ke.length();Tt++){const Ct=ke.getSection(Tt),vt=ke.getCodePoint(Tt);if(tp[vt]||(dt+=Hg(vt,Ct,$e,qe,Be,st)),Tt<ke.length()-1){const qt=!((_t=vt)<11904||!(Mi["Bopomofo Extended"](_t)||Mi.Bopomofo(_t)||Mi["CJK Compatibility Forms"](_t)||Mi["CJK Compatibility Ideographs"](_t)||Mi["CJ
273K Compatibility"](_t)||Mi["CJK Radicals Supplement"](_t)||Mi["CJK Strokes"](_t)||Mi["CJK Symbols and Punctuation"](_t)||Mi["CJK Unified Ideographs Extension A"](_t)||Mi["CJK Unified Ideographs"](_t)||Mi["Enclosed CJK Letters and Months"](_t)||Mi["Halfwidth and Fullwidth Forms"](_t)||Mi.Hiragana(_t)||Mi["Ideographic Description Characters"](_t)||Mi["Kangxi Radicals"](_t)||Mi["Katakana Phonetic Extensions"](_t)||Mi.Katakana(_t)||Mi["Vertical Forms"](_t)||Mi["Yi Radicals"](_t)||Mi["Yi Syllables"](_t)));(sv[vt]||qt||Ct.image)&&We.push(Zg(Tt+1,dt,ct,We,av(vt,ke.getCodePoint(Tt+1),qt&&ft),!1))}}var _t;return Xg(Zg(ke.length(),dt,ct,We,0,!0))}(ae,se,R,e,y,K),{processBidirectionalText:xe,processStyledBidirectionalText:we}=_s;if(xe&&ae.sections.length===1){const ke=xe(ae.toString(),de);for(const Be of ke){const He=new Uc;He.text=Be,He.sections=ae.sections;for(let $e=0;$e<Be.length;$e++)He.sectionIndex.push(0);ue.push(He)}}else if(we){const ke=we(ae.text,ae.sectionIndex,de);for(const Be of ke){const He=new Uc;He.text=Be[0],He.sectionIndex=Be[1],He.sections=ae.sections,ue.push(He)}}else ue=function(ke,Be){const He=[],$e=ke.text;let qe=0;for(const st of Be)He.push(ke.substring(qe,st)),qe=st;return qe<$e.length&&He.push(ke.substring(qe,$e.length)),He}(ae,de);const me=[],Me={positionedLines:me,text:ae.toString(),top:W[1],bottom:W[1],left:W[0],right:W[0],writingMode:ee,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(ke,Be,He,$e,qe,st,We,ct,ft,dt,_t,Tt){let Ct=0,vt=0,qt=0;const ei=ct==="right"?1:ct==="left"?0:.5;let Gt=!1;for(const vi of qe){const wi=vi.getSections();for(const ji of wi){if(ji.image)continue;const Ji=Be[ji.fontStack];if(Ji&&(Gt=Ji.ascender!==void 0&&Ji.descender!==void 0,!Gt))break}if(!Gt)break}let yi=0;for(const vi of qe){vi.trim();const wi=vi.getMaxScale(),ji=(wi-1)*Yn,Ji={positionedGlyphs:[],lineOffset:0};ke.positionedLines[yi]=Ji;const Ki=Ji.positionedGlyphs;let Qi=0;if(!vi.length()){vt+=st,++yi;continue}let nr=0,sr=0;for(let Dr=0;Dr<vi.length();Dr++){const Wi=vi.getSection(Dr),Mr=vi.getSectionIndex(Dr),Ir=vi.getCodePoint(Dr);let $r=Wi.scale,un=null,Sn=null,dn=null,Qr=Yn,yn=0;const En=!(ft===Bs.horizontal||!_t&&!yc(Ir)||_t&&(tp[Ir]||(mi=Ir,Mi.Arabic(mi)||Mi["Arabic Supplement"](mi)||Mi["Arabic Extended-A"](mi)||Mi["Arabic Presentation Forms-A"](mi)||Mi["Arabic Presentation Forms-B"](mi))));if(Wi.image){const Jn=$e[Wi.image.serialize()];if(!Jn)continue;dn=Wi.image.id,ke.iconsInText=ke.iconsInText||!0,Sn=Jn.paddedRect;const jr=Jn.displaySize;$r=$r*Yn/Tt,un={width:jr[0],height:jr[1],left:0,top:-3,advance:En?jr[1]:jr[0],localGlyph:!1},yn=Gt?-un.height*$r:wi*Yn-17-jr[1]*$r,Qr=un.advance;const ws=(En?jr[0]:jr[1])*$r-Yn*wi;ws>0&&ws>Qi&&(Qi=ws)}else{const Jn=He[Wi.fontStack];if(!Jn)continue;Jn[Ir]&&(Sn=Jn[Ir]);const jr=Be[Wi.fontStack];if(!jr)continue;const ws=jr.glyphs[Ir];if(!ws)continue;if(un=ws.metrics,Qr=Ir!==8203?Yn:0,Gt){const xa=jr.ascender!==void 0?Math.abs(jr.ascender):0,ta=jr.descender!==void 0?Math.abs(jr.descender):0,ia=(xa+ta)*$r;nr<ia&&(nr=ia,sr=(xa-ta)/2*$r),yn=-xa*$r}else yn=(wi-$r)*Yn-17}En?(ke.verticalizable=!0,Ki.push({glyph:Ir,imageName:dn,x:Ct,y:vt+yn,vertical:En,scale:$r,localGlyph:un.localGlyph,fontStack:Wi.fontStack,sectionIndex:Mr,metrics:un,rect:Sn}),Ct+=Qr*$r+dt):(Ki.push({glyph:Ir,imageName:dn,x:Ct,y:vt+yn,vertical:En,scale:$r,localGlyph:un.localGlyph,fontStack:Wi.fontStack,sectionIndex:Mr,metrics:un,rect:Sn}),Ct+=un.advance*$r+dt)}Ki.length!==0&&(qt=Math.max(Ct-dt,qt),Gt?Yg(Ki,ei,Qi,sr,st*wi/2):Yg(Ki,ei,Qi,0,st/2)),Ct=0;const Br=st*wi+Qi;Ji.lineOffset=Math.max(Qi,ji),vt+=Br,++yi}var mi;const ni=vt,{horizontalAlign:ti,verticalAlign:Ai}=Vf(We);(function(vi,wi,ji,Ji,Ki,Qi){const nr=(wi-ji)*Ki,sr=-Qi*Ji;for(const Br of vi)for(const Dr of Br.positionedGlyphs)Dr.x+=nr,Dr.y+=sr})(ke.positionedLines,ei,ti,Ai,qt,ni),ke.top+=-Ai*ni,ke.bottom=ke.top+ni,ke.left+=-ti*qt,ke.right=ke.left+qt,ke.hasBaseline=Gt}(Me,e,r,y,ue,j,X,Q,ee,se,ne,te),!function(ke){for(const Be of ke)if(Be.positionedGlyphs.length!==0)return!1;return!0}(me)&&Me}const tp={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},sv={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 Hg(h,e,r,y,U,R){if(e.image){const j=y[e.image.serialize()];return j?j.displaySize[0]*e.scale*Yn/R+U:0}{const j=r[e.fontStack],X=j&&j.glyphs[h];return X?X.metrics.advance*e.scale+U:0}}function Wg(h,e,r,y){const U=Math.pow(h-e,2);return y?h<e?U/2:2*U:U+Math.abs(r)*r}function av(h,e,r){let y=0;return h===10&&(y-=1e4),r&&(y+=150),h!==40&&h!==65288||(y+=50),e!==41&&e!==65289||(y+=50),y}function Zg(h,e,r,y,U,R){let j=null,X=Wg(e,r,U,R);for(const Q of y){const se=Wg(e-Q.x,r,U,R)+Q.badness;se<=X&&(j=Q,X=se)}return{index:h,x:e,priorBreak:j,badness:X}}function Xg(h){return h?Xg(h.priorBreak).concat(h.index):[]}function Vf(h){let e=.5,r=.5;switch(h){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(h){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Yg(h,e,r,y,U){if(!(e||r||y||U))return;const R=h.length-1,j=h[R],X=(j.x+j.metrics.advance*j.scale)*e;for(let Q=0;Q<=R;Q++)h[Q].x-=X,h[Q].y+=r+y+U}function ov(h,e,r,y){const{horizontalAlign:U,verticalAlign:R}=Vf(y),j=r[0]-h.displaySize[0]*U,X=r[1]-h.displaySize[1]*R;return{imagePrimary:h,imageSecondary:e,top:X,bottom:X+h.displaySize[1],left:j,right:j+h.displaySize[0]}}function Jg(h,e,r,y,U,R){const j=h.imagePrimary;let X;if(j.content){const ue=j.content,de=j.pixelRatio||1;X=[ue[0]/de,ue[1]/de,j.displaySize[0]-ue[2]/de,j.displaySize[1]-ue[3]/de]}const Q=e.left*R,se=e.right*R;let W,ee,ne,K;r==="width"||r==="both"?(K=U[0]+Q-y[3],ee=U[0]+se+y[1]):(K=U[0]+(Q+se-j.displaySize[0])/2,ee=K+j.displaySize[0]);const te=e.top*R,ae=e.bottom*R;return r==="height"||r==="both"?(W=U[1]+te-y[0],ne=U[1]+ae+y[2]):(W=U[1]+(te+ae-j.displaySize[1])/2,ne=W+j.displaySize[1]),{imagePrimary:j,imageSecondary:void 0,top:W,right:ee,bottom:ne,left:K,
vendor: 5,756 bytes, line 273
273collisionPadding:X}}class co extends Ht{constructor(e,r,y,U,R){super(e,r),this.angle=U,this.z=y,R!==void 0&&(this.segment=R)}clone(){return new co(this.x,this.y,this.z,this.angle,this.segment)}}function Kg(h,e,r,y,U){if(e.segment===void 0)return!0;let R=e,j=e.segment+1,X=0;for(;X>-r/2;){if(j--,j<0)return!1;X-=h[j].dist(R),R=h[j]}X+=h[j].dist(h[j+1]),j++;const Q=[];let se=0;for(;X<r/2;){const W=h[j],ee=h[j+1];if(!ee)return!1;let ne=h[j-1].angleTo(W)-W.angleTo(ee);for(ne=Math.abs((ne+3*Math.PI)%(2*Math.PI)-Math.PI),Q.push({distance:X,angleDelta:ne}),se+=ne;X-Q[0].distance>y;)se-=Q.shift().angleDelta;if(se>U)return!1;j++,X+=W.dist(ee)}return!0}function Qg(h){let e=0;for(let r=0;r<h.length-1;r++)e+=h[r].dist(h[r+1]);return e}function e_(h,e,r){return h?.6*e*r:0}function t_(h,e){return Math.max(h?h.right-h.left:0,e?e.right-e.left:0)}function lv(h,e,r,y,U,R){const j=e_(r,U,R),X=t_(r,y)*R;let Q=0;const se=Qg(h)/2;for(let W=0;W<h.length-1;W++){const ee=h[W],ne=h[W+1],K=ee.dist(ne);if(Q+K>se){const te=(se-Q)/K,ae=Bi(ee.x,ne.x,te),ue=Bi(ee.y,ne.y,te),de=new co(ae,ue,0,ne.angleTo(ee),W);return!j||Kg(h,de,X,j,e)?de:void 0}Q+=K}}function cv(h,e,r,y,U,R,j,X,Q){const se=e_(y,R,j),W=t_(y,U),ee=W*j,ne=h[0].x===0||h[0].x===Q||h[0].y===0||h[0].y===Q;return e-ee<e/4&&(e=ee+e/4),i_(h,ne?e/2*X%e:(W/2+2*R)*j*X%e,e,se,r,ee,ne,!1,Q)}function i_(h,e,r,y,U,R,j,X,Q){const se=R/2,W=Qg(h);let ee=0,ne=e-r,K=[];for(let te=0;te<h.length-1;te++){const ae=h[te],ue=h[te+1],de=ae.dist(ue),xe=ue.angleTo(ae);for(;ne+r<ee+de;){ne+=r;const we=(ne-ee)/de,me=Bi(ae.x,ue.x,we),Me=Bi(ae.y,ue.y,we);if(me>=0&&me<Q&&Me>=0&&Me<Q&&ne-se>=0&&ne+se<=W){const ke=new co(me,Me,0,xe,te);y&&!Kg(h,ke,R,y,U)||K.push(ke)}}ee+=de}return X||K.length||j||(K=i_(h,ee/2,r,y,U,R,j,!0,Q)),K}function r_(h,e,r,y,U){const R=[];for(let j=0;j<h.length;j++){const X=h[j];let Q;for(let se=0;se<X.length-1;se++){let W=X[se],ee=X[se+1];W.x<e&&ee.x<e||(W.x<e?W=new Ht(e,W.y+(e-W.x)/(ee.x-W.x)*(ee.y-W.y))._round():ee.x<e&&(ee=new Ht(e,W.y+(e-W.x)/(ee.x-W.x)*(ee.y-W.y))._round()),W.y<r&&ee.y<r||(W.y<r?W=new Ht(W.x+(r-W.y)/(ee.y-W.y)*(ee.x-W.x),r)._round():ee.y<r&&(ee=new Ht(W.x+(r-W.y)/(ee.y-W.y)*(ee.x-W.x),r)._round()),W.x>=y&&ee.x>=y||(W.x>=y?W=new Ht(y,W.y+(y-W.x)/(ee.x-W.x)*(ee.y-W.y))._round():ee.x>=y&&(ee=new Ht(y,W.y+(y-W.x)/(ee.x-W.x)*(ee.y-W.y))._round()),W.y>=U&&ee.y>=U||(W.y>=U?W=new Ht(W.x+(U-W.y)/(ee.y-W.y)*(ee.x-W.x),U)._round():ee.y>=U&&(ee=new Ht(W.x+(U-W.y)/(ee.y-W.y)*(ee.x-W.x),U)._round()),Q&&W.equals(Q[Q.length-1])||(Q=[W],R.push(Q)),Q.push(ee)))))}}return R}function n_(h){let e=0,r=0;for(const j of h)e+=j.w*j.h,r=Math.max(r,j.w);h.sort((j,X)=>X.h-j.h);const y=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let U=0,R=0;for(const j of h)for(let X=y.length-1;X>=0;X--){const Q=y[X];if(!(j.w>Q.w||j.h>Q.h)){if(j.x=Q.x,j.y=Q.y,R=Math.max(R,j.y+j.h),U=Math.max(U,j.x+j.w),j.w===Q.w&&j.h===Q.h){const se=y.pop();X<y.length&&(y[X]=se)}else j.h===Q.h?(Q.x+=j.w,Q.w-=j.w):j.w===Q.w?(Q.y+=j.h,Q.h-=j.h):(y.push({x:Q.x+j.w,y:Q.y,w:Q.w-j.w,h:j.h}),Q.y+=j.h,Q.h-=j.h);break}}return{w:U,h:R,fill:e/(U*R)||0}}Ti(co,"Anchor");const Iu=1;class Du{static getImagePositionScale(e,r,y){return r&&e&&e.options&&e.options.transform?{x:e.options.transform.a,y:e.options.transform.d}:{x:y,y}}constructor(e,{pixelRatio:r,version:y,stretchX:U,stretchY:R,content:j,sdf:X,usvg:Q},se,W){this.paddedRect=e,this.pixelRatio=r,this.stretchX=U,this.stretchY=R,this.content=j,this.version=y,this.padding=se,this.sdf=X,this.scale=Du.getImagePositionScale(W,Q,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]}}class s_{constructor(e,r,y){const U={},R={};this.haveRenderCallbacks=[];const j=[];this.addImages(e,U,Iu,j),this.addImages(r,R,2,j);const{w:X,h:Q}=n_(j),se=new Gn({width:X||1,height:Q||1});for(const W in e){const ee=e[W],ne=U[W].paddedRect;Gn.copy(ee.data,se,{x:0,y:0},{x:ne.x+Iu,y:ne.y+Iu},ee.data,y,ee.sdf)}for(const W in r){const ee=r[W],ne=R[W].paddedRect;let K=R[W].padding;const te=ne.x+K,ae=ne.y+K,ue=ee.data.width,de=ee.data.height;K=K>1?K-1:K,Gn.copy(ee.data,se,{x:0,y:0},{x:te,y:ae},ee.data,y),Gn.copy(ee.data,se,{x:0,y:de-K},{x:te,y:ae-K},{width:ue,height:K},y),Gn.copy(ee.data,se,{x:0,y:0},{x:te,y:ae+de},{width:ue,height:K},y),Gn.copy(ee.data,se,{x:ue-K,y:0},{x:te-K,y:ae},{width:K,height:de},y),Gn.copy(ee.data,se,{x:0,y:0},{x:te+ue,y:ae},{width:K,height:de},y),Gn.copy(ee.data,se,{x:ue-K,y:de-K},{x:te-K,y:ae-K},{width:K,height:K},y),Gn.copy(ee.data,se,{x:0,y:de-K},{x:te+ue,y:ae-K},{width:K,height:K},y),Gn.copy(ee.data,se,{x:0,y:0},{x:te+ue,y:ae+de},{width:K,height:K},y),Gn.copy(ee.data,se,{x:ue-K,y:0},{x:te-K,y:ae+de},{width:K,height:K},y)}this.lut=y,this.image=se,this.iconPositions=U,this.patternPositions=R}addImages(e,r,y,U){for(const R in e){const j=e[R],X={x:0,y:0,w:j.data.width+2*y,h:j.data.height+2*y};U.push(X);const Q=$s.deserializeFromString(R);r[R]=new Du(X,j,y,Q),j.hasRenderCallback&&this.haveRenderCallbacks.push(Q.id)}}patchUpdatedImages(e,r,y){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(U=>e.hasImage(U,y)),e.dispatchRenderCallbacks(this.haveRenderCallbacks,y);for(const U in e.getUpdatedImages(y)){for(const R of Object.keys(this.iconPositions))$s.deserializeId(R)===U&&this.patchUpdatedImage(this.iconPositions[R],e.getImage(U,y),r);for(const R of Object.keys(this.patternPositions))$s.deserializeId(R)===U&&this.patchUpdatedImage(this.patternPositions[R],e.getImage(U,y),r)}}patchUpdatedImage(e,r,y){if(!e||!r||e.version===r.version)return;e.version=r.version;
273const[U,R]=e.tl,j=e.sdf;if(this.lut||j){const X={width:r.data.width,height:r.data.height},Q=new Gn(X);Gn.copy(r.data,Q,{x:0,y:0},{x:0,y:0},X,this.lut,j),y.update(Q,{position:{x:U,y:R}})}else y.update(r.data,{position:{x:U,y:R}})}}Ti(Du,"ImagePosition"),Ti(s_,"ImageAtlas");const ip=1e20;function a_(h,e,r,y,U,R,j,X,Q){for(let se=e;se<e+y;se++)o_(h,r*R+se,R,U,j,X,Q);for(let se=r;se<r+U;se++)o_(h,se*R+e,1,y,j,X,Q)}function o_(h,e,r,y,U,R,j){R[0]=0,j[0]=-1e20,j[1]=ip,U[0]=h[e];for(let X=1,Q=0,se=0;X<y;X++){U[X]=h[e+X*r];const W=X*X;do{const ee=R[Q];se=(U[X]-U[ee]+W-ee*ee)/(X-ee)/2}while(se<=j[Q]&&--Q>-1);Q++,R[Q]=X,j[Q]=se,j[Q+1]=ip}for(let X=0,Q=0;X<y;X++){for(;j[Q+1]<X;)Q++;const se=R[Q],W=X-se;h[e+X*r]=U[se]+W*W}}const ga=2,Uf={none:0,ideographs:1,all:2};class jc{constructor(e,r,y){this.requestManager=e,this.localGlyphMode=r,this.localFontFamily=y,this.urls={},this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e,r){this.urls[r]=e}getGlyphs(e,r,y){const U=[],R=this.urls[r]||ln.GLYPHS_URL;for(const j in e)for(const X of e[j])U.push({stack:j,id:X});Yt(U,({stack:j,id:X},Q)=>{let se=this.entries[j];se||(se=this.entries[j]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let W=se.glyphs[X];if(W!==void 0)return void Q(null,{stack:j,id:X,glyph:W});if(W=this._tinySDF(se,j,X),W)return se.glyphs[X]=W,void Q(null,{stack:j,id:X,glyph:W});const ee=Math.floor(X/256);if(256*ee>65535)return zi("glyphs > 65535 not supported"),void Q(null,{stack:j,id:X,glyph:W});if(se.ranges[ee])return void Q(null,{stack:j,id:X,glyph:W});let ne=se.requests[ee];ne||(ne=se.requests[ee]=[],jc.loadGlyphRange(j,ee,R,this.requestManager,(K,te)=>{if(te){se.ascender=te.ascender,se.descender=te.descender;for(const ae in te.glyphs)this._doesCharSupportLocalGlyph(+ae)||(se.glyphs[+ae]=te.glyphs[+ae]);se.ranges[ee]=!0}for(const ae of ne)ae(K,te);delete se.requests[ee]})),ne.push((K,te)=>{K?Q(K):te&&Q(null,{stack:j,id:X,glyph:te.glyphs[X]||null})})},(j,X)=>{if(j)y(j);else if(X){const Q={};for(const{stack:se,id:W,glyph:ee}of X)Q[se]===void 0&&(Q[se]={}),Q[se].glyphs===void 0&&(Q[se].glyphs={}),Q[se].glyphs[W]=ee&&{id:ee.id,bitmap:ee.bitmap.clone(),metrics:ee.metrics},Q[se].ascender=this.entries[se].ascender,Q[se].descender=this.entries[se].descender;y(null,Q)}})}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Uf.none&&(this.localGlyphMode===Uf.all?!!this.localFontFamily:!!this.localFontFamily&&(Mi["CJK Unified Ideographs"](e)||Mi["Hangul Syllables"](e)||Mi.Hiragana(e)||Mi.Katakana(e)||Mi["CJK Symbols and Punctuation"](e)||Mi["CJK Unified Ideographs Extension A"](e)||Mi["CJK Unified Ideographs Extension B"](e)||Mi.Osage(e)))}_tinySDF(e,r,y){const U=this.localFontFamily;if(!U||!this._doesCharSupportLocalGlyph(y))return;let R=e.tinySDF;if(!R){let ae="400";/bold/i.test(r)?ae="900":/medium/i.test(r)?ae="500":/light/i.test(r)&&(ae="200"),R=e.tinySDF=new jc.TinySDF({fontFamily:U,fontWeight:ae,fontSize:24*ga,buffer:3*ga,radius:8*ga}),R.fontWeight=ae}if(this.localGlyphs[R.fontWeight][y])return this.localGlyphs[R.fontWeight][y];const j=String.fromCodePoint(y),{data:X,width:Q,height:se,glyphWidth:W,glyphHeight:ee,glyphLeft:ne,glyphTop:K,glyphAdvance:te}=R.draw(j);return this.localGlyphs[R.fontWeight][y]={id:y,bitmap:new Oo({width:Q,height:se},X),metrics:{width:W/ga,height:ee/ga,left:ne/ga,top:K/ga-27,advance:te/ga,localGlyph:!0}}}}jc.loadGlyphRange=function(h,e,r,y,U){const R=256*e,j=R+255,X=y.transformRequest(y.normalizeGlyphsURL(r).replace("{fontstack}",h).replace("{range}",`${R}-${j}`),xr.Glyphs);Pn(X,(Q,se)=>{if(Q)U(Q);else if(se){const W={},ee=function(ne){return new ep(ne).readFields(tv,{})}(se);for(const ne of ee.glyphs)W[ne.id]=ne;U(null,{glyphs:W,ascender:ee.ascender,descender:ee.descender})}})},jc.TinySDF=class{constructor({fontSize:h=24,buffer:e=3,radius:r=8,cutoff:y=.25,fontFamily:U="sans-serif",fontWeight:R="normal",fontStyle:j="normal"}={}){this.buffer=e,this.cutoff=y,this.radius=r;const X=this.size=h+4*e,Q=this._createCanvas(X),se=this.ctx=Q.getContext("2d",{willReadFrequently:!0});se.font=`${j} ${R} ${h}px ${U}`,se.textBaseline="alphabetic",se.textAlign="left",se.fillStyle="black",this.gridOuter=new Float64Array(X*X),this.gridInner=new Float64Array(X*X),this.f=new Float64Array(X),this.z=new Float64Array(X+1),this.v=new Uint16Array(X)}_createCanvas(h){const e=document.createElement("canvas");return e.width=e.height=h,e}draw(h){const{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:y,actualBoundingBoxLeft:U,actualBoundingBoxRight:R}=this.ctx.measureText(h),j=Math.ceil(r),X=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(R-U))),Q=Math.min(this.size-this.buffer,j+Math.ceil(y)),se=X+2*this.buffer,W=Q+2*this.buffer,ee=Math.max(se*W,0),ne=new Uint8ClampedArray(ee),K={data:ne,width:se,height:W,glyphWidth:X,glyphHeight:Q,glyphTop:j,glyphLeft:0,glyphAdvance:e};if(X===0||Q===0)return K;const{ctx:te,buffer:ae,gridInner:ue,gridOuter:de}=this;te.clearRect(ae,ae,X,Q),te.fillText(h,ae,ae+j);const xe=te.getImageData(ae,ae,X,Q);de.fill(ip,0,ee),ue.fill(0,0,ee);for(let we=0;we<Q;we++)for(let me=0;me<X;me++){const Me=xe.data[4*(we*X+me)+3]/255;if(Me===0)continue;
vendor: 5,010 bytes, line 273
273const ke=(we+ae)*se+me+ae;if(Me===1)de[ke]=0,ue[ke]=ip;else{const Be=.5-Me;de[ke]=Be>0?Be*Be:0,ue[ke]=Be<0?Be*Be:0}}a_(de,0,0,se,W,se,this.f,this.v,this.z),a_(ue,ae,ae,X,Q,se,this.f,this.v,this.z);for(let we=0;we<ee;we++){const me=Math.sqrt(de[we])-Math.sqrt(ue[we]);ne[we]=Math.round(255-255*(me/this.radius+this.cutoff))}return K}};const Bl=Iu;function l_(h,e){return h+e[1]-e[0]}function c_(h,e,r,y,U=1){const R=[],j=h.imagePrimary,X=j.pixelRatio,Q=j.paddedRect.w-2*Bl,se=j.paddedRect.h-2*Bl,W=(h.right-h.left)*U,ee=(h.bottom-h.top)*U,ne=j.stretchX||[[0,Q]],K=j.stretchY||[[0,se]],te=ne.reduce(l_,0),ae=K.reduce(l_,0),ue=Q-te,de=se-ae;let xe=0,we=te,me=0,Me=ae,ke=0,Be=ue,He=0,$e=de;if(j.content&&y){const st=j.content;xe=rp(ne,0,st[0]),me=rp(K,0,st[1]),we=rp(ne,st[0],st[2]),Me=rp(K,st[1],st[3]),ke=st[0]-xe,He=st[1]-me,Be=st[2]-st[0]-we,$e=st[3]-st[1]-Me}const qe=(st,We,ct,ft)=>{const dt=np(st.stretch-xe,we,W,h.left*U),_t=sp(st.fixed-ke,Be,st.stretch,te),Tt=np(We.stretch-me,Me,ee,h.top*U),Ct=sp(We.fixed-He,$e,We.stretch,ae),vt=np(ct.stretch-xe,we,W,h.left*U),qt=sp(ct.fixed-ke,Be,ct.stretch,te),ei=np(ft.stretch-me,Me,ee,h.top*U),Gt=sp(ft.fixed-He,$e,ft.stretch,ae),yi=new Ht(dt,Tt),mi=new Ht(vt,Tt),ni=new Ht(vt,ei),ti=new Ht(dt,ei),Ai=new Ht(_t/X,Ct/X),vi=new Ht(qt/X,Gt/X),wi=e*Math.PI/180;if(wi){const sr=Math.sin(wi),Br=Math.cos(wi),Dr=[Br,-sr,sr,Br];yi._matMult(Dr),mi._matMult(Dr),ti._matMult(Dr),ni._matMult(Dr)}const ji=st.stretch+st.fixed,Ji=ct.stretch+ct.fixed,Ki=We.stretch+We.fixed,Qi=ft.stretch+ft.fixed,nr=h.imageSecondary;return{tl:yi,tr:mi,bl:ti,br:ni,texPrimary:{x:j.paddedRect.x+Bl+ji,y:j.paddedRect.y+Bl+Ki,w:Ji-ji,h:Qi-Ki},texSecondary:nr?{x:nr.paddedRect.x+Bl+ji,y:nr.paddedRect.y+Bl+Ki,w:Ji-ji,h:Qi-Ki}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ai,pixelOffsetBR:vi,minFontScaleX:Be/X/W,minFontScaleY:$e/X/ee,isSDF:r}};if(y&&(j.stretchX||j.stretchY)){const st=h_(ne,ue,te),We=h_(K,de,ae);for(let ct=0;ct<st.length-1;ct++){const ft=st[ct],dt=st[ct+1];for(let _t=0;_t<We.length-1;_t++)R.push(qe(ft,We[_t],dt,We[_t+1]))}}else R.push(qe({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:Q+1},{fixed:0,stretch:se+1}));return R}function rp(h,e,r){let y=0;for(const U of h)y+=Math.max(e,Math.min(r,U[1]))-Math.max(e,Math.min(r,U[0]));return y}function h_(h,e,r){const y=[{fixed:-1,stretch:0}];for(const[U,R]of h){const j=y[y.length-1];y.push({fixed:U-j.stretch,stretch:j.stretch}),y.push({fixed:U-j.stretch,stretch:j.stretch+(R-U)})}return y.push({fixed:e+Bl,stretch:r}),y}function np(h,e,r,y){return h/e*r+y}function sp(h,e,r,y){return h-e*r/y}function hv(h,e,r,y){const U=e+h.positionedLines[y].lineOffset;return y===0?r+U/2:r+(U+(e+h.positionedLines[y-1].lineOffset))/2}function uv(h,e=1,r=!1){let y=1/0,U=1/0,R=-1/0,j=-1/0;const X=h[0];for(let K=0;K<X.length;K++){const te=X[K];(!K||te.x<y)&&(y=te.x),(!K||te.y<U)&&(U=te.y),(!K||te.x>R)&&(R=te.x),(!K||te.y>j)&&(j=te.y)}const Q=Math.min(R-y,j-U);let se=Q/2;const W=new jn([],dv);if(Q===0)return new Ht(y,U);for(let K=y;K<R;K+=Q)for(let te=U;te<j;te+=Q)W.push(new Gc(K+se,te+se,se,h));let ee=function(K){let te=0,ae=0,ue=0;const de=K[0];for(let xe=0,we=de.length,me=we-1;xe<we;me=xe++){const Me=de[xe],ke=de[me],Be=Me.x*ke.y-ke.x*Me.y;ae+=(Me.x+ke.x)*Be,ue+=(Me.y+ke.y)*Be,te+=3*Be}return new Gc(ae/te,ue/te,0,K)}(h),ne=W.length;for(;W.length;){const K=W.pop();(K.d>ee.d||!ee.d)&&(ee=K,r&&console.log("found best %d after %d probes",Math.round(1e4*K.d)/1e4,ne)),K.max-ee.d<=e||(se=K.h/2,W.push(new Gc(K.p.x-se,K.p.y-se,se,h)),W.push(new Gc(K.p.x+se,K.p.y-se,se,h)),W.push(new Gc(K.p.x-se,K.p.y+se,se,h)),W.push(new Gc(K.p.x+se,K.p.y+se,se,h)),ne+=4)}return r&&(console.log(`num probes: ${ne}`),console.log(`best distance: ${ee.d}`)),ee.p}function dv(h,e){return e.max-h.max}class Gc{constructor(e,r,y,U){this.p=new Ht(e,r),this.h=y,this.d=function(R,j){let X=!1,Q=1/0;for(let se=0;se<j.length;se++){const W=j[se];for(let ee=0,ne=W.length,K=ne-1;ee<ne;K=ee++){const te=W[ee],ae=W[K];te.y>R.y!=ae.y>R.y&&R.x<(ae.x-te.x)*(R.y-te.y)/(ae.y-te.y)+te.x&&(X=!X),Q=Math.min(Q,Qe(R,te,ae))}}return(X?1:-1)*Math.sqrt(Q)}(this.p,U),this.max=this.d+this.h*Math.SQRT2}}const jf=Number.POSITIVE_INFINITY,pv=Math.sqrt(2);function u_(h,[e,r]){let y=0,U=0;if(r===jf){e<0&&(e=0);const R=e/pv;switch(h){case"top-right":case"top-left":U=R-7;break;case"bottom-right":case"bottom-left":U=7-R;break;case"bottom":U=7-e;break;case"top":U=e-7}switch(h){case"top-right":case"bottom-right":y=-R;break;case"top-left":case"bottom-left":y=R;break;case"left":y=e;break;case"right":y=-e}}else{switch(e=Math.abs(e),r=Math.abs(r),h){case"top-right":case"top-left":case"top":U=r-7;break;case"bottom-right":case"bottom-left":case"bottom":U=7-r}switch(h){case"top-right":case"bottom-right":case"right":y=-e;break;case"top-left":case"bottom-left":case"left":y=e}}return[y,U]}function Gf(h){switch(h){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}
273function fv(h,e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te){let ae=R.textMaxSize.evaluate(e,{},ee);ae===void 0?ae=j*R.textScaleFactor:ae*=R.textScaleFactor;const ue=h.layers[0].layout,de=ue.get("icon-offset").evaluate(e,{},ee),xe=p_(r.horizontal)||r.vertical,we=ne.name==="globe",me=Yn,Me=j*R.textScaleFactor/me,ke=h.tilePixelRatio*ae/me,Be=(dt=h.overscaling,h.zoom>18&&dt>2&&(dt>>=1),Math.max(gi/(512*dt),1)*ue.get("symbol-spacing")),He=ue.get("text-padding")*h.tilePixelRatio,$e=ue.get("icon-padding")*h.tilePixelRatio,qe=Xi(ue.get("text-max-angle")),st=ue.get("text-rotation-alignment")==="map"&&ue.get("symbol-placement")!=="point",We=ue.get("icon-rotation-alignment")==="map"&&ue.get("symbol-placement")!=="point",ct=ue.get("symbol-placement"),ft=Be/2;var dt;const _t=ue.get("icon-text-fit").evaluate(e,{},ee),Tt=ue.get("icon-text-fit-padding").evaluate(e,{},ee),Ct=_t!=="none";let vt;h.hasAnyIconTextFit===!1&&Ct&&(h.hasAnyIconTextFit=!0),y&&Ct&&(h.allowVerticalPlacement&&r.vertical&&(vt=Jg(y,r.vertical,_t,Tt,de,Me)),xe&&(y=Jg(y,xe,_t,Tt,de,Me)));const qt=(ei,Gt,yi)=>
273{if(Gt.x<0||Gt.x>=gi||Gt.y<0||Gt.y>=gi)return;let mi=null;if(we){const{x:ni,y:ti,z:Ai}=ne.projectTilePoint(Gt.x,Gt.y,yi);mi={anchor:new co(ni,ti,Ai,0,void 0),up:ne.upVector(yi,Gt.x,Gt.y)}}(function(ni,ti,Ai,vi,wi,ji,Ji,Ki,Qi,nr,sr,Br,Dr,Wi,Mr,Ir,$r,un,Sn,dn,Qr,yn,En,Jn,jr,ws,xa){const ta=ni.addToLineVertexArray(ti,vi);let ia,Gl,Go,ql,Yu,Wy,Zy,Xy=0,Yy=0,Jy=0,Ky=0,Tm=-1,Em=-1;const Fa={};let Qy=Rs("");const $l=Ai?Ai.anchor:ti,Am=Qi.layout.get("icon-text-fit").evaluate(Qr,{},jr)!=="none";let Mm=0,Pm=0;if(Qi._unevaluatedLayout.getValue("text-radial-offset")===void 0?[Mm,Pm]=Qi.layout.get("text-offset").evaluate(Qr,{},jr).map(Vs=>Vs*Yn):(Mm=Qi.layout.get("text-radial-offset").evaluate(Qr,{},jr)*Yn,Pm=jf),ni.allowVerticalPlacement&&wi.vertical){const Vs=wi.vertical;if(Mr)Wy=qf(Vs),Ki&&(Zy=qf(Ki));else{const Ss=Qi.layout.get("text-rotate").evaluate(Qr,{},jr)+90;Go=ap(nr,$l,ti,sr,Br,Dr,Vs,Wi,Ss,Ir),Ki&&(ql=ap(nr,$l,ti,sr,Br,Dr,Ki,un,Ss))}}if(ji){const Vs=ni.iconSizeData,Ss=Qi.layout.get("icon-rotate").evaluate(Qr,{},jr),Ju=c_(ji,Ss,En,Am,yn.iconScaleFactor),Im=Ki?c_(Ki,Ss,En,Am,yn.iconScaleFactor):void 0;Gl=ap(nr,$l,ti,sr,Br,Dr,ji,un,Ss,null),Xy=4*Ju.length;let Hl=null;Vs.kind==="source"?(Hl=[ma*Qi.layout.get("icon-size").evaluate(Qr,{},jr)*yn.iconScaleFactor],Hl[0]>No&&zi(`${ni.layerIds[0]}: Value for "icon-size" is >= ${ku}. Reduce your "icon-size".`)):Vs.kind==="composite"&&(Hl=[ma*yn.compositeIconSizes[0].evaluate(Qr,{},jr)*yn.iconScaleFactor,ma*yn.compositeIconSizes[1].evaluate(Qr,{},jr)*yn.iconScaleFactor],(Hl[0]>No||Hl[1]>No)&&zi(`${ni.layerIds[0]}: Value for "icon-size" is >= ${ku}. Reduce your "icon-size".`)),ni.addSymbols(ni.icon,Ju,Hl,dn,Sn,Qr,!1,Ai,ti,ta.lineStartIndex,ta.lineLength,-1,Jn,jr,ws,xa),Tm=ni.icon.placedSymbolArray.length-1,Im&&(Yy=4*Im.length,ni.addSymbols(ni.icon,Im,Hl,dn,Sn,Qr,Bs.vertical,Ai,ti,ta.lineStartIndex,ta.lineLength,-1,Jn,jr,ws,xa),Em=ni.icon.placedSymbolArray.length-1)}for(const Vs in wi.horizontal){const Ss=wi.horizontal[Vs];ia||(Qy=Rs(Ss.text),Mr?Yu=qf(Ss):ia=ap(nr,$l,ti,sr,Br,Dr,Ss,Wi,Qi.layout.get("text-rotate").evaluate(Qr,{},jr),Ir));const Ju=Ss.positionedLines.length===1;if(Jy+=d_(ni,Ai,ti,Ss,Ji,Qi,Mr,Qr,Ir,ta,wi.vertical?Bs.horizontal:Bs.horizontalOnly,Ju?Object.keys(wi.horizontal):[Vs],Fa,Tm,yn,Jn,jr,ws),Ju)break}wi.vertical&&(Ky+=d_(ni,Ai,ti,wi.vertical,Ji,Qi,Mr,Qr,Ir,ta,Bs.vertical,["vertical"],Fa,Em,yn,Jn,jr,ws));let qo=-1;const Cm=(Vs,Ss)=>Vs?Math.max(Vs,Ss):Ss;qo=Cm(Yu,qo),qo=Cm(Wy,qo),qo=Cm(Zy,qo);const Wx=qo>-1?1:0;ni.glyphOffsetArray.length>=65535&&zi("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Qr.sortKey!==void 0&&ni.addToSortKeyRanges(ni.symbolInstances.length,Qr.sortKey),ni.symbolInstances.emplaceBack(ti.x,ti.y,$l.x,$l.y,$l.z,Fa.right>=0?Fa.right:-1,Fa.center>=0?Fa.center:-1,Fa.left>=0?Fa.left:-1,Fa.vertical>=0?Fa.vertical:-1,Tm,Em,Qy,ia!==void 0?ia:ni.collisionBoxArray.length,ia!==void 0?ia+1:ni.collisionBoxArray.length,Go!==void 0?Go:ni.collisionBoxArray.length,Go!==void 0?Go+1:ni.collisionBoxArray.length,Gl!==void 0?Gl:ni.collisionBoxArray.length,Gl!==void 0?Gl+1:ni.collisionBoxArray.length,ql||ni.collisionBoxArray.length,ql?ql+1:ni.collisionBoxArray.length,sr,Jy,Ky,Xy,Yy,Wx,0,Mm,Pm,qo,0,Am?1:0)})(h,Gt,mi,ei,r,y,U,vt,h.layers[0],h.collisionBoxArray,e.index,e.sourceLayerIndex,h.index,He,st,Q,0,$e,We,de,e,R,se,W,ee,K,te)};if(ct==="line")for(const ei of r_(e.geometry,0,0,gi,gi)){const Gt=cv(ei,Be,qe,r.vertical||xe,y,me,ke,h.overscaling,gi);for(const yi of Gt)xe&&mv(h,xe.text,ft,yi)||qt(ei,yi,ee)}else if(ct==="line-center"){for(const ei of e.geometry)if(ei.length>1){const Gt=lv(ei,qe,r.vertical||xe,y,me,ke);Gt&&qt(ei,Gt,ee)}}else if(e.type==="Polygon")for(const ei of Hd(e.geometry,0)){const Gt=uv(ei,16);qt(ei[0],new co(Gt.x,Gt.y,0,0,void 0),ee)}else if(e.type==="LineString")for(const ei of e.geometry)qt(ei,new co(ei[0].x,ei[0].y,0,0,void 0),ee);else if(e.type==="Point")for(const ei of e.geometry)for(const Gt of ei)qt([Gt],new co(Gt.x,Gt.y,0,0,void 0),ee)}const ku=255,No=ku*ma;function d_(h,e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue,de){const xe=function(Me,ke,Be,He,$e,qe,st,We){const ct=[];if(ke.positionedLines.length===0)return ct;
273const ft=He.layout.get("text-rotate").evaluate(qe,{})*Math.PI/180,dt=function(qt){const ei=qt[0],Gt=qt[1],yi=ei*Gt;return yi>0?[ei,-Gt]:yi<0?[-ei,Gt]:ei===0?[Gt,ei]:[Gt,-ei]}(Be);let _t=Math.abs(ke.top-ke.bottom);for(const qt of ke.positionedLines)_t-=qt.lineOffset;const Tt=ke.positionedLines.length,Ct=_t/Tt;let vt=ke.top-Be[1];for(let qt=0;qt<Tt;++qt){const ei=ke.positionedLines[qt];vt=hv(ke,Ct,vt,qt);for(const Gt of ei.positionedGlyphs){if(!Gt.rect)continue;const yi=Gt.rect||{};let mi=nv+1,ni=!0,ti=1,Ai=0;if(Gt.imageName){const dn=st[Un.build(Gt.imageName).getSerializedPrimary()];if(!dn)continue;if(dn.sdf){zi("SDF images are not supported in formatted text and will be ignored.");continue}ni=!1,ti=dn.pixelRatio,mi=Iu/ti}const vi=($e||We)&&Gt.vertical,wi=Gt.metrics.advance*Gt.scale/2,ji=Gt.metrics,Ji=Gt.rect;if(Ji===null)continue;We&&ke.verticalizable&&(Ai=Gt.imageName?wi-Gt.metrics.width*Gt.scale/2:0);const Ki=$e?[Gt.x+wi,Gt.y]:[0,0];let Qi=[0,0],nr=[0,0],sr=!1;$e||(vi?(nr=[Gt.x+wi+dt[0],Gt.y+dt[1]-Ai],sr=!0):Qi=[Gt.x+wi+Be[0],Gt.y+Be[1]-Ai]);const Br=Ji.w*Gt.scale/(ti*(Gt.localGlyph?ga:1)),Dr=Ji.h*Gt.scale/(ti*(Gt.localGlyph?ga:1));let Wi,Mr,Ir,$r;if(vi){const dn=Gt.y-vt,Qr=new Ht(-wi,wi-dn),yn=-Math.PI/2,En=new Ht(...nr);Wi=new Ht(-wi+Qi[0],Qi[1]),Wi._rotateAround(yn,Qr)._add(En),Wi.x+=-dn+wi,Wi.y-=(ji.left-mi)*Gt.scale;const Jn=Gt.imageName?ji.advance*Gt.scale:Yn*Gt.scale,jr=String.fromCodePoint(Gt.glyph);K0(jr)?Wi.x+=(1-mi)*Gt.scale:Q0(jr)?Wi.x+=Jn-ji.height*Gt.scale+(-mi-1)*Gt.scale:Wi.x+=Gt.imageName||ji.width+2*mi===Ji.w&&ji.height+2*mi===Ji.h?(Jn-Dr)/2:(Jn-(ji.height+2*mi)*Gt.scale)/2,Mr=new Ht(Wi.x,Wi.y-Br),Ir=new Ht(Wi.x+Dr,Wi.y),$r=new Ht(Wi.x+Dr,Wi.y-Br)}else{const dn=(ji.left-mi)*Gt.scale-wi+Qi[0],Qr=(-ji.top-mi)*Gt.scale+Qi[1],yn=dn+Br,En=Qr+Dr;Wi=new Ht(dn,Qr),Mr=new Ht(yn,Qr),Ir=new Ht(dn,En),$r=new Ht(yn,En)}if(ft){let dn;dn=$e?new Ht(0,0):sr?new Ht(dt[0],dt[1]):new Ht(Be[0],Be[1]),Wi._rotateAround(ft,dn),Mr._rotateAround(ft,dn),Ir._rotateAround(ft,dn),$r._rotateAround(ft,dn)}const un=new Ht(0,0),Sn=new Ht(0,0);ct.push({tl:Wi,tr:Mr,bl:Ir,br:$r,texPrimary:yi,texSecondary:void 0,writingMode:ke.writingMode,glyphOffset:Ki,sectionIndex:Gt.sectionIndex,isSDF:ni,pixelOffsetTL:un,pixelOffsetBR:Sn,minFontScaleX:0,minFontScaleY:0})}}return ct}(0,y,Q,R,j,X,U,h.allowVerticalPlacement),we=h.textSizeData;let me=null;we.kind==="source"?(me=[ma*R.layout.get("text-size").evaluate(X,{},ue)*te.textScaleFactor],me[0]>No&&zi(`${h.layerIds[0]}: Value for "text-size" is >= ${ku}. Reduce your "text-size".`)):we.kind==="composite"&&(me=[ma*te.compositeTextSizes[0].evaluate(X,{},ue)*te.textScaleFactor,ma*te.compositeTextSizes[1].evaluate(X,{},ue)*te.textScaleFactor],(me[0]>No||me[1]>No)&&zi(`${h.layerIds[0]}: Value for "text-size" is >= ${ku}. Reduce your "text-size".`)),h.addSymbols(h.text,xe,me,Q,j,X,W,e,r,se.lineStartIndex,se.lineLength,K,ae,ue,de,!1);for(const Me of ee)ne[Me]=h.text.placedSymbolArray.length-1;return 4*xe.length}function p_(h){for(const e in h)return h[e];return null}function ap(h,e,r,y,U,R,j,X,Q,se){let W=j.top,ee=j.bottom,ne=j.left,K=j.right;const te=j.collisionPadding;if(te&&(ne-=te[0],W-=te[1],K+=te[2],ee+=te[3]),Q){const ae=new Ht(ne,W),ue=new Ht(K,W),de=new Ht(ne,ee),xe=new Ht(K,ee),we=Xi(Q);let me=new Ht(0,0);se&&(me=new Ht(se[0],se[1])),ae._rotateAround(we,me),ue._rotateAround(we,me),de._rotateAround(we,me),xe._rotateAround(we,me),ne=Math.min(ae.x,ue.x,de.x,xe.x),K=Math.max(ae.x,ue.x,de.x,xe.x),W=Math.min(ae.y,ue.y,de.y,xe.y),ee=Math.max(ae.y,ue.y,de.y,xe.y)}return h.emplaceBack(e.x,e.y,e.z,r.x,r.y,ne,W,K,ee,X,y,U,R),h.length-1}function qf(h){h.collisionPadding&&(h.top-=h.collisionPadding[1],h.bottom+=h.collisionPadding[3]);const e=h.bottom-h.top;return e>0?Math.max(10,e):null}function mv(h,e,r,y){const U=h.compareText;if(e in U){const R=U[e];for(let j=R.length-1;j>=0;j--)if(y.dist(R[j])<r)return!0}else U[e]=[];return U[e].push(y),!1}function f_(h,e){const r=h.fovAboveCenter,y=h.elevation?h.elevation.getMinElevationBelowMSL()*e:0,U=(h._camera.position[2]*h.worldSize-y)/Math.cos(h._pitch),R=Math.sin(r)*U/Math.sin(Math.max(Math.PI/2-h._pitch-r,.01));let j=Math.sin(h._pitch)*R+U;const X=U*(1/h._horizonShift);if(!h.elevation||h.elevation.exaggeration()===0){let Q=Math.max(h.zoom-17,0);h.isOrthographic&&(Q/=10),j*=1+Q}return Math.min(1.01*j,X)}function Ru(h,e){if(!e.isReprojectedInTileSpace)return{scale:1<<h.z,x:h.x,y:h.y,x2:h.x+1,y2:h.y+1,projection:e};const r=Math.pow(2,-h.z),y=h.x*r,U=(h.x+1)*r,R=h.y*r,j=(h.y+1)*r,X=fs(y),Q=fs(U),se=Bn(R),W=Bn(j),ee=e.project(X,se),ne=e.project(Q,se),K=e.project(Q,W),te=e.project(X,W);let ae=Math.min(ee.x,ne.x,K.x,te.x),ue=Math.min(ee.y,ne.y,K.y,te.y),de=Math.max(ee.x,ne.x,K.x,te.x),xe=Math.max(ee.y,ne.y,K.y,te.y);const we=r/16;
vendor: 5,476 bytes, line 273
273function me(ke,Be,He,$e,qe,st){const We=(He+qe)/2,ct=($e+st)/2,ft=e.project(fs(We),Bn(ct)),dt=Math.max(0,ae-ft.x,ue-ft.y,ft.x-de,ft.y-xe);ae=Math.min(ae,ft.x),de=Math.max(de,ft.x),ue=Math.min(ue,ft.y),xe=Math.max(xe,ft.y),dt>we&&(me(ke,ft,He,$e,We,ct),me(ft,Be,We,ct,qe,st))}me(ee,ne,y,R,U,R),me(ne,K,U,R,U,j),me(K,te,U,j,y,j),me(te,ee,y,j,y,R),ae-=we,ue-=we,de+=we,xe+=we;const Me=1/Math.max(de-ae,xe-ue);return{scale:Me,x:ae*Me,y:ue*Me,x2:de*Me,y2:xe*Me,projection:e}}function m_(h,{x:e,y:r},y=0){return new Ht(((e-y)*h.scale-h.x)*gi,(r*h.scale-h.y)*gi)}const gv=pt.mat4.identity(new Float32Array(16));class Vo{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,r){return{x:0,y:0,z:0}}unproject(e,r){return new _r(0,0)}projectTilePoint(e,r,y){return{x:e,y:r,z:0}}locationPoint(e,r,y=!0){return e._coordinatePoint(e.locationCoordinate(r),y)}pixelsPerMeter(e,r){return ns(1,e)*r}pixelSpaceConversion(e,r,y){return 1}farthestPixelDistance(e){return f_(e,e.pixelsPerMeter)}pointCoordinate(e,r,y,U){const R=e.horizonLineFromTop(!1),j=new Ht(r,Math.max(R,y));return e.rayIntersectionCoordinate(e.pointRayIntersection(j,U))}pointCoordinate3D(e,r,y){const U=new Ht(r,y);if(e.elevation)return e.elevation.pointCoordinate(U);{const R=this.pointCoordinate(e,U.x,U.y,0);return[R.x,R.y,R.z]}}isPointAboveHorizon(e,r){if(e.elevation&&e.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(e,r.x,r.y);const y=e.horizonLineFromTop();return r.y<y}createInversionMatrix(e,r){return gv}createTileMatrix(e,r,y){let U,R,j;const X=y.canonical,Q=pt.mat4.identity(new Float64Array(16));if(this.isReprojectedInTileSpace){const se=Ru(X,this);U=1,R=se.x+y.wrap*se.scale,j=se.y,pt.mat4.scale(Q,Q,[U/se.scale,U/se.scale,e.pixelsPerMeter/r])}else U=r/e.zoomScale(X.z),R=(X.x+Math.pow(2,X.z)*y.wrap)*U,j=X.y*U;return pt.mat4.translate(Q,Q,[R,j,0]),pt.mat4.scale(Q,Q,[U/gi,U/gi,1]),Q}upVector(e,r,y){return[0,0,1]}upVectorScale(e,r,y){return{metersToTile:1}}}class _v extends Vo{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[r,y]=this.parallels=e.parallels||[29.5,45.5],U=Math.sin(Xi(r));this.n=(U+Math.sin(Xi(y)))/2,this.c=1+U*(2*this.n-U),this.r0=Math.sqrt(this.c)/this.n}project(e,r){const{n:y,c:U,r0:R}=this,j=Xi(e-this.center[0]),X=Xi(r),Q=Math.sqrt(U-2*y*Math.sin(X))/y;return{x:Q*Math.sin(j*y),y:Q*Math.cos(j*y)-R,z:0}}unproject(e,r){const{n:y,c:U,r0:R}=this,j=R+r;let X=Math.atan2(e,Math.abs(j))*Math.sign(j);j*y<0&&(X-=Math.PI*Math.sign(e)*Math.sign(j));const Q=Xi(this.center[0])*y;X=It(X,-Math.PI-Q,Math.PI-Q);const se=Ue(Gr(X/y)+this.center[0],-180,180),W=Math.asin(Ue((U-(e*e+j*j)*y*y)/(2*y),-1,1)),ee=Ue(Gr(W),-85.051129,cs);return new _r(se,ee)}}const zu=1.340264,Lu=-.081106,Fu=893e-6,Ou=.003796,op=Math.sqrt(3)/2;class yv extends Vo{project(e,r){r=r/180*Math.PI,e=e/180*Math.PI;const y=Math.asin(op*Math.sin(r)),U=y*y,R=U*U*U;return{x:.5*(e*Math.cos(y)/(op*(zu+3*Lu*U+R*(7*Fu+9*Ou*U)))/Math.PI+.5),y:1-.5*(y*(zu+Lu*U+R*(Fu+Ou*U))/Math.PI+1),z:0}}unproject(e,r){e=(2*e-.5)*Math.PI;let y=r=(2*(1-r)-1)*Math.PI,U=y*y,R=U*U*U;for(let W,ee,ne,K=0;K<12&&(ee=y*(zu+Lu*U+R*(Fu+Ou*U))-r,ne=zu+3*Lu*U+R*(7*Fu+9*Ou*U),W=ee/ne,y=Ue(y-W,-Math.PI/3,Math.PI/3),U=y*y,R=U*U*U,!(Math.abs(W)<1e-12));++K);const j=op*e*(zu+3*Lu*U+R*(7*Fu+9*Ou*U))/Math.cos(y),X=Math.asin(Math.sin(y)/op),Q=Ue(180*j/Math.PI,-180,180),se=Ue(180*X/Math.PI,-85.051129,cs);return new _r(Q,se)}}class vv extends Vo{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,r){return{x:.5+e/360,y:.5-r/360,z:0}}unproject(e,r){const y=360*(e-.5),U=Ue(360*(.5-r),-85.051129,cs);return new _r(y,U)}}const qc=Math.PI/2;function lp(h){return Math.tan((qc+h)/2)}class xv extends Vo{constructor(e){super(e),this.center=e.center||[0,30];const[r,y]=this.parallels=e.parallels||[30,30];let U=Xi(r),R=Xi(y);this.southernCenter=U+R<0,this.southernCenter&&(U=-U,R=-R);const j=Math.cos(U),X=lp(U);this.n=U===R?Math.sin(U):Math.log(j/Math.cos(R))/Math.log(lp(R)/X),this.f=j*Math.pow(lp(U),this.n)/this.n}project(e,r){r=Xi(r),this.southernCenter&&(r=-r),e=Xi(e-this.center[0]);const y=1e-6,{n:U,f:R}=this;R>0?r<-qc+y&&(r=-qc+y):r>qc-y&&(r=qc-y);const j=R/Math.pow(lp(r),U);let X=j*Math.sin(U*e),Q=R-j*Math.cos(U*e);return X=.5*(X/Math.PI+.5),Q=.5*(Q/Math.PI+.5),{x:X,y:this.southernCenter?Q:1-Q,z:0}}unproject(e,r){e=(2*e-.5)*Math.PI,this.southernCenter&&(r=1-r),r=(2*(1-r)-.5)*Math.PI;const{n:y,f:U}=this,R=U-r,j=Math.sign(R),X=Math.sign(y)*Math.sqrt(e*e+R*R);let Q=Math.atan2(e,Math.abs(R))*j;R*y<0&&(Q-=Math.PI*Math.sign(e)*j);const se=Ue(Gr(Q/y)+this.center[0],-180,180),W=Ue(Gr(2*Math.atan(Math.pow(U/X,1/y))-qc),-85.051129,cs);return new _r(se,this.southernCenter?-W:W)}}class g_ extends Vo{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,r){return{x:Js(e),y:Os(r),z:0}}unproject(e,r){const y=fs(e),U=Bn(r);return new _r(y,U)}}const __=Xi(cs);class bv extends Vo{project(e,r){const y=(r=Xi(r))*r,U=y*y;return{x:.5*((e=Xi(e))*(.8707-.131979*y+U*(U*(.003971*y-.001529*U)-.013791))/Math.PI+.5),y:1-.5*(r*(1.007226+y*(.015085+U*(.028874*y-.04447
vendor: 7,910 bytes, line 273
2735-.005916*U)))/Math.PI+1),z:0}}unproject(e,r){e=(2*e-.5)*Math.PI;let y=r=(2*(1-r)-1)*Math.PI,U=25,R=0,j=y*y;do{j=y*y;const se=j*j;R=(y*(1.007226+j*(.015085+se*(.028874*j-.044475-.005916*se)))-r)/(1.007226+j*(.045255+se*(.259866*j-.311325-.005916*11*se))),y=Ue(y-R,-__,__)}while(Math.abs(R)>1e-6&&--U>0);j=y*y;const X=Ue(Gr(e/(.8707+j*(j*(j*j*j*(.003971-.001529*j)-.013791)-.131979))),-180,180),Q=Gr(y);return new _r(X,Q)}}const y_=Xi(cs);class wv extends Vo{project(e,r){r=Xi(r),e=Xi(e);const y=Math.cos(r),U=2/Math.PI,R=Math.acos(y*Math.cos(e/2)),j=Math.sin(R)/R,X=.5*(e*U+2*y*Math.sin(e/2)/j)||0,Q=.5*(r+Math.sin(r)/j)||0;return{x:.5*(X/Math.PI+.5),y:1-.5*(Q/Math.PI+1),z:0}}unproject(e,r){let y=e=(2*e-.5)*Math.PI,U=r=(2*(1-r)-1)*Math.PI,R=25;const j=1e-6;let X=0,Q=0;do{const se=Math.cos(U),W=Math.sin(U),ee=2*W*se,ne=W*W,K=se*se,te=Math.cos(y/2),ae=Math.sin(y/2),ue=2*te*ae,de=ae*ae,xe=1-K*te*te,we=xe?1/xe:0,me=xe?Math.acos(se*te)*Math.sqrt(1/xe):0,Me=.5*(2*me*se*ae+2*y/Math.PI)-e,ke=.5*(me*W+U)-r,Be=.5*we*(K*de+me*se*te*ne)+1/Math.PI,He=we*(ue*ee/4-me*W*ae),$e=.125*we*(ee*ae-me*W*K*ue),qe=.5*we*(ne*te+me*de*se)+.5,st=He*$e-qe*Be;X=(ke*He-Me*qe)/st,Q=(Me*$e-ke*Be)/st,y=Ue(y-X,-Math.PI,Math.PI),U=Ue(U-Q,-y_,y_)}while((Math.abs(X)>j||Math.abs(Q)>j)&&--R>0);return new _r(Gr(y),Gr(U))}}class v_ extends Vo{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Xi(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,r){const{scale:y,cosPhi:U}=this;return{x:Xi(e)*U*y+.5,y:-Math.sin(Xi(r))/U*y+.5,z:0}}unproject(e,r){const{scale:y,cosPhi:U}=this,R=-(r-.5)/y,j=Ue(Gr((e-.5)/y)/U,-180,180),X=Math.asin(Ue(R*U,-1,1)),Q=Ue(Gr(X),-85.051129,cs);return new _r(j,Q)}}class Sv extends g_{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,r,y){const U=zr(e,r,y),R=In(xn(y));return pt.vec3.transformMat4(U,U,R),{x:U[0],y:U[1],z:U[2]}}locationPoint(e,r){const y=so(r.lat,r.lng),U=pt.vec3.normalize([],y),R=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(r),e._centerAltitude):e._centerAltitude,j=ns(1,0)*gi*R;pt.vec3.scaleAndAdd(y,y,U,j);const X=pt.mat4.identity(new Float64Array(16));return pt.mat4.multiply(X,e.pixelMatrix,e.globeMatrix),pt.vec3.transformMat4(y,y,X),new Ht(y[0],y[1])}pixelsPerMeter(e,r){return ns(1,0)*r}pixelSpaceConversion(e,r,y){const U=ns(1,e)*r,R=Bi(ns(1,45)*r,U,y);return this.pixelsPerMeter(e,r)/R}createTileMatrix(e,r,y){const U=Fr(xn(y.canonical));return pt.mat4.multiply(new Float64Array(16),e.globeMatrix,U)}createInversionMatrix(e,r){const{center:y}=e,U=In(xn(r));return pt.mat4.rotateY(U,U,Xi(y.lng)),pt.mat4.rotateX(U,U,Xi(y.lat)),pt.mat4.scale(U,U,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(U)}pointCoordinate(e,r,y,U){return Er(e,r,y,!0)||new l(0,0)}pointCoordinate3D(e,r,y){const U=this.pointCoordinate(e,r,y,0);return[U.x,U.y,U.z]}isPointAboveHorizon(e,r){return!Er(e,r.x,r.y,!1)}farthestPixelDistance(e){const r=function(U,R){const j=U.cameraToCenterDistance,X=U._centerAltitude*R,Q=U._camera,se=U._camera.forward(),W=pt.vec3.add([],pt.vec3.scale([],se,-j),[0,0,X]),ee=U.worldSize/(2*Math.PI),ne=[0,0,-ee],K=U.width/U.height,te=Math.tan(U.fovAboveCenter),ae=pt.vec3.scale([],Q.up(),te),ue=pt.vec3.scale([],Q.right(),te*K),de=pt.vec3.normalize([],pt.vec3.add([],pt.vec3.add([],se,ae),ue)),xe=[];let we;if(new Hi(W,de).closestPointOnSphere(ne,ee,xe)){const me=pt.vec3.add([],xe,ne),Me=pt.vec3.sub([],me,W);we=Math.cos(U.fovAboveCenter)*pt.vec3.length(Me)}else{const me=pt.vec3.sub([],W,ne),Me=pt.vec3.sub([],ne,W);pt.vec3.normalize(Me,Me);const ke=pt.vec3.length(me)-ee;we=Math.sqrt(ke*(ke+2*ee));const Be=Math.acos(we/(ee+ke))-Math.acos(pt.vec3.dot(se,Me));we*=Math.cos(Be)}return 1.01*we}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),y=hs(e.zoom);if(y>0){const U=f_(e,ns(1,e.center.lat)*e.worldSize),R=e.worldSize/(2*Math.PI),j=Math.max(e.width,e.height)/e.worldSize*Math.PI;return Bi(r,U+R*(1-Math.cos(j)),Math.pow(y,10))}return r}upVector(e,r,y){return zr(r,y,e,1)}upVectorScale(e){return{metersToTile:ar(ur(xn(e)))}}}function x_(h){const e=h.parallels,r=!!e&&Math.abs(e[0]+e[1])<.01;switch(h.name){case"mercator":return new g_(h);case"equirectangular":return new vv(h);case"naturalEarth":return new bv(h);case"equalEarth":return new yv(h);case"winkelTripel":return new wv(h);case"albers":return r?new v_(h):new _v(h);case"lambertConformalConic":return r?new v_(h):new xv(h);case"globe":return new Sv(h)}throw new Error(`Invalid projection name: ${h.name}`)}const Tv=Nc.VectorTileFeature.types,Ev=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function cp(h,e,r,y,U,R,j,X,Q,se,W,ee,ne){const K=X?Math.min(No,Math.round(X[0])):0,te=X?Math.min(No,Math.round(X[1])):0;h.emplaceBack(e,r,Math.round(32*y),Math.round(32*U),R,j,(K<<1)+(Q?1:0),te,16*se,16*W,256*ee,256*ne)}function hp(h,e,r){h.emplaceBack(e,r)}function up(h,e,r,y,U,R,j){h.emplaceBack(e,r,y,U,R,j)}function dp(h,e,r,y,U){h.emplaceBack(e,r,y,U),h.emplaceBack(e,r,y,U),h.emplaceBack(e,r,y,U),h.emplaceBack(e,r,y,U)}function Av(h){for(const e of h.sections)if($h(e.text))return!0;return!1}class $f{constructor(e){this.layoutVertexArray=new Qh,this.indexArray=new On,this.programConfigurations=e,this.segments=new an,this.dynamicLayoutVertexArray=new to,this.opacityVertexArray=new tu,this.placedSymbolArray=new Id,this.iconTransitioningVertexArray=new Ia,this.globeExtVertexArray=new eu,this.zOffsetVertexArray=new Tl}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0&&this.iconTransitioningVertexArray.length===0}upload(e,r,y,U,R){this.isEmpty()||(y&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,j0.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,q0.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Ev,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,H0.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,G0.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||R)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,$0.members,!0)),this.opacityVertexBuffer.itemSize=1),(y||U)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy())}}Ti($f,"SymbolBuffers");class Hf{constructor(e,r,y){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new y,this.segments=new an,this.collisionVertexArray=new nu,this.collisionVertexArrayExt=new to}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,W0.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Z0.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.de
273stroy())}}Ti(Hf,"CollisionBuffers");class pp{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.lut=e.lut,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(j=>j.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.collisionCircleArray=[],this.placementInvProjMatrix=pt.mat4.identity([]),this.placementViewportMatrix=pt.mat4.identity([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Lf(this.zoom,r["text-size"]),this.iconSizeData=Lf(this.zoom,r["icon-size"]);const y=this.layers[0].layout,U=y.get("symbol-sort-key"),R=y.get("symbol-z-order");this.canOverlap=y.get("text-allow-overlap")||y.get("icon-allow-overlap")||y.get("text-ignore-placement")||y.get("icon-ignore-placement"),this.sortFeaturesByKey=R!=="viewport-y"&&U.constantOr(1)!==void 0,this.sortFeaturesByY=(R==="viewport-y"||R==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=y.get("text-writing-mode").map(j=>Bs[j]),this.stateDependentLayerIds=this.layers.filter(j=>j.isStateDependent()).map(j=>j.id),this.sourceID=e.sourceID,this.projection=e.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=y.get("symbol-z-elevate"),this.activeReplacements=[],this.replacementUpdateTime=0}createArrays(){this.text=new $f(new Ra(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("text")||e.startsWith("symbol"))),this.icon=new $f(new Ra(this.layers,{zoom:this.zoom,lut:this.lut},e=>e.startsWith("icon")||e.startsWith("symbol"))),this.glyphOffsetArray=new Rd,this.lineVertexArray=new zd,this.symbolInstances=new kd}calculateGlyphDependencies(e,r,y,U,R){for(const j of e){const X=j.codePointAt(0);if(X===void 0)break;if(r[X]=!0,U&&R&&X<=65535){const Q=Pu[j];Q&&(r[Q.charCodeAt(0)]=!0)}}}updateFootprints(e,r){}updateReplacement(e,r){if(r.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=r.updateTime;const y=r.getReplacementRegionsForTile(e.toUnwrapped(),!0);return!Mf(this.activeReplacements,y)&&(this.activeReplacements=y,!0)}populate(e,r,y,U){const R=this.layers[0],j=R.layout,X=this.projection.name==="globe",Q=j.get("text-font"),se=j.get("text-field"),W=j.get("icon-image"),[ee,ne]=j.get("icon-size-scale-range"),K=Ue(r.scaleFactor||1,ee,ne),te=(se.value.kind!=="constant"||se.value.value instanceof Hn&&!se.value.value.isEmpty()||se.value.value.toString().length>0)&&(Q.value.kind!=="constant"||Q.value.value.length>0),ae=W.value.kind!=="constant"||!!W.value.value||Object.keys(W.parameters).length>0,ue=j.get("symbol-sort-key");if(this.features=[],!te&&!ae)return;const de=r.iconDependencies,xe=r.glyphDependencies,we=r.availableImages,me=new Nr(this.zoom);for(const{feature:Me,id:ke,index:Be,sourceLayerIndex:He}of e){const $e=R._featureFilter.needGeometry,qe=pe(Me,$e);if(!R._featureFilter.filter(me,qe,y))continue;if($e||(qe.geometry=he(Me,y,U)),X&&Me.type!==1&&y.z<=5){const dt=qe.geometry,_t=.98078528056,Tt=(Ct,vt)=>{const qt=zr(Ct.x,Ct.y,y,1),ei=zr(vt.x,vt.y,y,1);return pt.vec3.dot(qt,ei)<_t};for(let Ct=0;Ct<dt.length;Ct++)dt[Ct]=Y(dt[Ct],Tt)}let st,We;if(te){const dt=R.getValueAndResolveTokens("text-field",qe,y,we),_t=Hn.factory(dt);Av(_t)&&(this.hasRTLText=!0),(!this.hasRTLText||xc()==="unavailable"||this.hasRTLText&&_s.isParsed())&&(st=J0(_t,R,qe))}if(ae){const dt=R.getValueAndResolveTokens("icon-image",qe,y,we);We=dt instanceof Un?dt:Un.build(dt)}if(!st&&!We)continue;const ct=this.sortFeaturesByKey?ue.evaluate(qe,{},y):void 0,ft={id:ke,text:st,icon:We,index:Be,sourceLayerIndex:He,geometry:qe.geometry,properties:Me.properties,type:Tv[Me.type],sortKey:ct};if(this.features.push(ft),We){const dt=zf(this.iconSizeData,this.layers[0]._unevaluatedLayout._values["icon-size"],y,this.zoom,ft)*K*this.pixelRatio,_t=We.getPrimary().scaleSelf(dt);if(de[_t.id]=de[_t.id]||[],de[_t.id].push(_t),We.nameSecondary){const Tt=We.getSecondary().scaleSelf(dt);de[Tt.id]=de[Tt.id]||[],de[Tt.id].push(Tt)}}if(st){const dt=Q.evaluate(qe,{},y).join(","),_t=j.get("text-rotation-alignment")==="map"&&j.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Bs.vertical)>=0;for(const Tt of st.sections)if(Tt.image){const Ct=Tt.image.getPrimary().scaleSelf(this.pixelRatio);de[Ct.id]=de[Ct.id]||[],de[Ct.id].push(Ct)}else{const Ct=jh(st.toString()),vt=Tt.fontStack||dt,qt=xe[vt]=xe[vt]||{};this.calculateGlyphDependencies(Tt.text,qt,_t,this.allowVerticalPlacement,Ct)}}}j.get("symbol-placement")==="line"&&(this.features=function(Me){const ke={},Be={},He=[];let $e=0;function qe(ft){He.push(Me[ft]),$e++}function st(ft,dt,_t){const Tt=Be[ft];return delete Be[ft],Be[dt]=Tt,He[Tt].geometry[0].pop(),He[Tt].geometry[0]=He[Tt].geometry[0].concat(_t[0]),Tt}function We(ft,dt,_t){const Tt=ke[dt];return delete ke[dt],ke[ft]=Tt,He[Tt].geometry[0].shift(),He[Tt].geometry[0]=_t[0].concat(He[Tt].geometry[0]),Tt}function ct(ft,dt,_t){const Tt=_t?dt[0][dt[0].length-1]:dt[0][0];return`${ft}:${Tt.x}:${Tt.y}`}for(let ft=0;ft<Me.length;ft++){const dt=Me[ft],_t=dt.geometry,Tt=dt.text?dt.text.toString():null;if(!Tt){qe(ft);continue}const Ct=ct(Tt,_t),vt=ct(Tt,_t,!0);if(Ct in Be&&vt in ke&&Be[Ct]!==ke[vt]){const qt=We(Ct,vt,_t),ei=st(Ct,vt,He[qt].geometry);
vendor: 4,683 bytes, line 273
273delete ke[Ct],delete Be[vt],Be[ct(Tt,He[ei].geometry,!0)]=ei,He[qt].geometry=null}else Ct in Be?st(Ct,vt,_t):vt in ke?We(Ct,vt,_t):(qe(ft),ke[Ct]=$e-1,Be[vt]=$e-1)}return He.filter(ft=>ft.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Me,ke)=>Me.sortKey-ke.sortKey)}update(e,r,y,U,R,j,X){this.text.programConfigurations.updatePaintArrays(e,r,R,y,U,j,X),this.icon.programConfigurations.updatePaintArrays(e,r,R,y,U,j,X)}updateZOffset(){const e=(R,j,X)=>{y+=j,y>R.length&&R.resize(y);for(let Q=-j;Q<0;Q++)R.emplace(Q+y,X)},r=(R,j,X)=>{U+=j,U>R.length&&R.resize(U);for(let Q=-j;Q<0;Q++)R.emplace(Q+U,X)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let y=0,U=0;for(let R=0;R<this.symbolInstances.length;R++){const j=this.symbolInstances.get(R),{numHorizontalGlyphVertices:X,numVerticalGlyphVertices:Q,numIconVertices:se}=j,W=j.zOffset,ee=se>0;if((X>0||Q>0)&&(e(this.text.zOffsetVertexArray,X,W),e(this.text.zOffsetVertexArray,Q,W)),ee){const{placedIconSymbolIndex:ne,verticalPlacedIconSymbolIndex:K}=j;ne>=0&&r(this.icon.zOffsetVertexArray,se,W),K>=0&&r(this.icon.zOffsetVertexArray,j.numVerticalIconVertices,W)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=x_(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const y=this.lineVertexArray.length;if(e.segment!==void 0)for(const{x:U,y:R}of r)this.lineVertexArray.emplaceBack(U,R);return{lineStartIndex:y,lineLength:this.lineVertexArray.length-y}}addSymbols(e,r,y,U,R,j,X,Q,se,W,ee,ne,K,te,ae,ue){const de=e.indexArray,xe=e.layoutVertexArray,we=e.globeExtVertexArray,me=e.segments.prepareSegment(4*r.length,xe,de,this.canOverlap?j.sortKey:void 0),Me=this.glyphOffsetArray.length,ke=me.vertexLength,Be=this.allowVerticalPlacement&&X===Bs.vertical?Math.PI/2:0,He=j.text&&j.text.sections;for(let qe=0;qe<r.length;qe++){const{tl:st,tr:We,bl:ct,br:ft,texPrimary:dt,texSecondary:_t,pixelOffsetTL:Tt,pixelOffsetBR:Ct,minFontScaleX:vt,minFontScaleY:qt,glyphOffset:ei,isSDF:Gt,sectionIndex:yi}=r[qe],mi=me.vertexLength,ni=ei[1];if(cp(xe,se.x,se.y,st.x,ni+st.y,dt.x,dt.y,y,Gt,Tt.x,Tt.y,vt,qt),cp(xe,se.x,se.y,We.x,ni+We.y,dt.x+dt.w,dt.y,y,Gt,Ct.x,Tt.y,vt,qt),cp(xe,se.x,se.y,ct.x,ni+ct.y,dt.x,dt.y+dt.h,y,Gt,Tt.x,Ct.y,vt,qt),cp(xe,se.x,se.y,ft.x,ni+ft.y,dt.x+dt.w,dt.y+dt.h,y,Gt,Ct.x,Ct.y,vt,qt),Q){const{x:ti,y:Ai,z:vi}=Q.anchor,[wi,ji,Ji]=Q.up;up(we,ti,Ai,vi,wi,ji,Ji),up(we,ti,Ai,vi,wi,ji,Ji),up(we,ti,Ai,vi,wi,ji,Ji),up(we,ti,Ai,vi,wi,ji,Ji),dp(e.dynamicLayoutVertexArray,ti,Ai,vi,Be)}else dp(e.dynamicLayoutVertexArray,se.x,se.y,se.z,Be);if(ue){const ti=_t||dt;hp(e.iconTransitioningVertexArray,ti.x,ti.y),hp(e.iconTransitioningVertexArray,ti.x+ti.w,ti.y),hp(e.iconTransitioningVertexArray,ti.x,ti.y+ti.h),hp(e.iconTransitioningVertexArray,ti.x+ti.w,ti.y+ti.h)}de.emplaceBack(mi,mi+1,mi+2),de.emplaceBack(mi+1,mi+2,mi+3),me.vertexLength+=4,me.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ei[0]),qe!==r.length-1&&yi===r[qe+1].sectionIndex||e.programConfigurations.populatePaintArrays(xe.length,j,j.index,{},K,te,ae,He&&He[yi])}const $e=Q?Q.anchor:se;e.placedSymbolArray.emplaceBack($e.x,$e.y,$e.z,se.x,se.y,Me,this.glyphOffsetArray.length-Me,ke,W,ee,se.segment,y?y[0]:0,y?y[1]:0,U[0],U[1],X,0,!1,0,ne,0)}_commitLayoutVertex(e,r,y,U,R,j,X){e.emplaceBack(r,y,U,R,j,Math.round(X.x),Math.round(X.y))}_addCollisionDebugVertices(e,r,y,U,R,j,X){const Q=y.segments.prepareSegment(4,y.layoutVertexArray,y.indexArray),se=Q.vertexLength,W=X.tileAnchorX,ee=X.tileAnchorY;for(let K=0;K<4;K++)y.collisionVertexArray.emplaceBack(0,0,0,0,0,0);this._commitDebugCollisionVertexUpdate(y.collisionVertexArrayExt,r,e.padding,X.zOffset),this._commitLayoutVertex(y.layoutVertexArray,U,R,j,W,ee,
vendor: 6,306 bytes, line 273
273new Ht(e.x1,e.y1)),this._commitLayoutVertex(y.layoutVertexArray,U,R,j,W,ee,new Ht(e.x2,e.y1)),this._commitLayoutVertex(y.layoutVertexArray,U,R,j,W,ee,new Ht(e.x2,e.y2)),this._commitLayoutVertex(y.layoutVertexArray,U,R,j,W,ee,new Ht(e.x1,e.y2)),Q.vertexLength+=4;const ne=y.indexArray;ne.emplaceBack(se,se+1),ne.emplaceBack(se+1,se+2),ne.emplaceBack(se+2,se+3),ne.emplaceBack(se+3,se),Q.primitiveLength+=4}_addTextDebugCollisionBoxes(e,r,y,U,R,j){for(let X=U;X<R;X++){const Q=y.get(X),se=this.getSymbolInstanceTextSize(e,j,r,X);this._addCollisionDebugVertices(Q,se,this.textCollisionBox,Q.projectedAnchorX,Q.projectedAnchorY,Q.projectedAnchorZ,j)}}_addIconDebugCollisionBoxes(e,r,y,U,R,j){for(let X=U;X<R;X++){const Q=y.get(X),se=this.getSymbolInstanceIconSize(e,r,j.placedIconSymbolIndex);this._addCollisionDebugVertices(Q,se,this.iconCollisionBox,Q.projectedAnchorX,Q.projectedAnchorY,Q.projectedAnchorZ,j)}}generateCollisionDebugBuffers(e,r,y){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Hf(Pc,jg.members,Ia),this.iconCollisionBox=new Hf(Pc,jg.members,Ia);const U=Vc(this.iconSizeData,e),R=Vc(this.textSizeData,e,y);for(let j=0;j<this.symbolInstances.length;j++){const X=this.symbolInstances.get(j);this._addTextDebugCollisionBoxes(R,e,r,X.textBoxStartIndex,X.textBoxEndIndex,X),this._addTextDebugCollisionBoxes(R,e,r,X.verticalTextBoxStartIndex,X.verticalTextBoxEndIndex,X),this._addIconDebugCollisionBoxes(U,e,r,X.iconBoxStartIndex,X.iconBoxEndIndex,X),this._addIconDebugCollisionBoxes(U,e,r,X.verticalIconBoxStartIndex,X.verticalIconBoxEndIndex,X)}}getSymbolInstanceTextSize(e,r,y,U){const R=this.text.placedSymbolArray.get(r.rightJustifiedTextSymbolIndex>=0?r.rightJustifiedTextSymbolIndex:r.centerJustifiedTextSymbolIndex>=0?r.centerJustifiedTextSymbolIndex:r.leftJustifiedTextSymbolIndex>=0?r.leftJustifiedTextSymbolIndex:r.verticalPlacedTextSymbolIndex>=0?r.verticalPlacedTextSymbolIndex:U),j=Qd(this.textSizeData,e,R)/Yn;return this.tilePixelRatio*j}getSymbolInstanceIconSize(e,r,y){const U=this.icon.placedSymbolArray.get(y),R=Qd(this.iconSizeData,e,U);return this.tilePixelRatio*R}_commitDebugCollisionVertexUpdate(e,r,y,U){e.emplaceBack(r,-y,-y,U),e.emplaceBack(r,y,-y,U),e.emplaceBack(r,y,y,U),e.emplaceBack(r,-y,y,U)}_updateTextDebugCollisionBoxes(e,r,y,U,R,j,X){for(let Q=U;Q<R;Q++){const se=y.get(Q),W=this.getSymbolInstanceTextSize(e,j,r,Q);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,W,se.padding,j.zOffset)}}_updateIconDebugCollisionBoxes(e,r,y,U,R,j,X){for(let Q=U;Q<R;Q++){const se=y.get(Q),W=this.getSymbolInstanceIconSize(e,r,j.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,W,se.padding,j.zOffset)}}updateCollisionDebugBuffers(e,r,y,U){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const R=Vc(this.iconSizeData,e,U),j=Vc(this.textSizeData,e,y);for(let X=0;X<this.symbolInstances.length;X++){const Q=this.symbolInstances.get(X);this._updateTextDebugCollisionBoxes(j,e,r,Q.textBoxStartIndex,Q.textBoxEndIndex,Q,y),this._updateTextDebugCollisionBoxes(j,e,r,Q.verticalTextBoxStartIndex,Q.verticalTextBoxEndIndex,Q,y),this._updateIconDebugCollisionBoxes(R,e,r,Q.iconBoxStartIndex,Q.iconBoxEndIndex,Q,U),this._updateIconDebugCollisionBoxes(R,e,r,Q.verticalIconBoxStartIndex,Q.verticalIconBoxEndIndex,Q,U)}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,r,y,U,R,j,X,Q,se){const W={};if(r<y){const{x1:ee,y1:ne,x2:K,y2:te,padding:ae,projectedAnchorX:ue,projectedAnchorY:de,projectedAnchorZ:xe,tileAnchorX:we,tileAnchorY:me,featureIndex:Me}=e.get(r);W.textBox={x1:ee,y1:ne,x2:K,y2:te,padding:ae,projectedAnchorX:ue,projectedAnchorY:de,projectedAnchorZ:xe,tileAnchorX:we,tileAnchorY:me},W.textFeatureIndex=Me}if(U<R){const{x1:ee,y1:ne,x2:K,y2:te,padding:ae,projectedAnchorX:ue,projectedAnchorY:de,projectedAnchorZ:xe,tileAnchorX:we,tileAnchorY:me,featureIndex:Me}=e.get(U);W.verticalTextBox={x1:ee,y1:ne,x2:K,y2:te,padding:ae,projectedAnchorX:ue,projectedAnchorY:de,projectedAnchorZ:xe,tileAnchorX:we,tileAnchorY:me},W.verticalTextFeatureIndex=Me}if(j<X){const{x1:ee,y1:ne,x2:K,y2:te,padding:ae,projectedAnchorX:ue,projectedAnchorY:de,projectedAnchorZ:xe,tileAnchorX:we,tileAnchorY:me,featureIndex:Me}=e.get(j);W.iconBox={x1:ee,y1:ne,x2:K,y2:te,padding:ae,projectedAnchorX:ue,projectedAnchorY:de,projectedAnchorZ:xe,tileAnchorX:we,tileAnchorY:me},W.iconFeatureIndex=Me}if(Q<se){const{x1:ee,y1:ne,x2:K,y2:te,padding:ae,projectedAnchorX:ue,projectedAnchorY:de,projectedAnchorZ:xe,tileAnchorX:we,tileAnchorY:me,featureIndex:Me}=e.get(Q);W.verticalIconBox={x1:ee,y1:ne,x2:K,y2:te,padding:ae,projectedAnchorX:ue,projectedAnchorY:de,projectedAnchorZ:xe,tileAnchorX:we,tileAnchorY:me},W.verticalIconFeatureIndex=Me}return W}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const y=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,y.textBoxStartIndex,y.textBoxEndIndex,y.verticalTextBoxStartIndex,y.verticalTextBoxEndIndex,y.iconBoxStartIndex,y.iconBoxEndIndex,y.verticalIconBoxStartIndex,y.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,r){const y=e.placedSymbolArray.get(r),U=y.vertexStartIndex+4*y.numGlyphs;for(let R=y.vertexStartIndex;R<U;R+=4)e.indexArray.emplaceBack(R,R+1,R+2),e.indexArray.emplaceBack(R+1,R+2,R+3)}
vendor: 16,384 bytes, line 273
273getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const r=Math.sin(e),y=Math.cos(e),U=[],R=[],j=[];for(let X=0;X<this.symbolInstances.length;++X){j.push(X);const Q=this.symbolInstances.get(X);U.push(0|Math.round(r*Q.tileAnchorX+y*Q.tileAnchorY)),R.push(Q.featureIndex)}return j.sort((X,Q)=>U[X]-U[Q]||R[Q]-R[X]),j}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,r)=>this.symbolInstances.get(r).zOffset-this.symbolInstances.get(e).zOffset)}addToSortKeyRanges(e,r){const y=this.sortKeyRanges[this.sortKeyRanges.length-1];y&&y.sortKey===r?y.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const y=this.symbolInstances.get(r);this.featureSortOrder.push(y.featureIndex);const{rightJustifiedTextSymbolIndex:U,centerJustifiedTextSymbolIndex:R,leftJustifiedTextSymbolIndex:j,verticalPlacedTextSymbolIndex:X,placedIconSymbolIndex:Q,verticalPlacedIconSymbolIndex:se}=y;U>=0&&this.addIndicesForPlacedSymbol(this.text,U),R>=0&&R!==U&&this.addIndicesForPlacedSymbol(this.text,R),j>=0&&j!==R&&j!==U&&this.addIndicesForPlacedSymbol(this.text,j),X>=0&&this.addIndicesForPlacedSymbol(this.text,X),Q>=0&&this.addIndicesForPlacedSymbol(this.icon,Q),se>=0&&this.addIndicesForPlacedSymbol(this.icon,se)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let b_,w_,Wf;Ti(pp,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),pp.addDynamicAttributes=dp;class S_{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Va,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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}}Ti(S_,"FormatSectionOverride",{omit:["defaultValue"]});const Zf=()=>Wf||(Wf={layout:b_||(b_=new Wr({"symbol-placement":new oi(Rt.layout_symbol["symbol-placement"]),"symbol-spacing":new oi(Rt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new oi(Rt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new bi(Rt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new oi(Rt.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new oi(Rt.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new oi(Rt.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new oi(Rt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new oi(Rt.layout_symbol["icon-ignore-placement"]),"icon-optional":new oi(Rt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new oi(Rt.layout_symbol["icon-rotation-alignment"]),"icon-size":new bi(Rt.layout_symbol["icon-size"]),"icon-size-scale-range":new oi(Rt.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new bi(Rt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new bi(Rt.layout_symbol["icon-text-fit-padding"]),"icon-image":new bi(Rt.layout_symbol["icon-image"]),"icon-rotate":new bi(Rt.layout_symbol["icon-rotate"]),"icon-padding":new oi(Rt.layout_symbol["icon-padding"]),"icon-keep-upright":new oi(Rt.layout_symbol["icon-keep-upright"]),"icon-offset":new bi(Rt.layout_symbol["icon-offset"]),"icon-anchor":new bi(Rt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new oi(Rt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new oi(Rt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new oi(Rt.layout_symbol["text-rotation-alignment"]),"text-field":new bi(Rt.layout_symbol["text-field"]),"text-font":new bi(Rt.layout_symbol["text-font"]),"text-size":new bi(Rt.layout_symbol["text-size"]),"text-size-scale-range":new oi(Rt.layout_symbol["text-size-scale-range"]),"text-max-width":new bi(Rt.layout_symbol["text-max-width"]),"text-line-height":new bi(Rt.layout_symbol["text-line-height"]),"text-letter-spacing":new bi(Rt.layout_symbol["text-letter-spacing"]),"text-justify":new bi(Rt.layout_symbol["text-justify"]),"text-radial-offset":new bi(Rt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new oi(Rt.layout_symbol["text-variable-anchor"]),"text-anchor":new bi(Rt.layout_symbol["text-anchor"]),"text-max-angle":new oi(Rt.layout_symbol["text-max-angle"]),"text-writing-mode":new oi(Rt.layout_symbol["text-writing-mode"]),"text-rotate":new bi(Rt.layout_symbol["text-rotate"]),"text-padding":new oi(Rt.layout_symbol["text-padding"]),"text-keep-upright":new oi(Rt.layout_symbol["text-keep-upright"]),"text-transform":new bi(Rt.layout_symbol["text-transform"]),"text-offset":new bi(Rt.layout_symbol["text-offset"]),"text-allow-overlap":new oi(Rt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new oi(Rt.layout_symbol["text-ignore-placement"]),"text-optional":new oi(Rt.layout_symbol["text-optional"]),visibility:new oi(Rt.layout_symbol.visibility)})),paint:w_||(w_=new Wr({"icon-opacity":new bi(Rt.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new bi(Rt.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new bi(Rt.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new bi(Rt.paint_symbol["text-emissive-strength"]),"icon-color":new bi(Rt.paint_symbol["icon-color"]),"icon-halo-color":new bi(Rt.paint_symbol["icon-halo-color"]),"icon-halo-width":new bi(Rt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new bi(Rt.paint_symbol["icon-halo-blur"]),"icon-translate":new oi(Rt.paint_symbol["icon-translate"]),"icon-translate-anchor":new oi(Rt.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new bi(Rt.paint_symbol["icon-image-cross-fade"]),"text-opacity":new bi(Rt.paint_symbol["text-opacity"]),"text-occlusion-opacity":new bi(Rt.paint_symbol["text-occlusion-opacity"]),"text-color":new bi(Rt.paint_symbol["text-color"],{runtimeType:$n,getOverride:h=>h.textColor,hasOverride:h=>!!h.textColor}),"text-halo-color":new bi(Rt.paint_symbol["text-halo-color"]),"text-halo-width":new bi(Rt.paint_symbol["text-halo-width"]),"text-halo-blur":new bi(Rt.paint_symbol["text-halo-blur"]),"text-translate":new oi(Rt.paint_symbol["text-translate"]),"text-translate-anchor":new oi(Rt.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new oi(Rt.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new oi(Rt.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new oi(Rt.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new oi(Rt.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new bi(Rt.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},Wf);class fp extends kn{constructor(e,r,y,U){super(e,Zf(),r,y,U),this._colorAdjustmentMatrix=pt.mat4.identity([]),this.hasInitialOcclusionOpacityProperties=e.paint!==void 0&&("icon-occlusion-opacity"in e.paint||"text-occlusion-opacity"in e.paint)}recalculate(e,r){super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const y=this.layout.get("text-writing-mode");if(y){const U=[];for(const R of y)U.indexOf(R)<0&&U.push(R);this.layout._values["text-writing-mode"]=U}else this.layout._values["text-writing-mode"]=this.layout.get("symbol-placement")==="point"?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(e,r,y,U){return this._saturation===e&&this._contrast===r&&this._brightnessMin===y&&this._brightnessMax===U||(this._colorAdjustmentMatrix=function(R,j,X,Q){R=Oa(R),j=ss(j);const se=pt.mat4.create(),W=R/3,ee=1-2*W,ne=[ee,W,W,0,W,ee,W,0,W,W,ee,0,0,0,0,1],K=.5-.5*j,te=Q-X;return pt.mat4.multiply(se,[te,0,0,0,0,te,0,0,0,0,te,0,X,X,X,1],[j,0,0,0,0,j,0,0,0,0,j,0,K,K,K,1]),pt.mat4.multiply(se,se,ne),se}(e,r,y,U),this._saturation=e,this._contrast=r,this._brightnessMin=y,this._brightnessMax=U),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,r,y,U){const R=this.layout.get(e).evaluate(r,{},y,U),j=this._unevaluatedLayout._values[e];return j.isDataDriven()||bo(j.value)||!R?R:function(X,Q){return Q.replace(/{([^{}]+)}/g,(se,W)=>W in X?String(X[W]):"")}(r.properties,R)}createBucket(e){return new pp(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of Zf().paint.overridableProperties){if(!fp.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),y=new S_(r),U=new mc(y,r.property.specification,this.scope,this.options);let R=null;R=r.value.kind==="constant"||r.value.kind==="source"?new gc("source",U):new fl("composite",U,r.value.zoomStops,r.value._interpolationType),this.paint._values[e]=new Eo(r.property,R,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,y){return!(!this.layout||r.isDataDriven()||y.isDataDriven())&&fp.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const y=e.get("text-field"),U=Zf().paint.properties[r];let R=!1;const j=X=>{for(const Q of X)if(U.overrides&&U.overrides.hasOverride(Q))return void(R=!0)};if(y.value.kind==="constant"&&y.value.value instanceof Hn)j(y.value.value.sections);else if(y.value.kind==="source"){const X=se=>{R||(se instanceof Ln&&Kr(se.value)===qs?j(se.value.sections):se instanceof Ua?j(se.sections):se.eachChild(X))},Q=y.value;Q._styleExpression&&X(Q._styleExpression.expression)}return R}getProgramIds(){return["symbol"]}getDefaultProgramParams(e,r,y){return{config:new no(this,{zoom:r,lut:y}),overrideFog:!1}}}let T_,E_,A_,M_;var Xf=Tr([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);function Yf(h){switch(h){case WebGL2RenderingContext.RGBA8: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 Jf(h){switch(h){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;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}}class Kf{constructor(e,r,y,U){this.context=e,this.format=y,this.useMipmap=U&&U.useMipmap,this.texture=e.gl.createTexture(),this.update(r,{premultiply:U&&U.premultiply})}update(e,r){const y=e&&e instanceof HTMLVideoElement&&e.width===0?e.videoWidth:e.width,U=e&&e instanceof HTMLVideoElement&&e.height===0?e.videoHeight:e.height,{context:R}=this,{gl:j}=R,{x:X,y:Q}=r&&r.position?r.position:{x:0,y:0},se=X+y,W=Q+U;!this.size||this.size[0]===se&&this.size[1]===W||(j.bindTexture(j.TEXTURE_2D,null),j.deleteTexture(this.texture),this.texture=j.createTexture(),this.size=null),j.bindTexture(j.TEXTURE_2D,this.texture),R.pixelStoreUnpackFlipY.set(!1),R.pixelStoreUnpack.set(1),R.pixelStoreUnpackPremultiplyAlpha.set(this.format===j.RGBA8&&(!r||r.premultiply!==!1));const ee=e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap;if(!this.size&&se>0&&W>0){const ne=this.useMipmap?Math.floor(Math.log2(Math.max(se,W)))+1:1;j.texStorage2D(j.TEXTURE_2D,ne,this.format,se,W),this.size=[se,W]}if(this.size)if(ee)j.texSubImage2D(j.TEXTURE_2D,0,X,Q,Yf(this.format),Jf(this.format),e);else{const ne=e.data;ne&&j.texSubImage2D(j.TEXTURE_2D,0,X,Q,y,U,Yf(this.format),Jf(this.format),ne)}this.useMipmap&&j.generateMipmap(j.TEXTURE_2D)}bind(e,r,y=!1){const{context:U}=this,{gl:R}=U;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&&!y?e===R.NEAREST?R.NEAREST_MIPMAP_NEAREST:R.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),r!==this.wrapS&&(R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,r),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,r),this.wrapS=r)}bindExtraParam(e,r,y,U){const{context:R}=this,{gl:j}=R;j.bindTexture(j.TEXTURE_2D,this.texture),r!==this.magFilter&&(j.texParameteri(j.TEXTURE_2D,j.TEXTURE_MAG_FILTER,r),this.magFilter=r),e!==this.minFilter&&(j.texParameteri(j.TEXTURE_2D,j.TEXTURE_MIN_FILTER,this.useMipmap?e===j.NEAREST?j.NEAREST_MIPMAP_NEAREST:j.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),y!==this.wrapS&&(j.texParameteri(j.TEXTURE_2D,j.TEXTURE_WRAP_S,y),this.wrapS=y),U!==this.wrapT&&(j.texParameteri(j.TEXTURE_2D,j.TEXTURE_WRAP_T,U),this.wrapT=U)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class mp{constructor(e,r){this.context=e,this.texture=r}bind(e,r){const{context:y}=this,{gl:U}=y;U.bindTexture(U.TEXTURE_2D,this.texture),e!==this.minFilter&&(U.texParameteri(U.TEXTURE_2D,U.TEXTURE_MAG_FILTER,e),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_MIN_FILTER,e),this.minFilter=e),r!==this.wrapS&&(U.texParameteri(U.TEXTURE_2D,U.TEXTURE_WRAP_S,r),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_WRAP_T,r),this.wrapS=r)}}function gp(h,e,r,y,U,R,j,X){const Q=[h,e,1,r,y,1,U,R,1],se=[j,X,1],W=pt.mat3.adjoint([],Q),[ee,ne,K]=pt.vec3.transformMat3(se,se,W);return pt.mat3.multiply(Q,Q,[ee,0,0,0,ne,0,0,0,K])}function P_(h,e,r,y,U,R,j,X){const Q=function(se,W,ee,ne,K,te,ae,ue){const de=gp(0,0,1,0,1,1,0,1),xe=gp(se,W,ee,ne,K,te,ae,ue),we=pt.mat3.adjoint([],de);return pt.mat3.multiply(xe,xe,we)}(h,e,r,y,U,R,j,X);return[Q[2]/Q[8]/gi,Q[5]/Q[8]/gi]}function _p(h){return[h[0],Math.min(Math.max(h[1],-85.051129),cs)]}class C_ extends wa{constructor(e,r,y,U){super(),this.id=e,this.dispatcher=y,this.coordinates=r.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(U),this.options=r,this._dirty=!1}load(e,r){if(this._loaded=r||!1,this.fire(new Gs("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return e&&(this.coordinates=e),this._loaded=!0,void this._finishLoading();this._imageRequest=eh(this.map._requestManager.transformRequest(this.url,xr.Image),(y,U)=>{this._imageRequest=null,this._loaded=!0,y?this.fire(new Wl(y)):U&&(this.image=U instanceof HTMLImageElement?tt.getImageData(U):U,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())})}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}
vendor: 7,485 bytes, line 273
273setTexture(e){if(!(e.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new mp(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Gs("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(e){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof mp||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let r=e[0][1],y=e[0][1];for(const R of e)R[1]>y&&(y=R[1]),R[1]<r&&(r=R[1]);const U=(y+r)/2;if(U>cs?this.onNorthPole=!0:U<-85.051129&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const R=e.map(l.fromLngLat);this.tileID=function(j){let X=1/0,Q=1/0,se=-1/0,W=-1/0;for(const ae of j)X=Math.min(X,ae.x),Q=Math.min(Q,ae.y),se=Math.max(se,ae.x),W=Math.max(W,ae.y);const ee=Math.max(se-X,W-Q),ne=Math.max(0,Math.floor(-Math.log(ee)/Math.LN2)),K=Math.pow(2,ne);let te=Math.floor((X+se)/2*K);return te>1&&(te-=1),new Qt(ne,te,Math.floor((Q+W)/2*K))}(R),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new Gs("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(e){for(const de in this.tiles){const xe=this.tiles[de];xe.state!=="loaded"&&(xe.state="loaded",xe.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const r=Ru(new Qt(0,0,0),this.map.transform.projection),y=[r.projection.project(this.coordinates[0][0],this.coordinates[0][1]),r.projection.project(this.coordinates[1][0],this.coordinates[1][1]),r.projection.project(this.coordinates[2][0],this.coordinates[2][1]),r.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(de){const xe=de[1].x-de[0].x,we=de[1].y-de[0].y,me=de[2].x-de[1].x,Me=de[2].y-de[1].y,ke=de[3].x-de[2].x,Be=de[3].y-de[2].y,He=de[0].x-de[3].x,$e=de[0].y-de[3].y,qe=xe*Me-me*we,st=me*Be-ke*Me,We=ke*$e-He*Be,ct=He*we-xe*$e;return qe>0&&st>0&&We>0&&ct>0||qe<0&&st<0&&We<0&&ct<0}(y))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const U=Ru(this.tileID,this.map.transform.projection),[R,j,X,Q]=this.coordinates.map(de=>{const xe=U.projection.project(de[0],de[1]);return m_(U,xe)._round()});this.perspectiveTransform=P_(R.x,R.y,j.x,j.y,X.x,X.y,Q.x,Q.y);const se=this._boundsArray=new pa;se.emplaceBack(R.x,R.y,0,0),se.emplaceBack(j.x,j.y,gi,0),se.emplaceBack(Q.x,Q.y,0,gi),se.emplaceBack(X.x,X.y,gi,gi),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=e.createVertexBuffer(se,Xf.members),this.boundsSegments=an.simpleSegment(0,0,4,2);const W=[],ee=[_p((ne=this.coordinates)[0]),_p(ne[1]),_p(ne[2]),_p(ne[3])];var ne;const[K,te,ae,ue]=function(de){let xe=de[0][0],we=xe,me=de[0][1],Me=me;for(let ke=1;ke<de.length;ke++)de[ke][0]<xe?xe=de[ke][0]:de[ke][0]>we&&(we=de[ke][0]),de[ke][1]<me?me=de[ke][1]:de[ke][1]>Me&&(Me=de[ke][1]);return[xe,me,we-xe,Me-me]}(ee);{const de=new pa,[xe,we,me,Me]=function(Tt){let Ct=Tt[0].x,vt=Ct,qt=Tt[0].y,ei=qt;for(let Gt=1;Gt<Tt.length;Gt++)Tt[Gt].x<Ct?Ct=Tt[Gt].x:Tt[Gt].x>vt&&(vt=Tt[Gt].x),Tt[Gt].y<qt?qt=Tt[Gt].y:Tt[Gt].y>ei&&(ei=Tt[Gt].y);return[Ct,qt,vt-Ct,ei-qt]}(y),ke=Tt=>[(Tt.x-xe)/me,(Tt.y-we)/Me],[Be,He,$e,qe]=y.map(ke),st=function(Tt,Ct,vt,qt,ei,Gt,yi,mi){const ni=gp(0,0,1,0,1,1,0,1),ti=gp(Tt,Ct,vt,qt,ei,Gt,yi,mi),Ai=pt.mat3.adjoint([],ti);return pt.mat3.multiply(ni,ni,Ai)}(Be[0],Be[1],He[0],He[1],$e[0],$e[1],qe[0],qe[1]);this.elevatedGlobePerspectiveTransform=P_(Be[0],Be[1],He[0],He[1],$e[0],$e[1],qe[0],qe[1]);const We=(Tt,Ct)=>{W.push(Tt.lng);const vt=Math.round((Tt.lng-K)/ae*gi),qt=Math.round((Tt.lat-te)/ue*gi),ei=ke(Ct),Gt=pt.vec3.transformMat3([],[ei[0],ei[1],1],st),yi=Math.round(Gt[0]/Gt[2]*gi),mi=Math.round(Gt[1]/Gt[2]*gi);de.emplaceBack(vt,qt,yi,mi)},ct=y[3].x-y[0].x,ft=y[3].y-y[0].y,dt=y[2].x-y[1].x,_t=y[2].y-y[1].y;for(let Tt=0;Tt<65;Tt++){const Ct=Tt/64,vt=[y[0].x+Ct*ct,y[0].y+Ct*ft],qt=[y[1].x+Ct*dt,y[1].y+Ct*_t],ei=qt[0]-vt[0],Gt=qt[1]-vt[1];for(let yi=0;yi<65;yi++){const mi=yi/64,ni={x:vt[0]+ei*mi,y:vt[1]+Gt*mi};We(r.projection.unproject(ni.x,ni.y),ni)}}this.elevatedGlobeVertexBuffer=e.createVertexBuffer(de,Xf.members)}{this.maxLongitudeTriangleSize=0;let de=[],xe=new On;const we=(me,Me,ke)=>{xe.emplaceBack(me,Me,ke);const Be=W[me],He=W[Me],$e=W[ke],qe=Math.min(Math.min(Be,He),$e),st=Math.max(Math.max(Be,He),$e)-qe;st>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=st),de.push(qe+st/2)};for(let me=0;me<64;me++)for(let Me=0;Me<64;Me++){const ke=65*me+Me,Be=ke+1,He=ke+65,$e=He+1;we(ke,He,Be),we(Be,He,$e)}[de,xe]=function(me,Me){const ke=Array.from({length:me.length},($e,qe)=>qe);ke.sort(($e,qe)=>me[$e]-me[qe]);const Be=[],He=new On;for(let $e=0;$e<ke.length;$e++){const qe=ke[$e];Be.push(me[qe]);const st=3*qe,We=st+1;He.emplaceBack(Me.uint16[st],Me.uint16[We],Me.uint16[We+1])}return[Be,He]}(de,xe),this.elevatedGlobeTrianglesCenterLongitudes=de,this.elevatedGlobeIndexBuffer=e.createIndexBuffer(xe)}this.elevatedGlobeSegments=an.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,ae/gi,0,ue/gi,0,0,te,K,0])}prepare(){const e=Object.keys(this.tiles).length!==0;if(this.tileID&&!e)return;const r=this.map.painter.context,y=r.gl;!this._dirty||this.texture instanceof mp||(this.texture?this.texture.update(this.image):(this.texture=new Kf(r,this.image,y.RGBA8),this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE)),this._dirty=!1),e&&this._prepareData(r)}loadTile(e,r){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},r(null)):(e.state="errored",r(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(e){const r=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!r)return null;const y=this.elevatedGlobeTrianglesCenterLongitudes;let U=(R=e+180)+360*Math.round((y[0]-R)/360);var R;const j=new an,X=(ee,ne)=>{j.segments.push({vertexOffset:0,primitiveOffset:ee,vertexLength:r.segments[0].vertexLength,primitiveLength:ne,sortKey:void 0,vaos:{}})},Q=.51*this.maxLongitudeTriangleSize;if(Math.abs(y[0]-U)<=Q){const ee=qn(y,0,y.length,U+Q);return ee===y.length||X(ee,Ds(y,ee+1,y.length,U+360-Q)-ee),j}U<y[0]&&(U+=360);const se=Ds(y,0,y.length,U-Q);if(se===y.length)return X(0,y.length),j;X(0,se-0);const W=qn(y,se+1,y.length,U+Q);return W!==y.length&&X(W,y.length-W),j}}const Mv=(Math.pow(256,2)-1)/16907520;class I_ extends kn{constructor(e,r,y,U){super(e,{layout:A_||(A_=new Wr({visibility:new oi(Rt.layout_raster.visibility)})),paint:M_||(M_=new Wr({"raster-opacity":new oi(Rt.paint_raster["raster-opacity"]),"raster-color":new Mo(Rt.paint_raster["raster-color"]),"raster-color-mix":ne
vendor: 5,219 bytes, line 273
273w oi(Rt.paint_raster["raster-color-mix"]),"raster-color-range":new oi(Rt.paint_raster["raster-color-range"]),"raster-hue-rotate":new oi(Rt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new oi(Rt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new oi(Rt.paint_raster["raster-brightness-max"]),"raster-saturation":new oi(Rt.paint_raster["raster-saturation"]),"raster-contrast":new oi(Rt.paint_raster["raster-contrast"]),"raster-resampling":new oi(Rt.paint_raster["raster-resampling"]),"raster-fade-duration":new oi(Rt.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new oi(Rt.paint_raster["raster-emissive-strength"]),"raster-array-band":new oi(Rt.paint_raster["raster-array-band"]),"raster-elevation":new oi(Rt.paint_raster["raster-elevation"]),"raster-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},r,y,U),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){return!(e&&e._source instanceof C_&&(e._source.onNorthPole||e._source.onSouthPole))&&this.paint.get("raster-elevation")===0}_handleSpecialPaintPropertyUpdate(e){e!=="raster-color"&&e!=="raster-color-range"||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}updateColorRamp(e){if(!this.hasColorMap()||!this._curRampRange)return;const r=this._transitionablePaint._values["raster-color"].value.expression,[y,U]=e||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(y)&&isNaN(U)||y===this._curRampRange[0]&&U===this._curRampRange[1]||(this.colorRamp=yu({expression:r,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:y,end:U}],resolution:256}),this.colorRampTexture=null,this._curRampRange=[y,U])}}let D_,k_,R_,z_,L_;class F_ extends kn{constructor(e,r,y,U){super(e,{layout:D_||(D_=new Wr({visibility:new oi(Rt["layout_raster-particle"].visibility)})),paint:k_||(k_=new Wr({"raster-particle-array-band":new oi(Rt["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new oi(Rt["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new Mo(Rt["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new oi(Rt["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new oi(Rt["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new oi(Rt["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new oi(Rt["paint_raster-particle"]["raster-particle-reset-rate-factor"]),"raster-particle-elevation":new oi(Rt["paint_raster-particle"]["raster-particle-elevation"]),"raster-particle-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},r,y,U),this._updateColorRamp(),this.lastInvalidatedAt=tt.now()}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 this.visibility!=="none"}isDraped(e){return!1}_handleSpecialPaintPropertyUpdate(e){e!=="raster-particle-color"&&e!=="raster-particle-max-speed"||(this._updateColorRamp(),this._invalidateAnimationState()),e==="raster-particle-count"&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;const e=this._transitionablePaint._values["raster-particle-color"].value.expression,r=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=yu({expression:e,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:r}],resolution:256}),this.colorRampTexture=null}_invalidateAnimationState(){this.lastInvalidatedAt=tt.now()}tileCoverLift(){return this.paint.get("raster-particle-elevation")}}class Pv extends kn{constructor(e,r){super(e,{},r,null),this.implementation=e,e.slot&&(this.slot=e.slot)}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}isDraped(e){return this.implementation.renderToTile!==void 0}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 Qf(h,e,r){const y=[0,0,1],U=pt.quat.identity([]);return pt.quat.rotateY(U,U,r?-Xi(h)+Math.PI:Xi(h)),pt.quat.rotateX(U,U,-Xi(e)),pt.vec3.transformQuat(y,y,U),pt.vec3.normalize(y,y)}function O_(h,e){const r=yp(h.projection,h.zoom,h.width,h.height),y=function(R,j,X,Q,se){const W=new _r(X.lng-180*Uo,X.lat),ee=new _r(X.lng+180*Uo,X.lat),ne=R.project(W.lng,W.lat),K=R.project(ee.lng,ee.lat),te=-Math.atan2(K.y-ne.
273y,K.x-ne.x),ae=l.fromLngLat(X);ae.y=Ue(ae.y,-1+Uo,1-Uo);const ue=ae.toLngLat(),de=R.project(ue.lng,ue.lat),xe=l.fromLngLat(ue);xe.x+=Uo;const we=xe.toLngLat(),me=R.project(we.lng,we.lat),Me=N_(me.x-de.x,me.y-de.y,te),ke=l.fromLngLat(ue);ke.y+=Uo;const Be=ke.toLngLat(),He=R.project(Be.lng,Be.lat),$e=N_(He.x-de.x,He.y-de.y,te),qe=Math.abs(Me.x)/Math.abs($e.y),st=pt.mat4.identity([]);pt.mat4.rotateZ(st,st,-te*(1-(se?0:Q)));const We=pt.mat4.identity([]);return pt.mat4.scale(We,We,[1,1-(1-qe)*Q,1]),We[4]=-$e.x/$e.y*Q,pt.mat4.rotateZ(We,We,te),pt.mat4.multiply(We,st,We),We}(h.projection,0,h.center,r,e),U=B_(h);return pt.mat4.scale(y,y,[U,U,1]),y}function B_(h){const e=h.projection,r=yp(h.projection,h.zoom,h.width,h.height),y=em(e,h.center),U=em(e,_r.convert(e.center));return Math.pow(2,y*r+(1-r)*U)}function yp(h,e,r,y,U=1/0){const R=h.range;if(!R)return 0;const j=Math.min(U,Math.max(r,y)),X=Math.log(j/1024)/Math.LN2;return bt(R[0]+X,R[1]+X,e)}const Uo=1/4e4;function em(h,e){const r=Ue(e.lat,-85.051129,cs),y=new _r(e.lng-180*Uo,r),U=new _r(e.lng+180*Uo,r),R=h.project(y.lng,r),j=h.project(U.lng,r),X=l.fromLngLat(y),Q=l.fromLngLat(U),se=j.x-R.x,W=j.y-R.y,ee=Q.x-X.x,ne=Q.y-X.y,K=Math.sqrt((ee*ee+ne*ne)/(se*se+W*W));return Math.log(K)/Math.LN2}function N_(h,e,r){const y=Math.cos(r),U=Math.sin(r);return{x:h*y-e*U,y:h*U+e*y}}function V_(h,e,r){pt.mat4.identity(h),pt.mat4.rotateZ(h,h,Xi(e[2])),pt.mat4.rotateX(h,h,Xi(e[0])),pt.mat4.rotateY(h,h,Xi(e[1])),pt.mat4.scale(h,h,r),pt.mat4.multiply(h,h,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1])}function vp(h,e,r,y,U,R,j,X){const Q=[r[0]-e[0],r[1]-e[1],0],se=[y[0]-e[0],y[1]-e[1],0];if(pt.vec3.length(Q)<1e-12||pt.vec3.length(se)<1e-12)return pt.quat.identity(h);const W=pt.vec3.cross([],Q,se);pt.vec3.normalize(W,W),pt.vec3.subtract(se,y,e),Q[2]=(R-U)*X,se[2]=(j-U)*X;const ee=Q;return pt.vec3.cross(ee,Q,se),pt.vec3.normalize(ee,ee),pt.quat.rotationTo(h,W,ee)}function tm(h,e,r=!1){const y=hs(e.zoom),U=function(R,j,X){const Q=j.worldSize,se=[R[12],R[13],R[14]],W=Bn(se[1]/Q),ee=fs(se[0]/Q),ne=pt.mat4.identity([]),K=ns(1,W)*Q,te=ns(1,0)*Q*Lo(W,j.zoom),ae=1/Xn(Q);let ue=te*ae;if(X){const me=yp(j.projection,j.zoom,j.width,j.height,1024);ue=ae*j.projection.pixelSpaceConversion(j.center.lat,Q,me)}const de=so(W,ee);pt.vec3.add(de,de,pt.vec3.scale([],pt.vec3.normalize([],de),K*ue*se[2]));const xe=function(me){const Me=[me[0],me[1],me[2]];let ke=[0,1,0];const Be=pt.vec3.cross([],ke,Me);return pt.vec3.cross(ke,Me,Be),pt.vec3.squaredLength(ke)===0&&(ke=[0,1,0],pt.vec3.cross(Be,Me,ke)),pt.vec3.normalize(Be,Be),pt.vec3.normalize(ke,ke),pt.vec3.normalize(Me,Me),[Be[0],Be[1],Be[2],0,ke[0],ke[1],ke[2],0,Me[0],Me[1],Me[2],0,me[0],me[1],me[2],1]}(de);pt.mat4.scale(ne,ne,[ue,ue,ue*K]),pt.mat4.translate(ne,ne,[-se[0],-se[1],-se[2]]);const we=pt.mat4.multiply([],j.globeMatrix,xe);return pt.mat4.multiply(we,we,ne),pt.mat4.multiply(we,we,R),we}(h,e,r);if(y>0){const R=function(j,X){const Q=X.worldSize,se=ns(1,0)*Q*Lo(X.center.lat,X.zoom)/Xn(Q),W=ns(1,X.center.lat)*Q,ee=pt.mat4.identity([]);return pt.mat4.rotateY(ee,ee,Xi(X.center.lng)),pt.mat4.rotateX(ee,ee,Xi(X.center.lat)),pt.mat4.translate(ee,ee,[0,0,rs]),pt.mat4.scale(ee,ee,[se,se,se*W]),pt.mat4.translate(ee,ee,[X.point.x-.5*Q,X.point.y-.5*Q,0]),pt.mat4.multiply(ee,ee,j),pt.mat4.multiply(ee,X.globeMatrix,ee)}(h,e);return function(j,X,Q){const se=(te,ae,ue)=>{const de=pt.vec3.length(te),xe=pt.vec3.length(ae),we=bn(te,ae,ue);return pt.vec3.scale(we,we,1/pt.vec3.length(we)*Bi(de,xe,ue))},W=se([j[0],j[1],j[2]],[X[0],X[1],X[2]],Q),ee=se([j[4],j[5],j[6]],[X[4],X[5],X[6]],Q),ne=se([j[8],j[9],j[10]],[X[8],X[9],X[10]],Q),K=bn([j[12],j[13],j[14]],[X[12],X[13],X[14]],Q);return[W[0],W[1],W[2],0,ee[0],ee[1],ee[2],0,ne[0],ne[1],ne[2],0,K[0],K[1],K[2],1]}(U,R,y)}return U}function U_(h,e,r,y){const U=Pi.projectAabbCorners(y,r);let R=Number.MAX_VALUE,j=-1;for(let se=0;se<U.length;++se){const W=U[se];W[0]=(.5*W[0]+.5)*e.width,W[1]=(.5-.5*W[1])*e.height,W[2]<R&&(j=se,R=W[2])}const X=se=>new Ht(U[se][0],U[se][1]);let Q;switch(j){case 0:case 6:Q=[X(1),X(5),X(4),X(7),X(3),X(2),X(1)];break;case 1:case 7:Q=[X(0),X(4),X(5),X(6),X(2),X(3),X(0)];break;case 3:case 5:Q=[X(1),X(0),X(4),X(7),X(6),X(2),X(1)];break;default:Q=[X(1),X(5),X(6),X(7),X(3),X(0),X(1)]}if(De(h,Q))return R}const Cv=Tr([{name:"a_pos_3f",components:3,type:"Float32"}]),Iv=Tr([{name:"a_color_3f",components:3,type:"Float32"}]),Dv=Tr([{name:"a_color_4f",components:4,type:"Float32"}]),kv=Tr([{name:"a_uv_2f",components:2,type:"Float32"}]),Rv=Tr([{name:"a_normal_3f",components:3,type:"Float32"}]),zv=Tr([{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"}]),Lv=Tr([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]),j_={None:0,Model:1,Symbol:2,FillExtrusion:4,All:7};class xp{constructor(e,r,y,U){this.message=(e?`${e}: `:"")+y,U&&(this.identifier=U),r!=null&&r.__line__&&(this.line=r.__line__)}}function G_(h,e){const r=h.indexOf("://")===-1;try{return new URL(h,r&&e?"http://example.com":void 0),!0}catch{return!1}}class q_{constructor(e,r){this.feature=e,this.instancedDataOffset=r,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class $_{constructor(){this.instancedDataArray=new El,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class im{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.fqid),this.projection=e.projection,this.index=e.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.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?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}updateFootprints(e,r){}populate(e,r,y,U){this.tileToMeter=t(y);const R=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:j,id:X,index:Q,sourceLayerIndex:se}of e){const W=X??(j.properties&&j.properties.hasOwnProperty("id")?j.properties.id:void 0),ee=pe(j,R);if(!this.layers[0]._featureFilter.filter(new Nr(this.zoom),ee,y))continue;const ne={id:W,sourceLayerIndex:se,index:Q,geometry:R?ee.geometry:he(j,y,U),properties:j.properties,type:j.type,patterns:{}},K=this.addFeature(ne,ne.geometry,ee);K&&r.featureIndex.insert(j,ne.geometry,Q,se,this.index,this.instancesPerModel[K].instancedDataArray.length,gi/32)}this.lookup=null}update(e,r,y,U){for(const R in this.instancesPerModel){const j=this.instancesPerModel[R];for(const X in e)j.idToFeaturesIndex.hasOwnProperty(X)&&(this.evaluate(j.features[j.idToFeaturesIndex[X]],e[X],j,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let e=!1;for(const r in this.instancesPerModel){const y=this.instancesPerModel[r];for(const U of y.features){const R=this.layers[0],j=U.feature,X=this.canonical,Q=R.paint.get("model-rotation").evaluate(j,{},X),se=R.paint.get("model-scale").evaluate(j,{},X),W=R.paint.get("model-translation").evaluate(j,{},X);pt.vec3.exactEquals(U.rotation,Q)&&pt.vec3.exactEquals(U.scale,se)&&pt.vec3.exactEquals(U.translation,W)||(this.evaluate(U,U.featureStates,y,!0),e=!0)}}return e}updateReplacement(e,r,y,U){if(r.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=r.updateTime;const R=r.getReplacementRegionsForTile(e.toUnwrapped(),!0);if(Mf(this.activeReplacements,R))return!1;this.activeReplacements=R;let j=!1;for(const X in this.instancesPerModel){const Q=this.instancesPerModel[X],se=Q.instancedDataArray;for(const W of Q.features){const ee=W.instancedDataOffset,ne=W.instancedDataCount;for(let K=0;K<ne;K++){const te=16*(K+ee);let ae=se.float32[te+0];const ue=ae>gi;ae=ue?ae-gi:ae;const de=Math.floor(ae),xe=se.float32[te+1];let we=!1;for(const me of this.activeReplacements)if(!ag(me,y,j_.Model,U)&&!(me.min.x>de||de>me.max.x||me.min.y>xe||xe>me.max.y)&&(we=dg(ug(de,xe,e.canonical,me.footprintTileId.canonical),me.footprint),we))break;se.float32[te]=we?ae+gi:ae,j=j||we!==ue}}}return j}isEmpty(){for(const e in this.instancesPerModel)if(this.instancesPerModel[e].instancedDataArray.length!==0)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const r in this.instancesPerModel){const y=this.instancesPerModel[r];y.instancedDataArray.length<0||y.instancedDataArray.length===0||(y.instancedDataBuffer?y.instancedDataBuffer.updateData(y.instancedDataArray):y.instancedDataBuffer=e.createVertexBuffer(y.instancedDataArray,zv.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(const r in this.instancesPerModel){const y=this.instancesPerModel[r];y.instancedDataArray.length!==0&&y.instancedDataBuffer&&y.instancedDataBuffer.destroy()}const e=this.layers[0].modelManager;if(e&&this.modelUris)for(const r of this.modelUris)e.removeModel(r,"")}addFeature(e,r,y){const U=this.layers[0],R=U.layout.get("model-id").evaluate(y,{},this.canonical);if(!R)return zi(`modelId is not evaluated for layer ${U.id} and it is not going to get rendered.`),R;G_(R,!1)&&(this.modelUris.includes(R)||this.modelUris.push(R)),this.instancesPerModel[R]||(this.instancesPerModel[R]=new $_);const j=this.instancesPerModel[R],X=j.instancedDataArray,Q=new q_(y,X.length);for(const se of r)for(const W of se){if(W.x<0||W.x>=gi||W.y<0||W.y>=gi)continue;const ee=(this.lookupDim-1)/gi,ne=this.lookupDim*(W.y*ee|0)+W.x*ee|0;if(this.lookup){if(this.lookup[ne]!==0)continue;this.lookup[ne]=1}this.instanceCount++;const K=X.length;X.resize(K+1),j.instancesEvaluatedElevation.push(0),X.float32[16*K]=W.x,X.float32[16*K+1]=W.y}return Q.instancedDataCount=j.instancedDataArray.length-Q.instancedDataOffset,Q.instancedDataCount>0&&(e.id&&(j.idToFeaturesIndex[e.id]=j.features.length),j.features.push(Q
273),this.evaluate(Q,{},j,!1)),R}getModelUris(){return this.modelUris}evaluate(e,r,y,U){const R=this.layers[0],j=e.feature,X=this.canonical,Q=e.rotation=R.paint.get("model-rotation").evaluate(j,r,X),se=e.scale=R.paint.get("model-scale").evaluate(j,r,X),W=e.translation=R.paint.get("model-translation").evaluate(j,r,X),ee=R.paint.get("model-color").evaluate(j,r,X);ee.a=R.paint.get("model-color-mix-intensity").evaluate(j,r,X);const ne=[];this.maxVerticalOffset<W[2]&&(this.maxVerticalOffset=W[2]),this.maxScale=Math.max(Math.max(this.maxScale,se[0]),Math.max(se[1],se[2])),V_(ne,Q,se);const K=Math.round(100*ee.a)+ee.b/1.05;for(let te=0;te<e.instancedDataCount;++te){const ae=e.instancedDataOffset+te,ue=16*ae,de=y.instancedDataArray.float32;let xe=0;U&&(xe=de[ue+6]-y.instancesEvaluatedElevation[ae]);const we=0|de[ue+1];de[ue]=(0|de[ue])+ee.r/1.05,de[ue+1]=we+ee.g/1.05,de[ue+2]=K,de[ue+3]=1/(X.z>10?this.tileToMeter:t(X,we)),de[ue+4]=W[0],de[ue+5]=W[1],de[ue+6]=W[2]+xe,de[ue+7]=ne[0],de[ue+8]=ne[1],de[ue+9]=ne[2],de[ue+10]=ne[4],de[ue+11]=ne[5],de[ue+12]=ne[6],de[ue+13]=ne[8],de[ue+14]=ne[9],de[ue+15]=ne[10],y.instancesEvaluatedElevation[ae]=W[2]}}}let H_,W_;Ti(im,"ModelBucket",{omit:["layers"]}),Ti($_,"PerModelAttributes"),Ti(q_,"ModelFeature");const Nl=64,$c={CoordinateSpaceTile:1,CoordinateSpaceYUp:2,HasMapbox
273MeshFeatures:4,HasMeshoptCompression:8};function Z_(h,e,r,y,U,R,j,X,Q,se=!1){const W=r.zoom,ee=r.project(y),ne=Lo(y.lat,W),K=1/ne;pt.mat4.identity(h),pt.mat4.translate(h,h,[ee.x+j[0]*K,ee.y+j[1]*K,j[2]]);let te=1,ae=1;const ue=r.worldSize;if(se){if(r.projection.name==="mercator"){let me=0;r.elevation&&(me=r.elevation.getAtPointOrZero(new l(ee.x/ue,ee.y/ue),0));const Me=pt.vec4.transformMat4([],[ee.x,ee.y,me,1],r.projMatrix)[3]/r.cameraToCenterDistance;te=Me,ae=Me*Lo(r.center.lat,W)}else if(r.projection.name==="globe"){const me=tm(h,r),Me=pt.mat4.multiply([],r.projMatrix,me),ke=[0,0,0,1];pt.vec4.transformMat4(ke,ke,Me);const Be=ke[3]/r.cameraToCenterDistance,He=hs(W),$e=r.projection.pixelsPerMeter(y.lat,ue)*Lo(y.lat,W),qe=r.projection.pixelsPerMeter(r.center.lat,ue)*Lo(r.center.lat,W);te=Be/Bi($e,gu(r.center.lat),He),ae=Be*ne/$e,te*=qe,ae*=qe}}else te=K;pt.mat4.scale(h,h,[te,te,ae]);const de=[...h],xe=e.orientation,we=[];if(V_(we,[xe[0]+U[0],xe[1]+U[1],xe[2]+U[2]],R),pt.mat4.multiply(h,de,we),X&&r.elevation){let me=0;const Me=[];if(Q&&r.elevation){me=function(He,$e,qe,st,We){const ct=$e.elevation;if(!ct)return 0;const ft=Pi.projectAabbCorners(qe,st),dt=ns(1,We.lat)*$e.worldSize,_t=function(Ai,vi){const wi=[0,0,1],ji=[{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 Ji of ji){const Ki=Ai[Ji.corners[0]],Qi=Ai[Ji.corners[1]],nr=Ai[Ji.corners[2]],sr=[Qi[0]-Ki[0],Qi[1]-Ki[1],vi*(Qi[2]-Ki[2])],Br=pt.vec3.cross(sr,sr,[nr[0]-Ki[0],nr[1]-Ki[1],vi*(nr[2]-Ki[2])]);pt.vec3.normalize(Br,Br),Ji.dotProductWithUp=pt.vec3.dot(Br,wi)}return ji.sort((Ji,Ki)=>Ji.dotProductWithUp-Ki.dotProductWithUp),ji[0].corners}(ft,dt),Tt=ft[_t[0]],Ct=ft[_t[1]],vt=ft[_t[2]],qt=ft[_t[3]],ei=ct.getAtPointOrZero(new l(Tt[0]/$e.worldSize,Tt[1]/$e.worldSize),0),Gt=ct.getAtPointOrZero(new l(Ct[0]/$e.worldSize,Ct[1]/$e.worldSize),0),yi=ct.getAtPointOrZero(new l(vt[0]/$e.worldSize,vt[1]/$e.worldSize),0),mi=ct.getAtPointOrZero(new l(qt[0]/$e.worldSize,qt[1]/$e.worldSize),0),ni=(ei+mi)/2,ti=(Gt+yi)/2;return ni>ti?Gt<yi?vp(He,Ct,qt,Tt,Gt,mi,ei,dt):vp(He,vt,Tt,qt,yi,ei,mi,dt):ei<mi?vp(He,Tt,Ct,vt,ei,Gt,yi,dt):vp(He,qt,vt,Ct,mi,yi,Gt,dt),Math.max(ni,ti
273)}(Me,r,e.aabb,h,y);const ke=pt.mat4.fromQuat([],Me),Be=pt.mat4.multiply([],ke,we);pt.mat4.multiply(h,de,Be)}else me=r.elevation.getAtPointOrZero(new l(ee.x/ue,ee.y/ue),0);me!==0&&(h[14]+=me)}}function Bu(h,e,r=!1){h.uploaded||(h.gfxTexture=new Kf(e,h.image,r?e.gl.R8:e.gl.RGBA8,{useMipmap:h.sampler.minFilter>=e.gl.NEAREST_MIPMAP_NEAREST}),h.uploaded=!0,h.image=null)}function Fv(h,e,r){h.indexBuffer=e.createIndexBuffer(h.indexArray,!1,!0),h.vertexBuffer=e.createVertexBuffer(h.vertexArray,Cv.members,!1,!0),h.normalArray&&(h.normalBuffer=e.createVertexBuffer(h.normalArray,Rv.members,!1,!0)),h.texcoordArray&&(h.texcoordBuffer=e.createVertexBuffer(h.texcoordArray,kv.members,!1,!0)),h.colorArray&&(h.colorBuffer=e.createVertexBuffer(h.colorArray,(h.colorArray.bytesPerElement===12?Iv:Dv).members,!1,!0)),h.featureArray&&(h.pbrBuffer=e.createVertexBuffer(h.featureArray,Lv.members,!0)),h.segments=an.simpleSegment(0,0,h.vertexArray.length,h.indexArray.length);const y=h.material;y.pbrMetallicRoughness.baseColorTexture&&Bu(y.pbrMetallicRoughness.baseColorTexture,e),y.pbrMetallicRoughness.metallicRoughnessTexture&&Bu(y.pbrMetallicRoughness.metallicRoughnessTexture,e),y.normalTexture&&Bu(y.normalTexture,e),y.occlusionTexture&&Bu(y.occlusionTexture,e,r),y.emissionTexture&&Bu(y.emissionTexture,e)}function rm(h,e,r){if(h.meshes)for(const y of h.meshes)Fv(y,e,r);if(h.children)for(const y of h.children)rm(y,e,r)}function bp(h){if(h.meshes)for(const e of h.meshes)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();if(h.children)for(const e of h.children)bp(e)}function nm(h){if(h.meshes)for(const r of h.meshes)r.vertexBuffer&&(r.vertexBuffer.destroy(),r.indexBuffer.destroy(),r.normalBuffer&&r.n
vendor: 2,016 bytes, line 273
273ormalBuffer.destroy(),r.texcoordBuffer&&r.texcoordBuffer.destroy(),r.colorBuffer&&r.colorBuffer.destroy(),r.pbrBuffer&&r.pbrBuffer.destroy(),r.segments.destroy(),r.material&&((e=r.material).pbrMetallicRoughness.baseColorTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),e.pbrMetallicRoughness.metallicRoughnessTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),e.normalTexture&&e.normalTexture.gfxTexture&&e.normalTexture.gfxTexture.destroy(),e.emissionTexture&&e.emissionTexture.gfxTexture&&e.emissionTexture.gfxTexture.destroy(),e.occlusionTexture&&e.occlusionTexture.gfxTexture&&e.occlusionTexture.gfxTexture.destroy()));var e;if(h.children)for(const r of h.children)nm(r)}class Hc{constructor(e,r,y){this._demTile=e,this._dem=this._demTile.dem,this._scale=r,this._offset=y}static create(e,r,y){const U=y||e.findDEMTileFor(r);if(!U||!U.dem)return;const R=U.dem,j=U.tileID,X=1<<r.canonical.z-j.canonical.z;return new Hc(U,R.dim/gi/X,[(r.canonical.x/X-j.canonical.x)*R.dim,(r.canonical.y/X-j.canonical.y)*R.dim])}tileCoordToPixel(e,r){const y=r*this._scale+this._offset[1],U=Math.floor(e*this._scale+this._offset[0]),R=Math.floor(y);return new Ht(U,R)}getElevationAt(e,r,y,U){const R=e*this._scale+this._offset[0],j=r*this._scale+this._offset[1],X=Math.floor(R),Q=Math.floor(j),se=this._dem;return U=!!U,y?Bi(Bi(se.get(X,Q,U),se.get(X,Q+1,U),j-Q),Bi(se.get(X+1,Q,U),se.get(X+1,Q+1,U),j-Q),R-X):se.get(X,Q,U)}getElevationAtPixel(e,r,y){return this._dem.get(e,r,!!y)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*ns(1,e)*this._dem.stride}}const sm=new Float32Array(262144),Vl=new Uint8Array(262144);function X_(h){let e=0;if(h.meshes)for(const r of h.meshes)e=Math.max(e,r.aabb.max[2]);if(h.children)for(const r of h.children)e=Math.max(e,X_(r));return e}function Y_(h,e,r){if(h.meshes)for(const y of h.meshes){if(y.aabb.min[0]===1/0)continue;
273const U=Pi.applyTransform(y.aabb,h.matrix);r.insert(e,U.min[0],U.min[1],U.max[0],U.max[1])}if(h.children)for(const y of h.children)Y_(y,e,r)}const J_=["","wall","door","roof","window","lamp","logo"];class K_{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.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.cameraCollisionOpacity=1,this.feature={type:"Point",id:e.id,geometry:[],properties:{height:X_(e)}},this.aabb=this._getLocalBounds(),this.state=null}_getLocalBounds(){if(!this.node.meshes)return new Pi([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let e=0;const r=new Pi([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const y of this.node.meshes)this.node.lightMeshIndex!==e&&(y.transformedAabb=Pi.applyTransformFast(y.aabb,this.node.matrix),r.encapsulate(y.transformedAabb)),e++;this.aabb=r}return this.aabb}}class wp{constructor(e,r,y,U,R,j,X){this.id=y,this.layers=e,this.layerIds=this.layers.map(Q=>Q.fqid),this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id),this.modelTraits|=$c.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,U&&(this.modelTraits|=$c.HasMapboxMeshFeatures),R&&(this.modelTraits|=$c.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=j,this.dirty=!0,this.needsUpload=!1,this.nodesInfo=[];for(const Q of r)this.nodesInfo.push(new K_(Q)),Y_(Q,X.featureIndexArray.length,X.grid),X.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,X.bucketLayerIDs.length-1,0);this.states={}}updateFootprints(e,r){for(const y of this.getNodesInfo()){const U=y.node;U.footprint&&r.push({footprint:U.footprint,id:e})}}update(e){const r=Object.keys(e).length!==0;if(r&&!this.stateDependentLayers.length)return;const y=r?this.stateDependentLayers:this.layers;if(!on(e,this.states))for(const U of y)this.evaluate(U,e);this.states=structuredClone(e)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(e){if(!this.needsUpload)return;const r=this.getNodesInfo();for(const y of r){const U=y.node;this.uploaded?this.updatePbrBuffer(U):rm(U,e,!0)}for(const y of r)bp(y.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(e){let r=!1;if(!e.meshes)return r;for(const y of e.meshes)y.pbrBuffer&&(y.pbrBuffer.updateData(y.featureArray),r=!0);return r}needsReEvaluation(e,r,y){const U=e.transform.projectionOptions,R=e.style.getBrightness(),j=this.brightness!==R;if(!this.uploaded||this.dirty||U.name!==this.projection.name||Nu(y.paint.get("model-color").value,j)||Nu(y.paint.get("model-color-mix-intensity").value,j)||Nu(y.paint.get("model-roughness").value,j)||Nu(y.paint.get("model-emissive-strength").value,j)||Nu(y.paint.get("model-height-based-emissive-strength-multiplier").value,j)){this.projection=U,this.brightness=R;const X=this.getNodesInfo();for(const Q of X)Q.state=null;return!0}return!1}evaluateScale(e,r){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;const y=this.getNodesInfo(),U=this.id.canonical;for(const R of y){const j=R.feature;R.evaluatedScale=r.paint.get("model-scale").evaluate(j,{},U)}}evaluate(e,r){const y=this.getNodesInfo();for(const U of y){if(!U.node.meshes)continue;const R=U.feature,j=r&&r[R.id];if(on(j,U.state))continue;U.state=structuredClone(j);const X=U.node.meshes&&U.node.meshes[0].featureData,Q=U.evaluatedColor[2],se=U.evaluatedRMEA[2],W=this.id.canonical;if(U.hasTranslucentParts=!1,X){for(let ee=0;ee<J_.length;ee++){const ne=J_[ee];ne.length&&(R.properties.part=ne);const K=e.paint.get("model-color").evaluate(R,j,W).toRenderColor(null),te=e.paint.get("model-color-mix-intensity").evaluate(R,j,W);U.evaluatedColor[ee]=[K.r,K.g,K.b,te],U.evaluatedRMEA[ee][0]=e.paint.get("model-roughness").evaluate(R,j,W),U.evaluatedRMEA[ee][2]=e.paint.get("model-emissive-strength").evaluate(R,j,W),U.evaluatedRMEA[ee][3]=K.a,U.emissionHeightBasedParams[ee]=e.paint.get("model-height-based-emissive-strength-multiplier").evaluate(R,j,W),!U.hasTranslucentParts&&K.a<1&&(U.hasTranslucentParts=!0)}delete R.properties.part,Bv(U,Q!==U.evaluatedColor[2]||se!==U.evaluatedRMEA[2],this.modelTraits)}else U.evaluatedRMEA[0][2]=e.paint.get("model-emissive-strength").evaluate(R,j,W);U.evaluatedScale=e.paint.get("model-scale").evaluate(R,j,W),this.updatePbrBuffer(U.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(e,r,y,U){const R=e.findDEMTileFor(y);if(R&&(R.tileID.canonical!==this.terrainTile||r!==this.terrainExaggeration)){if
vendor: 3,589 bytes, line 273
273(R.dem&&R.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=R.tileID.overscaledZ;const j=Hc.create(e,y,R);if(!j)return;this.modelTraits&$c.HasMapboxMeshFeatures&&this.updateDEM(e,j,y,U);for(const X of this.getNodesInfo()){const Q=X.node;if(!Q.footprint||!Q.footprint.vertices||!Q.footprint.vertices.length)continue;const se=Q.footprint.vertices;let W=j.getElevationAt(se[0].x,se[0].y,!0,!0);for(let ee=1;ee<se.length;ee++)W=Math.min(W,j.getElevationAt(se[ee].x,se[ee].y,!0,!0));Q.elevation=W}}this.terrainTile=R.tileID.canonical,this.terrainExaggeration=r}}updateDEM(e,r,y,U){let R=r._dem._modifiedForSources[U];if(R===void 0&&(r._dem._modifiedForSources[U]=[],R=r._dem._modifiedForSources[U]),R.includes(y.canonical))return;const j=r._dem.dim;R.push(y.canonical);let X=!1;for(const Q of this.getNodesInfo()){const se=Q.node;if(!se.footprint||!se.footprint.grid)continue;const W=se.footprint.grid,ee=r.tileCoordToPixel(W.min.x,W.min.y),ne=r.tileCoordToPixel(W.max.x,W.max.y),K=Math.min(Math.min(j-ne.y,ee.x),Math.min(ee.y,j-ne.x));if(K<0)continue;const te=Ue(K,2,5);let ae=Math.max(0,ee.x-te),ue=Math.max(0,ee.y-te),de=Math.min(ne.x+te,j-1),xe=Math.min(ne.y+te,j-1);for(let ke=ue;ke<=xe;++ke)for(let Be=ae;Be<=de;++Be)Vl[ke*j+Be]=255;let we=0,me=0;for(let ke=0;ke<W.cellsY;++ke)for(let Be=0;Be<W.cellsX;++Be){if(!W.cells[ke*W.cellsX+Be])continue;const He=r.tileCoordToPixel(W.min.x+Be/W.xScale,W.min.y+ke/W.yScale),$e=r.tileCoordToPixel(W.min.x+(Be+1)/W.xScale,W.min.y+(ke+1)/W.yScale);for(let qe=He.y;qe<=Math.min($e.y+1,j-1);++qe)for(let st=He.x;st<=Math.min($e.x+1,j-1);++st)Vl[qe*j+st]===255&&(Vl[qe*j+st]=0,we+=r.getElevationAtPixel(st,qe),me++)}const Me=we/me;ae=Math.max(1,ee.x-te),ue=Math.max(1,ee.y-te),de=Math.min(ne.x+te,j-2),xe=Math.min(ne.y+te,j-2),X=!0;for(let ke=ue;ke<=xe;++ke)for(let Be=ae;Be<=de;++Be)Vl[ke*j+Be]===0&&(sm[ke*j+Be]=r._dem.set(Be,ke,Me));for(let ke=1;ke<te;++ke){ae=Math.max(1,ee.x-ke),ue=Math.max(1,ee.y-ke),de=Math.min(ne.x+ke,j-2),xe=Math.min(ne.y+ke,j-2);for(let Be=ue;Be<=xe;++Be)for(let He=ae;He<=de;++He){const $e=Be*j+He;if(Vl[$e]===255){let qe=0,st=0,We=-1,ct=-1;for(let ft=-1;ft<=1;++ft)for(let dt=-1;dt<=1;++dt){const _t=(Be+ft)*j+He+dt;if(Vl[_t]>=ke)continue;const Tt=sm[_t],Ct=Math.abs(Tt);Ct>st&&(qe=Tt,st=Ct,We=dt,ct=ft)}if(st>.1){const ft=1-(ke+.5*Math.abs(We*ct))/te;let dt=r._dem.get(He,Be)+qe*ft;const _t=r._dem.get(He+We,Be+ct),Tt=r._dem.get(He-We,Be-ct,!0);(dt-_t)*(dt-Tt)>0&&(dt=(_t+Tt)/2),sm[$e]=r._dem.set(He,Be,dt),Vl[$e]=ke}}}}}X&&(r._demTile.needsDEMTextureUpload=!0,r._dem._timestamp=tt.now())}getNodesInfo(){return this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const r of e)bp(r.node),nm(r.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,r){if(r.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=r.updateTime;const y=r.getReplacementRegionsForTile(e.toUnwrapped()),U=this.getNodesInfo();for(let R=0;R<this.nodesInfo.length;R++){const j=U[R].node;U[R].hiddenByReplacement=!!j.footprint&&!y.find(X=>X.footprint===j.footprint)}}getHeightAtTileCoord(e,r){const y=this.getNodesInfo(),U=[],R=[0,0,0],j=pt.mat4.identity([]);for(let X=0;X<this.nodesInfo.length;X++){const Q=y[X],se=Q.node.meshes[0],W=se.transformedAabb;if(e<W.min[0]||r<W.min[1]||e>W.max[0]||r>W.max[1])continue;if(Q.node.hidden===!0)return{height:1/0,maxHeight:Q.feature.properties.height,hidden:!1,verticalScale:Q.evaluatedScale[2]};pt.mat4.invert(j,Q.node.matrix),R[0]=e,R[1]=r,pt.vec3.transformMat4(R,R,j);const ee=(R[0]-se.aabb.min[0])/(se.aabb.max[0]-se.aabb.min[0])*Nl|0,ne=Math.min(63,(R[
2731]-se.aabb.min[1])/(se.aabb.max[1]-se.aabb.min[1])*Nl|0)*Nl+Math.min(63,ee),K=se.heightmap[ne];if(!(K<0&&Q.node.footprint))return Q.hiddenByReplacement?void 0:{height:K,maxHeight:Q.feature.properties.height,hidden:!1,verticalScale:Q.evaluatedScale[2]};if(Q.node.footprint.grid.query(new Ht(e,r),new Ht(e,r),U),U.length>0)return{height:void 0,maxHeight:Q.feature.properties.height,hidden:Q.hiddenByReplacement,verticalScale:Q.evaluatedScale[2]}}}}function Nu(h,e){return!h.isLightConstant&&e}function Ov(h,e,r,y,U,R,j,X){let Q=(61440&e|(61440&e)>>4)>>8,se=(3840&e|(3840&e)>>4)>>4,W=240&e|(240&e)>>4;r[3]>0&&(Q=Bi(Q,255*r[0],r[3]),se=Bi(se,255*r[1],r[3]),W=Bi(W,255*r[2],r[3]));const ee=Q<<8|se,ne=W<<8|Math.floor(255*y[3]),K=function(ke){const Be=Ue(ke,0,2);return Math.min(Math.round(.5*Be*255),255)}(y[2])<<8|15*y[0]<<4|15*y[1],te=Ue(U[0],0,1),ae=Ue(U[1],0,1),ue=Ue(U[2],0,1),de=Ue(U[3],0,1);let xe,we,me,Me;if(te!==ae&&j!==R&&ae!==te){const ke=j-R;we=1/(ke*(ae-te)),me=-(R+ke*te)/(ke*(ae-te));const Be=Ue(U[4],-1,1);Me=Math.pow(10,Be),xe=255*ue<<8|255*de}else xe=65535,we=0,me=1,Me=1;if(h.emplaceBack(ee,ne,K,xe,we,me,Me),X){const ke=X.length;X.clear();for(let Be=0;Be<ke;Be++)X.emplaceBack(ee,ne,K,xe,we,me,Me)}}function Bv(h,e,r){const y=h.node;let U=0;const R=r&$c.HasMeshoptCompression;for(const j of y.meshes){if(y.lights&&y.lightMeshIndex===U||!j.featureData)continue;j.featureArray=new Al,j.featureArray.reserve(j.featureData.length);let X=e;for(const Q of j.featureData){const se=R?65535&Q:Q>>16&65535,W=R?Q>>16&65535:65535&Q,ee=(15&W)<8?15&W:0,ne=h.evaluatedRMEA[ee],K=h.evaluatedColor[ee],te=h.emissionHeightBasedParams[ee];let ae;if(X&&ee===2&&y.lights&&(ae=new Al,ae.resize(10*y.lights.length)),Ov(j.featureArray,se,K,ne,te,j.aabb.min[2],j.aabb.max[2],ae),ae&&X){X=!1;const ue=y.meshes[y.lightMeshIndex];ue.featureArray=ae,ue.featureArray._trim()}}j.featureArray._trim(),U++}}function Q_(h,e,r,y){const U=1<<h.z;e.lat=Bn((y/gi+h.y)/U),e.lng=fs((r/gi+h.x)/U)}Ti(wp,"Tiled3dModelBucket",{omit:["layers"]}),Ti(K_,"Tiled3dModelFeature");const Nv={circle:class extends kn{constructor(h,e,r,y){super(h,{layout:ii||(ii=new Wr({"circle-sort-key":new bi(Rt.layout_circle["circle-sort-key"]),"circle-elevation-reference":new oi(Rt.layout_circle["circle-elevation-reference"]),visibility:new oi(Rt.layout_circle.visibility)})),paint:Et||(Et=new Wr({"circle-radius":new bi(Rt.paint_circle["circle-radius"]),"circle-color":new bi(Rt.paint_circle["circle-color"]),"circle-blur":new bi(Rt.paint_circle["circle-blur"]),"circle-opacity":new bi(Rt.paint_circle["circle-opacity"]),"circle-translate":new oi(Rt.paint_circle["circle-translate"]),"circle-translate-anchor":new oi(Rt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new oi(Rt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new oi(Rt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new bi(Rt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new bi(Rt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new bi(Rt.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new oi(Rt.paint_circle["circle-emissive-strength"]),"circle-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"circle-stroke-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},e,r,y)}createBucket(h){return new ze(h)}queryRadius(h){const e=h;return Wt("circle-radius",this,e)+Wt("circle-stroke-width",this,e)+$t(this.paint.get("circle-translate"))}queryIntersectsFeature(h,e,r,y,U,R,j,X){const Q=Vt(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),R.angle,h.pixelToTileUnitsFactor),se=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r);return Oc(h,y,R,j,X,this.paint.get("circle-pitch-alignment")==="map",this.paint.get("circle-pitch-scale")==="map",Q,se)}getProgramIds(){return["circle"]}getDefaultProgramParams(h,e,r){const y=Fo(this);return{config:new no(this,{zoom:e,lut:r}),defines:y,overrideFog:!1}}},heatmap:class extends kn{createBucket(h){return new km(h)}constructor(h,e,r,y){super(h,{layout:Rm||(Rm=new Wr({visibility:new oi(Rt.layout_heatmap.visibility)})),paint:zm||(zm=new Wr({"heatmap-radius":new bi(Rt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new bi(Rt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new oi(Rt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Mo(Rt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new oi(Rt.paint_heatmap["heatmap-opacity"]),"heatmap-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},e,r,y),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(h){h==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=yu({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(h){return Wt("heatmap-radius",this,h)}queryIntersectsFeature(h,e,r,y,U,R,j,X){const Q=this.paint.get("heatmap-radius").evaluate(e,r);return Oc(h,y,R,j,X,!0,!0,new Ht(0,0),Q)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(h,e,r){return h==="heatmap"?{config:new no(this,{zoom:e,lut:r}),overrideFog:!1}:{}}},hillshade:class extends kn{constructor(h,e,r,y){super(h,{layout:Lm||(Lm=new Wr({visibility:new oi(Rt.layout_hillshade.visibility)})),paint:Fm||(Fm=new Wr({"hillshade-illumination-direction":new oi(Rt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new oi(Rt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new oi(Rt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new oi(Rt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new oi(Rt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new oi(Rt.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new oi(Rt.paint_hillshade["hillshade-emissive-strength"]),"hillshade-shadow-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"hillshade-highlight-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"hillshade-accent-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},e,r,y)}shouldRedrape(){return this.hasOffscreenPass()&&this.paint.get("hillshade-illumination-anchor")==="viewport"}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(h,e,r){return{overrideFog:!1}}},fill:class extends kn{constructor(h,e,r,y){super(h,{layout:$m||($m=new Wr({"fill-sort-key":new bi(Rt.layout_fill["fill-sort-key"]),visibility:new oi(Rt.layout_fill.visibility),"fill-elevation-reference":new oi(Rt.layout_fill["fill-elevation-reference"])})),paint:Hm||(Hm=new Wr({"fill-antialias":new oi(Rt.paint_fill["fill-antialias"]),"fill-opacity":new bi(Rt.paint_fill["fill-opacity"]),"fill-color":new bi(Rt.paint_fill["fill-color"]),"fill-outline-color":new bi(Rt.paint_fill["fill-outline-color"]),"fill-translate":new oi(Rt.paint_fill["fill-translate"]),"fill-translate-anchor":new oi(Rt.paint_fill["fill-translate-anchor"]),"fill-pattern":new bi(Rt.paint_fill["fill-pattern"]),"fill-emissive-strength":new oi(Rt.paint_fill["fill-emissive-strength"]),"fill-z-offset":new bi(Rt.paint_fill["fill-z-offset"]),"fill-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"fill-outline-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},e,r,y)}getProgramIds(){const h=this.paint.get("fill-pattern"),e=h&&h.constantOr(1),r=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&r.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),r}getDefaultProgramParams(h,e,r){return{config:new no(this,{zoom:e,lut:r}),overrideFog:!1}}recalculate(h,e){super.recalculate(h,e);const r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(h){return new bf(h)}queryRadius(){return $t(this.paint.get("fill-translate"))}queryIntersectsFeature(h,e,r,y,U,R){return!h.queryGeometry.isAboveHorizon&&Fe(At(h.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),R.angle,h.pixelToTileUnitsFactor),y)}isTileClipped(){return!0}is3D(){return this.paint.get("fill-z-offset").constantOr(1)!==0}},"fill-extrusion":class extends kn{constructor(h,e,r,y){super(h,{layout:Mg||(Mg=ne
vendor: 5,654 bytes, line 273
273w Wr({visibility:new oi(Rt["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new oi(Rt["layout_fill-extrusion"]["fill-extrusion-edge-radius"])})),paint:Pg||(Pg=new Wr({"fill-extrusion-opacity":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new bi(Rt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new bi(Rt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new bi(Rt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new bi(Rt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-height-alignment":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),"fill-extrusion-base-alignment":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-base-alignment"]),"fill-extrusion-vertical-gradient":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new bi(Rt["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new bi(Rt["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new bi(Rt["paint_fill-extrusion"]["fill-extrusion-emissive-strength"]),"fill-extrusion-line-width":new bi(Rt["paint_fill-extrusion"]["fill-extrusion-line-width"]),"fill-extrusion-cast-shadows":new oi(Rt["paint_fill-extrusion"]["fill-extrusion-cast-shadows"]),"fill-extrusion-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"fill-extrusion-flood-light-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},e,r,y),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(h){return new Kd(h)}queryRadius(){return $t(this.paint.get("fill-extrusion-translate"))}is3D(){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(h,e,r,y,U,R,j,X,Q){const se=Vt(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),R.angle,h.pixelToTileUnitsFactor),W=this.paint.get("fill-extrusion-height").evaluate(e,r),ee=this.paint.get("fill-extrusion-base").evaluate(e,r),ne=[0,0],K=X&&R.elevation,te=R.elevation?R.elevation.exaggeration():1,ae=h.tile.getBucket(this);if(K&&ae instanceof Kd){const me=ae.centroidVertexArray,Me=Q+1;Me<me.length&&(ne[0]=me.geta_centroid_pos0(Me),ne[1]=me.geta_centroid_pos1(Me))}if(ne[0]===0&&ne[1]===1)return!1;R.projection.name==="globe"&&(y=Ag([y],[new Ht(0,0),new Ht(gi,gi)],h.tileID.canonical).map(me=>me.polygon).flat());const ue=K?X:null,[de,xe]=function(me,Me,ke,Be,He,$e,qe,st,We,ct,ft){return me.projection.name==="globe"?function(dt,_t,Tt,Ct,vt,qt,ei,Gt,yi,mi,ni){const ti=[],Ai=[],vi=dt.projection.upVectorScale(ni,dt.center.lat,dt.worldSize).metersToTile,wi=[0,0,0,1],ji=[0,0,0,1],Ji=(Qi,nr,sr,Br)=>{Qi[0]=nr,Qi[1]=sr,Qi[2]=Br,Qi[3]=1},Ki=Eg();Tt>0&&(Tt+=Ki),Ct+=Ki;for(const Qi of _t){const nr=[],sr=[];for(const Br of Qi){const Dr=Br.x+vt.x,Wi=Br.y+vt.y,Mr=dt.projection.projectTilePoint(Dr,Wi,ni),Ir=dt.projection.upVector(ni,Br.x,Br.y);let $r=Tt,un=Ct;if(ei){const Sn=Ig(Dr,Wi,Tt,Ct,ei,Gt,yi,mi);$r+=Sn.base,un+=Sn.top}Tt!==0?Ji(wi,Mr.x+Ir[0]*vi*$r,Mr.y+Ir[1]*vi*$r,Mr.z+Ir[2]*vi*$r):Ji(wi,Mr.x,Mr.y,Mr.z),Ji(ji,Mr.x+Ir[0]*vi*un,Mr.y+Ir[1]*vi*un,Mr.z+Ir[2]*vi*un),pt.vec3.transformMat4(wi,wi,qt),pt.vec3.transformMat4(ji,ji,qt),nr.push(new Ol(wi[0],wi[1],wi[2])),sr.push(new Ol(ji[0],ji[1],ji[2]))}ti.push(nr),Ai.push(sr)}return[ti,Ai]}(me,Me,ke,Be,He,$e,qe,st,We,ct,ft):qe?function(dt,_t,Tt,Ct,vt,qt,ei,Gt,yi){const mi=[],ni=[],ti=[0,0,0,1];for(const Ai of dt){const vi=[],wi=[];for(const ji of Ai){const Ji=ji.x+Ct.x,Ki=ji.y+Ct.y,Qi=Ig(Ji,Ki,_t,Tt,qt,ei,Gt,yi);ti[0]=Ji,ti[1]=Ki,ti[2]=Qi.base,ti[3]=1,pt.vec4.transformMat4(ti,ti,vt),ti[3]=Math.max(ti[3],1e-5);const nr=new Ol(ti[0]/ti[3],ti[1]/ti[3],ti[2]/ti[3]);
vendor: 1,978 bytes, line 273
273ti[0]=Ji,ti[1]=Ki,ti[2]=Qi.top,ti[3]=1,pt.vec4.transformMat4(ti,ti,vt),ti[3]=Math.max(ti[3],1e-5);const sr=new Ol(ti[0]/ti[3],ti[1]/ti[3],ti[2]/ti[3]);vi.push(nr),wi.push(sr)}mi.push(vi),ni.push(wi)}return[mi,ni]}(Me,ke,Be,He,$e,qe,st,We,ct):function(dt,_t,Tt,Ct,vt){const qt=[],ei=[],Gt=vt[8]*_t,yi=vt[9]*_t,mi=vt[10]*_t,ni=vt[11]*_t,ti=vt[8]*Tt,Ai=vt[9]*Tt,vi=vt[10]*Tt,wi=vt[11]*Tt;for(const ji of dt){const Ji=[],Ki=[];for(const Qi of ji){const nr=Qi.x+Ct.x,sr=Qi.y+Ct.y,Br=vt[0]*nr+vt[4]*sr+vt[12],Dr=vt[1]*nr+vt[5]*sr+vt[13],Wi=vt[2]*nr+vt[6]*sr+vt[14],Mr=vt[3]*nr+vt[7]*sr+vt[15],Ir=Br+Gt,$r=Dr+yi,un=Wi+mi,Sn=Math.max(Mr+ni,1e-5),dn=Br+ti,Qr=Dr+Ai,yn=Wi+vi,En=Math.max(Mr+wi,1e-5);Ji.push(new Ol(Ir/Sn,$r/Sn,un/Sn)),Ki.push(new Ol(dn/En,Qr/En,yn/En))}qt.push(Ji),ei.push(Ki)}return[qt,ei]}(Me,ke,Be,He,$e)}(R,y,ee,W,se,j,ue,ne,te,R.center.lat,h.tileID.canonical),we=h.queryGeometry;return function(me,Me,ke){let Be=1/0;Fe(ke,Me)&&(Be=Cg(ke,Me[0]));for(let He=0;He<Me.length;He++){const $e=Me[He],qe=me[He];for(let st=0;st<$e.length-1;st++){const We=$e[st],ct=[We,$e[st+1],qe[st+1],qe[st],We];De(ke,ct)&&(Be=Math.min(Be,Cg(ke,ct)))}}return Be!==1/0&&Be}(de,xe,we.isPointQuery()?we.screenBounds:we.screenGeometry)}},line:class extends kn{constructor(h,e,r,y){const U=Vg();super(h,U,e,r,y),U.layout&&(this.layout=new Ao(U.layout)),this.gradientVersion=0,this.hasElevatedBuckets=!1,this.hasNonElevatedBuckets=!1}_handleSpecialPaintPropertyUpdate(h){if(h==="line-gradient"){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof go,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(h,e){super.recalculate(h,e),this.paint._values["line-floorwidth"]=(()=>
vendor: 8,586 bytes, line 273
273{if(Mu)return Mu;const r=Vg();return Mu=new U0(r.paint.properties["line-width"].specification),Mu.useIntegerZoom=!0,Mu})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,h)}createBucket(h){return new Df(h)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(h,e,r){const y=Bg(this);return{config:new no(this,{zoom:e,lut:r}),defines:y,overrideFog:!1}}queryRadius(h){const e=h,r=Ug(Wt("line-width",this,e),Wt("line-gap-width",this,e)),y=Wt("line-offset",this,e);return r/2+Math.abs(y)+$t(this.paint.get("line-translate"))}queryIntersectsFeature(h,e,r,y,U,R){if(h.queryGeometry.isAboveHorizon)return!1;const j=At(h.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),R.angle,h.pixelToTileUnitsFactor),X=h.pixelToTileUnitsFactor/2*Ug(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),Q=this.paint.get("line-offset").evaluate(e,r);return Q&&(y=function(se,W){const ee=[],ne=new Ht(0,0);for(let K=0;K<se.length;K++){const te=se[K],ae=[];for(let ue=0;ue<te.length;ue++){const de=te[ue],xe=te[ue+1],we=ue===0?ne:de.sub(te[ue-1])._unit()._perp(),me=ue===te.length-1?ne:xe.sub(de)._unit()._perp(),Me=we._add(me)._unit();Me._mult(1/(Me.x*me.x+Me.y*me.y)),ae.push(Me._mult(W)._add(de))}ee.push(ae)}return ee}(y,Q*h.pixelToTileUnitsFactor)),function(se,W,ee){for(let ne=0;ne<W.length;ne++){const K=W[ne];if(se.length>=3){for(let te=0;te<K.length;te++)if(Ke(se,K[te]))return!0}if(Ge(se,K,ee))return!0}return!1}(j,y,X)}isTileClipped(){return!0}isDraped(h){return!this.hasElevatedBuckets}},symbol:fp,background:class extends kn{constructor(h,e,r,y){super(h,{layout:T_||(T_=new Wr({visibility:new oi(Rt.layout_background.visibility)})),paint:E_||(E_=new Wr({"background-pitch-alignment":new oi(Rt.paint_background["background-pitch-alignment"]),"background-color":new oi(Rt.paint_background["background-color"]),"background-pattern":new oi(Rt.paint_background["background-pattern"]),"background-opacity":new oi(Rt.paint_background["background-opacity"]),"background-emissive-strength":new oi(Rt.paint_background["background-emissive-strength"]),"background-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},e,r,y)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(h,e,r){return{overrideFog:!1}}is3D(){return this.paint.get("background-pitch-alignment")==="viewport"}},raster:I_,"raster-particle":F_,sky:class extends kn{constructor(h,e,r,y){super(h,{layout:R_||(R_=new Wr({visibility:new oi(Rt.layout_sky.visibility)})),paint:z_||(z_=new Wr({"sky-type":new oi(Rt.paint_sky["sky-type"]),"sky-atmosphere-sun":new oi(Rt.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new oi(Rt.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new oi(Rt.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new oi(Rt.paint_sky["sky-gradient-radius"]),"sky-gradient":new Mo(Rt.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new oi(Rt.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new oi(Rt.paint_sky["sky-atmosphere-color"]),"sky-opacity":new oi(Rt.paint_sky["sky-opacity"]),"sky-gradient-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-halo-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},e,r,y),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(h){h==="sky-gradient"?this._updateColorRamp():h!=="sky-atmosphere-sun"&&h!=="sky-atmosphere-halo-color"&&h!=="sky-atmosphere-color"&&h!=="sky-atmosphere-sun-intensity"||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=yu({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(h){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const e=h.style.light.properties.get("position");return this._lightPosition.azimuthal!==e.azimuthal||this._lightPosition.polar!==e.polar}return!1}getCenter(h,e){if(this.paint.get("sky-type")==="atmosphere"){const y=this.paint.get("sky-atmosphere-sun"),U=!y,R=h.style.light,j=R.properties.get("position");return U&&R.properties.get("anchor")==="viewport"&&zi("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),U?Qf(j.azimuthal,90-j.polar,e):Qf(y[0],90-y[1],e)}const r=this.paint.get("sky-gradient-center");return Qf(r[0],90-r[1],e)}isSky(){return!0}markSkyboxValid(h){this._skyboxInvalidated=!1,this._lightPosition=h.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const h=this.paint.get("sky-type");return h==="atmosphere"?["skyboxCapture","skybox"]:h==="gradient"?["skyboxGradient"]:null}},slot:class extends kn{constructor(h,e,r,y){super(h,{paint:L_||(L_=new Wr({}))},e,null)}},model:class extends kn{constructor(h,e,r,y){super(h,{layout:H_||(H_=new Wr({visibility:new oi(Rt.layout_model.visibility),"model-id":new bi(Rt.layout_model["model-id"])})),paint:W_||(W_=new Wr({"model-opacity":new bi(Rt.paint_model["model-opacity"]),"model-rotation":new bi(Rt.paint_model["model-rotation"]),"model-scale":new bi(Rt.paint_model["model-scale"]),"model-translation":new bi(Rt.paint_model["model-translation"]),"model-color":new bi(Rt.paint_model["model-color"]),"model-color-mix-intensity":new bi(Rt.paint_model["model-color-mix-intensity"]),"model-type":new oi(Rt.paint_model["model-type"]),"model-cast-shadows":new oi(Rt.paint_model["model-cast-shadows"]),"model-receive-shadows":new oi(Rt.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new oi(Rt.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new bi(Rt.paint_model["model-emissive-strength"]),"model-roughness":new bi(Rt.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new bi(Rt.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new oi(Rt.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new oi(Rt.paint_model["model-front-cutoff"]),"model-color-use-theme":new bi({type:"string",default:"default","property-type":"data-driven"})}))},e,r,y),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(h){return new im(h)}getProgramIds(){return["model"]}is3D(){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(h){return h instanceof wp?gi-1:0}queryIntersectsFeature(h,e,r,y,U,R){if(!this.modelManager)return!1;const j=this.modelManager,X=h.tile.getBucket(this);if(!(X&&X instanceof im))return!1;for(const Q in X.instancesPerModel){const se=X.instancesPerModel[Q],W=e.id!==void 0?e.id:e.properties&&e.properties.hasOwnProperty("id")?e.properties.id:void 0;if(se.idToFeaturesIndex.hasOwnProperty(W)){const ee=se.features[se.idToFeaturesIndex[W]],ne=j.getModel(Q,this.scope);if(!ne)return!1;let K=pt.mat4.create();const te=new _r(0,0),ae=X.canonical;let ue=Number.MAX_VALUE;for(let de=0;de<ee.instancedDataCount;++de){const xe=16*(ee.instancedDataOffset+de),we=se.instancedDataArray.float32,me=[we[xe+4],we[xe+5],we[xe+6]];Q_(ae,te,we[xe],0|we[xe+1]),Z_(K,ne,R,te,ee.rotation,ee.scale,me,!1,!1,!1),R.projection.name==="globe"&&(K=tm(K,R));const Me=pt.mat4.multiply([],R.projMatrix,K),ke=h.queryGeometry,Be=U_(ke.isPointQuery()?ke.screenBounds:ke.screenGeometry,R,Me,ne.aabb);Be!=null&&(ue=Math.min(Be,ue))}return ue!==Number.MAX_VALUE&&ue}}return!1}_handleOverridablePaintPropertyUpdate(h,e,r){return!(!this.layout||e.isDataDriven()||r.isDataDriven()||h!=="model-color"&&h!=="model-color-mix-intensity"&&h!=="model-rotation"&&h!=="model-scale"&&h!=="model-translation"&&h!=="model-emissive-strength")}_isPropertyZoomDependent(h){const e=this._transitionablePaint._values[h];return e!=null&&e.value!=null&&e.value.expression!=null&&e.value.expression instanceof fl}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}},clip:class extends kn{constructor(h,e,r,y){super(h,{layout:Wm||(Wm=new Wr({"clip-layer-types":ne
273w oi(Rt.layout_clip["clip-layer-types"]),"clip-layer-scope":new oi(Rt.layout_clip["clip-layer-scope"])})),paint:Zm||(Zm=new Wr({}))},e,r,y)}recalculate(h,e){super.recalculate(h,e)}createBucket(h){return new Xm(h)}isTileClipped(){return!0}is3D(){return!0}}};class Vv{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class Uv{constructor(){this.tasks={},this.taskQueue=[],Ni(["process"],this),this.invoker=new Vv(this.process),this.nextId=0}add(e,r){const y=this.nextId++,U=function({type:R,isSymbolTile:j,zoom:X}){return X=X||0,R==="message"?0:R!=="maybePrepare"||j?R!=="parseTile"||j?R==="parseTile"&&j?300-X:R==="maybePrepare"&&j?400-X:500:200-X:100-X}(r);if(U===0){try{e()}finally{}return null}return this.tasks[y]={fn:e,metadata:r,priority:U,id:y},this.taskQueue.push(y),this.invoker.trigger(),{cancel:()=>{delete this.tasks[y]}}}process(){try{if(this.taskQueue=this.taskQueue.filter(y=>!!this.tasks[y]),!this.taskQueue.length)return;const e=this.pick();if(e===null)return;const r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!r)return;r.fn()}finally{}}pick(){let e=null,r=1/0;for(let U=0;U<this.taskQueue.length;U++){const R=this.tasks[this.taskQueue[U]];R.priority<r&&(r=R.priority,e=U)}if(e===null)return null;const y=this.taskQueue[e];return this.taskQueue.splice(e,1),y}remove(){this.invoker.remove()}}class ey{constructor(e,r,y){this.target=e,this.parent=r,this.mapId=y,this.callbacks={},this.cancelCallbacks={},Ni(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler=new Uv}send(e,r,y,U,R=!1,j){const X=Math.round(1e18*Math.random()).toString(36).substring(0,10);y&&(y.metadata=j,this.callbacks[X]=y);const Q=new Set;return this.target.postMessage({id:X,type:e,hasCallback:!!y,targetMapId:U,mustQueue:R,sourceMapId:this.mapId,data:Ma(r,Q)},Q),{cancel:()=>{y&&delete this.callbacks[X],this.target.postMessage({id:X,type:"<cancel>",targetMapId:U,sourceMapId:this.mapId})}}}receive(e){const r=e.data,y=r.id;if(y&&(!r.targetMapId||this.mapId===r.targetMapId))if(r.type==="<cancel>"){const U=this.cancelCallbacks[y];delete this.cancelCallbacks[y],U&&U.cancel()}else if(r.mustQueue||rn()){const U=this.callbacks[y],R=this.scheduler.add(()=>this.processTask(y,r),U&&U.metadata||{type:"message"});R&&(this.cancelCallbacks[y]=R)}else this.processTask(y,r)}processTask(e,r){if(delete this.cancelCallbacks[e],r.type==="<response>"){const y=this.callbacks[e];delete this.callbacks[e],y&&(r.error?y(Qa(r.error)):y(null,Qa(r.data)))}else{const y=new Set,U=r.hasCallback?(j,X)=>{this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:j?Ma(j):null,data:Ma(X,y)},y)}:()=>{},R=Qa(r.data);if(this.parent[r.type])this.parent[r.type](r.sourceMapId,R,U);else if(this.parent.getWorkerSource){const j=r.type.split(".");this.parent.getWorkerSource(r.sourceMapId,j[0],R.source,R.scope)[j[1]](R,U)}else U(new Error(`Could not find function ${r.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}var Vu={workerUrl:"",workerClass:null,workerParams:void 0};const am="mapboxgl_preloaded_worker_pool";class Ul{constructor(){this.active={}}acquire(e,r=Ul.workerCount){if(!this.workers)for(this.workers=[];this.workers.length<r;)this.workers.push(Vu.workerClass!=null?new Vu.workerClass:new self.Worker(Vu.workerUrl,Vu.workerParams));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.workers&&this.numActive()===0&&(this.workers.forEach(r=>{r.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[am]}numActive(){return Object.keys(this.active).length}}Ul.workerCount=2;class Wc{constructor(e,r,y="Worker",U=Ul.workerCount){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=di();const R=this.workerPool.acquire(this.id,U);for(let j=0;j<R.length;j++){const X=new Wc.Actor(R[j],r,this.id);X.name=`${y} ${j}`,this.actors.push(X)}this.ready=!1,this.broadcast("checkIfReady",null,()=>{this.ready=!0})}broadcast(e,r,y){Yt(this.actors,(U,R)=>{U.send(e,r,R)},y=y||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}
273remove(){this.actors.forEach(e=>{e.remove()}),this.actors=[],this.workerPool.release(this.id)}}let Uu,om;function Sp(){return Uu||(Uu=new Ul),Uu}Wc.Actor=ey;const lm=new Sr(0,0,0);var cm=(h=>(h[h.PATH_RULE_UNSPECIFIED=0]="PATH_RULE_UNSPECIFIED",h[h.PATH_RULE_NON_ZERO=1]="PATH_RULE_NON_ZERO",h[h.PATH_RULE_EVEN_ODD=2]="PATH_RULE_EVEN_ODD",h))(cm||{}),Tp=(h=>(h[h.LINE_CAP_UNSPECIFIED=0]="LINE_CAP_UNSPECIFIED",h[h.LINE_CAP_BUTT=1]="LINE_CAP_BUTT",h[h.LINE_CAP_ROUND=2]="LINE_CAP_ROUND",h[h.LINE_CAP_SQUARE=3]="LINE_CAP_SQUARE",h))(Tp||{}),ju=(h=>(h[h.LINE_JOIN_UNSPECIFIED=0]="LINE_JOIN_UNSPECIFIED",h[h.LINE_JOIN_MITER=1]="LINE_JOIN_MITER",h[h.LINE_JOIN_MITER_CLIP=2]="LINE_JOIN_MITER_CLIP",h[h.LINE_JOIN_ROUND=3]="LINE_JOIN_ROUND",h[h.LINE_JOIN_BEVEL=4]="LINE_JOIN_BEVEL",h))(ju||{}),ty=(h=>(h[h.PAINT_ORDER_UNSPECIFIED=0]="PAINT_ORDER_UNSPECIFIED",h[h.PAINT_ORDER_FILL_AND_STROKE=1]="PAINT_ORDER_FILL_AND_STROKE",h[h.PAINT_ORDER_STROKE_AND_FILL=2]="PAINT_ORDER_STROKE_AND_FILL",h))(ty||{}),Zc=(h=>(h[h.PATH_COMMAND_UNSPECIFIED=0]="PATH_COMMAND_UNSPECIFIED",h[h.PATH_COMMAND_MOVE=1]="PATH_COMMAND_MOVE",h[h.PATH_COMMAND_LINE=2]="PATH_COMMAND_LINE",h[h.PATH_COMMAND_QUAD=3]="PATH_COMMAND_QUAD",h[h.PATH_COMMAND_CUBIC=4]="PATH_COMMAND_CUBIC",h[h.PATH_COMMAND_CLOSE=5]="PATH_COMMAND_CLOSE",h))(Zc||{}),iy=(h=>(h[h.MASK_TYPE_UNSPECIFIED=0]="MASK_TYPE_UNSPECIFIED",h[h.MASK_TYPE_LUMINANCE=1]="MASK_TYPE_LUMINANCE",h[h.MASK_TYPE_ALPHA=2]="MASK_TYPE_ALPHA",h))(iy||{});function jv(h,e,r){h===1&&e.icons.push(function(y,U){return function(R){if(R.usvg_tree.height||(R.usvg_tree.height=R.usvg_tree.width),!R.metadata)return R;const{metadata:j}=R;if(j.content_area){const{content_area:X}=j;X.top==null&&(X.top=X.left),X.width==null&&(X.width=R.usvg_tree.width),X.height==null&&(X.height=X.width)}return j.stretch_x&&j.stretch_x.length&&ry(j,"x"),j.stretch_y&&j.stretch_y.length&&ry(j,"y"),R}(y.readFields(Gv,{name:void 0},U))}(r,r.readVarint()+r.pos))}function ry(h,e){const r=[],y=h[`stretch_${e}`];let U=null;for(let R=0;R<y.length;R++)U===null?U=r.length===0?y[0]:r[r.length-1][1]+y[R]:(r.push([U,U+y[R]]),U=null);h[`stretch_${e}_areas`]=r}function Gv(h,e,r){h===1?e.name=r.readString():h===2?e.metadata=function(y,U){return y.readFields(qv,{stretch_x:null,stretch_y:null,stretch_x_areas:null,stretch_y_areas:null,variables:[]},U)}(r,r.readVarint()+r.pos):h===3&&(e.usvg_tree=function(y,U){return y.readFields(Wv,{width:20,children:[],linear_gradients:[],radial_gradients:[],clip_paths:[],masks:[]},U)}(r,r.readVarint()+r.pos),e.data="usvg_tree")}function qv(h,e,r){h===1?e.stretch_x=r.readPackedVarint():h===2?e.stretch_y=r.readPackedVarint():h===3?e.content_area=function(y,U){return y.readFields($v,{left:0},U)}(r,r.readVarint()+r.pos):h===4&&e.variables.push(function(y,U){return y.readFields(Hv,{name:void 0},U)}(r,r.readVarint()+r.pos))}function $v(h,e,r){h===1?e.left=r.readVarint():h===2?e.width=r.readVarint():h===3?e.top=r.readVarint():h===4&&(e.height=r.readVarint())}function Hv(h,e,r){h===1?e.name=r.readString():h===2&&(e.rgb_color=Mp(r.readVarint()),e.value="rgb_color")}function Wv(h,e,r){h===1?e.width=e.height=r.readVarint():h===2?e.height=r.readVarint():h===3?e.children.push(Ep(r,r.readVarint()+r.pos)):h===4?e.linear_gradients.push(function(y,U){return y.readFields(ex,{spread_method:1,stops:[],x1:0,y1:0,x2:1,y2:0},U)}(r,r.readVarint()+r.pos)):h===5?e.radial_gradients.push(function(y,U){return y.readFields(ix,{spread_method:1,stops:[],cx:.5,cy:.5,r:.5,fx:.5,fy:.5,fr:0},U)}(r,r.readVarint()+r.pos)):h===7?e.clip_paths.push(function(y,U){return y.readFields(rx,{children:[]},U)}(r,r.readVarint()+r.pos)):h===8&&e.masks.push(function(y,U){const R=y.readFields(nx,{left:0,width:20,mask_type:1,children:[]},U);return R.height==null&&(R.height=R.width),R.top==null&&(R.top=R.left),R}(r,r.readVarint()+r.pos))}function Ep(h,e){return h.readFields(Zv,{},e)}function Zv(h,e,r){h===1?(e.group=function(y,U){return y.readFields(Xv,{opacity:255,children:[]},U)}(r,r.readVarint()+r.pos),e.node="group"):h===2&&(e.path=function(y,U){return y.readFields(Jv,{paint_order:1,commands:[],step:1,diffs:[],rule:1},U)}(r,r.readVarint()+r.pos),e.node="path")}function Xv(h,e,r){h===1?e.transform=Ap(r,r.readVarint()+r.pos):h===2?e.opacity=r.readVarint():h===5?e.clip_path_idx=r.readVarint():h===6?e.mask_idx=r.readVarint():h===7&&e.children.push(Ep(r,r.readVarint()+r.pos))}function Ap(h,e){return h.readFields(Yv,{sx:1,ky:0,kx:0,sy:1,tx:0,ty:0},e)}function Yv(h,e,r){h===1?e.sx=r.readFloat():h===2?e.ky=r.readFloat():h===3?e.kx=r.readFloat():h===4?e.sy=r.readFloat():h===5?e.tx=r.readFloat():h===6&&(e.ty=r.readFloat())}function Jv(h,e,r){h===1?e.fill=function(y,U){return y.readFields(Kv,{rgb_color:lm,paint:"rgb_color",opacity:255},U)}(r,r.readVarint()+r.pos):h===2?e.stroke=function(y,U){return y.readFields(Qv,{rgb_color:lm,paint:"rgb_color",dasharray:[],dashoffset:0,miterlimit:4,opacity:255,width:1,linecap:1,linejoin:1},U)}(r,r.readVarint()+r.pos):h===3?e.paint_order=r.readVarint():h===5?r.readPackedVarint(e.commands):h===6?e.step=r.readFloat():h===7?r.readPackedSVarint(e.diffs):h===8&&(e.rule=r.readVarint())}function Kv(h,e,r){h===1?(e.rgb_color=Mp(r.readVarint()),e.paint="rgb_color"):h===2?(e.linear_gradient_idx=r.readVarint(),e.paint="linear_gradient_idx"):h===3?(e.radial_gradient_idx=r.readVarint(),e.paint="radial_gradient_idx"):h===5&&(e.opacity=r.readVarint())}function Mp(h){return new Sr((h>>16&255)/255,(h>>8&255)/255,(255&h)/255,1)}function Qv(h,e,r){h===1?(e.rgb_color=Mp(r.readVarint()),e.paint="rgb_color"):h===2?(e.linear_gradient_idx=r.readVarint(),e.paint="linear_gradient_idx"):h===3?(e.radial_gradient_idx=r.readVarint(),e.paint="radial_gradient_idx"):h===5?r.readPackedFloat(e.dasharray):h===6?e.dashoffset=r.readFloat():h===7?e.miterlimit=r.readFloat():h===8?e.opacity=r.readVarint():h===9?e.width=r.readFloat():h===10?e.linecap=r.readVarint():h===11&&(e.linejoin=r.readVarint())}function ex(h,e,r){h===1?e.transform=Ap(r,r.readVarint()+r.pos):h===2?e.spread_method=r.readVarint():h===3?e.stops.push(ny(r,r.readVarint()+r.pos)):h===4?e.x1=r.readFloat():h===5?e.y1=r.readFloat():h===6?e.x2=r.readFloat():h===7&&(e.y2=r.readFloat())}function ny(h,e){return h.readFields(tx,{offset:0,opacity:255,rgb_color:lm},e)}function tx(h,e,r){h===1?e.offset=r.readFloat():h===2?e.opacity=r.readVarint():h===3&&(e.rgb_color=Mp(r.readVarint()))}function ix(h,e,r){h===1?e.transform=Ap(r,r.readVarint()+r.pos):h===2?e.spread_method=r.readVarint():h===3?e.stops.push(ny(r,r.readVarint()+r.pos)):h===4?e.cx=r.readFloat():h===5?e.cy=r.readFloat():h===6?e.r=r.readFloat():h===7?e.fx=r.readFloat():h===8?e.fy=r.readFloat():h===9&&(e.fr=r.readFloat())}function rx(h,e,r){h===1?e.transform=Ap(r,r.readVarint()+r.pos):h===2?e.clip_path_idx=r.readVarint():h===3&&e.children.push(Ep(r,r.readVarint()+r.pos))}function nx(h,e,r){h===1?e.left=e.top=r.readFloat():h===2?e.width=e.height=r.readFloat():h===3?e.top=r.readFloat():h===4?e.height=r.readFloat():h===5?e.mask_type=r.readVarint():h===6?e.mask_idx=r.readVarint():h===7&&e.children.push(Ep(r,r.readVarint()+r.pos))}class sx{static calculate(e,r){const y=new Map,U=new Map;if(Object.keys(e).length===0)return y;r.forEach(R=>{U.set(R.name,R.rgb_color||new Sr(0,0,0))});for(const[R,j]of Object.entries(e))U.has(R)?y.set(U.get(R).toStringPremultipliedAlpha(),j):console.warn(`Ignoring unknown image variable "${R}"`);return y}}function Xc(h,e=255,r){const y=e/255,U=h.toStringPremultipliedAlpha(),R=r.has(U)?r.get(U).clone():h.clone();return R.a=y,R.toString()}function Gu(h,e){if(!je()){const r=document.createElement("canvas");return r.width=h,r.height=e,r}return new OffscreenCanvas(h,e)}function ax(h,e){const r=sx.calculate(e.params,h.metadata?h.metadata.variables:[]),y=h.usvg_tree,U=y.width,R=y.height,j=e.transform?e.transform:new DOMMatrix,X=Math.max(1,Math.round(U*j.a)),Q=Math.max(1,Math.round(R*j.d)),se=new DOMMatrix([X/U,0,0,Q/R,0,0]),W=Gu(X,Q).getContext("2d");return hm(W,se,y,y,r),W.getImageData(0,0,X,Q)}function hm(h,e,r,y,U){for(const R of y.children)sy(h,e,r,R,U)}function sy(h,e,r,y,U){y.group?(h.save(),function(R,j,X,Q,se){const W=Q.mask_idx!=null?X.masks[Q.mask_idx]:null,ee=Q.clip_path_idx!=null?X.clip_paths[Q.
273clip_path_idx]:null;if(Q.transform&&(j=Pp(Q.transform).preMultiplySelf(j)),!function(te,ae,ue){return te.opacity!==255||ae||ue}(Q,ee!=null,W!=null))return void hm(R,j,X,Q,se);const ne=Gu(R.canvas.width,R.canvas.height),K=ne.getContext("2d");hm(K,j,X,Q,se),ee&&dy(K,j,X,ee),W&&py(K,j,X,W,se),R.globalAlpha=Q.opacity/255,R.drawImage(ne,0,0)}(h,e,r,y.group,U),h.restore()):y.path&&(h.save(),function(R,j,X,Q,se){const W=fy(Q);R.setTransform(j),Q.paint_order===ty.PAINT_ORDER_FILL_AND_STROKE?(ay(R,X,Q,W,se),ly(R,X,Q,W,se)):(ly(R,X,Q,W,se),ay(R,X,Q,W,se))}(h,e,r,y.path,U),h.restore())}function ay(h,e,r,y,U){const R=r.fill;if(!R)return;const j=R.opacity/255;switch(R.paint){case"rgb_color":h.fillStyle=Xc(R.rgb_color,R.opacity,U);break;case"linear_gradient_idx":h.fillStyle=cy(h,e.linear_gradients[R.linear_gradient_idx],j,U);break;case"radial_gradient_idx":h.fillStyle=hy(h,e.radial_gradients[R.radial_gradient_idx],j,U)}h.fill(y,oy(r))}function oy(h){return h.rule===cm.PATH_RULE_NON_ZERO?"nonzero":h.rule===cm.PATH_RULE_EVEN_ODD?"evenodd":void 0}function ly(h,e,r,y,U){const R=r.stroke;if(!R)return;h.lineWidth=R.width,h.miterLimit=R.miterlimit,h.setLineDash(R.dasharray),h.lineDashOffset=R.dashoffset;const j=R.opacity/255;switch(R.paint){case"rgb_color":h.strokeStyle=Xc(R.rgb_color,R.opacity,U);break;case"linear_gradient_idx":h.strokeStyle=cy(h,e.linear_gradients[R.linear_gradient_idx],j,U);break;case"radial_gradient_idx":h.strokeStyle=hy(h,e.radial_gradients[R.radial_gradient_idx],j,U)}switch(R.linejoin){case ju.LINE_JOIN_MITER_CLIP:case ju.LINE_JOIN_MITER:h.lineJoin="miter";break;case ju.LINE_JOIN_ROUND:h.lineJoin="round";break;case ju.LINE_JOIN_BEVEL:h.lineJoin="bevel"}switch(R.linecap){case Tp.LINE_CAP_BUTT:h.lineCap="butt";break;case Tp.LINE_CAP_ROUND:h.lineCap="round";break;case Tp.LINE_CAP_SQUARE:h.lineCap="square"}h.stroke(y)}function cy(h,e,r,y){if(e.stops.length===1){const ne=e.stops[0];return Xc(ne.rgb_color,ne.opacity*r,y)}const U=Pp(e.transform),{x1:R,y1:j,x2:X,y2:Q}=e,se=U.transformPoint(new DOMPoint(R,j)),W=U.transformPoint(new DOMPoint(X,Q)),ee=h.createLinearGradient(se.x,se.y,W.x,W.y);for(const ne of e.stops)ee.addColorStop(ne.offset,Xc(ne.rgb_color,ne.opacity*r,y));return ee}function hy(h,e,r,y){if(e.stops.length===1){const ne=e.stops[0];return Xc(ne.rgb_color,ne.opacity*r,y)}const U=Pp(e.transform),{fx:R,fy:j,cx:X,cy:Q}=e,se=U.transformPoint(new DOMPoint(R,j)),W=U.transformPoint(new DOMPoint(X,Q)),ee=h.createRadialGradient(se.x,se.y,0,W.x,W.y,e.r*((U.a+U.d)/2));for(const ne of e.stops)ee.addColorStop(ne.offset,Xc(ne.rgb_color,ne.opacity*r,y));return ee}function uy(h,e,r,y){const U=y.transform?Pp(y.transform).preMultiplySelf(e):e,R=Gu(h.canvas.width,h.canvas.height),j=R.getContext("2d");for(const Q of y.children)if(Q.group)uy(j,U,r,Q.group);else if(Q.path){const se=Q.path,W=new Path2D;W.addPath(fy(se),U),j.fill(W,oy(se))}const X=y.clip_path_idx!=null?r.clip_paths[y.clip_path_idx]:null;X&&dy(j,U,r,X),h.globalCompositeOperation="source-over",h.drawImage(R,0,0)}function dy(h,e,r,y){const U=Gu(h.canvas.width,h.canvas.height);uy(U.getContext("2d"),e,r,y),h.globalCompositeOperation="destination-in",h.drawImage(U,0,0)}function py(h,e,r,y,U){if(y.children.length===0)return;const R=y.mask_idx!=null?r.masks[y.mask_idx]:null;R&&py(h,e,r,R,U);const j=h.canvas.width,X=h.canvas.height,Q=Gu(j,X),se=Q.getContext("2d"),W=y.width,ee=y.height,ne=y.left,K=y.top,te=new Path2D,ae=new Path2D;ae.rect(ne,K,W,ee),te.addPath(ae,e),se.clip(te);for(const xe of y.children)sy(se,e,r,xe,U);const ue=se.getImageData(0,0,j,X),de=ue.data;if(y.mask_type===iy.MASK_TYPE_LUMINANCE)for(let xe=0;xe<de.length;xe+=4)de[xe+3]=de[xe+3]/255*(.2126*de[xe]+.7152*de[xe+1]+.0722*de[xe+2]);se.putImageData(ue,0,0),h.globalCompositeOperation="destination-in",h.drawImage(Q,0,0)}function Pp(h){return h?new DOMMatrix([h.sx,h.ky,h.kx,h.sy,h.tx,h.ty]):new DOMMatrix}function fy(h){const e=new Path2D,r=h.step;let y=h.diffs[0]*r,U=h.diffs[1]*r;e.moveTo(y,U);for(let R=0,j=2;R<h.commands.length;R++)switch(h.commands[R]){case Zc.PATH_COMMAND_MOVE:y+=h.diffs[j++]*r,U+=h.diffs[j++]*r,e.moveTo(y,U);break;case Zc.PATH_COMMAND_LINE:y+=h.diffs[j++]*r,U+=h.diffs[j++]*r,e.lineTo(y,U);break;case Zc.PATH_COMMAND_QUAD:{const X=y+h.diffs[j++]*r,Q=U+h.diffs[j++]*r;y=X+h.diffs[j++]*r,U=Q+h.diffs[j++]*r,e.quadraticCurveTo(X,Q,y,U);break}case Zc.PATH_COMMAND_CUBIC:{const X=y+h.diffs[j++]*r,Q=U+h.diffs[j++]*r,
vendor: 4,601 bytes, line 273
273se=X+h.diffs[j++]*r,W=Q+h.diffs[j++]*r;y=se+h.diffs[j++]*r,U=W+h.diffs[j++]*r,e.bezierCurveTo(X,Q,se,W,y,U);break}case Zc.PATH_COMMAND_CLOSE:e.closePath()}return e}class um{constructor(e){this.capacity=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const r=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,r),r}put(e,r){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,r)}delete(e){this.cache.delete(e)}}class dm{constructor(){this.cacheMap=new Map,this.cacheDependenciesMap=new Map}static _getImage(e){return new Gn(e,e.data)}getFromCache(e,r,y){return this.cacheMap.has(y)||this.cacheMap.set(y,new um(150)),this.cacheMap.get(y).get(Ws(e.serialize(),r))}setInCache(e,r,y,U){this.cacheDependenciesMap.has(U)||this.cacheDependenciesMap.set(U,new Map),this.cacheMap.has(U)||this.cacheMap.set(U,new um(150));const R=this.cacheDependenciesMap.get(U);R.get(Ws(e.id,y))||R.set(Ws(e.id,y),new Set);const j=this.cacheMap.get(U),X=e.serialize();R.get(Ws(e.id,y)).add(X),j.put(Ws(e.serialize(),y),r)}removeImagesFromCacheByIds(e,r,y=""){if(!this.cacheMap.has(y)||!this.cacheDependenciesMap.has(y))return;const U=this.cacheMap.get(y),R=this.cacheDependenciesMap.get(y);for(const j of e)if(R.has(Ws(j,r))){for(const X of R.get(Ws(j,r)))U.delete(X);R.delete(Ws(j,r))}}rasterize(e,r,y,U,R=ax){const j=this.getFromCache(e,y,U);if(j)return j.clone();const X=R(r.icon,e.options),Q=dm._getImage(X);return this.setInCache(e,Q,y,U),Q.clone()}}class my{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,r){const y=this.toIdx(e,r);return{min:this.minimums[y],max:this.maximums[y]}}isLeaf(e,r){return this.leaves[this.toIdx(e,r)]}toIdx(e,r){return r*this.size+e}}function gy(h,e,r,y){let U=0,R=Number.MAX_VALUE;for(let j=0;j<3;j++)if(Math.abs(y[j])<1e-15){if(r[j]<h[j]||r[j]>e[j])return null}else{const X=1/y[j];let Q=(h[j]-r[j])*X,se=(e[j]-r[j])*X;if(Q>se){const W=Q;Q=se,se=W}if(Q>U&&(U=Q),se<R&&(R=se),U>R)return null}return U}function _y(h,e,r,y,U,R,j,X,Q,se,W){const ee=y-h,ne=U-e,K=R-r,te=j-h,ae=X-e,ue=Q-r,de=W[1]*ue-W[2]*ae,xe=W[2]*te-W[0]*ue,we=W[0]*ae-W[1]*te,me=ee*de+ne*xe+K*we;if(Math.abs(me)<1e-15)return null;const Me=1/me,ke=se[0]-h,Be=se[1]-e,He=se[2]-r,$e=(ke*de+Be*xe+He*we)*Me;if($e<0||$e>1)return null;const qe=Be*K-He*ne,st=He*ee-ke*K,We=ke*ne-Be*ee,ct=(W[0]*qe+W[1]*st+W[2]*We)*Me;return ct<0||$e+ct>1?null:(te*qe+ae*st+ue*We)*Me}function yy(h,e,r){return(h-e)/(r-e)}function vy(h,e,r,y,U,R,j,X,Q){const se=1<<r,W=R-y,ee=j-U,ne=(h+1)/se*W+y,K=(e+0)/se*ee+U,te=(e+1)/se*ee+U;X[0]=(h+0)/se*W+y,X[1]=K,Q[0]=ne,Q[1]=te}class xy{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 r=function(R){const j=Math.ceil(Math.log2(R.dim/8)),X=[];let Q=Math.ceil(Math.pow(2,j));const se=1/Q,W=(K,te,ae,ue,de)=>{const xe=ue?1:0,we=(K+1)*ae-xe,me=te*ae,Me=(te+1)*ae-xe;de[0]=K*ae,de[1]=me,de[2]=we,de[3]=Me};let ee=new my(Q);const ne=[];for(let K=0;K<Q*Q;K++){W(K%Q,Math.floor(K/Q),se,!1,ne);const te=jo(ne[0],ne[1],R),ae=jo(ne[2],ne[1],R),ue=jo(ne[2],ne[3],R),de=jo(ne[0],ne[3],R);ee.minimums.push(Math.min(te,ae,ue,de)),ee.maximums.push(Math.max(te,ae,ue,de)),ee.leaves.push(1)}for(X.push(ee),Q/=2;Q>=1;Q/=2){const K=X[X.length-1];ee=new my(Q);for(let te=0;te<Q*Q;te++){W(te%Q,Math.floor(te/Q),2,!0,ne);const ae=K.getElevation(ne[0],ne[1]),ue=K.getElevation(ne[2],ne[1]),de=K.getElevation(ne[2],ne[3]),xe=K.getElevation(ne[0],ne[3]),we=K.isLeaf(ne[0],ne[1]),me=K.isLeaf(ne[2],ne[1]),Me=K.isLeaf(ne[2],ne[3]),ke=K.isLeaf(ne[0],ne[3]),Be=Math.min(ae.min,ue.min,de.min,xe.min),He=Math.max(ae.max,ue.max,de.max,xe.max),$e=we&&me&&Me&&ke;ee.maximums.push(He),ee.minimums.push(Be),ee.leaves.push(He-Be<=5&&$e?1:0)}X.push(ee)}return X}(this.dem),y=r.length-1,U=r[y];this._addNode(U.minimums[0],U.maximums[0],U.leaves[0]),this._construct(r,0,0,y,0)}raycastRoot(e,r,y,U,R,j,X=1){return gy([e,r,-100],[y,U,this.maximums[0]*X],R,j)}raycast(e,r,y,U,R,j,X=1){if(!this.nodeCount)return null;const Q=this.raycastRoot(e,r,y,U,R,j,X);if(Q==null)return null;const se=[],W=[],ee=[],ne=[],K=[{idx:0,t:Q,nodex:0,nodey:0,depth:0}];for(;K.length>0;){const{idx:te,t:ae,nodex:ue,nodey:de,depth:xe}=K.pop();if(this.leaves[te]){vy(ue,de,xe,e,r,y,U,ee,ne);const me=1<<xe,Me=(ue+0)/me,ke=(ue+1)/me,Be=(de+0)/me,He=(de+1)/me,$e=jo(Me,Be,this.dem)*X,qe=jo(ke,Be,this.dem)*X,st=jo(ke,He,this.dem)*X,We=jo(Me,He,this.dem)*X,ct=_y(ee[0],ee[1],$e,ne[0],ee[1],qe,
vendor: 14,863 bytes, line 273
273ne[0],ne[1],st,R,j),ft=_y(ne[0],ne[1],st,ee[0],ne[1],We,ee[0],ee[1],$e,R,j),dt=Math.min(ct!==null?ct:Number.MAX_VALUE,ft!==null?ft:Number.MAX_VALUE);if(dt!==Number.MAX_VALUE)return dt;{const _t=pt.vec3.scaleAndAdd([],R,j,ae);if(by($e,qe,We,st,yy(_t[0],ee[0],ne[0]),yy(_t[1],ee[1],ne[1]))>=_t[2])return ae}continue}let we=0;for(let me=0;me<this._siblingOffset.length;me++){vy((ue<<1)+this._siblingOffset[me][0],(de<<1)+this._siblingOffset[me][1],xe+1,e,r,y,U,ee,ne),ee[2]=-100,ne[2]=this.maximums[this.childOffsets[te]+me]*X;const Me=gy(ee,ne,R,j);if(Me!=null){const ke=Me;se[me]=ke;let Be=!1;for(let He=0;He<we&&!Be;He++)ke>=se[W[He]]&&(W.splice(He,0,me),Be=!0);Be||(W[we]=me),we++}}for(let me=0;me<we;me++){const Me=W[me];K.push({idx:this.childOffsets[te]+Me,t:se[Me],nodex:(ue<<1)+this._siblingOffset[Me][0],nodey:(de<<1)+this._siblingOffset[Me][1],depth:xe+1})}}return null}_addNode(e,r,y){return this.minimums.push(e),this.maximums.push(r),this.leaves.push(y),this.childOffsets.push(0),this.nodeCount++}_construct(e,r,y,U,R){if(e[U].isLeaf(r,y)===1)return;this.childOffsets[R]||(this.childOffsets[R]=this.nodeCount);const j=U-1,X=e[j];let Q=0,se=0;for(let W=0;W<this._siblingOffset.length;W++){const ee=2*r+this._siblingOffset[W][0],ne=2*y+this._siblingOffset[W][1],K=X.getElevation(ee,ne),te=X.isLeaf(ee,ne),ae=this._addNode(K.min,K.max,te);te&&(Q|=1<<W),se||(se=ae)}for(let W=0;W<this._siblingOffset.length;W++)Q&1<<W||this._construct(e,2*r+this._siblingOffset[W][0],2*y+this._siblingOffset[W][1],j,se+W)}}function by(h,e,r,y,U,R){return Bi(Bi(h,r,R),Bi(e,y,R),U)}function jo(h,e,r){const y=r.dim,U=Ue(h*y-.5,0,y-1),R=Ue(e*y-.5,0,y-1),j=Math.floor(U),X=Math.floor(R),Q=Math.min(j+1,y-1),se=Math.min(X+1,y-1);return by(r.get(j,X),r.get(Q,X),r.get(j,se),r.get(Q,se),U-j,R-X)}const ox={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function lx(h,e,r){return(256*h*256+256*e+r)/10-1e4}function cx(h,e,r){return 256*h+e+r/256-32768}class Cp{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,r,y,U=!1){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(y&&y!=="mapbox"&&y!=="terrarium")return void zi(`"${y}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=r.height;const R=this.dim=r.height-2,j=new Uint32Array(r.data.buffer);if(this.pixels=new Uint8Array(r.data.buffer),this.floatView=new Float32Array(r.data.buffer),this.borderReady=U,this._modifiedForSources={},!U){for(let Q=0;Q<R;Q++)j[this._idx(-1,Q)]=j[this._idx(0,Q)],j[this._idx(R,Q)]=j[this._idx(R-1,Q)],j[this._idx(Q,-1)]=j[this._idx(Q,0)],j[this._idx(Q,R)]=j[this._idx(Q,R-1)];j[this._idx(-1,-1)]=j[this._idx(0,0)],j[this._idx(R,-1)]=j[this._idx(R-1,0)],j[this._idx(-1,R)]=j[this._idx(0,R-1)],j[this._idx(R,R)]=j[this._idx(R-1,R-1)]}const X=y==="terrarium"?cx:lx;for(let Q=0;Q<j.length;++Q){const se=4*Q;this.floatView[Q]=X(this.pixels[se],this.pixels[se+1],this.pixels[se+2])}this._timestamp=tt.now()}_buildQuadTree(){this._tree=new xy(this)}get(e,r,y=!1){y&&(e=Ue(e,-1,this.dim),r=Ue(r,-1,this.dim));const U=this._idx(e,r);return this.floatView[U]}set(e,r,y){const U=this._idx(e,r),R=this.floatView[U];return this.floatView[U]=y,y-R}static getUnpackVector(e){return ox[e]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}static pack(e,r){const y=[0,0,0,0],U=Cp.getUnpackVector(r);let R=Math.floor((e+U[3])/U[2]);return y[2]=R%256,R=Math.floor(R/256),y[1]=R%256,R=Math.floor(R/256),y[0]=R,y}getPixels(){return new Nm({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,r,y){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let U=r*this.dim,R=r*this.dim+this.dim,j=y*this.dim,X=y*this.dim+this.dim;switch(r){case-1:U=R-1;break;case 1:R=U+1}switch(y){case-1:j=X-1;break;case 1:X=j+1}const Q=-r*this.dim,se=-y*this.dim;for(let W=j;W<X;W++)for(let ee=U;ee<R;ee++){const ne=4*this._idx(ee,W),K=4*this._idx(ee+Q,W+se);this.pixels[ne+0]=e.pixels[K+0],this.pixels[ne+1]=e.pixels[K+1],this.pixels[ne+2]=e.pixels[K+2],this.pixels[ne+3]=e.pixels[K+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}function hx(h,e,r){h===1?e.headerLength=r.readFixed32():h===2?e.x=r.readVarint():h===3?e.y=r.readVarint():h===4?e.z=r.readVarint():h===5&&e.layers.push(function(y,U){return y.readFields(mx,{version:0,name:"",units:"",tileSize:0,buffer:0,pixelFormat:0,dataIndex:[]},U)}(r,r.readVarint()+r.pos))}function ux(h,e,r){h===1?(e.delta_filter=function(y,U){return y.readFields(dx,{blockSize:0},U)}(r,r.readVarint()+r.pos),e.filter="delta_filter"):h===2?(r.readVarint(),e.filter="zigzag_filter"):h===3?(r.readVarint(),e.filter="bitshuffle_filter"):h===4&&(r.readVarint(),e.filter="byteshuffle_filter")}function dx(h,e,r){h===1&&(e.blockSize=r.readVarint())}function px(h,e,r){h===1?(r.readVarint(),e.codec="gzip_data"):h===2?(r.readVarint(),e.codec="jpeg_image"):h===3?(r.readVarint(),e.codec="webp_image"):h===4&&(r.readVarint(),e.codec="png_image")}function fx(h,e,r){let y=0,U=0;h===1?e.firstByte=r.readFixed64():h===2?e.lastByte=r.readFixed64():h===3?e.filters.push(function(R,j){return R.readFields(ux,{},j)}(r,r.readVarint()+r.pos)):h===4?e.codec=function(R,j){return R.readFields(px,{},j)}(r,r.readVarint()+r.pos):h===5?U=r.readFloat():h===6?y=r.readFloat():h===7?e.bands.push(r.readString()):h===8?e.offset=r.readDouble():h===9&&(e.scale=r.readDouble()),e.offset===0&&(e.offset=U),e.scale===0&&(e.scale=y)}function mx(h,e,r){h===1?e.version=r.readVarint():h===2?e.name=r.readString():h===3?e.units=r.readString():h===4?e.tileSize=r.readVarint():h===5?e.buffer=r.readVarint():h===6?e.pixelFormat=r.readVarint():h===7&&e.dataIndex.push(function(y,U){return y.readFields(fx,{firstByte:0,lastByte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},U)}(r,r.readVarint()+r.pos))}function gx(h,e,r){if(h===2)(function(y,U,R){y.readFields(_x,R,U)})(r,r.readVarint()+r.pos,e);else if(h===3)throw new Error("Not implemented")}function _x(h,e,r){if(h===1){let y=0;const U=r.readVarint()+r.pos;for(;r.pos<U;)e[y++]=r.readVarint()}}function yx(h,e){if(e.length!==4)throw new Error(`Expected data of dimension 4 but got ${e.length}.`);let r=e[3];for(let y=2;y>=1;y--){const U=y===1?1:0,R=y===2?1:0;for(let j=0;j<e[0];j++){const X=e[1]*j;for(let Q=U;Q<e[1];Q++){const se=e[2]*(Q+X);for(let W=R;W<e[2];W++){const ee=e[3]*(W+se);for(let ne=0;ne<e[3];ne++){const K=ee+ne;h[K]+=h[K-r]}}}}r*=e[y]}return h}function vx(h){for(let e=0,r=h.length;e<r;e++)h[e]=h[e]>>>1^-(1&h[e]);return h}function xx(h,e){switch(e){case"uint32":return h;case"uint16":for(let r=0;r<h.length;r+=2){const y=h[r],U=h[r+1];h[r]=(240&y)>>4|(61440&y)>>8|(240&U)<<4|61440&U,h[r+1]=15&y|(3840&y)>>4|(15&U)<<8|(3840&U)<<4}return h;case"uint8":for(let r=0;r<h.length;r+=4){const y=h[r],U=h[r+1],R=h[r+2],j=h[r+3];h[r+0]=(192&y)>>6|(192&U)>>4|(192&R)>>2|192&j,h[r+1]=(48&y)>>4|(48&U)>>2|48&R|(48&j)<<2,h[r+2]=(12&y)>>2|12&U|(12&R)<<2|(12&j)<<4,h[r+3]=3&y|(3&U)<<2|(3&R)<<4|(3&j)<<6}return h;default:throw new Error(`Invalid pixel format, "${e}"`)}}Ti(Cp,"DEMData"),Ti(xy,"DemMinMaxQuadTree",{omit:["dem"]});var Ns=Uint8Array,qu=Uint16Array,bx=Int32Array,wy=new Ns([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]),Sy=new Ns([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]),wx=new Ns([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ty=function(h,e){for(var r=new qu(31),y=0;y<31;++y)r[y]=e+=1<<h[y-1];var U=new bx(r[30]);for(y=1;y<30;++y)for(var R=r[y];R<r[y+1];++R)U[R]=R-r[y]<<5|y;return{b:r,r:U}},Ey=Ty(wy,2),Ay=Ey.b,Sx=Ey.r;Ay[28]=258,Sx[258]=28;for(var Tx=Ty(Sy,0).b,My=new qu(32768),wn=0;wn<32768;++wn){var Yc=(43690&wn)>>1|(21845&wn)<<1;My[wn]=((65280&(Yc=(61680&(Yc=(52428&Yc)>>2|(13107&Yc)<<2))>>4|(3855&Yc)<<4))>>8|(255&Yc)<<8)>>1}var $u=function(h,e,r){for(var y=h.length,U=0,R=new qu(e);U<y;++U)h[U]&&++R[h[U]-1];var j,X=new qu(e);for(U=1;U<e;++U)X[U]=X[U-1]+R[U-1]<<1;j=new qu(1<<e);var Q=15-e;for(U=0;U<y;++U)if(h[U])for(var se=U<<4|h[U],W=e-h[U],ee=X[h[U]-1]++<<W,ne=ee|(1<<W)-1;ee<=ne;++ee)j[My[ee]>>Q]=se;return j},Hu=new Ns(288);for(wn=0;wn<144;++wn)Hu[wn]=8;for(wn=144;wn<256;++wn)Hu[wn]=9;for(wn=256;wn<280;++wn)Hu[wn]=7;for(wn=280;wn<288;++wn)Hu[wn]=8;var Py=new Ns(32);for(wn=0;wn<32;++wn)Py[wn]=5;var Ex=$u(Hu,9),Ax=$u(Py,5),pm=function(h){for(var e=h[0],r=1;r<h.length;++r)h[r]>e&&(e=h[r]);return e},_a=function(h,e,r){var y=e/8|0;return(h[y]|h[y+1]<<8)>>(7&e)&r},fm=function(h,e){var r=e/8|0;return(h[r]|h[r+1]<<8|h[r+2]<<16)>>(7&e)},Mx=["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"],ya=function(h,e,r){var y=new Error(e||Mx[h]);if(y.code=h,Error.captureStackTrace&&Error.captureStackTrace(y,ya),!r)throw y;return y},Px=new Ns(0),Cx=typeof TextDecoder<"u"&&new TextDecoder;try{Cx.decode(Px,{stream:!0})}catch{}const Ix={gzip_data:"gzip"};class ea extends Error{constructor(e){super(e),this.name="MRTError"}}const Dx={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},Cy={uint32:1,uint16:2,uint8:4},kx={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let mm;class gm{constructor(e=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=e}getLayer(e){const r=this.layers[e];if(!r)throw new ea(`Layer '${e}' not found`);return r}getHeaderLength(e){const r=new Uint8Array(e),y=new DataView(e);if(r[0]!==13)throw new ea("File is not a valid MRT.");return y.getUint32(1,!0)}parseHeader(e){const r=new Uint8Array(e),y=this.getHeaderLength(e);if(r.length<y)throw new ea(`Expected header with length >= ${y} but got buffer of length ${r.length}`);const U=function(R,j){return R.readFields(hx,{headerLength:0,x:0,y:0,z:0,layers:[]},void 0)}(new mm(r.subarray(0,y)));if(!isNaN(this.x)&&(this.x!==U.x||this.y!==U.y||this.z!==U.z))throw new ea(`Invalid attempt to parse header ${U.z}/${U.x}/${U.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=U.x,this.y=U.y,this.z=U.z;for(const R of U.layers)this.layers[R.name]=new Rx(R,{cacheSize:this._cacheSize});return this}createDecodingTask(e){const r=[],y=this.getLayer(e.layerName);for(let U of e.blockIndices){const R=y.dataIndex[U],j=R.firstByte-e.firstByte,X=R.lastByte-e.firstByte;if(y._blocksInProgress.has(U))continue;const Q={layerName:y.name,firstByte:j,lastByte:X,pixelFormat:y.pixelFormat,blockIndex:U,blockShape:[R.bands.length].concat(y.bandShape),buffer:y.buffer,codec:R.codec.codec,filters:R.filters.map(se=>se.filter)};y._blocksInProgress.add(U),r.push(Q)}return new Iy(r,()=>{r.forEach(U=>y._blocksInProgress.delete(U.blockIndex))},(U,R)=>{if(r.forEach(j=>y._blocksInProgress.delete(j.blockIndex)),U)throw U;R.forEach(j=>{this.getLayer(j.layerName).processDecodedData(j)})})}}class Rx{constructor({version:e,name:r,units:y,tileSize:U,pixelFormat:R,buffer:j,dataIndex:X},Q){if(this.version=e,this.version!==1)throw new ea(`Cannot parse raster layer encoded with MRT version ${e}`);this.name=r,this.units=y,this.tileSize=U,this.buffer=j,this.pixelFormat=Dx[R],this.dataIndex=X,this.bandShape=[U+2*j,U+2*j,Cy[this.pixelFormat]],this._decodedBlocks=new um(Q?Q.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return Cy[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map(({bands:e})=>e).flat()}processDecodedData(e){const r=e.blockIndex.toString();this._decodedBlocks.get(r)||this._decodedBlocks.put(r,e.data)}getBlockForBand(e){let r=0;switch(typeof e){case"string":for(const[y,U]of this.dataIndex.entries()){for(const[R,j]of U.bands.entries())if(j===e)return{bandIndex:r+R,blockIndex:y,blockBandIndex:R};r+=U.bands.length}break;case"number":for(const[y,U]of this.dataIndex.entries()){if(e>=r&&e<r+U.bands.length)return{bandIndex:e,blockIndex:y,blockBandIndex:e-r};r+=U.bands.length}break;default:throw new ea(`Invalid band \`${JSON.stringify(e)}\`. Expected string or integer.`)}throw new ea(`Band not found: ${JSON.stringify(e)}`)}getDataRange(e){let r=1/0,y=-1/0;const U=[],R=new Set;for(const j of e){const{blockIndex:X}=this.getBlockForBand(j);if(X<0)throw new ea(`Invalid band: ${JSON.stringify(j)}`);const Q=this.dataIndex[X];U.includes(X)||U.push(X),R.add(X),r=Math.min(r,Q.firstByte),y=Math.max(y,Q.lastByte)}if(R.size>this.cacheSize)throw new ea(`Number of blocks to decode (${R.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:r,lastByte:y,blockIndices:U}}hasBand(e){const{blockIndex:r}=this.getBlockForBand(e);return r>=0}hasDataForBand(e){const{blockIndex:r}=this.getBlockForBand(e);return r>=0&&!!this._decodedBlocks.get(r.toString())}getBandView(e){const{blockIndex:r,blockBandIndex:y}=this.getBlockForBand(e),U=this._decodedBlocks.get(r.toString());if(!U)throw new ea(`Data for band ${JSON.stringify(e)} of layer "${this.name}" not decoded.`);const R=this.dataIndex[r],j=this.bandShape.reduce((se,W)=>se*W,1),X=y*j,Q=U.subarray(X,X+j);return{data:Q,bytes:new Uint8Array(Q.buffer).subarray(Q.byteOffset,Q.byteOffset+Q.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:R.offset,scale:R.scale}}}gm.setPbf=function(h){mm=h};class Iy{constructor(e,r,y){this.tasks=e,this._onCancel=r,this._onComplete=y,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(e,r){this._finalized||(this._onComplete(e,r),this._finalized=!0)}}gm.performDecoding=function(h,e){const r=new Uint8Array(h);return Promise.all(e.tasks.map(y=>{const{layerName:U,firstByte:R,lastByte:j,pixelFormat:X,blockShape:Q,blockIndex:se,filters:W,codec:ee}=y,ne=r.subarray(R,j+1),K=new Uint32Array(Q[0]*Q[1]*Q[2]);let te;if(ee!=="gzip_data")throw new ea(`Unhandled codec: ${ee}`);return te=function(ae,ue){if(!globalThis.DecompressionStream&&ue==="gzip_data")return Promise.resolve(((me=function(Be){Be[0]==31&&Be[1]==139&&Be[2]==8||ya(6,"invalid gzip data");var He=Be[3],$e=10;4&He&&($e+=2+(Be[10]|Be[11]<<8));for(var qe=(He>>3&1)+(He>>4&1);qe>0;qe-=!Be[$e++]);return $e+(2&He)}(we=ae))+8>we.length&&ya(6,"invalid gzip data"),function(Be,He,$e,qe){var st=Be.length;if(!st||He.f&&!He.l)return $e||new Ns(0);var We=!$e,ct=We||He.i!=2,ft=He.i;We&&($e=new Ns(3*st));var dt,_t,Tt=function(Go){var ql=$e.length;if(Go>ql){var Yu=new Ns(Math.max(2*ql,Go));Yu.set($e),$e=Yu}},Ct=He.f||0,vt=He.p||0,qt=He.b||0,ei=He.l,Gt=He.d,yi=He.m,mi=He.n,ni=8*st;do{if(!ei){Ct=_a(Be,vt,1);var ti=_a(Be,vt+1,3);if(vt+=3,!ti){var Ai=Be[(Wi=4+((vt+7)/8|0))-4]|Be[Wi-3]<<8,vi=Wi+Ai;if(vi>st){ft&&ya(0);break}ct&&Tt(qt+Ai),$e.set(Be.subarray(Wi,vi),qt),He.b=qt+=Ai,He.p=vt=8*vi,He.f=Ct;continue}if(ti==1)ei=Ex,Gt=Ax,yi=9,mi=5;else if(ti==2){var wi=_a(Be,vt,31)+257,ji=_a(Be,vt+10,15)+4,Ji=wi+_a(Be,vt+5,31
273)+1;vt+=14;for(var Ki=new Ns(Ji),Qi=new Ns(19),nr=0;nr<ji;++nr)Qi[wx[nr]]=_a(Be,vt+3*nr,7);vt+=3*ji;var sr=pm(Qi),Br=(1<<sr)-1,Dr=$u(Qi,sr);for(nr=0;nr<Ji;){var Wi,Mr=Dr[_a(Be,vt,Br)];if(vt+=15&Mr,(Wi=Mr>>4)<16)Ki[nr++]=Wi;else{var Ir=0,$r=0;for(Wi==16?($r=3+_a(Be,vt,3),vt+=2,Ir=Ki[nr-1]):Wi==17?($r=3+_a(Be,vt,7),vt+=3):Wi==18&&($r=11+_a(Be,vt,127),vt+=7);$r--;)Ki[nr++]=Ir}}var un=Ki.subarray(0,wi),Sn=Ki.subarray(wi);yi=pm(un),mi=pm(Sn),ei=$u(un,yi),Gt=$u(Sn,mi)}else ya(1);if(vt>ni){ft&&ya(0);break}}ct&&Tt(qt+131072);for(var dn=(1<<yi)-1,Qr=(1<<mi)-1,yn=vt;;yn=vt){var En=(Ir=ei[fm(Be,vt)&dn])>>4;if((vt+=15&Ir)>ni){ft&&ya(0);break}if(Ir||ya(2),En<256)$e[qt++]=En;else{if(En==256){yn=vt,ei=null;break}var Jn=En-254;En>264&&(Jn=_a(Be,vt,(1<<(xa=wy[nr=En-257]))-1)+Ay[nr],vt+=xa);var jr=Gt[fm(Be,vt)&Qr],ws=jr>>4;if(jr||ya(3),vt+=15&jr,Sn=Tx[ws],ws>3){var xa=Sy[ws];Sn+=fm(Be,vt)&(1<<xa)-1,vt+=xa}if(vt>ni){ft&&ya(0);break}ct&&Tt(qt+131072);var ta=qt+Jn;if(qt<Sn){var ia=0-Sn,Gl=Math.min(Sn,ta);for(ia+qt<0&&ya(3);qt<Gl;++qt)$e[qt]=(void 0)[ia+qt]}for(;qt<ta;++qt)$e[qt]=$e[qt-Sn]}}He.l=ei,He.p=yn,He.b=qt,He.f=Ct,ei&&(Ct=1,He.m=yi,He.d=Gt,He.n=mi)}while(!Ct);return qt!=$e.length&&We?(dt=$e,((_t=qt)==null||_t>dt.length)&&(_t=dt.length),new Ns(dt.subarray(0,_t))):$e.subarray(0,qt)}(we.subarray(me,-8),{i:2},new Ns(((de=we)[(xe=de.length)-4]|de[xe-3]<<8|de[xe-2]<<16|de[xe-1]<<24)>>>0))));var de,xe,we,me;const Me=Ix[ue];if(!Me)throw new Error(`Unhandled codec: ${ue}`);const ke=new globalThis.DecompressionStream(Me);return new Response(new Blob([ae]).stream().pipeThrough(ke)).arrayBuffer().then(Be=>new Uint8Array(Be))}(ne,ee).then(ae=>(function(ue,de){ue.readFields(gx,de)}(new mm(ae),K),new kx[X](K.buffer))),te.then(ae=>{for(let ue=W.length-1;ue>=0;ue--)switch(W[ue]){case"delta_filter":yx(ae,Q);break;case"zigzag_filter":vx(ae);break;case"bitshuffle_filter":xx(ae,X);break;default:throw new ea(`Unhandled filter "${W[ue]}"`)}return{layerName:U,blockIndex:se,data:ae}}).catch(ae=>{throw ae})}))},Ti(Iy,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]});let Wu,_m,va,Jc,ym,Kc=null;function Dy(){return rn()&&self.worker&&self.worker.dracoUrl?self.worker.dracoUrl:_m||ln.DRACO_URL}function ky(){if(rn()&&self.worker&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(Jc)return Jc;const h=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]);if(typeof WebAssembly!="object")throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return Jc=WebAssembly.validate(h)?ln.MESHOPT_SIMD_URL:ln.MESHOPT_URL,Jc}const Ip={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},zx={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},Zu={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function Ry(h,e,r){const y=r.json.bufferViews.length,U=r.buffers.length;e.bufferView=y,r.json.bufferViews[y]={buffer:U,byteLength:h.byteLength},r.buffers[U]=h}const vm="KHR_draco_mesh_compression";function Lx(h,e){const r=h.extensions&&h.extensions[vm];if(!r)return;const y=new va.Decoder,U=Oy(e,r.bufferView),R=new va.Mesh;if(!y.DecodeArrayToMesh(U,U.byteLength,R))throw new Error("Failed to decode Draco mesh");const j=e.json.accessors[h.indices],X=Ip[j.componentType],Q=j.count*X.BYTES_PER_ELEMENT,se=va._malloc(Q);X===Uint16Array?y.GetTrianglesUInt16Array(R,Q,se):y.GetTrianglesUInt32Array(R,Q,se),Ry(va.memory.buffer.slice(se,se+Q),j,e),va._free(se);for(const W of Object.keys(r.attributes)){const ee=y.GetAttributeByUniqueId(R,r.attributes[W]),ne=e.json.accessors[h.attributes[W]],K=zx[ne.componentType],te=ne.count*Zu[ne.type]*Ip[ne.componentType].BYTES_PER_ELEMENT,ae=va._malloc(te);y.GetAttributeDataArrayForAllPoints(R,ee,va[K],te,ae),Ry(va.memory.buffer.slice(ae,ae+te),ne,e),va._free(ae)}y.destroy(),R.destroy(),delete h.extensions[vm]}const Dp="EXT_meshopt_compression";function Fx(h,e){if(!h.extensions||!h.extensions[Dp])return;const r=h.extensions[Dp],y=new Uint8Array(e.buffers[r.buffer],r.byteOffset||0,r.byteLength||0),U=new Uint8Array(r.count*r.byteStride);ym.decodeGltfBuffer(U,r.count,r.byteStride,y,r.mode,r.filter),h.buffer=e.buffers.length,h.byteOffset=0,e.buffers[h.buffer]=U.buffer,delete h.extensions[Dp]}const zy=1179937895,Ly=new TextDecoder("utf8");function Fy(h,e){return new URL(h,e).href}function Ox(h,e,r,y){return fetch(Fy(h.uri,y)).then(U=>U.arrayBuffer()).then(U=>{e.buffers[r]=U})}
273function Oy(h,e){const r=h.json.bufferViews[e];return new Uint8Array(h.buffers[r.buffer],r.byteOffset||0,r.byteLength)}function Bx(h,e,r,y){if(h.uri){const U=Fy(h.uri,y);return fetch(U).then(R=>R.blob()).then(R=>createImageBitmap(R)).then(R=>{e.images[r]=R})}if(h.bufferView!==void 0){const U=Oy(e,h.bufferView),R=new Blob([U],{type:h.mimeType});return createImageBitmap(R).then(j=>{e.images[r]=j})}}function By(h,e=0,r){const y={json:null,images:[],buffers:[]};if(new Uint32Array(h,e,1)[0]===zy){const W=new Uint32Array(h,e);let ee=2;const ne=(W[ee++]>>2)-3,K=W[ee++]>>2;if(ee++,y.json=JSON.parse(Ly.decode(W.subarray(ee,ee+K))),ee+=K,ee<ne){const te=W[ee++];ee++;const ae=e+(ee<<2);y.buffers[0]=h.slice(ae,ae+te)}}else y.json=JSON.parse(Ly.decode(new Uint8Array(h,e)));const{buffers:U,images:R,meshes:j,extensionsUsed:X,bufferViews:Q}=y.json;let se=Promise.resolve();if(U){const W=[];for(let ee=0;ee<U.length;ee++){const ne=U[ee];ne.uri?W.push(Ox(ne,y,ee,r)):y.buffers[ee]||(y.buffers[ee]=null)}se=Promise.all(W)}return se.then(()=>{const W=[],ee=X&&X.includes(vm),ne=X&&X.includes(Dp);if(ee&&W.push(function(){if(!va)return Wu??(Wu=function(K){let te,ae=null;function ue(){te=new Uint8Array(ae.buffer)}function de(){throw new Error("Unexpected Draco error.")}const xe={a:{a:de,d:function(we,me,Me){return te.copyWithin(we,me,me+Me)},c:function(we){const me=te.length,Me=Math.max(we>>>0,Math.ceil(1.2*me)),ke=Math.ceil((Me-me)/65536);try{return ae.grow(ke),ue(),!0}catch{return!1}},b:de}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(K,xe):K.then(we=>we.arrayBuffer()).then(we=>WebAssembly.instantiate(we,xe))).then(we=>{const{Rb:me,Qb:Me,P:ke,T:Be,X:He,Ja:$e,La:qe,Qa:st,Va:We,Wa:ct,eb:ft,jb:dt,f:_t,e:Tt,yb:Ct,zb:vt,Ab:qt,Bb:ei,Db:Gt,Gb:yi}=we.instance.exports;ae=Tt;const mi=(()=>{let ni=0,ti=0,Ai=0,vi=0;return wi=>{Ai&&(me(vi),me(ni),ti+=Ai,Ai=ni=0),ni||(ti+=128,ni=Me(ti));const ji=wi.length+7&-8;let Ji=ni;ji>=ti&&(Ai=ji,Ji=vi=Me(ji));for(let Ki=0;Ki<wi.length;Ki++)te[Ji+Ki]=wi[Ki];return Ji}})();return ue(),_t(),{memory:Tt,_free:me,_malloc:Me,Mesh:class{constructor(){this.ptr=ke()}destroy(){Be(this.ptr)}},Decoder:class{constructor(){this.ptr=$e()}destroy(){dt(this.ptr)}DecodeArrayToMesh(ni,ti,Ai){const vi=mi(ni),wi=qe(this.ptr,vi,ti,Ai.ptr);return!!He(wi)}GetAttributeByUniqueId(ni,ti){return{ptr:st(this.ptr,ni.ptr,ti)}}GetTrianglesUInt16Array(ni,ti,Ai){We(this.ptr,ni.ptr,ti,Ai)}GetTrianglesUInt32Array(ni,ti,Ai){ct(this.ptr,ni.ptr,ti,Ai)}GetAttributeDataArrayForAllPoints(ni,ti,Ai,vi,wi){ft(this.ptr,ni.ptr,ti.ptr,Ai,vi,wi)}},DT_INT8:Ct(),DT_UINT8:vt(),DT_INT16:qt(),DT_UINT16:ei(),DT_UINT32:Gt(),DT_FLOAT32:yi()}})}(fetch(Dy())),Wu.then(K=>{va=K,Wu=void 0}))}()),ne&&W.push(function(){if(ym)return;const K=function(te){let ae;const ue=WebAssembly.instantiateStreaming(te,{}).then(we=>{ae=we.instance,ae.exports.__wasm_call_ctors()}),de={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},xe={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:ue,supported:!0,decodeGltfBuffer(we,me,Me,ke,Be,He){(function($e,qe,st,We,ct,ft,dt){const _t=$e.exports.sbrk,Tt=We+3&-4,Ct=_t(Tt*ct),vt=_t(ft.length),qt=new Uint8Array($e.exports.memory.buffer);qt.set(ft,vt);const ei=qe(Ct,We,ct,vt,ft.length);if(ei===0&&dt&&dt(Ct,Tt,ct),st.set(qt.subarray(Ct,Ct+We*ct)),_t(Ct-_t(0)),ei!==0)throw new Error(`Malformed buffer data: ${ei}`)})(ae,ae.exports[xe[Be]],we,me,Me,ke,ae.exports[de[He]])}}}(fetch(ky()));return K.ready.then(()=>{ym=K})}()),R)for(let K=0;K<R.length;K++)W.push(Bx(R[K],y,K,r));return(W.length?Promise.all(W):Promise.resolve()).then(()=>{if(ee&&j)for(const{primitives:K}of j)for(const te of K)Lx(te,y);if(ne&&j&&Q)for(const K of Q)Fx(K,y);return y})})}function jl(h,e){const r=h.json.bufferViews[e.bufferView],y=Ip[e.componentType];return new y(h.buffers[r.buffer],(e.byteOffset||0)+(r.byteOffset||0),e.count*(r.byteStride&&r.byteStride!==Zu[e.type]*y.BYTES_PER_ELEMENT?r.byteStride/y.BYTES_PER_ELEMENT:Zu[e.type]))}function xm(h,e,r,y){const U=Ip[e.componentType],R=function(W){switch(W){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(U),j=h.json.bufferViews[e.bufferView],X=j.byteStride?j.byteStride/U.BYTES_PER_ELEMENT:Zu[e.type],Q=r.float32,se=Q.length/r.capacity;for(let W=0,ee=0;W<e.count*X;W+=X,ee+=se)for(let ne=0;ne<se;ne++)Q[ee+ne]=y[W+ne]*R;r._trim()}function Nx(h,e,r){const y=h.indices,U=h.attributes,R={};R.indexArray=new On;const j=e.json.accessors[y],X=j.count/3;R.indexArray.reserve(X);const Q=jl(e,j);for(let ne=0;ne<X;ne++)R.indexArray.emplaceBack(Q[3*ne],Q[3*ne+1],Q[3*ne+2]);R.indexArray._trim(),R.vertexArray=new Zs;const se=e.json.accessors[U.POSITION];R.vertexArray.reserve(se.count);const W=jl(e,se);for(let ne=0;ne<se.count;ne++)R.vertexArray.emplaceBack(W[3*ne],W[3*ne+1],W[3*ne+2]);if(R.vertexArray._trim(),R.aabb=new Pi(se.min,se.max),R.centroid=function(ne,K){const te=[0,0,0],ae=ne.length;if(ae>0){for(let ue=0;ue<ae;ue++){const de=3*ne[ue];te[0]+=K[de],te[1]+=K[de+1],te[2]+=K[de+2]}te[0]/=ae,te[1]/=ae,te[2]/=ae}return te}(Q,W),U.COLOR_0!==void 0){const ne=e.json.accessors[U.COLOR_0],K=Zu[ne.type],te=jl(e,ne);R.colorArray=K===3?new Zs:new to,R.colorArray.resize(ne.count),xm(e,ne,R.colorArray,te)}if(U.NORMAL!==void 0){R.normalArray=new Zs;const ne=e.json.accessors[U.NORMAL];R.normalArray.resize(ne.count);const K=jl(e,ne);xm(e,ne,R.normalArray,K)}if(U.TEXCOORD_0!==void 0&&r.length>0){R.texcoordArray=new Io;const ne=e.json.accessors[U.TEXCOORD_0];R.texcoordArray.resize(ne.count);const K=jl(e,ne);xm(e,ne,R.texcoordArray,K)}if(U._FEATURE_ID_RGBA4444!==void 0){const ne=e.json.accessors[U._FEATURE_ID_RGBA4444];e.json.extensionsUsed&&e.json.extensionsUsed.includes("EXT_meshopt_compression")&&(R.featureData=jl(e,ne))}U._FEATURE_RGBA4444!==void 0&&(R.featureData=new Uint32Array(jl(e,e.json.accessors[U._FEATURE_RGBA4444]).buffer));const ee=h.material;return R.material=function(ne,K){const{emissiveFactor:te=[0,0,0],alphaMode:ae="OPAQUE",alphaCutoff:ue=.5,normalTexture:de,occlusionTexture:xe,emissiveTexture:we,doubleSided:me}=ne,{baseColorFactor:Me=[1,1,1,1],metallicFactor:ke=1,roughnessFactor:Be=1,baseColorTexture:He,metallicRoughnessTexture:$e}=ne.pbrMetallicRoughness||{},qe=xe?K[xe.index]:void 0;if(xe&&xe.extensions&&xe.extensions.KHR_texture_transform&&qe){const st=xe.extensions.KHR_texture_transform;qe.offsetScale=[st.offset[0],st.offset[1],st.scale[0],st.scale[1]]}return{pbrMetallicRoughness:{baseColorFactor:new Sr(...Me),metallicFactor:ke,roughnessFactor:Be,baseColorTexture:He?K[He.index]:void 0,metallicRoughnessTexture:$e?K[$e.index]:void 0},doubleSided:me,emissiveFactor:te,alphaMode:ae,alphaCutoff:ue,normalTexture:de?K[de.index]:void 0,occlusionTexture:qe,emissionTexture:we?K[we.index]:void 0,defined:ne.defined===void 0}}(ee!==void 0?e.json.materials[ee]:{defined:!1},r),R}function Ny(h,e,r){const{matrix:y,rotation:U,translation:R,scale:j,mesh:X,extras:Q,children:se}=h,W={};if(W.matrix=y||pt.mat4.fromRotationTranslationScale([],U||[0,0,0,1],R||[0,0,0],j||[1,1,1]),X!==void 0){W.meshes=r[X];const ee=W.anchor=[0,0];for(const ne of W.meshes){const{min:K,max:te}=ne.aabb;ee[0]+=K[0]+te[0],ee[1]+=K[1]+te[1]}ee[0]=Math.floor(ee[0]/W.meshes.length/2),ee[1]=Math.floor(ee[1]/W.meshes.length/2)}if(Q&&(Q.id&&(W.id=Q.id),Q.lights&&(W.lights=function(ee){if(!ee.length)return[];const ne=function(de){const xe=atob(de),we=new Uint8Array(xe.length);for(let me=0;me<xe.length;me++)we[me]=xe.codePointAt(me);return we}
vendor: 9,262 bytes, line 273
273(ee),K=[],te=ne.length/24,ae=new Uint16Array(ne.buffer),ue=new Float32Array(ne.buffer);for(let de=0;de<te;de++){const xe=ae[2*de*6]/30,we=ae[2*de*6+1]/30,me=ae[2*de*6+10]/100,Me=ue[6*de+1],ke=ue[6*de+2],Be=ue[6*de+3],He=ue[6*de+4],$e=Be-Me,qe=He-ke,st=Math.hypot($e,qe);K.push({pos:[Me+.5*$e,ke+.5*qe,we],normal:[qe/st,-$e/st,0],width:st,height:xe,depth:me,points:[Me,ke,Be,He]})}return K}(Q.lights))),se){const ee=[];for(const ne of se)ee.push(Ny(e.json.nodes[ne],e,r));W.children=ee}return W}function Vx(h){if(h.vertices.length===0||h.indices.length===0)return null;const e=new wf(h.vertices,h.indices,8,256),[r,y]=[e.min.clone(),e.max.clone()];return{vertices:h.vertices,indices:h.indices,grid:e,min:r,max:y}}function Ux(h){if(!h.extras||!h.extras.ground)return null;const e=h.extras.ground;if(!e||!Array.isArray(e)||e.length===0)return null;const r=e[0];if(!r||!Array.isArray(r)||r.length===0)return null;const y=[];for(const j of r){if(!Array.isArray(j)||j.length!==2)continue;const X=j[0],Q=j[1];typeof X=="number"&&typeof Q=="number"&&y.push(new Ht(X,Q))}if(y.length<3)return null;y.length>1&&y[y.length-1].equals(y[0])&&y.pop();let U=0;for(let j=0;j<y.length;j++){const X=y[j],Q=y[(j+1)%y.length],se=y[(j+2)%y.length];U+=(X.x-Q.x)*(se.y-Q.y)-(se.x-Q.x)*(X.y-Q.y)}U>0&&y.reverse();const R=vu(y.flatMap(j=>[j.x,j.y]),[]);return R.length===0?null:{vertices:y,indices:R}}function jx(h,e){const r=[],y=[];let U=0;const R=[];for(const j of h){U=r.length;const X=j.vertexArray.float32,Q=j.indexArray.uint16;for(let se=0;se<j.vertexArray.length;se++)R[0]=X[3*se+0],R[1]=X[3*se+1],R[2]=X[3*se+2],pt.vec3.transformMat4(R,R,e),r.push(new Ht(R[0],R[1]));for(let se=0;se<3*j.indexArray.length;se++)y.push(Q[se]+U)}if(y.length%3!=0)return null;for(let j=0;j<y.length;j+=3){const X=r[y[j+0]],Q=r[y[j+1]],se=r[y[j+2]];(X.x-Q.x)*(se.y-Q.y)-(se.x-Q.x)*(X.y-Q.y)>0&&([y[j+1],y[j+2]]=[y[j+2],y[j+1]])}return{vertices:r,indices:y}}function Vy(h){const e=function(Q,se){const W=[],ee=WebGL2RenderingContext;if(Q.json.textures)for(const ne of Q.json.textures){const K={magFilter:ee.LINEAR,minFilter:ee.NEAREST,wrapS:ee.REPEAT,wrapT:ee.REPEAT};ne.sampler!==void 0&&Object.assign(K,Q.json.samplers[ne.sampler]),W.push({image:se[ne.source],sampler:K,uploaded:!1})}return W}(h,h.images),r=function(Q,se){const W=[];for(const ee of Q.json.meshes){const ne=[];for(const K of ee.primitives)ne.push(Nx(K,Q,se));W.push(ne)}return W}(h,e),{scenes:y,scene:U,nodes:R}=h.json,j=y?y[U||0].nodes:R,X=[];for(const Q of j)X.push(Ny(R[Q],h,r));return function(Q,se,W){const ee={},ne=new Set;for(let K=0;K<Q.length;K++){const te=W[se[K]];if(!te.extras)continue;const ae=te.extras["mapbox:footprint:version"],ue=te.extras["mapbox:footprint:id"];(ae||ue)&&ne.add(K),ae==="1.0.0"&&ue&&(ee[ue]=K)}for(let K=0;K<Q.length;K++){if(ne.has(K))continue;const te=Q[K],ae=W[se[K]];if(!ae.extras)continue;let ue=null;te.id in ee&&(ue=jx(Q[ee[te.id]].meshes,te.matrix)),ue||(ue=Ux(ae)),ue&&(te.footprint=Vx(ue))}if(ne.size>0){const K=Array.from(ne.values()).sort((te,ae)=>te-ae);for(let te=K.length-1;te>=0;te--)Q.splice(K[te],1)}}(X,j,h.json.nodes),X}function Gx(h){h.heightmap=new Float32Array(4096),h.heightmap.fill(-1);const e=h.vertexArray.float32,r=h.aabb.min[0]-1,y=h.aabb.min[1]-1,U=Nl/(h.aabb.max[0]-r+2),R=Nl/(h.aabb.max[1]-y+2);for(let j=0;j<e.length;j+=3){const X=e[j+2],Q=(e[j+0]-r)*U|0,se=(e[j+1]-y)*R|0;X>h.heightmap[se*Nl+Q]&&(h.heightmap[se*Nl+Q]=X)}}function qx(h,e){const r={};r.indexArray=new On,r.indexArray.reserve(4*h.length),r.vertexArray=new Zs,r.vertexArray.reserve(10*h.length),r.colorArray=new to,r.vertexArray.reserve(10*h.length);let y=0;for(const j of h){const X=Math.min(10,Math.max(4,1.3*j.height))*e,Q=[-j.normal[1],j.normal[0],0],se=Math.min(.29,.1*j.width/j.depth),W=j.width-2*j.depth*e*(se+.01),ee=pt.vec3.scaleAndAdd([],j.pos,Q,W/2),ne=pt.vec3.scaleAndAdd([],j.pos,Q,-W/2),K=[ee[0],ee[1],ee[2]+j.height],te=[ne[0],ne[1],ne[2]+j.height],ae=pt.vec3.scaleAndAdd([],j.normal,Q,se);pt.vec3.scale(ae,ae,X);const ue=pt.vec3.scaleAndAdd([],j.normal,Q,-se);pt.vec3.scale(ue,ue,X),pt.vec3.add(ae,ee,ae),pt.vec3.add(ue,ne,ue),ee[2]+=.1,ne[2]+=.1,r.vertexArray.emplaceBack(ae[0],ae[1],ae[2]),r.vertexArray.emplaceBack(ue[0],ue[1],ue[2]),r.vertexArray.emplaceBack(ee[0],ee[1],ee[2]),r.vertexArray.emplaceBack(ne[0],ne[1],ne[2]),r.vertexArray.emplaceBack(K[0],K[1],K[2]),r.vertexArray.emplaceBack(te[0],te[1],te[2]),r.vertexArray.emplaceBack(ee[0],ee[1],ee[2]),r.vertexArray.emplaceBack(ne[0],ne[1],ne[2]),r.vertexArray.emplaceBack(ae[0],ae[1],ae[2]),r.vertexArray.emplaceBack(ue[0],ue[1],ue[2]);const de=W/X/2;r.colorArray.emplaceBack(-de-se,-1,de,.8),r.colorArray.emplaceBack(de+se,-1,de,.8),r.colorArray.emplaceBack(-de,0,de,1.3),r.colorArray.emplaceBack(de,0,de,1.3),r.colorArray.emplaceBack(de+se,-.8,de,.7),r.colorArray.emplaceBack(de+se,-.8,de,.7),r.colorArray.emplaceBack(0,0,de,1.3),r.colorArray.emplaceBack(0,0,de,1.3),r.colorArray.emplaceBack(de+se,-1.2,de,.8),r.colorArray.emplaceBack(de+se,-1.2,de,.8),r.indexArray.emplaceBack(6+y,4+y,8+y),r.indexArray.emplaceBack(7+y,9+y,5+y),r.indexArray.emplaceBack(0+y,1+y,2+y),r.indexArray.emplaceBack(1+y,3+y,2+y),y+=10}const U={defined:!0,emissiveFactor:[0,0,0]},R={};return R.baseColorFactor=Sr.white,U.pbrMetallicRoughness=R,r.material=U,r.aabb=new Pi([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),r}class Uy{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){const y=e[r];this._stringToNumber[y]=r,this._numberToString[r]=y}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const $x=["id","tile","layer","source","sourceLayer","state"];class Qc{constructor(e,r,y,U,R){this.type="Feature",this._vectorTileFeature=e,this._z=r,this._x=y,this._y=U,this.properties=e.properties,this.id=R}clone(){const e=new Qc(this._vectorTileFeature,this._z,this._x,this._y,this.id);return this.state&&(e.state=Object.assign({},this.state)),this.layer&&(e.layer=Object.assign({},this.layer)),this.source&&(e.source=this.source),this.sourceLayer&&(e.sourceLayer=this.sourceLayer),e}get geometry(){return this._geometry===void 0&&(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 r of $x)this[r]!==void 0&&(e[r]=this[r]);return e}}class jy{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Ka(gi,16,0),this.featureIndexArray=new Cl,this.promoteId=r,this.is3DTile=!1,this.serializedLayersCache=new Map}insert(e,r,y,U,R,j=0,X=0){const Q=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(y,U,R,j);const se=this.grid;for(let W=0;W<r.length;W++){const ee=r[W],ne=[1/0,1/0,-1/0,-1/0];for(let K=0;K<ee.length;K++){const te=ee[K];ne[0]=Math.min(ne[0],te.x),ne[1]=Math.min(ne[1],te.y),ne[2]=Math.max(ne[2],te.x),ne[3]=Math.max(ne[3],te.y)}X!==0&&(ne[0]-=X,ne[1]-=X,ne[2]+=X,ne[3]+=X),ne[0]<gi&&ne[1]<gi&&ne[2]>=0&&ne[3]>=0&&se.insert(Q,ne[0],ne[1],ne[2],ne[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Nc.VectorTile(new ep(this.rawTileData)).layers,this.sourceLayerCoder=new Uy(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,r){const{tilespaceGeometry:y,transform:U,tileTransform:R,pixelPosMatrix:j,availableImages:X}=r;this.loadVTLayers(),this.serializedLayersCache.clear();const Q=y.bufferedTilespaceBounds,se=this.grid.query(Q.min.x,Q.min.y,Q.max.x,Q.max.y,(K,te,ae,ue)=>ht(y.bufferedTilespaceGeometry,K,te,ae,ue));se.sort(Hx);let W=null;U.elevation&&se.length>0&&(W=Hc.create(U.elevation,this.tileID));const ee={};let ne;for(let K=0;K<se.length;K++){const te=se[K];if(te===ne)continue;ne=te;const ae=this.featureIndexArray.get(te);let ue=null;this.is3DTile?this.loadMatchingModelFeature(ee,ae,e,y,U):this.loadMatchingFeature(ee,ae,e,X,(de,xe,we,me=0)=>(ue||(ue=he(de,this.tileID.canonical,R)),xe.queryIntersectsFeature(y,de,we,ue,this.z,U,j,W,me)))}return ee}loadMatchingFeature(e,r,y,U,R){const{featureIndex:j,bucketIndex:X,sourceLayerIndex:Q,layoutVertexArrayOffset:se}=r,W=this.bucketLayerIDs[X],ee=y.layers,ne=Object.keys(ee);if(ne.length&&!function(de,xe){for(let we=0;we<de.length;we++)if(xe.indexOf(de[we])>=0)return!0;return!1}(ne,W))return;const K=y.sourceCache,te=this.sourceLayerCoder.decode(Q),ae=this.vtLayers[te].feature(j),ue=this.getId(ae,te);for(let de=0;de<W.length;de++){const xe=W[de];if(!ee[xe])continue;const{styleLayer:we,targets:me}=ee[xe];let Me={};ue!==void 0&&(Me=K.getFeatureState(we.sourceLayer,ue));const ke=!R||R(ae,we,Me,se);if(!ke)continue;const Be=new Qc(ae,this.z,this.x,this.y,ue);Be.tile=this.tileID.canonical,Be.state=Me;let He=this.serializedLayersCache.get(xe);He||(He=we.serialize(),He.id=xe,this.serializedLayersCache.set(xe,He)),Be.source=He.source,Be.sourceLayer=He["source-layer"],Be.layer=ai({},He),Be.layer.paint=Gy(He.paint,we.paint,ae,Me,U),Be.layer.layout=Gy(He.layout,we.layout,ae,Me,U);let $e=!1;for(const qe of me){this.updateFeatureProperties(Be,qe);const{filter:st}=qe;if(st){if(ae.properties=Be.properties,st.needGeometry){const We=pe(ae,!0);
273if(!st.filter(new Nr(this.tileID.overscaledZ),We,this.tileID.canonical))continue}else if(!st.filter(new Nr(this.tileID.overscaledZ),ae))continue}$e=!0,qe.targetId&&this.addFeatureVariant(Be,qe)}$e&&this.appendToResult(e,xe,j,Be,ke)}}loadMatchingModelFeature(e,r,y,U,R){const j=this.bucketLayerIDs[0][0],X=y.layers;if(!X[j])return;const{styleLayer:Q,targets:se}=X[j];if(Q.type!=="model")return;const W=U.tile,ee=r.featureIndex,ne=W.getBucket(Q);if(!(ne&&ne instanceof wp))return;const K=function(He,$e,qe,st){const We=He.getNodesInfo()[$e];if(We.hiddenByReplacement||!We.node.meshes)return;let ct=Number.MAX_VALUE;const ft=We.node,dt=qe.tile,_t=st.calculatePosMatrix(dt.tileID.toUnwrapped(),st.worldSize),Tt=We.evaluatedScale;let Ct=0;st.elevation&&ft.elevation&&(Ct=ft.elevation*st.elevation.exaggeration()),pt.mat4.translate(_t,_t,[(ft.anchor?ft.anchor[0]:0)*(Tt[0]-1),(ft.anchor?ft.anchor[1]:0)*(Tt[1]-1),Ct]),pt.mat4.scale(_t,_t,Tt);const vt=qe.queryGeometry,qt=vt.isPointQuery()?vt.screenBounds:vt.screenGeometry,ei=function(yi){const mi=pt.mat4.multiply([],_t,yi.matrix);pt.mat4.multiply(mi,st.expandedFarZProjMatrix,mi);for(let ni=0;ni<yi.meshes.length;++ni){const ti=yi.meshes[ni];if(ni===yi.lightMeshIndex)continue;const Ai=U_(qt,st,mi,ti.aabb);Ai!=null&&(ct=Math.min(Ai,ct))}if(yi.children)for(const ni of yi.children)ei(ni)};if(ei(ft),ct===Number.MAX_VALUE)return;const Gt=new _r(0,0);return Q_(dt.tileID.canonical,Gt,We.node.anchor[0],We.node.anchor[1]),{intersectionZ:ct,position:Gt,feature:We.feature}}(ne,ee,U,R);if(!K)return;const{z:te,x:ae,y:ue}=W.tileID.canonical,{feature:de,intersectionZ:xe,position:we}=K;let me={};de.id!==void 0&&(me=y.sourceCache.getFeatureState(Q.sourceLayer,de.id));const Me=new Qc({},te,ae,ue,de.id);Me.tile=this.tileID.canonical,Me.state=me,Me.properties=de.properties,Me.geometry={type:"Point",coordinates:[we.lng,we.lat]};let ke=this.serializedLayersCache.get(j);ke||(ke=Q.serialize(),ke.id=j,this.serializedLayersCache.set(j,ke)),Me.source=ke.source,Me.s
273ourceLayer=ke["source-layer"],Me.layer=ai({},ke);let Be=!1;for(const He of se){this.updateFeatureProperties(Me,He);const{filter:$e}=He;if($e){if(de.properties=Me.properties,$e.needGeometry){if(!$e.filter(new Nr(this.tileID.overscaledZ),de,this.tileID.canonical))continue}else if(!$e.filter(new Nr(this.tileID.overscaledZ),de))continue}Be=!0,He.targetId&&this.addFeatureVariant(Me,He)}Be&&this.appendToResult(e,j,ee,Me,xe)}updateFeatureProperties(e,r,y){if(r.properties){const U={};for(const R in r.properties){const j=r.properties[R].evaluate({zoom:this.z},e._vectorTileFeature,e.state,e.tile,y);j!=null&&(U[R]=j)}e.properties=U}}addFeatureVariant(e,r,y){const U={target:r.target,namespace:r.namespace,uniqueFeatureID:r.uniqueFeatureID};r.properties&&(U.properties=e.properties),e.variants=e.variants||{},e.variants[r.targetId]=e.variants[r.targetId]||[],e.variants[r.targetId].push(U)}appendToResult(e,r,y,U,R){let j=e[r];j===void 0&&(j=e[r]=[]),j.push({featureIndex:y,feature:U,intersectionZ:R})}lookupSymbolFeatures(e,r,y,U,R){const j={};this.loadVTLayers();for(const X of e)this.loadMatchingFeature(j,{bucketIndex:r,sourceLayerIndex:y,featureIndex:X,layoutVertexArrayOffset:0},U,R);return j}loadFeature(e){const{featureIndex:r,sourceLayerIndex:y}=e;this.loadVTLayers();const U=this.sourceLayerCoder.decode(y),R=this.vtFeatures[U];if(R[r])return R[r];const j=this.vtLayers[U].feature(r);return R[r]=j,j}hasLayer(e){for(const r of this.bucketLayerIDs)for(const y of r)if(e===y)return!0;return!1}getId(e,r){let y=e.id;if(this.promoteId){const U=Array.isArray(this.promoteId)||typeof this.promoteId!="object"?this.promoteId:this.promoteId[r];if(U!=null)if(Array.isArray(U)){if(!this.promoteIdExpression){const R=wo(U);if(R.result!=="success"){const j=R.value.map(X=>`${X.key}: ${X.message}`).join(", ");return void zi(`Failed to create expression for promoteId: ${j}`)}this.promoteIdExpression=R.value}this.promoteIdExpression._evaluator||(this.promoteIdExpression._evaluator=new ch),y=this.promoteIdExpression.evaluate({zoom:0},e)}else y=e.properties[U];typeof y=="boolean"&&(y=Number(y))}return y}}function Gy(h,e,r,y,U){return er(h,(R,j)=>{const X=e instanceof Ao?e.get(j):null;return X&&X.evaluate?X.evaluate(r,y,U):X})}function Hx(h,e){return e-h}Ti(jy,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const qy=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class bm{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,y]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const U=y>>4;if(U!==1)throw new Error(`Got v${U} data when expected v1.`);const R=qy[15&y];if(!R)throw new Error("Unrecognized array type.");const[j]=new Uint16Array(e,2,1),[X]=new Uint32Array(e,4,1);return new bm(X,j,R,e)}constructor(e,r=64,y=Float64Array,U){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=y,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const R=qy.indexOf(this.ArrayType),j=2*e*this.ArrayType.BYTES_PER_ELEMENT,X=e*this.IndexArrayType.BYTES_PER_ELEMENT,Q=(8-X%8)%8;if(R<0)throw new Error(`Unexpected typed array class: ${y}.`);U&&U instanceof ArrayBuffer?(this.data=U,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+X+Q,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+j+X+Q),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+X+Q,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+R]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const y=this._pos>>1;return this.ids[y]=y,this.coords[this._pos++]=e,this.coords[this._pos++]=r,y}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return wm(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,y,U){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:R,coords:j,nodeSize:X}=this,Q=[0,R.length-1,0],se=[];for(;Q.length;){const W=Q.pop()||0,ee=Q.pop()||0,ne=Q.pop()||0;if(ee-ne<=X){for(let ue=ne;ue<=ee;ue++){const de=j[2*ue],xe=j[2*ue+1];de>=e&&de<=y&&xe>=r&&xe<=U&&se.push(R[ue])}continue}const K=ne+ee>>1,te=j[2*K],ae=j[2*K+1];te>=e&&te<=y&&ae>=r&&ae<=U&&se.push(R[K]),(W===0?e<=te:r<=ae)&&(Q.push(ne),Q.push(K-1),Q.push(1-W)),(W===0?y>=te:U>=ae)&&(Q.push(K+1),Q.push(ee),Q.push(1-W))}return se}within(e,r,y){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:U,coords:R,nodeSize:j}=this,X=[0,U.length-1,0],Q=[],se=y*y;for(;X.length;){const W=X.pop()||0,ee=X.pop()||0,ne=X.pop()||0;if(ee-ne<=j){for(let ue=ne;ue<=ee;ue++)Hy(R[2*ue],R[2*ue+1],e,r)<=se&&Q.push(U[ue]);continue}const K=ne+ee>>1,te=R[2*K],ae=R[2*K+1];Hy(te,ae,e,r)<=se&&Q.push(U[K]),(W===0?e-y<=te:r-y<=ae)&&(X.push(ne),X.push(K-1),X.push(1-W)),(W===0?e+y>=te:r+y>=ae)&&(X.push(K+1),X.push(ee),X.push(1-W))}return Q}}function wm(h,e,r,y,U,R){if(U-y<=r)return;const j=y+U>>1;$y(h,e,j,y,U,R),wm(h,e,r,y,j-1,1-R),wm(h,e,r,j+1,U,1-R)}function $y(h,e,r,y,U,R){for(;U>y;){if(U-y>600){const se=U-y+1,W=r-y+1,ee=Math.log(se),ne=.5*Math.exp(2*ee/3),K=.5*Math.sqrt(ee*ne*(se-ne)/se)*(W-se/2<0?-1:1);$y(h,e,r,Math.max(y,Math.floor(r-W*ne/se+K)),Math.min(U,Math.floor(r+(se-W)*ne/se+K)),R)}const j=e[2*r+R];let X=y,Q=U;for(Xu(h,e,y,r),e[2*U+R]>j&&Xu(h,e,y,U);X<Q;){for(Xu(h,e,X,Q),X++,Q--;e[2*X+R]<j;)X++;for(;e[2*Q+R]>j;)Q--}e[2*y+R]===j?Xu(h,e,y,Q):(Q++,Xu(h,e,Q,U)),Q<=r&&(y=Q+1),r<=Q&&(U=Q-1)}}function Xu(h,e,r,y){Sm(h,r,y),Sm(e,2*r,2*y),Sm(e,2*r+1,2*y+1)}function Sm(h,e,r){const y=h[e];h[e]=h[r],h[r]=y}function Hy(h,e,r,y){const U=h-r,R=e-y;return U*U+R*R}o.$=Yh,o.A=Un,o.B=2,o.C=Du,o.D=Wc,o.E=wa,o.F=n_,o.G=class extends xp{},o.H=Ls,o.I=dm,o.J=Xl,o.K=wd,o.L=pl,o.M=dl,o.N=fc,o.O=bo,o.P=Ht,o.Q=Sc,o.R=xr,o.S=vd,o.T=Kf,o.U=wo,o.V=xp,o.W=al,o.X=Xa,o.Y=fo,o.Z=os,o._=Es,o.a=function(h){return ln.API_CDN_URL_REGEX.test(h)},o.a$=Qc,o.a0=Oh,o.a1=gd,o.a2=function(h){const e=h.value;let r=[];if(!e)return r;const y=Ls(e);return y!=="string"?(r=r.concat([new xp(h.key,e,`string expected, "${y}" found`)]),r):(G_(e,!0)||(r=r.concat([new xp(h.key,e,`invalid url "${e}"`)])),r)},o.a3=Rt,o.a4=wc,o.a5=Wr,o.a6=oi,o.a7=class{constructor(h){this.specification=h}possiblyEvaluate(h,e){return mn(h.expression.evaluate(e))}interpolate(h,e,r){return{x:Bi(h.x,e.x,r),y:Bi(h.y,e.y,r),z:Bi(h.z,e.z,r),azimuthal:Bi(h.azimuthal,e.azimuthal,r),polar:Bi(h.polar,e.polar,r)}}},o.a8=Nr,o.a9=fl,o.aA=Os,o.aB=class{constructor(h){this.entries={}
273,this.scheduler=h}request(h,e,r,y){const U=this.entries[h]=this.entries[h]||{callbacks:[]};if(U.result){const[R,j]=U.result;return this.scheduler?this.scheduler.add(()=>{y(R,j)},e):y(R,j),()=>{}}return U.callbacks.push(y),U.cancel||(U.cancel=r((R,j)=>{U.result=[R,j];for(const X of U.callbacks)this.scheduler?this.scheduler.add(()=>{X(R,j)},e):X(R,j);setTimeout(()=>delete this.entries[h],3e3)})),()=>{U.result||(U.callbacks=U.callbacks.filter(R=>R!==y),U.callbacks.length||(U.cancel(),delete this.entries[h]))}}},o.aC=Ws,o.aD=function(h,e,r){const y=JSON.stringify(h.request);return h.data&&(this.deduped.entries[y]={result:[null,h.data]}),this.deduped.request(y,{type:"parseTile",isSymbolTile:h.isSymbolTile,zoom:h.tileZoom},U=>{const R=Pn(h.request,(j,X,Q,se)=>{j?U(j):X&&U(null,{vectorTile:r?void 0:new Nc.VectorTile(new ep(X)),rawData:X,cacheControl:Q,expires:se})});return()=>{R.cancel(),U()}},e)},o.aE=function(h){Di++,Di>Ft&&(h.getActor().send("enforceCacheSizeLimit",gt),Di=0)},o.aF=function(h){return h<=1?1:Math.pow(2,Math.floor(Math.log(h)/Math.LN2))},o.aG=ri,o.aH=I_,o.aI=F_,o.aJ=C_,o.aK=function(h,e){const r=document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(let y=0;y<h.length;y++){const U=document.createElement("source");ts(h[y])||(r.crossOrigin="Anonymous"),U.src=h[y],r.appendChild(U)}return{cancel:()=>{}}},o.aL=mp,o.aM=function(h){return fetch(h).then(e=>e.arrayBuffer()).then(e=>By(e,0,h))},o.aN=Vy,o.aO=class{constructor(h,e,r,y){this.id=h,this.position=e!=null?new _r(e[0],e[1]):new _r(0,0),this.orientation=r??[0,0,0],this.nodes=y,this.uploaded=!1,this.aabb=new Pi([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(h,e){if(pt.mat4.multiply(h.matrix,e,h.matrix),h.meshes)for(const r of h.meshes){const y=Pi.applyTransformFast(r.aabb,h.matrix
vendor: 4,383 bytes, line 273
273);this.aabb.encapsulate(y)}if(h.children)for(const r of h.children)this._applyTransformations(r,h.matrix)}computeBoundsAndApplyParent(){const h=pt.mat4.identity([]);for(const e of this.nodes)this._applyTransformations(e,h)}computeModelMatrix(h,e,r,y,U,R,j=!1){Z_(this.matrix,this,h.transform,this.position,e,r,y,U,R,j)}upload(h){if(!this.uploaded){for(const e of this.nodes)rm(e,h);for(const e of this.nodes)bp(e);this.uploaded=!0}}destroy(){for(const h of this.nodes)nm(h)}},o.aP=Ni,o.aQ=Ru,o.aR=fs,o.aS=Bn,o.aT=pa,o.aU=On,o.aV=di,o.aW=hu,o.aX=pp,o.aY=function(){_s.isLoading()||_s.isLoaded()||xc()!=="deferred"||yl()},o.aZ=Sd,o.a_=pe,o.aa=l,o.ab=pt,o.ac=bt,o.ad=Ao,o.ae=hs,o.af=Bi,o.ag=gi,o.ah=ed,o.ai=Xi,o.aj=Sr,o.ak=class{constructor(h){this.specification=h}possiblyEvaluate(h,e){return function([r,y]){const U=mn([1,r,y]);return{x:U.x,y:U.y,z:U.z}}(h.expression.evaluate(e))}interpolate(h,e,r){return{x:Bi(h.x,e.x,r),y:Bi(h.y,e.y,r),z:Bi(h.z,e.z,r)}}},o.al=function(h,e,r=0,y=!0){const U=new Ht(r,r),R=h.sub(U),j=e.add(U),X=[R,new Ht(j.x,R.y),j,new Ht(R.x,j.y)];return y&&X.push(R.clone()),X},o.am=function(h,e){const r=[];for(let y=0;y<h.length;y++){const U=It(y-1,-1,h.length-1),R=It(y+1,-1,h.length-1),j=h[y],X=h[R],Q=h[U].sub(j).unit(),se=X.sub(j).unit(),W=se.angleWithSep(Q.x,Q.y),ee=Q.add(se).unit().mult(-1*e/Math.sin(W/2));r.push(j.add(ee))}return r},o.an=m_,o.ao=ht,o.ap=function(h,e,r=0){return pt.vec3.fromValues(((e.x-r)*h.scale-h.x)*gi,(e.y*h.scale-h.y)*gi,jd(e.z,e.y))},o.aq=Hi,o.ar=zg,o.as=function(h){let e=1/0,r=1/0,y=-1/0,U=-1/0;for(const R of h)e=Math.min(e,R.x),r=Math.min(r,R.y),y=Math.max(y,R.x),U=Math.max(U,R.y);return{min:new Ht(e,r),max:new Ht(y,U)}},o.at=Js,o.au=Ke,o.av=G,o.aw=Ue,o.ax=rs,o.ay=function(h,e){const r={};for(let y=0;y<e.length;y++){const U=e[y];U in h&&(r[U]=h[U])}return r},o.az=za,o.b=function(h){return ln.API_FONTS_REGEX.test(h)},o.b$=yp,o.b0=Qn,o.b1=Df,o.b2=bf,o.b3=he,o.b4=da,o.b5=lu,o.b6=Ri,o.b7=an,o.b8=vu,o.b9=Xf,o.bA=dg,o.bB=Gf,o.bC=u_,o.bD=Vf,o.bE=bm,o.bF=It,o.bG=Ts,o.bH=ns,o.bI=function(h,e,r){h[4*e+0]=r[0],h[4*e+1]=r[1],h[4*e+2]=r[2],h[4*e+3]=r[3]},o.bJ=Ll,o.bK=Ps,o.bL=Do,o.bM=cn,o.bN=Rl,o.bO=_r,o.bP=x_,o.bQ=Xt,o.bR=fr,o.bS=B_,o.bT=Qt,o.bU=Zn,o.bV=function(h,e,r,y,U,R,j,X,Q){if(Q.name==="globe")return Zn(h,e,new Qt(r,y,U),!1);const se=Ru({z:r,x:y,y:U},Q);return new Pi([(R+se.x/se.scale)*e,e*(se.y/se.scale),j],[(R+se.x2/se.scale)*e,e*(se.y2/se.scale),X])},o.bW=function(h,e,r){let y=0;for(let U=0;U<2;++U)h[U]>0&&(y+=(h[U]-0)*(h[U]-0)),e[U]<0&&(y+=(0-e[U])*(0-e[U]));return y},o.bX=cs,o.bY=Vd,o.bZ=function(h){const e=pt.mat4.identity(new Float64Array(16));pt.mat4.multiply(e,h.pixelMatrix,h.globeMatrix);const r=[0,ys,0],y=[0,vs,0];return pt.vec3.transformMat4(r,r,e),pt.vec3.transformMat4(y,y,e),[r[0]>0&&r[0]<=h.width&&r[1]>0&&r[1]<=h.height&&!Is(h,new _r(h.center.lat,90)),y[0]>0&&y[0]<=h.width&&y[1]>0&&y[1]<=h.height&&!Is(h,new _r(h.center.lat,-90))]},o.b_=function(h,e){const{scale:r}=h.tileTransform,y=r*gi/(h.tileSize*Math.pow(2,e.zoom-h.tileID.overscaledZ+h.tileID.canonical.z));return pt.mat2.scale(new Float32Array(4),e.inverseAdjustmentMatrix,[y,y])},o.ba=function(h,e){const r=hs(e.zoom);if(r===0)return xn(h);const y=Xr(h),U=Or(y),R=Js(y.getWest())*e.worldSize,j=Js(y.getEast())*e.worldSize,X=Os(y.getNorth())*e.worldSize,Q=Os(y.getSouth())*e.worldSize,se=[R,X,0],W=[j,X,0],ee=[R,Q,0],ne=[j,Q,0],K=pt.mat4.invert([],e.globeMatrix);return pt.vec3.transformMat4(se,se,K),pt.vec3.transformMat4(W,W,K),pt.vec3.transformMat4(ee,ee,K),pt.vec3.transformMat4(ne,ne,K),U[0]=bn(U[0],ee,r),U[1]=bn(U[1],ne,r),U[2]=bn(U[2],W,r),U[3]=bn(U[3],se,r),Pi.fromPoints(U)},o.bb=In,o.bc=zr,o.bd=bn,o.be=Co,o.bf=Ci,o.bg=gm,o.bh=ep,o.bi=Pn,o.bj=function(h){const e=[];for(const r in h)e.push(h[r]);return e},o.bk=function(h,e){const r=[];for(const y in h)y in e||r.push(y);return r},o.bl=Yt,o.bm=["type","source","source-layer","minzoom","maxzoom","filter","layout"],o.bn=on,o.bo=function(h,e){const{x:r,y}=h.point,U=ms(r,y,h.worldSize/h._pixelsPerMercatorPixel,0,0);return pt.mat4.multiply(U,U,Fr(xn(e)))},o.bp=Vc,o.bq=Bs,o.br=Qd,o.bs=function(h,e,r,y,U){const R=5*e+2;h.float32[R+0]=r,h.float32[R+1]=y,h.float32[R+2]=U},o.bt=dp,o.bu=r_,o.bv=De,o.bw=Yn,o.bx=ag,o.by=j_,o.bz=ug,o.c=ra,o.c$=(h,e,r,y,U,R,j,X)=>{const Q=h.transform,se=Q.pitch<15?Lg(.07,.7,Ue((14-Q.zoom)/5,0,1)):.07,W=r.paint.get("line-trim-color-use-theme").
273constantOr("default")==="none";return{u_matrix:Og(h,e,r,y),u_texsize:e.imageAtlasTexture?e.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:Q.calculatePixelsToTileUnitsMatrix(e),u_device_pixel_ratio:U,u_width_scale:R,u_floor_width_scale:j,u_image:0,u_tile_units_to_pixels:Fg(e,Q),u_units_to_pixels:[1/Q.pixelsToGLUnits[0],1/Q.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:X,u_trim_fade_range:r.paint.get("line-trim-fade-range"),u_trim_color:r.paint.get("line-trim-color").toRenderColor(W?null:r.lut).toArray01(),u_emissive_strength:r.paint.get("line-emissive-strength"),u_zbias_factor:se,u_tile_to_meter:t(e.tileID.canonical,0)}},o.c0=O_,o.c1=function(h){const e=O_(h,!0);return pt.mat2.invert([],[e[0],e[1],e[4],e[5]])},o.c2=cr,o.c3=function(h){const{x:e,y:r}=h.point,{lng:y,lat:U}=h._center;return ms(e,r,h.worldSize,y,U)},o.c4=Gr,o.c5=ci,o.c6=ko,o.c7=function(h){const e=Math.round((h+45+360)%360/90)%4;return Hr[e]},o.c8=45,o.c9=Fc,o.cA=class extends Ys{constructor(h){super(h),this.current=du}set(h,e,r){if(this.fetchUniformLocation(h,e)){for(let y=0;y<9;y++)if(r[y]!==this.current[y]){this.current=r,this.gl.uniformMatrix3fv(this.location,!1,r);break}}}},o.cB=Rn,o.cC=function(h,e,r){const y=hs(r.zoom),U=h.style.map._antialias,R=h.terrain&&h.terrain.exaggeration()>0;return y===0&&!U&&!R},o.cD=function(h){const e=h.pixelsPerMeter,r=e/ns(1,h.center.lat),y=pt.mat4.identity(new Float64Array(16));return pt.mat4.translate(y,y,[h.point.x,h.point.y,0]),pt.mat4.scale(y,y,[r,r,e]),Float32Array.from(y)},o.cE=Xr,o.cF=function(h){const e=cs-5;h=Ue(h,-80.051129,e)/e*90;const r=Math.pow(Math.abs(Math.sin(Xi(h))),3);return Math.round(r*(Lc.length-1))},o.cG=function(h,e,r,y){const U=e.getNorth(),R=e.getSouth(),j=e.getWest(),X=e.getEast(),Q=1<<h.z,se=X-j,W=U-R,ee=se/Ro,ne=-W/Lc[r],K=[0,ee,0,ne,0,0,U,j,0];if(h.z>0){const te=180/y;pt.mat3.multiply(K,K,[te/se+1,0,0,0,te/W+1,0,-.5*te/ee,.5*te/ne,1])}return K[2]=Q,K[5]=h.x,K[8]=h.y,K},o.cH=xn,o.cI=function(h,e,r){const y=pt.mat4.identity(new Float64Array(16)),U=(e/(1<<h)-.5)*Math.PI*2;return pt.mat4.rotateY(y,r.globeMatrix,U),Float32Array.from(y)},o.cJ=class{isDataAvailableAtPoint(h){const e=this._source();if(this.isUsingMockSource()||!e||h.y<0||h.y>1)return!1;const r=e.getSource().maxzoom,y=1<<r,U=Math.floor(h.x),R=Math.floor((h.x-U)*y),j=Math.floor(h.y*y),X=this.findDEMTileFor(new ri(r,U,r,R,j));return!(!X||!X.dem)}getAtPointOrZero(h,e=0){return this.getAtPoint(h,e)||0}getAtPoint(h,e,r=!0){if(this.isUsingMockSource())return null;e==null&&(e=null);const y=this._source();if(!y||h.y<0||h.y>1)return e;const U=y.getSource().maxzoom,R=1<<U,j=Math.floor(h.x),X=h.x-j,Q=new ri(U,j,U,Math.floor(X*R),Math.floor(h.y*R)),se=this.findDEMTileFor(Q);if(!se||!se.dem)return e;const W=se.dem,ee=1<<se.tileID.canonical.z,ne=(X*ee-se.tileID.canonical.x)*W.dim,K=(h.y*ee-se.tileID.canonical.y)*W.dim,te=Math.floor(ne),ae=Math.floor(K);return(r?this.exaggeration():1)*Bi(Bi(W.get(te,ae),W.get(te,ae+1),K-ae),Bi(W.get(te+1,ae),W.get(te+1,ae+1),K-ae),ne-te)}getAtTileOffset(h,e,r){const y=1<<h.canonical.z;return this.getAtPointOrZero(new l(h.wrap+(h.canonical.x+e/gi)/y,(h.canonical.y+r/gi)/y))}getAtTileOffsetFunc(h,e,r,y){return U=>{const R=this.getAtTileOffset(h,U.x,U.y),j=y.upVector(h.canonical,U.x,U.y),X=y.upVectorScale(h.canonical,e,r).metersToTile;return pt.vec3.scale(j,j,R*X),j}}getForTilePoints(h,e,r,y){if(this.isUsingMockSource())return!1;const U=Hc.create(this,h,y);return!!U&&(e.forEach(R=>{R[2]=this.exaggeration()*U.getElevationAt(R[0],R[1],r)}),!0)}getMinMaxForTile(h){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(h);if(!e||!e.dem)return null;const r=e.dem.tree,y=e.tileID,U=1<<h.canonical.z-y.canonical.z;let R=h.canonical.x/U-y.canonical.x,j=h.canonical.y/U-y.canonical.y,X=0;for(let Q=0;Q<h.canonical.z-y.canonical.z&&!r.leaves[X];Q++){R*=2,j*=2;const se=2*Math.floor(j)+Math.floor(R);X=r.childOffsets[X]+se,R%=1,j%=1}return{min:this.exaggeration()*r.minimums[X],max:this.exaggeration()*r.maximums[X]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(h,e,r){throw new Error("Pure virtual method called.")}pointCoordinate(h){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(h){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){const h=this.visibleDemTiles;if(h.length===0)return null;let e=!1,r=Number.MAX_VALUE,y=Number.MIN_VALUE;for(const U of h){const R=this.getMinMaxForTile(U.tileID);R&&(r=Math.min(r,R.min),y=Math.max(y,R.max),e=!0)}return e?{min:r,max:y}:null}},o.cK=Nm,o.cL=ar,o.cM=function(h,e){return[Math.pow(h[0],2.2)*e,Math.pow(h[1],2.2)*e,Math.pow(h[2],2.2)*e]},o.cN=Cs,o.cO=Oa,o.cP=ss,o.cQ=256,o.cR=function(h,e){const r=[0,0,0],y=In(xn(e.canonical));return pt.vec3.transformMat4(r,r,y),pt.vec3.transformMat4(r,r,h),r},o.cS=h=>
273({u_camera_to_center_distance:new cn(h),u_extrude_scale:new pu(h),u_device_pixel_ratio:new cn(h),u_matrix:new Ll(h),u_inv_rot_matrix:new Ll(h),u_merc_center:new Ps(h),u_tile_id:new Do(h),u_zoom_transition:new cn(h),u_up_dir:new Do(h),u_emissive_strength:new cn(h)}),o.cT=h=>({u_matrix:new Ll(h),u_pixels_to_tile_units:new pu(h),u_device_pixel_ratio:new cn(h),u_width_scale:new cn(h),u_floor_width_scale:new cn(h),u_units_to_pixels:new Ps(h),u_dash_image:new Rl(h),u_gradient_image:new Rl(h),u_image_height:new cn(h),u_texsize:new Ps(h),u_tile_units_to_pixels:new cn(h),u_alpha_discard_threshold:new cn(h),u_trim_offset:new Ps(h),u_trim_fade_range:new Ps(h),u_trim_color:new zl(h),u_emissive_strength:new cn(h),u_zbias_factor:new cn(h),u_tile_to_meter:new cn(h)}),o.cU=h=>({u_matrix:new Ll(h),u_texsize:new Ps(h),u_pixels_to_tile_units:new pu(h),u_device_pixel_ratio:new cn(h),u_width_scale:new cn(h),u_floor_width_scale:new cn(h),u_image:new Rl(h),u_units_to_pixels:new Ps(h),u_tile_units_to_pixels:new cn(h),u_alpha_discard_threshold:new cn(h
vendor: 2,387 bytes, line 273
273),u_trim_offset:new Ps(h),u_trim_fade_range:new Ps(h),u_trim_color:new zl(h),u_emissive_strength:new cn(h),u_zbias_factor:new cn(h),u_tile_to_meter:new cn(h)}),o.cV=ru,o.cW=X0,o.cX=Y0,o.cY=Fo,o.cZ=(h,e,r,y,U,R)=>{const j=h.transform,X=j.projection.name==="globe";let Q;if(R.paint.get("circle-pitch-alignment")==="map")if(X){const W=Cs(j.zoom,e.canonical)*j._pixelsPerMercatorPixel;Q=Float32Array.from([W,0,0,W])}else Q=j.calculatePixelsToTileUnitsMatrix(r);else Q=new Float32Array([j.pixelsToGLUnits[0],0,0,j.pixelsToGLUnits[1]]);const se={u_camera_to_center_distance:h.transform.getCameraToCenterDistance(j.projection),u_matrix:h.translatePosMatrix(e.projMatrix,r,R.paint.get("circle-translate"),R.paint.get("circle-translate-anchor")),u_device_pixel_ratio:tt.devicePixelRatio,u_extrude_scale:Q,u_inv_rot_matrix:lo,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:R.paint.get("circle-emissive-strength")};if(X){se.u_inv_rot_matrix=y,se.u_merc_center=U,se.u_tile_id=[e.canonical.x,e.canonical.y,1<<e.canonical.z],se.u_zoom_transition=hs(j.zoom);const W=U[0]*gi,ee=U[1]*gi;se.u_up_dir=j.projection.upVector(new Qt(0,0,0),W,ee)}return se},o.c_=Bg,o.ca=zl,o.cb=function(h,e,r){const y=Math.sqrt(h*h+e*e+r*r),U=y>0?Math.acos(r/y)*Kn:0;let R=h!==0||e!==0?Math.atan2(-e,-h)*Kn+90:0;return R<0&&(R+=360),[y,R,U]},o.cc=t,o.cd=Pi,o.ce=mn,o.cf=function(h){return[Math.pow(h[0],1/2.2),Math.pow(h[1],1/2.2),Math.pow(h[2],1/2.2)]},o.cg=function(h,e){return h.readFields(jv,{icons:[]},e)},o.ch=function(h){return h({pluginStatus:ds,pluginURL:Pa}),So.on("pluginStateChange",h),h},o.ci=Sp,o.cj=jc,o.ck=Uf,o.cl=Us,o.cm=Wh,o.cn=mt,o.co=Rs,o.cp=or,o.cq=function(h){const e=h.indexOf(Ec);return e>=0?h.slice(0,e):h},o.cr=function(h){return h.indexOf(Ec)>=0},o.cs=function(h){const e=h.indexOf(Ec);return e>=0?h.slice(e+1):""},o.ct=function(h){const e=[],r=h.id;return r===void 0&&e.push({message:`layers.${r}: missing required property "id"`}),h.render===void 0&&e.push({message:`layers.${r}: missing required method "render"`}),h.renderingMode&&h.renderingMode!=="2d"&&h.renderingMode!=="3d"&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},o.cu=function(h,e,r,y){return h.type==="custom"?new Pv(h,e):new Nv[h.type](h,e,r,y)},o.cv=yr,o.cw=class extends Qc{constructor(h,e){super(h._vectorTileFeature,h._z,h._x,h._y,h.id
273),h.state&&(this.state=Object.assign({},h.state)),this.target=e.target,this.namespace=e.namespace,e.properties&&(this.properties=e.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=h.source,this.sourceLayer=h.sourceLayer,this.layer=h.layer)}toJSON(){const h=super.toJSON();return h.target=this.target,h.namespace=this.namespace,h}},o.cx=So,o.cy=Tn,o.cz=Od,o.d=function(h){return ln.API_TILEJSON_REGEX.test(h)},o.d$=jy,o.d0=(h,e,r,y,U,R,j,X,Q)=>{const se=h.transform,W=se.calculatePixelsToTileUnitsMatrix(e),ee=r.paint.get("line-trim-color-use-theme").constantOr("default")==="none",ne=se.pitch<15?Lg(.07,.7,Ue((14-se.zoom)/5,0,1)):.07;return{u_matrix:Og(h,e,r,y),u_pixels_to_tile_units:W,u_device_pixel_ratio:R,u_width_scale:j,u_floor_width_scale:X,u_units_to_pixels:[1/se.pixelsToGLUnits[0],1/se.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:U,u_texsize:Ng(r)&&e.lineAtlasTexture?e.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Fg(e,h.transform),u_alpha_discard_threshold:0,u_trim_offset:Q,u_trim_fade_range:r.paint.get("line-trim-fade-range"),u_trim_color:r.paint.get("line-trim-color").toRenderColor(ee?null:r.lut).toArray01(),u_emissive_strength:r.paint.get("line-emissive-strength"),u_zbias_factor:ne,u_tile_to_meter:t(e.tileID.canonical,0)}},o.d1=Gi,o.d2=yu,o.d3=Eg,o.d4=xi,o.d5=Kd,o.d6=Bo,o.d7=450,o.d8=7,o.d9=Mv,o.dA=Le,o.dB=F,o.dC=so,o.dD=function([h,e,r]){const y=Math.hypot(h,e,r),U=Math.atan2(h,r),R=.5*Math.PI-Math.acos(-e/y);return new _r(Gr(U),Gr(R))},o.dE=em,o.dF=function(h){const e=h.navigator?h.navigator.userAgent:null;return!!function(r){if(es==null){const y=r.navigator?r.navigator.userAgent:null;es=!!r.safari||!(!y||!(/\b(iPad|iPhone|iPod)\b/.test(y)||y.match("Safari")&&!y.match("Chrome")))}return es}(h)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},o.dG=function(h,e){gt=h,Ft=e},o.dH=Is,o.dI=Ks,o.dJ=function(h){const e=[0,0,0],r=pt.mat4.identity(new Float64Array(16));return pt.mat4.multiply(r,h.pixelMatrix,h.globeMatrix),pt.vec3.transformMat4(e,e,r),new Ht(e[0],e[1])},o.dK=function(h,e,r=!1){if(ds===_l||ds===vc||ds===Hh)throw new Error("setRTLTextPlugin cannot be called multiple times.");Pa=tt.resolveURL(h),ds=_l,Hs=e,Zh(),r||yl()},o.dL=xc,o.dM=function(){Sp().acquire(am)},o.dN=function(){const h=Uu;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(am),Uu=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()"))},o.dO=Ul,o.dP=function(h){const e=ui();if(!e)return;const r=e.delete(Pt);h&&r.catch(h).then(()=>h())},o.dQ=Vu,o.dR=Dy,o.dS=function(h){_m=tt.resolveURL(h),Kc||(Kc=new Wc(Sp(),new wa)),Kc.broadcast("setDracoUrl",_m)},o.dT=ky,o.dU=function(h){Jc=tt.resolveURL(h),Kc||(Kc=new Wc(Sp(),new wa)),Kc.broadcast("setMeshoptUrl",Jc)},o.dV=Ti,o.dW=Oo,o.dX=ga,o.dY=Nc,o.dZ=class{constructor(h,e){this.pos=h,this.dir=e}intersectsPlane(h,e,r){const y=pt.vec2.dot(e,this.dir);if(Math.abs(y)<1e-6)return!1;const U=((h[0]-this.pos[0])*e[0]+(h[1]-this.pos[1])*e[1])/y;return r[0]=this.pos[0]+this.dir[0]*U,r[1]=this.pos[1]+this.dir[1]*U,!0}},o.d_=Uy,o.da=Tr,o.db=cu,o.dc=256,o.dd=Fr,o.de=Zs,o.df=Da,o.dg=Cc,o.dh=function(h,e,r,y,U){return Ue((h-e)/(r-e)*(U-y)+y,y,U)},o.di=dc,o.dj=Lo,o.dk=class{constructor(h,e,r,y){this.context=h,this.format=y,this.size=r,this.texture=h.gl.createTexture();const[U,R,j]=this.size,{gl:X}=h;X.bindTexture(X.TEXTURE_3D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(!1),X.texImage3D(X.TEXTURE_3D,0,this.format,U,R,j,0,Yf(this.format),Jf(this.format),e.data)}bind(h,e){const{context:r}=this,{gl:y}=r;y.bindTexture(y.TEXTURE_3D,this.texture),h!==this.minFilter&&(y.texParameteri(y.TEXTURE_3D,y.TEXTURE_MAG_FILTER,h),y.texParameteri(y.TEXTURE_3D,y.TEXTURE_MIN_FILTER,h),this.minFilter=h),e!==this.wrapS&&(y.texParameteri(y.TEXTURE_3D,y.TEXTURE_WRAP_S,e),y.texParameteri(y.TEXTURE_3D,y.TEXTURE_WRAP_T,e),this.wrapS=e)}destroy(){const{gl:h}=this.context;h.deleteTexture(this.texture),this.texture=null}},o.dl=tm,o.dm=[1,1,1],o.dn=Hc,o.dp=$c,o.dq=Ia,o.dr=Io,o.ds=ao,o.dt=Ic,o.du=Xs,o.dv=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new Ht(1/0,1/0),max:new Ht(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(h,e=!1){const r=lg(new Ht(0,0),new Ht(gi,gi),h),y=[];if(e&&!Af(r,this._globalClipBounds))return y;for(const U of this._activeRegions){if(U.hiddenByOverlap||!Af(r,U))continue;const R=w0(U.min,U.max,h);y.push({min:R.min,max:R.max,sourceId:this._sourceIds[U.priority],footprint:U.footprint,footprintTileId:U.tileId,order:U.order,clipMask:U.clipMask,clipScope:U.clipScope})}return y}setSources(h){this._setSources(h.map(e=>({getSourceId:()=>e.cache.id,getFootprints:()=>{const r=[];for(const y of e.cache.getVisibleCoordinates()){const U=e.cache.getTile(y).buckets[e.layer];U&&U.updateFootprints(y.toUnwrapped(),r)}return r},getOrder:()=>e.order,getClipMask:()=>e.clipMask,getClipScope:()=>e.clipScope})))}_addSource(h){const e=h.getFootprints();if(e.length===0)return;const r=h.getOrder(),y=h.getClipMask(),U=h.getClipScope();for(const R of e){if(!R.footprint)continue;const j=lg(R.footprint.min,R.footprint.max,R.id);this._activeRegions.push({min:j.min,max:j.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:R.id,footprint:R.footprint,order:r,clipMask:y,clipScope:U})}this._sourceIds.push(h.getSourceId())}_computeReplacement(){this._activeRegions.sort((e,r)=>e.priority-r.priority||Yd(e.min,r.min)||Yd(e.max,r.max)||e.order-r.order||e.clipMask-r.clipMask||function(y,U){const R=(j,X)=>j+X;return y.length-U.length||y.reduce(R,"").localeCompare(U.reduce(R,""))}(e.clipScope,r.clipScope));let h=this._activeRegions.length!==this._prevRegions.length;
vendor: 6,147 bytes, line 273
273if(!h){let e=0;for(;!h&&e!==this._activeRegions.length;){const r=this._activeRegions[e],y=this._prevRegions[e];h=r.priority!==y.priority||!og(r,y)||r.order!==y.order||r.clipMask!==y.clipMask||!on(r.clipScope,y.clipScope),++e}}if(h){++this._updateTime;for(const r of this._activeRegions)r.order!==Xd&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,r.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,r.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,r.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,r.max.y));const e=r=>{const y=this._activeRegions;if(r>=y.length)return r;const U=y[r].priority;for(;r<y.length&&y[r].priority===U;)++r;return r};if(this._sourceIds.length>1){let r=0,y=e(r);for(;r!==y;){let U=r;const R=r;for(;U!==y;){const j=this._activeRegions[U];j.hiddenByOverlap=!1;for(let X=0;X<R;X++){const Q=this._activeRegions[X];if(!Q.hiddenByOverlap&&j.order===Xd&&Af(j,Q)&&(j.hiddenByOverlap=hg(j.footprint,j.tileId,Q.footprint,Q.tileId),j.hiddenByOverlap))break}++U}r=y,y=e(r)}}}}_setSources(h){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let e=h.length-1;e>=0;e--)this._addSource(h[e]);this._computeReplacement()}},o.dw=class{constructor(h){this._createGrid(h),this._createPoles(h)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const h of this._poleSegments)h.destroy();for(const h of this._gridSegments)h.withSkirts.destroy(),h.withoutSkirts.destroy()}_fillGridMeshWithLods(h,e){const r=new da,y=new On,U=[],R=h+1+2,j=e[0]+1,X=e[0]+1+(1+e.length),Q=(se,W,ee)=>{let ne=se===R-1?se-2:se===0?se:se-1;return ne+=ee?24575:0,[ne,W]};for(let se=0;se<R;++se)r.emplaceBack(...Q(se,0,!0));for(let se=0;se<j;++se)for(let W=0;W<R;++W)r.emplaceBack(...Q(W,se,(W===0||W===R-1)&&!0));for(let se=0;se<e.length;++se){const W=e[se];for(let ee=0;ee<R;++ee)r.emplaceBack(...Q(ee,W,!0))}for(let se=0;se<e.length;++se){const W=y.length,ee=e[se]+1+2,ne=new On;for(let ae=0;ae<ee-1;ae++){const ue=ae===ee-2,de=ue?R*(X-e.length+se-ae):R;for(let xe=0;xe<R-1;xe++){const we=ae*R+xe;ae===0||ue||xe===0||xe===R-2?(ne.emplaceBack(we+1,we,we+de),ne.emplaceBack(we+de,we+de+1,we+1)):(y.emplaceBack(we+1,we,we+de),y.emplaceBack(we+de,we+de+1,we+1))}}const K=an.simpleSegment(0,W,r.length,y.length-W);for(let ae=0;ae<ne.uint16.length;ae+=3)y.emplaceBack(ne.uint16[ae],ne.uint16[ae+1],ne.uint16[ae+2]);const te=an.simpleSegment(0,W,r.length,y.length-W);U.push({withoutSkirts:K,withSkirts:te})}return{vertices:r,indices:y,segments:U}}_createGrid(h){const e=this._fillGridMeshWithLods(Ro,Lc);this._gridSegments=e.segments,this._gridBuffer=h.createVertexBuffer(e.vertices,Ri.members),this._gridIndexBuffer=h.createIndexBuffer(e.indices,!0)}_createPoles(h){const e=new On;for(let j=0;j<=Ro;j++)e.emplaceBack(0,j+1,j+2);this._poleIndexBuffer=h.createIndexBuffer(e,!0);const r=new Da,y=new Da,U=new Da,R=new Da;this._poleSegments=[];for(let j=0,X=0;j<ko;j++){const Q=360/(1<<j);r.emplaceBack(0,-rs,0,.5,0),y.emplaceBack(0,-rs,0,.5,1),U.emplaceBack(0,-rs,0,.5,.5),R.emplaceBack(0,-rs,0,.5,.5);for(let se=0;se<=Ro;se++){let W=se/Ro,ee=0;const ne=Bi(0,Q,W),[K,te,ae]=zo(oo,Qs,ne,rs);r.emplaceBack(K,te,ae,W,ee),y.emplaceBack(K,te,ae,W,1-ee);const ue=Xi(ne);W=.5+.5*Math.sin(ue),ee=.5+.5*Math.cos(ue),U.emplaceBack(K,te,ae,W,ee),R.emplaceBack(K,te,ae,W,1-ee)}this._poleSegments.push(an.simpleSegment(X,0,66,64)),X+=66}this._poleNorthVertexBuffer=h.createVertexBuffer(r,Vi,!1),this._poleSouthVertexBuffer=h.createVertexBuffer(y,Vi,!1),this._texturedPoleNorthVertexBuffer=h.createVertexBuffer(U,Vi,!1),this._texturedPoleSouthVertexBuffer=h.createVertexBuffer(R,Vi,!1)}getGridBuffers(h,e){return[this._gridBuffer,this._gridIndexBuffer,e?this._gridSegments[h].withSkirts:this._gridSegments[h].withoutSkirts]}getPoleBuffers(h,e){return[e?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,e?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[h]]}},o.dx=Xd,o.dy=Nn,o.dz=function(){return!!document.fullscreenElement||!!document.webkitFullscreenElement},o.e=ln,o.e0=Dg,o.e1=er,o.e2=$s,o.e3=s_,o.e4=function(h,e,r,y,U,R,j,X,Q,se,W=1,ee,ne){h.createArrays(),h.tilePixelRatio=gi/(512*h.overscaling),h.compareText={},h.iconsNeedLinear=!1;const K=h.layers[0].layout,te=h.layers[0]._unevaluatedLayout._values,ae={};ae.scaleFactor=W,ae.textSizeScaleRange=K.get("text-size-scale-range"),ae.iconSizeScaleRange=K.get("icon-size-scale-range");const[ue,de]=ae.textSizeScaleRange,[xe,we]=ae.iconSizeScaleRange;if(ae.textScaleFactor=Ue(ae.scaleFactor,ue,de),ae.iconScaleFactor=Ue(ae.scaleFactor,xe,we),h.textSizeData.kind==="composite"){const{minZoom:Be,maxZoom:He}=h.textSizeData;ae.compositeTextSizes=[te["text-size"].possiblyEvaluate(new Nr(Be),X),te["text-size"].possiblyEvaluate(new Nr(He),X)]}if(h.iconSizeData.kind==="composite"){const{minZoom:Be,maxZoom:He}=h.iconSizeData;ae.compositeIconSizes=[te["icon-size"].possiblyEvaluate(new Nr(Be),X),te["icon-size"].possiblyEvaluate(new Nr(He),X)]}ae.layoutTextSize=te["text-size"].possiblyEvaluate(new Nr(Q+1),X),ae.layoutIconSize=te["icon-size"].possiblyEvaluate(new Nr(Q+1),X),ae.textMaxSize=te["text-size"].possiblyEvaluate(new Nr(18),X);const me=K.get("text-rotation-alignment")==="map"&&K.get("symbol-placement")!=="point",Me=K.get("text-size");let ke=!1;for(const Be of h.features)if(Be.icon&&Be.icon.nameSecondary){ke=!0;break}for(const Be of h.features){const He=K.get("text-font").evaluate(Be,{},X).join(","),$e=Me.evaluate(Be,{},X)*ae.textScaleFactor,qe=ae.layoutTextSize.evaluate(Be,{},X)*ae.textScaleFactor,st=(ae.layoutIconSize.evaluate(Be,{},X),{horizontal:{},vertical:void 0}),We=Be.text;let ct,ft=[0,0];if(We){const Tt=We.toString(),Ct=K.get("text-letter-spacing").evaluate(Be,{},X)*Yn,vt=K.get("text-line-height").evaluate(Be,{},X)*Yn,qt=tf(Tt)?Ct:0,ei=K.get("text-anchor").evaluate(Be,{},X),Gt=K.get("text-variable-anchor");if(!Gt){const Ai=K.get("text-radial-offset").evaluate(Be,{},X);
273ft=Ai?u_(ei,[Ai*Yn,jf]):K.get("text-offset").evaluate(Be,{},X).map(vi=>vi*Yn)}let yi=me?"center":K.get("text-justify").evaluate(Be,{},X);const mi=K.get("symbol-placement")==="point",ni=mi?K.get("text-max-width").evaluate(Be,{},X)*Yn:1/0,ti=Ai=>{h.allowVerticalPlacement&&jh(Tt)&&(st.vertical=Nf(We,e,r,U,He,ni,vt,ei,Ai,qt,ft,Bs.vertical,!0,qe,$e))};if(!me&&Gt){const Ai=yi==="auto"?Gt.map(wi=>Gf(wi)):[yi];let vi=!1;for(let wi=0;wi<Ai.length;wi++){const ji=Ai[wi];if(!st.horizontal[ji])if(vi)st.horizontal[ji]=st.horizontal[0];else{const Ji=Nf(We,e,r,U,He,ni,vt,"center",ji,qt,ft,Bs.horizontal,!1,qe,$e);Ji&&(st.horizontal[ji]=Ji,vi=Ji.positionedLines.length===1)}}ti("left")}else{if(yi==="auto"&&(yi=Gf(ei)),mi||K.get("text-writing-mode").indexOf("horizontal")>=0||!jh(Tt)){const Ai=Nf(We,e,r,U,He,ni,vt,ei,yi,qt,ft,Bs.horizontal,!1,qe,$e);Ai&&(st.horizontal[yi]=Ai)}ti(mi?"left":yi)}}let dt=!1;if(Be.icon&&Be.icon.namePrimary){const Tt=zf(h.iconSizeData,te["icon-size"],X,h.zoom,Be)*ae.iconScaleFactor*ee,Ct=Be.icon.getPrimary().scaleSelf(Tt).serialize(),vt=y[Ct];vt&&(ct=ov(U[Ct],Be.icon.nameSecondary?U[Be.icon.getSecondary().scaleSelf(Tt).serialize()]:void 0,K.get("icon-offset").evaluate(Be,{},X),K.get("icon-anchor").evaluate(Be,{},X)),dt=vt.sdf,h.sdfIcons===void 0?h.sdfIcons=vt.sdf:h.sdfIcons!==vt.sdf&&zi("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(vt.pixelRatio!==h.pixelRatio||K.get("icon-rotate").constantOr(1)!==0)&&(h.iconsNeedLinear=!0))}const _t=p_(st.horizontal)||st.vertical;h.iconsInText||(h.iconsInText=!!_t&&_t.iconsInText),(_t||ct)&&fv(h,Be,st,ct,y,ae,qe,0,ft,dt,j,X,se,ne,ke)}R&&h.generateCollisionDebugBuffers(Q,h.collisionBoxArray,ae.textScaleFactor)},o.e5=Cp,o.e6=fn,o.e7=ig,o.e8=$g,o.e9=Te,o.ea=function(h){let e=0;if(new Uint32Array(h,0,1)[0]!==zy){const r=new Uint32Array(h,0,7),[,,y,U,R,j]=r;e=r.byteLength+U+R+j+R,(y!==h.byteLength||e>=h.byteLength)&&zi("Invalid b3dm header information.")}return By(h,e)},o.eb=function(h,e){const r=Vy(h);for(const y of r){for(const U of y.meshes)Gx(U);y.lights&&(y.lightMeshIndex=y.meshes.length,y.meshes.push(qx(y.lights,e)))}return r},o.ec=wp,o.ed=ey,o.ee=_s,o.ef=function(h){fi(),Ot!=null&&Ot.then(e=>{e.keys().then(r=>{for(let y=0;y<r.length-h;y++)e.delete(r[y])})})},o.f=function(h){return h.indexOf("mapbox:")===0},o.g=function(h,e){return Tn(ai(h,{method:"GET"}),e)},o.h=Ba,o.i=function(h){return ln.API_STYLE_REGEX.test(h)&&!ra(h)},o.j=function(h){return decodeURIComponent(atob(h).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))},o.k=function(h){return btoa(encodeURIComponent(h).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(+("0x"+r))))},o.l=ai,o.m=Fi,o.n=function(h,e){return Tn(ai(h,{type:"json"}),e)},o.o=eh,o.p=function(h,e){return Tn(ai(h,{method:"POST"}),e)},o.q=tt,o.r=Gn,o.s=function(h){try{const e=self[h];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch{return!1}},o.t=je,o.u=function(){return function h(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,h)}()},o.v=function(h){return!!h&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(h)},o.w=zi,o.x=function(){return om||(om=new Ul),om},o.y=Wl,o.z=Gs}),le(["./shared"],function(o){function Te(Lt){const Re=Lt?Lt.url.toString():void 0;return Re?performance.getEntriesByName(Re):[]}function Pe(Lt){if(typeof Lt=="number"||typeof Lt=="boolean"||typeof Lt=="string"||Lt==null)return JSON.stringify(Lt);if(Array.isArray(Lt)){let Ne="[";for(const je of Lt)Ne+=`${Pe(je)},`;return`${Ne}]`}let Re="{";for(const Ne of Object.keys(Lt).sort())Re+=`${Ne}:${Pe(Lt[Ne])},`;return`${Re}}`}function ve(Lt){let Re="";for(const Ne of o.bm)(Lt.type!=="model"||Ne!=="minzoom"&&Ne!=="maxzoom")&&(Re+=`/${Pe(Lt[Ne])}`);return Re}class Ae{constructor(Re){this.keyCache={},this._layers={},this._layerConfigs={},Re&&this.replace(Re)}replace(Re,Ne){this._layerConfigs={},this._layers={},this.update(Re,[],Ne)}update(Re,Ne,je){this._options=je;for(const ot of Re)this._layerConfigs[ot.id]=ot,(this._layers[ot.id]=o.cu(ot,this.scope,null,this._options)).compileFilter(je),this.keyCache[ot.id]&&delete this.keyCache[ot.id];for(const ot of Ne)delete this.keyCache[ot],delete this._layerConfigs[ot],delete this._layers[ot];this.familiesBySource={};const tt=function(ot,mt){const Pt={};for(let Ft=0;Ft<ot.length;
273Ft++){const zt=ot[Ft];let Ot=mt&&mt[zt.id];!Ot&&(Ot=ve(zt),zt.type==="line"&&zt.paint)&&function ui(fi){return typeof fi=="string"&&fi==="line-progress"||(Array.isArray(fi)?fi.some(ui):!(!fi||typeof fi!="object")&&Object.values(fi).some(ui))}(zt.paint["line-width"])&&(Ot+=`/${Pe(zt.paint["line-width"])}`),mt&&(mt[zt.id]=Ot);let Kt=Pt[Ot];Kt||(Kt=Pt[Ot]=[]),Kt.push(zt)}const gt=[];for(const Ft in Pt)gt.push(Pt[Ft]);return gt}(o.bj(this._layerConfigs),this.keyCache);for(const ot of tt){const mt=ot.map(Kt=>this._layers[Kt.id]),Pt=mt[0];if(Pt.visibility==="none")continue;const gt=Pt.source||"";let Ft=this.familiesBySource[gt];Ft||(Ft=this.familiesBySource[gt]={});const zt=Pt.sourceLayer||"_geojsonTileLayer";let Ot=Ft[zt];Ot||(Ot=Ft[zt]=[]),Ot.push(mt)}}}const Ee=1*o.dX;class Ie{constructor(Re){const Ne={},je=[];for(const Pt in Re){const gt=Re[Pt],Ft=Ne[Pt]={};for(const zt in gt.glyphs){const Ot=gt.glyphs[+zt];if(!Ot||Ot.bitmap.width===0||Ot.bitmap.height===0)continue;const Kt=Ot.metrics.localGlyph?Ee:1,ui={x:0,y:0,w:Ot.bitmap.width+2*Kt,h:Ot.bitmap.height+2*Kt};je.push(ui),Ft[zt]=ui}}const{w:tt,h:ot}=o.F(je),mt=new o.dW({width:tt||1,height:ot||1});for(const Pt in Re){const gt=Re[Pt];for(const Ft in gt.glyphs){const zt=gt.glyphs[+Ft];if(!zt||zt.bitmap.width===0||zt.bitmap.height===0)continue;const Ot=Ne[Pt][Ft],Kt=zt.metrics.localGlyph?Ee:1;o.dW.copy(zt.bitmap,mt,{x:0,y:0},{x:Ot.x+Kt,y:Ot.y+Kt},zt.bitmap)}}this.image=mt,this.positions=Ne}}o.dV(Ie,"GlyphAtlas");const ye="3d_elevation_id",ge="hd_road_elevation";class Se{constructor(){this._valid=!1}reset(Re){return this.feature=Re,this._valid=!0,this._geometry=Re.loadGeometry(),this._geometry.length!==0&&this._geometry[0].length!==0||(this._valid=!1),this}geometry(Re,Ne){return this._valid&&Re(Ne(this._geometry)),this}require(Re,Ne,je){return this.get(Re,!0,Ne,je)}optional(Re,Ne,je){return this.get(Re,!1,Ne,je)}success(){return this._valid}get(Re,Ne,je,tt){const ot=this.feature.properties.hasOwnProperty(Re)?+this.feature.properties[Re]:void 0;return this._valid&&ot!==void 0?je(tt?tt(ot):ot):Ne&&(this._valid=!1),this}}class Ce{constructor(Re,Ne){this.featureFunc=Re,this.vertexFunc=Ne}parseFeature(Re,Ne,je){return this.featureFunc(Re,Ne,je)}parseVertex(Re,Ne,je){return this.vertexFunc(Re,Ne,je)}}const Ve=new Ce((Lt,Re,Ne)=>Lt.reset(Re).require(ye,je=>{Ne.id=je}).optional("fixed_height_relative",je=>{Ne.constantHeight=je},et.decodeRelativeHeight).geometry(je=>{Ne.bounds=je},et.computeBounds).success(),(Lt,Re,Ne)=>Lt.reset(Re).require(ye,je=>{Ne.id=je}).require("elevation_idx",je=>{Ne.idx=je}).require("extent",je=>{Ne.extent=je}).require("height_relative",je=>{Ne.height=je},et.decodeRelativeHeight).geometry(je=>{Ne.position=je},et.getPoint).success()),at=new Ce((Lt,Re,Ne)=>Lt.reset(Re).require(ye,je=>{Ne.id=je}).optional("fixed_height",je=>{Ne.constantHeight=je},et.decodeMetricHeight).geometry(je=>{Ne.bounds=je},et.computeBounds).success(),(Lt,Re,Ne)=>Lt.reset(Re).require(ye,je=>{Ne.id=je}).require("elevation_idx",je=>{Ne.idx=je}).require("extent",je=>{Ne.extent=je}).require("height",je=>{Ne.height=je},et.decodeMetricHeight).geometry(je=>{Ne.position=je},et.getPoint).success());class et{static computeBounds(Re){const Ne=new o.P(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),je=new o.P(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const tt of Re[0])Ne.x>tt.x&&(Ne.x=tt.x),Ne.y>tt.y&&(Ne.y=tt.y),je.x<tt.x&&(je.x=tt.x),je.y<tt.y&&(je.y=tt.y);return{min:Ne,max:je}}static getPoint(Re){return o.ab.vec2.fromValues(Re[0][0].x,Re[0][0].y)}static decodeRelativeHeight(Re){return 1e-4*Re*5}static decodeMetricHeight(Re){return 1e-4*Re}static parse(Re){const Ne=[],je=[],tt=Re.length,ot=new Se;for(let Pt=0;Pt<tt;Pt++){const gt=Re.feature(Pt),Ft=gt.properties.hasOwnProperty("version")?String(gt.properties.version):void 0,zt=(mt=Ft)?mt==="1.0.1"?at:void 0:Ve;if(zt===void 0){o.w(`Unknown elevation feature version number ${Ft||"(unknown)"}`);continue}const Ot=gt.properties.hasOwnProperty("type")?gt.properties.type:void 0;if(Ot){if(o.dY.VectorTileFeature.types[gt.type]==="Point"&&Ot==="curve_point"){const Kt={};zt.parseVertex(ot,gt,Kt)&&Ne.push(Kt)}else if(o.dY.VectorTileFeature.types[gt.type]==="Polygon"&&Ot==="curve_meta"){const Kt={};zt.parseFeature(ot,gt,Kt)&&je.push(Kt)}}}var mt;return{vertices:Ne,features:je}}}class Mt{constructor(Re,Ne,je,tt,ot,mt){if(this.vertices=new Array,this.vertexProps=new Array,this.edges=new Array,this.edgeProps=new Array,this.id=Re,this.heightRange={min:je,max:je},this.safeArea=Ne,this.constantHeight=je,this.constantHeight==null&&(this.constantHeight!=null||tt.length!==0)){this.vertices=tt,this.edges=ot,this.edges=this.edges.filter(Pt=>Pt.a<this.vertices.length&&Pt.b<this.vertices.length&&!o.ab.vec2.exactEquals(this.vertices[Pt.a].position,this.vertices[Pt.b].position)),this.heightRange={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};for(const Pt of this.vertices)this.vertexProps.push({dir:o.ab.vec2.fromValues(0,0)}),this.heightRange.min=Math.min(this.heightRange.min,Pt.height),this.heightRange.max=Math.max(this.heightRange.max,Pt.height);for(const Pt of this.edges){const gt=this.vertices[Pt.a].position,Ft=this.vertices[Pt.b].position,zt=o.ab.vec2.subtract(o.ab.vec2.create(),Ft,gt),Ot=o.ab.vec2.length(zt),Kt=o.ab.vec2.scale(o.ab.vec2.create(),zt,1/Ot);this.edgeProps.push({vec:zt,dir:Kt,len:Ot});const ui=this.vertexProps[Pt.a].dir,fi=this.vertexProps[Pt.b].dir;o.ab.vec2.add(ui,ui,Kt),o.ab.vec2.add(fi,fi,Kt)}for(const Pt of this.vertexProps)Pt.dir[0]===0&&Pt.dir[1]===0||o.ab.vec2.normalize(Pt.dir,Pt.dir);this.tessellate(mt)}}pointElevation(Re){if(this.constantHeight!=null)return this.constantHeight;const Ne=this.getClosestEdge(Re);
273if(Ne==null)return 0;const[je,tt]=Ne;return(1-(ot=tt))*this.vertices[this.edges[je].a].height+ot*this.vertices[this.edges[je].b].height;var ot}getClosestEdge(Re){if(this.edges.length===0)return;let Ne=0,je=Number.POSITIVE_INFINITY,tt=0;const ot=o.ab.vec2.fromValues(Re.x,Re.y);for(let mt=0;mt<this.edges.length;mt++){const Pt=this.edges[mt],gt=this.edgeProps[mt].dir,Ft=new o.dZ(ot,this.edgeProps[mt].dir),zt=this.vertices[Pt.a].position,Ot=this.vertices[Pt.b].position,Kt=o.ab.vec2.create(),ui=o.ab.vec2.create(),fi=Ft.intersectsPlane(zt,this.vertexProps[Pt.a].dir,Kt),Di=Ft.intersectsPlane(Ot,this.vertexProps[Pt.b].dir,ui);if(!fi||!Di)continue;const Fi=o.ab.vec2.subtract(o.ab.vec2.create(),ui,Kt),Oi=o.ab.vec2.subtract(o.ab.vec2.create(),ot,Kt),Li=o.ab.vec2.dot(Fi,Fi),lr=Li>0?o.ab.vec2.dot(Oi,Fi)/Li:0,dr=o.aw(lr,0,1),tr=Math.abs((lr-dr)*this.edgeProps[mt].len),gr=o.ab.vec2.subtract(o.ab.vec2.create(),ot,zt),xr=tr+Math.abs(o.ab.vec2.dot(gr,o.ab.vec2.fromValues(gt[1],-gt[0])));xr<je&&(Ne=mt,je=xr,tt=dr)}return[Ne,tt]}tessellate(Re){for(let Ne=this.edges.length-1;Ne>=0;--Ne){const je=this.edges[Ne].a,tt=this.edges[Ne].b,{position:ot,height:mt,extent:Pt}=this.vertices[je],{position:gt,height:Ft,extent:zt}=this.vertices[tt],Ot=this.vertexProps[je].dir,Kt=this.vertexProps[tt].dir,ui=o.ab.vec3.fromValues(ot[0]/Re,ot[1]/Re,mt),fi=o.ab.vec3.fromValues(gt[0]/Re,gt[1]/Re,Ft),Di=o.ab.vec3.fromValues(Ot[1],-Ot[0],0);o.ab.vec3.scale(Di,Di,Pt);const Fi=o.ab.vec3.fromValues(Kt[1],-Kt[0],0);if(o.ab.vec3.scale(Fi,Fi,zt),this.distSqLines(o.ab.vec3.fromValues(ui[0]+.5*Di[0],ui[1]+.5*Di[1],ui[2]+.5*Di[2]),o.ab.vec3.fromValues(fi[0]-.5*Fi[0],fi[1]-.5*Fi[1],fi[2]-.5*Fi[2]),o.ab.vec3.fromValues(ui[0]-.5*Di[0],ui[1]-.5*Di[1],ui[2]-.5*Di[2]),o.ab.vec3.fromValues(fi[0]+.5*Fi[0],fi[1]+.5*Fi[1],fi[2]+.5*Fi[2]))<=.05*.05)continue;const Oi=this.vertices.length,Li=o.ab.vec2.add(o.ab.vec2.create(),ot,gt);this.vertices.push({position:o.ab.vec2.scale(Li,Li,.5),height:.5*(mt+Ft),extent:.5*(Pt+zt)});const lr=o.ab.vec2.add(o.ab.vec2.create(),Ot,Kt);this.vertexProps.push({dir:o.ab.vec2.normalize(lr,lr)}),this.edges.splice(Ne,1),this.edgeProps.splice(Ne,1),this.edges.push({a:je,b:Oi}),this.edges.push({a:Oi,b:tt});const dr=o.ab.vec2.subtract(o.ab.vec2.create(),this.vertices[Oi].position,ot),tr=o.ab.vec2.length(dr),gr={vec:dr,dir:o.ab.vec2.scale(o.ab.vec2.create(),dr,1/tr),len:tr};this.edgeProps.push(gr),this.edgeProps.push(gr)}}distSqLines(Re,Ne,je,tt){const ot=o.ab.vec3.subtract(o.ab.vec3.create(),Ne,Re),mt=o.ab.vec3.subtract(o.ab.vec3.create(),tt,je),Pt=o.ab.vec3.subtract(o.ab.vec3.create(),Re,je),gt=o.ab.vec3.dot(ot,ot),Ft=o.ab.vec3.dot(ot,mt),zt=o.ab.vec3.dot(ot,Pt),Ot=o.ab.vec3.dot(mt,mt),Kt=o.ab.vec3.dot(mt,Pt),ui=gt*Ot-Ft*Ft;if(ui===0){const Li=o.ab.vec3.dot(Pt,mt)/o.ab.vec3.dot(mt,mt),lr=o.ab.vec3.lerp(o.ab.vec3.create(),je,tt,Li);return o.ab.vec3.squaredDistance(lr,Re)}const fi=(Ft*Kt-zt*Ot)/ui,Di=(gt*Kt-Ft*zt)/ui,Fi=o.ab.vec3.lerp(o.ab.vec3.create(),Re,Ne,fi),Oi=o.ab.vec3.lerp(o.ab.vec3.create(),je,tt,Di);return o.ab.vec3.squaredDistance(Fi,Oi)}}class jt{static parseFrom(Re,Ne){const je=et.parse(Re);if(!je)return[];let{vertices:tt,features:ot}=je;const mt=1/o.cc(Ne);ot.sort((zt,Ot)=>zt.id-Ot.id),tt.sort((zt,Ot)=>zt.id-Ot.id||zt.idx-Ot.idx),tt=tt.filter((zt,Ot,Kt)=>Ot===Kt.findIndex(ui=>ui.id===zt.id&&ui.idx===zt.idx));const Pt=new Array;let gt=0;const Ft=tt.length;for(const zt of ot){if(zt.constantHeight){Pt.push(new Mt(zt.id,zt.bounds,zt.constantHeight));continue}for(;gt!==Ft&&tt[gt].id<zt.id;)gt++;if(gt===Ft||tt[gt].id!==zt.id)continue;const Ot=new Array,Kt=new Array,ui=gt;for(;gt!==Ft&&tt[gt].id===zt.id;){const fi=tt[gt];if(Ot.push({position:fi.position,height:fi.height,extent:fi.extent}),gt!==ui&&tt[gt-1].idx===fi.idx-1){const Di=gt-ui;Kt.push({a:Di-1,b:Di})}gt++}Pt.push(new Mt(zt.id,zt.bounds,void 0,Ot,Kt,mt))}return Pt}}o.dV(Mt,"ElevationFeature");class St{constructor(Re){this.tileID=new o.aG(Re.tileID.overscaledZ,Re.tileID.wrap,Re.tileID.canonical.z,Re.tileID.canonical.x,Re.tileID.canonical.y),this.tileZoom=Re.tileZoom,this.uid=Re.uid,this.zoom=Re.zoom,this.lut=Re.lut,this.canonical=Re.tileID.canonical,this.pixelRatio=Re.pixelRatio,this.tileSize=Re.tileSize,this.source=Re.source,this.scope=Re.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Re.showCollisionBoxes,this.collectResourceTiming=!!Re.request&&Re.request.collectResourceTiming,this.promoteId=Re.promoteId,this.isSymbolTile=Re.isSymbolTile,this.tileTransform=o.aQ(Re.tileID.canonical,Re.projection),this.projection=Re.projection,this.worldview=Re.w
273orldview,this.localizableLayerIds=Re.localizableLayerIds,this.brightness=Re.brightness,this.extraShadowCaster=!!Re.extraShadowCaster,this.tessellationStep=Re.tessellationStep,this.scaleFactor=Re.scaleFactor}parse(Re,Ne,je,tt,ot){this.status="parsing",this.data=Re,this.collisionBoxArray=new o.aW;const mt=new o.d_(Object.keys(Re.layers).sort()),Pt=new o.d$(this.tileID,this.promoteId);Pt.bucketLayerIDs=[];const gt={},Ft=new o.e0(256,256),zt={featureIndex:Pt,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:Ft,availableImages:je,brightness:this.brightness,scaleFactor:this.scaleFactor,elevationFeatures:void 0},Ot=Ne.familiesBySource[this.source];for(const Li in Ot){const lr=Re.layers[Li];if(!lr)continue;let dr=!1,tr=!1,gr=!1;for(const Tn of Ot[Li])Tn[0].type==="symbol"?dr=!0:tr=!0,Tn[0].is3D()&&Tn[0].type!=="model"&&(gr=!0);if(this.extraShadowCaster&&!gr||this.isSymbolTile===!0&&!dr||this.isSymbolTile===!1&&!tr)continue;lr.version===1&&o.w(`Vector tile source "${this.source}" layer "${Li}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const xr=mt.encode(Li),gn=[];let Us=!1;for(let Tn=0,Pn=0;Tn<lr.length;Tn++){const ts=lr.feature(Tn),$o=Pt.getId(ts,Li);if(this.localizableLayerIds&&this.localizableLayerIds.has(Li)){const na=ts.properties?ts.properties.worldview:null;if(this.worldview&&typeof na=="string")if(na==="all")ts.properties.$localized=!0;else{if(!na.split(",").includes(this.worldview))continue;ts.properties.$localized=!0,ts.properties.worldview=this.worldview}}!Us&&ts.properties&&ts.properties.hasOwnProperty(ye)&&(Us=!0),gn.push({feature:ts,id:$o,index:Pn,sourceLayerIndex:xr}),Pn++}Us&&Re.layers.hasOwnProperty(ge)&&(zt.elevationFeatures=jt.parseFrom(Re.layers[ge],this.canonical));for(const Tn of Ot[Li]){const Pn=Tn[0];(!this.extraShadowCaster||Pn.is3D()&&Pn.type!=="model")&&(this.isSymbolTile!==void 0&&Pn.type==="symbol"!==this.isSymbolTile||Pn.minzoom&&this.zoom<Math.floor(Pn.minzoom)||Pn.maxzoom&&this.zoom>=Pn.maxzoom||Pn.visibility!=="none"&&(Bt(Tn,this.zoom,zt.brightness,je),(gt[Pn.id]=Pn.createBucket({index:Pt.bucketLayerIDs.length,layers:Tn,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:xr,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep})).populate(gn,zt,this.tileID.canonical,this.tileTransform),Pt.bucketLayerIDs.push(Tn.map(ts=>o.aC(ts.id,ts.scope)))))}}let Kt,ui,fi,Di;Ft.trim();const Fi={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},Oi=()=>{if(Kt)return this.status="done",ot(Kt);if(this.extraShadowCaster)this.status="done",ot(null,{buckets:o.bj(gt).filter(Li=>!Li.isEmpty()),featureIndex:Pt,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:zt.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(ui&&fi&&Di){const Li=new Ie(ui),lr=new o.e3(fi,Di,this.lut);for(const dr in gt){const tr=gt[dr];tr instanceof o.aX?(Bt(tr.layers,this.zoom,zt.brightness,je),o.e4(tr,ui,Li.positions,fi,lr.iconPositions,this.showCollisionBoxes,je,this.tileID.canonical,this.tileZoom,this.projection,this.scaleFactor,this.pixelRatio,this.brightness)):tr.hasPattern&&(tr instanceof o.b1||tr instanceof o.b2||tr instanceof o.d5)&&(Bt(tr.layers,this.zoom,zt.brightness,je),tr.addFeatures(zt,this.tileID.canonical,lr.patternPositions,je,this.tileTransform,this.brightness))}this.status="done",ot(null,{buckets:o.bj(gt).filter(dr=>!dr.isEmpty()),featureIndex:Pt,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Li.image,lineAtlas:Ft,imageAtlas:lr,brightness:zt.brightness})}};if(!this.extraShadowCaster){const Li=o.e1(zt.glyphDependencies,tr=>Object.keys(tr).map(Number));Object.keys(Li).length?tt.send("getGlyphs",{uid:this.uid,stacks:Li,scope:this.scope},(tr,gr)=>{Kt||(Kt=tr,ui=gr,Oi())},void 0,!1,Fi):ui={};const lr=Object.keys(zt.iconDependencies);lr.length?tt.send("getImages",{icons:lr,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},(tr,gr)=>{if(Kt)return;Kt=tr;const xr={};Object.values(gr).some(gn=>gn.usvg)?this.rasterize(tt,xr,gr,zt.iconDependencies,()=>{fi=xr,Oi()}):(this.fillImageMap(xr,zt.iconDependencies,gr),fi=xr,Oi())},void 0,!1,Fi):fi={};const dr=Object.keys(zt.patternDependencies);dr.length?tt.send("getImages",{icons:dr,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},(tr,gr)=>{if(!Kt){Kt=tr;const xr={};Object.values(gr).some(gn=>gn.usvg)?this.rasterize(tt,xr,gr,zt.patternDependencies,()=>{Di=xr,Oi()}):(this.fillImageMap(xr,zt.patternDependencies,gr),Di=xr,Oi())}},void 0,!1,Fi):Di={}}Oi()}fillImageMap(Re,Ne,je){for(const tt in je){const ot=Ne[tt]||[];for(const mt of ot)je[mt.id].usvg||(Re[mt.serialize()]=je[mt.id])}}getImageTaskQueue(Re,Ne,je){const tt={};for(const ot in Ne){const mt=je[ot]||[];for(const Pt of mt){const gt=Pt.serialize();Ne[Pt.id].usvg?tt[gt]||(tt[gt]=Pt):Re[gt]=Ne[Pt.id]}}return tt}rasterize(Re,Ne,je,tt,ot){const mt=this.getImageTaskQueue(Ne,je,tt);this.rasterizeTask=Re.send("rasterizeImages",{scope:this.scope,imageTasks:mt},(Pt,gt)=>{if(!Pt)for(const Ft in gt){const{id:zt}=o.e2.deserializeFromString(Ft);Ne[Ft]=Object.assign({},je[zt],{data:gt[Ft]})}ot()})}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.cancel()}}function Bt(Lt,Re,Ne,je){const tt=new o.a8(Re,{brightness:Ne});for(const ot of Lt)ot.recalculate(tt,je)}class Zt extends o.E{constructor(Re,Ne,je,tt,ot,mt){super(),this.actor=Re,this.layerIndex=Ne,this.availableImages=je,this.loadVectorData=ot||o.aD,this.loading={},this.loaded={},this.deduped=new o.aB(Re.scheduler),this.isSpriteLoaded=tt,this.scheduler
273=Re.scheduler,this.brightness=mt}loadTile(Re,Ne){const je=Re.uid,tt=Re&&Re.request,ot=tt&&tt.collectResourceTiming,mt=this.loading[je]=new St(Re);mt.abort=this.loadVectorData(Re,(Pt,gt)=>{const Ft=!this.loading[je];if(delete this.loading[je],mt.cancelRasterize(),Ft||Pt||!gt)return mt.status="done",Ft||(this.loaded[je]=mt),Ne(Pt);const zt=gt.rawData,Ot={};gt.expires&&(Ot.expires=gt.expires),gt.cacheControl&&(Ot.cacheControl=gt.cacheControl),mt.vectorTile=gt.vectorTile||new o.dY.VectorTile(new o.bh(zt));const Kt=()=>{mt.parse(mt.vectorTile,this.layerIndex,this.availableImages,this.actor,(ui,fi)=>{if(ui||!fi)return Ne(ui);const Di={};if(ot){const Fi=Te(tt);Fi.length>0&&(Di.resourceTiming=JSON.parse(JSON.stringify(Fi)))}Ne(null,o.l({rawTileData:zt.slice(0)},fi,Ot,Di))})};this.isSpriteLoaded?Kt():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(Kt,{type:"parseTile",isSymbolTile:Re.isSymbolTile,zoom:Re.tileZoom}):Kt()}),this.loaded=this.loaded||{},this.loaded[je]=mt})}reloadTile(Re,Ne){const je=this.loaded,tt=Re.uid;if(je&&je[tt]){const ot=je[tt];ot.scaleFactor=Re.scaleFactor,ot.showCollisionBoxes=Re.showCollisionBoxes,ot.projection=Re.projection,ot.brightness=Re.brightness,ot.tileTransform=o.aQ(Re.tileID.canonical,Re.projection),ot.extraShadowCaster=Re.extraShadowCaster,ot.lut=Re.lut;const mt=(Pt,gt)=>{const Ft=ot.reloadCallback;Ft&&(delete ot.reloadCallback,ot.parse(ot.vectorTile,this.layerIndex,this.availableImages,this.actor,Ft)),Ne(Pt,gt)};ot.status==="parsing"?ot.reloadCallback=mt:ot.status==="done"&&(ot.vectorTile?ot.parse(ot.vectorTile,this.layerIndex,this.availableImages,this.actor,mt):mt())}else Ne(null,void 0)}abortTile(Re,Ne){const je=Re.uid,tt=this.loading[je];tt&&(tt.abort&&tt.abort(),delete this.loading[je]),Ne()}removeTile(Re,Ne){const je=this.loaded,tt=Re.uid;je&&je[tt]&&delete je[tt],Ne()}}class xt{loadTile(Re,Ne){const{uid:je,encoding:tt,rawImageData:ot,padding:mt}=Re,Pt=ImageBitmap&&ot instanceof ImageBitmap?this.getImageData(ot,mt):ot;Ne(null,new o.e5(je,Pt,tt,mt<1))}getImageData(Re,Ne){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(Re.width,Re.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=Re.width,this.offscreenCanvas.height=Re.height,this.offscreenCanvasContext.drawImage(Re,0,0,Re.width,Re.height);const je=this.offscreenCanvasContext.getImageData(-Ne,-Ne,Re.width+2*Ne,Re.height+2*Ne);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),je}}o.bg.setPbf(o.bh);class wt{decodeRasterArray({task:Re,buffer:Ne},je){o.bg.performDecoding(Ne,Re).then(tt=>{je(null,tt)},tt=>{je(tt)})}}const Je=o.dY.VectorTileFeature.prototype.toGeoJSON;class ut{constructor(Re){this._feature=Re,this.extent=o.ag,this.type=Re.type,this.properties=Re.tags,"id"in Re&&!isNaN(Re.id)&&(this.id=parseInt(Re.id,10))}loadGeometry(){if(this._feature.type===1){const Re=[];for(const Ne of this._feature.geometry)Re.push([new o.P(Ne[0],Ne[1])]);return Re}{const Re=[];for(const Ne of this._feature.geometry){const je=[];for(const tt of Ne)je.push(new o.P(tt[0],tt[1]));Re.push(je)}return Re}}toGeoJSON(Re,Ne,je){return Je.call(this,Re,Ne,je)}}class lt{constructor(Re){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.ag,this.length=Re.length,this._features=Re}feature(Re){return new ut(this._features[Re])}}const Ye=64/4096,pi=128;class si{constructor(){this.features=new Map}clear(){this.features.clear()}load(Re=[],Ne){for(const je of Re){const tt=je.id;if(tt==null)continue;let ot=this.features.get(tt);ot&&this.updateCache(ot,Ne),je.geometry?(ot=kt(je),this.updateCache(ot,Ne),this.features.set(tt,ot)):this.features.delete(tt),this.updateCache(ot,Ne)}}updateCache(Re,Ne){for(const{canonical:je,uid:tt}of Object.values(Ne)){const{z:ot,x:mt,y:Pt}=je;rt(Re,Math.pow(2,ot),mt,Pt)&&delete Ne[tt]}}getTile(Re,Ne,je){const tt=Math.pow(2,Re),ot=[];for(const mt of this.features.values())rt(mt,tt,Ne,je)&&ot.push(Ii(mt,tt,Ne,je));return{features:ot}}getFeatures(){return[...this.features.values()]}}function rt({minX:Lt,minY:Re,maxX:Ne,maxY:je},tt,ot,mt){return Lt<(ot+1+Ye)/tt&&Re<(mt+1+Ye)/tt&&Ne>(ot-Ye)/tt&&je>(mt-Ye)/tt}function kt(Lt){const{id:Re,geometry:Ne,properties:je}=Lt;if(!Ne)return;if(Ne.type==="GeometryCollection")throw new Error("GeometryCollection not supported in dynamic mode.");const{type:tt,coordinates:ot}=Ne,mt={id:Re,type:1,geometry:[],tags:je,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},Pt=mt.geometry;if(tt==="Point")_i(ot,Pt,mt);else if(tt==="MultiPoint")for(const gt of ot)_i(gt,Pt,mt);else if(tt==="LineString")mt.type=2,Yi(ot,Pt,mt);else if(tt==="MultiLineString")mt.type=2,Lr(ot,Pt,mt);else if(tt==="Polygon")mt.type=3,Lr(ot,Pt,mt,!0);else{if(tt!=="MultiPolygon")throw new Error("Input data is not a valid GeoJSON object.");mt.type=3;for(const gt of ot)Lr(gt,Pt,mt,!0)}return mt}function _i([Lt,Re],Ne,je){const tt=o.at(Lt);let ot=o.aA(Re);ot=ot<0?0:ot>1?1:ot,Ne.push(tt,ot),je.minX=Math.min(je.minX,tt),je.minY=Math.min(je.minY,ot),je.maxX=Math.max(je.maxX,tt),je.maxY=Math.max(je.maxY,ot)}function Yi(Lt,Re,Ne,je=!1,tt=!1){const ot=[];for(const mt of Lt)_i(mt,ot,Ne);Re.push(ot),je&&function(mt,Pt){let gt=0;for(let Ft=0,zt=mt.length,Ot=zt-2;Ft<zt;Ot=Ft,Ft+=2)gt+=(mt[Ft]-mt[Ot])*(mt[Ft+1]+mt[Ot+1]);if(gt>0===Pt)for(let Ft=0,zt=mt.length;Ft<zt/2;Ft+=2){const Ot=mt[Ft],Kt=mt[Ft+1];mt[Ft]=mt[zt-2-Ft],mt[Ft+1]=mt[zt-1-Ft],mt[zt-2-Ft]=Ot,mt[zt-1-Ft]=Kt}}(ot,tt)}function Lr(Lt,Re,Ne,je=!1){for(let tt=0;tt<Lt.length;tt++)Yi(Lt[tt],Re,Ne,je,tt===0)}function Ii(Lt,Re,Ne,je){const{id:tt,type:ot,geometry:mt,tags:Pt}=Lt,gt=[];if(ot===1)(function(Ft,zt,Ot,Kt,ui){for(let fi=0;fi<Ft.length;fi+=2){const Di=Math.round(o.ag*(Ft[fi+0]*zt-Ot)),Fi=Math.round(o.ag*(Ft[fi+1]*zt-Kt));ui.push([Di,Fi])}}
273)(mt,Re,Ne,je,gt);else for(const Ft of mt)en(Ft,Re,Ne,je,gt);return{id:tt,type:ot,geometry:gt,tags:Pt}}function en(Lt,Re,Ne,je,tt){const mt=o.ag+pi;let Pt;for(let gt=0;gt<Lt.length-2;gt+=2){let Ft=Math.round(o.ag*(Lt[gt+0]*Re-Ne)),zt=Math.round(o.ag*(Lt[gt+1]*Re-je)),Ot=Math.round(o.ag*(Lt[gt+2]*Re-Ne)),Kt=Math.round(o.ag*(Lt[gt+3]*Re-je));const ui=Ot-Ft,fi=Kt-zt;Ft<-128&&Ot<-128||(Ft<-128?(zt+=Math.round(fi*((-128-Ft)/ui)),Ft=-128):Ot<-128&&(Kt=zt+Math.round(fi*((-128-Ft)/ui)),Ot=-128),zt<-128&&Kt<-128||(zt<-128?(Ft+=Math.round(ui*((-128-zt)/fi)),zt=-128):Kt<-128&&(Ot=Ft+Math.round(ui*((-128-zt)/fi)),Kt=-128),Ft>=mt&&Ot>=mt||(Ft>=mt?(zt+=Math.round(fi*((mt-Ft)/ui)),Ft=mt):Ot>=mt&&(Kt=zt+Math.round(fi*((mt-Ft)/ui)),Ot=mt),zt>=mt&&Kt>=mt||(zt>=mt?(Ft+=Math.round(ui*((mt-zt)/fi)),zt=mt):Kt>=mt&&(Ot=Ft+Math.round(ui*((mt-zt)/fi)),Kt=mt),Pt&&Ft===Pt[Pt.length-1][0]&&zt===Pt[Pt.length-1][1]||(Pt=[[Ft,zt]],tt.push(Pt)),Pt.push([Ot,Kt])))))}}var Rr,Jr,kr,Pr={exports:{}},An=function(){if(kr)return Pr.exports;kr=1;var Lt=o.e8(),Re=function(){if(Jr)return Rr;Jr=1;var zt=o.e6(),Ot=o.e7().VectorTileFeature;function Kt(fi,Di){this.options=Di||{},this.features=fi,this.length=fi.length}function ui(fi,Di){this.id=typeof fi.id=="number"?fi.id:void 0,this.type=fi.type,this.rawGeometry=fi.type===1?[fi.geometry]:fi.geometry,this.properties=fi.tags,this.extent=Di||4096}return Rr=Kt,Kt.prototype.feature=function(fi){return new ui(this.features[fi],this.options.extent)},ui.prototype.loadGeometry=function(){var fi=this.rawGeometry;this.geometry=[];for(var Di=0;Di<fi.length;Di++){for(var Fi=fi[Di],Oi=[],Li=0;Li<Fi.length;Li++)Oi.push(new zt(Fi[Li][0],Fi[Li][1]));this.geometry.push(Oi)}return this.geometry},ui.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var fi=this.geometry,Di=1/0,Fi=-1/0,Oi=1/0,Li=-1/0,lr=0;lr<fi.length;lr++)for(var dr=fi[lr],tr=0;tr<dr.length;tr++){var gr=dr[tr];Di=Math.min(Di,gr.x),Fi=Math.max(Fi,gr.x),Oi=Math.min(Oi,gr.y),Li=Math.max(Li,gr.y)}return[Di,Oi,Fi,Li]},ui.prototype.toGeoJSON=Ot.prototype.toGeoJSON,Rr}();function Ne(zt){var Ot=new Lt;return function(Kt,ui){for(var fi in Kt.layers)ui.writeMessage(3,je,Kt.layers[fi])}(zt,Ot),Ot.finish()}function je(zt,Ot){var Kt;Ot.writeVarintField(15,zt.version||1),Ot.writeStringField(1,zt.name||""),Ot.writeVarintField(5,zt.extent||4096);var ui={keys:[],values:[],keycache:{},valuecache:{}};for(Kt=0;Kt<zt.length;Kt++)ui.feature=zt.feature(Kt),Ot.writeMessage(2,tt,ui);var fi=ui.keys;for(Kt=0;Kt<fi.length;Kt++)Ot.writeStringField(3,fi[Kt]);var Di=ui.values;for(Kt=0;Kt<Di.length;Kt++)Ot.writeMessage(4,Ft,Di[Kt])}function tt(zt,Ot){var Kt=zt.feature;Kt.id!==void 0&&Ot.writeVarintField(1,Kt.id),Ot.writeMessage(2,ot,zt),Ot.writeVarintField(3,Kt.type),Ot.writeMessage(4,gt,Kt)}function ot(zt,Ot){var Kt=zt.feature,ui=zt.keys,fi=zt.values,Di=zt.keycache,Fi=zt.valuecache;for(var Oi in Kt.properties){var Li=Kt.properties[Oi],lr=Di[Oi];if(Li!==null){lr===void 0&&(ui.push(Oi),Di[Oi]=lr=ui.length-1),Ot.writeVarint(lr);var dr=typeof Li;dr!=="string"&&dr!=="boolean"&&dr!=="number"&&(Li=JSON.stringify(Li));var tr=dr+":"+Li,gr=Fi[tr];gr===void 0&&(fi.push(Li),Fi[tr]=gr=fi.length-1),Ot.writeVarint(gr)}}}function mt(zt,Ot){return(Ot<<3)+(7&zt)}function Pt(zt){return zt<<1^zt>>31}function gt(zt,Ot){for(var Kt=zt.loadGeometry(),ui=zt.type,fi=0,Di=0,Fi=Kt.length,Oi=0;Oi<Fi;Oi++){var Li=Kt[Oi],lr=1;ui===1&&(lr=Li.length),Ot.writeVarint(mt(1,lr));for(var dr=ui===3?Li.length-1:Li.length,tr=0;tr<dr;tr++){tr===1&&ui!==1&&Ot.writeVarint(mt(2,dr-1));var gr=Li[tr].x-fi,xr=Li[tr].y-Di;Ot.writeVarint(Pt(gr)),Ot.writeVarint(Pt(xr)),fi+=gr,Di+=xr}ui===3&&Ot.writeVarint(mt(7,1))}}function Ft(zt,Ot){var Kt=typeof zt;Kt==="string"?Ot.writeStringField(1,zt):Kt==="boolean"?Ot.writeBooleanField(7,zt):Kt==="number"&&(zt%1!=0?Ot.writeDoubleField(3,zt):zt<0?Ot.writeSVarintField(6,zt):Ot.writeVarintField(5,zt))}return Pr.exports=Ne,Pr.exports.fromVectorTileJs=Ne,Pr.exports.fromGeojsonVt=function(zt,Ot){Ot=Ot||{};var Kt={};for(var ui in zt)Kt[ui]=new Re(zt[ui].features,Ot),Kt[ui].name=ui,Kt[ui].version=Ot.version,Kt[ui].extent=Ot.extent;return Ne({layers:Kt})}
vendor: 4,230 bytes, line 273
273,Pr.exports.GeoJSONWrapper=Re,Pr.exports}(),pt=o.e9(An);const pn={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Lt=>Lt},Mn=Math.fround||(fn=new Float32Array(1),Lt=>(fn[0]=+Lt,fn[0]));var fn;const Ht=3,on=5,tn=6;class Kn{constructor(Re){this.options=Object.assign(Object.create(pn),Re),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Re){const{log:Ne,minZoom:je,maxZoom:tt}=this.options;Ne&&console.time("total time");const ot=`prepare ${Re.length} points`;Ne&&console.time(ot),this.points=Re;const mt=[];for(let gt=0;gt<Re.length;gt++){const Ft=Re[gt];if(!Ft.geometry)continue;const[zt,Ot]=Ft.geometry.coordinates,Kt=Mn(Hr(zt)),ui=Mn(Rn(Ot));mt.push(Kt,ui,1/0,gt,-1,1),this.options.reduce&&mt.push(0)}let Pt=this.trees[tt+1]=this._createTree(mt);Ne&&console.timeEnd(ot);for(let gt=tt;gt>=je;gt--){const Ft=+Date.now();Pt=this.trees[gt]=this._createTree(this._cluster(Pt,gt)),Ne&&console.log("z%d: %d clusters in %dms",gt,Pt.numItems,+Date.now()-Ft)}return Ne&&console.timeEnd("total time"),this}getClusters(Re,Ne){let je=((Re[0]+180)%360+360)%360-180;const tt=Math.max(-90,Math.min(90,Re[1]));let ot=Re[2]===180?180:((Re[2]+180)%360+360)%360-180;const mt=Math.max(-90,Math.min(90,Re[3]));if(Re[2]-Re[0]>=360)je=-180,ot=180;else if(je>ot){const Ot=this.getClusters([je,tt,180,mt],Ne),Kt=this.getClusters([-180,tt,ot,mt],Ne);return Ot.concat(Kt)}const Pt=this.trees[this._limitZoom(Ne)],gt=Pt.range(Hr(je),Rn(mt),Hr(ot),Rn(tt)),Ft=Pt.data,zt=[];for(const Ot of gt){const Kt=this.stride*Ot;zt.push(Ft[Kt+on]>1?Xi(Ft,Kt,this.clusterProps):this.points[Ft[Kt+Ht]])}return zt}getChildren(Re){const Ne=this._getOriginId(Re),je=this._getOriginZoom(Re),tt="No cluster with the specified id.",ot=this.trees[je];if(!ot)throw new Error(tt);const mt=ot.data;if(Ne*this.stride>=mt.length)throw new Error(tt);const Pt=this.options.radius/(this.options.extent*Math.pow(2,je-1)),gt=ot.within(mt[Ne*this.stride],mt[Ne*this.stride+1],Pt),Ft=[];for(const zt of gt){const Ot=zt*this.stride;mt[Ot+4]===Re&&Ft.push(mt[Ot+on]>1?Xi(mt,Ot,this.clusterProps):this.points[mt[Ot+Ht]])}if(Ft.length===0)throw new Error(tt);return Ft}getLeaves(Re,Ne,je){const tt=[];return this._appendLeaves(tt,Re,Ne=Ne||10,je=je||0,0),tt}getTile(Re,Ne,je){const tt=this.trees[this._limitZoom(Re)],ot=Math.pow(2,Re),{extent:mt,radius:Pt}=this.options,gt=Pt/mt,Ft=(je-gt)/ot,zt=(je+1+gt)/ot,Ot={features:[]};return this._addTileFeatures(tt.range((Ne-gt)/ot,Ft,(Ne+1+gt)/ot,zt),tt.data,Ne,je,ot,Ot),Ne===0&&this._addTileFeatures(tt.range(1-gt/ot,Ft,1,zt),tt.data,ot,je,ot,Ot),Ne===ot-1&&this._addTileFeatures(tt.range(0,Ft,gt/ot,zt),tt.data,-1,je,ot,Ot),Ot.features.length?Ot:null}getClusterExpansionZoom(Re){let Ne=this._getOriginZoom(Re)-1;for(;Ne<=this.options.maxZoom;){const je=this.getChildren(Re);if(Ne++,je.length!==1)break;Re=je[0].properties.cluster_id}return Ne}_appendLeaves(Re,Ne,je,tt,ot){const mt=this.getChildren(Ne);for(const Pt of mt){const gt=Pt.properties;if(gt&&gt.cluster?ot+gt.point_count<=tt?ot+=gt.point_count:ot=this._appendLeaves(Re,gt.cluster_id,je,tt,ot):ot<tt?ot++:Re.push(Pt),Re.length===je)break}return ot}_createTree(Re){const Ne=new o.bE(Re.length/this.stride|0,this.options.nodeSize,Float32Array);for(let je=0;je<Re.length;je+=this.stride)Ne.add(Re[je],Re[je+1]);return Ne.finish(),Ne.data=Re,Ne}_addTileFeatures(Re,Ne,je,tt,ot,mt){for(const Pt of Re){const gt=Pt*this.stride,Ft=Ne[gt+on]>1;let zt,Ot,Kt;if(Ft)zt=Gr(Ne,gt,this.clusterProps),Ot=Ne[gt],Kt=Ne[gt+1];else{const Di=this.points[Ne[gt+Ht]];zt=Di.properties;const[Fi,Oi]=Di.geometry.coordinates;Ot=Hr(Fi),Kt=Rn(Oi)}const ui={type:1,geometry:[[Math.round(this.options.extent*(Ot*ot-je)),Math.round(this.options.extent*(Kt*ot-tt))]],tags:zt};let fi;fi=Ft||this.options.generateId?Ne[gt+Ht]:this.points[Ne[gt+Ht]].id,fi!==void 0&&(ui.id=fi),mt.features.push(ui)}}_limitZoom(Re){return Math.max(this.options.minZoom,Math.min(Math.floor(+Re),this.options.maxZoom+1))}_cluster(Re,Ne){const{radius:je,extent:tt,reduce:ot,minPoints:mt}=this.options,Pt=je/(tt*Math.pow(2,Ne)),gt=Re.data,Ft=[],zt=this.stride;for(let Ot=0;Ot<gt.length;Ot+=zt){if(gt[Ot+2]<=Ne)continue;gt[Ot+2]=Ne;
vendor: 14,439 bytes, line 273
273const Kt=gt[Ot],ui=gt[Ot+1],fi=Re.within(gt[Ot],gt[Ot+1],Pt),Di=gt[Ot+on];let Fi=Di;for(const Oi of fi){const Li=Oi*zt;gt[Li+2]>Ne&&(Fi+=gt[Li+on])}if(Fi>Di&&Fi>=mt){let Oi,Li=Kt*Di,lr=ui*Di,dr=-1;const tr=(Ot/zt<<5)+(Ne+1)+this.points.length;for(const gr of fi){const xr=gr*zt;if(gt[xr+2]<=Ne)continue;gt[xr+2]=Ne;const gn=gt[xr+on];Li+=gt[xr]*gn,lr+=gt[xr+1]*gn,gt[xr+4]=tr,ot&&(Oi||(Oi=this._map(gt,Ot,!0),dr=this.clusterProps.length,this.clusterProps.push(Oi)),ot(Oi,this._map(gt,xr)))}gt[Ot+4]=tr,Ft.push(Li/Fi,lr/Fi,1/0,tr,-1,Fi),ot&&Ft.push(dr)}else{for(let Oi=0;Oi<zt;Oi++)Ft.push(gt[Ot+Oi]);if(Fi>1)for(const Oi of fi){const Li=Oi*zt;if(!(gt[Li+2]<=Ne)){gt[Li+2]=Ne;for(let lr=0;lr<zt;lr++)Ft.push(gt[Li+lr])}}}}return Ft}_getOriginId(Re){return Re-this.points.length>>5}_getOriginZoom(Re){return(Re-this.points.length)%32}_map(Re,Ne,je){if(Re[Ne+on]>1){const mt=this.clusterProps[Re[Ne+tn]];return je?Object.assign({},mt):mt}const tt=this.points[Re[Ne+Ht]].properties,ot=this.options.map(tt);return je&&ot===tt?Object.assign({},ot):ot}}function Xi(Lt,Re,Ne){return{type:"Feature",id:Lt[Re+Ht],properties:Gr(Lt,Re,Ne),geometry:{type:"Point",coordinates:[(je=Lt[Re],360*(je-.5)),Nn(Lt[Re+1])]}};var je}function Gr(Lt,Re,Ne){const je=Lt[Re+on],tt=je>=1e4?`${Math.round(je/1e3)}k`:je>=1e3?Math.round(je/100)/10+"k":je,ot=Lt[Re+tn],mt=ot===-1?{}:Object.assign({},Ne[ot]);return Object.assign(mt,{cluster:!0,cluster_id:Lt[Re+Ht],point_count:je,point_count_abbreviated:tt})}function Hr(Lt){return Lt/360+.5}function Rn(Lt){const Re=Math.sin(Lt*Math.PI/180),Ne=.5-.25*Math.log((1+Re)/(1-Re))/Math.PI;return Ne<0?0:Ne>1?1:Ne}function Nn(Lt){const Re=(180-360*Lt)*Math.PI/180;return 360*Math.atan(Math.exp(Re))/Math.PI-90}function Le(Lt,Re,Ne,je){let tt=je;const ot=Re+(Ne-Re>>1);let mt,Pt=Ne-Re;const gt=Lt[Re],Ft=Lt[Re+1],zt=Lt[Ne],Ot=Lt[Ne+1];for(let Kt=Re+3;Kt<Ne;Kt+=3){const ui=Ue(Lt[Kt],Lt[Kt+1],gt,Ft,zt,Ot);if(ui>tt)mt=Kt,tt=ui;else if(ui===tt){const fi=Math.abs(Kt-ot);fi<Pt&&(mt=Kt,Pt=fi)}}tt>je&&(mt-Re>3&&Le(Lt,Re,mt,je),Lt[mt+2]=tt,Ne-mt>3&&Le(Lt,mt,Ne,je))}function Ue(Lt,Re,Ne,je,tt,ot){let mt=tt-Ne,Pt=ot-je;if(mt!==0||Pt!==0){const gt=((Lt-Ne)*mt+(Re-je)*Pt)/(mt*mt+Pt*Pt);gt>1?(Ne=tt,je=ot):gt>0&&(Ne+=mt*gt,je+=Pt*gt)}return mt=Lt-Ne,Pt=Re-je,mt*mt+Pt*Pt}function bt(Lt,Re,Ne,je){const tt={id:Lt??null,type:Re,geometry:Ne,tags:je,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Re==="Point"||Re==="MultiPoint"||Re==="LineString")It(tt,Ne);else if(Re==="Polygon")It(tt,Ne[0]);else if(Re==="MultiLineString")for(const ot of Ne)It(tt,ot);else if(Re==="MultiPolygon")for(const ot of Ne)It(tt,ot[0]);return tt}function It(Lt,Re){for(let Ne=0;Ne<Re.length;Ne+=3)Lt.minX=Math.min(Lt.minX,Re[Ne]),Lt.minY=Math.min(Lt.minY,Re[Ne+1]),Lt.maxX=Math.max(Lt.maxX,Re[Ne]),Lt.maxY=Math.max(Lt.maxY,Re[Ne+1])}function Yt(Lt,Re,Ne,je){if(!Re.geometry)return;const tt=Re.geometry.coordinates;if(tt&&tt.length===0)return;const ot=Re.geometry.type,mt=Math.pow(Ne.tolerance/((1<<Ne.maxZoom)*Ne.extent),2);let Pt=[],gt=Re.id;if(Ne.promoteId?gt=Re.properties[Ne.promoteId]:Ne.generateId&&(gt=je||0),ot==="Point")ai(tt,Pt);else if(ot==="MultiPoint")for(const Ft of tt)ai(Ft,Pt);else if(ot==="LineString")li(tt,Pt,mt,!1);else if(ot==="MultiLineString"){if(Ne.lineMetrics){for(const Ft of tt)Pt=[],li(Ft,Pt,mt,!1),Lt.push(bt(gt,"LineString",Pt,Re.properties));return}di(tt,Pt,mt,!1)}else if(ot==="Polygon")di(tt,Pt,mt,!0);else{if(ot!=="MultiPolygon"){if(ot==="GeometryCollection"){for(const Ft of Re.geometry.geometries)Yt(Lt,{id:gt,geometry:Ft,properties:Re.properties},Ne,je);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const Ft of tt){const zt=[];di(Ft,zt,mt,!0),Pt.push(zt)}}Lt.push(bt(gt,ot,Pt,Re.properties))}function ai(Lt,Re){Re.push(Gi(Lt[0]),Ni(Lt[1]),0)}function li(Lt,Re,Ne,je){let tt,ot,mt=0;for(let gt=0;gt<Lt.length;gt++){const Ft=Gi(Lt[gt][0]),zt=Ni(Lt[gt][1]);Re.push(Ft,zt,0),gt>0&&(mt+=je?(tt*zt-Ft*ot)/2:Math.sqrt(Math.pow(Ft-tt,2)+Math.pow(zt-ot,2))),tt=Ft,ot=zt}const Pt=Re.length-3;Re[2]=1,Le(Re,0,Pt,Ne),Re[Pt+2]=1,Re.size=Math.abs(mt),Re.start=0,Re.end=Re.size}function di(Lt,Re,Ne,je){for(let tt=0;tt<Lt.length;tt++){const ot=[];li(Lt[tt],ot,Ne,je),Re.push(ot)}}function Gi(Lt){return Lt/360+.5}function Ni(Lt){const Re=Math.sin(Lt*Math.PI/180),Ne=.5-.25*Math.log((1+Re)/(1-Re))/Math.PI;return Ne<0?0:Ne>1?1:Ne}function $i(Lt,Re,Ne,je,tt,ot,mt,Pt){if(je/=Re,ot>=(Ne/=Re)&&mt<je)return Lt;if(mt<Ne||ot>=je)return null;const gt=[];for(const Ft of Lt){const zt=Ft.geometry;let Ot=Ft.type;const Kt=tt===0?Ft.minX:Ft.minY,ui=tt===0?Ft.maxX:Ft.maxY;if(Kt>=Ne&&ui<je){gt.push(Ft);continue}if(ui<Ne||Kt>=je)continue;let fi=[];if(Ot==="Point"||Ot==="MultiPoint")er(zt,fi,Ne,je,tt);else if(Ot==="LineString")yr(zt,fi,Ne,je,tt,!1,Pt.lineMetrics);else if(Ot==="MultiLineString")wr(zt,fi,Ne,je,tt,!1);else if(Ot==="Polygon")wr(zt,fi,Ne,je,tt,!0);else if(Ot==="MultiPolygon")for(const Di of zt){const Fi=[];wr(Di,Fi,Ne,je,tt,!0),Fi.length&&fi.push(Fi)}if(fi.length){if(Pt.lineMetrics&&Ot==="LineString"){for(const Di of fi)gt.push(bt(Ft.id,Ot,Di,Ft.tags));continue}Ot!=="LineString"&&Ot!=="MultiLineString"||(fi.length===1?(Ot="LineString",fi=fi[0]):Ot="MultiLineString"),Ot!=="Point"&&Ot!=="MultiPoint"||(Ot=fi.length===3?"Point":"MultiPoint"),gt.push(bt(Ft.id,Ot,fi,Ft.tags))}}return gt.length?gt:null}function er(Lt,Re,Ne,je,tt){for(let ot=0;ot<Lt.length;ot+=3){const mt=Lt[ot+tt];mt>=Ne&&mt<=je&&zi(Re,Lt[ot],Lt[ot+1],Lt[ot+2])}}function yr(Lt,Re,Ne,je,tt,ot,mt){let Pt=or(Lt);const gt=tt===0?vn:Vn;let Ft,zt,Ot=Lt.start;for(let Fi=0;Fi<Lt.length-3;Fi+=3){const Oi=Lt[Fi],Li=Lt[Fi+1],lr=Lt[Fi+2],dr=Lt[Fi+3],tr=Lt[Fi+4],gr=tt===0?Oi:Li,xr=tt===0?dr:tr;let gn=!1;mt&&(Ft=Math.sqrt(Math.pow(Oi-dr,2)+Math.pow(Li-tr,2))),gr<Ne?xr>Ne&&(zt=gt(Pt,Oi,Li,dr,tr,Ne),mt&&(Pt.start=Ot+Ft*zt)):gr>je?xr<je&&(zt=gt(Pt,Oi,Li,dr,tr,je),mt&&(Pt.start=Ot+Ft*zt)):zi(Pt,Oi,Li,lr),xr<Ne&&gr>=Ne&&(zt=gt(Pt,Oi,Li,dr,tr,Ne),gn=!0),xr>je&&gr<=je&&(zt=gt(Pt,Oi,Li,dr,tr,je),gn=!0),!ot&&gn&&(mt&&(Pt.end=Ot+Ft*zt),Re.push(Pt),Pt=or(Lt)),mt&&(Ot+=Ft)}let Kt=Lt.length-3;const ui=Lt[Kt],fi=Lt[Kt+1],Di=tt===0?ui:fi;Di>=Ne&&Di<=je&&zi(Pt,ui,fi,Lt[Kt+2]),Kt=Pt.length-3,ot&&Kt>=3&&(Pt[Kt]!==Pt[0]||Pt[Kt+1]!==Pt[1])&&zi(Pt,Pt[0],Pt[1],Pt[2]),Pt.length&&Re.push(Pt)}function or(Lt){const Re=[];return Re.size=Lt.size,Re.start=Lt.start,Re.end=Lt.end,Re}function wr(Lt,Re,Ne,je,tt,ot){for(const mt of Lt)yr(mt,Re,Ne,je,tt,ot,!1)}function zi(Lt,Re,Ne,je){Lt.push(Re,Ne,je)}function vn(Lt,Re,Ne,je,tt,ot){const mt=(ot-Re)/(je-Re);return zi(Lt,ot,Ne+(tt-Ne)*mt,1),mt}function Vn(Lt,Re,Ne,je,tt,ot){const mt=(ot-Ne)/(tt-Ne);return zi(Lt,Re+(je-Re)*mt,ot,1),mt}function mn(Lt,Re){const Ne=[];for(let je=0;je<Lt.length;je++){const tt=Lt[je],ot=tt.type;let mt;if(ot==="Point"||ot==="MultiPoint"||ot==="LineString")mt=rn(tt.geometry,Re);else if(ot==="MultiLineString"||ot==="Polygon"){mt=[];for(const Pt of tt.geometry)mt.push(rn(Pt,Re))}else if(ot==="MultiPolygon"){mt=[];for(const Pt of tt.geometry){const gt=[];for(const Ft of Pt)gt.push(rn(Ft,Re));mt.push(gt)}}Ne.push(bt(tt.id,ot,mt,tt.tags))}return Ne}function rn(Lt,Re){const Ne=[];Ne.size=Lt.size,Lt.start!==void 0&&(Ne.start=Lt.start,Ne.end=Lt.end);for(let je=0;je<Lt.length;je+=3)Ne.push(Lt[je]+Re,Lt[je+1],Lt[je+2]);return Ne}function Qn(Lt,Re){if(Lt.transformed)return Lt;const Ne=1<<Lt.z,je=Lt.x,tt=Lt.y;for(const ot of Lt.features){const mt=ot.geometry,Pt=ot.type;if(ot.geometry=[],Pt===1)for(let gt=0;gt<mt.length;gt+=2)ot.geometry.push(es(mt[gt],mt[gt+1],Re,Ne,je,tt));else for(let gt=0;gt<mt.length;gt++){const Ft=[];for(let zt=0;zt<mt[gt].length;zt+=2)Ft.push(es(mt[gt][zt],mt[gt][zt+1],Re,Ne,je,tt));ot.geometry.push(Ft)}}return Lt.transformed=!0,Lt}function es(Lt,Re,Ne,je,tt,ot){return[Math.round(Ne*(Lt*je-tt)),Math.round(Ne*(Re*je-ot))]}function Ts(Lt,Re,Ne,je,tt){const ot=Re===tt.maxZoom?0:tt.tolerance/((1<<Re)*tt.extent),mt={features:[],numPoints:0,numSimplified:0,numFeatures:Lt.length,source:null,x:Ne,y:je,z:Re,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const Pt of Lt)Ds(mt,Pt,ot,tt);return mt}function Ds(Lt,Re,Ne,je){const tt=Re.geometry,ot=Re.type,mt=[];if(Lt.minX=Math.min(Lt.minX,Re.minX),Lt.minY=Math.min(Lt.minY,Re.minY),Lt.maxX=Math.max(Lt.maxX,Re.maxX),Lt.maxY=Math.max(Lt.maxY,Re.maxY),ot==="Point"||ot==="MultiPoint")for(let Pt=0;Pt<tt.length;Pt+=3)mt.push(tt[Pt],tt[Pt+1]),Lt.numPoints++,Lt.numSimplified++;else if(ot==="LineString")qn(mt,tt,Lt,Ne,!1,!1);else if(ot==="MultiLineString"||ot==="Polygon")for(let Pt=0;Pt<tt.length;Pt++)qn(mt,tt[Pt],Lt,Ne,ot==="Polygon",Pt===0);else if(ot==="MultiPolygon")for(let Pt=0;Pt<tt.length;Pt++){const gt=tt[Pt];for(let Ft=0;Ft<gt.length;Ft++)qn(mt,gt[Ft],Lt,Ne,!0,Ft===0)}if(mt.length){let Pt=Re.tags||null;if(ot==="LineString"&&je.lineMetrics){Pt={};for(const Ft in Re.tags)Pt[Ft]=Re.tags[Ft];Pt.mapbox_clip_start=tt.start/tt.size,Pt.mapbox_clip_end=tt.end/tt.size}const gt={geometry:mt,type:ot==="Polygon"||ot==="MultiPolygon"?3:ot==="LineString"||ot==="MultiLineString"?2:1,tags:Pt};Re.id!==null&&(gt.id=Re.id),Lt.features.push(gt)}}function qn(Lt,Re,Ne,je,tt,ot){const mt=je*je;if(je>0&&Re.size<(tt?mt:je))return void(Ne.numPoints+=Re.length/3);const Pt=[];for(let gt=0;gt<Re.length;gt+=3)(je===0||Re[gt+2]>mt)&&(Ne.numSimplified++,Pt.push(Re[gt],Re[gt+1])),Ne.numPoints++;tt&&function(gt,Ft){let zt=0;for(let Ot=0,Kt=gt.length,ui=Kt-2;Ot<Kt;ui=Ot,Ot+=2)zt+=(gt[Ot]-gt[ui])*(gt[Ot+1]+gt[ui+1]);if(zt>0===Ft)for(let Ot=0,Kt=gt.length;Ot<Kt/2;Ot+=2){const ui=gt[Ot],fi=gt[Ot+1];gt[Ot]=gt[Kt-2-Ot],gt[Ot+1]=gt[Kt-1-Ot],gt[Kt-2-Ot]=ui,gt[Kt-1-Ot]=fi}}(Pt,ot),Lt.push(Pt)}const ss={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class Oa{constructor(Re,Ne){const je=(Ne=this.options=function(ot,mt){for(const Pt in mt)ot[Pt]=mt[Pt];return ot}(Object.create(ss),Ne)).debug;if(je&&console.time("preprocess data"),Ne.maxZoom<0||Ne.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(Ne.promoteId&&Ne.generateId)throw new Error("promoteId and generateId cannot be used together.");let tt=function(ot,mt){const Pt=[];if(ot.type==="FeatureCollection")for(let gt=0;gt<ot.features.length;gt++)Yt(Pt,ot.features[gt],mt,gt);else Yt(Pt,ot.type==="Feature"?ot:{geometry:ot},mt);return Pt}(Re,Ne);this.tiles={},this.tileCoords=[],je&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Ne.indexMaxZoom,Ne.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),tt=function(ot,mt){const Pt=mt.buffer/mt.extent;let gt=ot;const Ft=$i(ot,1,-1-Pt,Pt,0,-1,2,mt),zt=$i(ot,1,1-Pt,2+Pt,0,-1,2,mt);return(Ft||zt)&&(gt=$i(ot,1,-Pt,1+Pt,0,-1,2,mt)||[],Ft&&(gt=mn(Ft,1).concat(gt)),zt&&(gt=gt.concat(mn(zt,-1)))),gt}(tt,Ne),tt.length&&this.splitTile(tt,0,0,0),je&&(tt.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(Re,Ne,je,tt,ot,mt,Pt){const gt=[Re,Ne,je,tt],Ft=this.options,zt=Ft.debug;for(;gt.length;){tt=gt.pop(),je=gt.pop(),Ne=gt.pop(),Re=gt.pop();const Ot=1<<Ne,Kt=ln(Ne,je,tt);let ui=this.tiles[Kt];if(!ui&&(zt>1&&console.time("creation"),ui=this.tiles[Kt]=Ts(Re,Ne,je,tt,Ft),this.tileCoords.push({z:Ne,x:je,y:tt}),zt)){zt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ne,je,tt,ui.numFeatures,ui.numPoints,ui.numSimplified),console.timeEnd("creation"));const gn=`z${Ne}`;this.stats[gn]=(this.stats[gn]||0)+1,this.total++}if(ui.source=Re,ot==null){if(Ne===Ft.indexMaxZoom||ui.numPoints<=Ft.indexMaxPoints)continue}else{if(Ne===Ft.maxZoom||Ne===ot)continue;if(ot!=null){const gn=ot-Ne;if(je!==mt>>gn||tt!==Pt>>gn)continue}}if(ui.source=null,Re.length===0)continue;zt>1&&console.time("clipping");const fi=.5*Ft.buffer/Ft.extent,Di=.5-fi,Fi=.5+fi,Oi=1+fi;let Li=null,lr=null,dr=null,tr=null,gr=$i(Re,Ot,je-fi,je+Fi,0,ui.minX,ui.maxX,Ft),xr=$i(Re,Ot,je+Di,je+Oi,0,ui.minX,ui.maxX,Ft);Re=null,gr&&(Li=$i(gr,Ot,tt-fi,tt+Fi,1,ui.minY,ui.maxY,Ft),lr=$i(gr,Ot,tt+Di,tt+Oi,1,ui.minY,ui.maxY,Ft),gr=null),xr&&(dr=$i(xr,Ot,tt-fi,tt+Fi,1,ui.minY,ui.maxY,Ft),tr=$i(xr,Ot,tt+Di,tt+Oi,1,ui.minY,ui.maxY,Ft),xr=null),zt>1&&console.timeEnd("clipping"),gt.push(Li||[],Ne+1,2*je,2*tt),gt.push(lr||[],Ne+1,2*je,2*tt+1),gt.push(dr||[],Ne+1,2*je+1,2*tt),gt.push(tr||[],Ne+1,2*je+1,2*tt+1)}}getTile(Re,Ne,je){Re=+Re,Ne=+Ne,je=+je;const tt=this.options,{extent:ot,debug:mt}=tt;if(Re<0||Re>24)return null;const Pt=1<<Re,gt=ln(Re,Ne=Ne+Pt&Pt-1,je);if(this.tiles[gt])return Qn(this.tiles[gt],ot);mt>1&&console.log("drilling down to z%d-%d-%d",Re,Ne,je);let Ft,zt=Re,Ot=Ne,Kt=je;for(;!Ft&&zt>0;)zt--,Ot>>=1,Kt>>=1,Ft=this.tiles[ln(zt,Ot,Kt)];return Ft&&Ft.source?(mt>1&&(console.log("found parent tile z%d-%d-%d",zt,Ot,Kt),console.time("drilling down")),this.splitTile(Ft.source,zt,Ot,Kt,Re,Ne,je),mt>1&&console.timeEnd("drilling down"),this.tiles[gt]?Qn(this.tiles[gt],ot):null):null}}function ln(Lt,Re,Ne){return 32*((1<<Lt)*Ne+Re)+Lt}function Ba(Lt,Re){const Ne=Lt.tileID.canonical;if(!this._geoJSONIndex)return void Re(null,null);const je=this._geoJSONIndex.getTile(Ne.z,Ne.x,Ne.y);if(!je)return void Re(null,null);const tt=new lt(je.features);let ot=pt(tt);ot.byteOffset===0&&ot.byteLength===ot.buffer.byteLength||(ot=new Uint8Array(ot)),Re(null,{vectorTile:tt,rawData:ot.buffer})}class ra extends Zt{constructor(Re,Ne,je,tt,ot,mt){super(Re,Ne,je,tt,Ba,mt),ot&&(this.loadGeoJSON=ot),this._dynamicIndex=new si}loadData(Re,Ne){const je=Re&&Re.request,tt=je&&je.collectResourceTiming;this.loadGeoJSON(Re,(ot,mt)=>{if(ot||!mt)return Ne(ot);if(typeof mt!="object")return Ne(new Error(`Input data given to '${Re.source}' is not a valid GeoJSON object.`));{try{if(Re.filter){const gt=o.U(Re.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(gt.result==="error")throw new Error(gt.value.map(Ft=>`${Ft.key}: ${Ft.message}`).join(", "));mt.features=mt.features.filter(Ft=>gt.value.evaluate({zoom:0},Ft))}Re.dynamic?(mt.type==="Feature"&&(mt={type:"FeatureCollection",features:[mt]}),Re.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(mt.features,this.loaded),Re.cluster&&(mt.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=Re.cluster?new Kn(function({superclusterOptions:gt,clusterProperties:Ft}){if(!Ft||!gt)return gt;
273const zt={},Ot={},Kt={accumulated:null,zoom:0},ui={properties:null},fi=Object.keys(Ft);for(const Di of fi){const[Fi,Oi]=Ft[Di],Li=o.U(Oi),lr=o.U(typeof Fi=="string"?[Fi,["accumulated"],["get",Di]]:Fi);zt[Di]=Li.value,Ot[Di]=lr.value}return gt.map=Di=>{ui.properties=Di;const Fi={};for(const Oi of fi)Fi[Oi]=zt[Oi].evaluate(Kt,ui);return Fi},gt.reduce=(Di,Fi)=>{ui.properties=Fi;for(const Oi of fi)Kt.accumulated=Di[Oi],Di[Oi]=Ot[Oi].evaluate(Kt,ui)},gt}(Re)).load(mt.features):Re.dynamic?this._dynamicIndex:function(gt,Ft){return new Oa(gt,Ft)}(mt,Re.geojsonVtOptions)}catch(gt){return Ne(gt)}const Pt={};if(tt){const gt=Te(je);gt&&(Pt.resourceTiming={},Pt.resourceTiming[Re.source]=JSON.parse(JSON.stringify(gt)))}Ne(null,Pt)}})}reloadTile(Re,Ne){const je=this.loaded;return je&&je[Re.uid]?Re.partial?Ne(null,void 0):super.reloadTile(Re,Ne):this.loadTile(Re,Ne)}loadGeoJSON(Re,Ne){if(Re.request)o.n(Re.request,Ne);else{if(typeof Re.data!="string")return Ne(new Error(`Input data given to '${Re.source}' is not a valid GeoJSON object.`));try{return Ne(null,JSON.parse(Re.data))}catch{return Ne(new Error(`Input data given to '${Re.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(Re,Ne){try{Ne(null,this._geoJSONIndex.getClusterExpansionZoom(Re.clusterId))}catch(je){Ne(je)}}getClusterChildren(Re,Ne){try{Ne(null,this._geoJSONIndex.getChildren(Re.clusterId))}catch(je){Ne(je)}}getClusterLeaves(Re,Ne){try{Ne(null,this._geoJSONIndex.getLeaves(Re.clusterId,Re.limit,Re.offset))}catch(je){Ne(je)}}}class Na{constructor(Re,Ne){this.tileID=new o.aG(Re.tileID.overscaledZ,Re.tileID.wrap,Re.tileID.canonical.z,Re.tileID.canonical.x,Re.tileID.canonical.y),this.tileZoom=Re.tileZoom,this.uid=Re.uid,this.zoom=Re.zoom,this.canonical=Re.tileID.canonical,this.pixelRatio=Re.pixelRatio,this.tileSize=Re.tileSize,this.source=Re.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=Re.projection,this.brightness=Ne}parse(Re,Ne,je,tt){this.status="parsing";const ot=new o.aG(je.tileID.overscaledZ,je.tileID.wrap,je.tileID.canonical.z,je.tileID.canonical.x,je.tileID.canonical.y),mt=[],Pt=Ne.familiesBySource[je.source],gt=new o.d$(ot,je.promoteId);return gt.bucketLayerIDs=[],gt.is3DTile=!0,o.ea(Re).then(Ft=>{if(!Ft)return tt(new Error("Could not parse tile"));const zt=o.eb(Ft,1/o.cc(je.tileID.canonical)),Ot=Ft.json.extensionsUsed&&Ft.json.extensionsUsed.includes("MAPBOX_mesh_features")||Ft.json.asset.extras&&Ft.json.asset.extras.MAPBOX_mesh_features,Kt=Ft.json.extensionsUsed&&Ft.json.extensionsUsed.includes("EXT_meshopt_compression"),ui=new o.a8(this.zoom,{brightness:this.brightness});for(const fi in Pt)for(const Di of Pt[fi]){const Fi=Di[0];gt.bucketLayerIDs.push(Di.map(Li=>o.aC(Li.id,Li.scope))),Fi.recalculate(ui,[]);const Oi=new o.ec(Di,zt,ot,Ot,Kt,this.brightness,gt);Ot||(Oi.needsUpload=!0),mt.push(Oi),Oi.evaluate(Fi)}this.status="done",tt(null,{buckets:mt,featureIndex:gt,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null})}).catch(Ft=>tt(new Error(Ft.message)))}}class mr{constructor(Re,Ne,je,tt,ot,mt){this.actor=Re,this.layerIndex=Ne,this.availableImages=je,this.brightness=mt,this.loading={},this.loaded={}}loadTile(Re,Ne){const je=Re.uid,tt=this.loading[je]=new Na(Re,this.brightness);o.bi(Re.request,(ot,mt)=>{const Pt=!this.loading[je];return delete this.loading[je],Pt||ot?(tt.status="done",Pt||(this.loaded[je]=tt),Ne(ot)):mt&&mt.byteLength!==0?void tt.parse(mt,this.layerIndex,Re,(gt,Ft)=>{tt.status="done",this.loaded=this.loaded||{},this.loaded[je]=tt,gt||!Ft?Ne(gt):Ne(null,Ft)}):(tt.status="done",this.loaded[je]=tt,Ne())})}reloadTile(Re,Ne){const je=this.loaded,tt=Re.uid;if(je&&je[tt]){const ot=je[tt];ot.projection=Re.projection,ot.brightness=Re.brightness;const mt=(Pt,gt)=>{ot.reloadCallback&&(delete ot.reloadCallback,this.loadTile(Re,Ne)),Ne(Pt,gt)};ot.status==="parsing"?ot.reloadCallback=mt:ot.status==="done"&&this.loadTile(Re,Ne)}}abortTile(Re,Ne){const je=Re.uid;this.loading[je]&&delete this.loading[je],Ne()}removeTile(Re,Ne){const je=this.loaded,tt=Re.uid;je&&je[tt]&&delete je[tt],Ne()}}class nn{constructor(Re){this.self=Re,this.actor=new o.ed(Re,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.imageRasterizer=new o.I,this.projections={},this.defaultProjection=o.bP({name:"mercator"}),this.workerSourceTypes={vector:Zt,geojson:ra,"batched-model":mr},this.workerSources={},this.demWorkerSources={}
273,this.self.registerWorkerSource=(Ne,je)=>{if(this.workerSourceTypes[Ne])throw new Error(`Worker source with name "${Ne}" already registered.`);this.workerSourceTypes[Ne]=je},this.self.registerRTLTextPlugin=Ne=>{if(o.ee.isParsed())throw new Error("RTL text plugin already registered.");o.ee.applyArabicShaping=Ne.applyArabicShaping,o.ee.processBidirectionalText=Ne.processBidirectionalText,o.ee.processStyledBidirectionalText=Ne.processStyledBidirectionalText}}clearCaches(Re,Ne,je){delete this.layerIndexes[Re],delete this.availableImages[Re],delete this.workerSources[Re],delete this.demWorkerSources[Re],delete this.rasterArrayWorkerSource,je()}checkIfReady(Re,Ne,je){je()}setReferrer(Re,Ne){this.referrer=Ne}spriteLoaded(Re,{scope:Ne,isLoaded:je}){if(this.isSpriteLoaded[Re]||(this.isSpriteLoaded[Re]={}),this.isSpriteLoaded[Re][Ne]=je,this.workerSources[Re]&&this.workerSources[Re][Ne])for(const tt in this.workerSources[Re][Ne]){const ot=this.workerSources[Re][Ne][tt];for(const mt in ot){const Pt=ot[mt];Pt instanceof Zt&&(Pt.isSpriteLoaded=je,Pt.fire(new o.z("isSpriteLoaded")))}}}setImages(Re,{scope:Ne,images:je},tt){if(this.availableImages[Re]||(this.availableImages[Re]={}),this.availableImages[Re][Ne]=je,this.workerSources[Re]&&this.workerSources[Re][Ne]){for(const ot in this.workerSources[Re][Ne]){const mt=this.workerSources[Re][Ne][ot];for(const Pt in mt)mt[Pt].availableImages=je}tt()}else tt()}setProjection(Re,Ne){this.projections[Re]=o.bP(Ne)}setBrightness(Re,Ne,je){this.brightness=Ne,je()}setLayers(Re,Ne,je){this.getLayerIndex(Re,Ne.scope).replace(Ne.layers,Ne.options),je()}updateLayers(Re,Ne,je){this.getLayerIndex(Re,Ne.scope).update(Ne.layers,Ne.removedIds,Ne.options),je()}loadTile(Re,Ne,je){Ne.projection=this.projections[Re]||this.defaultProjection,this.getWorkerSource(Re,Ne.type,Ne.source,Ne.scope).loadTile(Ne,je)}loadDEMTile(Re,Ne,je){this.getDEMWorkerSource(Re,Ne.source,Ne.scope).loadTile(Ne,je)}decodeRasterArray(Re,Ne,je){this.getRasterArrayWorkerSource().decodeRasterArray(Ne,je)}reloadTile(Re,Ne,je){Ne.projection=this.projections[Re]||this.defaultProjection,this.getWorkerSource(Re,Ne.type,Ne.source,Ne.scope).reloadTile(Ne,je)}abortTile(Re,Ne,je){this.getWorkerSource(Re,Ne.type,Ne.source,Ne.scope).abortTile(Ne,je)}removeTile(Re,Ne,je){this.getWorkerSource(Re,Ne.type,Ne.source,Ne.scope).removeTile(Ne,je)}removeSource(Re,Ne,je){if(!(this.workerSources[Re]&&this.workerSources[Re][Ne.scope]&&this.workerSources[Re][Ne.scope][Ne.type]&&this.workerSources[Re][Ne.scope][Ne.type][Ne.source]))return;const tt=this.workerSources[Re][Ne.scope][Ne.type][Ne.source];delete this.workerSources[Re][Ne.scope][Ne.type][Ne.source],tt.removeSource!==void 0?tt.removeSource(Ne,je):je()}loadWorkerSource(Re,Ne,je){try{this.self.importScripts(Ne.url),je()}catch(tt){je(tt.toString())}}syncRTLPluginState(Re,Ne,je){try{o.ee.setState(Ne);const tt=o.ee.getPluginURL();if(o.ee.isLoaded()&&!o.ee.isParsed()&&tt!=null){this.self.importScripts(tt);const ot=o.ee.isParsed();je(ot?void 0:new Error(`RTL Text Plugin failed to import scripts from ${tt}`),ot)}}catch(tt){je(tt.toString())}}setDracoUrl(Re,Ne){this.dracoUrl=Ne}getAvailableImages(Re,Ne){this.availableImages[Re]||(this.availableImages[Re]={});let je=this.availableImages[Re][Ne];return je||(je=[]),je}getLayerIndex(Re,Ne){this.layerIndexes[Re]||(this.layerIndexes[Re]={});let je=this.layerIndexes[Re][Ne];return je||(je=this.layerIndexes[Re][Ne]=new Ae,je.scope=Ne),je}getWorkerSource(Re,Ne,je,tt){return this.workerSources[Re]||(this.workerSources[Re]={}),this.workerSources[Re][tt]||(this.workerSources[Re][tt]={}),this.workerSources[Re][tt][Ne]||(this.workerSources[Re][tt][Ne]={}),this.isSpriteLoaded[Re]||(this.isSpriteLoaded[Re]={}),this.workerSources[Re][tt][Ne][je]||(this.workerSources[Re][tt][Ne][je]=new this.workerSourceTypes[Ne]({send:(ot,mt,Pt,gt,Ft,zt)=>{this.actor.send(ot,mt,Pt,Re,Ft,zt)},scheduler:this.actor.scheduler},this.getLayerIndex(Re,tt),this.getAvailableImages(Re,tt),this.isSpriteLoaded[Re][tt],void 0,this.brightness)),this.workerSources[Re][tt][Ne][je]}rasterizeImages(Re,Ne,je){const{imageTasks:tt,scope:ot}=Ne,mt={};for(const Pt in tt){const{image:gt,imageIdWithOptions:Ft}=tt[Pt];mt[Pt]=this.imageRasterizer.rasterize(Ft,gt,ot,Re)}je(void 0,mt)}removeRasterizedImages(Re,Ne,je){const{imageIds:tt,scope:ot}=Ne;this.imageRasterizer.removeImagesFromCacheByIds(tt,ot,Re),je()}getDEMWorkerSource(Re,Ne,je){return this.demWorkerSources[Re]||(this.demWorkerSources[Re]={}),this.demWorkerSources[Re][je]||(this.demWorkerSources[Re][je]={}),this.demWorkerSources[Re][je][Ne]||(this.demWorkerSources[Re][je][Ne]=new xt),this.demWorkerSources[Re][je][Ne]}getRasterArrayWorkerSource(){return this.rasterArrayWorkerSource||(this.rasterArrayWorkerSource=new wt),this.rasterArrayWorkerSource}enforceCacheSizeLimit(Re,Ne){o.ef(Ne)}getWorkerPerformanceMetrics(Re,Ne,je){je(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new nn(self)),nn}),le(["./shared"],function(o){var Te="3.10.0";const Pe={create:"create",load:"load",fullLoad:"fullLoad"},ve={mark(F){performance.mark(F)},measure(F,t,l){performance.measure(F,t,l)}};function Ae(F){const t=F.name.split("?")[0];return o.a(t)&&t.includes("mapbox-gl.js")?"javascript":o.a(t)&&t.includes("mapbox-gl.css")?"css":o.b(t)?"fontRange":o.c(t)?"sprite":o.i(t)?"style":o.d(t)?"tilejson":"other"}var Ee,Ie={},ye=function(){if(Ee)return Ie;function F(B){return!t(B)}function t(B){return typeof window>"u"||typeof document>"u"?"not a browser":function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var Z,Y,re=new Blob([""],{type:"text/javascript"}),oe=URL.createObjectURL(re);try{Y=new Worker(oe),Z=!0}catch{Z=!1}return Y&&Y.terminate(),URL.revokeObjectURL(oe),Z}()?function(){var Z=document.createElement("canvas");Z.width=Z.height=1;var Y=Z.getContext("2d");if(!Y)return!1;var re=Y.getImageData(0,0,1,1);return re&&re.width===Z.width}()?(l[G=B&&B.failIfMajorPerformanceCaveat]===void 0&&(l[G]=function(Z){var Y,re=function(oe){var ce=document.createElement("canvas"),he=Object.create(F.webGLContextAttributes);return he.failIfMajorPerformanceCaveat=oe,ce.getContext("webgl2",he)}(Z);if(!re)return!1;try{Y=re.createShader(re.VERTEX_SHADER)}catch{return!1}return!(!Y||re.isContextLost())&&(re.shaderSource(Y,"void main() {}"),re.compileShader(Y),re.getShaderParameter(Y,re.COMPILE_STATUS)===!0)}(G)),l[G]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var G}Ee=1,Ie.supported=F,Ie.notSupportedReason=t;var l={};return F.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},Ie}();function ge(F,t,l){const B=document.createElement(F);return t!=null&&(B.className=t),l&&l.appendChild(B),B}function Se(F,t,l){const B=document.createElementNS("http://www.w3.org/2000/svg",F);for(const G of Object.keys(t))B.setAttributeNS(null,G,String(t[G]));return l&&l.appendChild(B),B}const Ce=typeof document<"u"?document.documentElement&&document.documentElement.style:null,Ve=Ce&&Ce.userSelect!==void 0?"userSelect":"WebkitUserSelect";let at;function et(){Ce&&Ve&&(at=Ce[Ve],Ce[Ve]="none")}function Mt(){Ce&&Ve&&(Ce[Ve]=at)}function jt(F){F.preventDefault(),F.stopPropagation(),window.removeEventListener("click",jt,!0)}function St(){window.addEventListener("click",jt,!0),window.setTimeout(()=>{window.removeEventListener("click",jt,!0)},0)}function Bt(F,t){const l=F.getBoundingClientRect();return wt(F,l,t)}function Zt(F,t){const l=F.getBoundingClientRect(),B=[];for(let G=0;G<t.length;G++)B.push(wt(F,l,t[G]));return B}function xt(F){return/firefox/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)&&F.button===2&&F.ctrlKey?0:F.button}function wt(F,t,l){const B=F.offsetWidth===t.width?1:F.offsetWidth/t.width;return new o.P((l.clientX-t.left)*B,(l.clientY-t.top)*B)}const Je="01",ut="NO_ACCESS_TOKEN";class lt{constructor(t,l,B){this._transformRequestFn=t,this._customAccessToken=l,this._silenceAuthErrors=!!B,this._createSkuToken()}_createSkuToken(){const t=function(){let l="";for(let B=0;B<10;B++)l+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Je,l].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(t,l){return this._transformRequestFn&&this._transformRequestFn(t,l)||{url:t}}normalizeStyleURL(t,l){if(!o.f(t))return t;const B=pi(t);return B.params.push(`sdk=js-${Te}`),B.path=`/styles/v1${B.path}`,this._makeAPIURL(B,this._customAccessToken||l)}normalizeGlyphsURL(t,l){if(!o.f(t))return t;const B=pi(t);return B.path=`/fonts/v1${B.path}`,this._makeAPIURL(B,this._customAccessToken||l)}normalizeModelURL(t,l){if(!o.f(t))return t;const B=pi(t);return B.path=`/models/v1${B.path}`,this._makeAPIURL(B,this._customAccessToken||l)}normalizeSourceURL(t,l,B,G){if(!o.f(t))return t;const Z=pi(t);return Z.path=`/v4/${Z.authority}.json`,Z.params.push("secure"),B&&Z.params.push(`language=${B}`),G&&Z.params.push(`worldview=${G}`),this._makeAPIURL(Z,this._customAccessToken||l)}normalizeIconsetURL(t,l){const B=pi(t);return o.f(t)?(B.path=`/styles/v1${B.path}/iconset.pbf`,this._makeAPIURL(B,this._customAccessToken||l)):si(B)}normalizeSpriteURL(t,l,B,G){const Z=pi(t);return o.f(t)?(Z.path=`/styles/v1${Z.path}/sprite${l}${B}`,this._makeAPIURL(Z,this._customAccessToken||G)):(Z.path+=`${l}${B}`,si(Z))}normalizeTileURL(t,l,B){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!o.f(t))return t;const G=pi(t);G.path=G.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${l||B&&G.authority!=="raster"&&B===512?"@2x":""}${o.m.supported?".webp":"$1"}`),G.authority==="raster"?G.path=`/${o.e.RASTER_URL_PREFIX}${G.path}`:G.authority==="rasterarrays"?G.path=`/${o.e.RASTERARRAYS_URL_PREFIX}${G.path}`:G.authority==="3dtiles"?G.path=`/${o.e.TILES3D_URL_PREFIX}${G.path}`:(G.path=G.path.replace(/^.+\/v4\//,"/"),G.path=`/${o.e.TILE_URL_VERSION}${G.path}`);const Z=this._customAccessToken||function(Y){for(const re of Y){const oe=re.match(/^access_token=(.*)$/);if(oe)return oe[1]}return null}(G.params)||o.e.ACCESS_TOKEN;return o.e.REQUIRE_ACCESS_TOKEN&&Z&&this._skuToken&&G.params.push(`sku=${this._skuToken}`),this._makeAPIURL(G,Z)}canonicalizeTileURL(t,l){const B=pi(t);
273if(!B.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!B.path.match(/\.[\w]+$/))return t;let G="mapbox://";B.path.match(/^\/raster\/v1\//)?G+=`raster/${B.path.replace(`/${o.e.RASTER_URL_PREFIX}/`,"")}`:B.path.match(/^\/rasterarrays\/v1\//)?G+=`rasterarrays/${B.path.replace(`/${o.e.RASTERARRAYS_URL_PREFIX}/`,"")}`:G+=`tiles/${B.path.replace(`/${o.e.TILE_URL_VERSION}/`,"")}`;let Z=B.params;return l&&(Z=Z.filter(Y=>!Y.match(/^access_token=/))),Z.length&&(G+=`?${Z.join("&")}`),G}canonicalizeTileset(t,l){const B=!!l&&o.f(l),G=[];for(const Z of t.tiles||[])o.h(Z)?G.push(this.canonicalizeTileURL(Z,B)):G.push(Z);return G}_makeAPIURL(t,l){const B="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",G=pi(o.e.API_URL);if(t.protocol=G.protocol,t.authority=G.authority,t.protocol==="http"){const Z=t.params.indexOf("secure");Z>=0&&t.params.splice(Z,1)}if(G.path!=="/"&&(t.path=`${G.path}${t.path}`),!o.e.REQUIRE_ACCESS_TOKEN)return si(t);if(l=l||o.e.ACCESS_TOKEN,!this._silenceAuthErrors){if(!l)throw new Error(`An API access token is required to use Mapbox GL. ${B}`);if(l[0]==="s")throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${B}`)}return t.params=t.params.filter(Z=>Z.indexOf("access_token")===-1),t.params.push(`access_token=${l||""}`),si(t)}}const Ye=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function pi(F){const t=F.match(Ye);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 si(F){const t=F.params.length?`?${F.params.join("&")}`:"";return`${F.protocol}://${F.authority}${F.path}${t}`}const rt="mapbox.eventData";function kt(F){if(!F)return null;const t=F.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(o.j(t[1]))}catch{return null}}class _i{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const l=kt(o.e.ACCESS_TOKEN);let B="";return B=l&&l.u?o.k(l.u):o.e.ACCESS_TOKEN||"",t?`${rt}.${t}:${B}`:`${rt}:${B}`}fetchEventData(){const t=o.s("localStorage"),l=this.getStorageKey(),B=this.getStorageKey("uuid");if(t)try{const G=localStorage.getItem(l);G&&(this.eventData=JSON.parse(G));const Z=localStorage.getItem(B);Z&&(this.anonId=Z)}catch{o.w("Unable to read from LocalStorage")}}saveEventData(){const t=o.s("localStorage"),l=this.getStorageKey(),B=this.getStorageKey("uuid"),G=this.anonId;if(t&&G)try{localStorage.setItem(B,G),Object.keys(this.eventData).length>=1&&localStorage.setItem(l,JSON.stringify(this.eventData))}catch{o.w("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,l,B,G){if(!o.e.EVENTS_URL)return;const Z=pi(o.e.EVENTS_URL);Z.params.push(`access_token=${G||o.e.ACCESS_TOKEN||""}`);const Y={event:this.type,created:new Date(t).toISOString()},re=l?o.l(Y,l):Y,oe={url:si(Z),headers:{"Content-Type":"text/plain"},body:JSON.stringify([re])};this.pendingRequest=o.p(oe,ce=>{this.pendingRequest=null,B(ce),this.saveEventData(),this.processRequests(G)})}queueRequest(t,l){this.queue.push(t),this.processRequests(l)}}const Yi=new class extends _i{constructor(F){super("appUserTurnstile"),this._customAccessToken=F}postTurnstileEvent(F,t){o.e.EVENTS_URL&&o.e.ACCESS_TOKEN&&Array.isArray(F)&&F.some(l=>o.f(l)||o.h(l))&&this.queueRequest(Date.now(),t)}processRequests(F){if(this.pendingRequest||this.queue.length===0)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=kt(o.e.ACCESS_TOKEN),l=t?t.u:o.e.ACCESS_TOKEN;let B=l!==this.eventData.tokenU;o.v(this.anonId)||(this.anonId=o.u(),B=!0);const G=this.queue.shift();if(this.eventData.lastSuccess){const Z=new Date(this.eventData.lastSuccess),Y=new Date(G),re=(G-this.eventData.lastSuccess)/864e5;B=B||re>=1||re<-1||Z.getDate()!==Y.getDate()}else B=!0;B?this.postEvent(G,{sdkIdentifier:"mapbox-gl-js",sdkVersion:Te,skuId:Je,"enabled.telemetry":!1,userId:this.anonId},Z=>{Z||(this.eventData.lastSuccess=G,this.eventData.tokenU=l)},F):this.processRequests()}},Lr=Yi.postTurnstileEvent.bind(Yi),Ii=new class extends _i{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(F,t,l,B){this.skuToken=t,this.errorCb=B,o.e.EVENTS_URL&&(l||o.e.ACCESS_TOKEN?this.queueRequest({id:F,timestamp:Date.now()},l):this.errorCb(new Error(ut)))}processRequests(F){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:l}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),o.v(this.anonId)||(this.anonId=o.u(
273)),this.postEvent(l,{sdkIdentifier:"mapbox-gl-js",sdkVersion:Te,skuId:Je,skuToken:this.skuToken,userId:this.anonId},B=>{B?this.errorCb(B):t&&(this.success[t]=!0)},F))}remove(){this.errorCb=null}},en=Ii.postMapLoadEvent.bind(Ii),Rr=new class extends _i{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(F){let t=this.mapInstanceIdMap.get(F);return t||(t=o.u(),this.mapInstanceIdMap.set(F,t)),t}getEventId(F){const t=this.eventIdPerMapInstanceMap.get(F)||0;return this.eventIdPerMapInstanceMap.set(F,t+1),t}postStyleLoadEvent(F,t){const{map:l,style:B,importedStyles:G}=t;if(!o.e.EVENTS_URL||!F&&!o.e.ACCESS_TOKEN)return;const Z=this.getMapInstanceId(l),Y={mapInstanceId:Z,eventId:this.getEventId(Z),style:B};G.length&&(Y.importedStyles=G),this.queueRequest({timestamp:Date.now(),payload:Y},F)}processRequests(F){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:t,payload:l}=this.queue.shift();this.postEvent(t,l,()=>{},F)}},Jr=Rr.postStyleLoadEvent.bind(Rr),kr=new class extends _i{constructor(){super("gljs.performance")}postPerformanceEvent(F,t){o.e.EVENTS_URL&&(F||o.e.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},F)}processRequests(F){if(this.pendingRequest||this.queue.length===0)return;const{timestamp:t,performanceData:l}=this.queue.shift(),B=function(G){const Z=performance.getEntriesByType("resource"),Y=performance.getEntriesByType("mark"),re=function(be){const ze={};if(be){for(const De in be)if(De!=="other")for(const Oe of be[De]){const Fe=`${De}ResolveRangeMin`,Ge=`${De}ResolveRangeMax`,Xe=`${De}RequestCount`,Ze=`${De}RequestCachedCount`;ze[Fe]=Math.min(ze[Fe]||1/0,Oe.startTime),ze[Ge]=Math.max(ze[Ge]||-1/0,Oe.responseEnd);const nt=Qe=>{ze[Qe]===void 0&&(ze[Qe]=0),++ze[Qe]};Oe.transferSize!==void 0&&Oe.transferSize===0&&nt(Ze),nt(Xe)}}return ze}(function(be,ze){const De={};if(be)for(const Oe of be){const Fe=ze(Oe);De[Fe]===void 0&&(De[Fe]=[]),De[Fe].push(Oe)}return De}(Z,Ae)),oe=window.devicePixelRatio,ce=navigator.connection||navigator.mozConnection||navigator.webkitConnection,he=ce?ce.effectiveType:void 0,pe={counters:[],metadata:[],attributes:[]},fe=(be,ze,De)=>{De!=null&&be.push({name:ze,value:De.toString()})};for(const be in re)fe(pe.counters,be,re[be]);if(G.interactionRange[0]!==1/0&&G.interactionRange[1]!==-1/0&&(fe(pe.counters,"interactionRangeMin",G.interactionRange[0]),fe(pe.counters,"interactionRangeMax",G.interactionRange[1])),Y)for(const be of Object.keys(Pe)){const ze=Pe[be],De=Y.find(Oe=>Oe.name===ze);De&&fe(pe.counters,ze,De.startTime)}return fe(pe.counters,"visibilityHidden",G.visibilityHidden),fe(pe.attributes,"style",function(be){if(be)for(const ze of be){const De=ze.name.split("?")[0];if(o.i(De)){const Oe=De.split("/").slice(-2);if(Oe.length===2)return`mapbox://styles/${Oe[0]}/${Oe[1]}`}}}(Z)),fe(pe.attributes,"terrainEnabled",G.terrainEnabled?"true":"false"),fe(pe.attributes,"fogEnabled",G.fogEnabled?"true":"false"),fe(pe.attributes,"projection",G.projection),fe(pe.attributes,"zoom",G.zoom),fe(pe.metadata,"devicePixelRatio",oe),fe(pe.metadata,"connectionEffectiveType",he),fe(pe.metadata,"navigatorUserAgent",navigator.userAgent),fe(pe.metadata,"screenWidth",window.screen.width),fe(pe.metadata,"screenHeight",window.screen.height),fe(pe.metadata,"windowWidth",window.innerWidth),fe(pe.metadata,"windowHeight",window.innerHeight),fe(pe.metadata,"mapWidth",G.width/oe),fe(pe.metadata,"mapHeight",G.height/oe),fe(pe.metadata,"webglRenderer",G.renderer),fe(pe.metadata,"webglVendor",G.vendor),fe(pe.metadata,"sdkVersion",Te),fe(pe.metadata,"sdkIdentifier","mapbox-gl-js"),pe}(l);for(const G of B.metadata);for(const G of B.counters);for(const G of B.attributes);this.postEvent(t,B,()=>{},F)}},Pr=kr.postPerformanceEvent.bind(kr),An=new class extends _i{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(F,t,l,B){if(!o.e.API_URL||!o.e.SESSION_PATH)return;const G=pi(o.e.API_URL+o.e.SESSION_PATH);G.params.push(`sku=${t||""}`),G.params.push(`access_token=${B||o.e.ACCESS_TOKEN||""}`);const Z={url:si(G),headers:{"Content-Type":"text/plain"}};this.pendingRequest=o.g(Z,Y=>{this.pendingRequest=null,l(Y),this.saveEventData(),this.processRequests(B)})}getSessionAPI(F,t,l,B){this.skuToken=t,this.errorCb=B,o.e.SESSION_PATH&&o.e.API_URL&&(l||o.e.ACCESS_TOKEN?this.queueRequest({id:F,timestamp:Date.now()},l):this.errorCb(new Error(ut)))}processRequests(F){if(this.pendingRequest||this.queue.length===0)return;const{id:t,timestamp:l}=this.queue.shift();
273t&&this.success[t]||this.getSession(l,this.skuToken,B=>{B?this.errorCb(B):t&&(this.success[t]=!0)},F)}remove(){this.errorCb=null}},pt=An.getSessionAPI.bind(An),pn=new Set;function Mn(F,t){t?pn.add(F):pn.delete(F)}class fn{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages=new Set}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(t,l){this._updatedSourceCaches[t]=l,this.setDirty()}discardSourceCacheUpdate(t){delete this._updatedSourceCaches[t]}updateLayer(t){const l=t.scope;this._updatedLayers[l]=this._updatedLayers[l]||new Set,this._updatedLayers[l].add(t.id),this.setDirty()}removeLayer(t){const l=t.scope;this._removedLayers[l]=this._removedLayers[l]||{},this._updatedLayers[l]=this._updatedLayers[l]||new Set,this._removedLayers[l][t.id]=t,this._updatedLayers[l].delete(t.id),this._updatedPaintProps.delete(t.fqid),this.setDirty()}getRemovedLayer(t){return this._removedLayers[t.scope]?this._removedLayers[t.scope][t.id]:null}discardLayerRemoval(t){this._removedLayers[t.scope]&&delete this._removedLayers[t.scope][t.id]}getLayerUpdatesByScope(){const t={};for(const l in this._updatedLayers)t[l]=t[l]||{},t[l].updatedIds=Array.from(this._updatedLayers[l].values());for(const l in this._removedLayers)t[l]=t[l]||{},t[l].removedIds=Object.keys(this._removedLayers[l]);return t}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(t){this._updatedPaintProps.add(t.fqid),this.setDirty()}getUpdatedImages(){return Array.from(this._updatedImages.values())}updateImage(t){this._updatedImages.add(t),this.setDirty()}resetUpdatedImages(){this._updatedImages.clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages.clear()}}function Ht(F){const{userImage:t}=F;return!!(t&&t.render&&t.render())&&(F.data.replace(new Uint8Array(t.data.buffer)),!0)}class on extends o.E{constructor(t){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded={},this.requestors=[],this.patterns={},this.atlasImage={},this.atlasTexture={},this.dirty=!0,this.spriteFormat=t,t!=="raster"&&o.t()&&(this.imageRasterizerDispatcher=new o.D(o.x(),this,"Image Rasterizer Worker",1))}get imageRasterizer(){return this._imageRasterizer||(this._imageRasterizer=new o.I),this._imageRasterizer}createScope(t){this.images[t]={},this.loaded[t]=!1,this.updatedImages[t]={},this.patterns[t]={},this.callbackDispatchedThisFrame[t]={},this.atlasImage[t]=new o.r({width:1,height:1})}isLoaded(){for(const t in this.loaded)if(!this.loaded[t])return!1;return!0}setLoaded(t,l){if(this.loaded[l]!==t&&(this.loaded[l]=t,t)){for(const{ids:B,callback:G}of this.requestors)this._notify(B,l,G);this.requestors=[]}}hasImage(t,l){return!!this.getImage(t,l)}getImage(t,l){return this.images[l][t]}addImage(t,l,B){this._validate(t,B)&&(this.images[l][t]=B)}_validate(t,l){let B=!0;return this._validateStretch(l.stretchX,l.data&&l.data.width)||(this.fire(new o.y(new Error(`Image "${t}" has invalid "stretchX" value`))),B=!1),this._validateStretch(l.stretchY,l.data&&l.data.height)||(this.fire(new o.y(new Error(`Image "${t}" has invalid "stretchY" value`))),B=!1),this._validateContent(l.content,l)||(this.fire(new o.y(new Error(`Image "${t}" has invalid "content" value`))),B=!1),B}_validateStretch(t,l){if(!t)return!0;let B=0;for(const G of t){if(G[0]<B||G[1]<G[0]||l<G[1])return!1;B=G[1]}return!0}_validateContent(t,l){return t?t.length!==4||!l.usvg&&(t[0]<0||l.data.width<t[0]||t[1]<0||l.data.height<t[1]||t[2]<0||l.data.width<t[2]||t[3]<0||l.data.height<t[3])?!1:!(t[2]<t[0]||t[3]<t[1]):!0}updateImage(t,l,B){B.version=this.images[l][t].version+1,this.images[l][t]=B,this.updatedImages[l][t]=!0,this.removeFromImageRasterizerCache(t,l)}removeFromImageRasterizerCache(t,l){this.spriteFormat!=="raster"&&(o.t()?this.imageRasterizerDispatcher.getActor().send("removeRasterizedImages",{imageIds:[t],scope:l}):this.imageRasterizer.removeImagesFromCacheByIds([t],l))}removeImage(t,l){const B=this.images[l][t];delete this.images[l][t],delete this.patterns[l][t],this.removeFromImageRasterizerCache(t,l),B.userImage&&B.userImage.onRemove&&B.userImage.onRemove()}listImages(t){return Object.keys(this.images[t])}getImages(t,l,B){let G=!0;const Z=!!this.loaded[l];
273if(!Z)for(const Y of t)this.images[l][Y]||(G=!1);Z||G?this._notify(t,l,B):this.requestors.push({ids:t,scope:l,callback:B})}rasterizeImages({scope:t,imageTasks:l},B){const G={};for(const Z in l){const Y=l[Z],re=this.getImage(Y.id,t);re&&(G[Z]={image:re,imageIdWithOptions:Y})}o.t()?this.imageRasterizerDispatcher.getActor().send("rasterizeImages",{imageTasks:G,scope:t},B):this.rasterizeImagesInMainThread({imageTasks:G,scope:t},B)}rasterizeImagesInMainThread(t,l){const{imageTasks:B,scope:G}=t,Z={};for(const Y in B){const{image:re,imageIdWithOptions:oe}=B[Y];Z[Y]=this.imageRasterizer.rasterize(oe,re,G,"")}l(void 0,Z)}getUpdatedImages(t){return this.updatedImages[t]}_notify(t,l,B){const G={};for(const Z of t){this.images[l][Z]||this.fire(new o.z("styleimagemissing",{id:Z}));const Y=this.images[l][Z];Y?G[Z]={data:Y.usvg?null:Y.data.clone(),pixelRatio:Y.pixelRatio,sdf:Y.sdf,usvg:Y.usvg,version:Y.version,stretchX:Y.stretchX,stretchY:Y.stretchY,content:Y.content,hasRenderCallback:!!(Y.userImage&&Y.userImage.render)}:o.w(`Image "${Z}" 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.`)}B(null,G)}getPixelSize(t){const{width:l,height:B}=this.atlasImage[t];return{width:l,height:B}}getPattern(t,l,B){const G=this.patterns[l][t],Z=this.getImage(t,l);if(!Z)return null;if(G&&G.position.version===Z.version)return G.position;if(G)G.position.version=Z.version;else{Z.usvg&&!Z.data&&(Z.data=this.imageRasterizer.rasterize(o.A.from(t).getPrimary(),Z,l,""));const Y={w:Z.data.width+2*o.B,h:Z.data.height+2*o.B,x:0,y:0},re=new o.C(Y,Z,o.B);this.patterns[l][t]={bin:Y,position:re}}return this._updatePatternAtlas(l,B),this.patterns[l][t].position}bind(t,l){const B=t.gl;let G=this.atlasTexture[l];G?this.dirty&&(G.update(this.atlasImage[l]),this.dirty=!1):(G=new o.T(t,this.atlasImage[l],B.RGBA8),this.atlasTexture[l]=G),G.bind(B.LINEAR,B.CLAMP_TO_EDGE)}_updatePatternAtlas(t,l){const B=[];for(const re in this.patterns[t])B.push(this.patterns[t][re].bin);const{w:G,h:Z}=o.F(B),Y=this.atlasImage[t];Y.resize({width:G||1,height:Z||1});for(const re in this.patterns[t]){const{bin:oe,position:ce}=this.patterns[t][re];let he=ce.padding;const pe=oe.x+he,fe=oe.y+he,be=this.images[t][re].data,ze=be.width,De=be.height;he=he>1?he-1:he,o.r.copy(be,Y,{x:0,y:0},{x:pe,y:fe},{width:ze,height:De},l),o.r.copy(be,Y,{x:0,y:De-he},{x:pe,y:fe-he},{width:ze,height:he},l),o.r.copy(be,Y,{x:0,y:0},{x:pe,y:fe+De},{width:ze,height:he},l),o.r.copy(be,Y,{x:ze-he,y:0},{x:pe-he,y:fe},{width:he,height:De},l),o.r.copy(be,Y,{x:0,y:0},{x:pe+ze,y:fe},{width:he,height:De},l),o.r.copy(be,Y,{x:ze-he,y:De-he},{x:pe-he,y:fe-he},{width:he,height:he},l),o.r.copy(be,Y,{x:0,y:De-he},{x:pe+ze,y:fe-he},{width:he,height:he},l),o.r.copy(be,Y,{x:0,y:0},{x:pe+ze,y:fe+De},{width:he,height:he},l),o.r.copy(be,Y,{x:ze-he,y:0},{x:pe-he,y:fe+De},{width:he,height:he},l)}this.dirty=!0}beginFrame(){for(const t in this.images)this.callbackDispatchedThisFrame[t]={}}dispatchRenderCallbacks(t,l){for(const B of t){if(this.callbackDispatchedThisFrame[l][B])continue;this.callbackDispatchedThisFrame[l][B]=!0;const G=this.images[l][B];Ht(G)&&this.updateImage(B,l,G)}}}function tn(F){const t=F.key,l=F.value,B=F.valueSpec||{},G=F.objectElementValidators||{},Z=F.style,Y=F.styleSpec;let re=[];const oe=o.H(l);if(oe!=="object")return[new o.V(t,l,`object expected, ${oe} found`)];for(const ce in l){const he=ce.split(".")[0];let pe;G[he]?pe=G[he]:B[he]?pe=zi:G["*"]?pe=G["*"]:B["*"]&&(pe=zi),pe?re=re.concat(pe({key:(t&&`${t}.`)+ce,value:l[ce],valueSpec:B[he]||B["*"],style:Z,styleSpec:Y,object:l,objectKey:ce},l)):re.push(new o.G(t,l[ce],`unknown property "${ce}"`))}for(const ce in B)G[ce]||B[ce].required&&B[ce].default===void 0&&l[ce]===void 0&&re.push(new o.V(t,l,`missing required property "${ce}"`));return re}function Kn(F){const t=F.value,l=F.valueSpec,B=F.style,G=F.styleSpec,Z=F.key,Y=F.arrayElementValidator||zi;if(o.H(t)!=="array")return[new o.V(Z,t,`array expected, ${o.H(t)} found`)];if(l.length&&t.length!==l.length)return[new o.V(Z,t,`array length ${l.length} expected, length ${t.length} found`)];if(l["min-length"]&&t.length<l["min-length"])return[new o.V(Z,t,`array length at least ${l["min-length"]} expected, length ${t.length} found`)];let re={type:l.value,values:l.values,minimum:l.minimum,maximum:l.maximum,function:void 0};G.$version<7&&(re.function=l.function),o.H(l.value)==="object"&&(re=l.value);let oe=[];for(let ce=0;ce<t.length;ce++)oe=oe.concat(Y({array:t,arrayIndex:ce,value:t[ce],valueSpec:re,style:B,styleSpec:G,key:`${Z}[${ce}]`},!0));return oe}function Xi(F){const t=F.key,l=F.value,B=F.valueSpec;
273let G=o.H(l);if(G==="number"&&l!=l&&(G="NaN"),G!=="number")return[new o.V(t,l,`number expected, ${G} found`)];if("minimum"in B){let Z=B.minimum;if(o.H(B.minimum)==="array"&&(Z=B.minimum[F.arrayIndex]),l<Z)return[new o.V(t,l,`${l} is less than the minimum value ${Z}`)]}if("maximum"in B){let Z=B.maximum;if(o.H(B.maximum)==="array"&&(Z=B.maximum[F.arrayIndex]),l>Z)return[new o.V(t,l,`${l} is greater than the maximum value ${Z}`)]}return[]}function Gr(F){const t=F.valueSpec,l=o.K(F.value.type);let B,G,Z,Y={};const re=l!=="categorical"&&F.value.property===void 0,oe=!re,ce=o.H(F.value.stops)==="array"&&o.H(F.value.stops[0])==="array"&&o.H(F.value.stops[0][0])==="object",he=tn({key:F.key,value:F.value,valueSpec:F.styleSpec.function,style:F.style,styleSpec:F.styleSpec,objectElementValidators:{stops:function(be){if(l==="identity")return[new o.V(be.key,be.value,'identity function may not have a "stops" property')];let ze=[];const De=be.value;return ze=ze.concat(Kn({key:be.key,value:De,valueSpec:be.valueSpec,style:be.style,styleSpec:be.styleSpec,arrayElementValidator:pe})),o.H(De)==="array"&&De.length===0&&ze.push(new o.V(be.key,De,"array must have at least one stop")),ze},default:function(be){return zi({key:be.key,value:be.value,valueSpec:t,style:be.style,styleSpec:be.styleSpec})}}});return l==="identity"&&re&&he.push(new o.V(F.key,F.value,'missing required property "property"')),l==="identity"||F.value.stops||he.push(new o.V(F.key,F.value,'missing required property "stops"')),l==="exponential"&&F.valueSpec.expression&&!o.L(F.valueSpec)&&he.push(new o.V(F.key,F.value,"exponential functions not supported")),F.styleSpec.$version>=8&&(oe&&!o.M(F.valueSpec)?he.push(new o.V(F.key,F.value,"property functions not supported")):re&&!o.N(F.valueSpec)&&he.push(new o.V(F.key,F.value,"zoom functions not supported"))),l!=="categorical"&&!ce||F.value.property!==void 0||he.push(new o.V(F.key,F.value,'"property" property is required')),he;function pe(be){let ze=[];const De=be.value,Oe=be.key;if(o.H(De)!=="array")return[new o.V(Oe,De,`array expected, ${o.H(De)} found`)];if(De.length!==2)return[new o.V(Oe,De,`array length 2 expected, length ${De.length} found`)];if(ce){if(o.H(De[0])!=="object")return[new o.V(Oe,De,`object expected, ${o.H(De[0])} found`)];if(De[0].zoom===void 0)return[new o.V(Oe,De,"object stop key must have zoom")];if(De[0].value===void 0)return[new o.V(Oe,De,"object stop key must have value")];const Fe=o.K(De[0].zoom);if(typeof Fe!="number")return[new o.V(Oe,De[0].zoom,"stop zoom values must be numbers")];if(Z&&Z>Fe)return[new o.V(Oe,De[0].zoom,"stop zoom values must appear in ascending order")];Fe!==Z&&(Z=Fe,G=void 0,Y={}),ze=ze.concat(tn({key:`${Oe}[0]`,value:De[0],valueSpec:{zoom:{}},style:be.style,styleSpec:be.styleSpec,objectElementValidators:{zoom:Xi,value:fe}}))}else ze=ze.concat(fe({key:`${Oe}[0]`,value:De[0],style:be.style,styleSpec:be.styleSpec},De));return o.O(o.Q(De[1]))?ze.concat([new o.V(`${Oe}[1]`,De[1],"expressions are not allowed in function stops.")]):ze.concat(zi({key:`${Oe}[1]`,value:De[1],valueSpec:t,style:be.style,styleSpec:be.styleSpec}))}function fe(be,ze){const De=o.H(be.value),Oe=o.K(be.value),Fe=be.value!==null?be.value:ze;if(B){if(De!==B)return[new o.V(be.key,Fe,`${De} stop domain type must match previous stop domain type ${B}`)]}else B=De;if(De!=="number"&&De!=="string"&&De!=="boolean"&&typeof Oe!="number"&&typeof Oe!="string"&&typeof Oe!="boolean")return[new o.V(be.key,Fe,"stop domain value must be a number, string, or boolean")];if(De!=="number"&&l!=="categorical"){let Ge=`number expected, ${De} found`;return o.M(t)&&l===void 0&&(Ge+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new o.V(be.key,Fe,Ge)]}return l!=="categorical"||De!=="number"||typeof Oe=="number"&&isFinite(Oe)&&Math.floor(Oe)===Oe?l!=="categorical"&&De==="number"&&typeof Oe=="number"&&typeof G=="number"&&G!==void 0&&Oe<G?[new o.V(be.key,Fe,"stop domain values must appear in ascending order")]:(G=Oe,l==="categorical"&&Oe in Y?[new o.V(be.key,Fe,"stop domain values must be unique")]:(Y[Oe]=!0,[])):[new o.V(be.key,Fe,`integer expected, found ${String(Oe)}`)]}}function Hr(F){const t=(F.expressionContext==="property"?o.S:o.U)(o.Q(F.value),F.valueSpec);if(t.result==="error")return t.value.map(B=>new o.V(`${F.key}${B.key}`,F.value,B.message));const l=t.value.expression||t.value._styleExpression.expression;if(F.expressionContext==="property"&&F.propertyKey==="text-font"&&!l.outputDefined())return[new o.V(F.key,F.value,`Invalid data expression for "${F.propertyKey}". Output values must be contained as literals within the expression.`)];if(F.expressionContext==="property"&&F.propertyType==="layout"&&!o.W(l))return[new o.V(F.key,F.value,'"feature-state" data expressions are not supported with layout properties.')];if(F.expressionContext==="filter")return Rn(l,F);if(F.expressionContext&&F.expressionContext.indexOf("cluster")===0){if(!o.X(l,["zoom","feature-state"]))return[new o.V(F.key,F.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(F.expressionContext==="cluster-initial"&&!o.Y(l))return[new o.V(F.key,F.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Rn(F,t){const l=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(t.valueSpec&&t.valueSpec.expression)for(const G of t.valueSpec.expression.parameters)l.delete(G);if(l.size===0)return[];const B=[];return F instanceof o.Z&&l.has(F.name)?[new o.V(t.key,t.value,`["${F.name}"] expression is not supported in a filter for a ${t.object.type}
273 layer with id: ${t.object.id}`)]:(F.eachChild(G=>{B.push(...Rn(G,t))}),B)}function Nn(F){const t=F.key,l=F.value,B=F.valueSpec,G=[];return Array.isArray(B.values)?B.values.indexOf(o.K(l))===-1&&G.push(new o.V(t,l,`expected one of [${B.values.join(", ")}], ${JSON.stringify(l)} found`)):Object.keys(B.values).indexOf(o.K(l))===-1&&G.push(new o.V(t,l,`expected one of [${Object.keys(B.values).join(", ")}], ${JSON.stringify(l)} found`)),G}function Le(F){return o.$(o.Q(F.value))?Hr(o.J({},F,{expressionContext:"filter",valueSpec:F.styleSpec[`filter_${F.layerType||"fill"}`]})):Ue(F)}function Ue(F){const t=F.value,l=F.key;if(o.H(t)!=="array")return[new o.V(l,t,`array expected, ${o.H(t)} found`)];const B=F.styleSpec;let G,Z=[];if(t.length<1)return[new o.V(l,t,"filter array must have at least 1 element")];switch(Z=Z.concat(Nn({key:`${l}[0]`,value:t[0],valueSpec:B.filter_operator,style:F.style,styleSpec:F.styleSpec})),o.K(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&o.K(t[1])==="$type"&&Z.push(new o.V(l,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&Z.push(new o.V(l,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(G=o.H(t[1]),G!=="string"&&Z.push(new o.V(`${l}[1]`,t[1],`string expected, ${G} found`)));for(let Y=2;Y<t.length;Y++)G=o.H(t[Y]),o.K(t[1])==="$type"?Z=Z.concat(Nn({key:`${l}[${Y}]`,value:t[Y],valueSpec:B.geometry_type,style:F.style,styleSpec:F.styleSpec})):G!=="string"&&G!=="number"&&G!=="boolean"&&Z.push(new o.V(`${l}[${Y}]`,t[Y],`string, number, or boolean expected, ${G} found`));break;case"any":case"all":case"none":for(let Y=1;Y<t.length;Y++)Z=Z.concat(Ue({key:`${l}[${Y}]`,value:t[Y],style:F.style,styleSpec:F.styleSpec}));break;case"has":case"!has":G=o.H(t[1]),t.length!==2?Z.push(new o.V(l,t,`filter array for "${t[0]}" operator must have 2 elements`)):G!=="string"&&Z.push(new o.V(`${l}[1]`,t[1],`string expected, ${G} found`))}return Z}function bt(F,t){const l=F.key,B=F.style,G=F.layer,Z=F.styleSpec,Y=F.value,re=F.objectKey,oe=Z[`${t}_${F.layerType}`];if(!oe)return[];const ce=re.match(/^(.*)-use-theme$/);if(t==="paint"&&ce&&oe[ce[1]])return o.O(Y)?[].concat(zi({key:F.key,value:Y,valueSpec:{type:"string",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},style:B,styleSpec:Z,expressionContext:"property",propertyType:t,propertyKey:re})):zi({key:l,value:Y,valueSpec:{type:"string"},style:B,styleSpec:Z});const he=re.match(/^(.*)-transition$/);if(t==="paint"&&he&&oe[he[1]]&&oe[he[1]].transition)return zi({key:l,value:Y,valueSpec:Z.transition,style:B,styleSpec:Z});const pe=F.valueSpec||oe[re];if(!pe)return[new o.G(l,Y,`unknown property "${re}"`)];let fe;if(o.H(Y)==="string"&&o.M(pe)&&!pe.tokens&&(fe=/^{([^}]+)}$/.exec(Y))){const ze=`\`{ "type": "identity", "property": ${fe?JSON.stringify(fe[1]):'"_"'} }\``;return[new o.V(l,Y,`"${re}" does not support interpolation syntax
274Use an identity property function instead: ${ze}.`)]}const be=[];if(F.layerType==="symbol")re!=="text-field"||!B||B.glyphs||B.imports||be.push(new o.V(l,Y,'use of "text-field" requires a style "glyphs" property')),re==="text-font"&&o.a0(o.Q(Y))&&o.K(Y.type)==="identity"&&be.push(new o.V(l,Y,'"text-font" does not support identity functions'));else if(F.layerType==="model"&&t==="paint"&&G&&G.layout&&G.layout.hasOwnProperty("model-id")&&o.M(pe)&&(o.a1(pe)||o.N(pe))){const ze=o.S(o.Q(Y),pe),De=ze.value.expression||ze.value._styleExpression.expression;De&&!o.X(De,["measure-light"])&&(re==="model-emissive-strength"&&o.Y(De)&&o.W(De)||be.push(new o.V(l,Y,`${re} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)))}return be.concat(zi({key:F.key,value:Y,valueSpec:pe,style:B,styleSpec:Z,expressionContext:"property",propertyType:t,propertyKey:re}))}function It(F){return bt(F,"paint")}function Yt(F){return bt(F,"layout")}function ai(F){let t=[];const l=F.value,B=F.key,G=F.style,Z=F.styleSpec;l.type||l.ref||t.push(new o.V(B,l,'either "type" or "ref" is required'));let Y=o.K(l.type);const re=o.K(l.ref);if(l.id){const oe=o.K(l.id);for(let ce=0;ce<F.arrayIndex;ce++){const he=G.layers[ce];o.K(he.id)===oe&&t.push(new o.V(B,l.id,`duplicate layer id "${l.id}", previously used at line ${he.id.__line__}`))}}if("ref"in l){let oe;["type","source","source-layer","filter","layout"].forEach(ce=>{ce in l&&t.push(new o.V(B,l[ce],`"${ce}" is prohibited for ref layers`))}
274),G.layers.forEach(ce=>{o.K(ce.id)===re&&(oe=ce)}),oe?oe.ref?t.push(new o.V(B,l.ref,"ref cannot reference another ref layer")):Y=o.K(oe.type):typeof re=="string"&&t.push(new o.V(B,l.ref,`ref layer "${re}" not found`))}else if(Y!=="background"&&Y!=="sky"&&Y!=="slot")if(l.source){const oe=G.sources&&G.sources[l.source],ce=oe&&o.K(oe.type);oe?ce==="vector"&&Y==="raster"?t.push(new o.V(B,l.source,`layer "${l.id}" requires a raster source`)):ce==="raster"&&Y!=="raster"?t.push(new o.V(B,l.source,`layer "${l.id}" requires a vector source`)):ce!=="vector"||l["source-layer"]?ce==="raster-dem"&&Y!=="hillshade"?t.push(new o.V(B,l.source,"raster-dem source can only be used with layer type 'hillshade'.")):ce!=="raster-array"||["raster","raster-particle"].includes(Y)?Y!=="line"||!l.paint||!l.paint["line-gradient"]&&!l.paint["line-trim-offset"]||ce==="geojson"&&oe.lineMetrics?Y==="raster-particle"&&ce!=="raster-array"&&t.push(new o.V(B,l.source,`layer "${l.id}" requires a 'raster-array' source.`)):t.push(new o.V(B,l,`layer "${l.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new o.V(B,l.source,"raster-array source can only be used with layer type 'raster'.")):t.push(new o.V(B,l,`layer "${l.id}" must specify a "source-layer"`)):t.push(new o.V(B,l.source,`source "${l.source}" not found`))}else t.push(new o.V(B,l,'missing required property "source"'));return t=t.concat(tn({key:B,value:l,valueSpec:Z.layer,style:F.style,styleSpec:F.styleSpec,objectElementValidators:{"*":()=>[],type:()=>zi({key:`${B}.type`,value:l.type,valueSpec:Z.layer.type,style:F.style,styleSpec:F.styleSpec,object:l,objectKey:"type"}),filter:oe=>Le(o.J({layerType:Y},oe)),layout:oe=>tn({layer:l,key:oe.key,value:oe.value,valueSpec:{},style:oe.style,styleSpec:oe.styleSpec,objectElementValidators:{"*":ce=>Yt(o.J({layerType:Y},ce))}}),paint:oe=>tn({layer:l,key:oe.key,value:oe.value,valueSpec:{},style:oe.style,styleSpec:oe.styleSpec,objectElementValidators:{"*":ce=>It(o.J({layerType:Y,layer:l},ce))}})}})),t}function li(F){const t=F.value,l=F.key,B=o.H(t);return B!=="string"?[new o.V(l,t,`string expected, ${B} found`)]:[]}const di={promoteId:function F({key:t,value:l}){if(o.H(l)==="string")return li({key:t,value:l});if(Array.isArray(l)){const B=[],G=o.Q(l),Z=o.U(G);return Z.result==="error"&&Z.value.forEach(Y=>{B.push(new o.V(`${t}${Y.key}`,null,`${Y.message}`))}),o.X(Z.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"])||B.push(new o.V(`${t}`,null,"promoteId expression should be only feature dependent")),B}{const B=[];for(const G in l)B.push(...F({key:`${t}.${G}`,value:l[G]}));return B}}};function Gi(F){const t=F.value,l=F.key,B=F.styleSpec,G=F.style;if(!t.type)return[new o.V(l,t,'"type" is required')];const Z=o.K(t.type);let Y=[];switch(["vector","raster","raster-dem","raster-array"].includes(Z)&&(t.url||t.tiles||Y.push(new o.G(l,t,'Either "url" or "tiles" is required.'))),Z){case"vector":case"raster":case"raster-dem":case"raster-array":return Y=Y.concat(tn({key:l,value:t,valueSpec:B[`source_${Z.replace("-","_")}`],style:F.style,styleSpec:B,objectElementValidators:di})),Y;case"geojson":if(Y=tn({key:l,value:t,valueSpec:B.source_geojson,style:G,styleSpec:B,objectElementValidators:di}),t.cluster)for(const re in t.clusterProperties){const[oe,ce]=t.clusterProperties[re],he=typeof oe=="string"?[oe,["accumulated"],["get",re]]:oe;Y.push(...Hr({key:`${l}.${re}.map`,value:ce,expressionContext:"cluster-map"})),Y.push(...Hr({key:`${l}.${re}.reduce`,value:he,expressionContext:"cluster-reduce"}))}return Y;case"video":return tn({key:l,value:t,valueSpec:B.source_video,style:G,styleSpec:B});case"image":return tn({key:l,value:t,valueSpec:B.source_image,style:G,styleSpec:B});case"canvas":return[new o.V(l,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Nn({key:`${l}.type`,value:t.type,valueSpec:{values:Ni(B)}})}}function Ni(F){return F.source.reduce((t,l)=>{const B=F[l];return B.type.type==="enum"&&(t=t.concat(Object.keys(B.type.values))),t},[])}function $i(F){const t=F.value,l=F.styleSpec,B=l.light,G=F.style;let Z=[];const Y=o.H(t);if(t===void 0)return Z;if(Y!=="object")return Z=Z.concat([new o.V("light",t,`object expected, ${Y} found`)]),Z;for(const re in t){const oe=re.match(/^(.*)-transition$/),ce=re.match(/^(.*)-use-theme$/);Z=Z.concat(ce&&B[ce[1]]?zi({key:re,value:t[re],valueSpec:{type:"string"},style:G,styleSpec:l}
274):oe&&B[oe[1]]&&B[oe[1]].transition?zi({key:re,value:t[re],valueSpec:l.transition,style:G,styleSpec:l}):B[re]?zi({key:re,value:t[re],valueSpec:B[re],style:G,styleSpec:l}):[new o.V(re,t[re],`unknown property "${re}"`)])}return Z}function er(F){const t=F.value;let l=[];if(!t)return l;const B=o.H(t);if(B!=="object")return l=l.concat([new o.V("light-3d",t,`object expected, ${B} found`)]),l;const G=F.styleSpec,Z=G["light-3d"],Y=F.key,re=F.style,oe=F.style.lights;for(const pe of["type","id"])if(!(pe in t))return l=l.concat([new o.V("light-3d",t,`missing property ${pe} on light`)]),l;if(t.type&&oe)for(let pe=0;pe<F.arrayIndex;pe++){const fe=o.K(t.type),be=oe[pe];o.K(be.type)===fe&&l.push(new o.V(Y,t.id,`duplicate light type "${t.type}", previously defined at line ${be.id.__line__}`))}const ce=`properties_light_${t.type}`;if(!(ce in G))return l=l.concat([new o.V("light-3d",t,`Invalid light type ${t.type}`)]),l;const he=G[ce];for(const pe in t)if(pe==="properties"){const fe=t[pe],be=o.H(fe);if(be!=="object")return l=l.concat([new o.V("properties",fe,`object expected, ${be} found`)]),l;for(const ze in fe)l=l.concat(he[ze]?zi({key:ze,value:fe[ze],valueSpec:he[ze],style:re,styleSpec:G}):[new o.G(F.key,fe[ze],`unknown property "${ze}"`)])}else{const fe=pe.match(/^(.*)-transition$/),be=pe.match(/^(.*)-use-theme$/);l=l.concat(be&&Z[be[1]]?zi({key:pe,value:t[pe],valueSpec:{type:"string"},style:re,styleSpec:G}):fe&&Z[fe[1]]&&Z[fe[1]].transition?zi({key:pe,value:t[pe],valueSpec:G.transition,style:re,styleSpec:G}):Z[pe]?zi({key:pe,value:t[pe],valueSpec:Z[pe],style:re,styleSpec:G}):[new o.G(pe,t[pe],`unknown property "${pe}"`)])}return l}function yr(F){const t=F.value,l=F.key,B=F.style,G=F.styleSpec,Z=G.terrain;let Y=[];const re=o.H(t);if(t===void 0||re==="null")return Y;if(re!=="object")return Y=Y.concat([new o.V("terrain",t,`object expected, ${re} found`)]),Y;for(const oe in t){const ce=oe.match(/^(.*)-transition$/),he=oe.match(/^(.*)-use-theme$/);Y=Y.concat(he&&Z[he[1]]?zi({key:oe,value:t[oe],valueSpec:{type:"string"},style:B,styleSpec:G}):ce&&Z[ce[1]]&&Z[ce[1]].transition?zi({key:oe,value:t[oe],valueSpec:G.transition,style:B,styleSpec:G}):Z[oe]?zi({key:oe,value:t[oe],valueSpec:Z[oe],style:B,styleSpec:G}):[new o.G(oe,t[oe],`unknown property "${oe}"`)])}if(t.source){const oe=B.sources&&B.sources[t.source],ce=oe&&o.K(oe.type);oe?ce!=="raster-dem"&&Y.push(new o.V(l,t.source,`terrain cannot be used with a source of type ${String(ce)}
274, it only be used with a "raster-dem" source type`)):Y.push(new o.V(l,t.source,`source "${t.source}" not found`))}else Y.push(new o.V(l,t,'terrain is missing required property "source"'));return Y}function or(F){const t=F.value,l=F.style,B=F.styleSpec,G=B.fog;let Z=[];const Y=o.H(t);if(t===void 0)return Z;if(Y!=="object")return Z=Z.concat([new o.V("fog",t,`object expected, ${Y} found`)]),Z;for(const re in t){const oe=re.match(/^(.*)-transition$/),ce=re.match(/^(.*)-use-theme$/);Z=Z.concat(ce&&G[ce[1]]?zi({key:re,value:t[re],valueSpec:{type:"string"},style:l,styleSpec:B}):oe&&G[oe[1]]&&G[oe[1]].transition?zi({key:re,value:t[re],valueSpec:B.transition,style:l,styleSpec:B}):G[re]?zi({key:re,value:t[re],valueSpec:G[re],style:l,styleSpec:B}):[new o.G(re,t[re],`unknown property "${re}"`)])}return Z}const wr={"*":()=>[],array:Kn,boolean:function(F){const t=F.value,l=F.key,B=o.H(t);return B!=="boolean"?[new o.V(l,t,`boolean expected, ${B} found`)]:[]},number:Xi,color:function(F){const t=F.key,l=F.value,B=o.H(l);return B!=="string"?[new o.V(t,l,`color expected, ${B} found`)]:o._.parseCSSColor(l)===null?[new o.V(t,l,`color expected, "${l}" found`)]:[]},enum:Nn,filter:Le,function:Gr,layer:ai,object:tn,source:Gi,model:o.a2,light:$i,"light-3d":er,terrain:yr,fog:or,string:li,formatted:function(F){return li(F).length===0?[]:Hr(F)},resolvedImage:function(F){return li(F).length===0?[]:Hr(F)},projection:function(F){const t=F.value,l=F.styleSpec,B=l.projection,G=F.style;let Z=[];const Y=o.H(t);if(Y==="object")for(const re in t)Z=Z.concat(zi({key:re,value:t[re],valueSpec:B[re],style:G,styleSpec:l}));else Y!=="string"&&(Z=Z.concat([new o.V("projection",t,`object or string expected, ${Y} found`)]));return Z},import:function(F){const{value:t,styleSpec:l}=F,{data:B,...G}=t;Object.defineProperty(G,"__line__",{value:t.__line__,enumerable:!1});let Z=tn(o.J({},F,{value:G,valueSpec:l.import}));return o.K(G.id)===""&&Z.push(new o.V(`${F.key}.id`,G,"import id can't be an empty string")),B&&(Z=Z.concat(Vn(B,l,{key:`${F.key}.data`}))),Z}};function zi(F,t=!1){const l=F.value,B=F.valueSpec,G=F.styleSpec;if(B.expression&&o.a0(o.K(l)))return Gr(F);if(B.expression&&o.O(o.Q(l)))return Hr(F);if(B.type&&wr[B.type]){const Z=wr[B.type](F);return t===!0&&Z.length>0&&o.H(F.value)==="array"?Hr(F):Z}return tn(o.J({},F,{valueSpec:B.type?G[B.type]:B}))}function vn(F){const t=F.value,l=F.key,B=li(F);return B.length||(t.indexOf("{fontstack}")===-1&&B.push(new o.V(l,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&B.push(new o.V(l,t,'"glyphs" url must include a "{range}" token'))),B}function Vn(F,t=o.a3,l={}){return zi({key:l.key||"",value:F,valueSpec:t.$root,styleSpec:t,style:F,objectElementValidators:{glyphs:vn,"*":()=>[]}})}function mn(F,t=o.a3){return mr(Vn(F,t))}const rn=F=>mr(Gi(F)),Qn=F=>mr($i(F)),es=F=>mr(er(F)),Ts=F=>mr(yr(F)),Ds=F=>mr(or(F)),qn=F=>mr(function(t){const l=t.value,B=t.style,G=t.styleSpec,Z=G.snow;let Y=[];const re=o.H(l);if(l===void 0)return Y;if(re!=="object")return Y=Y.concat([new o.V("snow",l,`object expected, ${re} found`)]),Y;for(const oe in l){const ce=oe.match(/^(.*)-transition$/);Y=Y.concat(ce&&Z[ce[1]]&&Z[ce[1]].transition?zi({key:oe,value:l[oe],valueSpec:G.transition,style:B,styleSpec:G}):Z[oe]?zi({key:oe,value:l[oe],valueSpec:Z[oe],style:B,styleSpec:G}):[new o.G(oe,l[oe],`unknown property "${oe}"`)])}return Y}(F)),ss=F=>mr(function(t){const l=t.value,B=t.style,G=t.styleSpec,Z=G.rain;let Y=[];const re=o.H(l);if(l===void 0)return Y;if(re!=="object")return Y=Y.concat([new o.V("rain",l,`object expected, ${re} found`)]),Y;for(const oe in l){const ce=oe.match(/^(.*)-transition$/);Y=Y.concat(ce&&Z[ce[1]]&&Z[ce[1]].transition?zi({key:oe,value:l[oe],valueSpec:G.transition,style:B,styleSpec:G}):Z[oe]?zi({key:oe,value:l[oe],valueSpec:Z[oe],style:B,styleSpec:G}):[new o.G(oe,l[oe],`unknown property "${oe}"`)])}return Y}(F)),Oa=F=>mr(ai(F)),ln=F=>mr(Le(F)),Ba=F=>mr(It(F)),ra=F=>mr(Yt(F)),Na=F=>mr(o.a2(F));function mr(F){return F.slice().sort((t,l)=>t.line&&l.line?t.line-l.line:0)}function nn(F,t){let l=!1;if(t&&t.length)for(const B of t)B instanceof o.G?o.w(B.message):(F.fire(new o.y(new Error(B.message))),l=!0);return l}let Lt;class Re extends o.E{constructor(t,l="flat"){super(),this._transitionable=new o.a4(Lt||(Lt=new o.a5({anchor:new o.a6(o.a3.light.anchor),position:new o.a7(o.a3.light.position),color:new o.a6(o.a3.light.color),intensity:new o.a6(o.a3.light.intensity)}))),this.setLight(t,l),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,l,B={}
274){this._validate(Qn,t,B)||(this._transitionable.setTransitionOrValue(t),this.id=l)}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,l,B){return(!B||B.validate!==!1)&&nn(this,t.call(mn,o.l({value:l,style:{glyphs:!0,sprite:!0},styleSpec:o.a3})))}}let Ne=class extends o.E{constructor(F,t,l,B){super(),this.scope=l,this._transitionable=new o.a4(new o.a5({source:new o.a6(o.a3.terrain.source),exaggeration:new o.a6(o.a3.terrain.exaggeration)}),l,B),this._transitionable.setTransitionOrValue(F,B),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=t}get(){return this._transitionable.serialize()}set(F,t){this._transitionable.setTransitionOrValue(F,t)}updateTransitions(F){this._transitioning=this._transitionable.transitioned(F,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(F){this.properties=this._transitioning.possiblyEvaluate(F)}getExaggeration(F){return this._transitioning.possiblyEvaluate(new o.a8(F)).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const F=this._transitionable._values.exaggeration;if(!F)return null;const t=F.value.expression;if(!t)return null;let l=-1,B=-1,G=1;for(const Z of t.zoomStops)G=t.evaluate(new o.a8(Z)),G>.01?(l=Z,B=-1):B=Z;return G<.01&&l>0&&B>l?[l,B]:null}isZoomDependent(){const F=this._transitionable._values.exaggeration;return F!=null&&F.value!=null&&F.value.expression!=null&&F.value.expression instanceof o.a9}};const je=45,tt=65,ot=.05;function mt(F,t,l,B){const G=o.ac(je,tt,l),[Z,Y]=Pt(F,B);let re=1-Math.min(1,Math.exp((t-Z)/(Y-Z)*-6));return re*=re*re,re=Math.min(1,1.00747*re),re*G*F.alpha}function Pt(F,t){const l=.5/Math.tan(.5*t);return[F.range[0]+l,F.range[1]+l]}function gt(F,t,l,B,G){const Z=o.ab.vec3.transformMat4([],[t,l,B],G.mercatorFogMatrix);return mt(F,o.ab.vec3.length(Z),G.pitch,G._fov)}function Ft(F,t,l,B,G,Z,Y){const re=[[l,B,0],[G,B,0],[G,Z,0],[l,Z,0]];let oe=Number.MAX_VALUE,ce=-Number.MAX_VALUE;for(const he of re){const pe=o.ab.vec3.transformMat4([],he,t),fe=o.ab.vec3.length(pe);oe=Math.min(oe,fe),ce=Math.max(ce,fe)}return[mt(F,oe,Y.pitch,Y._fov),mt(F,ce,Y.pitch,Y._fov)]}class zt extends o.E{constructor(t,l,B,G){super();const Z=new o.a5({range:new o.a6(o.a3.fog.range),color:new o.a6(o.a3.fog.color),"color-use-theme":new o.a6({type:"string","property-type":"data-constant",default:"default"}),"high-color":new o.a6(o.a3.fog["high-color"]),"high-color-use-theme":new o.a6({type:"string","property-type":"data-constant",default:"default"}),"space-color":new o.a6(o.a3.fog["space-color"]),"space-color-use-theme":new o.a6({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new o.a6(o.a3.fog["horizon-blend"]),"star-intensity":new o.a6(o.a3.fog["star-intensity"]),"vertical-range":new o.a6(o.a3.fog["vertical-range"])});this._transitionable=new o.a4(Z,B,new Map(G)),this.set(t,G),this._transitioning=this._transitionable.untransitioned(),this._transform=l,this.properties=new o.ad(Z),this.scope=B}get state(){const t=this._transform,l=t.projection.name==="globe",B=o.ae(t.zoom),G=this.properties.get("range"),Z=[.5,3];return{range:l?[o.af(Z[0],G[0],B),o.af(Z[1],G[1],B)]:G,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(t,l,B={}){if(this._validate(Ds,t,B))return;const G=o.l({},t);for(const Z of Object.keys(o.a3.fog))G[Z]===void 0&&(G[Z]=o.a3.fog[Z].default);this._options=G,this._transitionable.setTransitionOrValue(this._options,l)}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const l=this.properties&&this.properties.get("color")||1;return(this._transform.projection.name==="globe"?1:o.ac(je,tt,t))*l.a}getOpacityAtLatLng(t,l){return this._transform.projection.supportsFog?function(B,G,Z){const Y=o.aa.fromLngLat(G),re=Z.elevation?Z.elevation.getAtPointOrZero(Y):0;return gt(B,Y.x,Y.y,re,Z)}(this.state,t,l):0}getOpacityForTile(t){if(!this._transform.projection.supportsFog)return[1,1];const l=this._transform.calculateFogTileMatrix(t.toUnwrapped());return Ft(this.state,l,0,0,o.ag,o.ag,this._transform)}getOpacityForBounds(t,l,B,G,Z){return this._transform.projection.supportsFog?Ft(this.state,t,l,B,G,Z,this._transform):[1,1]}getFovAdjustedRange(t){return this._transform.projection.supportsFog?Pt(this.state,t):[0,1]}isVisibleOnFrustum(t){if(!this._transform.projection.supportsFog)return!1;const l=[4,5,6,7];for(const B of l){const G=t.points[B];let Z;if(G[2]>=0)Z=G;else{const Y=t.points[B-4];Z=o.ah(Y,G,Y[2]/(Y[2]-G[2]))}if(gt(this.state,Z[0],Z[1],0,this._transform)>=ot)return!0}return!1}updateConfig(t){this._transitionable.setTransitionOrValue(this._options,new Map(t))}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,l,B){return(!B||B.validate!==!1)&&nn(this,t.call(mn,o.l({value:l,style:{glyphs:!0,sprite:!0},styleSpec:o.a3})))}}let Ot,Kt,ui,fi,Di=class extends o.E{constructor(F,t,l,B){super();const G=Ot||(Ot=new o.a5({density:new o.a6(o.a3.snow.density),intensity:new o.a6(o.a3.snow.intensity),color:new o.a6(o.a3.snow.color),opacity:new o.a6(o.a3.snow.opacity),vignette:new o.a6(o.a3.snow.vignette),"vignette-color":new o.a6(o.a3.snow["vignette-color"]),"center-thinning":new o.a6(o.a3.snow["center-thinning"]),direction:new o.a6(o.a3.snow.direction),"flake-size":new o.a6(o.a3.snow["flake-size"])}));this._transitionable=new o.a4(G,l,new Map(B)),this.set(F,B),this._transitioning=this._transitionable.untransitioned(),this.properties=new o.ad(G),this.scope=l}get state(){const F=this.properties.get("opacity"),t=this.properties.get("color"),l=this.properties.get("direction"),B=o.ai(l[0]),G=-Math.max(o.ai(l[1]),.01),Z=[Math.cos(B)*Math.cos(G),Math.sin(B)*Math.cos(G),Math.sin(G)],Y=this.properties.get("vignette"),re=this.properties.get("vignette-color");return re.a=Y,{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new o.aj(t.r,t.g,t.b,t.a*F),direction:Z,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:re}}get(){return this._transitionable.serialize()}set(F,t,l={}
vendor: 6,023 bytes, line 274
274){if(this._validate(qn,F,l))return;const B=o.l({},F);for(const G of Object.keys(o.a3.snow))B[G]===void 0&&(B[G]=o.a3.snow[G].default);this._options=B,this._transitionable.setTransitionOrValue(this._options,t)}updateConfig(F){this._transitionable.setTransitionOrValue(this._options,new Map(F))}updateTransitions(F){this._transitioning=this._transitionable.transitioned(F,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(F){this.properties=this._transitioning.possiblyEvaluate(F)}_validate(F,t,l){return(!l||l.validate!==!1)&&nn(this,F.call(mn,o.l({value:t,style:{glyphs:!0,sprite:!0},styleSpec:o.a3})))}},Fi=class extends o.E{constructor(F,t,l,B){super();const G=Kt||(Kt=new o.a5({density:new o.a6(o.a3.rain.density),intensity:new o.a6(o.a3.rain.intensity),color:new o.a6(o.a3.rain.color),opacity:new o.a6(o.a3.rain.opacity),vignette:new o.a6(o.a3.rain.vignette),"vignette-color":new o.a6(o.a3.rain["vignette-color"]),"center-thinning":new o.a6(o.a3.rain["center-thinning"]),direction:new o.a6(o.a3.rain.direction),"droplet-size":new o.a6(o.a3.rain["droplet-size"]),"distortion-strength":new o.a6(o.a3.rain["distortion-strength"])}));this._transitionable=new o.a4(G,l,new Map(B)),this.set(F,B),this._transitioning=this._transitionable.untransitioned(),this.properties=new o.ad(G),this.scope=l}get state(){const F=this.properties.get("opacity"),t=this.properties.get("color"),l=this.properties.get("direction"),B=o.ai(l[0]),G=-Math.max(o.ai(l[1]),.01),Z=[Math.cos(B)*Math.cos(G),Math.sin(B)*Math.cos(G),Math.sin(G)],Y=this.properties.get("vignette-color");return Y.a=this.properties.get("vignette"),{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new o.aj(t.r,t.g,t.b,t.a*F),direction:Z,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:Y}}get(){return this._transitionable.serialize()}set(F,t,l={}){if(this._validate(ss,F,l))return;const B=o.l({},F);for(const G of Object.keys(o.a3.rain))B[G]===void 0&&(B[G]=o.a3.rain[G].default);this._options=B,this._transitionable.setTransitionOrValue(this._options,t)}updateConfig(F){this._transitionable.setTransitionOrValue(this._options,new Map(F))}updateTransitions(F){this._transitioning=this._transitionable.transitioned(F,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(F){this.properties=this._transitioning.possiblyEvaluate(F)}_validate(F,t,l){return(!l||l.validate!==!1)&&nn(this,F.call(mn,o.l({value:t,style:{glyphs:!0,sprite:!0},styleSpec:o.a3})))}};class Oi extends o.E{constructor(t,l,B,G){super(),this.scope=B,this._options=t,this.properties=new o.ad(l),this._transitionable=new o.a4(l,B,new Map(G)),this._transitionable.setTransitionOrValue(t.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(t){this._transitionable.setTransitionOrValue(this._options.properties,new Map(t))}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(t,l){this._options=t,this._transitionable.setTransitionOrValue(t.properties,l)}shadowsEnabled(){return!!this.properties&&this.properties.get("cast-shadows")===!0}}class Li{constructor(t,l,B,G){this.screenBounds=t,this.cameraPoint=l,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=B,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,G)}static createFromScreenPoints(t,l){let B,G;if(t instanceof o.P||typeof t[0]=="number"){const Z=o.P.convert(t);B=[Z],G=l.isPointAboveHorizon(Z)}else{const Z=o.P.convert(t[0]),Y=o.P.convert(t[1]);B=[Z,Y],G=o.al(Z,Y).every(re=>l.isPointAboveHorizon(re))}return new Li(B,l.getCameraPoint(),G,l)}isPointQuery(){return this.screenBounds.length===1}bufferedScreenGeometry(t){return o.al(this.screenBounds[0],this.screenBounds.length===1?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const l=this.screenBounds[0],B=this.screenBounds.length===1?this.screenBounds[0].add(new o.P(1,1)):this.screenBounds[1],G=o.al(l,B,0,!1);return this.cameraPoint.y>B.y&&(this.cameraPoint.x>l.x&&this.cameraPoint.x<B.x?G.splice(3,0,this.cameraPoint):this.cameraPoint.x>=B.x?G[2]=this.cameraPoint:this.cameraPoint.x<=l.x&&(G[3]=this.cameraPoint)),o.am(G,t)}bufferedCameraGeometryGlobe(t){const l=this.screenBounds[0],B=this.screenBounds.length===1?this.screenBounds[0].add(new o.P(1,1)):this.screenBounds[1],G=o.al(l,B,t),Z=this.cameraPoint.clone();switch(3*((Z.y>l.y)+(Z.y>B.y))+((Z.x>l.x)+(Z.x>B.x))){case 0:G[0]=Z,G[4]=Z.clone();break;case 1:G.splice(1,0,Z);break;case 2:G[1]=Z;break;case 3:G.splice(4,0,Z);break;case 5:G.splice(2,0,Z);break;case 6:G[3]=Z;break;case 7:G.splice(3,0,Z);break;case 8:G[2]=Z}return G}containsTile(t,l,B,G=0){const Z=t.queryPadding/l._pixelsPerMercatorPixel+1,Y=B?this._bufferedCameraMercator(Z,l):this._bufferedScreenMercator(Z,l);let re=t.tileID.wrap+(Y.unwrapped?G:0);const oe=Y.polygon.map(Oe=>o.an(t.tileTransform,Oe,re));if(!o.ao(oe,0,0,o.ag,o.ag))return;re=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?G:0);const ce=this.screenGeometryMercator.polygon.map(Oe=>o.ap(t.tileTransform,Oe,re)),he=ce.map(Oe=>new o.P(Oe[0],Oe[1])),pe=l.getFreeCameraOptions().position||new o.aa(0,0,0),fe=o.ap(t.tileTransform,pe,re),be=ce.map(Oe=>{const Fe=o.ab.vec3.sub(Oe,Oe,fe);return o.ab.vec3.normalize(Fe,Fe),new o.aq(fe,Fe)}),ze=o.ar(t,1,l.zoom)*l._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:he,tilespaceRays:be,bufferedTilespaceGeometry:oe,bufferedTilespaceBounds:(De=o.as(oe),De.min.x=o.aw(De.min.x,0,o.ag),De.min.y=o.aw(De.min.y,0,o.ag),De.max.x=o.aw(De.max.x,0,o.ag),De.max.y=o.aw(De.max.y,0,o.ag),De),tile:t,t
274ileID:t.tileID,pixelToTileUnitsFactor:ze};var De}_bufferedScreenMercator(t,l){const B=tr(t);if(this._screenRaycastCache[B])return this._screenRaycastCache[B];{let G;return G=l.projection.name==="globe"?this._projectAndResample(this.bufferedScreenGeometry(t),l):{polygon:this.bufferedScreenGeometry(t).map(Z=>l.pointCoordinate3D(Z)),unwrapped:!0},this._screenRaycastCache[B]=G,G}}_bufferedCameraMercator(t,l){const B=tr(t);if(this._cameraRaycastCache[B])return this._cameraRaycastCache[B];{let G;return G=l.projection.name==="globe"?this._projectAndResample(this.bufferedCameraGeometryGlobe(t),l):{polygon:this.bufferedCameraGeometry(t).map(Z=>l.pointCoordinate3D(Z)),unwrapped:!0},this._cameraRaycastCache[B]=G,G}}_projectAndResample(t,l){const B=function(Z,Y){const re=o.ab.mat4.multiply([],Y.pixelMatrix,Y.globeMatrix),oe=[0,-o.ax,0,1],ce=[0,o.ax,0,1],he=[0,0,0,1];o.ab.vec4.transformMat4(oe,oe,re),o.ab.vec4.transformMat4(ce,ce,re),o.ab.vec4.transformMat4(he,he,re);const pe=new o.P(oe[0]/oe[3],oe[1]/oe[3]),fe=new o.P(ce[0]/ce[3],ce[1]/ce[3]),be=o.au(Z,pe)&&oe[3]<he[3],ze=o.au(Z,fe)&&ce[3]<he[3];if(!be&&!ze)return null;const De=function(it,Ke,ht){for(let yt=1;yt<it.length;yt++){const Nt=dr(Ke.pointCoordinate3D(it[yt-1]).x),Dt=dr(Ke.pointCoordinate3D(it[yt]).x);if(ht<0){if(Nt<Dt)return{idx:yt,t:-Nt/(Dt-1-Nt)}}else if(Dt<Nt)return{idx:yt,t:(1-Nt)/(Dt+1-Nt)}}return null}(Z,Y,be?-1:1);if(!De)return null;const{idx:Oe,t:Fe}=De;let Ge=Oe>1?lr(Z.slice(0,Oe),Y):[],Xe=Oe<Z.length?lr(Z.slice(Oe),Y):[];Ge=Ge.map(it=>new o.P(dr(it.x),it.y)),Xe=Xe.map(it=>new o.P(dr(it.x),it.y));const Ze=[...Ge];Ze.length===0&&Ze.push(Xe[Xe.length-1]);const nt=o.af(Ze[Ze.length-1].y,(Xe.length===0?Ge[0]:Xe[0]).y,Fe);let Qe;return Qe=be?[new o.P(0,nt),new o.P(0,0),new o.P(1,0),new o.P(1,nt)]:[new o.P(1,nt),new o.P(1,1),new o.P(0,1),new o.P(0,nt)],Ze.push(...Qe),Xe.length===0?Ze.push(Ge[0]):Ze.push(...Xe),{polygon:Ze.map(it=>new o.aa(it.x,it.y)),unwrapped:!1}}(t,l);if(B)return B;const G=function(Z,Y){let re=!1,oe=-1/0,ce=0;for(let pe=0;pe<Z.length-1;pe++)Z[pe].x>oe&&(oe=Z[pe].x,ce=pe);for(let pe=0;pe<Z.length-1;pe++){const fe=(ce+pe)%(Z.length-1),be=Z[fe],ze=Z[fe+1];Math.abs(be.x-ze.x)>.5&&(be.x<ze.x?(be.x+=1,fe===0&&(Z[Z.length-1].x+=1)):(ze.x+=1,fe+1===Z.length-1&&(Z[0].x+=1)),re=!0)}const he=o.at(Y.center.lng);return re&&he<Math.abs(he-1)&&Z.forEach(pe=>{pe.x-=1}),{polygon:Z,unwrapped:re}}(lr(t,l).map(Z=>new o.P(dr(Z.x),Z.y)),l);return{polygon:G.polygon.map(Z=>new o.aa(Z.x,Z.y)),unwrapped:G.unwrapped}}}function lr(F,t){return o.av(F,l=>{const B=t.pointCoordinate3D(l);l.x=B.x,l.y=B.y},1/256)}function dr(F){return F<0?1+F%1:F%1}function tr(F){return 100*F|0}function gr(F,t,l,B,G){const Z=function(re,oe){if(re)return G(re);if(oe){if(F.url&&oe.tiles&&F.tiles&&delete F.tiles,oe.variants){if(!Array.isArray(oe.variants))return G(new Error("variants must be an array"));for(const he of oe.variants){if(he==null||typeof he!="object"||he.constructor!==Object)return G(new Error("variant must be an object"));if(!Array.isArray(he.capabilities))return G(new Error("capabilities must be an array"));if(he.capabilities.length===1&&he.capabilities[0]==="meshopt"){oe=o.l(oe,he);break}}}const ce=o.ay(o.l({},oe,F),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);ce.tiles=t.canonicalizeTileset(ce,F.url),G(null,ce)}},Y=function(re,oe,ce){if(!re)return null;if(!oe&&!ce)return re;ce=ce||re.worldview_default;const he=Object.values(re.language||{});if(he.length===0)return null;const pe=Object.values(re.worldview||{});if(pe.length===0)return null;const fe=he.every(ze=>ze===oe),be=pe.every(ze=>ze===ce);return fe&&be?re:oe in(re.language_options||{})||ce in(re.worldview_options||{})?null:re.language_options&&re.worldview_options?re:null}(F.data,l,B);return Y?o.q.frame(()=>Z(null,Y)):F.url?o.n(t.transformRequest(t.normalizeSourceURL(F.url,null,l,B),o.R.Source),Z):o.q.frame(()=>{const{data:re,...oe}=F;Z(null,oe)})}class xr{constructor(t,l,B){this.bounds=o.az.convert(this.validateBounds(t)),this.minzoom=l||0,this.maxzoom=B||24}
274validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const l=Math.pow(2,t.z),B=Math.floor(o.at(this.bounds.getWest())*l),G=Math.floor(o.aA(this.bounds.getNorth())*l),Z=Math.ceil(o.at(this.bounds.getEast())*l),Y=Math.ceil(o.aA(this.bounds.getSouth())*l);return t.x>=B&&t.x<Z&&t.y>=G&&t.y<Y}}class gn extends o.E{constructor(t,l,B,G){if(super(),this.id=t,this.dispatcher=B,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,o.l(this,o.ay(l,["url","scheme","tileSize","promoteId"])),this._options=o.l({type:"vector"},l),this._collectResourceTiming=!!l.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(G),this._tileWorkers={},this._deduped=new o.aB}load(t){this._loaded=!1,this.fire(new o.z("dataloading",{dataType:"source"}));const l=Array.isArray(this.map._language)?this.map._language.join():this.map._language,B=this.map.getWorldview();this._tileJSONRequest=gr(this._options,this.map._requestManager,l,B,(G,Z)=>{if(this._tileJSONRequest=null,this._loaded=!0,G)l&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${l}`),B&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${B}`),this.fire(new o.y(G));else if(Z){if(o.l(this,Z),this.hasWorldviews=!!Z.worldview_options,Z.worldview_default&&(this.worldviewDefault=Z.worldview_default),Z.vector_layers){this.vectorLayers=Z.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const Y of Z.vector_layers)this.vectorLayerIds.push(Y.id),Z.worldview&&Z.worldview[Y.source]&&this.localizableLayerIds.add(Y.id)}Z.bounds&&(this.tileBounds=new xr(Z.bounds,this.minzoom,this.maxzoom)),Lr(Z.tiles,this.map._requestManager._customAccessToken),this.fire(new o.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.z("data",{dataType:"source",sourceDataType:"content"}))}t&&t(G)})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}reload(){this.cancelTileJSONRequest();const t=o.aC(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}setTiles(t){return this._options.tiles=t,this.reload(),this}setUrl(t){return this.url=t,this._options.url=t,this.reload(),this}onRemove(t){this.cancelTileJSONRequest()}serialize(){return o.l({},this._options)}loadTile(t,l){const B=t.tileID.canonical.url(this.tiles,this.scheme),G=this.map._requestManager.normalizeTileURL(B),Z=this.map._requestManager.transformRequest(G,o.R.Tile),Y=this.map.style?this.map.style.getLut(this.scope):null,re=Y?{image:Y.image.clone()}:null,oe={request:Z,data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,lut:re,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
274ype,source:this.id,scope:this.scope,pixelRatio:o.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor()};if(this.hasWorldviews&&o.f(B)&&(oe.worldview=this.map.getWorldview()||this.worldviewDefault,oe.localizableLayerIds=this.localizableLayerIds),oe.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired")t.state==="loading"?t.reloadCallback=l:t.request=t.actor.send("reloadTile",oe,ce.bind(this));else if(t.actor=this._tileWorkers[G]=this._tileWorkers[G]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",oe,ce.bind(this),void 0,!0);else{const he=o.aD.call({deduped:this._deduped},oe,(pe,fe)=>{pe||!fe?ce.call(this,pe):(oe.data={cacheControl:fe.cacheControl,expires:fe.expires,rawData:fe.rawData.slice(0)},t.actor&&t.actor.send("loadTile",oe,ce.bind(this),void 0,!0))},!0);t.request={cancel:he}}function ce(he,pe){return delete t.request,t.aborted?l(null):he&&he.status!==404?l(he):(pe&&pe.resourceTiming&&(t.resourceTiming=pe.resourceTiming),this.map._refreshExpiredTiles&&pe&&t.setExpiryData(pe),t.loadVectorData(pe,this.map.painter),o.aE(this.dispatcher),l(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.t
274ype,source:this.id,scope:this.scope})}unloadTile(t,l){t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id,scope:this.scope}),t.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Us extends o.E{constructor(t,l,B,G){super(),this.id=t,this.dispatcher=B,this.setEventedParent(G),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=o.l({type:"raster"},l),o.l(this,o.ay(l,["url","scheme","tileSize"]))}load(t){this._loaded=!1,this.fire(new o.z("dataloading",{dataType:"source"})),this._tileJSONRequest=gr(this._options,this.map._requestManager,null,null,(l,B)=>{this._tileJSONRequest=null,this._loaded=!0,l?this.fire(new o.y(l)):B&&(o.l(this,B),B.raster_layers&&(this.rasterLayers=B.raster_layers,this.rasterLayerIds=this.rasterLayers.map(G=>G.id)),B.bounds&&(this.tileBounds=new xr(B.bounds,this.minzoom,this.maxzoom)),Lr(B.tiles),this.fire(new o.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.z("data",{dataType:"source",sourceDataType:"content"}))),t&&t(l)})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}reload(){this.cancelTileJSONRequest();const t=o.aC(this.id,this.scope);this.load(()=>this.map.style.clearSource(t))}setTiles(t){return this._options.tiles=t,this.reload(),this}setUrl(t){return this.url=t,this._options.url=t,this.reload(),this}onRemove(t){this.cancelTileJSONRequest()}serialize(){return o.l({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,l){const B=o.q.devicePixelRatio>=2,G=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),B,this.tileSize);t.request=o.o(this.map._requestManager.transformRequest(G,o.R.Tile),(Z,Y,re,oe)=>(delete t.request,t.aborted?(t.state="unloaded",l(null)):Z?(t.state="errored",l(Z)):Y?(this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:re,expires:oe}),t.setTexture(Y,this.map.painter),t.state="loaded",o.aE(this.dispatcher),void l(null)):l(null)))}abortTile(t,l){t.request&&(t.request.cancel(),delete t.request),l&&l()}unloadTile(t,l){t.texture&&t.texture instanceof o.T?(t.destroy(!0),t.texture&&t.texture instanceof o.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),l&&l()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Tn extends Us{constructor(t,l,B,G){super(t,l,B,G),this.type="raster-array",this.maxzoom=22,this._options=o.l({type:"raster-array"},l)}triggerRepaint(t){const l=this.map.painter._terrain,B=this.map.style.getSourceCache(this.id);l&&l.enabled&&B&&l._clearRenderCacheForTile(B.id,t.tileID),this.map.triggerRepaint()}loadTile(t,l){const B=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),G=this.map._requestManager.transformRequest(B,o.R.Tile);t.requestParams=G,t.actor||(t.actor=this.dispatcher.getActor()),t.request=t.fetchHeader(void 0,(Z,Y,re,oe)=>{if(delete t.request,t.aborted)return t.state="unloaded",l(null);if(Z)return Z.code===20?void 0:(t.state="errored",l(Z));this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:re,expires:oe}),t.state="empty",l(null)})}unloadTile(t,l){const B=t.texture;B&&B instanceof o.T?(t.destroy(!0),this.map.painter.saveTileTexture(B)):(t.destroy(),t.flushQueues(),t._isHeaderLoaded=!1,delete t._mrt,delete t.textureDescriptor),t.fbo&&(t.fbo.destroy(),delete t.fbo),delete t.request,delete t.requestParams,delete t.neighboringTiles,t.state="unloaded"}prepareTile(t,l,B){t._isHeaderLoaded&&(t.state!=="empty"&&(t.state="reloading"),t.fetchBand(l,B,(G,Z)=>{if(G)return t.state="errored",this.fire(new o.y(G)),void this.triggerRepaint(t);Z&&(t.setTexture(Z,this.map.painter),t.state="loaded",this.triggerRepaint(t))}))}getInitialBand(t){if(!this.rasterLayers)return 0;const l=this.rasterLayers.find(({id:Z})=>Z===t),B=l&&l.fields,G=B&&B.bands&&B.bands;return G?G[0]:0}getTextureDescriptor(t,l,B){if(!t)return;const G=l.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!G)return;let Z=null;l instanceof o.aH?Z=l.paint.get("raster-array-band"):l instanceof o.aI&&(Z=l.paint.get("raster-particle-array-band"));const Y=Z||this.getInitialBand(G);if(Y!=null)if(t.textureDescriptor){if(!t.updateNeeded(G,Y)||B)return Object.assign({},t.textureDescriptor,{texture:t.texture})}else this.prepareTile(t,G,Y)}}const Pn={vector:gn,raster:Us,"raster-dem":class extends Us{constructor(F,t,l,B){super(F,t,l,B),this.type="raster-dem",this.maxzoom=22,this._options=o.l({type:"raster-dem"},t),this.encoding=t.encoding||"mapbox"}loadTile(F,t){const l=this.map._requestManager.normalizeTileURL(F.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function B(G,Z){G&&(F.state="errored",t(G)),Z&&(F.dem=Z,F.dem.onDeserialize(),F.needsHillshadePrepare=!0,F.needsDEMTextureUpload=!0,F.state="loaded",t(null))}F.request=o.o(this.map._requestManager.transformRequest(l,o.R.Tile),(function(G,Z,Y,re){if(delete F.request,F.aborted)F.state="unloaded",t(null);else if(G)F.state="errored",t(G);
274else if(Z){this.map._refreshExpiredTiles&&F.setExpiryData({cacheControl:Y,expires:re});const oe=ImageBitmap&&Z instanceof ImageBitmap&&o.t(),ce=1-(Z.width-o.aF(Z.width))/2;ce<1||F.neighboringTiles||(F.neighboringTiles=this._getNeighboringTiles(F.tileID));const he=oe?Z:o.q.getImageData(Z,ce),pe={uid:F.uid,coord:F.tileID,source:this.id,scope:this.scope,rawImageData:he,encoding:this.encoding,padding:ce};F.actor&&F.state!=="expired"||(F.actor=this.dispatcher.getActor(),F.actor.send("loadDEMTile",pe,B.bind(this),void 0,!0))}}).bind(this))}_getNeighboringTiles(F){const t=F.canonical,l=Math.pow(2,t.z),B=(t.x-1+l)%l,G=t.x===0?F.wrap-1:F.wrap,Z=(t.x+1+l)%l,Y=t.x+1===l?F.wrap+1:F.wrap,re={};return re[new o.aG(F.overscaledZ,G,t.z,B,t.y).key]={backfilled:!1},re[new o.aG(F.overscaledZ,Y,t.z,Z,t.y).key]={backfilled:!1},t.y>0&&(re[new o.aG(F.overscaledZ,G,t.z,B,t.y-1).key]={backfilled:!1},re[new o.aG(F.overscaledZ,F.wrap,t.z,t.x,t.y-1).key]={backfilled:!1},re[new o.aG(F.overscaledZ,Y,t.z,Z,t.y-1).key]={backfilled:!1}),t.y+1<l&&(re[new o.aG(F.overscaledZ,G,t.z,B,t.y+1).key]={backfilled:!1},re[new o.aG(F.overscaledZ,F.wrap,t.z,t.x,t.y+1).key]={backfilled:!1},re[new o.aG(F.overscaledZ,Y,t.z,Z,t.y+1).key]={backfilled:!1}),re}},"raster-array":Tn,geojson:class extends o.E{constructor(F,t,l,B){super(),this.id=F,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=l.getActor(),this.setEventedParent(B),this._data=t.data,this._options=o.l({},t),this._collectResourceTiming=t.collectResourceTiming,t.maxzoom!==void 0&&(this.maxzoom=t.maxzoom),t.minzoom!==void 0&&(this.minzoom=t.minzoom),t.type&&(this.type=t.type),t.attribution&&(this.attribution=t.attribution),this.promoteId=t.promoteId;const G=o.ag/this.tileSize;this.workerOptions=o.l({source:this.id,scope:this.scope,cluster:t.cluster||!1,geojsonVtOptions:{buffer:(t.buffer!==void 0?t.buffer:128)*G,tolerance:(t.tolerance!==void 0?t.tolerance:.375)*G,extent:o.ag,maxZoom:this.maxzoom,lineMetrics:t.lineMetrics||!1,generateId:t.generateId||!1},superclusterOptions:{maxZoom:t.clusterMaxZoom!==void 0?t.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,t.clusterMinPoints||2),extent:o.ag,radius:(t.clusterRadius!==void 0?t.clusterRadius:50)*G,log:!1,generateId:t.generateId||!1},clusterProperties:t.clusterProperties,filter:t.filter,dynamic:t.dynamic},t.workerOptions)}onAdd(F){this.map=F,this.setData(this._data)}setData(F){return this._data=F,this._updateWorkerData(),this}updateData(F){if(!this._options.dynamic)return this.fire(new o.y(new Error("Can't call updateData on a GeoJSON source with dynamic set to false.")));if(typeof F!="string"&&(F.type==="Feature"&&(F={type:"FeatureCollection",features:[F]}),F.type!=="FeatureCollection"))return this.fire(new o.y(new Error("Data to update should be a feature or a feature collection.")));if(this._coalesce&&typeof F!="string"&&typeof this._data!="string"&&this._data.type==="FeatureCollection"){const t=new Map;for(const l of this._data.features)t.set(l.id,l);for(const l of F.features)t.set(l.id,l);this._data.features=[...t.values()]}else this._data=F;return this._updateWorkerData(!0),this}getClusterExpansionZoom(F,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:F,source:this.id,scope:this.scope},t),this}getClusterChildren(F,t){return this.actor.send("geojson.getClusterChildren",{clusterId:F,source:this.id,scope:this.scope},t),this}getClusterLeaves(F,t,l,B){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:F,limit:t,offset:l},B),this}_updateWorkerData(F=!1){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new o.z("dataloading",{dataType:"source"})),this._loaded=!1;const t=o.l({append:F},this.workerOptions);t.scope=this.scope;const l=this._data;typeof l=="string"?(t.request=this.map._requestManager.transformRequest(o.q.resolveURL(l),o.R.Source),t.request.collectResourceTiming=this._collectResourceTiming):t.data=JSON.stringify(l),this._pendingLoad=this.actor.send(`${this.type}.loadData`,t,(B,G)=>{if(this._loaded=!0,this._pendingLoad=null,B)this.fire(new o.y(B));else{const Z={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&G&&G.resourceTiming&&G.resourceTiming[this.id]&&(Z.resourceTiming=G.resourceTiming[this.id]),F&&(this._partialReload=!0),this.fire(new o.z("data",Z)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(F),this._coalesce=!1)})}loaded(){return this._loaded}reload(){const F=o.aC(this.id,this.scope);this.map.style.clearSource(F),this._updateWorkerData()}loadTile(F,t){const l=F.actor?"reloadTile":"loadTile";F.actor=this.actor;const B=this.map.style?this.map.style.getLut(this.scope):null,G=B?{image:B.image.clone()}
274:null,Z=this._partialReload,Y={type:this.type,uid:F.uid,tileID:F.tileID,tileZoom:F.tileZoom,zoom:F.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:G,scope:this.scope,pixelRatio:o.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,scaleFactor:this.map.getScaleFactor(),partial:Z};F.request=this.actor.send(l,Y,(re,oe)=>Z&&!oe?(F.state="loaded",t(null)):(delete F.request,F.destroy(),F.aborted?t(null):re?t(re):(F.loadVectorData(oe,this.map.painter,l==="reloadTile"),t(null))),void 0,l==="loadTile")}abortTile(F){F.request&&(F.request.cancel(),delete F.request),F.aborted=!0}unloadTile(F,t){this.actor.send("removeTile",{uid:F.uid,type:this.type,source:this.id,scope:this.scope}),F.destroy()}onRemove(F){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return o.l({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends o.aJ{constructor(F,t,l,B){super(F,t,l,B),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const F=this.options;this.urls=[];for(const t of F.urls)this.urls.push(this.map._requestManager.transformRequest(t,o.R.Source).url);o.aK(this.urls,(t,l)=>{this._loaded=!0,t?this.fire(new o.y(t)):l&&(this.video=l,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(F){if(this.video){const t=this.video.seekable;F<t.start(0)||F>t.end(0)?this.fire(new o.y(new o.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${t.start(0)} and ${t.end(0)}-second mark.`))):this.video.currentTime=F}}getVideo(){return this.video}
274onAdd(F){this.map||(this.map=F,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const F=this.map.painter.context,t=F.gl;this.texture?this.video.paused||(this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this.texture=new o.T(F,this.video,t.RGBA8),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(F)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:o.aJ,model:class extends o.E{constructor(F,t,l,B){super(),this.id=F,this.type="model",this.models=[],this._loaded=!1,this._options=t}load(){const F=[];for(const t in this._options.models){const l=this._options.models[t],B=o.aM(this.map._requestManager.transformRequest(l.uri,o.R.Model).url).then(G=>{if(!G)return;const Z=o.aN(G),Y=new o.aO(t,l.position,l.orientation,Z);Y.computeBoundsAndApplyParent(),this.models.push(Y)}).catch(G=>{this.fire(new o.y(new Error(`Could not load model ${t} from ${l.uri}: ${G.message}`)))});F.push(B)}return Promise.allSettled(F).then(()=>{this._loaded=!0,this.fire(new o.z("data",{dataType:"source",sourceDataType:"metadata"}))}).catch(t=>{this.fire(new o.y(new Error(`Could not load models: ${t.message}`)))})}onAdd(F){this.map=F,this.load()}hasTransition(){return!1}loaded(){return this._loaded}getModels(){return this.models}loadTile(F,t){}serialize(){return{type:"model"}}},"batched-model":class extends o.E{constructor(F,t,l,B){super(),this.type="batched-model",this.id=F,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=l,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(B)}onAdd(F){this.map=F,this.load()}reload(){this.cancelTileJSONRequest();const F=o.aC(this.id,this.scope);this.load(()=>this.map.style.clearSource(F))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(F){this._loaded=!1,this.fire(new o.z("dataloading",{dataType:"source"}));const t=Array.isArray(this.map._language)?this.map._language.join():this.map._language,l=this.map.getWorldview();this._tileJSONRequest=gr(this._options,this.map._requestManager,t,l,(B,G)=>{this._tileJSONRequest=null,this._loaded=!0,B?(t&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${t}`),l&&l.length!==2&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${l}`),this.fire(new o.y(B))):G&&(o.l(this,G),G.bounds&&(this.tileBounds=new xr(G.boun
274ds,this.minzoom,this.maxzoom)),Lr(G.tiles,this.map._requestManager._customAccessToken),this.fire(new o.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.z("data",{dataType:"source",sourceDataType:"content"}))),F&&F(B)})}hasTransition(){return!1}hasTile(F){return!this.tileBounds||this.tileBounds.contains(F.canonical)}loaded(){return this._loaded}loadTile(F,t){const l=this.map._requestManager.normalizeTileURL(F.tileID.canonical.url(this.tiles,this.scheme)),B={request:this.map._requestManager.transformRequest(l,o.R.Tile),data:void 0,uid:F.uid,tileID:F.tileID,tileZoom:F.tileZoom,zoom:F.tileID.overscaledZ,tileSize:this.tileSize*F.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:F.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,lut:null,maxZoom:null,promoteId:null,pixelRatio:null,scaleFactor:null};if(F.actor&&F.state!=="expired")if(F.state==="loading")F.reloadCallback=t;else{if(F.buckets){const Z=Object.values(F.buckets);for(const Y of Z)Y.dirty=!0;return void(F.state="loaded")}F.request=F.actor.send("reloadTile",B,G.bind(this))}else F.actor=this.dispatcher.getActor(),F.request=F.actor.send("loadTile",B,G.bind(this),void 0,!0);function G(Z,Y){return F.aborted?t(null):Z&&Z.status!==404?t(Z):(this.map._refreshExpiredTiles&&Y&&F.setExpiryData(Y),F.loadModelData(Y,this.map.painter),F.state="loaded",void t(null))}}serialize(){return o.l({},this._options)}},canvas:class extends o.aJ{constructor(F,t,l,B){super(F,t,l,B),t.coordinates?Array.isArray(t.coordinates)&&t.coordinates.length===4&&!t.coordinates.some(G=>!Array.isArray(G)||G.length!==2||G.some(Z=>typeof Z!="number"))||this.fire(new o.y(new o.V(`sources.${F}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.y(new o.V(`sources.${F}`,null,'missing required property "coordinates"'))),t.animate&&typeof t.animate!="boolean"&&this.fire(new o.y(new o.V(`sources.${F}`,null,'optional "animate" property must be a boolean value'))),t.canvas?typeof t.canvas=="string"||t.canvas instanceof HTMLCanvasElement||this.fire(new o.y(new o.V(`sources.${F}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new o.y(new o.V(`sources.${F}`,null,'missing required property "canvas"'))),this.options=t,this.animate=t.animate===void 0||t.animate}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 o.y(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(F){this.map=F,this.load(),this.canvas&&this.animate&&this.play()}onRemove(F){this.pause()}prepare(){let F=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,F=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,F=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const t=this.map.painter.context;this.texture?!F&&!this._playing||this.texture instanceof o.aL||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new o.T(t,this.canvas,t.gl.RGBA8,{premultiply:!0}),this._prepareData(t)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const F of[this.canvas.width,this.canvas.height])if(isNaN(F)||F<=0)return!0;return!1}},custom:class extends o.E{constructor(F,t,l,B){super(),this.id=F,this.type="custom",this._dataType="raster",this._dispatcher=l,this._implementation=t,this.setEventedParent(B),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new o.y(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new o.y(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new xr(this._implementation.bounds,this.minzoom,this.maxzoom)),t.update=this._update.bind(this),t.clearTiles=this._clearTiles.bind(this),t.coveringTiles=this._coveringTiles.bind(this),o.l(this,o.ay(t,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileC
274acheSize"]))}serialize(){return o.ay(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new o.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.z("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(F){this.map=F,this._loaded=!1,this.fire(new o.z("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(F),this.load()}onRemove(F){this._implementation.onRemove&&this._implementation.onRemove(F)}hasTile(F){if(this._implementation.hasTile){const{x:t,y:l,z:B}=F.canonical;return this._implementation.hasTile({x:t,y:l,z:B})}return!this.tileBounds||this.tileBounds.contains(F.canonical)}loadTile(F,t){const{x:l,y:B,z:G}=F.tileID.canonical,Z=new AbortController;F.request=Promise.resolve(this._implementation.loadTile({x:l,y:B,z:G},{signal:Z.signal})).then((function(Y){return delete F.request,F.aborted?(F.state="unloaded",t(null)):Y===void 0?(F.state="errored",t(null)):Y===null?(this.loadTileData(F,{width:this.tileSize,height:this.tileSize,data:null}),F.state="loaded",t(null)):function(re){return re instanceof ImageData||re instanceof HTMLCanvasElement||re instanceof ImageBitmap||re instanceof HTMLImageElement}(Y)?(this.loadTileData(F,Y),F.state="loaded",void t(null)):(F.state="errored",t(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}).bind(this)).catch(Y=>{Y.code!==20&&(F.state="errored",t(Y))}),F.request.cancel=()=>Z.abort()}loadTileData(F,t){F.setTexture(t,this.map.painter)}unloadTile(F,t){if(F.texture&&F.texture instanceof o.T?(F.destroy(!0),F.texture&&F.texture instanceof o.T&&this.map.painter.saveTileTexture(F.texture)):F.destroy(),this._implementation.unloadTile){const{x:l,y:B,z:G}=F.tileID.canonical;this._implementation.unloadTile({x:l,y:B,z:G})}t&&t()}abortTile(F,t){F.request&&F.request.cancel&&(F.request.cancel(),delete F.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(F=>({x:F.canonical.x,y:F.canonical.y,z:F.canonical.z}))}_clearTiles(){const F=o.aC(this.id,this.scope);this.map.style.clearSource(F)}_update(){this.fire(new o.z("data",{dataType:"source",sourceDataType:"content"}))}}},ts=function(F,t,l,B){const G=new Pn[t.type](F,t,l,B);if(G.id!==F)throw new Error(`Expected Source id to be ${F} instead of ${G.id}`);return o.aP(["load","abort","unload","serialize","prepare"],G),G};function $o(F,t,l=""){return`${l}:${t.id||""}:${t.layer.id}:${function(B){if("layerId"in B)return`layer:${B.layerId}`;{const{featuresetId:G,importId:Z}=B;return`featureset:${G}${Z?`:import:${Z}`:""}`}}(F.target)}`}function na(F,t,l,B=""){if(F.uniqueFeatureID){const G=$o(F,t,B);if(l.has(G))return!0;l.add(G)}return!1}function Ho(F,t,l,B,G=!1){const Z=t.sourceCache.transform,Y=t.sourceCache.tilesIn(F,t.has3DLayers,G);Y.sort(th);const re=[];for(const oe of Y){const ce=oe.tile.queryRenderedFeatures(t,oe,l,B,Z,G);Object.keys(ce).length&&re.push({wrappedTileID:oe.tile.tileID.wrapped().key,queryResults:ce})}return re.length===0?{}:function(oe){const ce={},he={};for(const pe of oe){const fe=pe.queryResults,be=pe.wrappedTileID,ze=he[be]=he[be]||{};for(const De in fe){const Oe=fe[De],Fe=ze[De]=ze[De]||{},Ge=ce[De]=ce[De]||[];for(const Xe of Oe)Fe[Xe.featureIndex]||(Fe[Xe.featureIndex]=!0,Ge.push(Xe))}}return ce}(re)}function eh(F,t,l,B,G){const Z={},Y=B.queryRenderedSymbols(F),re=[];for(const oe of Object.keys(Y).map(Number))re.push(G[oe]);re.sort(th);for(const oe of re){const ce=oe.featureIndex.lookupSymbolFeatures(Y[oe.bucketInstanceId],oe.bucketIndex,oe.sourceLayerIndex,t,l);for(const he in ce){const pe=Z[he]=Z[he]||[],fe=ce[he];fe.sort((be,ze)=>{const De=oe.featureSortOrder;if(De){const Oe=De.indexOf(be.featureIndex);return De.indexOf(ze.featureIndex)-Oe}return ze.featureIndex-be.featureIndex});for(const be of fe)pe.push(be)}}return Z}function Ku(F,t){const l=F.getRenderableIds().map(Z=>F.getTileByID(Z)),B=[],G={};for(let Z=0;Z<l.length;Z++){const Y=l[Z],re=Y.tileID.canonical.key;G[re]||(G[re]=!0,Y.querySourceFeatures(B,t))}return B}function th(F,t){const l=F.tileID,B=t.tileID;return l.overscaledZ-B.overscaledZ||l.canonical.y-B.canonical.y||l.wrap-B.wrap||l.canonical.x-B.canonical.x}function ih(F,t){const l={};if(!t)return l;for(const B of F){const G=B.layerIds.map(Z=>
274t.getLayer(Z)).filter(Boolean);if(G.length!==0){B.layers=G,B.stateDependentLayerIds&&(B.stateDependentLayers=B.stateDependentLayerIds.map(Z=>G.filter(Y=>Y.id===Z)[0]));for(const Z of G)l[Z.fqid]=B}}return l}const is=32,ks=33,sa=new Uint16Array(8184);for(let F=0;F<2046;F++){let t=F+2,l=0,B=0,G=0,Z=0,Y=0,re=0;for(1&t?G=Z=Y=is:l=B=re=is;(t>>=1)>1;){const ce=l+G>>1,he=B+Z>>1;1&t?(G=l,Z=B,l=Y,B=re):(l=G,B=Z,G=Y,Z=re),Y=ce,re=he}const oe=4*F;sa[oe+0]=l,sa[oe+1]=B,sa[oe+2]=G,sa[oe+3]=Z}const js=new Uint16Array(2178),Rs=new Uint8Array(1089),Gs=new Uint16Array(1089);function Wl(F){return F===0?-.03125:F===32?.03125:0}const rh={type:2,extent:o.ag,loadGeometry:()=>[[new o.P(0,0),new o.P(o.ag+1,0),new o.P(o.ag+1,o.ag+1),new o.P(0,o.ag+1),new o.P(0,0)]]};class ba{constructor(t,l,B,G,Z){this.tileID=t,this.uid=o.aV(),this.uses=0,this.tileSize=l,this.tileZoom=B,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=Z,G&&G.style&&(this._lastUpdatedBrightness=G.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",G&&G.transform&&(this.projection=G.transform.projection)}registerFadeDuration(t){const l=t+this.timeAdded;l<o.q.now()||this.fadeEndTime&&l<this.fadeEndTime||(this.fadeEndTime=l)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}get tileTransform(){return this._tileTransform||(this._tileTransform=o.aQ(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(t,l,B){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=ih(t.buckets,l.style),this.hasSymbolBuckets=!1;for(const G in this.buckets){const Z=this.buckets[G];if(Z instanceof o.aX){if(this.hasSymbolBuckets=!0,!B)break;Z.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const G in this.buckets){const Z=this.buckets[G];if(Z instanceof o.aX&&Z.hasRTLText){this.hasRTLText=!0,o.aY();break}}this.queryPadding=0;for(const G in this.buckets){const Z=this.buckets[G],Y=l.style.getOwnLayer(G);if(!Y)continue;const re=Y.queryRadius(Z);this.queryPadding=Math.max(this.queryPadding,re)}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas),this._lastUpdatedBrightness=t.brightness}else this.collisionBoxArray=new o.aW}unloadVectorData(){if(this.hasData()){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}loadModelData(t,l,B){t&&(t.resourceTiming&&(this.resourceTiming=t.resourceTiming),this.buckets=Object.assign({},this.buckets,ih(t.buckets,l.style)),t.featureIndex&&(this.latestFeatureIndex=t.featureIndex))}getBucket(t){return this.buckets[t.fqid]}upload(t){for(const G in this.buckets){const Z=this.buckets[G];Z.uploadPending()&&Z.upload(t)}const l=t.gl,B=this.imageAtlas;if(B&&!B.uploaded){const G=!!Object.keys(B.patternPositions).length;this.imageAtlasTexture=new o.T(t,B.image,l.RGBA8,{useMipmap:G}),this.imageAtlas.uploaded=!0}this.glyphAtlasImage&&(this.glyphAtlasTexture=new o.T(t,this.glyphAtlasImage,l.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new o.T(t,this.lineAtlas.image,l.R8),this.lineAtlas.uploaded=!0)}prepare(t,l,B){if(this.imageAtlas&&this.imageAtlasTexture&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture,B),!l||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const G=l.style.getBrightness();(this._lastUpdatedBrightness||G)&&(this._lastUpdatedBrightness&&G&&Math.abs(this._lastUpdatedBrightness-G)<.001||(this.updateBuckets(l,this._lastUpdatedBrightness!==G),this._lastUpdatedBrightness=G))}queryRenderedFeatures(t,l,B,G,Z,Y){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile)return{};const re=function(oe,ce){const he=o.ab.mat4.fromScaling([],[.5*oe.width,.5*-oe.height,1]);return o.ab.mat4.translate(he,he,[1,-1,0]),o.ab.mat4.multiply(he,he,oe.calculateProjMatrix(ce.toUnwrapped())),Float32Array.from(he)}(Z,this.tileID);return this.latestFeatureIndex.query(t,{tilespaceGeometry:l,pixelPosMatrix:re,transform:G,availableImages:B,tileTransform:this.tileTransform})}querySourceFeatures(t,l){const B=this.latestFeatureIndex;if(!B||!B.rawTileData)return;const G=B.loadVTLayers(),Z=l?l.sourceLayer:"",Y=G._geojsonTileLayer||G[Z];if(!Y)return;const re=o.aZ(l&&l.filter),{z:oe,x:ce,y:he}=this.tileID.canonical,pe={z:oe,x:ce,y:he};for(let fe=0;fe<Y.length;fe++){const be=Y.feature(fe);if(re.needGeometry){const Oe=o.a_(be,!0);
vendor: 6,536 bytes, line 274
274if(!re.filter(new o.a8(this.tileID.overscaledZ),Oe,this.tileID.canonical))continue}else if(!re.filter(new o.a8(this.tileID.overscaledZ),be))continue;const ze=B.getId(be,Z),De=new o.a$(be,oe,ce,he,ze);De.tile=pe,t.push(De)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const l=this.expirationTime;if(t.cacheControl){const B=o.b0(t.cacheControl);B["max-age"]&&(this.expirationTime=Date.now()+1e3*B["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const B=Date.now();let G=!1;if(this.expirationTime>B)G=!1;else if(l)if(this.expirationTime<l)G=!0;else{const Z=this.expirationTime-l;Z?this.expirationTime=B+Math.max(Z,3e4):G=!0}else G=!0;G?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}refreshFeatureState(t){this.latestFeatureIndex&&(this.latestFeatureIndex.rawTileData||this.latestFeatureIndex.is3DTile)&&t&&this.updateBuckets(t)}updateBuckets(t,l){if(!this.latestFeatureIndex||!t.style)return;const B=this.latestFeatureIndex.loadVTLayers(),G=t.style.listImages(),Z=t.style.getBrightness();for(const Y in this.buckets){if(!t.style.hasLayer(Y))continue;const re=this.buckets[Y],oe=re.layers[0],ce=oe.sourceLayer||"_geojsonTileLayer",he=B[ce],pe=t.style.getLayerSourceCache(oe);let fe={};pe&&(fe=pe._state.getState(ce,void 0));const be=this.imageAtlas&&this.imageAtlas.patternPositions||{},ze=Object.keys(fe).length>0&&!l;ze&&!re.stateDependentLayers.length&&!l||re.update(fe,he,G,be,ze?re.stateDependentLayers:re.layers,l,Z),(re instanceof o.b1||re instanceof o.b2)&&t._terrain&&t._terrain.enabled&&pe&&re.programConfigurations.needsUpload&&t._terrain._clearRenderCacheForTile(pe.id,this.tileID);const De=t&&t.style&&t.style.getOwnLayer(Y);De&&(this.queryPadding=Math.max(this.queryPadding,De.queryRadius(re)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<o.q.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=o.q.now()+t}setTexture(t,l){const B=l.context,G=B.gl;this.texture=this.texture||l.getTileTexture(t.width),this.texture&&this.texture instanceof o.T?this.texture.update(t):(this.texture=new o.T(B,t,G.RGBA8,{useMipmap:!0}),this.texture.bind(G.LINEAR,G.CLAMP_TO_EDGE))}setDependencies(t,l){const B={};for(const G of l)B[G]=!0;this.dependencies[t]=B}hasDependency(t,l){for(const B of t){const G=this.dependencies[B];if(G){for(const Z of l)if(G[Z])return!0}}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(t,l){if(!l||l.name==="mercator"||this._tileDebugBuffer)return;const B=o.b3(rh,this.tileID.canonical,this.tileTransform)[0],G=new o.b4,Z=new o.b5;for(let Y=0;Y<B.length;Y++){const{x:re,y:oe}=B[Y];G.emplaceBack(re,oe),Z.emplaceBack(Y)}Z.emplaceBack(0),this._tileDebugIndexBuffer=t.createIndexBuffer(Z),this._tileDebugBuffer=t.createVertexBuffer(G,o.b6.members),this._tileDebugSegments=o.b7.simpleSegment(0,0,G.length,Z.length)}_makeTileBoundsBuffers(t,l){if(this._tileBoundsBuffer||!l||l.name==="mercator")return;const B=o.b3(rh,this.tileID.canonical,this.tileTransform)[0];let G,Z;if(this.isRaster){const Y=function(re,oe){const ce=o.aQ(re,oe),he=Math.pow(2,re.z);for(let Oe=0;Oe<ks;Oe++)for(let Fe=0;Fe<ks;Fe++){const Ge=o.aR((re.x+(Fe+Wl(Fe))/is)/he),Xe=o.aS((re.y+(Oe+Wl(Oe))/is)/he),Ze=oe.project(Ge,Xe),nt=Oe*ks+Fe;js[2*nt+0]=Math.round((Ze.x*ce.scale-ce.x)*o.ag),js[2*nt+1]=Math.round((Ze.y*ce.scale-ce.y)*o.ag)}Rs.fill(0),Gs.fill(0);for(let Oe=2045;Oe>=0;Oe--){const Fe=4*Oe,Ge=sa[Fe+0],Xe=sa[Fe+1],Ze=sa[Fe+2],nt=sa[Fe+3],Qe=Ge+Ze>>1,it=Xe+nt>>1,Ke=Qe+it-Xe,ht=it+Ge-Qe,yt=Xe*ks+Ge,Nt=nt*ks+Ze,Dt=it*ks+Qe,Wt=Math.hypot((js[2*yt+0]+js[2*Nt+0])/2-js[2*Dt+0],(js[2*yt+1]+js[2*Nt+1])/2-js[2*Dt+1])>=16;Rs[Dt]=Rs[Dt]||(Wt?1:0),Oe<1022&&(Rs[Dt]=Rs[Dt]||Rs[(Xe+ht>>1)*ks+(Ge+Ke>>1)]||Rs[(nt+ht>>1)*ks+(Ze+Ke>>1)])}const pe=new o.aT,fe=new o.aU;let be=0;function ze(Oe,Fe){const Ge=Fe*ks+Oe;return Gs[Ge]===0&&(pe.emplaceBack(js[2*Ge+0],js[2*Ge+1],Oe*o.ag/is,Fe*o.ag/is),Gs[Ge]=++be),Gs[Ge]-1}function De(Oe,Fe,Ge,Xe,Ze,nt){const Qe=Oe+Ge>>1,it=Fe+Xe>>1;if(Math.abs(Oe-Ze)+Math.abs(Fe-nt)>1&&Rs[it*ks+Qe])De(Ze,nt,Oe,Fe,Qe,it),De(Ge,Xe,Ze,nt,Qe,it);else{const Ke=ze(Oe,Fe),ht=ze(Ge,Xe),yt=ze(Ze,nt);fe.emplaceBack(Ke,ht,yt)}}return De(0,0,is,is,is,0),De(is,is,0,0,0,is),{vertices:pe,indices:fe}}(this.tileID.canonical,l);G=Y.vertices,Z=Y.indices}else{G=new o.aT,Z=new o.aU;for(const{x:re,y:oe}of B)G.emplaceBack(re,oe,0,0);const Y=o.b8(G.int16,void 0,4);for(let re=0;re<Y.length;re+=3)Z.emplaceBack(Y[re],Y[re+1],Y[re+2])}this._tileBoundsBuffer=t.createVertexBuffer(G,o.b9.members),this._tileBoundsIndexBuffer=t.createIndexBuffer(Z),this._tileBoundsSegments=o.b7.simpleSegment(0,0,G.length,Z.length)}_makeGlobeTileDebugBuffers(t,l){const B=l.projection;if(!B||B.name!=="globe"||l.freezeTileCoverage)return;const G=this.tileID.canonical,Z=o.ba(G,l),Y=o.bb(Z),re=o.ae(l.zoom);let oe;re>0&&(oe=o.ab.mat4.invert(new Float64Array(16),l.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,G,l,Y,oe,re),this._makeGlobeTileDebugTextBuffer(t,G,l,Y,oe,re)}_globePoint(t,l,B,G,Z,Y,re){let oe=o.bc(t,l,B);if(Y){const ce=1<<B.z,he=o.at(G.center.lng),pe=o.aA(G.center.lat),fe=(B.x+.5)/ce-he;let be=0;fe>.5?be=-1:fe<-.5&&(be=1);let ze=(t/o.ag+B.x)/ce+be,De=(l/o.ag+B.y)/ce;ze=(ze-he)*G._pixelsPerMercatorPixel+he,De=(De-pe)*G._pixelsPerMercatorPixel+pe;const Oe=[ze*G.worldSize,De*G.worldSize,0];o.ab.vec3.transformMat4(Oe,Oe,Y),oe=o.bd(oe,Oe,re)}return o.ab.vec3.transformMat4(oe,oe,Z)}_makeGlobeTileDebugBorderBuffer(t,l,B,G,Z,Y){const re=new o.b4,oe=new o.b5,ce=new o.be,he=(fe,be,ze,De,Oe)=>{const Fe=(ze-fe)/(Oe-1),Ge=(De-be)/(Oe-1),Xe=re.length;for(let Ze=0;Ze<Oe;Ze++){const nt=fe+Ze*Fe,Qe=be+Ze*Ge;re.emplaceBack(nt,Qe);const it=this._globePoint(nt,Qe,l,B,G,Z,Y);ce.emplaceBack(it[0],it[1],it[2]),oe.emplaceBack(Xe+Ze)}},pe=o.ag;he(0,0,pe,0,16),he(pe,0,pe,pe,16),he(pe,pe,0,pe,16),he(0,pe,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(oe),this._tileDebugBuffer=t.createVertexBuffer(re,o.b6.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(ce,o.bf.members),this._tileDebugSegments=o.b7.simpleSegment(0,0,re.length,oe.length)}
274_makeGlobeTileDebugTextBuffer(t,l,B,G,Z,Y){const re=o.ag/4,oe=new o.b4,ce=new o.aU,he=new o.be,pe=25;ce.reserve(32),oe.reserve(pe),he.reserve(pe);const fe=(be,ze)=>pe*be+ze;for(let be=0;be<pe;be++){const ze=be*re;for(let De=0;De<pe;De++){const Oe=De*re;oe.emplaceBack(Oe,ze);const Fe=this._globePoint(Oe,ze,l,B,G,Z,Y);he.emplaceBack(Fe[0],Fe[1],Fe[2])}}for(let be=0;be<4;be++)for(let ze=0;ze<4;ze++){const De=fe(be,ze),Oe=fe(be,ze+1),Fe=fe(be+1,ze),Ge=fe(be+1,ze+1);ce.emplaceBack(De,Oe,Fe),ce.emplaceBack(Fe,Oe,Ge)}this._tileDebugTextIndexBuffer=t.createIndexBuffer(ce),this._tileDebugTextBuffer=t.createVertexBuffer(oe,o.b6.members),this._globeTileDebugTextBuffer=t.createVertexBuffer(he,o.bf.members),this._tileDebugTextSegments=o.b7.simpleSegment(0,0,pe,32)}destroy(t=!1){for(const l in this.buckets)this.buckets[l].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture.destroy(),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 o.T&&(this.texture.destroy(),delete this.texture),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"}}o.bg.setPbf(o.bh);class wa extends ba{constructor(t,l,B,G,Z){super(t,l,B,G,Z),this._workQueue=[],this._fetchQueue=[],this._isHeaderLoaded=!1}setTexture(t,l){const B=l.context,G=B.gl;this.texture=this.texture||l.getTileTexture(t.width),this.texture&&this.texture instanceof o.T?this.texture.update(t,{premultiply:!1}):this.texture=new o.T(B,t,G.RGBA8,{premultiply:!1})}flushQueues(){for(;this._workQueue.length;)this._workQueue.pop()();for(;this._fetchQueue.length;)this._fetchQueue.pop()()}fetchHeader(t=16384,l){const B=this._mrt=new o.bg(30),G=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(t-1)}});return this.entireBuffer=null,this.request=o.bi(G,(Z,Y,re,oe)=>{if(Z)l(Z);else try{const ce=B.getHeaderLength(Y);if(ce>t)return void(this.request=this.fetchHeader(ce,l));B.parseHeader(Y),this._isHeaderLoaded=!0;let he=0;for(const pe of Object.values(B.layers))he=Math.max(he,pe.dataIndex[pe.dataIndex.length-1].last_byte);Y.byteLength>=he&&(this.entireBuffer=Y),l(null,this.entireBuffer||Y,re,oe)}catch(ce){l(ce)}}),this.request}fetchBand(t,l,B){const G=this._mrt;if(!this._isHeaderLoaded||!G)return void B(new Error("Tile header is not ready"));const Z=this.actor;if(!Z)return void B(new Error("Can't fetch tile band without an actor"));let Y;const re=(pe,fe)=>{Y.complete(pe,fe),pe?B(pe):(this.updateTextureDescriptor(t,l),B(null,this.textureDescriptor&&this.textureDescriptor.img))},oe=(pe,fe)=>{if(pe)return B(pe);const be=Z.send("decodeRasterArray",{buffer:fe,task:Y},re,void 0,!0);this._workQueue.push(()=>{be&&be.cancel(),Y.cancel()})},ce=G.getLayer(t);if(!ce)return void B(new Error(`Unknown sourceLayer "${t}"`));if(ce.hasDataForBand(l))return this.updateTextureDescriptor(t,l),void B(null,this.textureDescriptor?this.textureDescriptor.img:null);const he=ce.getDataRange([l]);if(Y=G.createDecodingTask(he),!Y||Y.tasks.length)if(this.flushQueues(),this.entireBuffer)oe(null,this.entireBuffer.slice(he.firstByte,he.lastByte+1));else{const pe=Object.assign({}
274,this.requestParams,{headers:{Range:`bytes=${he.firstByte}-${he.lastByte}`}}),fe=o.bi(pe,oe);this._fetchQueue.push(()=>{fe.cancel(),Y.cancel()})}else B(null)}updateNeeded(t,l){return(!this.textureDescriptor||this.textureDescriptor.band!==l||this.textureDescriptor.layer!==t)&&this.state!=="errored"}updateTextureDescriptor(t,l){if(!this._mrt)return;const B=this._mrt.getLayer(t);if(!B||!B.hasBand(l)||!B.hasDataForBand(l))return;const{bytes:G,tileSize:Z,buffer:Y,offset:re,scale:oe}=B.getBandView(l),ce=Z+2*Y,he={data:G,width:ce,height:ce},pe=this.texture;pe&&pe instanceof o.T&&pe.update(he,{premultiply:!1}),this.textureDescriptor={layer:t,band:l,img:he,buffer:Y,offset:re,tileSize:Z,format:B.pixelFormat,mix:[oe,256*oe,65536*oe,16777216*oe]}}}class Qu{constructor(t,l){this.max=t,this.onRemove=l,this.reset()}reset(){for(const t in this.data)for(const l of this.data[t])l.timeout&&clearTimeout(l.timeout),this.onRemove(l.value);return this.data={},this.order=[],this}add(t,l,B){const G=t.wrapped().key;this.data[G]===void 0&&(this.data[G]=[]);const Z={value:l,timeout:void 0};if(B!==void 0&&(Z.timeout=setTimeout(()=>{this.remove(t,Z)},B)),this.data[G].push(Z),this.order.push(G),this.order.length>this.max){const Y=this._getAndRemoveByKey(this.order[0]);Y&&this.onRemove(Y)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const l=this.data[t].shift();return l.timeout&&clearTimeout(l.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),l.value}getByKey(t){const l=this.data[t];return l?l[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,l){if(!this.has(t))return this;const B=t.wrapped().key,G=l===void 0?0:this.data[B].indexOf(l),Z=this.data[B][G];return this.data[B].splice(G,1),Z.timeout&&clearTimeout(Z.timeout),this.data[B].length===0&&delete this.data[B],this.onRemove(Z.value),this.order.splice(this.order.indexOf(B),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const l=this._getAndRemoveByKey(this.order[0]);l&&this.onRemove(l)}return this}filter(t){const l=[];for(const B in this.data)for(const G of this.data[B])t(G.value)||l.push(G);for(const B of l)this.remove(B.value.tileID,B)}}class nh{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,l,B){const G=String(l);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][G]=this.stateChanges[t][G]||{},o.l(this.stateChanges[t][G],B),this.deletedStates[t]===null){this.deletedStates[t]={};for(const Z in this.state[t])Z!==G&&(this.deletedStates[t][Z]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][G]===null){this.deletedStates[t][G]={};for(const Z in this.state[t][G])B[Z]||(this.deletedStates[t][G][Z]=null)}else for(const Z in B)this.deletedStates[t]&&this.deletedStates[t][G]&&this.deletedStates[t][G][Z]===null&&delete this.deletedStates[t][G][Z]}removeFeatureState(t,l,B){if(this.deletedStates[t]===null)return;const G=String(l);if(this.deletedStates[t]=this.deletedStates[t]||{},B&&l!==void 0)this.deletedStates[t][G]!==null&&(this.deletedStates[t][G]=this.deletedStates[t][G]||{},this.deletedStates[t][G][B]=null);else if(l!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][G])for(B in this.deletedStates[t][G]={},this.stateChanges[t][G])this.deletedStates[t][G][B]=null;else this.deletedStates[t][G]=null;else this.deletedStates[t]=null}getState(t,l){const B=this.state[t]||{},G=this.stateChanges[t]||{},Z=this.deletedStates[t];if(Z===null)return{};if(l!==void 0){const re=String(l),oe=o.l({},B[re],G[re]);if(Z){const ce=Z[l];if(ce===null)return{};for(const he in ce)delete oe[he]}return oe}const Y=o.l({},B,G);if(Z)for(const re in Z)delete Y[re];return Y}initializeTileState(t,l){t.refreshFeatureState(l)}coalesceChanges(t,l){const B={};for(const G in this.stateChanges){this.state[G]=this.state[G]||{};const Z={};for(const Y in this.stateChanges[G])this.state[G][Y]||(this.state[G][Y]={}),o.l(this.state[G][Y],this.stateChanges[G][Y]),Z[Y]=this.state[G][Y];B[G]=Z}for(const G in this.deletedStates){this.state[G]=this.state[G]||{};const Z={};if(this.deletedStates[G]===null)for(const Y in this.state[G])Z[Y]={},this.state[G][Y]={};else for(const Y in this.deletedStates[G]){if(this.deletedStates[G][Y]===null)this.state[G][Y]={};
vendor: 21,500 bytes, line 274
274else if(this.state[G][Y])for(const re of Object.keys(this.deletedStates[G][Y]))delete this.state[G][Y][re];Z[Y]=this.state[G][Y]}B[G]=B[G]||{},o.l(B[G],Z)}if(this.stateChanges={},this.deletedStates={},Object.keys(B).length!==0)for(const G in t)t[G].refreshFeatureState(l)}}class Es extends o.E{constructor(t,l,B){super(),this.id=t,this._onlySymbols=B,l.on("data",G=>{G.dataType==="source"&&G.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&G.dataType==="source"&&G.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform))}),l.on("error",()=>{this._sourceErrored=!0}),this._source=l,this._tiles={},this._cache=new Qu(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=l.minTileCacheSize,this._maxTileCacheSize=l.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new nh,this._isRaster=this._source.type==="raster"||this._source.type==="raster-dem"||this._source.type==="raster-array"||this._source.type==="custom"&&this._source._dataType==="raster"}onAdd(t){this.map=t,this._minTileCacheSize=this._minTileCacheSize===void 0&&t?t._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=this._maxTileCacheSize===void 0&&t?t._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const t in this._tiles){const l=this._tiles[t];if(l.state!=="loaded"&&l.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(t,l){return t.isSymbolTile=this._onlySymbols,t.isExtraShadowCaster=this._shadowCasterTiles[t.tileID.key],this._source.loadTile(t,l)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t)}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t)}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const l in this._tiles){const B=this._tiles[l];B.upload(t),B.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return o.bj(this._tiles).map(t=>t.tileID).sort(Sr).map(t=>t.key)}getRenderableIds(t,l){const B=[];for(const G in this._tiles)this._isIdRenderable(+G,t,l)&&B.push(this._tiles[G]);return t?B.sort((G,Z)=>{const Y=G.tileID,re=Z.tileID,oe=new o.P(Y.canonical.x,Y.canonical.y)._rotate(this.transform.angle),ce=new o.P(re.canonical.x,re.canonical.y)._rotate(this.transform.angle);return Y.overscaledZ-re.overscaledZ||ce.y-oe.y||ce.x-oe.x}).map(G=>G.tileID.key):B.map(G=>G.tileID).sort(Sr).map(G=>G.key)}hasRenderableParent(t){const l=this.findLoadedParent(t,0);return!!l&&this._isIdRenderable(l.tileID.key)}_isIdRenderable(t,l,B){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(l||!this._tiles[t].holdingForFade())&&(B||!this._shadowCasterTiles[t])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(+t,"reloading")}}_reloadTile(t,l){const B=this._tiles[t];B&&(B.state!=="loading"&&(B.state=l),this._loadTile(B,this._tileLoaded.bind(this,B,t,l)))}_tileLoaded(t,l,B,G){if(G)if(t.state="errored",G.status!==404)this._source.fire(new o.y(G,{tile:t}));else{if(this._source.fire(new o.z("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:t})),!(t.tileID.key in this._loadedParentTiles))return;if(this._source.type==="raster-dem"&&this.usedForTerrain&&this.map.painter.terrain){const Z=this.map.painter.terrain;this.update(this.transform,Z.getScaledDemTileSize(),!0),Z.resetTileLookupCache(this.id)}else this.update(this.transform)}else t.timeAdded=o.q.now(),B==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(l,t),this._source.type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new o.z("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const l=this.getRenderableIds();for(let G=0;G<l.length;G++){const Z=l[G];if(t.neighboringTiles&&t.neighboringTiles[Z]){const Y=this.getTileByID(Z);B(t,Y),B(Y,t)}}function B(G,Z){if(!G.dem||G.dem.borderReady)return;G.needsHillshadePrepare=!0,G.needsDEMTextureUpload=!0;let Y=Z.tileID.canonical.x-G.tileID.canonical.x;const re=Z.tileID.canonical.y-G.tileID.canonical.y,oe=Math.pow(2,G.tileID.canonical.z),ce=Z.tileID.key;Y===0&&re===0||Math.abs(re)>1||(Math.abs(Y)>1&&(Math.abs(Y+oe)===1?Y+=oe:Math.abs(Y-oe)===1&&(Y-=oe)),Z.dem&&G.dem&&(G.dem.backfillBorder(Z.dem,Y,re),G.neighboringTiles&&G.neighboringTiles[ce]&&(G.neighboringTiles[ce].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,l,B,G){for(const Z in this._tiles){let Y=this._tiles[Z];if(G[Z]||!Y.hasData()||Y.tileID.overscaledZ<=l||Y.tileID.overscaledZ>B)continue;let re=Y.tileID;for(;Y&&Y.tileID.overscaledZ>l+1;){const ce=Y.tileID.scaledTo(Y.tileID.overscaledZ-1);Y=this._tiles[ce.key],Y&&Y.hasData()&&(re=ce)}let oe=re;for(;oe.overscaledZ>l;)if(oe=oe.scaledTo(oe.overscaledZ-1),t[oe.key]){G[re.key]=re;break}}}findLoadedParent(t,l){if(t.key in this._loadedParentTiles){const B=this._loadedParentTiles[t.key];return B&&B.tileID.overscaledZ>=l?B:null}for(let B=t.overscaledZ-1;B>=l;B--){const G=t.scaledTo(B),Z=this._getLoadedTile(G);if(Z)return Z}}_getLoadedTile(t){const l=this._tiles[t.key];return l&&l.hasData()?l:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,l){l=l||this._source.tileSize;const B=Math.ceil(t.width/l)+1,G=Math.ceil(t.height/l)+1,Z=Math.floor(B*G*5),Y=typeof this._minTileCacheSize=="number"?Math.max(this._minTileCacheSize,Z):Z,re=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Y):Y;this._cache.setMaxSize(re)}handleWrapJump(t){const l=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,l){const B={};for(const G in this._tiles){const Z=this._tiles[G];Z.tileID=Z.tileID.unwrapTo(Z.tileID.wrap+l),B[Z.tileID.key]=Z}this._tiles=B;for(const G in this._timers)clearTimeout(this._timers[G]),delete this._timers[G];for(const G in this._tiles)this._setTileReloadTimer(+G,this._tiles[G])}}update(t,l,B,G){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!B)return;this.updateCacheSize(t,l),this.transform.projection.name!=="globe"&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const Z=this._source.type==="batched-model";let Y,re=this._source.maxzoom;const oe=this.map&&this.map.painter?this.map.painter._terrain:null;if(oe&&oe.sourceCache===this&&oe.attenuationRange()){const pe=oe.attenuationRange()[0],fe=Math.floor(pe)-Math.log2(oe.getDemUpscale());re>fe&&(re=fe)}if(this.used||this.usedForTerrain){if(this._source.tileID)Y=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(pe=>new o.aG(pe.canonical.z,pe.wrap,pe.canonical.z,pe.canonical.x,pe.canonical.y));else if(this.tileCoverLift!==0){const pe=t.clone();pe.tileCoverLift=this.tileCoverLift,Y=pe.coveringTiles({tileSize:l||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:re,roundZoom:this._source.roundZoom&&!B,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:Z}),this._source.minzoom<=1&&t.projection.name==="globe"&&(Y.push(new o.aG(1,0,1,0,0)),Y.push(new o.aG(1,0,1,1,0)),Y.push(new o.aG(1,0,1,0,1)),Y.push(new o.aG(1,0,1,1,1)))}else if(Y=t.coveringTiles({tileSize:l||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:re,roundZoom:this._source.roundZoom&&!B,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:Z}),this._source.hasTile){const pe=this._source.hasTile.bind(this._source);Y=Y.filter(fe=>pe(fe))}}else Y=[];if(Y.length>0&&this.castsShadows&&G&&this.transform.projection.name!=="globe"&&!this.usedForTerrain&&!sh(this._source.type)){const pe=t.coveringZoomLevel({tileSize:l||this._source.tileSize,roundZoom:this._source.roundZoom&&!B}),fe=Math.min(pe,this._source.maxzoom);if(Z){const be=t.extendTileCover(Y,fe);for(const ze of be)Y.push(ze)}else{const be=t.extendTileCover(Y,fe,G);for(const ze of be)this._shadowCasterTiles[ze.key]=!0,Y.push(ze)}}const ce=this._updateRetainedTiles(Y);if(sh(this._source.type)&&Y.length!==0){const pe={},fe={},be=Object.keys(ce);for(const De of be){const Oe=ce[De],Fe=this._tiles[De];if(!Fe||Fe.fadeEndTime&&Fe.fadeEndTime<=o.q.now())continue;const Ge=this.findLoadedParent(Oe,Math.max(Oe.overscaledZ-Es.maxOverzooming,this._source.minzoom));Ge&&(this._addTile(Ge.tileID),pe[Ge.tileID.key]=Ge.tileID),fe[De]=Oe}const ze=Y[Y.length-1].overscaledZ;for(const De in this._tiles){const Oe=this._tiles[De];if(ce[De]||!Oe.hasData())continue;let Fe=Oe.tileID;for(;Fe.overscaledZ>ze;){Fe=Fe.scaledTo(Fe.overscaledZ-1);const Ge=this._tiles[Fe.key];if(Ge&&Ge.hasData()&&fe[Fe.key]){ce[De]=Oe.tileID;break}}}for(const De in pe)ce[De]||(this._coveredTiles[De]=!0,ce[De]=pe[De])}for(const pe in ce)this._tiles[pe].clearFadeHold();const he=o.bk(this._tiles,ce);for(const pe of he){const fe=this._tiles[pe];fe.hasSymbolBuckets&&!fe.holdingForFade()?fe.setHoldDuration(this.map._fadeDuration):fe.hasSymbolBuckets&&!fe.symbolFadeFinished()||this._removeTile(+pe)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const l={};if(t.length===0)return l;const B={},G=t.reduce((ce,he)=>Math.min(ce,he.overscaledZ),1/0),Z=t[0].overscaledZ,Y=Math.max(Z-Es.maxOverzooming,this._source.minzoom),re=Math.max(Z+Es.maxUnderzooming,this._source.minzoom),oe={};for(const ce of t){const he=this._addTile(ce);l[ce.key]=ce,he.hasData()||G<this._source.maxzoom&&(oe[ce.key]=ce)}this._retainLoadedChildren(oe,G,re,l);for(const ce of t){let he=this._tiles[ce.key];if(he.hasData())continue;if(ce.canonical.z>=this._source.maxzoom){const fe=ce.children(this._source.maxzoom)[0],be=this.getTile(fe);if(be&&be.hasData()){l[fe.key]=fe;continue}}else{const fe=ce.children(this._source.maxzoom);if(l[fe[0].key]&&l[fe[1].key]&&l[fe[2].key]&&l[fe[3].key])continue}let pe=he.wasRequested();for(let fe=ce.overscaledZ-1;fe>=Y;--fe){const be=ce.scaledTo(fe);if(B[be.key]||(B[be.key]=!0,he=this.getTile(be),!he&&pe&&(he=this._addTile(be)),he&&(l[be.key]=be,pe=he.wasRequested(),he.hasData())))break}}return l}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const l=[];let B,G=this._tiles[t].tileID;for(;G.overscaledZ>0;){if(G.key in this._loadedParentTiles){B=this._loadedParentTiles[G.key];break}l.push(G.key);const Z=G.scaledTo(G.overscaledZ-1);if(B=this._getLoadedTile(Z),B)break;G=Z}for(const Z of l)this._loadedParentTiles[Z]=B}}_addTile(t){let l=this._tiles[t.key];if(l)return l.isExtraShadowCaster!==!0||this._shadowCasterTiles[t.key]||this._reloadTile(t.key,"reloading"),l;l=this._cache.getAndRemove(t),l&&(this._setTileReloadTimer(t.key,l),l.tileID=t,this._state.initializeTileState(l,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,l)));const B=!!l;if(!B){const G=this.map?this.map.painter:null,Z=this._source.tileSize*t.overscaleFactor();l=this._source.type==="raster-array"?new wa(t,Z,this.transform.tileZoom,G,this._isRaster):new ba(t,Z,this.transform.tileZoom,G,this._isRaster),this._loadTile(l,this._tileLoaded.bind(this,l,t.key,l.state))}return l?(l.uses++,this._tiles[t.key]=l,B||this._source.fire(new o.z("dataloading",{tile:l,coord:l.tileID,dataType:"source"})),l):null}_setTileReloadTimer(t,l){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const B=l.getExpiryTimeout();B&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},B))}_removeTile(t){const l=this._tiles[t];l&&(l.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),l.uses>0||(l.hasData()&&l.state!=="reloading"||l.state==="empty"?this._cache.add(l.tileID,l,l.getExpiryTimeout()):(l.aborted=!0,this._abortTile(l),this._unloadTile(l))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);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,l,B){const G=[],Z=this.transform;if(!Z)return G;const Y=Z.projection.name==="globe",re=o.at(Z.center.lng);for(const oe in this._tiles){const ce=this._tiles[oe];if(B&&ce.clearQueryDebugViz(),ce.holdingForFade())continue;let he;if(Y){const pe=ce.tileID.canonical;if(pe.z===0){const fe=[Math.abs(o.aw(re,...Bi(pe,-1))-re),Math.abs(o.aw(re,...Bi(pe,1))-re)];he=[0,2*fe.indexOf(Math.min(...fe))-1]}else{const fe=[Math.abs(o.aw(re,...Bi(pe,-1))-re),Math.abs(o.aw(re,...Bi(pe,0))-re),Math.abs(o.aw(re,...Bi(pe,1))-re)];he=[fe.indexOf(Math.min(...fe))-1]}}else he=[0];for(const pe of he){const fe=t.containsTile(ce,Z,l,pe);fe&&G.push(fe)}}return G}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(t){return this._getRenderableCoordinates(t)}_getRenderableCoordinates(t,l){const B=this.getRenderableIds(t,l).map(Z=>this._tiles[Z].tileID),G=this.transform.projection.name==="globe";for(const Z of B)Z.projMatrix=this.transform.calculateProjMatrix(Z.toUnwrapped()),Z.expandedProjMatrix=G?this.transform.calculateProjMatrix(Z.toUnwrapped(),!1,!0):Z.projMatrix;return B}sortCoordinatesByDistance(t){const l=t.slice(),B=this.transform._camera.position,G=this.transform._camera.forward(),Z={};for(const Y of l){const re=1/(1<<Y.canonical.z);Z[Y.key]=((Y.canonical.x+.5)*re+Y.wrap-B[0])*G[0]+((Y.canonical.y+.5)*re-B[1])*G[1]-B[2]*G[2]}return l.sort((Y,re)=>Z[Y.key]-Z[re.key]),l}hasTransition(){if(this._source.hasTransition())return!0;if(sh(this._source.type))for(const t in this._tiles){const l=this._tiles[t];if(l.fadeEndTime!==void 0&&l.fadeEndTime>=o.q.now())return!0}return!1}setFeatureState(t,l,B){this._state.updateState(t=t||"_geojsonTileLayer",l,B)}removeFeatureState(t,l,B){this._state.removeFeatureState(t=t||"_geojsonTileLayer",l,B)}getFeatureState(t,l){return this._state.getState(t=t||"_geojsonTileLayer",l)}setDependencies(t,l,B){const G=this._tiles[t];G&&G.setDependencies(l,B)}reloadTilesForDependencies(t,l){for(const B in this._tiles)this._tiles[B].hasDependency(t,l)&&this._reloadTile(+B,"reloading");this._cache.filter(B=>!B.hasDependency(t,l))}_preloadTiles(t,l){if(!this._sourceLoaded){const oe=()=>{this._sourceLoaded&&(this._source.off("data",oe),this._preloadTiles(t,l))};return void this._source.on("data",oe)}const B=new Map,G=Array.isArray(t)?t:[t],Z=this.map.painter.terrain,Y=this.usedForTerrain&&Z?Z.getScaledDemTileSize():this._source.tileSize;for(const oe of G){const ce=oe.coveringTiles({tileSize:Y,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const he of ce)B.set(he.key,he);this.usedForTerrain&&oe.updateElevation(!1)}const re=Array.from(B.values());o.bl(re,(oe,ce)=>{const he=new ba(oe,this._source.tileSize*oe.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(he,pe=>{this._source.type==="raster-dem"&&he.dem&&this._backfillDEM(he),ce(pe,he)})},l)}}function Sr(F,t){const l=Math.abs(2*F.wrap)-+(F.wrap<0),B=Math.abs(2*t.wrap)-+(t.wrap<0);return F.overscaledZ-t.overscaledZ||B-l||t.canonical.y-F.canonical.y||t.canonical.x-F.canonical.x}function sh(F){return F==="raster"||F==="image"||F==="video"||F==="custom"}function Bi(F,t){const l=1<<F.z;return[F.x/l+t,(F.x+1)/l+t]}Es.maxOverzooming=10,Es.maxUnderzooming=3;class ed{constructor(t){this.style=t,this.layersGotHidden=!1,this.layers=[]}processLayersChanged(){this.layers=[];const t=!1,l=!1;for(const B in this.style._mergedLayers){const G=this.style._mergedLayers[B];if(G.type==="fill-extrusion")this.layers.push({layer:G,visible:t,visibilityChanged:l});else if(G.type==="model"){const Z=this.style.getLayerSource(G);Z&&Z.type==="batched-model"&&this.layers.push({layer:G,visible:t,visibilityChanged:l})}}}onNewFrame(t){this.layersGotHidden=!1;for(const l of this.layers){const B=l.layer;let G=!1;B.type==="fill-extrusion"?G=!B.isHidden(t)&&B.paint.get("fill-extrusion-opacity")>0:B.type==="model"&&(G=!B.isHidden(t)&&B.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!G&&l.visible,l.visible=G}}updateZOffset(t,l){this.currentBuildingBuckets=[];for(const G of this.layers){const Z=G.layer,Y=this.style.getLayerSourceCache(Z);let re=1;Z.type==="fill-extrusion"&&(re=G.visible?Z.paint.get("fill-extrusion-vertical-scale"):0);let oe=Y?Y.getTile(l):null;if(!oe&&Y&&l.canonical.z>Y.getSource().minzoom){let ce=l.scaledTo(Math.min(Y.getSource().maxzoom,l.overscaledZ-1));for(;ce.overscaledZ>=Y.getSource().minzoom&&(oe=Y.getTile(ce),!oe&&ce.overscaledZ!==0);)ce=ce.scaledTo(ce.overscaledZ-1)}this.currentBuildingBuckets.push({bucket:oe?oe.getBucket(Z):null,tileID:oe?oe.tileID:l,verticalScale:re})}t.hasAnyZOffset=!1;let B=!1;for(let G=0;G<t.symbolInstances.length;G++){const Z=t.symbolInstances.get(G),Y=Z.zOffset,re=this._getHeightAtTileOffset(l,Z.tileAnchorX,Z.tileAnchorY);Z.zOffset=re!==Number.NEGATIVE_INFINITY?re:Y,B||Y===Z.zOffset||(B=!0),t.hasAnyZOffset||Z.zOffset===0||(t.hasAnyZOffset=!0)}B&&(t.zOffsetBuffersNeedUpload=!0,t.zOffsetSortDirty=!0)}_mapCoordToOverlappingTile(t,l,B,G){let Z=l,Y=B;if(t.canonical.z!==G.canonical.z){const re=G.canonical,oe=1/(1<<t.canonical.z-re.z);Z=(l+t.canonical.x*o.ag)*oe-re.x*o.ag|0,Y=(B+t.canonical.y*o.ag)*oe-re.y*o.ag|0}return{tileX:Z,tileY:Y}}_getHeightAtTileOffset(t,l,B){let G,Z;for(let Y=0;Y<this.layers.length;++Y){if(this.layers[Y].layer.type!=="fill-extrusion")continue;const{bucket:re,tileID:oe,verticalScale:ce}=this.currentBuildingBuckets[Y];if(!re)continue;const{tileX:he,tileY:pe}=this._mapCoordToOverlappingTile(t,l,B,oe),fe=re.getHeightAtTileCoord(he,pe);fe&&fe.height!==void 0&&(fe.hidden?G=fe.height:Z=Math.max(fe.height*ce,Z||0))}if(Z!==void 0)return Z;for(let Y=0;Y<this.layers.length;++Y){const re=this.layers[Y];if(re.layer.type!=="model"||!re.visible)continue;const{bucket:oe,tileID:ce}=this.currentBuildingBuckets[Y];if(!oe)continue;const{tileX:he,tileY:pe}=this._mapCoordToOverlappingTile(t,l,B,ce),fe=oe.getHeightAtTileCoord(he,pe);if(fe&&!fe.hidden)return fe.height===void 0&&G!==void 0?Math.min(fe.maxHeight,G)*fe.verticalScale:fe.height?fe.height*fe.verticalScale:Number.NEGATIVE_INFINITY}return this.layersGotHidden?0:Number.NEGATIVE_INFINITY}}function Zl(F,t){const l={};for(const B in F)B!=="ref"&&(l[B]=F[B]);return o.bm.forEach(B=>{B in t&&(l[B]=t[B])}),l}function Xl(F){F=F.slice();const t=Object.create(null);for(let l=0;l<F.length;l++)t[F[l].id]=F[l];for(let l=0;l<F.length;l++)"ref"in F[l]&&(F[l]=Zl(F[l],t[F[l].ref]));return F}const rr={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setSlot:"setSlot",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setSnow:"setSnow",setRain:"setRain",setCamera:"setCamera",setLights:"setLights",setProjection:"setProjection",addImport:"addImport",removeImport:"removeImport",updateImport:"updateImport"};function Yl(F,t,l){l.push({command:rr.addSource,args:[F,t[F]]})}function Va(F,t,l){t.push({command:rr.removeSource,args:[F]}),l[F]=!0}function Ei(F,t,l,B){Va(F,l,B),Yl(F,t,l)}function Ar(F,t,l){let B;for(B in F[l])if(F[l].hasOwnProperty(B)&&B!=="data"&&!o.bn(F[l][B],t[l][B]))return!1;for(B in t[l])if(t[l].hasOwnProperty(B)&&B!=="data"&&!o.bn(F[l][B],t[l][B]))return!1;return!0}function pr(F,t,l,B,G,Z){let Y;for(Y in t=t||{},F=F||{})F.hasOwnProperty(Y)&&(o.bn(F[Y],t[Y])||l.push({command:Z,args:[B,Y,t[Y],G]}));for(Y in t)t.hasOwnProperty(Y)&&!F.hasOwnProperty(Y)&&(o.bn(F[Y],t[Y])||l.push({command:Z,args:[B,Y,t[Y],G]}))}function $n(F){return F.id}function aa(F,t){return F[t.id]=t,F}class vr{constructor(t,l){this.reset(t,l)}reset(t,l){this.points=t||[],this._distances=[0];for(let B=1;B<this.points.length;B++)this._distances[B]=this._distances[B-1]+this.points[B].dist(this.points[B-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(l||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=o.aw(t,0,1);let l=1,B=this._distances[l];const G=t*this.paddedLength+this.padding;
vendor: 4,638 bytes, line 274
274for(;B<G&&l<this._distances.length;)B=this._distances[++l];const Z=l-1,Y=this._distances[Z],re=B-Y,oe=re>0?(G-Y)/re:0;return this.points[Z].mult(1-oe).add(this.points[l].mult(oe))}}class Wo{constructor(t,l,B){const G=this.boxCells=[],Z=this.circleCells=[];this.xCellCount=Math.ceil(t/B),this.yCellCount=Math.ceil(l/B);for(let Y=0;Y<this.xCellCount*this.yCellCount;Y++)G.push([]),Z.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=l,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/l,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,l,B,G,Z){this._forEachCell(l,B,G,Z,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(l),this.bboxes.push(B),this.bboxes.push(G),this.bboxes.push(Z)}insertCircle(t,l,B,G){this._forEachCell(l-G,B-G,l+G,B+G,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(l),this.circles.push(B),this.circles.push(G)}_insertBoxCell(t,l,B,G,Z,Y){this.boxCells[Z].push(Y)}_insertCircleCell(t,l,B,G,Z,Y){this.circleCells[Z].push(Y)}_query(t,l,B,G,Z,Y){if(B<0||t>this.width||G<0||l>this.height)return!Z&&[];const re=[];if(t<=0&&l<=0&&this.width<=B&&this.height<=G){if(Z)return!0;for(let oe=0;oe<this.boxKeys.length;oe++)re.push({key:this.boxKeys[oe],x1:this.bboxes[4*oe],y1:this.bboxes[4*oe+1],x2:this.bboxes[4*oe+2],y2:this.bboxes[4*oe+3]});for(let oe=0;oe<this.circleKeys.length;oe++){const ce=this.circles[3*oe],he=this.circles[3*oe+1],pe=this.circles[3*oe+2];re.push({key:this.circleKeys[oe],x1:ce-pe,y1:he-pe,x2:ce+pe,y2:he+pe})}return Y?re.filter(Y):re}return this._forEachCell(t,l,B,G,this._queryCell,re,{hitTest:Z,seenUids:{box:{},circle:{}}},Y),Z?re.length>0:re}_queryCircle(t,l,B,G,Z){const Y=t-B,re=t+B,oe=l-B,ce=l+B;if(re<0||Y>this.width||ce<0||oe>this.height)return!G&&[];const he=[];return this._forEachCell(Y,oe,re,ce,this._queryCellCircle,he,{hitTest:G,circle:{x:t,y:l,radius:B},seenUids:{box:{},circle:{}}},Z),G?he.length>0:he}query(t,l,B,G,Z){return this._query(t,l,B,G,!1,Z)}hitTest(t,l,B,G,Z){return this._query(t,l,B,G,!0,Z)}hitTestCircle(t,l,B,G){return this._queryCircle(t,l,B,!0,G)}_queryCell(t,l,B,G,Z,Y,re,oe){const ce=re.seenUids,he=this.boxCells[Z];if(he!==null){const fe=this.bboxes;for(const be of he)if(!ce.box[be]){ce.box[be]=!0;const ze=4*be;if(t<=fe[ze+2]&&l<=fe[ze+3]&&B>=fe[ze+0]&&G>=fe[ze+1]&&(!oe||oe(this.boxKeys[be]))){if(re.hitTest)return Y.push(!0),!0;Y.push({key:this.boxKeys[be],x1:fe[ze],y1:fe[ze+1],x2:fe[ze+2],y2:fe[ze+3]})}}}const pe=this.circleCells[Z];if(pe!==null){const fe=this.circles;for(const be of pe)if(!ce.circle[be]){ce.circle[be]=!0;const ze=3*be;if(this._circleAndRectCollide(fe[ze],fe[ze+1],fe[ze+2],t,l,B,G)&&(!oe||oe(this.circleKeys[be]))){if(re.hitTest)return Y.push(!0),!0;{const De=fe[ze],Oe=fe[ze+1],Fe=fe[ze+2];Y.push({key:this.circleKeys[be],x1:De-Fe,y1:Oe-Fe,x2:De+Fe,y2:Oe+Fe})}}}}}_queryCellCircle(t,l,B,G,Z,Y,re,oe){const ce=re.circle,he=re.seenUids,pe=this.boxCells[Z];if(pe!==null){const be=this.bboxes;for(const ze of pe)if(!he.box[ze]){he.box[ze]=!0;const De=4*ze;if(this._circleAndRectCollide(ce.x,ce.y,ce.radius,be[De+0],be[De+1],be[De+2],be[De+3])&&(!oe||oe(this.boxKeys[ze])))return Y.push(!0),!0}}const fe=this.circleCells[Z];if(fe!==null){const be=this.circles;for(const ze of fe)if(!he.circle[ze]){he.circle[ze]=!0;const De=3*ze;if(this._circlesCollide(be[De],be[De+1],be[De+2],ce.x,ce.y,ce.radius)&&(!oe||oe(this.circleKeys[ze])))return Y.push(!0),!0}}}_forEachCell(t,l,B,G,Z,Y,re,oe){const ce=this._convertToXCellCoord(t),he=this._convertToYCellCoord(l),pe=this._convertToXCellCoord(B),fe=this._convertToYCellCoord(G);for(let be=ce;be<=pe;be++)for(let ze=he;ze<=fe;ze++)if(Z.call(this,t,l,B,G,this.xCellCount*ze+be,Y,re,oe))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,l,B,G,Z,Y){const re=G-t,oe=Z-l,ce=B+Y;return ce*ce>re*re+oe*oe}_circleAndRectCollide(t,l,B,G,Z,Y,re){const oe=(Y-G)/2,ce=Math.abs(t-(G+oe));if(ce>oe+B)return!1;const he=(re-Z)/2,pe=Math.abs(l-(Z+he));if(pe>he+B)return!1;if(ce<=oe||pe<=he)return!0;const fe=ce-oe,be=pe-he;return fe*fe+be*be<=B*B}}const qs={unknown:0,flipRequired:1,flipNotRequired:2},Zo=Math.tan(85*Math.PI/180);function zn(F,t,l,B,G,Z,Y){const re=o.ab.mat4.create();if(l)if(Z.name==="globe"){const oe=o.bo(G,t);o.ab.mat4.multiply(re,re,oe)}else{const oe=o.ab.mat2.invert([],Y);re[0]=oe[0],re[1]=oe[1],re[4]=oe[2],re[5]=oe[3],B||o.ab.mat4.rotateZ(re,re,G.angle)}
274else o.ab.mat4.multiply(re,G.labelPlaneMatrix,F);return re}function sn(F,t,l,B,G,Z,Y){const re=zn(F,t,l,B,G,Z,Y);return Z.name==="globe"&&l||(re[2]=re[6]=re[10]=re[14]=0),re}function ah(F,t,l,B,G,Z,Y){if(l){if(Z.name==="globe"){const re=zn(F,t,l,B,G,Z,Y);return o.ab.mat4.invert(re,re),o.ab.mat4.multiply(re,F,re),re}{const re=o.ab.mat4.clone(F),oe=o.ab.mat4.identity([]);return oe[0]=Y[0],oe[1]=Y[1],oe[4]=Y[2],oe[5]=Y[3],o.ab.mat4.multiply(re,re,oe),B||o.ab.mat4.rotateZ(re,re,-G.angle),re}}return G.glCoordMatrix}function as(F,t,l,B){const G=[F,t,l,1];l?o.ab.vec4.transformMat4(G,G,B):As(G,G,B);const Z=G[3];return G[0]/=Z,G[1]/=Z,G[2]/=Z,G}function Jl(F,t){return Math.min(.5+F/t*.5,1.5)}function Xo(F,t){const l=F[0]/F[3],B=F[1]/F[3];return l>=-t[0]&&l<=t[0]&&B>=-t[1]&&B<=t[1]}function Kl(F,t,l,B,G,Z,Y,re,oe,ce){const he=l.transform,pe=B?F.textSizeData:F.iconSizeData,fe=o.bp(pe,l.transform.zoom),be=he.projection.name==="globe",ze=[256/l.width*2+1,256/l.height*2+1],De=B?F.text.dynamicLayoutVertexArray:F.icon.dynamicLayoutVertexArray;De.clear();let Oe=null;be&&(Oe=B?F.text.globeExtVertexArray:F.icon.globeExtVertexArray);const Fe=F.lineVertexArray,Ge=B?F.text.placedSymbolArray:F.icon.placedSymbolArray,Xe=l.transform.width/l.transform.height;let Ze,nt=!1;for(let Qe=0;Qe<Ge.length;Qe++){const it=Ge.get(Qe),{numGlyphs:Ke,writingMode:ht}=it;if(ht!==o.bq.vertical||nt||Ze===o.bq.horizontal||(nt=!0),Ze=ht,(it.hidden||ht===o.bq.vertical)&&!nt){Kr(Ke,De);continue}nt=!1;const yt=new o.P(it.tileAnchorX,it.tileAnchorY);let{x:Nt,y:Dt,z:Wt}=he.projection.projectTilePoint(yt.x,yt.y,ce.canonical);if(oe){const[Xt,ri,ci]=oe(yt);Nt+=Xt,Dt+=ri,Wt+=ci}const $t=[Nt,Dt,Wt,1];if(o.ab.vec4.transformMat4($t,$t,t),!Xo($t,ze)){Kr(Ke,De);continue}const At=$t[3],Vt=Jl(l.transform.getCameraToCenterDistance(he.projection),At),ii=o.br(pe,fe,it),Et=Y?ii/Vt:ii*Vt,Jt=as(Nt,Dt,Wt,G);if(Jt[3]<=0){Kr(Ke,De);continue}let Ut={};const hi=Y?null:oe,Qt=$s(it,Et,!1,re,t,G,Z,F.glyphOffsetArray,Fe,De,Oe,Jt,yt,Ut,Xe,hi,he.projection,ce,Y);nt=Qt.useVertical,hi&&Qt.needsFlipping&&(Ut={}),(Qt.notEnoughRoom||nt||Qt.needsFlipping&&$s(it,Et,!0,re,t,G,Z,F.glyphOffsetArray,Fe,De,Oe,Jt,yt,Ut,Xe,hi,he.projection,ce,Y).notEnoughRoom)&&Kr(Ke,De)}B?(F.text.dynamicLayoutVertexBuffer.updateData(De),Oe&&F.text.globeExtVertexBuffer&&F.text.globeExtVertexBuffer.updateData(Oe)):(F.icon.dynamicLayoutVertexBuffer.updateData(De),Oe&&F.icon.globeExtVertexBuffer&&F.icon.globeExtVertexBuffer.updateData(Oe))}function Yo(F,t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De){const{lineStartIndex:Oe,glyphStartIndex:Fe,segment:Ge}=re,Xe=Fe+re.numGlyphs,Ze=Oe+re.lineLength,nt=t.getoffsetX(Fe),Qe=t.getoffsetX(Xe-1),it=oa(F*nt,l,B,G,Z,Y,Ge,Oe,Ze,oe,ce,he,pe,fe,!0,be,ze,De);if(!it)return null;const Ke=oa(F*Qe,l,B,G,Z,Y,Ge,Oe,Ze,oe,ce,he,pe,fe,!0,be,ze,De);return Ke?{first:it,last:Ke}:null}function Hn(F,t,l,B){return F===o.bq.horizontal&&Math.abs(B)>Math.abs(l)?{useVertical:!0}:F===o.bq.vertical?B>0?{needsFlipping:!0}:null:t!==qs.unknown&&function(G,Z){return G===0||Math.abs(Z/G)>Zo}(l,B)?t===qs.flipRequired?{needsFlipping:!0}:null:l<0?{needsFlipping:!0}:null}function $s(F,t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De,Oe,Fe,Ge){const Xe=t/24,Ze=F.lineOffsetX*Xe,nt=F.lineOffsetY*Xe,{lineStartIndex:Qe,glyphStartIndex:it,numGlyphs:Ke,segment:ht,writingMode:yt,flipState:Nt}=F,Dt=Qe+F.lineLength,Wt=$t=>{if(he){const[Et,Jt,Ut]=$t.up,hi=ce.length;o.bs(he,hi+0,Et,Jt,Ut),o.bs(he,hi+1,Et,Jt,Ut),o.bs(he,hi+2,Et,Jt,Ut),o.bs(he,hi+3,Et,Jt,Ut)}const[At,Vt,ii]=$t.point;o.bt(ce,At,Vt,ii,$t.angle)};if(Ke>1){const $t=Yo(Xe,re,Ze,nt,l,pe,fe,F,oe,Z,be,De,!1,Oe,Fe,Ge);if(!$t)return{notEnoughRoom:!0};if(B&&!l){let[At,Vt,ii]=$t.first.point,[Et,Jt,Ut]=$t.last.point;[At,Vt]=as(At,Vt,ii,Y),[Et,Jt]=as(Et,Jt,Ut,Y);const hi=Hn(yt,Nt,(Et-At)*ze,Jt-Vt);if(F.flipState=hi&&hi.needsFlipping?qs.flipRequired:qs.flipNotRequired,hi)return hi}Wt($t.first);for(let At=it+1;At<it+Ke-1;At++){const Vt=oa(Xe*re.getoffsetX(At),Ze,nt,l,pe,fe,ht,Qe,Dt,oe,Z,be,De,!1,!1,Oe,Fe,Ge);if(!Vt)return ce.length-=4*(At-it),{notEnoughRoom:!0};Wt(Vt)}Wt($t.last)}else{if(B&&!l){const At=as(fe.x,fe.y,0,G),Vt=Qe+ht+1,ii=new o.P(oe.getx(Vt),oe.gety(Vt)),Et=as(ii.x,ii.y,0,G),Jt=Et[3]>0?Et:oh(fe,ii,At,1,G,void 0,Oe,Fe.canonical),Ut=Hn(yt,Nt,(Jt[0]-At[0])*ze,Jt[1]-At[1]);if(F.flipState=Ut&&Ut.needsFlipping?qs.flipRequired:qs.flipNotRequired,Ut)return Ut}const $t=oa(Xe*re.getoffsetX(it),Ze,nt,l,pe,fe,ht,Qe,Dt,oe,Z,be,De,!1,!1,Oe,Fe,Ge);if(!$t)return{notEnoughRoom:!0};Wt($t)}return{}}function Un(F,t,l,B,G){const{x:Z,y:Y,z:re}=B.projectTilePoint(F.x,F.y,t);
274if(!G)return as(Z,Y,re,l);const[oe,ce,he]=G(F);return as(Z+oe,Y+ce,re+he,l)}function oh(F,t,l,B,G,Z,Y,re){const oe=Un(F.sub(t)._unit()._add(F),re,G,Y,Z);return o.ab.vec3.sub(oe,l,oe),o.ab.vec3.normalize(oe,oe),o.ab.vec3.scaleAndAdd(oe,l,oe,B)}function oa(F,t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De,Oe,Fe){const Ge=B?F-t:F+t;let Xe=Ge>0?1:-1,Ze=0;B&&(Xe*=-1,Ze=Math.PI),Xe<0&&(Ze+=Math.PI);let nt=re+Y+(Xe>0?0:1)|0,Qe=G,it=G,Ke=0,ht=0;const yt=Math.abs(Ge),Nt=[],Dt=[];let Wt=Z,$t=Wt;const At=()=>oh($t,Wt,it,yt-Ke+1,he,fe,De,Oe.canonical);for(;Ke+ht<=yt;){if(nt+=Xe,nt<re||nt>=oe)return null;if(it=Qe,$t=Wt,Nt.push(it),be&&Dt.push($t),Wt=new o.P(ce.getx(nt),ce.gety(nt)),Qe=pe[nt],!Qe){const ri=Un(Wt,Oe.canonical,he,De,fe);Qe=ri[3]>0?pe[nt]=ri:At()}Ke+=ht,ht=o.ab.vec3.distance(it,Qe)}ze&&fe&&(pe[nt]&&(Qe=At(),ht=o.ab.vec3.distance(it,Qe)),pe[nt]=Qe);const Vt=(yt-Ke)/ht,ii=Wt.sub($t)._mult(Vt)._add($t),Et=o.ab.vec3.sub([],Qe,it),Jt=o.ab.vec3.scaleAndAdd([],it,Et,Vt);let Ut=[0,0,1],hi=Et[0],Qt=Et[1];if(Fe&&(Ut=De.upVector(Oe.canonical,ii.x,ii.y),Ut[0]!==0||Ut[1]!==0||Ut[2]!==1)){const ri=[Ut[2],0,-Ut[0]],ci=o.ab.vec3.cross([],Ut,ri);o.ab.vec3.normalize(ri,ri),o.ab.vec3.normalize(ci,ci),hi=o.ab.vec3.dot(Et,ri),Qt=o.ab.vec3.dot(Et,ci)}if(l){const ri=o.ab.vec3.cross([],Ut,Et);o.ab.vec3.normalize(ri,ri),o.ab.vec3.scaleAndAdd(Jt,Jt,ri,l*Xe)}const Xt=Ze+Math.atan2(Qt,hi);return Nt.push(Jt),be&&Dt.push(ii),{point:Jt,angle:Xt,path:Nt,tilePath:Dt,up:Ut}}function Kr(F,t){const l=t.length,B=l+4*F;t.resize(B),t.float32.fill(-1/0,4*l,4*B)}function As(F,t,l){const B=t[0],G=t[1];return F[0]=l[0]*B+l[4]*G+l[12],F[1]=l[1]*B+l[5]*G+l[13],F[3]=l[3]*B+l[7]*G+l[15],F}const Ln=100;class _n{constructor(t,l,B=new Wo(t.width+200,t.height+200,25),G=new Wo(t.width+200,t.height+200,25)){this.transform=t,this.grid=B,this.ignoredGrid=G,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+Ln,this.screenBottomBoundary=t.height+Ln,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.fogState=l}placeCollisionBox(t,l,B,G,Z,Y,re,oe){let ce=B.projectedAnchorX,he=B.projectedAnchorY,pe=B.projectedAnchorZ;const fe=B.elevation,be=B.tileID,ze=t.getProjection();if(fe&&be){const[Qe,it,Ke]=ze.upVector(be.canonical,B.tileAnchorX,B.tileAnchorY),ht=ze.upVectorScale(be.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;ce+=Qe*fe*ht,he+=it*fe*ht,pe+=Ke*fe*ht}const De=this.projectAndGetPerspectiveRatio(re,ce,he,pe,B.tileID,ze.name==="globe"||!!fe||this.transform.pitch>0,ze),Oe=Y*De.perspectiveRatio,Fe=(B.x1*l+G.x-B.padding)*Oe+De.point.x,Ge=(B.y1*l+G.y-B.padding)*Oe+De.point.y,Xe=(B.x2*l+G.x+B.padding)*Oe+De.point.x,Ze=(B.y2*l+G.y+B.padding)*Oe+De.point.y,nt=De.perspectiveRatio<=.55||De.occluded;return!this.isInsideGrid(Fe,Ge,Xe,Ze)||!Z&&this.grid.hitTest(Fe,Ge,Xe,Ze,oe)||nt?{box:[],offscreen:!1,occluded:De.occluded}:{box:[Fe,Ge,Xe,Ze],offscreen:this.isOffscreen(Fe,Ge,Xe,Ze),occluded:!1}}placeCollisionCircles(t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De){const Oe=[],Fe=this.transform.elevation,Ge=t.getProjection(),Xe=Fe?Fe.getAtTileOffsetFunc(De,this.transform.center.lat,this.transform.worldSize,Ge):null,Ze=new o.P(B.tileAnchorX,B.tileAnchorY);let{x:nt,y:Qe,z:it}=Ge.projectTilePoint(Ze.x,Ze.y,De.canonical);if(Xe){const[ii,Et,Jt]=Xe(Ze);nt+=ii,Qe+=Et,it+=Jt}const Ke=Ge.name==="globe",ht=this.projectAndGetPerspectiveRatio(re,nt,Qe,it,De,Ke||!!Fe||this.transform.pitch>0,Ge),{perspectiveRatio:yt}=ht,Nt=(pe?Y/yt:Y*yt)/o.bw,Dt=as(nt,Qe,it,oe),Wt=ht.signedDistanceFromCamera>0?Yo(Nt,Z,B.lineOffsetX*Nt,B.lineOffsetY*Nt,!1,Dt,Ze,B,G,oe,{},Fe&&!pe?Xe:null,pe&&!!Fe,Ge,De,pe):null;let $t=!1,At=!1,Vt=!0;if(Wt&&!ht.occluded){const ii=.5*be*yt+ze,Et=new o.P(-100,-100),Jt=new o.P(this.screenRightBoundary,this.screenBottomBoundary),Ut=new vr,{first:hi,last:Qt}=Wt,Xt=hi.path.length;let ri=[];for(let Si=Xt-1;Si>=1;Si--)ri.push(hi.path[Si]);for(let Si=1;Si<Qt.path.length;Si++)ri.push(Qt.path[Si]);const ci=2.5*ii;ce&&(ri=ri.map(([Si,Vi,Ci],Ri)=>(Xe&&!Ke&&(Ci=Xe(Ri<Xt-1?hi.tilePath[Xt-1-Ri]:Qt.tilePath[Ri-Xt+2])[2]),as(Si,Vi,Ci,ce))),ri.some(Si=>Si[3]<=0)&&(ri=[]));let xi=[];if(ri.length>0){let Si=1/0,Vi=-1/0,Ci=1/0,Ri=-1/0;for(const Hi of ri)Si=Math.min(Si,Hi[0]),Ci=Math.min(Ci,Hi[1]),Vi=Math.max(Vi,Hi[0]),Ri=Math.max(Ri,Hi[1]);Vi>=Et.x&&Si<=Jt.x&&Ri>=Et.y&&Ci<=Jt.y&&(xi=[ri.map(Hi=>new o.P(Hi[0],Hi[1]))],(Si<Et.x||Vi>Jt.x||Ci<Et.y||Ri>
vendor: 30,623 bytes, line 274
274Jt.y)&&(xi=o.bu(xi,Et.x,Et.y,Jt.x,Jt.y)))}for(const Si of xi){Ut.reset(Si,.25*ii);let Vi=0;Vi=Ut.length<=.5*ii?1:Math.ceil(Ut.paddedLength/ci)+1;for(let Ci=0;Ci<Vi;Ci++){const Ri=Ci/Math.max(Vi-1,1),Hi=Ut.lerp(Ri),cr=Hi.x+Ln,Cr=Hi.y+Ln;Oe.push(cr,Cr,ii,0);const Yr=cr-ii,Ur=Cr-ii,Zi=cr+ii,fr=Cr+ii;if(Vt=Vt&&this.isOffscreen(Yr,Ur,Zi,fr),At=At||this.isInsideGrid(Yr,Ur,Zi,fr),!l&&this.grid.hitTestCircle(cr,Cr,ii,fe)&&($t=!0,!he))return{circles:[],offscreen:!1,collisionDetected:$t,occluded:!1}}}}return{circles:!he&&$t||!At?[]:Oe,offscreen:Vt,collisionDetected:$t,occluded:ht.occluded}}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const l=[];let B=1/0,G=1/0,Z=-1/0,Y=-1/0;for(const he of t){const pe=new o.P(he.x+Ln,he.y+Ln);B=Math.min(B,pe.x),G=Math.min(G,pe.y),Z=Math.max(Z,pe.x),Y=Math.max(Y,pe.y),l.push(pe)}const re=this.grid.query(B,G,Z,Y).concat(this.ignoredGrid.query(B,G,Z,Y)),oe={},ce={};for(const he of re){const pe=he.key;if(oe[pe.bucketInstanceId]===void 0&&(oe[pe.bucketInstanceId]={}),oe[pe.bucketInstanceId][pe.featureIndex])continue;const fe=[new o.P(he.x1,he.y1),new o.P(he.x2,he.y1),new o.P(he.x2,he.y2),new o.P(he.x1,he.y2)];o.bv(l,fe)&&(oe[pe.bucketInstanceId][pe.featureIndex]=!0,ce[pe.bucketInstanceId]===void 0&&(ce[pe.bucketInstanceId]=[]),ce[pe.bucketInstanceId].push(pe.featureIndex))}return ce}insertCollisionBox(t,l,B,G,Z){(l?this.ignoredGrid:this.grid).insert({bucketInstanceId:B,featureIndex:G,collisionGroupID:Z},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,l,B,G,Z){const Y=l?this.ignoredGrid:this.grid,re={bucketInstanceId:B,featureIndex:G,collisionGroupID:Z};for(let oe=0;oe<t.length;oe+=4)Y.insertCircle(re,t[oe],t[oe+1],t[oe+2])}projectAndGetPerspectiveRatio(t,l,B,G,Z,Y,re){const oe=[l,B,G,1];let ce=!1;G||this.transform.pitch>0?(o.ab.vec4.transformMat4(oe,oe,t),this.fogState&&Z&&re.name!=="globe"&&(ce=function(fe,be,ze,De,Oe,Fe){const Ge=Fe.calculateFogTileMatrix(Oe),Xe=[be,ze,De];return o.ab.vec3.transformMat4(Xe,Xe,Ge),mt(fe,o.ab.vec3.length(Xe),Fe.pitch,Fe._fov)}(this.fogState,l,B,G,Z.toUnwrapped(),this.transform)>.9)):As(oe,oe,t);const he=oe[3];return{point:new o.P((oe[0]/he+1)/2*this.transform.width+Ln,(-oe[1]/he+1)/2*this.transform.height+Ln),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(re)/he*.5,1.5),signedDistanceFromCamera:he,occluded:Y&&oe[2]>he||ce}}isOffscreen(t,l,B,G){return B<Ln||t>=this.screenRightBoundary||G<Ln||l>this.screenBottomBoundary}isInsideGrid(t,l,B,G){return B>=0&&t<this.gridRightBoundary&&G>=0&&l<this.gridBottomBoundary}getViewportMatrix(){const t=o.ab.mat4.identity([]);return o.ab.mat4.translate(t,t,[-100,-100,0]),t}}function Jo(F,t,l){const B=t.createTileMatrix(F,F.worldSize,l.toUnwrapped());return o.ab.mat4.multiply(new Float32Array(16),F.projMatrix,B)}function zs(F,t,l){if(t.projection.name===l.projection.name)return F.projMatrix;const B=l.clone();return B.setProjection(t.projection),Jo(B,t.getProjection(),F)}function Ua(F,t,l){return t.name===l.projection.name?F.projMatrix:Jo(l,t,F)}class Ko{constructor(t,l,B,G){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?l:-l))):G&&B?1:0,this.placed=B}isHidden(){return this.opacity===0&&!this.placed}}class Ls{constructor(t,l,B,G,Z,Y=!1){this.text=new Ko(t?t.text:null,l,B,Z),this.icon=new Ko(t?t.icon:null,l,G,Z),this.clipped=Y}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class lh{constructor(t,l,B,G=!1){this.text=t,this.icon=l,this.skipFade=B,this.clipped=G}}class la{constructor(){this.invProjMatrix=o.ab.mat4.create(),this.viewportMatrix=o.ab.mat4.create(),this.circles=[]}}class kp{constructor(t,l,B,G,Z){this.bucketInstanceId=t,this.featureIndex=l,this.sourceLayerIndex=B,this.bucketIndex=G,this.tileID=Z}}class ch{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const l=++this.maxGroupID;this.collisionGroups[t]={ID:l,predicate:B=>B.collisionGroupID===l}}return this.collisionGroups[t]}}function os(F,t,l,B,G){const{horizontalAlign:Z,verticalAlign:Y}=o.bD(F),re=-(Z-.5)*t,oe=-(Y-.5)*l,ce=o.bC(F,B);return new o.P(re+ce[0]*G,oe+ce[1]*G)}function hh(F,t,l,B,G){const Z=new o.P(F,t);return l&&Z._rotate(B?G:-G),Z}class Ql{constructor(t,l,B,G,Z,Y){this.transform=t.clone(),this.projection=t.projection.name,this.collisionIndex=new _n(this.transform,Z),this.buildingIndex=Y,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=l,this.retainedQueryData={},this.collisionGroups=new ch(B),this.collisionCircleArrays={},this.prevPlacement=G,G&&(G.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,l,B,G,Z=1){const Y=B.getBucket(l),re=B.latestFeatureIndex;if(!Y||!re||l.fqid!==Y.layerIds[0])return;const oe=Y.layers[0].layout,ce=Y.layers[0].paint,he=B.collisionBoxArray,pe=Math.pow(2,this.transform.zoom-B.tileID.overscaledZ),fe=B.tileSize/o.ag,be=B.tileID.toUnwrapped();this.transform.setProjection(Y.projection);const ze=(De=B.tileID,Oe=Y.getProjection(),Fe=this.transform,Oe.name===this.projection?Fe.calculateProjMatrix(De.toUnwrapped()):Jo(Fe,Oe,De));var De,Oe,Fe;const Ge=oe.get("text-pitch-alignment")==="map",Xe=oe.get("text-rotation-alignment")==="map";l.compileFilter(l.options);const Ze=l.dynamicFilter(),nt=l.dynamicFilterNeedsFeature(),Qe=this.transform.calculatePixelsToTileUnitsMatrix(B),it=sn(ze,B.tileID.canonical,Ge,Xe,this.transform,Y.getProjection(),Qe);let Ke=null;if(Ge){const ii=ah(ze,B.tileID.canonical,Ge,Xe,this.transform,Y.getProjection(),Qe);Ke=o.ab.mat4.multiply([],this.transform.labelPlaneMatrix,ii)}let ht=null;Ze&&B.latestFeatureIndex&&(ht={unwrappedTileID:be,dynamicFilter:Ze,dynamicFilterNeedsFeature:nt}),this.retainedQueryData[Y.bucketInstanceId]=new kp(Y.bucketInstanceId,re,Y.sourceLayerIndex,Y.index,B.tileID);const[yt,Nt]=Y.layers[0].layout.get("text-size-scale-range"),Dt=o.aw(Z,yt,Nt),[Wt,$t]=oe.get("icon-size-scale-range"),At=o.aw(Z,Wt,$t),Vt={bucket:Y,layout:oe,paint:ce,posMatrix:ze,textLabelPlaneMatrix:it,labelToScreenMatrix:Ke,clippingData:ht,scale:pe,textPixelRatio:fe,holdingForFade:B.holdingForFade(),collisionBoxArray:he,partiallyEvaluatedTextSize:o.bp(Y.textSizeData,this.transform.zoom,Dt),partiallyEvaluatedIconSize:o.bp(Y.iconSizeData,this.transform.zoom,At),collisionGroup:this.collisionGroups.get(Y.sourceID),latestFeatureIndex:B.latestFeatureIndex};if(G)for(const ii of Y.sortKeyRanges){const{sortKey:Et,symbolInstanceStart:Jt,symbolInstanceEnd:Ut}=ii;t.push({sortKey:Et,symbolInstanceStart:Jt,symbolInstanceEnd:Ut,parameters:Vt})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:Y.symbolInstances.length,parameters:Vt})}attemptAnchorPlacement(t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De,Oe,Fe,Ge){const{textOffset0:Xe,textOffset1:Ze,crossTileID:nt}=fe,Qe=[Xe,Ze],it=os(t,B,G,Qe,Z),Ke=this.collisionIndex.placeCollisionBox(ze,Z,l,hh(it.x,it.y,Y,re,this.transform.angle),pe,oe,ce,he.predicate);if(Oe){const ht=ze.getSymbolInstanceIconSize(Ge,this.transform.zoom,fe.placedIconSymbolIndex);if(this.collisionIndex.placeCollisionBox(ze,ht,Oe,hh(it.x,it.y,Y,re,this.transform.angle),pe,oe,ce,he.predicate).box.length===0)return}if(Ke.box.length>0){let ht;return this.prevPlacement&&this.prevPlacement.variableOffsets[nt]&&this.prevPlacement.placements[nt]&&this.prevPlacement.placements[nt].text&&(ht=this.prevPlacement.variableOffsets[nt].anchor),this.variableOffsets[nt]={textOffset:Qe,width:B,height:G,anchor:t,textScale:Z,prevAnchor:ht},this.markUsedJustification(ze,t,fe,De),ze.allowVerticalPlacement&&(this.markUsedOrientation(ze,De,fe),this.placedOrientations[nt]=De),{shift:it,placedGlyphBoxes:Ke}}}placeLayerBucketPart(t,l,B,G,Z=1){const{bucket:Y,layout:re,paint:oe,posMatrix:ce,textLabelPlaneMatrix:he,labelToScreenMatrix:pe,clippingData:fe,textPixelRatio:be,holdingForFade:ze,collisionBoxArray:De,partiallyEvaluatedTextSize:Oe,partiallyEvaluatedIconSize:Fe,collisionGroup:Ge,latestFeatureIndex:Xe}=t.parameters,Ze=re.get("text-optional"),nt=re.get("icon-optional"),Qe=re.get("text-allow-overlap"),it=re.get("icon-allow-overlap"),Ke=re.get("text-rotation-alignment")==="map",ht=re.get("text-pitch-alignment")==="map",yt=re.get("symbol-z-elevate"),Nt=oe.get("symbol-z-offset"),Dt=re.get("symbol-elevation-reference")==="sea",[Wt,$t]=re.get("text-size-scale-range"),[At,Vt]=re.get("icon-size-scale-range"),ii=o.aw(Z,Wt,$t),Et=o.aw(Z,At,Vt);this.transform.setProjection(Y.projection);let Jt=Qe&&(it||!Y.hasIconData()||nt),Ut=it&&(Qe||!Y.hasTextData()||Ze);const hi=!Nt.isConstant();!Y.collisionArrays&&De&&Y.deserializeCollisionBoxes(De),B&&G&&Y.updateCollisionDebugBuffers(this.transform.zoom,De,ii,Et);const Qt=(Xt,ri,ci)=>{const{crossTileID:xi,numVerticalGlyphVertices:Si}=Xt;let Vi=null;if(fe&&fe.dynamicFilterNeedsFeature||hi){const Or=this.retainedQueryData[Y.bucketInstanceId];Vi=Xe.loadFeature({featureIndex:Xt.featureIndex,bucketIndex:Or.bucketIndex,sourceLayerIndex:Or.sourceLayerIndex,layoutVertexArrayOffset:0})}if(fe&&!(0,fe.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch},Vi,this.retainedQueryData[Y.bucketInstanceId].tileID.canonical,new o.P(Xt.tileAnchorX,Xt.tileAnchorY),this.transform.calculateDistanceTileData(fe.unwrappedTileID)))return this.placements[xi]=new lh(!1,!1,!1,!0),void l.add(xi);const Ci=Nt.evaluate(Vi,{});if(l.has(xi))return;if(ze)return void(this.placements[xi]=new lh(!1,!1,!1));let Ri=!1,Hi=!1,cr=!0,Cr=!1,Yr=!1,Ur=null,Zi={box:null,offscreen:null,occluded:null},fr={box:null},Pi=null,ar=null,br=null,Er=0,Zr=0,Cn=0;ci.textFeatureIndex?Er=ci.textFeatureIndex:Xt.useRuntimeCollisionCircles&&(Er=Xt.featureIndex),ci.verticalTextFeatureIndex&&(Zr=ci.verticalTextFeatureIndex);const xn=Or=>{Or.tileID=this.retainedQueryData[Y.bucketInstanceId].tileID;const zr=this.transform.elevation;Or.elevation=Dt?Ci:Ci+(zr?zr.getAtTileOffset(Or.tileID,Or.tileAnchorX,Or.tileAnchorY):0),Or.elevation+=Xt.zOffset},bn=ci.textBox;if(bn){xn(bn);const Or=ur=>{let hn=o.bq.horizontal;if(Y.allowVerticalPlacement&&!ur&&this.prevPlacement){const In=this.prevPlacement.placedOrientations[xi];In&&(this.placedOrientations[xi]=In,hn=In,this.markUsedOrientation(Y,hn,Xt))}return hn},zr=(ur,hn)=>{if(Y.allowVerticalPlacement&&Si>0&&ci.verticalTextBox){for(const In of Y.writingModes)if(In===o.bq.vertical?(Zi=hn(),fr=Zi):Zi=ur(),Zi&&Zi.box&&Zi.box.length)break}else Zi=ur()};if(re.get("text-variable-anchor")){let ur=re.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[xi]){const Fr=this.prevPlacement.variableOffsets[xi];ur.indexOf(Fr.anchor)>0&&(ur=ur.filter(Xn=>Xn!==Fr.anchor),ur.unshift(Fr.anchor))}const hn=(Fr,Xn,Cs)=>{const ms=Y.getSymbolInstanceTextSize(Oe,Xt,this.transform.zoom,ri),hs=(Fr.x2-Fr.x1)*ms+2*Fr.padding,Ks=(Fr.y2-Fr.y1)*ms+2*Fr.padding,Is=Xt.hasIconTextFit&&!it?Xn:null;Is&&xn(Is);let bs={box:[],offscreen:!1,occluded:!1};const oo=Qe?2*ur.length:ur.length;for(let Qs=0;Qs<oo;++Qs){const lo=this.attemptAnchorPlacement(ur[Qs%ur.length],Fr,hs,Ks,ms,Ke,ht,be,ce,Ge,Qs>=ur.length,Xt,ri,Y,Cs,Is,Oe,Fe);if(lo&&(bs=lo.placedGlyphBoxes,bs&&bs.box&&bs.box.length)){Ri=!0,Ur=lo.shift;break}}return bs};zr(()=>hn(bn,ci.iconBox,o.bq.horizontal),()=>{const Fr=ci.verticalTextBox;return Fr&&xn(Fr),Y.allowVerticalPlacement&&!(Zi&&Zi.box&&Zi.box.length)&&Si>0&&Fr?hn(Fr,ci.verticalIconBox,o.bq.vertical):{box:null,offscreen:null,occluded:null}}),Zi&&(Ri=Zi.box,cr=Zi.offscreen,Cr=Zi.occluded);const In=Or(!(!Zi||!Zi.box));if(!Ri&&this.prevPlacement){const Fr=this.prevPlacement.variableOffsets[xi];Fr&&(this.variableOffsets[xi]=Fr,this.markUsedJustification(Y,Fr.anchor,Xt,In))}}else{const ur=(hn,In)=>{const Fr=Y.getSymbolInstanceTextSize(Oe,Xt,this.transform.zoom,ri,Z),Xn=this.collisionIndex.placeCollisionBox(Y,Fr,hn,new o.P(0,0),Qe,be,ce,Ge.predicate);return Xn&&Xn.box&&Xn.box.length&&(this.markUsedOrientation(Y,In,Xt),this.placedOrientations[xi]=In),Xn};zr(()=>ur(bn,o.bq.horizontal),()=>{const hn=ci.verticalTextBox;return Y.allowVerticalPlacement&&Si>0&&hn?(xn(hn),ur(hn,o.bq.vertical)):{box:null,offscreen:null,occluded:null}}),Or(!!(Zi&&Zi.box&&Zi.box.length))}}if(Pi=Zi,Ri=Pi&&Pi.box&&Pi.box.length>0,cr=Pi&&Pi.offscreen,Cr=Pi&&Pi.occluded,Xt.useRuntimeCollisionCircles){const Or=Y.text.placedSymbolArray.get(Xt.centerJustifiedTextSymbolIndex>=0?Xt.centerJustifiedTextSymbolIndex:Xt.verticalPlacedTextSymbolIndex),zr=o.br(Y.textSizeData,Oe,Or),ur=re.get("text-padding");ar=this.collisionIndex.placeCollisionCircles(Y,Qe,Or,Y.lineVertexArray,Y.glyphOffsetArray,zr,ce,he,pe,B,ht,Ge.predicate,Xt.collisionCircleDiameter*zr/o.bw,ur,this.retainedQueryData[Y.bucketInstanceId].tileID),Ri=Qe||ar.circles.length>0&&!ar.collisionDetected,cr=cr&&ar.offscreen,Cr=ar.occluded}if(ci.iconFeatureIndex&&(Cn=ci.iconFeatureIndex),ci.iconBox){const Or=zr=>{xn(zr);const ur=Xt.hasIconTextFit&&Ur?hh(Ur.x,Ur.y,Ke,ht,this.transform.angle):new o.P(0,0),hn=Y.getSymbolInstanceIconSize(Fe,this.transform.zoom,Xt.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(Y,hn,zr,ur,it,be,ce,Ge.predicate)};fr&&fr.box&&fr.box.length&&ci.verticalIconBox?(br=Or(ci.verticalIconBox),Hi=br.box.length>0):(br=Or(ci.iconBox),Hi=br.box.length>0),cr=cr&&br.offscreen,Yr=br.occluded}const xs=Ze||Xt.numHorizontalGlyphVertices===0&&Si===0,Zn=nt||Xt.numIconVertices===0;if(xs||Zn?Zn?xs||(Hi=Hi&&Ri):Ri=Hi&&Ri:Hi=Ri=Hi&&Ri,Ri&&Pi&&Pi.box&&this.collisionIndex.insertCollisionBox(Pi.box,re.get("text-ignore-placement"),Y.bucketInstanceId,fr&&fr.box&&Zr?Zr:Er,Ge.ID),Hi&&br&&this.collisionIndex.insertCollisionBox(br.box,re.get("icon-ignore-placement"),Y.bucketInstanceId,Cn,Ge.ID),ar&&(Ri&&this.collisionIndex.insertCollisionCircles(ar.circles,re.get("text-ignore-placement"),Y.bucketInstanceId,Er,Ge.ID),B)){const Or=Y.bucketInstanceId;let zr=this.collisionCircleArrays[Or];zr===void 0&&(zr=this.collisionCircleArrays[Or]=new la);for(let ur=0;ur<ar.circles.length;ur+=4)zr.circles.push(ar.circles[ur+0]),zr.circles.push(ar.circles[ur+1]),zr.circles.push(ar.circles[ur+2]),zr.circles.push(ar.collisionDetected?1:0)}const Xr=Y.projection.name!=="globe";Jt=Jt&&(Xr||!Cr),Ut=Ut&&(Xr||!Yr),this.placements[xi]=new lh(Ri||Jt,Hi||Ut,cr||Y.justReloaded),l.add(xi)};if(yt&&this.buildingIndex&&(this.buildingIndex.updateZOffset(Y,this.retainedQueryData[Y.bucketInstanceId].tileID),Y.updateZOffset()),Y.sortFeaturesByY){const Xt=Y.getSortedSymbolIndexes(this.transform.angle);for(let ri=Xt.length-1;ri>=0;--ri){const ci=Xt[ri];Qt(Y.symbolInstances.get(ci),ci,Y.collisionArrays[ci])}Y.hasAnyZOffset&&o.w(`${Y.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(Y.hasAnyZOffset){const Xt=Y.getSortedIndexesByZOffset();for(let ri=0;ri<Xt.length;++ri){const ci=Xt[ri];Qt(Y.symbolInstances.get(ci),ci,Y.collisionArrays[ci])}}else for(let Xt=t.symbolInstanceStart;Xt<t.symbolInstanceEnd;Xt++)Qt(Y.symbolInstances.get(Xt),Xt,Y.collisionArrays[Xt]);if(B&&Y.bucketInstanceId in this.collisionCircleArrays){const Xt=this.collisionCircleArrays[Y.bucketInstanceId];o.ab.mat4.invert(Xt.invProjMatrix,ce),Xt.viewportMatrix=this.collisionIndex.getViewportMatrix()}Y.justReloaded=!1}markUsedJustification(t,l,B,G){const{leftJustifiedTextSymbolIndex:Z,centerJustifiedTextSymbolIndex:Y,rightJustifiedTextSymbolIndex:re,verticalPlacedTextSymbolIndex:oe,crossTileID:ce}=B,he=o.bB(l),pe=G===o.bq.vertical?oe:he==="left"?Z:he==="center"?Y:he==="right"?re:-1;Z>=0&&(t.text.placedSymbolArray.get(Z).crossTileID=pe>=0&&Z!==pe?0:ce),Y>=0&&(t.text.placedSymbolArray.get(Y).crossTileID=pe>=0&&Y!==pe?0:ce),re>=0&&(t.text.placedSymbolArray.get(re).crossTileID=pe>=0&&re!==pe?0:ce),oe>=0&&(t.text.placedSymbolArray.get(oe).crossTileID=pe>=0&&oe!==pe?0:ce)}markUsedOrientation(t,l,B){const G=l===o.bq.horizontal||l===o.bq.horizontalOnly?l:0,Z=l===o.bq.vertical?l:0,{leftJustifiedTextSymbolIndex:Y,centerJustifiedTextSymbolIndex:re,rightJustifiedTextSymbolIndex:oe,verticalPlacedTextSymbolIndex:ce}=B,he=t.text.placedSymbolArray;Y>=0&&(he.get(Y).placedOrientation=G),re>=0&&(he.get(re).placedOrientation=G),oe>=0&&(he.get(oe).placedOrientation=G),ce>=0&&(he.get(ce).placedOrientation=Z)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const l=this.prevPlacement;let B=!1;this.prevZoomAdjustment=l?l.zoomAdjustment(this.transform.zoom):0;const G=l?l.symbolFadeChange(t):1,Z=l?l.opacities:{},Y=l?l.variableOffsets:{},re=l?l.placedOrientations:{};for(const oe in this.placements){const ce=this.placements[oe],he=Z[oe];he?(this.opacities[oe]=new Ls(he,G,ce.text,ce.icon,null,ce.clipped),B=B||ce.text!==he.text.placed||ce.icon!==he.icon.placed):(this.opacities[oe]=new Ls(null,G,ce.text,ce.icon,ce.skipFade,ce.clipped),B=B||ce.text||ce.icon)}for(const oe in Z){const ce=Z[oe];if(!this.opacities[oe]){const he=new Ls(ce,G,!1,!1);he.isHidden()||(this.opacities[oe]=he,B=B||ce.text.placed||ce.icon.placed)}}for(const oe in Y)this.variableOffsets[oe]||!this.opacities[oe]||this.opacities[oe].isHidden()||(this.variableOffsets[oe]=Y[oe]);for(const oe in re)this.placedOrientations[oe]||!this.opacities[oe]||this.opacities[oe].isHidden()||(this.placedOrientations[oe]=re[oe]);B?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=l?l.lastPlacementChangeTime:t)}updateLayerOpacities(t,l,B,G){const Z=new Set;for(const Y of l){const re=Y.getBucket(t);re&&Y.latestFeatureIndex&&t.fqid===re.layerIds[0]&&(this.updateBucketOpacities(re,Z,Y,Y.collisionBoxArray,B,G,Y.tileID,t.scope),re.layers[0].layout.get("symbol-z-elevate")&&this.buildingIndex&&(this.buildingIndex.updateZOffset(re,Y.tileID),re.updateZOffset()))}}updateBucketOpacities(t,l,B,G,Z,Y,re,oe){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 ce=t.layers[0].layout,he=t.layers[0].paint,pe=!!t.layers[0].dynamicFilter(),fe=new Ls(null,0,!1,!1,!0),be=ce.get("text-allow-overlap"),ze=ce.get("icon-allow-overlap"),De=ce.get("text-variable-anchor"),Oe=ce.get("text-rotation-alignment")==="map",Fe=ce.get("text-pitch-alignment")==="map",Ge=he.get("symbol-z-offset"),Xe=ce.get("symbol-elevation-reference")==="sea",Ze=!Ge.isConstant(),nt=new Ls(null,0,be&&(ze||!t.hasIconData()||ce.get("icon-optional")),ze&&(be||!t.hasTextData()||ce.get("text-optional")),!0);!t.collisionArrays&&G&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(G);const Qe=(Ke,ht,yt)=>{for(let Nt=0;Nt<ht/4;Nt++)Ke.opacityVertexArray.emplaceBack(yt)};let it=0;Y&&t.updateReplacement(re,Y);for(let Ke=0;Ke<t.symbolInstances.length;Ke++){const ht=t.symbolInstances.get(Ke),{numHorizontalGlyphVertices:yt,numVerticalGlyphVertices:Nt,crossTileID:Dt,numIconVertices:Wt,tileAnchorX:$t,tileAnchorY:At}=ht;let Vt=null;const ii=this.retainedQueryData[t.bucketInstanceId];Ze&&ht&&ii&&(Vt=B.latestFeatureIndex.loadFeature({featureIndex:ht.featureIndex,bucketIndex:ii.bucketIndex,sourceLayerIndex:ii.sourceLayerIndex,layoutVertexArrayOffset:0}));const Et=Ge.evaluate(Vt,{}),Jt=l.has(Dt);let Ut=this.opacities[Dt];Jt?Ut=fe:Ut||(Ut=nt,this.opacities[Dt]=Ut),l.add(Dt);const hi=yt>0||Nt>0,Qt=Wt>0,Xt=this.placedOrientations[Dt],ri=Xt===o.bq.vertical,ci=Xt===o.bq.horizontal||Xt===o.bq.horizontalOnly;!hi&&!Qt||Ut.isHidden()||it++;let xi=!1;if((hi||Qt)&&Y)for(const Si of t.activeReplacements){if(o.bx(Si,Z,o.by.Symbol,oe)||Si.min.x>$t||$t>Si.max.x||Si.min.y>At||At>Si.max.y)continue;const Vi=o.bz($t,At,re.canonical,Si.footprintTileId.canonical);if(xi=o.bA(Vi,Si.footprint),xi)break}if(hi){const Si=xi?ca:uh(Ut.text);Qe(t.text,yt,ri?ca:Si),Qe(t.text,Nt,ci?ca:Si);const Vi=Ut.text.isHidden(),{leftJustifiedTextSymbolIndex:Ci,centerJustifiedTextSymbolIndex:Ri,rightJustifiedTextSymbolIndex:Hi,verticalPlacedTextSymbolIndex:cr}=ht,Cr=t.text.placedSymbolArray,Yr=Vi||ri?1:0;Ci>=0&&(Cr.get(Ci).hidden=Yr),Ri>=0&&(Cr.get(Ri).hidden=Yr),Hi>=0&&(Cr.get(Hi).hidden=Yr),cr>=0&&(Cr.get(cr).hidden=Vi||ci?1:0);const Ur=this.variableOffsets[Dt];Ur&&this.markUsedJustification(t,Ur.anchor,ht,Xt);const Zi=this.placedOrientations[Dt];Zi&&(this.markUsedJustification(t,"left",ht,Zi),this.markUsedOrientation(t,Zi,ht))}if(Qt){const Si=xi?ca:uh(Ut.icon),{placedIconSymbolIndex:Vi,verticalPlacedIconSymbolIndex:Ci}=ht,Ri=t.icon.placedSymbolArray,Hi=Ut.icon.isHidden()?1:0;Vi>=0&&(Qe(t.icon,Wt,ri?ca:Si),Ri.get(Vi).hidden=Hi),Ci>=0&&(Qe(t.icon,ht.numVerticalIconVertices,ci?ca:Si),Ri.get(Ci).hidden=Hi)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const Si=t.collisionArrays[Ke];if(Si){let Vi=new o.P(0,0),Ci=!0;if(Si.textBox||Si.verticalTextBox){if(De){const Hi=this.variableOffsets[Dt];Hi?(Vi=os(Hi.anchor,Hi.width,Hi.height,Hi.textOffset,Hi.textScale),Oe&&Vi._rotate(Fe?this.transform.angle:-this.transform.angle)):Ci=!1}pe&&(Ci=!Ut.clipped),Si.textBox&&Qo(t.textCollisionBox.collisionVertexArray,Ut.text.placed,!Ci||ri,Et,Xe,Vi.x,Vi.y),Si.verticalTextBox&&Qo(t.textCollisionBox.collisionVertexArray,Ut.text.placed,!Ci||ci,Et,Xe,Vi.x,Vi.y)}const Ri=Ci&&!!(!ci&&Si.verticalIconBox);Si.iconBox&&Qo(t.iconCollisionBox.collisionVertexArray,Ut.icon.placed,Ri,Et,Xe,ht.hasIconTextFit?Vi.x:0,ht.hasIconTextFit?Vi.y:0),Si.verticalIconBox&&Qo(t.iconCollisionBox.collisionVertexArray,Ut.icon.placed,!Ri,Et,Xe,ht.hasIconTextFit?Vi.x:0,ht.hasIconTextFit?Vi.y:0)}}}if(t.fullyClipped=it===0,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 Ke=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=Ke.invProjMatrix,t.placementViewportMatrix=Ke.viewportMatrix,t.collisionCircleArray=Ke.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,l){const B=this.zoomAtLastRecencyCheck===l?1-this.zoomAdjustment(l):1;return this.zoomAtLastRecencyCheck=l,this.commitTime+this.fadeDuration*B>t}setStale(){this.stale=!0}}function Qo(F,t,l,B,G,Z,Y){F.emplaceBack(t?1:0,l?1:0,Z||0,Y||0,B,G?1:0),F.emplaceBack(t?1:0,l?1:0,Z||0,Y||0,B,G?1:0),F.emplaceBack(t?1:0,l?1:0,Z||0,Y||0,B,G?1:0),F.emplaceBack(t?1:0,l?1:0,Z||0,Y||0,B,G?1:0)}const el=Math.pow(2,25),Rp=Math.pow(2,24),zp=Math.pow(2,17),tl=Math.pow(2,16),il=Math.pow(2,9),Lp=Math.pow(2,8),ho=Math.pow(2,1);function uh(F){if(F.opacity===0&&!F.placed)return 0;if(F.opacity===1&&F.placed)return 4294967295;const t=F.placed?1:0,l=Math.floor(127*F.opacity);return l*el+t*Rp+l*zp+t*tl+l*il+t*Lp+l*ho+t}const ca=0;class Sa{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&t.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(t,l,B,G,Z,Y){const re=this._bucketParts;for(;this._currentTileIndex<t.length;)if(l.getBucketParts(re,G,t[this._currentTileIndex],this._sortAcrossTiles,Y),this._currentTileIndex++,Z())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,re.sort((oe,ce)=>oe.sortKey-ce.sortKey));this._currentPartIndex<re.length;){const oe=re[this._currentPartIndex];if(l.placeLayerBucketPart(oe,this._seenCrossTileIDs,B,oe.symbolInstanceStart===0,Y),this._currentPartIndex++,Z())return!0}return!1}}class Fp{constructor(t,l,B,G,Z,Y,re,oe,ce){this.placement=new Ql(t,Z,Y,re,oe,ce),this._currentPlacementIndex=l.length-1,this._forceFullPlacement=B,this._showCollisionBoxes=G,this._done=!1}isDone(){return this._done}continuePlacement(t,l,B,G,Z){const Y=o.q.now(),re=()=>{const oe=o.q.now()-Y;return!this._forceFullPlacement&&oe>2};for(;this._currentPlacementIndex>=0;){const oe=l[t[this._currentPlacementIndex]],ce=this.placement.collisionIndex.transform.zoom;if(oe.type==="symbol"&&(!oe.minzoom||oe.minzoom<=ce)&&(!oe.maxzoom||oe.maxzoom>ce)){const he=oe,pe=he.layout.get("symbol-z-elevate"),fe=he.layout.get("symbol-sort-key").constantOr(1)!==void 0,be=he.layout.get("symbol-z-order"),ze=be==="viewport-y"||be==="auto"&&!(be!=="viewport-y"&&fe),De=he.layout.get("text-allow-overlap")||he.layout.get("icon-allow-overlap")||he.layout.get("text-ignore-placement")||he.layout.get("icon-ignore-placement"),Oe=ze&&De,Fe=this._inProgressLayer=this._inProgressLayer||new Sa(he),Ge=o.aC(oe.source,oe.scope);if(Fe.continuePlacement(pe||Oe?G[Ge]:B[Ge],this.placement,this._showCollisionBoxes,oe,re,Z))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const dh=512/o.ag/2;class Op{constructor(t,l,B){this.tileID=t,this.bucketInstanceId=B,this.index=new o.bE(l.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const G=t.canonical.x*o.ag,Z=t.canonical.y*o.ag;for(let Y=0;Y<l.length;Y++){const{key:re,crossTileID:oe,tileAnchorX:ce,tileAnchorY:he}=l.get(Y),pe=Math.floor((G+ce)*dh),fe=Math.floor((Z+he)*dh);this.index.add(pe,fe),this.keys.push(re),this.crossTileIDs.push(oe)}this.index.finish()}findMatches(t,l,B){const G=this.tileID.canonical.z<l.canonical.z?1:Math.pow(2,this.tileID.canonical.z-l.canonical.z),Z=dh/Math.pow(2,l.canonical.z-this.tileID.canonical.z),Y=l.canonical.x*o.ag,re=l.canonical.y*o.ag;for(let oe=0;oe<t.length;oe++){const ce=t.get(oe);if(ce.crossTileID)continue;const{key:he,tileAnchorX:pe,tileAnchorY:fe}=ce,be=Math.floor((Y+pe)*Z),ze=Math.floor((re+fe)*Z),De=this.index.range(be-G,ze-G,be+G,ze+G);for(const Oe of De){const Fe=this.crossTileIDs[Oe];if(this.keys[Oe]===he&&!B.has(Fe)){B.add(Fe),ce.crossTileID=Fe;break}}}}}class td{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Bp{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const l=Math.round((t-this.lng)/360);if(l!==0)for(const B in this.indexes){const G=this.indexes[B],Z={};for(const Y in G){const re=G[Y];re.tileID=re.tileID.unwrapTo(re.tileID.wrap+l),Z[re.tileID.key]=re}this.indexes[B]=Z}this.lng=t}addBucket(t,l,B){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===l.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let Z=0;Z<l.symbolInstances.length;Z++)l.symbolInstances.get(Z).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]=new Set);const G=this.usedCrossTileIDs[t.overscaledZ];for(const Z in this.indexes){const Y=this.indexes[Z];if(Number(Z)>t.overscaledZ)for(const re in Y){const oe=Y[re];oe.tileID.isChildOf(t)&&oe.findMatches(l.symbolInstances,t,G)}else{const re=Y[t.scaledTo(Number(Z)).key];re&&re.findMatches(l.symbolInstances,t,G)}}for(let Z=0;Z<l.symbolInstances.length;Z++){const Y=l.symbolInstances.get(Z);Y.crossTileID||(Y.crossTileID=B.generate(),G.add(Y.crossTileID))}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Op(t,l.symbolInstances,l.bucketInstanceId),!0}removeBucketCrossTileIDs(t,l){for(const B of l.crossTileIDs)this.usedCrossTileIDs[t].delete(B)}removeStaleBuckets(t){let l=!1;for(const B in this.indexes){const G=this.indexes[B];for(const Z in G)t[G[Z].bucketInstanceId]||(this.removeBucketCrossTileIDs(B,G[Z]),delete G[Z],l=!0)}return l}}class ph{constructor(){this.layerIndexes={},this.crossTileIDs=new td,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,l,B,G){let Z=this.layerIndexes[t.fqid];Z===void 0&&(Z=this.layerIndexes[t.fqid]=new Bp);let Y=!1;const re={};G.name!=="globe"&&Z.handleWrapJump(B);for(const oe of l){const ce=oe.getBucket(t);ce&&t.fqid===ce.layerIds[0]&&(ce.bucketInstanceId||(ce.bucketInstanceId=++this.maxBucketInstanceId),Z.addBucket(oe.tileID,ce,this.crossTileIDs)&&(Y=!0),re[ce.bucketInstanceId]=!0)}return Z.removeStaleBuckets(re)&&(Y=!0),Y}pruneUnusedLayers(t){const l={};t.forEach(B=>{l[B]=!0});for(const B in this.layerIndexes)l[B]||delete this.layerIndexes[B]}}const ja=771;class ir{constructor(t,l,B,G){this.blendFunction=t,this.blendColor=l,this.mask=B,this.blendEquation=G}}ir.Replace=[1,0,1,0],ir.disabled=new ir(ir.Replace,o.aj.transparent,[!1,!1,!1,!1]),ir.unblended=new ir(ir.Replace,o.aj.transparent,[!0,!0,!0,!0]),ir.alphaBlended=new ir([1,ja,1,ja],o.aj.transparent,[!0,!0,!0,!0]),ir.alphaBlendedNonPremultiplied=new ir([770,ja,770,ja],o.aj.transparent,[!0,!0,!0,!0]),ir.multiply=new ir([774,0,774,0],o.aj.transparent,[!0,!0,!0,!0]);class ki{constructor(t,l,B){this.func=t,this.mask=l,this.range=B}}ki.ReadOnly=!1,ki.ReadWrite=!0,ki.disabled=new ki(519,ki.ReadOnly,[0,1]);const ec=7680;class Ui{constructor(t,l,B,G,Z,Y){this.test=t,this.ref=l,this.mask=B,this.fail=G,this.depthFail=Z,this.pass=Y}}Ui.disabled=new Ui({func:519,mask:0},0,0,ec,ec,ec);const uo=1029,tc=2305;class qi{constructor(t,l,B){this.enable=t,this.mode=l,this.frontFace=B}}function po(F,t){const l=o.bG(F,3);o.ab.mat4.fromQuat(F,t),o.bI(F,3,l)}function Ga(F,t){const l=o.ab.quat.identity([]);return o.ab.quat.rotateZ(l,l,-t),o.ab.quat.rotateX(l,l,-F),l}function fh(F,t){const l=[F[0],F[1],0],B=[t[0],t[1],0];if(o.ab.vec3.length(l)>=1e-15){const Y=o.ab.vec3.normalize([],l);o.ab.vec3.scale(B,Y,o.ab.vec3.dot(B,Y)),t[0]=B[0],t[1]=B[1]}const G=o.ab.vec3.cross([],t,F);if(o.ab.vec3.len(G)<1e-15)return null;const Z=Math.atan2(-G[1],G[0]);return Ga(Math.atan2(Math.sqrt(F[0]*F[0]+F[1]*F[1]),-F[2]),Z)}qi.disabled=new qi(!1,uo,tc),qi.backCCW=new qi(!0,uo,tc),qi.backCW=new qi(!0,uo,2304),qi.frontCW=new qi(!0,1028,2304),qi.frontCCW=new qi(!0,1028,tc);class ic{constructor(t,l){this.position=t,this.orientation=l}get position(){return this._position}set position(t){if(t){const l=t instanceof o.aa?t:new o.aa(t[0],t[1],t[2]);
274this._renderWorldCopies&&(l.x=o.bF(l.x,0,1)),this._position=l}else this._position=null}lookAtPoint(t,l){if(this.orientation=null,!this.position)return;const B=this.position,G=this._elevation?this._elevation.getAtPointOrZero(o.aa.fromLngLat(t)):0,Z=o.aa.fromLngLat(t,G),Y=[Z.x-B.x,Z.y-B.y,Z.z-B.z];l||(l=[0,0,1]),l[2]=Math.abs(l[2]),this.orientation=fh(Y,l)}setPitchBearing(t,l){this.orientation=Ga(o.ai(t),o.ai(-l))}}class ls{constructor(t,l){this._transform=o.ab.mat4.identity([]),this.orientation=l,this.position=t}get mercatorPosition(){const t=this.position;return new o.aa(t[0],t[1],t[2])}get position(){const t=o.bG(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var l;t&&o.bI(this._transform,3,[(l=t)[0],l[1],l[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||o.ab.quat.identity([]),t&&po(this._transform,this._orientation)}getPitchBearing(){const t=this.forward(),l=this.right();return{bearing:Math.atan2(-l[1],l[0]),pitch:Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2])}}setPitchBearing(t,l){this._orientation=Ga(t,l),po(this._transform,this._orientation)}forward(){const t=o.bG(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=o.bG(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=o.bG(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,l){const B=new Float64Array(16);return o.ab.mat4.invert(B,this.getWorldToCamera(t,l)),B}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(t,l,B){const G=this.position;o.ab.vec3.scale(G,G,-t);const Z=new Float64Array(16);return o.ab.mat4.fromScaling(Z,[B,B,B]),o.ab.mat4.translate(Z,Z,G),Z[10]*=l,Z}getWorldToCamera(t,l){const B=new Float64Array(16),G=new Float64Array(4),Z=this.position;return o.ab.quat.conjugate(G,this._orientation),o.ab.vec3.scale(Z,Z,-t),o.ab.mat4.fromQuat(B,G),o.ab.mat4.translate(B,B,Z),B[1]*=-1,B[5]*=-1,B[9]*=-1,B[13]*=-1,B[8]*=l,B[9]*=l,B[10]*=l,B[11]*=l,B}getCameraToClipPerspective(t,l,B,G){const Z=new Float64Array(16);return o.ab.mat4.perspective(Z,t,l,B,G),Z}getCameraToClipOrthographic(t,l,B,G,Z,Y){const re=new Float64Array(16);return o.ab.mat4.ortho(re,t,l,B,G,Z,Y),re}getDistanceToElevation(t,l=!1){const B=t===0?0:o.bH(t,l?o.aS(this.position[1]):this.position[1]),G=this.forward();return(B-this.position[2])/G[2]}clone(){return new ls([...this.position],[...this.orientation])}}const jn={BaseColor:5,MetallicRoughness:6,Normal:7,Occlusion:8,Emission:9,LUT:10,ShadowMap0:11};class gi{constructor(t=0,l=0,B=0,G=0){if(isNaN(t)||t<0||isNaN(l)||l<0||isNaN(B)||B<0||isNaN(G)||G<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=l,this.left=B,this.right=G}interpolate(t,l,B){return l.top!=null&&t.top!=null&&(this.top=o.af(t.top,l.top,B)),l.bottom!=null&&t.bottom!=null&&(this.bottom=o.af(t.bottom,l.bottom,B)),l.left!=null&&t.left!=null&&(this.left=o.af(t.left,l.left,B)),l.right!=null&&t.right!=null&&(this.right=o.af(t.right,l.right,B)),this}getCenter(t,l){const B=o.aw((this.left+t-this.right)/2,0,t),G=o.aw((this.top+l-this.bottom)/2,0,l);return new o.P(B,G)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new gi(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const mh=(F,t,l)=>(1-l)*F+l*t,rc=F=>F*F*F*F*F;class rl{constructor(t,l,B,G,Z,Y,re){this.tileSize=512,this._renderWorldCopies=Z===void 0||Z,this._minZoom=t||0,this._maxZoom=l||22,this._minPitch=B??0,this._maxPitch=G??60,this.setProjection(Y),this.setMaxBounds(re),this.width=0,this.height=0,this._center=new o.bO(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new gi,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new ls,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}clone(){const t=new rl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return t._elevation=this._elevation,t._centerAltitude=this._centerAltitude,t._centerAltitudeValidForE
274xaggeration=this._centerAltitudeValidForExaggeration,t.tileSize=this.tileSize,t.mercatorFromTransition=this.mercatorFromTransition,t.width=this.width,t.height=this.height,t.cameraElevationReference=this.cameraElevationReference,t._center=this._center,t._setZoom(this.zoom),t._seaLevelZoom=this._seaLevelZoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._nearZ=this._nearZ,t._farZ=this._farZ,t._averageElevation=this._averageElevation,t._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._camera=this._camera.clone(),t._calcMatrices(),t.freezeTileCoverage=this.freezeTileCoverage,t.frustumCorners=this.frustumCorners,t}get isOrthographic(){return this.projection.name!=="globe"&&this._orthographicProjectionAtLowPitch&&this.pitch<15}get elevation(){return this._elevation}set elevation(t){this._elevation!==t&&(this._elevation=t,this._updateCameraOnTerrain(),this._calcMatrices())}get depthOcclusionForSymbolsAndCircles(){return this.projection.name!=="globe"&&!this.isOrthographic}updateElevation(t,l=!1){const B=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForE
vendor: 3,955 bytes, line 274
274xaggeration;(this._seaLevelZoom==null||B)&&this._updateCameraOnTerrain(),(t||B)&&this._constrainCamera(l),this._calcMatrices()}getProjection(){return o.ay(this.projection,["name","center","parallels"])}setProjection(t){this.projectionOptions=t||{name:"mercator"};const l=this.projection?this.getProjection():void 0;this.projection=o.bP(this.projectionOptions);const B=this.getProjection(),G=!o.bn(l,B);return G&&this._calcMatrices(),this.mercatorFromTransition=!1,G}setOrthographicProjectionAtLowPitch(t){return this._orthographicProjectionAtLowPitch!==t&&(this._orthographicProjectionAtLowPitch=t,this._calcMatrices(),!0)}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=o.bP({name:"mercator"});const l=t!==this.projection.name;return l&&this._calcMatrices(),l}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies&&this.projection.supportsWorldCopies===!0}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const t=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(t))}get cameraWorldSize(){const t=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(t))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return o.bH(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new o.P(this.width,this.height)}get bearing(){return o.bF(this.rotation,-180,180)}set bearing(t){this.rotation=t}get rotation(){return-this.angle/Math.PI*180}set rotation(t){const l=-t*Math.PI/180;this.angle!==l&&(this._unmodified=!1,this.angle=l,this._calcMatrices(),this.rotationMatrix=o.ab.mat2.create(),o.ab.mat2.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const l=o.aw(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==l&&(this._unmodified=!1,this._pitch=l,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const t=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/t)}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=o.ai(t),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(t){this._averageElevation=t,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(t){const l=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==l&&(this._unmodified=!1,this._setZoom(l),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(t){this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(t){this._tileCoverLift!==t&&(this._tileCoverLift=t)}_updateCameraOnTerrain(){const t=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,l=this.elevation&&t===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>
2740&&this._centerAltitudeValidForExaggeration;if(!this._elevation||t===Number.NEGATIVE_INFINITY&&(!l||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const B=this._elevation;l||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&B.exaggeration()&&this._centerAltitudeValidForExaggeration!==B.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*B.exaggeration(),this._centerAltitudeValidForExaggeration=B.exaggeration()):(this._centerAltitude=t||0,this._centerAltitudeValidForExaggeration=B.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){this._centerAltitudeValidForExaggeration!==void 0&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,l=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],B=this.horizonLineFromTop();let G=0,Z=0;for(let Y=0;Y<l.length;Y++){const re=new o.P(l[Y][0]*this.width,B+l[Y][1]*(this.height-B)),oe=t.pointCoordinate(re);if(!oe)continue;const ce=1/Math.hypot(oe[0]-this._camera.position[0],oe[1]-this._camera.position[1]);G+=oe[3]*ce,Z+=ce}return Z===0?NaN:G/Z}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._terrainEnabled()&&(this.cameraElevationReference==="ground"?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(this._seaLevelZoom==null||!this._elevation)return;const t=this._seaLevelZoom,l=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),B=this.pixelsPerMeter/this.worldSize*l,G=this._mercatorZfromZoom(t),Z=this._mercatorZfromZoom(this._maxZoom),Y=Math.max(G-B,Z);this._setZoom(this._zoomFromMercatorZ(Y))}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}computeZoomRelativeTo(t){const l=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,t.toAltitude()));let B;B=t.z<this._camera.position[2]?[l.x,l.y,l.z]:[t.x,t.y,t.z];const G=o.ab.vec3.length(o.ab.vec3.sub([],this._camera.position,B));return o.aw(this._zoomFromMercatorZ(G),this._minZoom,this._maxZoom)}setFreeCameraOptions(t){if(!this.height||!t.position&&!t.orientation)return;this._updateCameraState();let l=!1;if(t.orientation&&!o.ab.quat.exactEquals(t.orientation,this._camera.orientation)&&(l=this._setCameraOrientation(t.orientation)),t.position){const B=[t.position.x,t.position.y,t.position.z];o.ab.vec3.exactEquals(B,this._camera.position)||(this._setCameraPosition(B),l=!0)}l&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const t=this._camera.position,l=new ic;return l.position=new o.aa(t[0],t[1],t[2]),l.orientation=this._camera.orientation,l._elevation=this.elevation,l._renderWorldCopies=this.renderWorldCopies,l}_setCameraOrientation(t){if(!o.ab.quat.length(t))return!1;o.ab.quat.normalize(t,t);const l=o.ab.vec3.transformQuat([],[0,0,-1],t),B=o.ab.vec3.transformQuat([],[0,-1,0],t);if(B[2]<0)return!1;const G=fh(l,B);return!!G&&(this._camera.orientation=G,!0)}_setCameraPosition(t){const l=this.zoomScale(this.minZoom)*this.tileSize,B=this.zoomScale(this.maxZoom)*this.tileSize,G=this.cameraToCenterDistance;t[2]=o.aw(t[2],G/B,G/l),this._camera.position=t}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,l,B){this._unmodified=!1,this._edgeInsets.interpolate(t,l,B),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const l=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,l)}getVisibleUnwrappedCoordinates(t){const l=[new o.bQ(0,t)];if(this.renderWorldCopies){const B=this.pointCoordinate(new o.P(0,0)),G=this.pointCoordinate(new o.P(this.width,0)),Z=this.pointCoordinate(new o.P(this.width,this.height)),Y=this.pointCoordinate(new o.P(0,this.height)),re=Math.floor(Math.min(B.x,G.x,Z.x,Y.x)),oe=Math.floor(Math.max(B.x,G.x,Z.x,Y.x)),ce=1;for(let he=re-ce;he<=oe+ce;he++)he!==0&&l.push(new o.bQ(he,t))}return l}isLODDisabled(t){return(!t||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}extendTileCover(t,l,B){let G=[];const Z=B!==void 0,Y=!Z;if(Y&&this.zoom<l||Z&&B[0]===0&&B[1]===0)return G;const re=new Set,oe=(he,pe,fe,be,ze)=>{const De=o.c5(pe,he,fe,be,ze);re.has(De)||(G.push(new o.aG(he,pe,fe,be,ze)),re.add(De))};for(let he=0;he<t.length;he++){const pe=t[he];if(Y&&pe.canonical.z!==l)continue;const fe=pe.canonical,be=pe.overscaledZ,ze=pe.wrap,De=1<<fe.z,Oe=fe.x+1<De,Fe=fe.x>0,Ge=fe.y+1<De,Xe=fe.y>0,Ze=pe.wrap-(Fe?0:1),nt=pe.wrap+(Oe?0:1),Qe=Fe?fe.x-1:De-1,it=Oe?fe.x+1:0;if(Z)B[0]<0?(oe(be,nt,fe.z,it,fe.y),B[1]<0&&Ge&&(oe(be,ze,fe.z,fe.x,fe.y+1),oe(be,nt,fe.z,it,fe.y+1)),B[1]>
vendor: 16,856 bytes, line 274
2740&&Xe&&(oe(be,ze,fe.z,fe.x,fe.y-1),oe(be,nt,fe.z,it,fe.y-1))):B[0]>0?(oe(be,Ze,fe.z,Qe,fe.y),B[1]<0&&Ge&&(oe(be,ze,fe.z,fe.x,fe.y+1),oe(be,Ze,fe.z,Qe,fe.y+1)),B[1]>0&&Xe&&(oe(be,ze,fe.z,fe.x,fe.y-1),oe(be,Ze,fe.z,Qe,fe.y-1))):B[1]<0&&Ge?oe(be,ze,fe.z,fe.x,fe.y+1):Xe&&oe(be,ze,fe.z,fe.x,fe.y-1);else{const Ke=pe.visibleQuadrants;1&Ke&&(oe(be,Ze,fe.z,Qe,fe.y),Xe&&(oe(be,ze,fe.z,fe.x,fe.y-1),oe(be,Ze,fe.z,Qe,fe.y-1))),2&Ke&&(oe(be,nt,fe.z,it,fe.y),Xe&&(oe(be,ze,fe.z,fe.x,fe.y-1),oe(be,nt,fe.z,it,fe.y-1))),4&Ke&&(oe(be,Ze,fe.z,Qe,fe.y),Ge&&(oe(be,ze,fe.z,fe.x,fe.y+1),oe(be,Ze,fe.z,Qe,fe.y+1))),8&Ke&&(oe(be,nt,fe.z,it,fe.y),Ge&&(oe(be,ze,fe.z,fe.x,fe.y+1),oe(be,nt,fe.z,it,fe.y+1)))}}const ce=[];for(const he of G)G.some(pe=>he.isChildOf(pe))||ce.push(he);if(G=ce.filter(he=>!t.some(pe=>!!(he.overscaledZ<l&&pe.isChildOf(he))||he.equals(pe)||he.isChildOf(pe))),Y){const he=1<<l,pe=this.projection.name==="globe"?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),fe=[he*pe.x,he*pe.y],be=4,ze=be*be;G=G.filter(De=>{const Oe=De.canonical.x+.5-fe[0],Fe=De.canonical.y+.5-fe[1];return Oe*Oe+Fe*Fe<ze})}return G}coveringTiles(t){let l=this.coveringZoomLevel(t);const B=l,G=this.elevation&&this.elevation.exaggeration(),Z=G&&!t.isTerrainDEM,Y=this.projection.name==="mercator";if(t.minzoom!==void 0&&l<t.minzoom)return[];t.maxzoom!==void 0&&l>t.maxzoom&&(l=t.maxzoom);const re=this.locationCoordinate(this.center),oe=this.center.lat,ce=1<<l,he=[ce*re.x,ce*re.y,0],pe=this.projection.name==="globe",fe=!pe,be=o.bR.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,l,fe),ze=pe?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),De=ce*o.bH(1,this.center.lat),Oe=this._camera.position[2]/o.bH(1,this.center.lat),Fe=[ce*ze.x,ce*ze.y,Oe*(fe?1:De)],Ge=pe||G,Xe=this.cameraToCenterDistance/t.tileSize*(t.roundZoom?1:.502),Ze=this.isLODDisabled(!0)?l:0;let nt;if(this._elevation&&t.isTerrainDEM)nt=1e4*this._elevation.exaggeration();else if(this._elevation){const Et=this._elevation.getMinMaxForVisibleTiles();nt=Et?Et.max:this._centerAltitude}else nt=this._centerAltitude;const Qe=t.isTerrainDEM?-nt:this._elevation?this._elevation.getMinElevationBelowMSL():0,it=this.projection.isReprojectedInTileSpace?o.bS(this):1,Ke=Et=>{const Ut=new o.aa(Et.x+25e-6,Et.y,Et.z),hi=new o.aa(Et.x,Et.y+25e-6,Et.z),Qt=Et.toLngLat(),Xt=Ut.toLngLat(),ri=hi.toLngLat(),ci=this.locationCoordinate(Qt),xi=this.locationCoordinate(Xt),Si=this.locationCoordinate(ri),Vi=Math.hypot(xi.x-ci.x,xi.y-ci.y),Ci=Math.hypot(Si.x-ci.x,Si.y-ci.y);return Math.sqrt(Vi*Ci)*it/25e-6},ht=Et=>{const Jt=nt,Ut=Qe;return{aabb:o.bV(this,ce,0,0,0,Et,Ut,Jt,this.projection),zoom:0,x:0,y:0,minZ:Ut,maxZ:Jt,wrap:Et,fullyVisible:!1}},yt=[];let Nt=[];const Dt=l,Wt=t.reparseOverscaled?B:l,$t=(Oe-this._centerAltitude)*De,At=Et=>{if(!this._elevation||!Et.tileID||!Y)return;const Jt=this._elevation.getMinMaxForTile(Et.tileID),Ut=Et.aabb;Jt?(Ut.min[2]=Jt.min,Ut.max[2]=Jt.max,Ut.center[2]=(Ut.min[2]+Ut.max[2])/2):(Et.shouldSplit=ii(Et),Et.shouldSplit||(Ut.min[2]=Ut.max[2]=Ut.center[2]=this._centerAltitude))},Vt=(Et,Jt)=>{if(.707*Jt<Et)return 1;const Ut=Jt/Et;return Ut/(1.4144271570014144+(Math.pow(1.1,Ut-1.4144271570014144+1)-1)/(1.1-1)-1)},ii=Et=>{if(Et.zoom<Ze)return!0;if(Et.zoom===Dt)return!1;if(Et.shouldSplit!=null)return Et.shouldSplit;const Jt=Et.aabb.distanceX(Fe),Ut=Et.aabb.distanceY(Fe);let hi=$t,Qt=1;if(pe){hi=Et.aabb.distanceZ(Fe);const Ci=Math.pow(2,Et.zoom),Ri=o.aS((Et.y+1)/Ci),Hi=o.aS(Et.y/Ci),cr=Math.min(Math.max(oe,Ri),Hi),Cr=o.c9(cr)/o.c9(oe);if(Qt=cr===oe?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,Cr/this._mercatorScaleRatio),this.zoom<=o.c6&&Et.zoom===Dt-1&&Cr>=.9)return!0}else if(Z&&(hi=Et.aabb.distanceZ(Fe)*De),this.projection.isReprojectedInTileSpace&&B<=5){const Ci=Math.pow(2,Et.zoom),Ri=Ke(new o.aa((Et.x+.5)/Ci,(Et.y+.5)/Ci));Qt=Ri>.85?1:Ri}if(!Y){const Ci=Math.sqrt(Jt*Jt+Ut*Ut+hi*hi);let Ri=(1<<Dt-Et.zoom)*Xe*Qt;return Ri*=Vt(Math.max(hi,$t),Ci),Ci<Ri}let Xt=Number.MAX_VALUE,ri=0;const ci=Et.aabb.getCorners(),xi=[];for(const Ci of ci){o.ab.vec3.sub(xi,Ci,Fe),pe||(Z?xi[2]*=De:xi[2]=$t);const Ri=o.ab.vec3.dot(xi,this._camera.forward());Ri<Xt&&(Xt=Ri,ri=Math.abs(xi[2]))}let Si=(1<<Dt-Et.zoom)*Xe*Qt;if(Si*=Vt(Math.max(ri,$t),Xt),Xt<Si)return!0;const Vi=Et.aabb.closestPoint(he);return Vi[0]===he[0]&&Vi[1]===he[1]};if(this.renderWorldCopies)for(let Et=1;Et<=3;Et++)yt.push(ht(-Et)),yt.push(ht(Et));for(yt.push(ht(0));yt.length>0;){const Et=yt.pop(),Jt=Et.x,Ut=Et.y;let hi=Et.fullyVisible;const Qt=()=>this.projection.name==="globe"&&(Et.y===0||Et.y===(1<<Et.zoom)-1);if(!hi){let Xt=Ge?Et.aabb.intersects(be):Et.aabb.intersectsFlat(be);if(Xt===0&&Qt()){const ri=new o.bT(Et.zoom,Jt,Ut);Xt=o.bU(this,ce,ri,!0).intersects(be)}if(Xt===0)continue;hi=Xt===2}if(Et.zoom!==Dt&&ii(Et))for(let Xt=0;Xt<4;Xt++){const ri=(Jt<<1)+Xt%2,ci=(Ut<<1)+(Xt>>1),xi={aabb:Y?Et.aabb.quadrant(Xt):o.bV(this,ce,Et.zoom+1,ri,ci,Et.wrap,Et.minZ,Et.maxZ,this.projection),zoom:Et.zoom+1,x:ri,y:ci,wrap:Et.wrap,fullyVisible:hi,tileID:void 0,shouldSplit:void 0,minZ:Et.minZ,maxZ:Et.maxZ};Z&&!pe&&(xi.tileID=new o.aG(Et.zoom+1===Dt?Wt:Et.zoom+1,Et.wrap,Et.zoom+1,ri,ci),At(xi)),yt.push(xi)}else{const Xt=Et.zoom===Dt?Wt:Et.zoom;if(t.minzoom&&t.minzoom>Xt)continue;let ri=0;if(!hi){let Vi=Ge?Et.aabb.intersectsPrecise(be):Et.aabb.intersectsPreciseFlat(be);if(Vi===0&&Qt()){const Ci=new o.bT(Et.zoom,Jt,Ut);Vi=o.bU(this,ce,Ci,!0).intersectsPrecise(be)}if(Vi===0)continue;if(t.calculateQuadrantVisibility)if(be.containsPoint(Et.aabb.center))ri=15;else for(let Ci=0;Ci<4;Ci++)Et.aabb.quadrant(Ci).intersects(be)!==0&&(ri|=1<<Ci)}const ci=he[0]-(.5+Jt+(Et.wrap<<Et.zoom))*(1<<l-Et.zoom),xi=he[1]-.5-Ut,Si=Et.tileID?Et.tileID:new o.aG(Xt,Et.wrap,Et.zoom,Jt,Ut);t.calculateQuadrantVisibility&&(Si.visibleQuadrants=ri),Nt.push({tileID:Si,distanceSq:ci*ci+xi*xi})}}if(this.fogCullDistSq){const Et=this.fogCullDistSq,Jt=this.horizonLineFromTop();Nt=Nt.filter(Ut=>{const hi=[0,0,0,1],Qt=[o.ag,o.ag,0,1],Xt=this.calculateFogTileMatrix(Ut.tileID.toUnwrapped());o.ab.vec4.transformMat4(hi,hi,Xt),o.ab.vec4.transformMat4(Qt,Qt,Xt);const ri=o.ab.vec4.min([],hi,Qt),ci=o.ab.vec4.max([],hi,Qt),xi=o.bW(ri,ci);if(xi===0)return!0;let Si=!1;const Vi=this._elevation;if(Vi&&xi>Et&&Jt!==0){const Ci=this.calculateProjMatrix(Ut.tileID.toUnwrapped());let Ri;t.isTerrainDEM||(Ri=Vi.getMinMaxForTile(Ut.tileID)),Ri||(Ri={min:Qe,max:nt});const Hi=o.c7(this.rotation),cr=[Hi[0]*o.ag,Hi[1]*o.ag,Ri.max];o.ab.vec3.transformMat4(cr,cr,Ci),Si=(1-cr[1])*this.height*.5<Jt}return xi<Et||Si})}return Nt.sort((Et,Jt)=>Et.distanceSq-Jt.distanceSq).map(Et=>Et.tileID)}resize(t,l){this.width=t,this.height=l,this.pixelsToGLUnits=[2/t,-2/l],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const l=o.aw(t.lat,-o.bX,o.bX),B=this.projection.project(t.lng,l);return new o.P(B.x*this.worldSize,B.y*this.worldSize)}unproject(t){return this.projection.unproject(t.x/this.worldSize,t.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/o.bH(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,l){let B,G;const Z=this.centerPoint;if(this.projection.name==="globe"){const re=this.worldSize;B=(l.x-Z.x)/re,G=(l.y-Z.y)/re}else{const re=this.pointCoordinate(l),oe=this.pointCoordinate(Z);B=re.x-oe.x,G=re.y-oe.y}const Y=this.locationCoordinate(t);this.setLocation(new o.aa(Y.x-B,Y.y-G))}setLocation(t){this.center=this.coordinateLocation(t),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(t){return this.projection.locationPoint(this,t)}locationPoint3D(t){return this.projection.locationPoint(this,t,!0)}pointLocation(t){return this.coordinateLocation(this.pointCoordinate(t))}pointLocation3D(t){return this.coordinateLocation(this.pointCoordinate3D(t))}locationCoordinate(t,l){const B=l?o.bH(l,t.lat):void 0,G=this.projection.project(t.lng,t.lat);return new o.aa(G.x,G.y,B)}coordinateLocation(t){return this.projection.unproject(t.x,t.y)}pointRayIntersection(t,l){const B=l??this._centerAltitude,G=[t.x,t.y,0,1],Z=[t.x,t.y,1,1];o.ab.vec4.transformMat4(G,G,this.pixelMatrixInverse),o.ab.vec4.transformMat4(Z,Z,this.pixelMatrixInverse);const Y=Z[3];o.ab.vec4.scale(G,G,1/G[3]),o.ab.vec4.scale(Z,Z,1/Y);const re=G[2],oe=Z[2];return{p0:G,p1:Z,t:re===oe?0:(B-re)/(oe-re)}}screenPointToMercatorRay(t){const l=[t.x,t.y,0,1],B=[t.x,t.y,1,1];return o.ab.vec4.transformMat4(l,l,this.pixelMatrixInverse),o.ab.vec4.transformMat4(B,B,this.pixelMatrixInverse),o.ab.vec4.scale(l,l,1/l[3]),o.ab.vec4.scale(B,B,1/B[3]),l[2]=o.bH(l[2],this._center.lat)*this.worldSize,B[2]=o.bH(B[2],this._center.lat)*this.worldSize,o.ab.vec4.scale(l,l,1/this.worldSize),o.ab.vec4.scale(B,B,1/this.worldSize),new o.aq([l[0],l[1],l[2]],o.ab.vec3.normalize([],o.ab.vec3.sub([],B,l)))}rayIntersectionCoordinate(t){const{p0:l,p1:B,t:G}=t,Z=o.bH(l[2],this._center.lat),Y=o.bH(B[2],this._center.lat);return new o.aa(o.af(l[0],B[0],G)/this.worldSize,o.af(l[1],B[1],G)/this.worldSize,o.af(Z,Y,G))}pointCoordinate(t,l=this._centerAltitude){return this.projection.pointCoordinate(this,t.x,t.y,l)}pointCoordinate3D(t){if(!this.elevation)return this.pointCoordinate(t);let l=this.projection.pointCoordinate3D(this,t.x,t.y);if(l)return new o.aa(l[0],l[1],l[2]);let B=0,G=this.horizonLineFromTop();if(t.y>G)return this.pointCoordinate(t);const Z=.02*G,Y=t.clone();for(let re=0;re<10&&G-B>Z;re++){Y.y=o.af(B,G,.66);const oe=this.projection.pointCoordinate3D(this,Y.x,Y.y);oe?(G=Y.y,l=oe):B=Y.y}return l?new o.aa(l[0],l[1],l[2]):this.pointCoordinate(t)}isPointAboveHorizon(t){return this.projection.isPointAboveHorizon(this,t)}isPointOnSurface(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=o.bY)return!this.isPointAboveHorizon(t);const l=this.pointCoordinate(t);return l.y>=0&&l.y<=1}_coordinatePoint(t,l){const B=l&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,G=[t.x*this.worldSize,t.y*this.worldSize,B+t.toAltitude(),1];return o.ab.vec4.transformMat4(G,G,this.pixelMatrix),G[3]>0?new o.P(G[0]/G[3],G[1]/G[3]):new o.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:l}=this._edgeInsets,B=this.height-this._edgeInsets.bottom,G=this.width-this._edgeInsets.right,Z=this.pointLocation3D(new o.P(l,t)),Y=this.pointLocation3D(new o.P(G,t)),re=this.pointLocation3D(new o.P(G,B)),oe=this.pointLocation3D(new o.P(l,B));let ce=Math.min(Z.lng,Y.lng,re.lng,oe.lng),he=Math.max(Z.lng,Y.lng,re.lng,oe.lng),pe=Math.min(Z.lat,Y.lat,re.lat,oe.lat),fe=Math.max(Z.lat,Y.lat,re.lat,oe.lat);const be=Math.pow(2,-this.zoom)/16*270,ze=this.projection.name==="globe"?1:4,De=(Oe,Fe,Ge,Xe,Ze)=>{const nt=(Oe+Ge)/2,Qe=(Fe+Xe)/2,it=new o.P(nt,Qe),{lng:Ke,lat:ht}=this.pointLocation3D(it),yt=Math.max(0,ce-Ke,pe-ht,Ke-he,ht-fe);ce=Math.min(ce,Ke),he=Math.max(he,Ke),pe=Math.min(pe,ht),fe=Math.max(fe,ht),(Ze<ze||yt>be)&&(De(Oe,Fe,nt,Qe,Ze+1),De(nt,Qe,Ge,Xe,Ze+1))};if(De(l,t,G,t,1),De(G,t,G,B,1),De(G,B,l,B,1),De(l,B,l,t,1),this.projection.name==="globe"){const[Oe,Fe]=o.bZ(this);Oe?(fe=90,he=180,ce=-180):Fe&&(pe=-90,he=180,ce=-180)}return new o.az(new o.bO(ce,pe),new o.bO(he,fe))}_getBoundsRectangular(t,l){const{top:B,left:G}=this._edgeInsets,Z=this.height-this._edgeInsets.bottom,Y=this.width-this._edgeInsets.right,re=new o.P(G,B),oe=new o.P(Y,B),ce=new o.P(Y,Z),he=new o.P(G,Z);let pe=this.pointCoordinate(re,t),fe=this.pointCoordinate(oe,t);const be=this.pointCoordinate(ce,l),ze=this.pointCoordinate(he,l),De=(Oe,Fe)=>(Fe.y-Oe.y)/(Fe.x-Oe.x);return pe.y>1&&fe.y>=0?pe=new o.aa((1-ze.y)/De(ze,pe)+ze.x,1):pe.y<0&&fe.y<=1&&(pe=new o.aa(-ze.y/De(ze,pe)+ze.x,0)),fe.y>1&&pe.y>=0?fe=new o.aa((1-be.y)/De(be,fe)+be.x,1):fe.y<0&&pe.y<=1&&(fe=new o.aa(-be.y/De(be,fe)+be.x,0)),new o.az().extend(this.coordinateLocation(pe)).extend(this.coordinateLocation(fe)).extend(this.coordinateLocation(ze)).extend(this.coordinateLocation(be))}_getBoundsRectangularTerrain(){const t=this.elevation;if(!t.visibleDemTiles.length||t.isUsingMockSource())return this._getBoundsRectangular(0,0);const l=t.visibleDemTiles.reduce((B,G)=>{if(G.dem){const Z=G.dem.tree;B.min=Math.min(B.min,Z.minimums[0]),B.max=Math.max(B.max,Z.maximums[0])}return B},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(l.min*t.exaggeration(),l.max*t.exaggeration())}getBounds(){return this.projection.name==="mercator"||this.projection.name==="equirectangular"?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(t=!0){const l=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,B=this.height/2-l*(1-this._horizonShift);return t?Math.max(0,B):B}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-o.bX,this.maxLat=o.bX,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=o.at(this.minLng)*this.tileSize,this.worldMaxX=o.at(this.maxLng)*this.tileSize,this.worldMinY=o.aA(this.maxLat)*this.tileSize,this.worldMaxY=o.aA(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(t,l){return this.projection.createTileMatrix(this,l,t)}calculateDistanceTileData(t){const l=t.key,B=this._distanceTileDataCache;if(B[l])return B[l];const G=t.canonical,Z=1/this.height,Y=this.cameraWorldSize,re=Y/this.zoomScale(G.z),oe=(G.x+Math.pow(2,G.z)*t.wrap)*re,ce=G.y*re,he=this.point;he.x*=Y/this.worldSize,he.y*=Y/this.worldSize;const pe=this.angle,fe=Math.sin(-pe),be=-Math.cos(-pe);return B[l]={bearing:[fe,be],center:[(he.x-oe)*Z,(he.y-ce)*Z],scale:re/o.ag*Z},B[l]}calculateFogTileMatrix(t){const l=t.key,B=this._fogTileMatrixCache;if(B[l])return B[l];const G=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,t);return o.ab.mat4.multiply(G,this.worldToFogMatrix,G),B[l]=new Float32Array(G),B[l]}calculateProjMatrix(t,l=!1,B=!1){const G=t.key;let Z;if(Z=B?this._expandedProjMatrixCache:l?this._alignedProjMatrixCache:this._projMatrixCache,Z[G])return Z[G];const Y=this.calculatePosMatrix(t,this.worldSize);let re;return re=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:B?this.expandedFarZProjMatrix:l?this.alignedProjMatrix:this.projMatrix,o.ab.mat4.multiply(Y,re,Y),Z[G]=new Float32Array(Y),Z[G]}calculatePixelsToTileUnitsMatrix(t){const l=t.tileID.key,B=this._pixelsToTileUnitsCache;if(B[l])return B[l];const G=o.b_(t,this);return B[l]=G,B[l]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if(this.projection.name==="globe"){const t=1/this.worldSize,l=o.ab.mat4.fromScaling([],[t,t,t]);return o.ab.mat4.multiply(l,l,this.globeMatrix),l}}recenterOnTerrain(){if(!this._elevation||this.projection.name==="globe")return;const t=this._elevation;this._updateCameraState();const l=o.bH(1,this._center.lat)*this.worldSize,B=this._computeCameraPosition(l),G=this._camera.forward(),Z=o.bH(1,this._center.lat);B[2]/=Z,G[2]/=Z,o.ab.vec3.normalize(G,G);const Y=t.raycast(B,G,t.exaggeration());if(Y){const re=o.ab.vec3.scaleAndAdd([],B,G,Y),oe=new o.aa(re[0],re[1],o.bH(re[2],o.aS(re[1]))),ce=(oe.z+o.ab.vec3.length([oe.x-B[0],oe.y-B[1],oe.z-B[2]*Z]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(ce),this._centerAltitude=oe.toAltitude(),this._center=this.coordinateLocation(oe),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(t=!1){if(!this._elevation)return;const l=this._elevation,B=o.bH(1,this._center.lat)*this.worldSize,G=this._computeCameraPosition(B),Z=l.getAtPointOrZero(new o.aa(...G)),Y=this.pixelsPerMeter/this.worldSize*Z,re=this._minimumHeightOverTerrain(),oe=G[2]-Y;if(oe<=re)if(oe<0||t){const ce=this.locationCoordinate(this._center,this._centerAltitude),he=[G[0],G[1],ce.z-G[2]],pe=o.ab.vec3.length(he);he[2]-=(re-oe)/this._pixelsPerMercatorPixel;const fe=o.ab.vec3.length(he);if(fe===0)return;o.ab.vec3.scale(he,he,pe/fe*this._pixelsPerMercatorPixel),this._camera.position=[G[0],G[1],ce.z*this._pixelsPerMercatorPixel-he[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t=this.projection.name==="globe"||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||t){const fe=this.center;return fe.lat=o.aw(fe.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(fe.lng=o.aw(fe.lng,this.minLng,this.maxLng)),this.center=fe,void(this._constraining=!1)}const l=this._unmodified,{x:B,y:G}=this.point;let Z=0,Y=B,re=G;
274const oe=this.width/2,ce=this.height/2,he=this.worldMinY*this.scale,pe=this.worldMaxY*this.scale;if(G-ce<he&&(re=he+ce),G+ce>pe&&(re=pe-ce),pe-he<this.height&&(Z=Math.max(Z,this.height/(pe-he)),re=(pe+he)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const fe=this.worldMinX*this.scale,be=this.worldMaxX*this.scale,ze=this.worldSize/2-(fe+be)/2;Y=(B+ze+this.worldSize)%this.worldSize-ze,Y-oe<fe&&(Y=fe+oe),Y+oe>be&&(Y=be-oe),be-fe<this.width&&(Z=Math.max(Z,this.width/(be-fe)),Y=(be+fe)/2)}Y===B&&re===G||(this.center=this.unproject(new o.P(Y,re))),Z&&(this.zoom+=this.scaleZoom(Z)),this._constrainCamera(),this._unmodified=l,this._constraining=!1}_minZoomForBounds(){let t=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(t=Math.max(t,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),t}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,l=this.projection.name==="globe",B=this.pixelsPerMeter;this.projection.name==="globe"&&(this._mercatorScaleRatio=o.bH(1,this.center.lat)/o.bH(1,o.c8));const G=o.b$(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,G),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const Z=this.projection.zAxisUnit==="meters"?B:1,Y=this._camera.getWorldToCamera(this.worldSize,Z);let re;const oe=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(oe[8]=2*-t.x/this.width,oe[9]=2*t.y/this.height,this.isOrthographic){let ht=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),yt=ht*this.aspect,Nt=-yt,Dt=-ht;yt-=t.x,Nt-=t.x,ht+=t.y,Dt+=t.y,re=this._camera.getCameraToClipOrthographic(Nt,yt,Dt,ht,this._nearZ,this._farZ),((Wt,$t,At,Vt)=>{for(let ii=0;ii<16;ii++)Wt[ii]=mh($t[ii],At[ii],Vt)})(re,re,oe,rc(this.pitch>=15?1:this.pitch/15))}else re=oe;const ce=o.ab.mat4.mul([],oe,Y);let he=o.ab.mat4.mul([],re,Y);if(this.projection.isReprojectedInTileSpace){const ht=this.locationCoordinate(this.center),yt=o.ab.mat4.identity([]);o.ab.mat4.translate(yt,yt,[ht.x*this.worldSize,ht.y*this.worldSize,0]),o.ab.mat4.multiply(yt,yt,o.c0(this)),o.ab.mat4.translate(yt,yt,[-ht.x*this.worldSize,-ht.y*this.worldSize,0]),o.ab.mat4.multiply(he,he,yt),o.ab.mat4.multiply(ce,ce,yt),this.inverseAdjustmentMatrix=o.c1(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=o.ab.mat4.scale([],he,[this.worldSize,this.worldSize,this.worldSize/Z,1]),this.projMatrix=he,this.invProjMatrix=o.ab.mat4.invert(new Float64Array(16),this.projMatrix),l){const ht=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);ht[8]=2*-t.x/this.width,ht[9]=2*t.y/this.height,this.expandedFarZProjMatrix=o.ab.mat4.mul([],ht,Y)}else this.expandedFarZProjMatrix=this.projMatrix;const pe=o.ab.mat4.invert([],re);this.frustumCorners=o.c2.fromInvProjectionMatrix(pe,this.horizonLineFromTop(),this.height),this.cameraFrustum=o.bR.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!l);const fe=new Float32Array(16);o.ab.mat4.identity(fe),o.ab.mat4.scale(fe,fe,[1,-1,1]),o.ab.mat4.rotateX(fe,fe,this._pitch),o.ab.mat4.rotateZ(fe,fe,this.angle);const be=o.ab.mat4.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=o.ab.mat4.clone(be);const ze=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;be[8]=2*-t.x/this.width,be[9]=2*(t.y+ze)/this.height,this.skyboxMatrix=o.ab.mat4.multiply(fe,be,fe);const De=this.point,Oe=De.x,Fe=De.y,Ge=this.width%2/2,Xe=this.height%2/2,Ze=Math.cos(this.angle),nt=Math.sin(this.angle),Qe=Oe-Math.round(Oe)+Ze*Ge+nt*Xe,it=Fe-Math.round(Fe)+Ze*Xe+nt*Ge,Ke=new Float64Array(he);if(o.ab.mat4.translate(Ke,Ke,[Qe>.5?Qe-1:Qe,it>.5?it-1:it,0]),this.alignedProjMatrix=Ke,he=o.ab.mat4.create(),o.ab.mat4.scale(he,he,[this.width/2,-this.height/2,1]),o.ab.mat4.translate(he,he,[1,-1,0]),this.labelPlaneMatr
274ix=he,he=o.ab.mat4.create(),o.ab.mat4.scale(he,he,[1,-1,1]),o.ab.mat4.translate(he,he,[-1,-1,0]),o.ab.mat4.scale(he,he,[2/this.width,2/this.height,1]),this.glCoordMatrix=he,this.pixelMatrix=o.ab.mat4.multiply(new Float64Array(16),this.labelPlaneMatrix,ce),this._calcFogMatrices(),this._distanceTileDataCache={},he=o.ab.mat4.invert(new Float64Array(16),this.pixelMatrix),!he)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=he,this.projection.name==="globe"||this.mercatorFromTransition){this.globeMatrix=o.c3(this);const ht=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=o.ab.vec3.transformMat4(ht,ht,Y),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=he;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,l=this.cameraPixelsPerMeter,B=this._camera.position,G=1/this.height/this._pixelsPerMercatorPixel,Z=[t,t,l];o.ab.vec3.scale(Z,Z,G),o.ab.vec3.scale(B,B,-1),o.ab.vec3.multiply(B,B,Z);const Y=o.ab.mat4.create();o.ab.mat4.translate(Y,Y,B),o.ab.mat4.scale(Y,Y,Z),this.mercatorFogMatrix=Y,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,l,G)}_computeCameraPosition(t){const l=(t=t||this.pixelsPerMeter)/this.pixelsPerMeter,B=this._camera.forward(),G=this.point,Z=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*l-t/this.worldSize*this._centerAltitude;return[G.x/this.worldSize-B[0]*Z,G.y/this.worldSize-B[1]*Z,t/this.worldSize*this._centerAltitude-B[2]*Z]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const l=this._maxCameraBoundsDistance()*Math.cos(this._pitch),B=this._camera.position[2],G=t[2];let Z=1;this.projection.wrap&&(this.center=this.center.wrap()),G>0&&(Z=Math.min((l-B)/G,1)),this._camera.position=o.ab.vec3.scaleAndAdd([],this._camera.position,t,Z),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,l=this._camera.forward(),{pitch:B,bearing:G}=this._camera.getPitchBearing(),Z=o.bH(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,Y=this._mercatorZfromZoom(this._maxZoom)*Math.cos(o.ai(this._maxPitch)),re=Math.max((t[2]-Z)/Math.cos(B),Y),oe=this._zoomFromMercatorZ(re);o.ab.vec3.scaleAndAdd(t,t,l,re),this._pitch=o.aw(B,o.ai(this.minPitch),o.ai(this.maxPitch)),this.angle=o.bF(G,-Math.PI,Math.PI),this._setZoom(o.aw(oe,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new o.aa(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(t){return Math.pow(2,t)*this.tileSize}_mercatorZfromZoom(t){return this.cameraToCenterDistance/this._worldSizeFromZoom(t)}_minimumHeightOverTerrain(){const t=Math.min(this._seaLevelZoom!=null?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(t)}_zoomFromMercatorZ(t){return this.scaleZoom(this.cameraToCenterDistance/(t*this.tileSize))}zoomFromMercatorZAdjusted(t){let l=0,B=o.bY,G=0,Z=1/0;for(;B-l>1e-6&&B>l;){const Y=l+.5*(B-l),re=this.tileSize*Math.pow(2,Y),oe=this.getCameraToCenterDistance(this.projection,Y,re),ce=this.scaleZoom(oe/(t*this.tileSize)),he=Math.abs(Y-ce);he<Z&&(Z=he,G=Y),Y<ce?l=Y:B=Y}return G}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(o.w("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(t,l){const B=Math.min(t.x,l.x),G=Math.max(t.x,l.x),Z=Math.min(t.y,l.y),Y=Math.max(t.y,l.y);if(Z<this.horizonLineFromTop(!1))return!0;if(this.projection.name!=="mercator")return!1;const re=[new o.P(B,Z),new o.P(G,Y),new o.P(B,Y),new o.P(G,Z)],oe=this.renderWorldCopies?-3:0,ce=this.renderWorldCopies?4:1;for(const he of re){const pe=this.pointRayIntersection(he);if(pe.t<0)return!0;const fe=this.rayIntersectionCoordinate(pe);if(fe.x<oe||fe.y<0||fe.x>ce||fe.y>1)return!0}return!1}
274isHorizonVisible(){return this.pitch+o.c4(this.fovAboveCenter)>88||this.anyCornerOffEdge(new o.P(0,0),new o.P(this.width,this.height))}zoomDeltaToMovement(t,l){const B=o.ab.vec3.length(o.ab.vec3.sub([],this._camera.position,t)),G=this._zoomFromMercatorZ(B)+l;return B-this._mercatorZfromZoom(G)}getCameraPoint(){if(this.projection.name==="globe"){const t=function([l,B,G],Z){const Y=[l,B,G,1];o.ab.vec4.transformMat4(Y,Y,Z);const re=Y[3]=Math.max(Y[3],1e-6);return Y[0]/=re,Y[1]/=re,Y[2]/=re,Y}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new o.P(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.P(0,t))}}getCameraToCenterDistance(t,l=this.zoom,B=this.worldSize){const G=o.b$(t,l,this.width,this.height,1024),Z=t.pixelSpaceConversion(this.center.lat,B,G);let Y=.5/Math.tan(.5*this._fov)*this.height*Z;return this.isOrthographic&&(Y=mh(1,Y,rc(this.pitch>=15?1:this.pitch/15))),Y}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,this.projection.zAxisUnit==="meters"?this.pixelsPerMeter:1);return this.projection.name==="globe"&&o.ab.mat4.multiply(t,t,this.globeMatrix),t}getFrustum(t){return o.bR.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t,this.projection.zAxisUnit==="meters")}}const Ta=(F,t)=>{if(t>0&&F.terrain&&o.w("Cutoff is currently disabled on terrain"),t<=0||F.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const l=F.transform,B=Math.max(Math.abs(l._zoom-(F.minCutoffZoom-1)),1),G=l.isLODDisabled(!1)?o.ac(60,45,l.pitch):o.ac(30,15,l.pitch),Z=l._farZ-l._nearZ,Y=t*l.height,re=((1-(oe=G))*l.cameraToCenterDistance+oe*(l._farZ+Y))*B;var oe;return{shouldRenderCutoff:G<1,uniformValues:{u_cutoff_params:[l._nearZ,l._farZ,(re-l._nearZ)/Z,(re-Y-l._nearZ)/Z]}}},Fn={cascadeCount:2,normalOffset:3,shadowMapResolution:2048};class ha{constructor(t,l){this.aabb=t,this.lastCascade=l}}class gh{add(t,l){const B=this.receivers[t.key];B!==void 0?(B.aabb.min[0]=Math.min(B.aabb.min[0],l.min[0]),B.aabb.min[1]=Math.min(B.aabb.min[1],l.min[1]),B.aabb.min[2]=Math.min(B.aabb.min[2],l.min[2]),B.aabb.max[0]=Math.max(B.aabb.max[0],l.max[0]),B.aabb.max[1]=Math.max(B.aabb.max[1],l.max[1]),B.aabb.max[2]=Math.max(B.aabb.max[2],l.max[2])):this.receivers[t.key]=new ha(l,null)}clear(){this.receivers={}}get(t){return this.receivers[t.key]}computeRequiredCascades(t,l,B){const G=o.cd.fromPoints(t.points);let Z=0;for(const Y in this.receivers){const re=this.receivers[Y];if(!re||!G.intersectsAabb(re.aabb))continue;re.aabb.min=G.closestPoint(re.aabb.min),re.aabb.max=G.closestPoint(re.aabb.max);const oe=re.aabb.getCorners();for(let ce=0;ce<B.length;ce++){let he=!0;for(const pe of oe){const fe=[pe[0]*l,pe[1]*l,pe[2]];
274if(o.ab.vec3.transformMat4(fe,fe,B[ce].matrix),fe[0]<-1||fe[0]>1||fe[1]<-1||fe[1]>1){he=!1;break}}if(re.lastCascade=ce,Z=Math.max(Z,ce),he)break}}return Z+1}}class qa{constructor(t){this.painter=t,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new gh,this._depthMode=new ki(t.context.gl.LEQUAL,ki.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.useNormalOffset=!1,t.tp.registerParameter(this,["Shadows"],"_forceDisable",{label:"forceDisable"},()=>{this.painter.style.map.triggerRepaint()}),t.tp.registerParameter(Fn,["Shadows"],"cascadeCount",{min:1,max:2,step:1}),t.tp.registerParameter(Fn,["Shadows"],"normalOffset",{min:0,max:10,step:.05}),t.tp.registerParameter(Fn,["Shadows"],"shadowMapResolution",{min:32,max:2048,step:32}),t.tp.registerBinding(this,["Shadows"],"_numCascadesToRender",{readonly:!0,label:"numCascadesToRender"})}destroy(){for(const t of this._cascades)t.texture.destroy(),t.framebuffer.destroy();this._cascades=[]}updateShadowParameters(t,l){const B=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!l||!l.properties)return;const G=l.properties.get("shadow-intensity");if(!l.shadowsEnabled()||G<=0||(this._shadowLayerCount=B.style.order.reduce((ze,De)=>{const Oe=B.style._mergedLayers[De];
274return ze+(Oe.hasShadowPass()&&!Oe.isHidden(t.zoom)?1:0)},0),this._enabled=this._shadowLayerCount>0,!this.enabled))return;const Z=B.context,Y=Fn.shadowMapResolution,re=Fn.shadowMapResolution;if(this._cascades.length===0||Fn.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let ze=0;ze<Fn.cascadeCount;++ze){const De=B._shadowMapDebug,Oe=Z.gl,Fe=Z.createFramebuffer(Y,re,De,"texture"),Ge=new o.T(Z,{width:Y,height:re,data:null},Oe.DEPTH_COMPONENT16);if(Fe.depthAttachment.set(Ge.texture),De){const Xe=new o.T(Z,{width:Y,height:re,data:null},Oe.RGBA8);Fe.colorAttachment.set(Xe.texture)}this._cascades.push({framebuffer:Fe,texture:Ge,matrix:[],far:0,boundingSphereRadius:0,frustum:new o.bR,scale:0})}}this.shadowDirection=Ha(l);let oe=0;if(t.elevation){const ze=t.elevation,De=[1e4,-1e4];ze.visibleDemTiles.filter(Oe=>Oe.dem).forEach(Oe=>{const Fe=Oe.dem.tree;De[0]=Math.min(De[0],Fe.minimums[0]),De[1]=Math.max(De[1],Fe.maximums[0])}),De[0]!==1e4&&(oe=(De[1]-De[0])*ze.exaggeration())}const ce=1.5*t.cameraToCenterDistance,he=3*ce,pe=new Float64Array(16);for(let ze=0;ze<this._cascades.length;++ze){const De=this._cascades[ze];let Oe=t.height/50,Fe=1;Fn.cascadeCount===1?Fe=he:ze===0?Fe=ce:(Oe=ce,Fe=he);const[Ge,Xe]=Np(t,this.shadowDirection,Oe,Fe,Fn.shadowMapResolution,oe);De.scale=t.scale,De.matrix=Ge,De.boundingSphereRadius=Xe,o.ab.mat4.invert(pe,De.matrix),De.frustum=o.bR.fromInvProjectionMatrix(pe,1,0,!0),De.far=Fe}const fe=this._cascades.length-1;this._uniformValues.u_fade_range=[.75*this._cascades[fe].far,this._cascades[fe].far],this._uniformValues.u_shadow_intensity=G,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=1/Fn.shadowMapResolution,this._uniformValues.u_shadow_map_resolution=Fn.shadowMapResolution,this._uniformValues.u_shadowmap_0=jn.ShadowMap0,this._uniformValues.u_shadowmap_1=jn.ShadowMap0+1,this._groundShadowTiles=B.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});const be=B.transform.elevation;for(const ze of this._groundShadowTiles){let De={min:0,max:0};if(be){const Oe=be.getMinMaxForTile(ze);Oe&&(De=Oe)}this.addShadowReceiver(ze.toUnwrapped(),De.min,De.max)}}get enabled(){return this._enabled&&!this._forceDisable}set enabled(t){this._enabled=t}drawShadowPass(t,l){if(!this.enabled)return;const B=this.painter,G=B.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(B.transform.getFrustum(0),B.transform.worldSize,this._cascades),G.viewport.set([0,0,Fn.shadowMapResolution,Fn.shadowMapResolution]);for(let Z=0;Z<this._numCascadesToRender;++Z){B.currentShadowCascade=Z,G.bindFramebuffer.set(this._cascades[Z].framebuffer.framebuffer),G.clear({color:o.aj.white,depth:1});for(const Y of t.order){const re=t._mergedLayers[Y];if(!re.hasShadowPass()||re.isHidden(B.transform.zoom))continue;const oe=t.getLayerSourceCache(re),ce=oe?l[oe.id]:void 0;(re.type==="model"||ce&&ce.length)&&B.renderLayer(B,oe,re,ce)}}B.currentShadowCascade=0}drawGroundShadows(){if(!this.enabled)return;const t=this.painter,l=t.style,B=t.context,G=l.directionalLight,Z=l.ambientLight;if(!G||!Z)return;const Y=[],re=Ta(t,t.longestCutoffRange);re.shouldRenderCutoff&&Y.push("RENDER_CUTOFF"),Y.push("RENDER_SHADOWS","DEPTH_TEXTURE"),this.useNormalOffset&&Y.push("NORMAL_OFFSET");const oe=_h(l,G,Z),ce=new ki(B.gl.LEQUAL,ki.ReadOnly,t.depthRangeFor3D);for(const he of this._groundShadowTiles){const pe=he.toUnwrapped(),fe=t.isTileAffectedByFog(he),be=t.getOrCreateProgram("groundShadow",{defines:Y,overrideFog:fe});this.setupShadows(pe,be),t.uploadCommonUniforms(B,be,pe,null,re);const ze={u_matrix:t.transform.calculateProjMatrix(pe),u_ground_shadow_factor:oe};be.draw(t,B.gl.TRIANGLES,ce,Ui.disabled,ir.multiply,qi.disabled,ze,"ground_shadow",t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments,{},t.transform.zoom,null,null)}}getShadowPassColorMode(){return this.painter._shadowMapDebug?ir.unblended:ir.disabled}getShadowPassDepthMode(){return this._depthMode}getShadowCastingLayerCount(){return this._shadowLayerCount}calculateShadowPassMatrixFromTile(t){const l=this.painter.transform,B=l.calculatePosMatrix(t,l.worldSize);return o.ab.mat4.multiply(B,this._cascades[this.painter.currentShadowCascade].matrix,B),Float32Array.from(B)}
274calculateShadowPassMatrixFromMatrix(t){return o.ab.mat4.multiply(t,this._cascades[this.painter.currentShadowCascade].matrix,t),Float32Array.from(t)}setupShadows(t,l,B,G=0){if(!this.enabled)return;const Z=this.painter.transform,Y=this.painter.context,re=Y.gl,oe=this._uniformValues,ce=new Float64Array(16),he=Z.calculatePosMatrix(t,Z.worldSize);for(let pe=0;pe<this._cascades.length;pe++)o.ab.mat4.multiply(ce,this._cascades[pe].matrix,he),oe[pe===0?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(ce),Y.activeTexture.set(re.TEXTURE0+jn.ShadowMap0+pe),this._cascades[pe].texture.bind(re.NEAREST,re.CLAMP_TO_EDGE);if(this.useNormalOffset=!!B,this.useNormalOffset){const pe=o.cc(t.canonical),fe=2/Z.tileSize*o.ag/Fn.shadowMapResolution,be=fe*this._cascades[0].boundingSphereRadius,ze=fe*this._cascades[this._cascades.length-1].boundingSphereRadius,De=(B==="vector-tile"?1:3)/Math.pow(2,G-t.canonical.z-(1-Z.zoom+Math.floor(Z.zoom)));oe.u_shadow_normal_offset=[pe,be*De,ze*De],oe.u_shadow_bias=[6e-5,.0012,.012]}else oe.u_shadow_bias=[36e-5,.0012,.012];l.setShadowUniformValues(Y,oe)}setupShadowsFromMatrix(t,l,B=!1){if(!this.enabled)return;const G=this.painter.context,Z=G.gl,Y=this._uniformValues,re=new Float64Array(16);for(let oe=0;oe<Fn.cascadeCount;oe++)o.ab.mat4.multiply(re,this._cascades[oe].matrix,t),Y[oe===0?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(re),G.activeTexture.set(Z.TEXTURE0+jn.ShadowMap0+oe),this._cascades[oe].texture.bind(Z.NEAREST,Z.CLAMP_TO_EDGE);if(this.useNormalOffset=B,B){const oe=Fn.normalOffset;Y.u_shadow_normal_offset=[1,oe,oe],Y.u_shadow_bias=[6e-5,.0012,.012]}else Y.u_shadow_bias=[36e-5,.0012,.012];l.setShadowUniformValues(G,Y)}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(t,l,B,G){if(G[2]>=0)return{};const Z=function(oe,ce,he){const pe=he/(1<<oe.canonical.z);return new o.cd([oe.canonical.x*pe+oe.wrap*he,oe.canonical.y*pe+oe.wrap*he,0],[(oe.canonical.x+1)*pe+oe.wrap*he,(oe.canonical.y+1)*pe+oe.wrap*he,ce])}(t,l,B).getCorners(),Y=l/-G[2];G[0]<0?(o.ab.vec3.add(Z[0],Z[0],[G[0]*Y,0,0]),o.ab.vec3.add(Z[3],Z[3],[G[0]*Y,0,0])):G[0]>0&&(o.ab.vec3.add(Z[1],Z[1],[G[0]*Y,0,0]),o.ab.vec3.add(Z[2],Z[2],[G[0]*Y,0,0])),G[1]<0?(o.ab.vec3.add(Z[0],Z[0],[0,G[1]*Y,0]),o.ab.vec3.add(Z[1],Z[1],[0,G[1]*Y,0])):G[1]>0&&(o.ab.vec3.add(Z[2],Z[2],[0,G[1]*Y,0]),o.ab.vec3.add(Z[3],Z[3],[0,G[1]*Y,0]));const re={};return re.vertices=Z,re.planes=[$a(Z[1],Z[0],Z[4]),$a(Z[2],Z[1],Z[5]),$a(Z[3],Z[2],Z[6]),$a(Z[0],Z[3],Z[7])],re}addShadowReceiver(t,l,B){this._receivers.add(t,o.cd.fromTileIdAndHeight(t,l,B))}getMaxCascadeForTile(t){const l=this._receivers.get(t);return l&&l.lastCascade?l.lastCascade:0}}function $a(F,t,l){const B=o.ab.vec3.sub([],l,t),G=o.ab.vec3.sub([],F,t),Z=o.ab.vec3.cross([],B,G),Y=o.ab.vec3.length(Z);return Y===0?[0,0,1,0]:(o.ab.vec3.scale(Z,Z,1/Y),[Z[0],Z[1],Z[2],-o.ab.vec3.dot(Z,t)])}function Ha(F){const t=F.properties.get("direction"),l=o.cb(t.x,t.y,t.z);l[2]=o.aw(l[2],0,75);const B=o.ce([l[0],l[1],l[2]]);return o.ab.vec3.fromValues(B.x,B.y,B.z)}function _h(F,t,l){const B=t.properties.get("color-use-theme")==="none",G=t.properties.get("color"),Z=t.properties.get("intensity"),Y=t.properties.get("direction"),re=[Y.x,Y.y,Y.z],oe=l.properties.get("color-use-theme")==="none",ce=l.properties.get("color"),he=l.properties.get("intensity"),pe=Math.max(o.ab.vec3.dot([0,0,1],re),0),fe=[0,0,0];o.ab.vec3.scale(fe,ce.toRenderColor(oe?null:F.getLut(t.scope)).toArray01Linear().slice(0,3),he);const be=[0,0,0];return o.ab.vec3.scale(be,G.toRenderColor(B?null:F.getLut(l.scope)).toArray01Linear().slice(0,3),pe*Z),o.cf([fe[0]>0?fe[0]/(fe[0]+be[0]):0,fe[1]>0?fe[1]/(fe[1]+be[1]):0,fe[2]>0?fe[2]/(fe[2]+be[2]):0])}function Np(F,t,l,B,G,Z){const Y=F.zoom,re=F.scale,oe=F.worldSize,ce=1/oe,he=F.aspect,pe=Math.sqrt(1+he*he)*Math.tan(.5*F.fovX),fe=pe*pe,be=B-l,ze=B+l;let De,Oe;fe>be/ze?(De=B,Oe=B*pe):(De=.5*ze*(1+fe),Oe=.5*Math.sqrt(be*be+2*(B*B+l*l)*fe+ze*ze*fe*fe));const Fe=F.projection.pixelsPerMeter(F.center.lat,oe),Ge=F._camera.getCameraToWorldMercator(),Xe=[0,0,-De*ce];o.ab.vec3.transformMat4(Xe,Xe,Ge);let Ze=Oe*ce;const nt=F._edgeInsets;if(!(nt.left===0&&nt.top===0&&nt.right===0&&nt.bottom===0||nt.left===nt.right&&nt.top===nt.bottom)){const hi=F._camera.getWorldToCamera(F.worldSize,F.projection.zAxisUnit==="meters"?Fe:1),Qt=F._camera.getCameraToClipPerspective(F._fov,F.width/F.height,l,B);Qt[8]=2*-F.centerOffset.x/F.width,Qt[9]=2*F.centerOffset.y/F.height;const Xt=new Float64Array(16);o.ab.mat4.mul(Xt,Qt,hi);const ri=new Float64Array(16);o.ab.mat4.invert(ri,Xt);const ci=o.bR.fromInvProjectionMatrix(ri,oe,Y,!0);
274for(const xi of ci.points){const Si=((Qe=xi)[0]/=re,Qe[1]/=re,Qe[2]=o.bH(Qe[2],F._center.lat),Qe);Ze=Math.max(Ze,o.ab.vec3.len(o.ab.vec3.subtract([],Xe,Si)))}}var Qe;Ze*=G/(G-1);const it=Math.acos(t[2]),Ke=Math.atan2(-t[0],-t[1]),ht=new ls;ht.position=Xe,ht.setPitchBearing(it,Ke);const yt=ht.getWorldToCamera(oe,Fe),Nt=Ze*oe,Dt=Math.min(F._mercatorZfromZoom(17)*oe*-2,-2*Nt),Wt=ht.getCameraToClipOrthographic(-Nt,Nt,-Nt,Nt,Dt,(Nt+Z*Fe)/t[2]),$t=new Float64Array(16);o.ab.mat4.multiply($t,Wt,yt);const At=o.ab.vec3.fromValues(Math.floor(1e6*Xe[0])/1e6*oe,Math.floor(1e6*Xe[1])/1e6*oe,0),Vt=.5*G,ii=[0,0,0];o.ab.vec3.transformMat4(ii,At,$t),o.ab.vec3.scale(ii,ii,Vt);const Et=[Math.floor(ii[0]),Math.floor(ii[1]),Math.floor(ii[2])],Jt=[0,0,0];o.ab.vec3.sub(Jt,ii,Et),o.ab.vec3.scale(Jt,Jt,-1/Vt);const Ut=new Float64Array(16);return o.ab.mat4.identity(Ut),o.ab.mat4.translate(Ut,Ut,Jt),o.ab.mat4.multiply($t,Ut,$t),[$t,Nt]}class yh extends o.E{constructor(t){super(),this.requestManager=t,this.models={"":{}},this.modelUris={"":{}},this.numModelsLoading={}}loadModel(t,l){return o.aM(this.requestManager.transformRequest(l,o.R.Model).url).then(B=>{if(!B)return;const G=o.aN(B),Z=new o.aO(t,void 0,void 0,G);return Z.computeBoundsAndApplyParent(),Z}).catch(B=>{if(B&&B.status===404)return null;this.fire(new o.y(new Error(`Could not load model ${t} from ${l}: ${B.message}`)))})}load(t,l,B={keepNumReferences:!1}){this.models[l]||(this.models[l]={});const G=Object.keys(t);this.numModelsLoading[l]=(this.numModelsLoading[l]||0)+G.length;const Z=[];for(const Y of G)Z.push(this.loadModel(Y,t[Y]));Promise.allSettled(Z).then(Y=>{for(let re=0;re<Y.length;re++){const{status:oe,value:ce}=Y[re];if(oe==="fulfilled"&&ce){const he=this.models[l][G[re]];this.models[l][G[re]]={model:ce,numReferences:B.keepNumReferences&&he?he.numReferences:1}}}this.numModelsLoading[l]-=G.length,this.fire(new o.z("data",{dataType:"style"}))}).catch(Y=>{this.fire(new o.y(new Error(`Could not load models: ${Y.message}`)))})}isLoaded(){for(const t in this.numModelsLoading)if(this.numModelsLoading[t]>0)return!1;return!0}hasModel(t,l){return!!this.getModel(t,l)}getModel(t,l){return this.models[l]||(this.models[l]={}),this.models[l][t]?this.models[l][t].model:void 0}
274addModel(t,l,B){this.models[B]||(this.models[B]={}),this.modelUris[B]||(this.modelUris[B]={}),this.hasModel(t,B)&&this.models[B][t].numReferences++,this.modelUris[B][t]=this.requestManager.normalizeModelURL(l),this.load({[t]:this.modelUris[B][t]},B)}addModels(t,l){this.models[l]||(this.models[l]={}),this.modelUris[l]||(this.modelUris[l]={});const B=this.modelUris[l];for(const G in t)this.models[l][G]={},B[G]=this.requestManager.normalizeModelURL(t[G]);this.load(B,l,{keepNumReferences:!0})}reloadModels(t){this.load(this.modelUris[t],t)}addModelsFromBucket(t,l){this.models[l]||(this.models[l]={}),this.modelUris[l]||(this.modelUris[l]={});const B={};for(const G of t)this.hasModel(G,l)?this.models[l][G].numReferences++:(this.modelUris[l][G]=this.requestManager.normalizeModelURL(G),B[G]=this.modelUris[l][G]);this.load(B,l)}removeModel(t,l){if(this.models[l]&&this.models[l][t]&&(this.models[l][t].numReferences--,this.models[l][t].numReferences===0)){const B=this.models[l][t].model;delete this.models[l][t],delete this.modelUris[l][t],B.destroy()}}listModels(t){return this.models[t]||(this.models[t]={}),Object.keys(this.models[t])}upload(t,l){this.models[l]||(this.models[l]={});for(const B in this.models[l])this.models[l][B].model&&this.models[l][B].model.upload(t.context)}}const Vp=new o.a5({data:new o.a6(o.a3.colorTheme.data)}),id={"mbx-indoor-active-floorplans":{default:["literal",[]]},"mbx-indoor-underground":{default:["literal",!1]},"mbx-indoor-loaded-levels":{default:["literal",[]]},"mbx-indoor-level-height":{default:["literal",{}]},"mbx-indoor-level-base":{default:["literal",{}]},"mbx-indoor-level-selected":{default:["literal",{}]},"mbx-indoor-level-overlapped":{default:["literal",{}]}};function vh(F){return F=F||{},Object.assign(F,id)}class xh extends o.E{constructor(t){super(),this.mergeFloors=!0,this._scope=void 0,this._queryFeatureSetId=void 0,this._buildingEntryFeatureSetId=void 0,this._selectedFloorplan=void 0,this._indoorData=void 0,this._selectedLevel=void 0,this._floorplanStates={},o.aP(["_onLoad","_onMove","_checkFloorplanVisible"],this),this._map=t,this._checkFloorplanVisible(!0),this._map.on("load",this._onLoad),this._map.on("move",this._onMove)}destroy(){this._map.indoor.off("load",this._onLoad),this._map.indoor.off("move",this._onMove),this._map=void 0}_onLoad(){this._map.style.forEachFragmentStyle(t=>{t.stylesheet.indoor&&(this._queryFeatureSetId?this.fire(new o.y(new Error("Multiple indoor map styles detected, simultaneous usage is not allowed currently."))):(this._queryFeatureSetId=t.stylesheet.indoor.floorplanFeaturesetId,this._buildingEntryFeatureSetId=t.stylesheet.indoor.buildingFeaturesetId,this._scope=t.scope))}),this._queryFeatureSetId&&this._buildingEntryFeatureSetId&&this._map.addInteraction("mbx-indoor-buildingclick",{type:"click",target:{featuresetId:this._buildingEntryFeatureSetId,importId:this._scope},handler:t=>(t.feature&&t.feature.properties.floorplan&&this.selectFloorplan(t.feature.properties.floorplan),!0)}),this._checkFloorplanVisible(!0)}_onMove(){this._checkFloorplanVisible(!1)}_checkFloorplanVisible(t){if(!this._queryFeatureSetId||!this._map.isStyleLoaded()||this._map.transform.zoom<13)return;this._indoorData&&!function(Y,re){const[oe,ce]=Y,{center:he,radius:pe}=re,[fe,be]=he,ze=Math.abs(oe-fe);return Math.sqrt((ze>180?360-ze:ze)**2+(ce-be)**2)<=pe}([this._map.getCenter().lng,this._map.getCenter().lat],this._indoorData.circumCircle)&&(this._indoorData=void 0,this._selectedFloorplan=void 0,this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!1),this._map.setConfigProperty(this._scope,"mbx-indoor-active-floorplans",["literal",[]]),this.fire(new o.z("floorplangone")));const l={target:{featuresetId:this._queryFeatureSetId,importId:this._scope}},B=new o.P(this._map.transform.width/2,this._map.transform.height/2),G=[new o.P(0,0),new o.P(this._map.transform.width,this._map.transform.height)],Z=this._map.queryRenderedFeatures(t?G:B,l);Z.length>0&&(this._selectedFloorplan&&Z[0].properties.id===this._selectedFloorplan.properties.id||(this._selectedFloorplan=Z[0],this._floorplanSelected(!1)))}
274_floorplanSelected(t){this._indoorData=JSON.parse(this._selectedFloorplan.properties["indoor-data"]),this._indoorData.id=this._selectedFloorplan.properties.id,this._indoorData.circumCircle=function(Z){const[[Y,re],[oe,ce]]=Z,he=(oe-Y+360)%360,pe=he>180?360-he:he;return{center:[(Y+pe/2+360)%360,(re+ce)/2],radius:Math.sqrt(pe**2+(ce-re)**2)/2}}(this._indoorData.extent),this._floorplanStates[this._indoorData.id]||(this._floorplanStates[this._indoorData.id]={});const l=this._floorplanStates[this._indoorData.id].selectedBuilding,B=this._floorplanStates[this._indoorData.id].selectedLevel;let G;if(this._map.setConfigProperty(this._scope,"mbx-indoor-active-floorplans",this._indoorData.floorplanIDs),this._selectedLevel)for(const Z of this._indoorData.levels)Z.id===this._selectedLevel.id&&(G=Z.id);if(this.fire(new o.z("floorplanselected",{buildings:this._indoorData.buildings,levels:this._indoorData.levels,selectedLevelId:G})),l){const Z=this._indoorData.buildings.find(Y=>Y.id===l);this._buildingSelected(Z,!1)}else this._indoorData.buildings.length>0&&this._buildingSelected(this._indoorData.buildings[0],!1);if(B){const Z=this._indoorData.levels.find(Y=>Y.id===B);this._updateLevels(Z,t)}else t&&this._indoorData["default-levels"].length>0&&this.selectLevel(this._indoorData["default-levels"][0])}_buildingSelected(t,l){l&&t&&t.extent&&this._map.fitBounds(t.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}),this._floorplanStates[this._indoorData.id].selectedBuilding=t?t.id:void 0;const B=this._indoorData.levels.filter(G=>t.levels.includes(G.id));this.fire(new o.z("buildingselected",{buildingId:t.id,levels:B}))}_levelSelected(t){if(t==="overview")this._updateLevels(void 0,!0);else{const l=this._indoorData.levels.find(B=>B.id===t);this._updateLevels(l,!0)}this.fire(new o.z("levelselected",{levelId:t==="overview"?void 0:t}))}_updateLevels(t,l){if(!t)return this._map.setConfigProperty(this._scope,"mbx-indoor-loaded-levels",["literal",[]]),this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!1),this._floorplanStates[this._indoorData.id].selectedLevel=void 0,void(l&&this._indoorData.extent&&this._map.fitBounds(this._indoorData.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}));function B(ce){const he=ce.indexOf("/floor/");if(he===-1)return ce;const pe=he+7,fe=ce.indexOf("/",pe);return fe===-1?ce.slice(pe):ce.slice(pe,fe)}this._selectedLevel=t,this._floorplanStates[this._indoorData.id].selectedLevel=t?t.id:void 0;const G=[],Z={},Y={},re={},oe={};for(const ce of this._indoorData.levels)if(G.push(ce.id),Z[ce.id]=ce.height,Y[ce.id]=ce.base,t){if(this.mergeFloors){const he=B(t.id),pe=B(ce.id);re[ce.id]=pe===he?"true":"false"}else re[ce.id]=ce.id===t.id?"true":"false";oe[ce.id]=ce.base<t.base?"true":"false"}else oe[ce.id]=!0;if(this._map.setConfigProperty(this._scope,"mbx-indoor-loaded-levels",["literal",G]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-height",["literal",Z]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-base",["literal",Y]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-selected",["literal",re]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-overlapped",["literal",oe]),t&&(this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!!t.isUnderground),l&&t.extent)){const ce=this._map.cameraForBounds(t.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}),he=this._map.getZoom(),pe=ce.zoom?Math.abs(he-ce.zoom):0;this._map.fitBounds(t.extent,pe>=1?{pitch:this._map.getPitch(),bearing:this._map.getBearing()}:{pitch:this._map.getPitch(),bearing:this._map.getBearing(),zoom:he})}}selectFloorplan(t){const l={target:{featuresetId:this._queryFeatureSetId,importId:this._scope}},B=[new o.P(0,0),new o.P(this._map.transform.width,this._map.transform.height)],G=this._map.queryRenderedFeatures(B,l);if(G.length>0){for(const Z of G)if(JSON.parse(Z.properties["indoor-data"]).floorplanIDs.includes(t)){this._selectedFloorplan=Z,this._floorplanSelected(!0);break}}}selectBuilding(t){const l=this._indoorData.buildings.find(B=>B.id===t);this._buildingSelected(l,!0)}selectLevel(t){this._levelSelected(t)}}function Up(F){if(!F.metadata||!F.metadata.content_area)return;const t=o.q.devicePixelRatio,{left:l,top:B,width:G,height:Z}=F.metadata.content_area,Y=l*t,re=B*t;return[Y,re,Y+G*t,re+Z*t]}function rd(F){if(F)return F.map(([t,l])=>[t*o.q.devicePixelRatio,l*o.q.devicePixelRatio])}const Wa=(F,t)=>nn(F,t&&t.filter(l=>l.identifier!=="source.canvas")),jp=o.ay(rr,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport"]),nd=o.ay(rr,["setCenter","setZoom","setBearing","setP
274itch"]),bh=new Set(["background","sky","slot","custom"]),nl={version:8,layers:[],sources:{}},sd={duration:300,delay:0};class Ms extends o.E{constructor(t,l={}){super(),this.map=t,this.scope=l.scope||"",this.globalId=null,this.fragments=[],this.importDepth=l.importDepth||0,this.importsCache=l.importsCache||new Map,this.resolvedImports=l.resolvedImports||new Set,this.transition=o.l({},sd),this._buildingIndex=new ed(this),this.crossTileSymbolIndex=new ph,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._clipLayerPresent=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._changes=l.styleChanges||new fn,this.dispatcher=l.dispatcher?l.dispatcher:new o.D(o.ci(),this),l.imageManager?this.imageManager=l.imageManager:(this.imageManager=new on(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.createScope(this.scope),this.glyphManager=l.glyphManager?l.glyphManager:new o.cj(t._requestManager,l.localFontFamily?o.ck.all:l.localIdeographFontFamily?o.ck.ideographs:o.ck.none,l.localFontFamily||l.localIdeographFontFamily),l.modelManager?this.modelManager=l.modelManager:(this.modelManager=new yh(t._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._order=[],this._markersNeedUpdate=!1,this.options=l.configOptions?l.configOptions:new Map,this._configDependentLayers=l.configDependentLayers?l.configDependentLayers:new Set,this._config=l.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:l.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=l.initialConfig,this.dispatcher.broadcast("setReferrer",o.cl());const B=this;this._rtlTextPluginCallback=Ms.registerForPluginStateChange(G=>{B.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:G.pluginStatus,pluginURL:G.pluginURL},(Z,Y)=>{if(o.cm(Z),Y&&Y.every(re=>re))for(const re in B._sourceCaches){const oe=B._sourceCaches[re],ce=oe.getSource().type;ce!=="vector"&&ce!=="geojson"||oe.reload()}})}),this.on("data",G=>{if(G.dataType!=="source"||G.sourceDataType!=="metadata")return;const Z=this.getOwnSource(G.sourceId);if(Z&&Z.vectorLayerIds)for(const Y in this._layers){const re=this._layers[Y];re.source===Z.id&&this._validateLayer(re)}})}load(t){return t?(typeof t=="string"?this.loadURL(t):this.loadJSON(t),this):this}_getGlobalId(t){if(!t)return null;if(typeof t=="string"){if(o.f(t))return t;const l=o.cn(t);if(!l.startsWith("http"))try{return new URL(l,location.href).toString()}catch{return l}return l}return`json://${o.co(JSON.stringify(t))}`}_diffStyle(t,l,B){this.globalId=this._getGlobalId(t);const G=(Z,Y)=>{try{Y(null,this.setState(Z,B))}catch(re){Y(re,!1)}};if(typeof t=="string"){const Z=this.map._requestManager.normalizeStyleURL(t),Y=this.map._requestManager.transformRequest(Z,o.R.Style);o.n(Y,(re,oe)=>{re?this.fire(new o.y(re)):oe&&G(oe,l)})}else typeof t=="object"&&G(t,l)}loadURL(t,l={}){this.fire(new o.z("dataloading",{dataType:"style"}));const B=typeof l.validate=="boolean"?l.validate:!o.f(t);this.globalId=this._getGlobalId(t),t=this.map._requestManager.normalizeStyleURL(t,l.accessToken),this.resolvedImports.add(t);const G=this.importsCache.get(t);if(G)return this._load(G,B);const Z=this.map._requestManager.transformRequest(t,o.R.Style);this._request=o.n(Z,(Y,re)=>{if(this._request=null,Y)this.fire(new o.y(Y));else if(re)return this.importsCache.set(t,re),this._load(re,B)})}loadJSON(t,l={}){this.fire(new o.z("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(t),this._request=o.q.frame(()=>{this._request=null,this._load(t,l.validate!==!1)})}loadEmpty(){this.fire(new o.z("dataloading",{dataType:"style"})),this._load(nl,!1)}_loadImports(t,l,B){if(this.importDepth>=4)return o.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const G=[];for(const Z of t){const Y=this._createFragmentStyle(Z),re=new Promise(he=>{Y.once("style.import.load",he),Y.once("error",he)}).then(()=>this.mergeAll());if(G.push(re),this.resolvedImports.has(Z.url)){Y.loadEmpty();continue}const oe=Z.data||this.importsCache.get(Z.url);
274oe?(Y.loadJSON(oe,{validate:l}),this._isInternalStyle(oe)&&(Y.globalId=null)):Z.url?Y.loadURL(Z.url,{validate:l}):Y.loadEmpty();const ce={style:Y,id:Z.id,config:Z.config};if(B){const he=this.fragments.findIndex(({id:pe})=>pe===B);this.fragments=this.fragments.slice(0,he).concat(ce).concat(this.fragments.slice(he))}else this.fragments.push(ce)}return Promise.allSettled(G)}getImportGlobalIds(t=this,l=new Set){for(const B of t.fragments)B.style.globalId&&l.add(B.style.globalId),this.getImportGlobalIds(B.style,l);return[...l.values()]}_createFragmentStyle(t){const l=this.scope?o.aC(t.id,this.scope):t.id;let B;const G=this._initialConfig&&this._initialConfig[l];(t.config||G)&&(B=o.l({},t.config,G));const Z=new Ms(this.map,{scope:l,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:B,configOptions:this.options,colorThemeOverride:t["color-theme"],configDependentLayers:this._configDependentLayers});return Z.setEventedParent(this.map,{style:Z}),Z}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.map._precompilePrograms&&this.isRootStyle()}_isInternalStyle(t){return this.isRootStyle()&&(t.fragment||!!t.schema&&t.fragment!==!1)}_load(t,l){const B=t.indoor?vh(t.schema):t.schema;if(this._isInternalStyle(t)){const Y=o.l({},nl,{imports:[{id:"basemap",data:t,url:""}]});return void this._load(Y,l)}if(this.updateConfig(this._config,B),l&&Wa(this,mn(t)))return;this._loaded=!0,this.stylesheet=o.cp(t);const G=()=>{for(const ce in t.sources)this.addSource(ce,t.sources[ce],{validate:!1,isInitialLoad:!0});t.sprite?this._loadIconset(t.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),this.glyphManager.setURL(t.glyphs,this.scope);const Y=Xl(this.stylesheet.layers);if(this._order=Y.map(ce=>ce.id),this.stylesheet.light&&o.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(this.stylesheet.lights.length===1&&this.stylesheet.lights[0].type==="flat"){const ce=this.stylesheet.lights[0];this.light=new Re(ce.properties,ce.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new Re(this.stylesheet.light)),this._layers={};for(const ce of Y){const he=o.cu(ce,this.scope,this._styleColorTheme.lut,this.options);he.configDependencies.size!==0&&this._configDependentLayers.add(he.fqid),he.setEventedParent(this,{layer:{id:he.id}}),this._layers[he.id]=he;const pe=this.getOwnLayerSourceCache(he),fe=!!this.directionalLight&&this.directionalLight.shadowsEnabled();pe&&he.canCastShadows()&&fe&&(pe.castsShadows=!0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.modelManager.addModels(this.stylesheet.models,this.scope);const re=this.stylesheet.terrain;re&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(re,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 o.z("data",{dataType:"style"}));const oe=this.isRootStyle();t.imports?this._loadImports(t.imports,l).then(()=>{this._reloadImports(),this.fire(new o.z(oe?"style.load":"style.import.load"))}):(this._reloadImports(),this.fire(new o.z(oe?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const Z=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(Z){const Y=this._evaluateColorThemeData(Z);this._loadColorTheme(Y).then(()=>{G()}).catch(re=>{o.w(`Couldn't load color theme from the stylesheet: ${re}`),G()})}else this._styleColorTheme.lut=null,G()}isRootStyle(){return this.importDepth===0}mergeAll(){let t,l,B,G,Z,Y,re,oe,ce,he;const pe={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(fe=>{if(fe.stylesheet){if(fe.light!=null&&(t=fe.light),fe.stylesheet.lights)for(const be of fe.stylesheet.lights)be.type==="ambient"&&fe.ambientLight!=null&&(l=fe.ambientLight),be.type==="directional"&&fe.directionalLight!=null&&(B=fe.directionalLight);G=this._prioritizeTerrain(G,fe.terrain,fe.stylesheet.terrain),fe.stylesheet.fog&&fe.fog!=null&&(Z=fe.fog),fe.stylesheet.snow&&fe.snow!=null&&(Y=fe.snow),fe.stylesheet.rain&&fe.rain!=null&&(re=fe.rain),fe.stylesheet.camera!=null&&(he=fe.stylesheet.camera),fe.stylesheet.projection!=null&&(oe=fe.stylesheet.projection),fe.stylesheet.transition!=null&&(ce=fe.stylesheet.transition),pe[fe.scope]=fe._styleColorTheme}}),this.light=t,this.ambientLight=l,this.directionalLight=B,this.fog=Z,this.snow=Y,this.rain=re,this._styleColorThemeForScope=pe,G===null?delete this.terrain:this.terrain=G,this.camera=he||{"camera-projection":"perspective"},this.projection=oe||{name:"mercator"},this.transition=o.l({},sd,ce),this.mergeSources(),this.mergeLayers()}forEachFragmentStyle(t){const l=B=>{for(const G of B.fragments)l(G.style);t(B)};l(this)}_prioritizeTerrain(t,l,B){const G=t&&t.drapeRenderMode===0;return B===null?l&&l.drapeRenderMode===0?l:G?t:null:l!=null&&(!t||G||l&&l.drapeRenderMode===1)?l:t}mergeTerrain(){let t;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(l=>{t=this._prioritizeTerrain(t,l.terrain,l.stylesheet.terrain)}),t===null?delete this.terrain:this.terrain=t}mergeProjection(){let t;this.forEachFragmentStyle(l=>{l.stylesheet.projection!=null&&(t=l.stylesheet.projection)}),this.projection=t||{name:"mercator"}}mergeSources(){const t={},l={},B={};this.forEachFragmentStyle(G=>{for(const Z in G._sourceCaches){const Y=o.aC(Z,G.scope);t[Y]=G._sourceCaches[Z]}for(const Z in G._otherSourceCaches){const Y=o.aC(Z,G.scope);l[Y]=G._otherSourceCaches[Z]}for(const Z in G._symbolSourceCaches){const Y=o.aC(Z,G.scope);B[Y]=G._symbolSourceCaches[Z]}}),this._mergedSourceCaches=t,this._mergedOtherSourceCaches=l,this._mergedSymbolSourceCaches=B}mergeLayers(){const t={},l=[],B={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle(Z=>{for(const Y of Z._order){const re=Z._layers[Y];if(re.type==="slot"){const oe=o.cq(Y);if(t[oe])continue;t[oe]=[]}re.slot&&t[re.slot]?t[re.slot].push(re):l.push(re)}}),this._mergedOrder=[];const G=(Z=[])=>{for(const Y of Z)if(Y.type==="slot"){const re=o.cq(Y.id);t[re]&&G(t[re]),this._mergedSlots.push(re)}else{const re=o.aC(Y.id,Y.scope);this._mergedOrder.push(re),B[re]=Y,Y.is3D()&&(this._has3DLayers=!0),Y.type==="circle"&&(this._hasCircleLayers=!0),Y.type==="symbol"&&(this._hasSymbolLayers=!0),Y.type==="clip"&&(this._clipLayerPresent=!0)}};G(l),this._mergedOrder.sort((Z,Y)=>{const re=B[Z],oe=B[Y];return re.hasInitialOcclusionOpacityProperties?oe.is3D()?1:0:re.is3D()&&oe.hasInitialOcclusionOpacityProperties?-1:0}),this._mergedLayers=B,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged()}terrainSetForDrapingOnly(){return!!this.terrain&&this.terrain.drapeRenderMode===0}getCamera(){return this.stylesheet.camera}setCamera(t){return this.stylesheet.camera=o.l({},this.stylesheet.camera,t),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(t){return t.data?function(l,B,G){const Z=o.l({},B);
274for(const re of Object.keys(o.a3.colorTheme))Z[re]===void 0&&(Z[re]=o.a3.colorTheme[re].default);const Y=new o.a4(Vp,l,new Map(G));return Y.setTransitionOrValue(Z,G),Y.untransitioned().possiblyEvaluate(new o.a8(0))}(this.scope,t,this.options).get("data"):null}_loadColorTheme(t){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const l=this._styleColorTheme.lutLoadingCorrelationID;return new Promise((B,G)=>{const Z="data:image/png;base64,";if(!t||t.length===0)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void B();let Y=t;Y.startsWith(Z)||(Y=Z+Y);const re="mapbox-reserved-lut",oe=new Image;oe.src=Y,oe.onerror=()=>{this._styleColorTheme.lutLoading=!1,G(new Error("Failed to load image data"))},oe.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==l)return void B();this._styleColorTheme.lutLoading=!1;const{width:ce,height:he,data:pe}=o.q.getImageData(oe);if(he>32)return void G(new Error("The height of the image must be less than or equal to 32 pixels."));if(ce!==he*he)return void G(new Error("The width of the image must be equal to the height squared."));this.getImage(re)&&this.removeImage(re),this.addImage(re,{data:new o.r({width:ce,height:he},pe),pixelRatio:1,sdf:!1,usvg:!1,version:0});const fe=this.imageManager.getImage(re,this.scope);fe?(this._styleColorTheme.lut={image:fe.data,data:t},B()):G(new Error("Missing LUT image."))}})}getLut(t){const l=this._styleColorThemeForScope[t];return l?l.lut:null}setProjection(t){t?this.stylesheet.projection=t:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){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){this._spriteRequest=function(l,B,G){let Z,Y,re;const oe=o.q.devicePixelRatio>1?"@2x":"";let ce=o.n(B.transformRequest(B.normalizeSpriteURL(l,oe,".json"),o.R.SpriteJSON),(fe,be)=>{ce=null,re||(re=fe,Z=be,pe())}),he=o.o(B.transformRequest(B.normalizeSpriteURL(l,oe,".png"),o.R.SpriteImage),(fe,be)=>{he=null,re||(re=fe,Y=be,pe())});function pe(){if(re)G(re);else if(Z&&Y){const fe=o.q.getImageData(Y),be={};for(const ze in Z){const{width:De,height:Oe,x:Fe,y:Ge,sdf:Xe,pixelRatio:Ze,stretchX:nt,stretchY:Qe,content:it}=Z[ze],Ke=new o.r({width:De,height:Oe});o.r.copy(fe,Ke,{x:Fe,y:Ge},{x:0,y:0},{width:De,height:Oe},null),be[ze]={data:Ke,pixelRatio:Ze,sdf:Xe,stretchX:nt,stretchY:Qe,content:it,usvg:!1}}G(null,be)}}return{cancel(){ce&&(ce.cancel(),ce=null),he&&(he.cancel(),he=null)}}}(t,this.map._requestManager,(l,B)=>{if(this._spriteRequest=null,l)this.fire(new o.y(l));else if(B)for(const G in B)this.imageManager.addImage(G,this.scope,B[G]);this.imageManager.setLoaded(!0,this.scope),this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new o.z("data",{dataType:"style"}))})}_loadIconset(t){if(!o.f(t)&&this.map._spriteFormat!=="icon_set"||this.map._spriteFormat==="raster")return void this._loadSprite(t);const l=this.map._spriteFormat==="auto";var B,G;this._spriteRequest=(G=(Z,Y)=>{if(this._spriteRequest=null,Z)l?this._loadSprite(t):this.fire(new o.y(Z));else if(Y)for(const re in Y)this.imageManager.addImage(re,this.scope,Y[re]);this.imageManager.setLoaded(!0,this.scope),this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new o.z("data",{dataType:"style"}))},o.bi((B=this.map._requestManager).transformRequest(B.normalizeIconsetURL(t),o.R.Iconset),(Z,Y)=>{if(Z)return void G(Z);const re={},oe=o.cg(new o.bh(Y));for(const ce of oe.icons){const he={version:1,pixelRatio:o.q.devicePixelRatio,content:Up(ce),stretchX:ce.metadata?rd(ce.metadata.stretch_x_areas):void 0,stretchY:ce.metadata?rd(ce.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:ce};re[ce.name]=he}G(null,re)}))}_validateLayer(t){const l=this.getOwnSource(t.source);if(!l)return;const B=t.sourceLayer;B&&(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(B)===-1)&&this.fire(new o.y(new Error(`Source layer "${B}
274" does not exist on source "${l.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const t in this._sourceCaches)if(!this._sourceCaches[t].loaded())return!1;if(!this.imageManager.isLoaded()||!this.modelManager.isLoaded()||this._styleColorTheme.lutLoading)return!1;for(const{style:t}of this.fragments)if(!t.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((t,l)=>{const B=this.fragments[l];return B&&B.style&&(t.data=B.style.serialize()),t})}_serializeSources(){const t={};for(const l in this._sourceCaches){const B=this._sourceCaches[l].getSource();t[B.id]||(t[B.id]=B.serialize())}return t}_serializeLayers(t){const l=[];for(const B of t){const G=this._layers[B];G&&G.type!=="custom"&&l.push(G.serialize())}return l}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()||this.hasFogTransition()||this.hasSnowTransition()||this.hasRainTransition())return!0;for(const t in this._sourceCaches)if(this._sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(t){return t?this.order:this._mergedOrder}isLayerDraped(t){return!!this.terrain&&t.isDraped(this.getLayerSourceCache(t))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(t){const l=this.getOwnLayer(t);if(l)return l;this.fire(new o.y(new Error(`The layer '${t}' does not exist in the map's style.`)))}_checkSource(t){const l=this.getOwnSource(t);if(l)return l;this.fire(new o.y(new Error(`The source '${t}' does not exist in the map's style.`)))}precompilePrograms(t,l){const B=this.map.painter;if(B)for(let G=t.minzoom||0;G<(t.maxzoom||25.5);G++){const Z=t.getProgramIds();if(Z)for(const Y of Z){const re=t.getDefaultProgramParams(Y,l.zoom,this._styleColorTheme.lut);re&&(B.style=this,this.fog&&(B._fogVisible=!0,re.overrideFog=!0,B.getOrCreateProgram(Y,re)),B._fogVisible=!1,re.overrideFog=!1,B.getOrCreateProgram(Y,re),(this.stylesheet.terrain||this.stylesheet.projection&&this.stylesheet.projection.name==="globe")&&(re.overrideRtt=!0,B.getOrCreateProgram(Y,re)))}}}update(t){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(t),this.directionalLight&&this.directionalLight.recalculate(t);const l=this.calculateLightsBrightness();t.brightness=l||0,l!==this._brightness&&(this._brightness=l,this.dispatcher.broadcast("setBrightness",l));const B=this._changes.isDirty();let G=!1;if(this._changes.isDirty()){const Y=this._changes.getLayerUpdatesByScope();for(const re in Y){const{updatedIds:oe,removedIds:ce}=Y[re];(oe||ce)&&(this._updateWorkerLayers(re,oe,ce),G=!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 Z={};for(const Y in this._mergedSourceCaches){const re=this._mergedSourceCaches[Y];Z[Y]=re.used,re.used=!1,re.tileCoverLift=0}for(const Y of this._mergedOrder){const re=this._mergedLayers[Y];if(re.recalculate(t,this._availableImages),!re.isHidden(t.zoom)){const oe=this.getLayerSourceCache(re);oe&&(oe.used=!0,oe.tileCoverLift=Math.max(oe.tileCoverLift,re.tileCoverLift()))}!this._precompileDone&&this._shouldPrecompile&&("requestIdleCallback"in window?requestIdleCallback(()=>{this.precompilePrograms(re,t)}):this.precompilePrograms(re,t))}this._shouldPrecompile&&(this._precompileDone=!0),this.terrain&&G&&this.mergeLayers();for(const Y in Z){const re=this._mergedSourceCaches[Y];Z[Y]!==re.used&&re.getSource().fire(new o.z("data",{sourceDataType:"visibility",dataType:"source",sourceId:re.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._markersNeedU
274pdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),B&&this.fire(new o.z("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=this._changes.getUpdatedImages();if(t.length){for(const l in this._sourceCaches)this._sourceCaches[l].reloadTilesForDependencies(["icons","patterns"],t);this._changes.resetUpdatedImages()}}_updateWorkerLayers(t,l,B){const G=this.getFragmentStyle(t);G&&this.dispatcher.broadcast("updateLayers",{layers:l?G._serializeLayers(l):[],scope:t,removedIds:B||[],options:G.options})}setState(t,l){if(this._checkLoaded(),Wa(this,mn(t)))return!1;(t=o.cp(t)).layers=Xl(t.layers);const B=function(Y,re){if(!Y)return[{command:rr.setStyle,args:[re]}];let oe=[];try{if(!o.bn(Y.version,re.version))return[{command:rr.setStyle,args:[re]}];if(o.bn(Y.center,re.center)||oe.push({command:rr.setCenter,args:[re.center]}),o.bn(Y.zoom,re.zoom)||oe.push({command:rr.setZoom,args:[re.zoom]}),o.bn(Y.bearing,re.bearing)||oe.push({command:rr.setBearing,args:[re.bearing]}),o.bn(Y.pitch,re.pitch)||oe.push({command:rr.setPitch,args:[re.pitch]}),o.bn(Y.sprite,re.sprite)||oe.push({command:rr.setSprite,args:[re.sprite]}),o.bn(Y.glyphs,re.glyphs)||oe.push({command:rr.setGlyphs,args:[re.glyphs]}),o.bn(Y.imports,re.imports)||function(be=[],ze=[],De){ze=ze||[];const Oe=(be=be||[]).map($n),Fe=ze.map($n),Ge=be.reduce(aa,{}),Xe=ze.reduce(aa,{}),Ze=Oe.slice();let nt,Qe,it,Ke;for(nt=0,Qe=0;nt<Oe.length;nt++)it=Oe[nt],Xe.hasOwnProperty(it)?Qe++:(De.push({command:rr.removeImport,args:[it]}),Ze.splice(Ze.indexOf(it,Qe),1));for(nt=0,Qe=0;nt<Fe.length;nt++)it=Fe[Fe.length-1-nt],Ze[Ze.length-1-nt]!==it&&(Ge.hasOwnProperty(it)?(De.push({command:rr.removeImport,args:[it]}),Ze.splice(Ze.lastIndexOf(it,Ze.length-Qe),1)):Qe++,Ke=Ze[Ze.length-nt],De.push({command:rr.addImport,args:[Xe[it],Ke]}),Ze.splice(Ze.length-nt,0,it));for(const ht of ze){const yt=Ge[ht.id];yt&&!o.bn(yt,ht)&&De.push({command:rr.updateImport,args:[ht.id,ht]})}}(Y.imports,re.imports,oe),o.bn(Y.transition,re.transition)||oe.push({command:rr.setTransition,args:[re.transition]}),o.bn(Y.light,re.light)||oe.push({command:rr.setLight,args:[re.light]}),o.bn(Y.fog,re.fog)||oe.push({command:rr.setFog,args:[re.fog]}),o.bn(Y.snow,re.snow)||oe.push({command:rr.setSnow,args:[re.snow]}),o.bn(Y.rain,re.rain)||oe.push({command:rr.setRain,args:[re.rain]}),o.bn(Y.projection,re.projection)||oe.push({command:rr.setProjection,args:[re.projection]}),o.bn(Y.lights,re.lights)||oe.push({command:rr.setLights,args:[re.lights]}),o.bn(Y.camera,re.camera)||oe.push({command:rr.setCamera,args:[re.camera]}),!o.bn(Y["color-theme"],re["color-theme"]))return[{command:rr.setStyle,args:[re]}];const ce={},he=[];(function(be,ze,De,Oe){let Fe;for(Fe in ze=ze||{},be=be||{})be.hasOwnProperty(Fe)&&(ze.hasOwnProperty(Fe)||Va(Fe,De,Oe));for(Fe in ze){if(!ze.hasOwnProperty(Fe))continue;const Ge=ze[Fe];be.hasOwnProperty(Fe)?o.bn(be[Fe],Ge)||(be[Fe].type==="geojson"&&Ge.type==="geojson"&&Ar(be,ze,Fe)?De.push({command:rr.setGeoJSONSourceData,args:[Fe,Ge.data]}):Ei(Fe,ze,De,Oe)):Yl(Fe,ze,De)}})(Y.sources,re.sources,he,ce);const pe=[];Y.layers&&Y.layers.forEach(be=>{be.source&&ce[be.source]?oe.push({command:rr.removeLayer,args:[be.id]}):pe.push(be)});let fe=Y.terrain;fe&&ce[fe.source]&&(oe.push({command:rr.setTerrain,args:[void 0]}),fe=void 0),oe=oe.concat(he),o.bn(fe,re.terrain)||oe.push({command:rr.setTerrain,args:[re.terrain]}),function(be,ze,De){ze=ze||[];const Oe=(be=be||[]).map($n),Fe=ze.map($n),Ge=be.reduce(aa,{}),Xe=ze.reduce(aa,{}),Ze=Oe.slice(),nt=Object.create(null);let Qe,it,Ke,ht,yt,Nt,Dt;for(Qe=0,it=0;Qe<Oe.length;Qe++)Ke=Oe[Qe],Xe.hasOwnProperty(Ke)?it++:(De.push({command:rr.removeLayer,args:[Ke]}),Ze.splice(Ze.indexOf(Ke,it),1));for(Qe=0,it=0;Qe<Fe.length;Qe++)Ke=Fe[Fe.length-1-Qe],Ze[Ze.length-1-Qe]!==Ke&&(Ge.hasOwnProperty(Ke)?(De.push({command:rr.removeLayer,args:[Ke]}),Ze.splice(Ze.lastIndexOf(Ke,Ze.length-it),1)):it++,Nt=Ze[Ze.length-Qe],De.push({command:rr.addLayer,args:[Xe[Ke],Nt]}),Ze.splice(Ze.length-Qe,0,Ke),nt[Ke]=!0);for(Qe=0;Qe<Fe.length;Qe++)if(Ke=Fe[Qe],ht=Ge[Ke],yt=Xe[Ke],!nt[Ke]&&!o.bn(ht,yt))if(o.bn(ht.source,yt.source)&&o.bn(ht["source-layer"],yt["source-layer"])&&o.bn(ht.type,yt.type)){for(Dt in pr(ht.layout,yt.layout,De,Ke,null,rr.setLayoutProperty),pr(ht.paint,yt.paint,De,Ke,null,rr.setPaintProperty),o.bn(ht.slot,yt.slot)||De.push({command:rr.setSlot,args:[Ke,yt.slot]}),o.bn(ht.filter,yt.filter)||De.push({command:rr.setFilter,args:[Ke,yt.filter]}),o.bn(ht.minzoom,yt.minzoom)&&o.bn(ht.maxzoom,yt.maxzoom)||De.push({command:rr.setLayerZoomRange,args:[Ke,yt.minzoom,yt.maxzoom]}),ht)ht.hasOwnProperty(Dt)&&Dt!=="layout"&&Dt!=="paint"&&Dt!=="filter"&&Dt!=="metadata"&&Dt!=="minzoom"&&Dt!=="maxzoom"&&Dt!=="slot"&&(Dt.indexOf("paint.")===0?pr(ht[Dt],yt[Dt],De,Ke,Dt.slice(6),rr.setPaintProperty):o.bn(ht[Dt],yt[Dt])||De.push({command:rr.setLayerProperty,args:[Ke,Dt,yt[Dt]]}));for(Dt in yt)yt.hasOwnProperty(Dt)&&!ht.hasOwnProperty(Dt)&&Dt!=="layout"&&Dt!=="paint"&&Dt!=="filter"&&Dt!=="metadata"&&Dt!=="minzoom"&&Dt!=="maxzoom"&&Dt!=="slot"&&(Dt.indexOf("paint.")===0?pr(ht[Dt],yt[Dt],De,Ke,Dt.slice(6),rr.setPaintProperty):o.bn(ht[Dt],yt[Dt])||De.push({command:rr.setLayerProperty,args:[Ke,Dt,yt[Dt]]}))}else De.push({command:rr.removeLayer,args:[Ke]}),Nt=Ze[Ze.lastIndexOf(Ke)+1],De.push({command:rr.addLayer,args:[yt,Nt]})}(pe,re.layers,oe)}catch(ce){console.warn("Unable to compute style diff:",ce),oe=[{command:rr.setStyle,args:[re]}]}return oe}(this.serialize(),t).filter(Y=>
274!(Y.command in nd));if(B.length===0)return!1;const G=B.filter(Y=>!(Y.command in jp));if(G.length>0)throw new Error(`Unimplemented: ${G.map(Y=>Y.command).join(", ")}.`);const Z=[];return B.forEach(Y=>{Z.push(this[Y.command].apply(this,Y.args))}),l&&Promise.all(Z).then(l),this.stylesheet=t,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}addImage(t,l){return this.getImage(t)?this.fire(new o.y(new Error("An image with this name already exists."))):(this.imageManager.addImage(t,this.scope,l),this._afterImageUpdated(t),this)}updateImage(t,l,B=!1){this.imageManager.updateImage(t,this.scope,l),B&&this._afterImageUpdated(t)}getImage(t){return this.imageManager.getImage(t,this.scope)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t,this.scope),this._afterImageUpdated(t),this):this.fire(new o.y(new Error("No image with this name exists.")))}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(this.scope),this._changes.updateImage(t),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.fire(new o.z("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addModel(t,l,B={}){return this._checkLoaded(),this._validate(Na,`models.${t}`,l,null,B)||(this.modelManager.addModel(t,l,this.scope),this._changes.setDirty()),this}hasModel(t){return this.modelManager.hasModel(t,this.scope)}removeModel(t){return this.hasModel(t)?(this.modelManager.removeModel(t,this.scope),this):this.fire(new o.y(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.scope)}addSource(t,l,B={}){if(this._checkLoaded(),this.getOwnSource(t)!==void 0)throw new Error(`There is already a source with ID "${t}".`);if(!l.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(l).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(l.type)>=0&&this._validate(rn,`sources.${t}`,l,null,B))return;this.map&&this.map._collectResourceTiming&&(l.collectResourceTiming=!0);const G=ts(t,l,this.dispatcher,this);G.scope=this.scope,G.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(G.id),source:G.serialize(),sourceId:G.id}));const Z=Y=>{const re=(Y?"symbol:":"other:")+G.id,oe=o.aC(re,this.scope),ce=this._sourceCaches[re]=new Es(oe,G,Y);(Y?this._symbolSourceCaches:this._otherSourceCaches)[G.id]=ce,ce.onAdd(this.map)};Z(!1),l.type!=="vector"&&l.type!=="geojson"||Z(!0),G.onAdd&&G.onAdd(this.map),B.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(t){this._checkLoaded();const l=this.getOwnSource(t);if(!l)throw new Error("There is no source with this ID");for(const G in this._layers)if(this._layers[G].source===t)return this.fire(new o.y(new Error(`Source "${t}" cannot be removed while layer "${G}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===t)return this.fire(new o.y(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));const B=this.getOwnSourceCaches(t);for(const G of B){const Z=o.cq(G.id);delete this._sourceCaches[Z],this._changes.discardSourceCacheUpdate(G.id),G.fire(new o.z("data",{sourceDataType:"metadata",dataType:"source",sourceId:G.getSource().id})),G.setEventedParent(null),G.clearTiles()}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],this.mergeSources(),l.setEventedParent(null),l.onRemove&&l.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(t,l){this._checkLoaded(),this.getOwnSource(t).setData(l),this._changes.setDirty()}getOwnSource(t){const l=this.getOwnSourceCache(t);return l&&l.getSource()}getOwnSources(){const t=[];for(const l in this._otherSourceCaches){const B=this.getOwnSourceCache(l);B&&t.push(B.getSource())}return t}areTilesLoaded(){const t=this._mergedSourceCaches;for(const l in t){const B=t[l]._tiles;for(const G in B){const Z=B[G];if(Z.state!=="loaded"&&Z.state!=="errored")return!1}}return!0}setLights(t){if(this._checkLoaded(),!t)return delete this.ambientLight,void delete this.directionalLight;const l=this._getTransitionParameters();
vendor: 4,525 bytes, line 274
274for(const G of t){if(this._validate(es,"lights",G))return;switch(G.type){case"ambient":if(this.ambientLight){const Z=this.ambientLight;Z.set(G),Z.updateTransitions(l)}else this.ambientLight=new Oi(G,ui||(ui=new o.a5({color:new o.a6(o.a3.properties_light_ambient.color),"color-use-theme":new o.a6({type:"string",default:"default","property-type":"data-constant"}),intensity:new o.a6(o.a3.properties_light_ambient.intensity)})),this.scope,this.options);break;case"directional":if(this.directionalLight){const Z=this.directionalLight;Z.set(G),Z.updateTransitions(l)}else this.directionalLight=new Oi(G,fi||(fi=new o.a5({direction:new o.ak(o.a3.properties_light_directional.direction),color:new o.a6(o.a3.properties_light_directional.color),"color-use-theme":new o.a6({type:"string",default:"default","property-type":"data-constant"}),intensity:new o.a6(o.a3.properties_light_directional.intensity),"cast-shadows":new o.a6(o.a3.properties_light_directional["cast-shadows"]),"shadow-quality":new o.a6(o.a3.properties_light_directional["shadow-quality"]),"shadow-intensity":new o.a6(o.a3.properties_light_directional["shadow-intensity"])})),this.scope,this.options)}}const B=new o.a8(this.z||0,l);this.ambientLight&&this.ambientLight.recalculate(B),this.directionalLight&&this.directionalLight.recalculate(B),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const t=this.directionalLight,l=this.ambientLight;if(!t||!l)return;const B=fe=>.2126*(fe[0]<=.03928?fe[0]/12.92:Math.pow((fe[0]+.055)/1.055,2.4))+.7152*(fe[1]<=.03928?fe[1]/12.92:Math.pow((fe[1]+.055)/1.055,2.4))+.0722*(fe[2]<=.03928?fe[2]/12.92:Math.pow((fe[2]+.055)/1.055,2.4)),G=t.properties.get("color").toRenderColor(null).toArray01(),Z=t.properties.get("intensity"),Y=t.properties.get("direction"),re=1-o.cb(Y.x,Y.y,Y.z)[2]/90,oe=B(G)*Z*re,ce=l.properties.get("color").toRenderColor(null).toArray01(),he=l.properties.get("intensity"),pe=B(ce)*he;return Number(((oe+pe)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const t=[];return this.directionalLight&&t.push(this.directionalLight.get()),this.ambientLight&&t.push(this.ambientLight.get()),t}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(t){if(!t)return this;if(o.cr(t)){const l=o.cs(t),B=this.fragments.find(({id:Z})=>Z===l);if(!B)throw new Error(`Style import '${t}' not found`);const G=o.cq(t);return B.style.getFragmentStyle(G)}{const l=this.fragments.find(({id:B})=>B===t);return l?l.style:void 0}}setFeaturesetSelectors(t){if(!t)return;const l={},B=(G,Z="")=>`${G}::${Z}`;this._featuresetSelectors={};for(const G in t){const Z=this._featuresetSelectors[G]=[];for(const Y of t[G].selectors){if(Y.featureNamespace){const oe=this.getOwnLayer(Y.layer);if(!oe){o.w(`Layer is undefined for selector: ${Y.layer}`);continue}const ce=B(oe.source,oe.sourceLayer);if(ce in l&&l[ce]!==Y.featureNamespace){o.w(`"featureNamespace ${Y.featureNamespace} of featureset ${G}'s selector is not associated to the same source, skip this selector`);continue}l[ce]=Y.featureNamespace}let re;if(Y.properties)for(const oe in Y.properties){const ce=o.U(Y.properties[oe]);ce.result==="success"&&(re=re||{},re[oe]=ce.value)}Z.push({layerId:Y.layer,namespace:Y.featureNamespace,properties:re,uniqueFeatureID:Y._uniqueFeatureID})}}}getFeaturesetDescriptors(t){const l=this.getFragmentStyle(t);if(!l||!l.stylesheet.featuresets)return[];const B=[];for(const G in l.stylesheet.featuresets)B.push({featuresetId:G,importId:l.scope?l.scope:void 0});return B}getFeaturesetLayers(t,l){const B=this.getFragmentStyle(l),G=B.stylesheet.featuresets;if(!G||!G[t])return this.fire(new o.y(new Error(`The featureset '${t}' does not exist in the map's style and cannot be queried.`))),[];const Z=[];for(const Y of G[t].selectors){const re=B.getOwnLayer(Y.layer);re&&Z.push(re)}return Z}getConfigProperty(t,l){const B=this.getFragmentStyle(t);if(!B)return null;const G=o.aC(l,B.scope),Z=B.options.get(G),Y=Z?Z.value||Z.default:null;return Y?Y.serialize():null}setConfigProperty(t,l,B){const G=this.getFragmentStyle(t);if(!G)return;const Z=G.stylesheet.indoor?vh(G.stylesheet.schema):G.stylesheet.schema;if(!Z||!Z[l])return;const Y=o.U(B);if(Y.result!=="success")return void Wa(this,Y.value);const re=Y.value.expression,oe=o.aC(l,G.scope),ce=G.options.get(oe);if(!ce)return;let he;const{minValue:pe,maxValue:fe,stepValue:be,type:ze,values:De}=Z[l],Oe=o.U(Z[l].default);
274Oe.result==="success"&&(he=Oe.value.expression),he?(this.options.set(oe,Object.assign({},ce,{value:re,default:he,minValue:pe,maxValue:fe,stepValue:be,type:ze,values:De})),this.updateConfigDependencies(l)):this.fire(new o.y(new Error(`No schema defined for the config option "${l}" in the "${t}" fragment.`)))}getConfig(t){const l=this.getFragmentStyle(t);if(!l)return null;const B=l.stylesheet.schema;if(!B)return null;const G={};for(const Z in B){const Y=o.aC(Z,l.scope),re=l.options.get(Y),oe=re?re.value||re.default:null;G[Z]=oe?oe.serialize():null}return G}setConfig(t,l){const B=this.getFragmentStyle(t);B&&(B.updateConfig(l,B.stylesheet.schema),this.updateConfigDependencies())}getSchema(t){const l=this.getFragmentStyle(t);return l?l.stylesheet.schema:null}setSchema(t,l){const B=this.getFragmentStyle(t);B&&(B.stylesheet.schema=l,B.updateConfig(B._config,l),this.updateConfigDependencies())}updateConfig(t,l){if(this._config=t,t||l)if(l)for(const B in l){let G,Z;const Y=o.U(l[B].default);if(Y.result==="success"&&(G=Y.value.expression),t&&t[B]!==void 0){const fe=o.U(t[B]);fe.result==="success"&&(Z=fe.value.expression)}const{minValue:re,maxValue:oe,stepValue:ce,type:he,values:pe}=l[B];if(G){const fe=o.aC(B,this.scope);this.options.set(fe,{default:G,value:Z,minValue:re,maxValue:oe,stepValue:ce,type:he,values:pe})}else this.fire(new o.y(new Error(`No schema defined for config option "${B}".`)))}else this.fire(new o.y(new Error("Attempting to set config for a style without schema.")))}updateConfigDependencies(t){for(const l of this._configDependentLayers){const B=this.getLayer(l);if(B){if(t&&!B.configDependencies.has(t))continue;B.possiblyEvaluateVisibility(),this._updateLayer(B)}}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(l=>{const B=l._styleColorTheme.colorThemeOverride?l._styleColorTheme.colorThemeOverride:l._styleColorTheme.colorTheme;if(B){const G=l._evaluateColorThemeData(B);(!l._styleColorTheme.lut&&G!==""||l._styleColorTheme.lut&&G!==l._styleColorTheme.lut.data)&&l.setColorTheme(B)}}),this._changes.setDirty()}addLayer(t,l,B={}){this._checkLoaded();const G=t.id;if(this._layers[G])return void this.fire(new o.y(new Error(`Layer with i
274d "${G}" already exists on this map`)));let Z;if(t.type==="custom"){if(Wa(this,o.ct(t)))return;Z=o.cu(t,this.scope,this._styleColorTheme.lut,this.options)}else{if(typeof t.source=="object"&&(this.addSource(G,t.source),t=o.cp(t),t=o.l(t,{source:G})),this._validate(Oa,`layers.${G}`,t,{arrayIndex:-1},B))return;Z=o.cu(t,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(Z),Z.setEventedParent(this,{layer:{id:G}})}Z.configDependencies.size!==0&&this._configDependentLayers.add(Z.fqid);let Y=this._order.length;if(l){const he=this._order.indexOf(l);if(he===-1)return void this.fire(new o.y(new Error(`Layer with id "${l}" does not exist on this map.`)));Z.slot===this._layers[l].slot?Y=he:o.w(`Layer with id "${l}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(Y,0,G),this._layerOrderChanged=!0,this._layers[G]=Z;const re=this.getOwnLayerSourceCache(Z),oe=!!this.directionalLight&&this.directionalLight.shadowsEnabled();re&&Z.canCastShadows()&&oe&&(re.castsShadows=!0);const ce=this._changes.getRemovedLayer(Z);if(ce&&Z.source&&re&&Z.type!=="custom"){this._changes.discardLayerRemoval(Z);const he=o.aC(Z.source,Z.scope);ce.type!==Z.type?this._changes.updateSourceCache(he,"clear"):(this._changes.updateSourceCache(he,"reload"),re.pause())}this._updateLayer(Z),Z.onAdd&&Z.onAdd(this.map),Z.scope=this.scope,this.mergeLayers()}moveLayer(t,l){this._checkLoaded();const B=this._checkLayer(t);if(!B||t===l)return;const G=this._order.indexOf(t);this._order.splice(G,1);let Z=this._order.length;if(l){const Y=this._order.indexOf(l);
274if(Y===-1)return void this.fire(new o.y(new Error(`Layer with id "${l}" does not exist on this map.`)));B.slot===this._layers[l].slot?Z=Y:o.w(`Layer with id "${l}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(Z,0,t),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers()}removeLayer(t){this._checkLoaded();const l=this._checkLayer(t);if(!l)return;l.setEventedParent(null);const B=this._order.indexOf(t);this._order.splice(B,1),delete this._layers[t],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(l.fqid),this._changes.removeLayer(l);const G=this.getOwnLayerSourceCache(l);if(G&&G.castsShadows){let Z=!1;for(const Y in this._layers)if(this._layers[Y].source===l.source&&this._layers[Y].canCastShadows()){Z=!0;break}G.castsShadows=Z}l.onRemove&&l.onRemove(this.map),this.mergeLayers()}getOwnLayer(t){return this._layers[t]}hasLayer(t){return t in this._mergedLayers}hasLayerType(t){for(const l in this._layers)if(this._layers[l].type===t)return!0;return!1}setLayerZoomRange(t,l,B){this._checkLoaded();const G=this._checkLayer(t);G&&(G.minzoom===l&&G.maxzoom===B||(l!=null&&(G.minzoom=l),B!=null&&(G.maxzoom=B),this._updateLayer(G)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(t,l){this._checkLoaded();const B=this._checkLayer(t);B&&B.slot!==l&&(B.slot=l,this._updateLayer(B))}setFilter(t,l,B={}){this._checkLoaded();const G=this._checkLayer(t);if(G&&!o.bn(G.filter,l))return l==null?(G.filter=void 0,void this._updateLayer(G)):void(this._validate(ln,`layers.${G.id}.filter`,l,{layerType:G.type},B)||(G.filter=o.cp(l),this._updateLayer(G)))}getFilter(t){const l=this._checkLayer(t);if(l)return o.cp(l.filter)}setLayoutProperty(t,l,B,G={}){this._checkLoaded();const Z=this._checkLayer(t);if(Z&&!o.bn(Z.getLayoutProperty(l),B)){if(B!=null&&(!G||G.validate!==!1)&&Wa(Z,ra.call(mn,{key:`layers.${t}.layout.${l}`,layerType:Z.type,objectKey:l,value:B,styleSpec:o.a3,style:{glyphs:!0,sprite:!0}})))return;Z.setLayoutProperty(l,B),Z.configDependencies.size!==0&&this._configDependentLayers.add(Z.fqid),this._updateLayer(Z)}}getLayoutProperty(t,l){const B=this._checkLayer(t);if(B)return B.getLayoutProperty(l)}setPaintProperty(t,l,B,G={}){this._checkLoaded();const Z=this._checkLayer(t);if(!Z||o.bn(Z.getPaintProperty(l),B)||B!=null&&(!G||G.validate!==!1)&&Wa(Z,Ba.call(mn,{key:`layers.${t}.paint.${l}`,layerType:Z.type,objectKey:l,value:B,styleSpec:o.a3})))return;const Y=Z.setPaintProperty(l,B);Z.configDependencies.size!==0&&this._configDependentLayers.add(Z.fqid),Y&&this._updateLayer(Z),this._changes.updatePaintProperties(Z)}getPaintProperty(t,l){const B=this._checkLayer(t);if(B)return B.getPaintProperty(l)}setFeatureState(t,l){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:oe,importId:ce}=t.target,he=this.getFragmentStyle(ce),pe=he.getFeaturesetLayers(oe);for(const{source:fe,sourceLayer:be}of pe)he.setFeatureState({id:t.id,source:fe,sourceLayer:be},l)}else if("layerId"in t.target){const{layerId:oe}=t.target,ce=this.getLayer(oe);this.setFeatureState({id:t.id,source:ce.source,sourceLayer:ce.sourceLayer},l)}return}const B=t.source,G=t.sourceLayer,Z=this._checkSource(B);if(!Z)return;const Y=Z.type;if(Y==="geojson"&&G)return void this.fire(new o.y(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if(Y==="vector"&&!G)return void this.fire(new o.y(new Error("The sourceLayer parameter must be provided for vector source types.")));t.id===void 0&&this.fire(new o.y(new Error("The feature id parameter must be provided.")));const re=this.getOwnSourceCaches(B);for(const oe of re)oe.setFeatureState(G,t.id,l)}removeFeatureState(t,l){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:oe,importId:ce}=t.target,he=this.getFragmentStyle(ce),pe=he.getFeaturesetLayers(oe);for(const{source:fe,sourceLayer:be}of pe)he.removeFeatureState({id:t.id,source:fe,sourceLayer:be},l)}else if("layerId"in t.target){const{layerId:oe}=t.target,ce=this.getLayer(oe);this.removeFeatureState({id:t.id,source:ce.source,sourceLayer:ce.s
vendor: 19,883 bytes, line 274
274ourceLayer},l)}return}const B=t.source,G=this._checkSource(B);if(!G)return;const Z=G.type,Y=Z==="vector"?t.sourceLayer:void 0;if(Z==="vector"&&!Y)return void this.fire(new o.y(new Error("The sourceLayer parameter must be provided for vector source types.")));if(l&&typeof t.id!="string"&&typeof t.id!="number")return void this.fire(new o.y(new Error("A feature id is required to remove its specific state property.")));const re=this.getOwnSourceCaches(B);for(const oe of re)oe.removeFeatureState(Y,t.id,l)}getFeatureState(t){if(this._checkLoaded(),"target"in t){let Z;if("featuresetId"in t.target){const{featuresetId:Y,importId:re}=t.target,oe=this.getFragmentStyle(re),ce=oe.getFeaturesetLayers(Y);for(const{source:he,sourceLayer:pe}of ce){const fe=oe.getFeatureState({id:t.id,source:he,sourceLayer:pe});if(fe&&!Z)Z=fe;else if(!o.bn(Z,fe))return void this.fire(new o.y(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{layerId:Y}=t.target,re=this.getLayer(Y);Z=this.getFeatureState({id:t.id,source:re.source,sourceLayer:re.sourceLayer})}return Z}const l=t.source,B=t.sourceLayer,G=this._checkSource(l);if(G){if(G.type!=="vector"||B)return t.id===void 0&&this.fire(new o.y(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(l)[0].getFeatureState(B,t.id);this.fire(new o.y(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(t){return this.stylesheet.transition=o.l({},this.stylesheet.transition,t),this.transition=this.stylesheet.transition,this}getTransition(){return o.l({},this.stylesheet.transition)}serialize(){this._checkLoaded();const t=this.getTerrain(),l=t&&this.terrain&&this.terrain.scope===this.scope?t:this.stylesheet.terrain;return o.cv({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:l,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,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)},B=>B!==void 0)}_updateFilteredLayers(t){for(const l of Object.values(this._mergedLayers))t(l)&&this._updateLayer(l)}_updateLayer(t){this._changes.updateLayer(t);const l=this.getLayerSourceCache(t),B=o.aC(t.source,t.scope),G=this._changes.getUpdatedSourceCaches();t.source&&!G[B]&&l&&l.getSource().type!=="raster"&&(this._changes.updateSourceCache(B,"reload"),l.pause()),t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(t){const l=re=>this._mergedLayers[re].is3D(),B=this.order,G={},Z=[];for(let re=B.length-1;re>=0;re--){const oe=B[re];if(l(oe)){G[oe]=re;for(const ce of t){const he=ce[oe];if(he)for(const pe of he)Z.push(pe)}}}Z.sort((re,oe)=>oe.intersectionZ-re.intersectionZ);const Y=[];for(let re=B.length-1;re>=0;re--){const oe=B[re];if(l(oe))for(let ce=Z.length-1;ce>=0;ce--){const he=Z[ce].feature;if(he.layer&&G[he.layer.id]<re)break;Y.push(he),Z.pop()}else for(const ce of t){const he=ce[oe];if(he)for(const pe of he)Y.push(pe.feature)}}return Y}queryRenderedFeatures(t,l,B){let G;l&&!Array.isArray(l)&&l.filter&&(this._validate(ln,"queryRenderedFeatures.filter",l.filter,null,l),G=o.aZ(l.filter));const Z={},Y=he=>{if(bh.has(he.type))return;const pe=this.getOwnLayerSourceCache(he),fe=Z[pe.id]=Z[pe.id]||{sourceCache:pe,layers:{},has3DLayers:!1};he.is3D()&&(fe.has3DLayers=!0),fe.layers[he.fqid]=fe.layers[he.fqid]||{styleLayer:he,targets:[]},fe.layers[he.fqid].targets.push({filter:G})};if(l&&l.layers){if(!Array.isArray(l.layers))return this.fire(new o.y(new Error("parameters.layers must be an Array."))),[];for(const he of l.layers){const pe=this._layers[he];if(!pe)return this.fire(new o.y(new Error(`The layer '${he}' does not exist in the map's style and cannot be queried for features.`))),[];Y(pe)}}else for(const he in this._layers)Y(this._layers[he]);const re=this._queryRenderedFeatures(t,Z,B),oe=this._flattenAndSortRenderedFeatures(re),ce=[];for(const he of oe)o.cs(he.layer.id)===this.scope&&ce.push(he);return ce}queryRenderedFeatureset(t,l,B){let G;l&&!Array.isArray(l)&&l.filter&&(this._validate(ln,"queryRenderedFeatures.filter",l.filter,null,l),G=o.aZ(l.filter));const Z="mock",Y=[];if(l&&l.target)Y.push(Object.assign({},l,{targetId:Z,filter:G}));else{const he=this.getFeaturesetDescriptors();for(const pe of he)Y.push({targetId:Z,filter:G,target:pe});for(const{style:pe}of this.fragments){const fe=pe.getFeaturesetDescriptors();for(const be of fe)Y.push({targetId:Z,filter:G,target:be})}}const re=this.queryRenderedTargets(t,Y,B),oe=[],ce=new Set;for(const he of re)for(const pe of he.variants[Z])na(pe,he,ce)||oe.push(new o.cw(he,pe));return oe}queryRenderedTargets(t,l,B){const G={},Z=(re,oe,ce,he)=>{const pe=G[oe.id]=G[oe.id]||{sourceCache:oe,layers:{},has3DLayers:!1};if(pe.layers[re.fqid]=pe.layers[re.fqid]||{styleLayer:re,targets:[]},re.is3D()&&(pe.has3DLayers=!0),!he)return ce.uniqueFeatureID=!1,void pe.layers[re.fqid].targets.push(ce);pe.layers[re.fqid].targets.push(Object.assign({},ce,{namespace:he.namespace,properties:he.properties,uniqueFeatureID:he.uniqueFeatureID}))};for(const re of l)if("featuresetId"in re.target){const{featuresetId:oe,importId:ce}=re.target,he=this.getFragmentStyle(ce);if(!he||!he._featuresetSelectors)continue;const pe=he._featuresetSelectors[oe];if(!pe){this.fire(new o.y(new Error(`The featureset '${oe}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const fe of pe){const be=he.getOwnLayer(fe.layerId);be&&!bh.has(be.type)&&Z(be,he.getOwnLayerSourceCache(be),re,fe)}}else if("layerId"in re.target){const{layerId:oe}=re.target,ce=this.getLayer(oe);if(!ce||bh.has(ce.type))continue;Z(ce,this.getLayerSourceCache(ce),re)}const Y=this._queryRenderedFeatures(t,G,B);return this._flattenAndSortRenderedFeatures(Y)}_queryRenderedFeatures(t,l,B){const G=[],Z=!!this.map._showQueryGeometry,Y=Li.createFromScreenPoints(t,B);for(const re in l){const oe=Ho(Y,l[re],this._availableImages,B,Z);Object.keys(oe).length&&G.push(oe)}if(this.placement)for(const re in l){if(!l[re].sourceCache._onlySymbols)continue;const oe=eh(Y.screenGeometry,l[re],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData);Object.keys(oe).length&&G.push(oe)}return G}querySourceFeatures(t,l){const B=l&&l.filter;B&&this._validate(ln,"querySourceFeatures.filter",B,null,l);let G=[];const Z=this.getOwnSourceCaches(t);for(const Y of Z)G=G.concat(Ku(Y,l));return G}addSourceType(t,l,B){return Ms.getSourceType(t)?B(new Error(`A source type called "${t}" already exists.`)):(Ms.setSourceType(t,l),l.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:l.workerSourceURL},B):B(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(t,l,B={}){this._checkLoaded();const G=this.light.getLight();let Z=!1;for(const re in t)if(!o.bn(t[re],G[re])){Z=!0;break}if(!Z)return;const Y=this._getTransitionParameters();this.light.setLight(t,l,B),this.light.updateTransitions(Y)}getTerrain(){return this.terrain&&this.terrain.drapeRenderMode===1?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){this.disableElevatedTerrain===void 0&&(this.disableElevatedTerrain=o.q.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&o.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(t,l=1){if(this._checkLoaded(),!t)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),l===0&&delete this.terrain,t===null?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);this.checkCanvasFingerprintNoise();let B=t;const G=t.source==null;if(l===1){if(this.disableElevatedTerrain)return;if(typeof B.source=="object"){const re="terrain-dem-src";this.addSource(re,B.source),B=o.cp(B),B=o.l(B,{source:re})}const Z=o.l({},B),Y={};if(this.terrain&&G){Z.source=this.terrain.get().source;const re=this.terrain?this.getFragmentStyle(this.terrain.scope):null;re&&(Y.style=re.serialize())}if(this._validate(Ts,"terrain",Z,Y))return}if(!this.terrain||this.terrain.scope!==this.scope&&!G||this.terrain&&l!==this.terrain.drapeRenderMode){if(!B)return;this._createTerrain(B,l),this.fire(new o.z("data",{dataType:"style"}))}else{const Z=this.terrain,Y=Z.get();for(const re of Object.keys(o.a3.terrain))!B.hasOwnProperty(re)&&o.a3.terrain[re].default&&(B[re]=o.a3.terrain[re].default);for(const re in t)if(!o.bn(t[re],Y[re])){Z.set(t,this.options),this.stylesheet.terrain=t;const oe=this._getTransitionParameters({duration:0});Z.updateTransitions(oe),this.fire(new o.z("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(t){const l=this.fog=new zt(t,this.map.transform,this.scope,this.options);this.stylesheet.fog=l.get();const B=this._getTransitionParameters({duration:0});l.updateTransitions(B)}_createSnow(t){const l=this.snow=new Di(t,this.map.transform,this.scope,this.options);this.stylesheet.snow=l.get();const B=this._getTransitionParameters({duration:0});l.updateTransitions(B)}_createRain(t){const l=this.rain=new Fi(t,this.map.transform,this.scope,this.options);this.stylesheet.rain=l.get();const B=this._getTransitionParameters({duration:0});l.updateTransitions(B)}_updateMarkersOpacity(){this.map._markers.length!==0&&this.map._requestDomTask(()=>{for(const t of this.map._markers)t._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(t){if(this._checkLoaded(),!t)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const l=this.fog;if(!o.bn(l.get(),t)){l.set(t,this.options),this.stylesheet.fog=l.get();const B=this._getTransitionParameters({duration:0});l.updateTransitions(B)}}else this._createFog(t);this._markersNeedUpdate=!0}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 l=this.snow;if(!o.bn(l.get(),t)){l.set(t,this.options),this.stylesheet.snow=l.get();const B=this._getTransitionParameters({duration:0});l.updateTransitions(B)}}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 l=this.rain;if(!o.bn(l.get(),t)){l.set(t,this.options),this.stylesheet.rain=l.get();const B=this._getTransitionParameters({duration:0});l.updateTransitions(B)}}else this._createRain(t);this._markersNeedUpdate=!0}_reloadColorTheme(){const t=()=>{for(const G in this._layers)this._layers[G].lut=this._styleColorTheme.lut;for(const G in this._sourceCaches)this._sourceCaches[G].clearTiles()},l=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!l)return this._styleColorTheme.lut=null,void t();const B=this._evaluateColorThemeData(l);this._loadColorTheme(B).then(()=>{this.fire(new o.z("colorthemeset")),t()}).catch(G=>{o.w(`Couldn't set color theme: ${G}`)})}setColorTheme(t){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&o.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(t,l){const B=this.getFragmentStyle(t);B&&(B._styleColorTheme.colorThemeOverride=l,B._reloadColorTheme())}_getTransitionParameters(t){return{now:o.q.now(),transition:o.l(this.transition,t)}}updateDrapeFirstLayers(){if(!this.terrain)return;const t=[],l=[];for(const B of this._mergedOrder)this.isLayerDraped(this._mergedLayers[B])?t.push(B):l.push(B);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...t),this._drapedFirstOrder.push(...l)}_createTerrain(t,l){const B=this.terrain=new Ne(t,l,this.scope,this.options);l===1&&(this.stylesheet.terrain=t),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const G=this._getTransitionParameters({duration:0});B.updateTransitions(G)}_force3DLayerUpdate(){for(const t in this._layers){const l=this._layers[t];l.type==="fill-extrusion"&&this._updateLayer(l)}}_forceSymbolLayerUpdate(){for(const t in this._layers){const l=this._layers[t];l.type==="symbol"&&this._updateLayer(l)}}_validate(t,l,B,G,Z={}){if(Z&&Z.validate===!1)return!1;const Y=o.l({},this.serialize());return Wa(this,t.call(mn,o.l({key:l,style:Y,value:B,styleSpec:o.a3},G)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),o.cx.off("pluginStateChange",this._rtlTextPluginCallback);for(const t in this._mergedLayers)this._mergedLayers[t].setEventedParent(null);for(const t in this._mergedSourceCaches)this._mergedSourceCaches[t].clearTiles(),this._mergedSourceCaches[t].setEventedParent(null);this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.dispatcher.remove())}clearSource(t){const l=this.getSourceCaches(t);for(const B of l)B.clearTiles()}clearSources(){for(const t in this._mergedSourceCaches)this._mergedSourceCaches[t].clearTiles()}reloadSource(t){const l=this.getSourceCaches(t);for(const B of l)B.resume(),B.reload()}reloadSources(){for(const t of this.getSources())t.reload&&t.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle(t=>{t.modelManager.reloadModels(t.scope)})}updateSources(t){let l;this.directionalLight&&(l=Ha(this.directionalLight));for(const B in this._mergedSourceCaches)this._mergedSourceCaches[B].update(t,void 0,void 0,l)}_generateCollisionBoxes(){for(const t in this._sourceCaches){const l=this._sourceCaches[t];l.resume(),l.reload()}}_updatePlacement(t,l,B,G,Z,Y,re=!1){let oe=!1,ce=!1;const he={},pe={};for(const fe of this._mergedOrder){const be=this._mergedLayers[fe];if(be.type!=="symbol")continue;const ze=o.aC(be.source,be.scope);let De=he[ze];if(!De){const Fe=this.getLayerSourceCache(be);if(!Fe)continue;const Ge=Fe.getRenderableIds(!0).map(Xe=>Fe.getTileByID(Xe));pe[ze]=Ge.slice(),De=he[ze]=Ge.sort((Xe,Ze)=>Ze.tileID.overscaledZ-Xe.tileID.overscaledZ||(Xe.tileID.isLessThan(Ze.tileID)?-1:1))}const Oe=this.crossTileSymbolIndex.addLayer(be,De,l.center.lng,l.projection);oe=oe||Oe}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),re=re||this._layerOrderChanged||G===0,this._layerOrderChanged&&this.fire(new o.z("neworder")),(re||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.q.now(),l.zoom))&&(this.pauseablePlacement=new Fp(l,this._mergedOrder,re,B,G,Z,this.placement,this.fog&&l.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,he,pe,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.q.now()),ce=!0),oe&&this.pauseablePlacement.placement.setStale()),ce||oe){this._buildingIndex.onNewFrame(l.zoom);for(let fe=0;fe<this._mergedOrder.length;fe++){const be=this._mergedLayers[this._mergedOrder[fe]];if(be.type!=="symbol")continue;const ze=this.isLayerClipped(be);this.placement.updateLayerOpacities(be,he[o.aC(be.source,be.scope)],fe,ze?Y:null)}}return{needsRerender:!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.q.now())}}_releaseSymbolFadeTiles(){for(const t in this._sourceCaches)this._sourceCaches[t].releaseSymbolFadeTiles()}addImport(t,l){this._checkLoaded();const B=this.stylesheet.imports=this.stylesheet.imports||[];if(B.findIndex(({id:Z})=>Z===t.id)!==-1)return void this.fire(new o.y(new Error(`Import with id '${t.id}' already exists in the map's style.`)));if(!l)return B.push(t),this._loadImports([t],!0);const G=B.findIndex(({id:Z})=>Z===l);return G===-1&&this.fire(new o.y(new Error(`Import with id "${l}" does not exist on this map.`))),this.stylesheet.imports=B.slice(0,G).concat(t).concat(B.slice(G)),this._loadImports([t],!0,l)}updateImport(t,l){this._checkLoaded();const B=this.stylesheet.imports||[],G=this.getImportIndex(t);return G===-1?this:typeof l=="string"?(this.setImportUrl(t,l),this):(l.url&&l.url!==B[G].url&&this.setImportUrl(t,l.url),o.bn(l.config,B[G].config)||this.setImportConfig(t,l.config,l.data.schema),o.bn(l.data,B[G].data)||this.setImportData(t,l.data),this)}moveImport(t,l){this._checkLoaded();let B=this.stylesheet.imports||[];const G=this.getImportIndex(t);if(G===-1)return this;const Z=this.getImportIndex(l);if(Z===-1)return this;const Y=B[G],re=this.fragments[G];return B=B.filter(({id:oe})=>oe!==t),this.fragments=this.fragments.filter(({id:oe})=>oe!==t),this.stylesheet.imports=B.slice(0,Z).concat(Y).concat(B.slice(Z)),this.fragments=this.fragments.slice(0,Z).concat(re).concat(this.fragments.slice(Z)),this.mergeLayers(),this}setImportUrl(t,l){this._checkLoaded();const B=this.stylesheet.imports||[],G=this.getImportIndex(t);if(G===-1)return this;B[G].url=l;const Z=this.fragments[G];return Z.style=this._createFragmentStyle(B[G]),Z.style.on("style.import.load",()=>this.mergeAll()),Z.style.loadURL(l),this}setImportData(t,l){this._checkLoaded();const B=this.getImportIndex(t),G=this.stylesheet.imports||[];return B===-1?this:l?(this.fragments[B].style.setState(l),this._reloadImports(),this):(delete G[B].data,this.setImportUrl(t,G[B].url))}setImportConfig(t,l,B){this._checkLoaded();const G=this.getImportIndex(t),Z=this.stylesheet.imports||[];if(G===-1)return this;l?Z[G].config=l:delete Z[G].config;const Y=this.fragments[G];B&&Y.style.stylesheet&&(Y.style.stylesheet.schema=B);const re=Y.style.stylesheet&&Y.style.stylesheet.schema;return Y.config=l,Y.style.updateConfig(l,re),this.updateConfigDependencies(),this}removeImport(t){this._checkLoaded();const l=this.stylesheet.imports||[],B=this.getImportIndex(t);B!==-1&&(l.splice(B,1),this.fragments[B].style._remove(),this.fragments.splice(B,1),this._reloadImports())}getImportIndex(t){const l=(this.stylesheet.imports||[]).findIndex(B=>B.id===t);return l===-1&&this.fire(new o.y(new Error(`Import '${t}' does not exist in the map's style and cannot be updated.`))),l}getLayer(t){return this._mergedLayers[t]}getSources(){const t=[];for(const l in this._mergedOtherSourceCaches){const B=this._mergedOtherSourceCaches[l];B&&t.push(B.getSource())}return t}getSource(t,l){const B=this.getSourceCache(t,l);return B&&B.getSource()}getLayerSource(t){const l=this.getLayerSourceCache(t);return l&&l.getSource()}getSourceCache(t,l){const B=o.aC(t,l);return this._mergedOtherSourceCaches[B]}getLayerSourceCache(t){const l=o.aC(t.source,t.scope);return t.type==="symbol"?this._mergedSymbolSourceCaches[l]:this._mergedOtherSourceCaches[l]}getSourceCaches(t){if(t==null)return Object.values(this._mergedSourceCaches);const l=[];return this._mergedOtherSourceCaches[t]&&l.push(this._mergedOtherSourceCaches[t]),this._mergedSymbolSourceCaches[t]&&l.push(this._mergedSymbolSourceCaches[t]),l}
274updateSourceCaches(){const t=this._changes.getUpdatedSourceCaches();for(const l in t){const B=t[l];B==="reload"?this.reloadSource(l):B==="clear"&&this.clearSource(l)}}updateLayers(t){const l=this._changes.getUpdatedPaintProperties();for(const B of l){const G=this.getLayer(B);G&&G.updateTransitions(t)}}getImages(t,l,B){this.imageManager.getImages(l.icons,l.scope,B),this._updateTilesForChangedImages();const G=Z=>{Z&&Z.setDependencies(l.tileID.key,l.type,l.icons)};G(this._otherSourceCaches[l.source]),G(this._symbolSourceCaches[l.source])}rasterizeImages(t,l,B){this.imageManager.rasterizeImages(l,B)}getGlyphs(t,l,B){this.glyphManager.getGlyphs(l.stacks,l.scope,B)}getResource(t,l,B){return o.cy(l,B)}getOwnSourceCache(t){return this._otherSourceCaches[t]}getOwnLayerSourceCache(t){return t.type==="symbol"?this._symbolSourceCaches[t.source]:this._otherSourceCaches[t.source]}getOwnSourceCaches(t){const l=[];return this._otherSourceCaches[t]&&l.push(this._otherSourceCaches[t]),this._symbolSourceCaches[t]&&l.push(this._symbolSourceCaches[t]),l}_isSourceCacheLoaded(t){const l=this.getOwnSourceCaches(t);return l.length===0?(this.fire(new o.y(new Error(`There is no source with ID '${t}'`))),!1):l.every(B=>B.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(t,l){if(!this._clipLayerPresent&&t.type!=="fill-extrusion")return!1;const B=t.type==="fill-extrusion"&&t.sourceLayer==="building";if(t.is3D()){if(B||l&&l.type==="batched-model"||t.type==="model")return!0}else if(t.type==="symbol")return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.fragments.forEach(t=>{t.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}Ms.getSourceType=function(F){return Pn[F]},Ms.setSourceType=function(F,t){Pn[F]=t},Ms.registerForPluginStateChange=o.ch;var nc=`
275#define EPSILON 0.0000001
276#define PI 3.141592653589793
277#ifdef RENDER_CUTOFF
278float 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);}
279#endif`,sl=`
280out vec4 glFragColor;highp float unpack_depth(highp vec4 rgba_depth)
281{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;}
282#ifdef INDICATOR_CUTOUT
283uniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;
284#endif
285vec4 applyCutout(vec4 color,float height) {
286#ifdef INDICATOR_CUTOUT
287float verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);
288#else
289return color;
290#endif
291}
292#ifdef DEBUG_WIREFRAME
293#define HANDLE_WIREFRAME_DEBUG \\
294glFragColor=vec4(0.7,0.0,0.0,0.7); \\
295gl_FragDepth=gl_FragCoord.z-0.0001;
296#else
297#define HANDLE_WIREFRAME_DEBUG
298#endif
299#ifdef RENDER_CUTOFF
300uniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;
301#endif
302vec4 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 applyLUT(highp sampler3D lut,vec4 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return vec4(texture(lut,uvw).rgb,col.a);}vec3 applyLUT(highp sampler3D lut,vec3 col) {return applyLUT(lut,vec4(col,1.0)).rgb;}`,sc=`
303#define EXTENT 8192.0
304#define RAD_TO_DEG 180.0/PI
305#define DEG_TO_RAD PI/180.0
306#define GLOBE_RADIUS EXTENT/PI/2.0
307float wrap(float n,float min,float max) {float d=max-min;
307float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}
308#ifdef PROJECTION_GLOBE_VIEW
309vec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {
310#ifndef PROJECTED_POS_ON_VIEWPORT
311float 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;
312#else
313return vec3(0.0);
314#endif
315}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);}
316#endif
317vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(
318unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
319);}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);}
320#ifdef RENDER_CUTOFF
321uniform vec4 u_cutoff_params;out float v_cutoff_opacity;
322#endif
323const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)
324{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}`,Ea="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",ac=`
325#define ELEVATION_SCALE 7.0
326#define ELEVATION_OFFSET 450.0
327#ifdef PROJECTION_GLOBE_VIEW
328uniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(
329mix(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;}
330#else
331vec3 elevationVector(vec2 pos) { return vec3(0,0,1); }
332#endif
333#ifdef TERRAIN
334uniform 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) {
335#ifdef TERRAIN_DEM_FLOAT_FORMAT
336vec2 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;
337#else
338float 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);
339#endif
340}float prevElevation(vec2 apos) {
341#ifdef TERRAIN_DEM_FLOAT_FORMAT
342vec2 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;
343#else
344float 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);
345#endif
346}
347#ifdef TERRAIN_VERTEX_MORPHING
348float elevation(vec2 apos) {
349#ifdef ZERO_EXAGGERATION
350return 0.0;
351#endif
352float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}
353#else
354float elevation(vec2 apos) {
355#ifdef ZERO_EXAGGERATION
356return 0.0;
357#endif
358return currentElevation(apos);}
359#endif
360vec4 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);}
361#else
362float elevation(vec2 pos) { return 0.0; }
363#endif
364#ifdef DEPTH_OCCLUSION
365uniform 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;
366#ifdef DEPTH_D24
367float 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);}
368#else
369highp float unpack_depth_rgba(vec4 rgba_depth)
370{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;}
371#endif
372bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;
373#ifdef DEPTH_D24
374float depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);
375#else
376float depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));
377#endif
378return coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_
378size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;
379#ifdef DEPTH_D24
380highp vec4 depth=vec4(
381texture(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
382);depth=unpack_depth4(depth);
383#else
384highp vec4 depth=vec4(
385unpack_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))
386);
387#endif
388return 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) {
389#ifdef DEPTH_D24
390highp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);
391#else
392highp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));
393#endif
394res+=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));}
395#else
396bool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }
397#endif//DEPTH_OCCLUSION`,wh=`#ifdef FOG
398uniform 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);}
399#endif`,Za=`#ifdef FOG
400uniform 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;highp vec3 ray_dir=mix(
401mix(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;}
401vec3 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);}
402#endif`,fo=`#ifdef RASTER_ARRAY
403uniform 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);}vec2 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)
404);}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)
405);}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);}
406#endif`,al=`#ifdef RASTER_ARRAY
407uniform 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;ivec4 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;}
408#endif
409uniform 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;}`,ol=`#ifdef RENDER_SHADOWS
410uniform 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];}
411#endif//RENDER_SHADOWS`,Xa=`#ifdef RENDER_SHADOWS
412#ifdef DEPTH_TEXTURE
413uniform highp sampler2D u_shadowmap_0;uniform highp sampler2D u_shadowmap_1;
414#else
415uniform sampler2D u_shadowmap_0;uniform sampler2D u_shadowmap_1;
416#endif
417uniform 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 float shadow_sample_1(highp vec2 uv,highp float compare) {highp float shadow_depth;
418#ifdef DEPTH_TEXTURE
419shadow_depth=texture(u_shadowmap_1,uv).r;
420#else
421shadow_depth=unpack_depth(texture(u_shadowmap_1,uv))*0.5+0.5;
422#endif
423return step(shadow_depth,compare);}highp float shadow_sample_0(highp vec2 uv,highp float compare) {highp float shadow_depth;
424#ifdef DEPTH_TEXTURE
425shadow_depth=texture(u_shadowmap_0,uv).r;
426#else
427shadow_depth=unpack_depth(texture(u_shadowmap_0,uv))*0.5+0.5;
428#endif
429return step(shadow_depth,compare);}float shadow_occlusion_1(highp vec4 pos,highp float bias) {highp vec2 uv=pos.xy;return shadow_sample_1(uv,pos.z-bias);}float shadow_occlusion_0(highp vec4 pos,highp float bias) {highp float compare0=pos.z-bias;
430#ifdef TEXTURE_GATHER
431highp vec2 uv=pos.xy;highp vec4 samples=textureGather(u_shadowmap_0,uv,0);lowp vec4 stepSamples=step(samples,vec4(compare0));
432#else
433highp vec2 uv00=pos.xy-vec2(0.5*u_shadow_texel_size);highp vec2 uv10=uv00+vec2(u_shadow_texel_size,0.0);highp vec2 uv01=uv00+vec2(0.0,u_shadow_texel_size);highp vec2 uv11=uv01+vec2(u_shadow_texel_size,0.0);lowp vec4 stepSamples=vec4(
434shadow_sample_0(uv01,compare0),shadow_sample_0(uv11,compare0),shadow_sample_0(uv10,compare0),shadow_sample_0(uv00,compare0)
435);
436#endif
437vec2 f=fract(pos.xy*u_shadow_map_resolution-vec2(0.5));lowp vec2 lerpx=mix(stepSamples.wx,stepSamples.zy,f.xx);return mix(lerpx.x,lerpx.y,f.y);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {
438#ifdef SHADOWS_SINGLE_CASCADE
439light_view_pos0.xyz/=light_view_pos0.w;vec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);
440#else
441light_view_pos0.xyz/=light_view_pos0.w;light_view_pos1.xyz/=light_view_pos1.w;vec4 uv=vec4(light_view_pos0.xy,light_view_pos1.xy);vec4 abs_bounds=abs(uv);if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}light_view_pos1.xyz=light_view_pos1.xyz*0.5+0.5;float occlusion1=shadow_occlusion_1(light_view_pos1,bias);return mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth));
442#endif
443}highp float calculate_shadow_bias(float NDotL) {
444#ifdef NORMAL_OFFSET
445return 0.5*u_shadow_bias.x;
446#else
447return 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));
448#endif
449}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)
450{highp vec2 biasUV=vec2(
451pos_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=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;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);}
452#endif`;const Ya=[];Ja(nc,Ya),Ja(sc,Ya),Ja(sl,Ya);const mo={"_prelude_fog.vertex.glsl":wh,"_prelude_terrain.vertex.glsl":ac,"_prelude_shadow.vertex.glsl":ol,"_prelude_fog.fragment.glsl":Za,"_prelude_shadow.fragment.glsl":Xa,"_prelude_lighting.glsl":`
453#ifdef LIGHTING_3D_MODE
454uniform 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
454));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);}
455#endif//LIGHTING_3D_MODE`,"_prelude_raster_array.glsl":fo,"_prelude_raster_particle.glsl":al},ll={};hr("",ac),hr(Za,wh),hr(Xa,ol),hr(fo,""),hr(al,"");const oc=hr(sl,sc),cl=nc;var go={background:hr(`#include "_prelude_fog.fragment.glsl"
456#include "_prelude_lighting.glsl"
457uniform vec4 u_color;uniform float u_opacity;
458#ifdef LIGHTING_3D_MODE
459in vec4 v_color;
460#endif
461void main() {vec4 out_color;
462#ifdef LIGHTING_3D_MODE
463out_color=v_color;
464#else
465out_color=u_color;
466#endif
467#ifdef FOG
468out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
469#endif
470glFragColor=out_color*u_opacity;
471#ifdef OVERDRAW_INSPECTOR
472glFragColor=vec4(1.0);
473#endif
474HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
475#include "_prelude_lighting.glsl"
476in vec2 a_pos;uniform mat4 u_matrix;
477#ifdef LIGHTING_3D_MODE
478uniform mediump vec4 u_color;out vec4 v_color;uniform float u_emissive_strength;
479#endif
480void main() {gl_Position=u_matrix*vec4(a_pos,0,1);
481#ifdef LIGHTING_3D_MODE
482v_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);
483#endif
484#ifdef FOG
485v_fog_pos=fog_position(a_pos);
486#endif
487}`),backgroundPattern:hr(`#include "_prelude_fog.fragment.glsl"
488#include "_prelude_lighting.glsl"
489uniform 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);
490#ifdef LIGHTING_3D_MODE
491out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);
492#endif
493#ifdef FOG
494out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
495#endif
496glFragColor=out_color*u_opacity;
497#ifdef OVERDRAW_INSPECTOR
498glFragColor=vec4(1.0);
499#endif
500HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
501uniform 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 vec2 a_pos;out highp vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,a_pos);
502#ifdef FOG
503v_fog_pos=fog_position(a_pos);
504#endif
505}`),circle:hr(`#include "_prelude_fog.fragment.glsl"
506#include "_prelude_lighting.glsl"
507in vec3 v_data;in float v_visibility;
508#pragma mapbox: define highp vec4 color
509#pragma mapbox: define mediump float radius
510#pragma mapbox: define lowp float blur
511#pragma mapbox: define lowp float opacity
512#pragma mapbox: define highp vec4 stroke_color
513#pragma mapbox: define mediump float stroke_width
514#pragma mapbox: define lowp float stroke_opacity
515uniform float u_emissive_strength;void main() {
516#pragma mapbox: initialize highp vec4 color
517#pragma mapbox: initialize mediump float radius
518#pragma mapbox: initialize lowp float blur
519#pragma mapbox: initialize lowp float opacity
520#pragma mapbox: initialize highp vec4 stroke_color
521#pragma mapbox: initialize mediump float stroke_width
522#pragma mapbox: initialize lowp float stroke_opacity
523vec2 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);
523float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? 
524smoothstep(0.0,-antialiased_blur,1.0-extrude_length) : 
525smoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(
526antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)
527);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);
528#ifdef LIGHTING_3D_MODE
529out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);
530#endif
531#ifdef FOG
532out_color=fog_apply_premultiplied(out_color,v_fog_pos);
533#endif
534glFragColor=out_color*(v_visibility*opacity_t);
535#ifdef OVERDRAW_INSPECTOR
536glFragColor=vec4(1.0);
537#endif
538}`,`#include "_prelude_fog.vertex.glsl"
539#include "_prelude_terrain.vertex.glsl"
540#define NUM_VISIBILITY_RINGS 2
541#define INV_SQRT2 0.70710678
542#define ELEVATION_BIAS 0.0001
543#define NUM_SAMPLES_PER_RING 16
544uniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos;
545#ifdef PROJECTION_GLOBE_VIEW
546in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;
547#endif
548#ifdef ELEVATED_ROADS
549in float a_circle_z_offset;
550#endif
551out vec3 v_data;out float v_visibility;
552#pragma mapbox: define highp vec4 color
553#pragma mapbox: define mediump float radius
554#pragma mapbox: define lowp float blur
555#pragma mapbox: define lowp float opacity
556#pragma mapbox: define highp vec4 stroke_color
557#pragma mapbox: define mediump float stroke_width
558#pragma mapbox: define lowp float stroke_opacity
559vec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {
560#if defined(TERRAIN)
561return elevation(pos)+ELEVATION_BIAS;
562#else
563return 0.0;
564#endif
565}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);
566#ifdef PITCH_WITH_MAP
567#ifdef PROJECTION_GLOBE_VIEW
568return u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );
569#else
570return u_matrix*( world_center+vec4(sample_offset,0,0) );
571#endif
572#else
573return projected_center+vec4(sample_offset,0,0);
574#endif
575}float get_sample_step() {
576#ifdef PITCH_WITH_MAP
577return 2.0*PI/float(NUM_SAMPLES_PER_RING);
578#else
579return PI/float(NUM_SAMPLES_PER_RING);
580#endif
581}void main(void) {
582#pragma mapbox: initialize highp vec4 color
583#pragma mapbox: initialize mediump float radius
584#pragma mapbox: initialize lowp float blur
585#pragma mapbox: initialize lowp float opacity
586#pragma mapbox: initialize highp vec4 stroke_color
587#pragma mapbox: initialize mediump float stroke_width
588#pragma mapbox: initialize lowp float stroke_opacity
589vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;
590#ifdef PROJECTION_GLOBE_VIEW
591vec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);
592#else 
593surface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);
594#endif
595#ifdef ELEVATED_ROADS
596world_center.z+=a_circle_z_offset+ELEVATION_BIAS;
597#endif
598vec4 projected_center=u_matrix*world_center;float view_scale=0.0;
599#ifdef PITCH_WITH_MAP
600#ifdef SCALE_WITH_MAP
601view_scale=1.0;
602#else
603view_scale=projected_center.w/u_camera_to_center_distance;
604#endif
605#else
606#ifdef SCALE_WITH_MAP
607view_scale=u_camera_to_center_distance;
608#else
609view_scale=projected_center.w;
610#endif
611#endif
612gl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;
613#ifdef TERRAIN
614float step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;
615#ifdef PITCH_WITH_MAP
616float 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;
617#else
618occlusion_world_center=world_center;occlusion_projected_center=projected_center;
619#endif
620for(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);
621#else
622visibility=1.0;
623#endif
624#ifdef PROJECTION_GLOBE_VIEW
625visibility=1.0;
626#endif
627v_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);
628#ifdef FOG
629v_fog_pos=fog_position(world_center.xyz);
630#endif
631}`),clippingMask:hr("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:hr(`#include "_prelude_fog.fragment.glsl"
632uniform highp float u_intensity;in vec2 v_extrude;
633#pragma mapbox: define highp float weight
634#define GAUSS_COEF 0.3989422804014327
635void main() {
636#pragma mapbox: initialize highp float weight
637float 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);
638#ifdef FOG
639if (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}
640#endif
641#ifdef OVERDRAW_INSPECTOR
642glFragColor=vec4(1.0);
643#endif
644HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_terrain.vertex.glsl"
645#include "_prelude_fog.vertex.glsl"
646uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos;
647#ifdef PROJECTION_GLOBE_VIEW
648in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;
649#endif
650out vec2 v_extrude;
651#pragma mapbox: define highp float weight
652#pragma mapbox: define mediump float radius
653const highp float ZERO=1.0/255.0/16.0;
654#define GAUSS_COEF 0.3989422804014327
655void main(void) {
656#pragma mapbox: initialize highp float weight
657#pragma mapbox: initialize mediump float radius
658vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;
659#ifdef PROJECTION_GLOBE_VIEW
660vec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
661#else
662pos=vec3(tilePos+extrude,elevation(tilePos));
663#endif
664gl_Position=u_matrix*vec4(pos,1);
665#ifdef FOG
666v_fog_pos=fog_position(pos);
667#endif
668}`),heatmapTexture:hr(`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;
669#ifdef OVERDRAW_INSPECTOR
670glFragColor=vec4(0.0);
671#endif
672HANDLE_WIREFRAME_DEBUG;}`,"in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:hr("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"
673in vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 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;out float v_placed;out float v_notUsed;void main() {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(a_anchor_pos));vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*(feature_elevation+terrain_elevation),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(
6740.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}`),collisionCircle:hr("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 vec2 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;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(
675mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(
6760.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}`),debug:hr("uniform highp vec4 u_color;uniform sampler2D u_overlay;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"
677in vec2 a_pos;
678#ifdef PROJECTION_GLOBE_VIEW
679in vec3 a_pos_3;
680#endif
681out vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;
682#ifdef PROJECTION_GLOBE_VIEW
683gl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);
684#else
685gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);
686#endif
687}`),fill:hr(`#include "_prelude_fog.fragment.glsl"
688#include "_prelude_lighting.glsl"
689#include "_prelude_shadow.fragment.glsl"
690#pragma mapbox: define highp vec4 color
691#pragma mapbox: define lowp float opacity
692uniform float u_emissive_strength;
693#ifdef RENDER_SHADOWS
694uniform 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;
695#endif
696#ifdef INDICATOR_CUTOUT
697in highp float v_z_offset;
698#endif
699void main() {
700#pragma mapbox: initialize highp vec4 color
701#pragma mapbox: initialize lowp float opacity
702vec4 out_color=color;
703#ifdef LIGHTING_3D_MODE
704out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);
705#ifdef RENDER_SHADOWS
706float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);
707#endif
708#endif
709#ifdef FOG
710out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
711#endif
712out_color*=opacity;
713#ifdef INDICATOR_CUTOUT
714if (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);}
715#endif
716glFragColor=out_color;
717#ifdef OVERDRAW_INSPECTOR
718glFragColor=vec4(1.0);
719#endif
720HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
721#include "_prelude_shadow.vertex.glsl"
722in vec2 a_pos;
723#ifdef ELEVATED_ROADS
724in float a_road_z_offset;
725#endif
726#ifdef RENDER_SHADOWS
727uniform 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;
728#endif
729#ifdef INDICATOR_CUTOUT
730out highp float v_z_offset;
731#endif
732uniform mat4 u_matrix;
733#pragma mapbox: define highp vec4 color
734#pragma mapbox: define lowp float opacity
735#pragma mapbox: define highp float z_offset
736void main() {
737#pragma mapbox: initialize highp vec4 color
738#pragma mapbox: initialize lowp float opacity
739#pragma mapbox: initialize highp float z_offset
740#ifdef ELEVATED_ROADS
741z_offset+=a_road_z_offset;
742#endif
743float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);
744#ifdef RENDER_SHADOWS
745vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);
746#ifdef NORMAL_OFFSET
747vec3 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();
748#endif
749v_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;
750#endif
751#ifdef FOG
752v_fog_pos=fog_position(a_pos);
753#endif
754#ifdef INDICATOR_CUTOUT
755v_z_offset=z_offset;
756#endif
757}`),fillOutline:hr(`#include "_prelude_fog.fragment.glsl"
758#include "_prelude_lighting.glsl"
759#include "_prelude_shadow.fragment.glsl"
760in highp vec2 v_pos;uniform float u_emissive_strength;
761#ifdef RENDER_SHADOWS
762uniform 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;
763#endif
764#pragma mapbox: define highp vec4 outline_color
765#pragma mapbox: define lowp float opacity
766void main() {
767#pragma mapbox: initialize highp vec4 outline_color
768#pragma mapbox: initialize lowp float opacity
769float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;
770#ifdef LIGHTING_3D_MODE
771out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);
772#ifdef RENDER_SHADOWS
773float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);
774#endif
775#endif
776#ifdef FOG
777out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
778#endif
779glFragColor=out_color*(alpha*opacity);
780#ifdef OVERDRAW_INSPECTOR
781glFragColor=vec4(1.0);
782#endif
783HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
784#include "_prelude_shadow.vertex.glsl"
785in vec2 a_pos;
786#ifdef ELEVATED_ROADS
787in float a_road_z_offset;
788#endif
789#ifdef RENDER_SHADOWS
790uniform 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;
791#endif
792uniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos;
793#pragma mapbox: define highp vec4 outline_color
794#pragma mapbox: define lowp float opacity
795#pragma mapbox: define highp float z_offset
796void main() {
797#pragma mapbox: initialize highp vec4 outline_color
798#pragma mapbox: initialize lowp float opacity
799#pragma mapbox: initialize highp float z_offset
800#ifdef ELEVATED_ROADS
801z_offset+=a_road_z_offset;
802#endif
803float 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;
804#ifdef RENDER_SHADOWS
805vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);
806#ifdef NORMAL_OFFSET
807vec3 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();
808#endif
809v_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;
810#endif
811#ifdef FOG
812v_fog_pos=fog_position(a_pos);
813#endif
814}`),fillOutlinePattern:hr(`#include "_prelude_fog.fragment.glsl"
815#include "_prelude_lighting.glsl"
816#include "_prelude_shadow.fragment.glsl"
817uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_emissive_strength;
818#ifdef RENDER_SHADOWS
819uniform 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;
820#endif
821in highp vec2 v_pos;in highp vec2 v_pos_world;
822#pragma mapbox: define lowp float opacity
823#pragma mapbox: define lowp vec4 pattern
824void main() {
825#pragma mapbox: initialize lowp float opacity
826#pragma mapbox: initialize mediump vec4 pattern
827vec2 pattern_tl=pattern.xy;vec2 pattern_br=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);
828#ifdef LIGHTING_3D_MODE
829out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);
830#ifdef RENDER_SHADOWS
831float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);
832#endif
833#endif
834#ifdef FOG
835out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
836#endif
837glFragColor=out_color*(alpha*opacity);
838#ifdef OVERDRAW_INSPECTOR
839glFragColor=vec4(1.0);
840#endif
841HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
842#include "_prelude_shadow.vertex.glsl"
843uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;
844#ifdef ELEVATED_ROADS
845in float a_road_z_offset;
846#endif
847#ifdef RENDER_SHADOWS
848uniform 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;
849#endif
850out highp vec2 v_pos;out highp vec2 v_pos_world;
851#pragma mapbox: define lowp float opacity
852#pragma mapbox: define lowp vec4 pattern
853#pragma mapbox: define lowp float pixel_ratio
854#pragma mapbox: define highp float z_offset
855void main() {
856#pragma mapbox: initialize lowp float opacity
857#pragma mapbox: initialize mediump vec4 pattern
858#pragma mapbox: initialize lowp float pixel_ratio
859#pragma mapbox: initialize highp float z_offset
860vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;
861#ifdef ELEVATED_ROADS
862z_offset+=a_road_z_offset;
863#endif
864float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_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,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
865#ifdef RENDER_SHADOWS
866vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);
867#ifdef NORMAL_OFFSET
868vec3 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();
869#endif
870v_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;
871#endif
872#ifdef FOG
873v_fog_pos=fog_position(a_pos);
874#endif
875}`),fillPattern:hr(`#include "_prelude_fog.fragment.glsl"
876#include "_prelude_lighting.glsl"
877#include "_prelude_shadow.fragment.glsl"
878uniform vec2 u_texsize;uniform sampler2D u_image;in highp vec2 v_pos;uniform float u_emissive_strength;
879#ifdef RENDER_SHADOWS
880uniform 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;
881#endif
882#pragma mapbox: define lowp float opacity
883#pragma mapbox: define lowp vec4 pattern
884void main() {
885#pragma mapbox: initialize lowp float opacity
886#pragma mapbox: initialize mediump vec4 pattern
887vec2 pattern_tl=pattern.xy;vec2 pattern_br=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);
888#ifdef LIGHTING_3D_MODE
889out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);
890#ifdef RENDER_SHADOWS
891float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);
892#endif
893#endif
894#ifdef FOG
895out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
896#endif
897glFragColor=out_color*opacity;
898#ifdef OVERDRAW_INSPECTOR
899glFragColor=vec4(1.0);
900#endif
901HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
902#include "_prelude_shadow.vertex.glsl"
903uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;
904#ifdef ELEVATED_ROADS
905in float a_road_z_offset;
906#endif
907#ifdef RENDER_SHADOWS
908uniform 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;
909#endif
910out highp vec2 v_pos;
911#pragma mapbox: define lowp float opacity
912#pragma mapbox: define lowp vec4 pattern
913#pragma mapbox: define lowp float pixel_ratio
914#pragma mapbox: define highp float z_offset
915void main() {
916#pragma mapbox: initialize lowp float opacity
917#pragma mapbox: initialize mediump vec4 pattern
918#pragma mapbox: initialize lowp float pixel_ratio
919#pragma mapbox: initialize highp float z_offset
920vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;
921#ifdef ELEVATED_ROADS
922z_offset+=a_road_z_offset;
923#endif
924float hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_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,a_pos);
925#ifdef RENDER_SHADOWS
926vec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);
927#ifdef NORMAL_OFFSET
928vec3 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();
929#endif
930v_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;
931#endif
932#ifdef FOG
933v_fog_pos=fog_position(a_pos);
934#endif
935}`),fillExtrusion:hr(`#include "_prelude_fog.fragment.glsl"
936#include "_prelude_shadow.fragment.glsl"
937#include "_prelude_lighting.glsl"
938in vec4 v_color;in vec4 v_flat;
939#ifdef RENDER_SHADOWS
940in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;
941#endif
942uniform lowp float u_opacity;
943#ifdef FAUX_AO
944uniform lowp vec2 u_ao;in vec2 v_ao;
945#endif
946#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)
947in vec4 v_roof_color;
948#endif
949#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)
950in highp vec3 v_normal;
951#endif
952uniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;
953#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)
954in float v_flood_radius;in float v_has_floodlight;
955#endif
956in float v_height;
957#pragma mapbox: define highp float emissive_strength
958void main() {
959#pragma mapbox: initialize highp float emissive_strength
960#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)
961vec3 normal=normalize(v_normal);
962#endif
963float z;vec4 color=v_color;
964#ifdef ZERO_ROOF_RADIUS
965z=float(normal.z > 0.00001);
966#ifdef LIGHTING_3D_MODE
967normal=mix(normal,vec3(0.0,0.0,1.0),z);
968#else
969color=mix(v_color,v_roof_color,z);
970#endif
971#endif
972float h=max(0.0,v_height);float ao_shade=1.0;
973#ifdef FAUX_AO
974float 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;
975#ifdef ZERO_ROOF_RADIUS
976concave*=(1.0-z);
977#endif
978float 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);
979#ifdef LIGHTING_3D_MODE
980#ifdef FLOOD_LIGHT
981color.rgb*=mix(ao_shade,1.0,v_has_floodlight);
982#else
983color.rgb*=ao_shade;
984#endif
985#else
986color.rgb*=ao_shade;
987#endif
988#endif
989#ifdef LIGHTING_3D_MODE
990float flood_radiance=0.0;
991#ifdef FLOOD_LIGHT
992flood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;
993#endif
994#ifdef RENDER_SHADOWS
995#ifdef FLOOD_LIGHT
996float 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);
997#else
998float shadowed_lighting_factor;
999#ifdef RENDER_CUTOFF
1000shadowed_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;}
1001#else
1002shadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);
1003#endif
1004color.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);
1005#endif
1006#else
1007color.rgb=apply_lighting(color.rgb,normal);
1008#ifdef FLOOD_LIGHT
1009color.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);
1010#endif
1011#endif
1012color.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity;
1013#endif
1014#ifdef FOG
1015color=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));
1016#endif
1017#ifdef INDICATOR_CUTOUT
1018color=applyCutout(color,h);
1019#endif
1020glFragColor=color;
1021#ifdef OVERDRAW_INSPECTOR
1022glFragColor=vec4(1.0);
1023#endif
1024HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
1025#include "_prelude_terrain.vertex.glsl"
1026#include "_prelude_shadow.vertex.glsl"
1027#include "_prelude_lighting.glsl"
1028uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_width_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;
1029#ifdef RENDER_WALL_MODE
1030in vec3 a_join_normal_inside;
1031#endif
1032#ifdef PROJECTION_GLOBE_VIEW
1033in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;
1034#endif
1035#ifdef TERRAIN
1036uniform int u_height_type;uniform int u_base_type;
1037#endif
1038uniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat;
1039#ifdef RENDER_SHADOWS
1040uniform 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;
1041#endif
1042#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)
1043out vec4 v_roof_color;
1044#endif
1045#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)
1046out highp vec3 v_normal;
1047#endif
1048#ifdef FAUX_AO
1049uniform lowp vec2 u_ao;out vec2 v_ao;
1050#endif
1051#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)
1052out float v_flood_radius;out float v_has_floodlight;
1053#endif
1054out float v_height;vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}
1055#pragma mapbox: define highp float base
1056#pragma mapbox: define highp float height
1057#pragma mapbox: define highp vec4 color
1058#pragma mapbox: define highp float flood_light_wall_radius
1059#pragma mapbox: define highp float line_width
1060#pragma mapbox: define highp float emissive_strength
1061void main() {
1062#pragma mapbox: initialize highp float base
1063#pragma mapbox: initialize highp float height
1064#pragma mapbox: initialize highp vec4 color
1065#pragma mapbox: initialize highp float flood_light_wall_radius
1066#pragma mapbox: initialize highp float line_width
1067#pragma mapbox: initialize highp float emissive_strength
1068base*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));
1069#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)
1070v_normal=normal;
1071#endif
1072base=max(0.0,base);float attr_height=height;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);
1073#if defined(HAS_CENTROID) || defined(TERRAIN)
1074centroid_pos=a_centroid_pos;
1075#endif
1076float ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;
1077#ifdef TERRAIN
1078bool 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);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? 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;pos=vec3(pos_nx.xy,h);
1079#else
1080h=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);
1081#endif
1082#ifdef PROJECTION_GLOBE_VIEW
1083float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
1084#endif
1085float cutoff=1.0;vec3 scaled_pos=pos;
1086#ifdef RENDER_CUTOFF
1087vec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);cutoff=cutoff_opacity(u_cutoff_params,ground.z);if (centroid_pos.y !=0.0 && centroid_pos.x !=0.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);
1088#endif
1089float hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0));
1090#ifdef RENDER_WALL_MODE
1091vec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=a_join_normal_inside.z*wall_offset*0.5;
1092#endif
1093gl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;
1094#ifdef RENDER_SHADOWS
1095vec3 shd_pos0=pos;vec3 shd_pos1=pos;
1096#ifdef NORMAL_OFFSET
1097vec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();
1098#endif
1099v_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);
1100#endif
1101float NdotL=0.0;float colorvalue=0.0;
1102#ifndef LIGHTING_3D_MODE
1103colorvalue=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*=(
1104(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}
1105#endif
1106#ifdef FAUX_AO
1107float 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;
1108#ifdef TERRAIN
1109top_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);
1110#endif
1111v_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);
1112#ifdef PROJECTION_GLOBE_VIEW
1113top_height+=u_height_lift;
1114#endif
1115gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;
1116#endif
1117#ifdef LIGHTING_3D_MODE
1118#ifdef FLOOD_LIGHT
1119float is_wall=1.0-float(t > 0.0 && top_up_ny.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;
1120#endif
1121v_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);
1122#else
1123v_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;
1124#endif
1125#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)
1126float 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;
1127#endif
1128#ifdef FOG
1129v_fog_pos=fog_position(pos);
1130#endif
1131}`),fillExtrusionDepth:hr(`in highp float v_depth;void main() {
1132#ifndef DEPTH_TEXTURE
1133glFragColor=pack_depth(v_depth);
1134#endif
1135}`,`#include "_prelude_terrain.vertex.glsl"
1136uniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale;
1137#ifdef TERRAIN
1138uniform int u_height_type;uniform int u_base_type;
1139#endif
1140in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;
1141#ifdef RENDER_WALL_MODE
1142in vec3 a_join_normal_inside;
1143#endif
1144#pragma mapbox: define highp float base
1145#pragma mapbox: define highp float height
1146#pragma mapbox: define highp float line_width
1147#pragma mapbox: define highp vec4 color
1148out highp float v_depth;void main() {
1149#pragma mapbox: initialize highp float base
1150#pragma mapbox: initialize highp float height
1151#pragma mapbox: initialize highp float line_width
1152#pragma mapbox: initialize highp vec4 color
1153base*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;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);
1154#if defined(HAS_CENTROID) || defined(TERRAIN)
1155centroid_pos=a_centroid_pos;
1156#endif
1157vec3 pos;
1158#ifdef TERRAIN
1159bool 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);float c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? 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);
1160#else
1161pos=vec3(pos_nx.xy,t > 0.0 ? height : base);
1162#endif
1163#ifdef RENDER_WALL_MODE
1164vec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;pos.xy-=a_join_normal_inside.z*wall_offset*0.5;
1165#endif
1166float 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);v_depth=gl_Position.z/gl_Position.w;}`),fillExtrusionPattern:hr(`#include "_prelude_fog.fragment.glsl"
1167#include "_prelude_lighting.glsl"
1168uniform vec2 u_texsize;uniform sampler2D u_image;
1169#ifdef FAUX_AO
1170uniform lowp vec2 u_ao;in vec3 v_ao;
1171#endif
1172#ifdef LIGHTING_3D_MODE
1173in vec3 v_normal;
1174#endif
1175in highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;
1176#pragma mapbox: define highp float base
1177#pragma mapbox: define highp float height
1178#pragma mapbox: define mediump vec4 pattern
1179#pragma mapbox: define highp float pixel_ratio
1180void main() {
1181#pragma mapbox: initialize highp float base
1182#pragma mapbox: initialize highp float height
1183#pragma mapbox: initialize mediump vec4 pattern
1184#pragma mapbox: initialize highp float pixel_ratio
1185vec2 pattern_tl=pattern.xy;vec2 pattern_br=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);
1186#ifdef LIGHTING_3D_MODE
1187out_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;
1188#else
1189out_color=out_color*v_lighting;
1190#endif
1191#ifdef FAUX_AO
1192float 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
1192),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;
1193#endif
1194#ifdef FOG
1195out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
1196#endif
1197#ifdef INDICATOR_CUTOUT
1198out_color=applyCutout(out_color,height);
1199#endif
1200glFragColor=out_color;
1201#ifdef OVERDRAW_INSPECTOR
1202glFragColor=vec4(1.0);
1203#endif
1204HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
1205#include "_prelude_terrain.vertex.glsl"
1206#include "_prelude_lighting.glsl"
1207uniform 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;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;
1208#ifdef RENDER_WALL_MODE
1209in vec3 a_join_normal_inside;
1210#endif
1211#ifdef PROJECTION_GLOBE_VIEW
1212in vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;
1213#endif
1214#ifdef TERRAIN
1215uniform int u_height_type;uniform int u_base_type;
1216#endif
1217out highp vec2 v_pos;out vec4 v_lighting;
1218#ifdef FAUX_AO
1219uniform lowp vec2 u_ao;out vec3 v_ao;
1220#endif
1221#ifdef LIGHTING_3D_MODE
1222out vec3 v_normal;
1223#endif
1224#pragma mapbox: define highp float base
1225#pragma mapbox: define highp float height
1226#pragma mapbox: define highp vec4 color
1227#pragma mapbox: define mediump vec4 pattern
1228#pragma mapbox: define highp float pixel_ratio
1229#pragma mapbox: define highp float line_width
1230void main() {
1231#pragma mapbox: initialize highp float base
1232#pragma mapbox: initialize highp float height
1233#pragma mapbox: initialize highp vec4 color
1234#pragma mapbox: initialize mediump vec4 pattern
1235#pragma mapbox: initialize highp float pixel_ratio
1236#pragma mapbox: initialize highp float line_width
1237vec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);
1238#if defined(HAS_CENTROID) || defined(TERRAIN)
1239centroid_pos=a_centroid_pos;
1240#endif
1241float ele=0.0;float h=z;vec3 p;float c_ele;
1242#ifdef TERRAIN
1243bool 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);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? 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);
1244#else
1245p=vec3(pos_nx.xy,z);
1246#endif
1247#ifdef PROJECTION_GLOBE_VIEW
1248float lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);
1249#endif
1250#ifdef RENDER_WALL_MODE
1251vec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);p.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;p.xy-=a_join_normal_inside.z*wall_offset*0.5;
1252#endif
1253float 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
1254? pos_nx.xy
1255: 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;
1256#ifdef LIGHTING_3D_MODE
1257NdotL=calculate_NdotL(normal);
1258#else
1259NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);
1260#endif
1261if (normal.y !=0.0) {float r=0.84;
1262#ifndef LIGHTING_3D_MODE
1263r=mix(0.7,0.98,1.0-u_lightintensity);
1264#endif
1265NdotL*=(
1266(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}
1267#ifdef FAUX_AO
1268float 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;
1269#ifdef TERRAIN
1270top_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);
1271#endif
1272v_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);
1273#ifdef PROJECTION_GLOBE_VIEW
1274top_height+=u_height_lift;
1275#endif
1276gl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;
1277#endif
1278#ifdef LIGHTING_3D_MODE
1279v_normal=normal;
1280#else
1281v_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;
1282#endif 
1283#ifdef FOG
1284v_fog_pos=fog_position(p);
1285#endif
1286}`),groundShadow:hr(`#include "_prelude_shadow.fragment.glsl"
1287precision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;
1288#ifdef FOG
1289in float v_fog_opacity;
1290#endif
1291void 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);
1292#ifdef RENDER_CUTOFF
1293shadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));
1294#endif
1295#ifdef FOG
1296shadow=mix(shadow,vec3(1.0),v_fog_opacity);
1297#endif
1298#ifdef INDICATOR_CUTOUT
1299shadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r);
1300#endif
1301glFragColor=vec4(shadow,1.0);}`,`#include "_prelude_fog.vertex.glsl"
1302uniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;
1303#ifdef FOG
1304out float v_fog_opacity;
1305#endif
1306void 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);
1307#ifdef FOG
1308v_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos);
1309#endif
1310}`),fillExtrusionGroundEffect:hr(`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;
1311#ifdef SDF_SUBPASS
1312in 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);}
1313#ifdef FOG
1314in highp float v_fog;
1315#endif
1316#endif
1317void main() {
1318#ifdef CLEAR_SUBPASS
1319vec4 color=vec4(1.0);
1320#ifdef CLEAR_FROM_TEXTURE
1321color=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));
1322#endif
1323glFragColor=color;
1324#else
1325#ifdef SDF_SUBPASS
1326highp 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;
1327#ifdef FOG
1328fog=v_fog;
1329#endif
1330#ifdef RENDER_CUTOFF
1331fog*=v_cutoff_opacity;
1332#endif
1333glFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));
1334#else
1335vec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);
1336#ifdef OVERDRAW_INSPECTOR
1337color=vec4(1.0);
1338#endif
1339glFragColor=color;
1340#endif
1341HANDLE_WIREFRAME_DEBUG;
1342#endif
1343}`,`#include "_prelude_fog.vertex.glsl"
1344in highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark;
1345#ifdef SDF_SUBPASS
1346out highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;
1347#ifdef FOG
1348out highp float v_fog;
1349#endif
1350#endif
1351uniform 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;
1352#pragma mapbox: define highp float flood_light_ground_radius
1353const float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {
1354#pragma mapbox: initialize highp float flood_light_ground_radius
1355vec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;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=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;
1356#ifdef SDF_SUBPASS
1357v_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);
1358#ifdef FOG
1359v_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);
1360#endif
1361#endif
1362float hidden_by_landmark=0.0;
1363#ifdef HAS_CENTROID
1364hidden_by_landmark=a_hidden_by_landmark;
1365#endif
1366float 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));
1367#ifdef RENDER_CUTOFF
1368v_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);
1369#endif
1370}`),hillshadePrepare:hr(`precision highp float;uniform 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(
1371(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)
1372)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(
1373deriv.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 vec2 a_pos;in vec2 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=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:hr(`#include "_prelude_fog.fragment.glsl"
1374#include "_prelude_lighting.glsl"
1375uniform 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;
1376#ifdef LIGHTING_3D_MODE
1377glFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);
1378#endif
1379#ifdef FOG
1380glFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));
1381#endif
1382#ifdef OVERDRAW_INSPECTOR
1383glFragColor=vec4(1.0);
1384#endif
1385HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
1386uniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;
1387#ifdef FOG
1388v_fog_pos=fog_position(a_pos);
1389#endif
1390}`),line:hr(`#include "_prelude_fog.fragment.glsl"
1391#include "_prelude_lighting.glsl"
1392#include "_prelude_shadow.fragment.glsl"
1393uniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_floor_width_scale;
1393uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec3 v_uv;
1394#ifdef ELEVATED_ROADS
1395in highp float v_road_z_offset;
1396#endif
1397#ifdef RENDER_LINE_DASH
1398uniform sampler2D u_dash_image;in vec2 v_tex;
1399#endif
1400#ifdef RENDER_LINE_GRADIENT
1401uniform sampler2D u_gradient_image;
1402#endif
1403#ifdef INDICATOR_CUTOUT
1404in highp float v_z_offset;
1405#endif
1406#ifdef RENDER_SHADOWS
1407uniform 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;
1408#endif
1409float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}uniform float u_emissive_strength;
1410#pragma mapbox: define highp vec4 color
1411#pragma mapbox: define lowp float floorwidth
1412#pragma mapbox: define lowp vec4 dash
1413#pragma mapbox: define lowp float blur
1414#pragma mapbox: define lowp float opacity
1415#pragma mapbox: define lowp float border_width
1416#pragma mapbox: define lowp vec4 border_color
1417float linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {
1418#pragma mapbox: initialize highp vec4 color
1419#pragma mapbox: initialize lowp float floorwidth
1420#pragma mapbox: initialize lowp vec4 dash
1421#pragma mapbox: initialize lowp float blur
1422#pragma mapbox: initialize lowp float opacity
1423#pragma mapbox: initialize lowp float border_width
1424#pragma mapbox: initialize lowp vec4 border_color
1425float 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);
1426#ifdef RENDER_LINE_DASH
1427float sdfdist=texture(u_dash_image,v_tex).r;
1427float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist);
1428#endif
1429highp vec4 out_color;
1430#ifdef RENDER_LINE_GRADIENT
1431out_color=texture(u_gradient_image,v_uv.xy);
1432#else
1433out_color=color;
1434#endif
1435float trim_alpha=1.0;
1436#ifdef RENDER_LINE_TRIM_OFFSET
1437highp 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);out_color=mix(out_color,u_trim_color,transition_factor);trim_alpha=1.0-transition_factor;}
1438#endif
1439if (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}
1440#ifdef RENDER_LINE_BORDER
1441float edgeBlur=((border_width*u_width_scale)+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color=mix(border_color*trim_alpha,out_color,smoothAlpha);}}
1442#endif
1443#ifdef LIGHTING_3D_MODE
1444out_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);
1445#ifdef RENDER_SHADOWS
1446float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);
1447#ifdef ELEVATED_ROADS
1448out_color.rgb*=mix(v_road_z_offset > 0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);
1449#else
1450out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);
1451#endif
1452#endif
1453#endif
1454#ifdef FOG
1455out_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));
1456#endif
1457out_color*=(alpha*opacity);
1458#ifdef INDICATOR_CUTOUT
1459out_color=applyCutout(out_color,v_z_offset);
1460#endif
1461glFragColor=out_color;
1462#ifdef OVERDRAW_INSPECTOR
1463glFragColor=vec4(1.0);
1464#endif
1465HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
1466#include "_prelude_shadow.vertex.glsl"
1467#include "_prelude_terrain.vertex.glsl"
1468#define EXTRUDE_SCALE 0.015873016
1469in vec2 a_pos_normal;in vec4 a_data;
1470#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH)
1471in vec3 a_z_offset_width;
1472#endif
1473#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)
1474in highp vec3 a_packed;
1475#endif
1476#ifdef RENDER_LINE_DASH
1477in float a_linesofar;
1478#endif
1479uniform 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 highp float u_floor_width_scale;
1480#ifdef ELEVATED
1481uniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {
1482#ifdef ELEVATION_REFERENCE_SEA
1483return 0.0;
1484#else
1485return elevation(apos);
1486#endif
1487}
1488#endif
1489out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec3 v_uv;
1490#ifdef ELEVATED_ROADS
1491out highp float v_road_z_offset;
1492#endif
1493#ifdef RENDER_LINE_DASH
1494uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;
1495#endif
1496#ifdef RENDER_LINE_GRADIENT
1497uniform float u_image_height;
1498#endif
1499#ifdef INDICATOR_CUTOUT
1500out highp float v_z_offset;
1501#endif
1502#ifdef RENDER_SHADOWS
1503uniform 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;
1504#endif
1505#pragma mapbox: define highp vec4 color
1506#pragma mapbox: define lowp float floorwidth
1507#pragma mapbox: define lowp vec4 dash
1508#pragma mapbox: define lowp float blur
1509#pragma mapbox: define lowp float opacity
1510#pragma mapbox: define mediump float gapwidth
1511#pragma mapbox: define lowp float offset
1512#pragma mapbox: define mediump float width
1513#pragma mapbox: define lowp float border_width
1514#pragma mapbox: define lowp vec4 border_color
1515void main() {
1516#pragma mapbox: initialize highp vec4 color
1517#pragma mapbox: initialize lowp float floorwidth
1518#pragma mapbox: initialize lowp vec4 dash
1519#pragma mapbox: initialize lowp float blur
1520#pragma mapbox: initialize lowp float opacity
1521#pragma mapbox: initialize mediump float gapwidth
1522#pragma mapbox: initialize lowp float offset
1523#pragma mapbox: initialize mediump float width
1524#pragma mapbox: initialize lowp float border_width
1525#pragma mapbox: initialize lowp vec4 border_color
1526float a_z_offset;
1527#if defined(ELEVATED) || defined(ELEVATED_ROADS)
1528a_z_offset=a_z_offset_width.x;
1529#endif
1530float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth;
1531#ifdef VARIABLE_LINE_WIDTH
1532float left=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);halfwidth=(u_width_scale*(left==1.0 ? a_z_offset_width.y : a_z_offset_width.z))/2.0;
1533#else
1534halfwidth=(u_width_scale*width)/2.0;
1535#endif
1536offset=-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);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;
1536vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;
1537#ifdef ELEVATED_ROADS
1538v_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;
1539#else
1540#ifdef ELEVATED
1541vec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;
1542#ifdef CROSS_SLOPE_VERTICAL
1543float top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);
1544#else
1545#ifdef CROSS_SLOPE_HORIZONTAL
1546float 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+a_z_offset;
1547#else
1548float 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+a_z_offset;
1549#endif
1550#endif
1551gl_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);
1552#else
1553gl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);
1554#endif
1555#endif
1556#ifdef ELEVATED_ROADS
1557#ifdef RENDER_SHADOWS
1558vec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;
1559#ifdef NORMAL_OFFSET
1560vec3 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();
1561#endif
1562v_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;
1563#endif
1564#endif
1565#ifndef RENDER_TO_TEXTURE
1566float 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));
1567#else
1568v_gamma_scale=1.0;
1569#endif
1570#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)
1571highp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float line_progress=a_packed[2];
1572#ifdef RENDER_LINE_GRADIENT
1573highp 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);
1574#else
1575v_uv=vec3(a_uv_x,0.0,line_progress);
1576#endif
1577#endif
1578#ifdef RENDER_LINE_DASH
1579float scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*height+dash.x+0.5)/u_texsize.y);
1580#endif
1581v_width2=vec2(outset,inset);
1582#ifdef FOG
1583v_fog_pos=fog_position(pos);
1584#endif
1585#ifdef INDICATOR_CUTOUT
1586v_z_offset=a_z_offset;
1587#endif
1588}`),linePattern:hr(`#include "_prelude_fog.fragment.glsl"
1589#include "_prelude_lighting.glsl"
1590#include "_prelude_shadow.fragment.glsl"
1591uniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_alpha_discard_threshold;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;in vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;
1592#ifdef RENDER_LINE_TRIM_OFFSET
1593in highp vec3 v_uv;
1594#endif
1595#ifdef ELEVATED_ROADS
1596in highp float v_road_z_offset;
1597#endif
1598#ifdef LINE_JOIN_NONE
1599in vec2 v_pattern_data;
1600#endif
1601#ifdef INDICATOR_CUTOUT
1602in highp float v_z_offset;
1603#endif
1604#ifdef RENDER_SHADOWS
1605uniform 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;
1606#endif
1607uniform float u_emissive_strength;
1608#pragma mapbox: define mediump vec4 pattern
1609#pragma mapbox: define mediump float pixel_ratio
1610#pragma mapbox: define mediump float blur
1611#pragma mapbox: define mediump float opacity
1612void main() {
1613#pragma mapbox: initialize mediump vec4 pattern
1614#pragma mapbox: initialize mediump float pixel_ratio
1615#pragma mapbox: initialize mediump float blur
1616#pragma mapbox: initialize mediump float opacity
1617vec2 pattern_tl=pattern.xy;vec2 pattern_br=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);
1618#ifdef RENDER_LINE_TRIM_OFFSET
1619highp 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);}
1620#endif
1621#ifdef LINE_JOIN_NONE
1622highp 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);}
1623#endif
1624#ifdef LIGHTING_3D_MODE
1625color=apply_lighting_with_emission_ground(color,u_emissive_strength);
1626#ifdef RENDER_SHADOWS
1627float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);
1628#ifdef ELEVATED_ROADS
1629color.rgb*=mix(v_road_z_offset > 0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);
1630#else
1631color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);
1632#endif
1633#endif
1634#endif
1635#ifdef FOG
1636color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
1637#endif
1638color*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}
1639#ifdef INDICATOR_CUTOUT
1640color=applyCutout(color,v_z_offset);
1641#endif
1642glFragColor=color;
1643#ifdef OVERDRAW_INSPECTOR
1644glFragColor=vec4(1.0);
1645#endif
1646HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
1647#include "_prelude_shadow.vertex.glsl"
1648#include "_prelude_terrain.vertex.glsl"
1649#define scale 0.015873016
1650in vec2 a_pos_normal;in vec4 a_data;
1651#if defined(ELEVATED) || defined(ELEVATED_ROADS)
1652in vec3 a_z_offset_width;
1653#endif
1654#ifdef RENDER_LINE_TRIM_OFFSET
1655in highp vec3 a_packed;
1656#endif
1657in highp float a_linesofar;
1658#ifdef LINE_JOIN_NONE
1659in highp vec3 a_pattern_data;out vec2 v_pattern_data;
1660#endif
1661#ifdef INDICATOR_CUTOUT
1662out highp float v_z_offset;
1663#endif
1664uniform 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;
1665#ifdef ELEVATED
1666uniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {
1667#ifdef ELEVATION_REFERENCE_SEA
1668return 0.0;
1669#else
1670return elevation(apos);
1671#endif
1672}
1673#endif
1674out vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;
1675#ifdef RENDER_LINE_TRIM_OFFSET
1676out highp vec3 v_uv;
1677#endif
1678#ifdef ELEVATED_ROADS
1679out highp float v_road_z_offset;
1680#endif
1681#ifdef RENDER_SHADOWS
1682uniform 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;
1683#endif
1684#pragma mapbox: define mediump float blur
1685#pragma mapbox: define mediump float opacity
1686#pragma mapbox: define mediump float offset
1687#pragma mapbox: define mediump float gapwidth
1688#pragma mapbox: define mediump float width
1689#pragma mapbox: define mediump float floorwidth
1690#pragma mapbox: define mediump vec4 pattern
1691#pragma mapbox: define mediump float pixel_ratio
1692void main() {
1693#pragma mapbox: initialize mediump float blur
1694#pragma mapbox: initialize mediump float opacity
1695#pragma mapbox: initialize mediump float offset
1696#pragma mapbox: initialize mediump float gapwidth
1697#pragma mapbox: initialize mediump float width
1698#pragma mapbox: initialize mediump float floorwidth
1699#pragma mapbox: initialize mediump vec4 pattern
1700#pragma mapbox: initialize mediump float pixel_ratio
1701float a_z_offset;
1702#if defined(ELEVATED) || defined(ELEVATED_ROADS)
1703a_z_offset=a_z_offset_width.x;
1704#endif
1705float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=(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;
1705vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;
1706#ifdef ELEVATED_ROADS
1707v_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;
1708#else
1709#ifdef ELEVATED
1710vec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;
1711#ifdef CROSS_SLOPE_VERTICAL
1712float top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);
1713#else
1714#ifdef CROSS_SLOPE_HORIZONTAL
1715float 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+a_z_offset;
1716#else
1717float 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+a_z_offset;
1718#endif
1719#endif
1720gl_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);
1721#else
1722gl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);
1723#endif
1724#endif
1725#ifdef ELEVATED_ROADS
1726#ifdef RENDER_SHADOWS
1727vec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;
1728#ifdef NORMAL_OFFSET
1729vec3 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();
1730#endif
1731v_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;
1732#endif
1733#endif
1734#ifndef RENDER_TO_TEXTURE
1735float 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));
1736#else
1737v_gamma_scale=1.0;
1738#endif
1739#ifdef RENDER_LINE_TRIM_OFFSET
1740highp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress);
1741#endif
1742v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale);
1743#ifdef LINE_JOIN_NONE
1744v_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/((pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=(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);
1745#endif
1746#ifdef FOG
1747v_fog_pos=fog_position(pos);
1748#endif
1749#ifdef INDICATOR_CUTOUT
1750v_z_offset=a_z_offset;
1751#endif
1752}`),raster:hr(`#include "_prelude_fog.fragment.glsl"
1753#include "_prelude_lighting.glsl"
1754#include "_prelude_raster_array.glsl"
1755uniform 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;
1756#ifdef PROJECTION_GLOBE_VIEW
1757in float v_split_fade;
1758#endif
1759uniform 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;
1760#ifndef RASTER_ARRAY
1761uniform highp sampler2D u_image0;uniform sampler2D u_image1;
1762#endif
1763#ifdef RASTER_COLOR
1764uniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;
1765#endif
1766void main() {vec4 color0,color1,color;vec2 value;
1767#ifdef RASTER_COLOR
1768#ifdef RASTER_ARRAY
1769#ifdef RASTER_ARRAY_LINEAR
1770value=mix(
1771raTexture2D_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
1772);
1773#else
1774value=mix(
1775raTexture2D_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
1776);
1777#endif
1778if (value.y > 0.0) value.x/=value.y;
1779#else
1780color=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);
1781#endif
1782color=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;
1783#else
1784color0=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);
1785#endif
1786color.a*=u_opacity;
1787#ifdef GLOBE_POLES
1788color.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);
1789#endif
1790vec3 rgb=color.rgb;rgb=vec3(
1791dot(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);
1792#ifdef LIGHTING_3D_MODE
1793out_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;
1794#endif
1795#ifdef FOG
1796highp 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));
1797#endif
1798glFragColor=vec4(out_color*color.a,color.a);
1799#ifdef PROJECTION_GLOBE_VIEW
1800glFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));
1801#endif
1802#ifdef RENDER_CUTOFF
1803glFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);
1804#endif
1805#ifdef OVERDRAW_INSPECTOR
1806glFragColor=vec4(1.0);
1807#endif
1808HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
1809uniform 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;
1810#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8
1811#ifdef GLOBE_POLES
1812in vec3 a_globe_pos;in vec2 a_uv;
1813#else
1814in vec2 a_pos;in vec2 a_texture_pos;
1815#endif
1816out vec2 v_pos0;out vec2 v_pos1;out float v_depth;
1817#ifdef PROJECTION_GLOBE_VIEW
1818out float v_split_fade;
1819#endif
1820void main() {vec2 uv;
1821#ifdef GLOBE_POLES
1822vec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos   ,1.0);uv=a_uv;
1823#ifdef FOG
1824v_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);
1825#endif
1826#else
1827float w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0;
1828#ifdef PROJECTION_GLOBE_VIEW
1829vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);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);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);    
1830v_split_fade=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;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)));}float tiles=u_grid_matrix[0][2];
1830if (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);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;
1831#ifdef FOG
1832v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);
1833#endif
1834#else
1835gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);
1836#ifdef FOG
1837v_fog_pos=fog_position(a_pos);
1838#endif
1839#endif
1840#endif
1841v_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;
1842#ifdef RENDER_CUTOFF
1843v_depth=gl_Position.z;
1844#endif
1845}`),rasterParticle:hr(`#include "_prelude_fog.fragment.glsl"
1846#include "_prelude_lighting.glsl"
1847uniform 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;
1848#ifdef LIGHTING_3D_MODE
1849out_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),0.0).rgb;
1850#endif
1851#ifdef FOG
1852highp 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));
1853#endif
1854glFragColor=vec4(out_color*color.a,color.a);
1855#ifdef OVERDRAW_INSPECTOR
1856glFragColor=vec4(1.0);
1857#endif
1858HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
1859uniform 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;
1860#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8
1861in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;
1862#ifdef PROJECTION_GLOBE_VIEW
1863vec3 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;
1864#ifdef FOG
1865v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);
1866#endif
1867#else
1868uv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);
1869#ifdef FOG
1870v_fog_pos=fog_position(a_pos);
1871#endif
1872#endif
1873v_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),rasterParticleDraw:hr("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"
1874in float 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(
1875mod(a_index,u_particle_texture_side_len),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:hr("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 vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:hr(`#include "_prelude_raster_particle.glsl"
1876uniform 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;
1876vec2 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(
1877linearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)
1878);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 vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbol:hr(`#include "_prelude_lighting.glsl"
1879#define SDF_PX 8.0
1880#define SDF 1.0
1881#define ICON 0.0
1882uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;uniform lowp float u_scale_factor;
1883#ifdef ICON_TRANSITION
1884uniform float u_icon_transition;
1885#endif
1886#ifdef COLOR_ADJUSTMENT
1887uniform mat4 u_color_adj_mat;
1888#endif
1889#ifdef INDICATOR_CUTOUT
1890in highp float v_z_offset;
1891#endif
1892in vec2 v_tex_a;
1893#ifdef ICON_TRANSITION
1894in vec2 v_tex_b;
1895#endif
1896in float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity;
1897#ifdef RENDER_TEXT_AND_SYMBOL
1898in float is_sdf;in vec2 v_tex_a_icon;
1899#endif
1900#pragma mapbox: define highp vec4 fill_color
1901#pragma mapbox: define highp vec4 halo_color
1902#pragma mapbox: define lowp float opacity
1903#pragma mapbox: define lowp float halo_width
1904#pragma mapbox: define lowp float halo_blur
1905#pragma mapbox: define lowp float emissive_strength
1906void main() {
1907#pragma mapbox: initialize highp vec4 fill_color
1908#pragma mapbox: initialize highp vec4 halo_color
1909#pragma mapbox: initialize lowp float opacity
1910#pragma mapbox: initialize lowp float halo_width
1911#pragma mapbox: initialize lowp float halo_blur
1912#pragma mapbox: initialize lowp float emissive_strength
1913vec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2];
1914#ifdef RENDER_TEXT_AND_SYMBOL
1915if (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha;
1916#ifdef OVERDRAW_INSPECTOR
1917glFragColor=vec4(1.0);
1918#endif
1919return;}
1920#endif
1921#ifdef RENDER_SDF
1922float 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;
1923#else
1924#ifdef ICON_TRANSITION
1925vec4 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);
1926#else
1927out_color=texture(u_texture,v_tex_a);
1928#endif
1929#ifdef COLOR_ADJUSTMENT
1930out_color=u_color_adj_mat*out_color;
1931#endif
1932#endif
1933out_color*=opacity*fade_opacity;
1934#ifdef LIGHTING_3D_MODE
1935out_color=apply_lighting_with_emission_ground(out_color,emissive_strength);
1936#endif
1937#ifdef INDICATOR_CUTOUT
1938out_color=applyCutout(out_color,v_z_offset);
1939#endif
1940glFragColor=out_color;
1941#ifdef OVERDRAW_INSPECTOR
1942glFragColor=vec4(1.0);
1943#endif
1944HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_terrain.vertex.glsl"
1945in vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;
1946#ifdef Z_OFFSET
1947in float a_auto_z_offset;
1948#endif
1949#ifdef PROJECTION_GLOBE_VIEW
1950in vec3 a_globe_anchor;in vec3 a_globe_normal;
1951#endif
1952#ifdef ICON_TRANSITION
1953in vec2 a_texb;
1954#endif
1955#ifdef OCCLUSION_QUERIES
1956in float a_occlusion_query_opacity;
1957#endif
1958#ifdef INDICATOR_CUTOUT
1959out highp float v_z_offset;
1960#endif
1961uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_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;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo;
1962#ifdef PROJECTION_GLOBE_VIEW
1963uniform 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;
1964#endif
1965out vec2 v_tex_a;
1966#ifdef ICON_TRANSITION
1967out vec2 v_tex_b;
1968#endif
1969out float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity;
1970#ifdef RENDER_TEXT_AND_SYMBOL
1971out float is_sdf;out vec2 v_tex_a_icon;
1972#endif
1973#pragma mapbox: define highp vec4 fill_color
1974#pragma mapbox: define highp vec4 halo_color
1975#pragma mapbox: define lowp float opacity
1976#pragma mapbox: define lowp float halo_width
1977#pragma mapbox: define lowp float halo_blur
1978#pragma mapbox: define lowp float emissive_strength
1979#pragma mapbox: define lowp float occlusion_opacity
1980#pragma mapbox: define lowp float z_offset
1981void main() {
1982#pragma mapbox: initialize highp vec4 fill_color
1983#pragma mapbox: initialize highp vec4 halo_color
1984#pragma mapbox: initialize lowp float opacity
1985#pragma mapbox: initialize lowp float halo_width
1986#pragma mapbox: initialize lowp float halo_blur
1987#pragma mapbox: initialize lowp float emissive_strength
1988#pragma mapbox: initialize lowp float occlusion_opacity
1989#pragma mapbox: initialize lowp float z_offset
1990vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor);
1991#ifdef Z_OFFSET
1992e+=a_auto_z_offset;
1993#endif
1994vec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;
1995#ifdef PROJECTION_GLOBE_VIEW
1996mercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=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;
1997#else
1998world_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;
1999#endif
2000vec4 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 ?
2001camera_to_anchor_distance/u_camera_to_center_distance :
2002u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(
20030.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;
2004#ifdef PROJECTION_GLOBE_VIEW
2005vec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(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;
2006#else
2007offsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;
2008#endif
2009vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;
2010#ifdef PROJECTION_GLOBE_VIEW
2011#ifdef PROJECTED_POS_ON_VIEWPORT
2012projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0);
2013#else
2014vec3 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);    
2015#endif
2016#else
2017projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);
2018#endif
2019highp 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);
2020#ifdef TERRAIN
2021#ifdef PITCH_WITH_MAP_TERRAIN
2022vec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);
2023#endif
2024#endif
2025#ifdef Z_OFFSET
2026z+=u_pitch_with_map ? a_auto_z_offset+(u_elevation_from_sea ? z_offset : z_offset) : 0.0;
2027#else
2028z+=u_pitch_with_map ? (u_elevation_from_sea ? z_offset : z_offset) : 0.0;
2029#endif
2030float 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));
2031#ifdef DEPTH_OCCLUSION
2032float depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier;
2033#endif
2034#ifdef OCCLUSION_QUERIES
2035float occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;
2036#endif
2037float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);
2038#ifdef PROJECTION_GLOBE_VIEW
2039vec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);
2040#else
2041gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);
2042#endif
2043float 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;
2044#ifdef RENDER_TEXT_AND_SYMBOL
2045is_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon;
2046#endif
2047#ifdef ICON_TRANSITION
2048v_tex_b=a_texb/u_texsize;
2049#endif
2050#ifdef INDICATOR_CUTOUT
2051v_z_offset=e;
2052#endif
2053}`),terrainRaster:hr(`#include "_prelude_fog.fragment.glsl"
2054#include "_prelude_shadow.fragment.glsl"
2055#include "_prelude_lighting.glsl"
2056uniform sampler2D u_image0;in vec2 v_pos0;
2057#ifdef FOG
2058in float v_fog_opacity;
2059#endif
2060#ifdef RENDER_SHADOWS
2061in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;
2062#endif
2063uniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;
2064#ifdef LIGHTING_3D_MODE
2065const vec3 normal=vec3(0.0,0.0,1.0);
2066#ifdef RENDER_SHADOWS
2067float cutoffOpacity=1.0;
2068#ifdef RENDER_CUTOFF
2069cutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);
2070#endif
2071#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS
2072vec3 unlit_base=image_color.rgb*(1.0-image_color.a);vec3 emissive_base=image_color.rgb*image_color.a;float 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;
2073#else
2074float 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));
2075#endif
2076#else
2077float lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);
2078#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS
2079color.rgb=mix(color.rgb,image_color.rgb,image_color.a);color.a=1.0;
2080#endif
2081#endif
2082#else
2083color=image_color;
2084#endif
2085#ifdef FOG
2086#ifdef ZERO_EXAGGERATION
2087color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
2088#else
2089color=fog_dither(fog_apply_from_vert(color,v_fog_opacity));
2090#endif
2091#endif
2092glFragColor=color;
2093#ifdef OVERDRAW_INSPECTOR
2094glFragColor=vec4(1.0);
2095#endif
2096HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
2097#include "_prelude_terrain.vertex.glsl"
2098uniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0;
2099#ifdef FOG
2100out float v_fog_opacity;
2101#endif
2102#ifdef RENDER_SHADOWS
2103uniform 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;out float v_depth;
2104#endif
2105void 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);
2106#ifdef FOG
2107#ifdef ZERO_EXAGGERATION
2108v_fog_pos=fog_position(decodedPos);
2109#else
2110v_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));
2111#endif
2112#endif
2113#ifdef RENDER_SHADOWS
2114vec3 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.);
2115#endif
2116}`),terrainDepth:hr("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",`#include "_prelude_terrain.vertex.glsl"
2117uniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}`),skybox:hr(`#include "_prelude_fog.fragment.glsl"
2118in 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(
2119cos_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
2119nd-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;
2120#ifdef FOG
2121sky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);
2122#endif
2123sky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);
2124#ifdef OVERDRAW_INSPECTOR
2125glFragColor=vec4(1.0);
2126#endif
2127}`,Ea),skyboxGradient:hr(`#include "_prelude_fog.fragment.glsl"
2128in 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));
2129#ifdef FOG
2130color.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;
2131#endif
2132color*=u_opacity;glFragColor=color;
2133#ifdef OVERDRAW_INSPECTOR
2134glFragColor=vec4(1.0);
2135#endif
2136}`,Ea),skyboxCapture:h
vendor: 3,793 bytes, lines 2136-2147
2136r(`
2137in 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;
2138#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)
2139#define BETA_M                  vec3(21e-6,21e-6,21e-6)
2140#define MIE_G                   0.76
2141#define DENSITY_HEIGHT_SCALE_R  8000.0
2142#define DENSITY_HEIGHT_SCALE_M  1200.0
2143#define PLANET_RADIUS           6360e3
2144#define ATMOSPHERE_RADIUS       6420e3
2145#define SAMPLE_STEPS            10
2146#define DENSITY_STEPS           4
2147float 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;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globe
2147Raster:hr(`#include "_prelude_fog.fragment.glsl"
2148#include "_prelude_lighting.glsl"
2149uniform sampler2D u_image0;uniform float u_far_z_cutoff;in vec2 v_pos0;
2150#ifndef FOG
2151uniform 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;
2152#endif
2153void main() {vec4 color;
2154#ifdef CUSTOM_ANTIALIASING
2155highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(
2156mix(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);
2157#ifdef LIGHTING_3D_MODE
2158#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS
2159raster=apply_lighting_with_emission_ground(raster,raster.a);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias);
2160#else
2161raster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);
2162#endif
2163#else
2164color=vec4(raster.rgb*antialias,raster.a*antialias);
2165#endif
2166#else
2167color=texture(u_image0,v_pos0);
2168#ifdef LIGHTING_3D_MODE
2169#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS
2170color=apply_lighting_with_emission_ground(color,color.a);color.a=1.0;
2171#else
2172color=apply_lighting_ground(color);
2173#endif
2174#endif
2175#endif
2176#ifdef FOG
2177color=fog_dither(fog_apply_premultiplied(color,v_fog_pos));
2178#endif
2179color*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;
2180#ifdef OVERDRAW_INSPECTOR
2181glFragColor=vec4(1.0);
2182#endif
2183HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
2184#include "_prelude_terrain.vertex.glsl"
2185uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;
2186#ifdef GLOBE_POLES
2187in vec3 a_globe_pos;in vec2 a_uv;
2188#else
2189in vec2 a_pos;
2190#endif
2191out vec2 v_pos0;void main() {
2192#ifdef GLOBE_POLES
2193vec3 globe_pos=a_globe_pos;vec2 uv=a_uv;
2194#else
2195float 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);
2196#endif
2197v_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;
2198#ifdef GLOBE_POLES
2199vec3 up_vector=globe_derived_up_vector;
2200#else
2201vec3 up_vector=elevationVector(tile_pos);
2202#endif
2203float height=elevation(tile_pos);globe_pos+=up_vector*height;
2204#ifndef GLOBE_POLES
2205globe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;
2206#endif
2207#ifdef GLOBE_POLES
2208vec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);
2209#else
2210vec4 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);
2211#endif
2212gl_Position=u_proj_matrix*interpolated_pos;
2213#ifdef FOG
2214v_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);
2215#endif
2216}`),globeAtmosphere:hr(`#include "_prelude_fog.fragment.glsl"
2217uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_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;
2218#ifdef PROJECTION_GLOBE_VIEW
2219globe_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) {
2220#ifdef ALPHA_PASS
2221glFragColor=vec4(0,0,0,0);return;
2222#else
2223#ifdef NATIVE
2224glFragColor=vec4(1,1,1,1);
2225#else
2226glFragColor=vec4(0,0,0,1);
2227#endif
2228return;
2229#endif
2230}
2231#endif
2232highp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?
22330.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;
2234#ifdef PROJECTION_GLOBE_VIEW
2235highp 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 ?
2236PI-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);
2237#else
2238horizon_angle=horizon_angle_mercator;
2239#endif
2240horizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;
2240vec3 color_stop_2=u_space_color.rgb;
2241#ifdef ALPHA_PASS
2242float 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);
2243#else
2244vec3 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);
2245#endif
2246}`,`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(
2247mix(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(
2248mix(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);}`),model:hr(`#include "_prelude_fog.fragment.glsl"
2249#include "_prelude_shadow.fragment.glsl"
2250#include "_prelude_lighting.glsl"
2251uniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform 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;
2252#ifdef RENDER_SHADOWS
2253in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;
2254#endif
2255#ifdef OCCLUSION_TEXTURE_TRANSFORM
2256uniform vec4 u_occlusionTextureTransform;
2257#endif
2258#pragma mapbox: define-attribute highp vec3 normal_3f
2259#pragma mapbox: define-attribute highp vec3 color_3f
2260#pragma mapbox: define-attribute highp vec4 color_4f
2261#pragma mapbox: define-attribute highp vec2 uv_2f
2262#pragma mapbox: initialize-attribute highp vec3 normal_3f
2263#pragma mapbox: initialize-attribute highp vec3 color_3f
2264#pragma mapbox: initialize-attribute highp vec4 color_4f
2265#pragma mapbox: initialize-attribute highp vec2 uv_2f
2266#ifdef HAS_ATTRIBUTE_a_pbr
2267in lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;
2268#endif
2269#ifdef HAS_TEXTURE_u_baseColorTexture
2270uniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;
2271#endif
2272#ifdef HAS_TEXTURE_u_metallicRoughnessTexture
2273uniform sampler2D u_metallicRoughnessTexture;
2274#endif
2275#ifdef HAS_TEXTURE_u_occlusionTexture
2276uniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;
2277#endif
2278#ifdef HAS_TEXTURE_u_normalTexture
2279uniform sampler2D u_normalTexture;
2280#endif
2281#ifdef HAS_TEXTURE_u_emissionTexture
2282uniform sampler2D u_emissionTexture;
2283#endif
2284#ifdef APPLY_LUT_ON_GPU
2285uniform highp sampler3D u_lutTexture;
2286#endif
2287#ifdef TERRAIN_FRAGMENT_OCCLUSION
2288in highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack;
2289#ifdef DEPTH_D24
2290highp float unpack_depth(highp float depth) {return  depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}
2291#else
2292highp float unpack_depth_rgba(highp vec4 rgba_depth)
2293{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;}
2294#endif
2295bool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size;
2296#ifdef DEPTH_D24
2297highp float depth=unpack_depth(texture(u_depthTexture,coord).r);
2298#else
2299highp float depth=unpack_depth_rgba(texture(u_depthTexture,coord));
2300#endif
2301return v_depth > depth+0.0005;}
2302#endif
2303#define saturate(_x) clamp(_x,0.,1.)
2304vec3 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)
2305{
2306#ifdef LIGHTING_3D_MODE
2307vec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;
2308#ifdef RENDER_SHADOWS
2309lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);
2310#else
2311lighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));
2312#endif
2313return apply_lighting(albedo,transformed_normal,lighting_factor);
2314#else
2315vec3 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)-light
2315Color),vec3(1.0));return c3;
2316#endif
2317}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;
2318#ifdef HAS_ATTRIBUTE_a_color_3f
2319albedo*=vec4(color_3f,1.0);
2320#endif
2321#ifdef HAS_ATTRIBUTE_a_pbr
2322#else
2323#ifdef HAS_ATTRIBUTE_a_color_4f
2324albedo*=color_4f;
2325#endif
2326#endif
2327#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)
2328vec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}
2329#ifdef UNPREMULT_TEXTURE_IN_SHADER
2330if(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0;
2331#endif
2332if(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}
2333#endif
2334vec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);
2335#ifdef APPLY_LUT_ON_GPU
2336color=applyLUT(u_lutTexture,color);
2337#endif
2338return color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {
2339#ifdef HAS_TEXTURE_u_normalTexture
2340highp 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;
2341#else
2342return mat3(1.0);
2343#endif
2344}highp vec3 getNormal(){highp vec3 n;
2345#ifdef HAS_ATTRIBUTE_a_normal_3f
2346n=normalize(normal_3f);
2347#else
2348highp 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;
2349#endif
2350#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)
2351vec3 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);
2352#endif
2353return 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;
2354#ifdef HAS_ATTRIBUTE_a_pbr
2355mat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;
2356#endif
2357#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) 
2358vec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;
2359#endif
2360const 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)
2361{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float 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)
2362{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)
2363{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)
2364{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)
2365{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)
2366{
2367#ifdef LIGHTING_3D_MODE
2368return mat.diffuseColor;
2369#else
2370return mat.diffuseColor/PI;
2371#endif
2372}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)
2373{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)
2374{vec3 env_light=vec3(0.65,0.65,0.65);
2375#ifdef LIGHTING_3D_MODE
2376float ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;
2377#endif
2378vec3 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)
2379{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;
2380#ifdef RENDER_SHADOWS
2381lighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);
2382#else
2383lighting_factor=NdotL;
2384#endif
2385vec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*light
2385Color;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;
2386#if !defined(LIGHTING_3D_MODE)
2387const 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);
2388#endif
2389color*=intensityFactor;return color;}void main() {
2390#ifdef TERRAIN_FRAGMENT_OCCLUSION
2391if (isOccluded()) {discard;}
2392#endif
2393vec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;
2394#ifdef LIGHTING_3D_MODE
2395lightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;
2396#endif
2397vec4 finalColor;
2398#ifdef DIFFUSE_SHADED
2399vec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);
2400#ifdef HAS_TEXTURE_u_occlusionTexture
2401float ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;
2402#endif
2403finalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;
2404#else
2405Material mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;
2406#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)
2407#ifdef OCCLUSION_TEXTURE_TRANSFORM
2408vec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;
2409#else
2410vec2 uv=uv_2f;
2411#endif
2412ao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;
2413#endif
2414vec4 emissive=u_emissiveFactor;
2415#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)
2416emissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);
2417#endif
2418#ifdef APPLY_LUT_ON_GPU
2419float emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;
2420#endif
2421color+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;
2422#ifdef HAS_ATTRIBUTE_a_pbr
2423float 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;
2424#ifdef APPLY_LUT_ON_GPU
2425color_mix=applyLUT(u_lutTexture,color_mix);
2426#endif
2427color=mix(color,color_mix,min(1.0,resEmission));
2428#ifdef HAS_ATTRIBUTE_a_color_4f
2429float distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.
2429y));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);
2430#endif
2431#endif
2432vec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);
2433#endif
2434#ifdef FOG
2435finalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));
2436#endif
2437#ifdef RENDER_CUTOFF
2438finalColor*=v_cutoff_opacity;
2439#endif
2440#ifdef INDICATOR_CUTOUT
2441finalColor=applyCutout(finalColor,v_position_height.w);
2442#endif
2443glFragColor=finalColor;
2444#ifdef OVERDRAW_INSPECTOR
2445glFragColor=vec4(1.0);
2446#endif
2447HANDLE_WIREFRAME_DEBUG;}`,`#include "_prelude_fog.vertex.glsl"
2448#include "_prelude_shadow.vertex.glsl"
2449in vec3 a_pos_3f;
2450#pragma mapbox: define-attribute highp vec3 normal_3f
2451#pragma mapbox: define-attribute highp vec2 uv_2f
2452#pragma mapbox: define-attribute highp vec3 color_3f
2453#pragma mapbox: define-attribute highp vec4 color_4f
2454#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr
2455#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength
2456uniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;
2457#ifdef INSTANCED_ARRAYS
2458in vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;
2459#else
2460uniform highp mat4 u_normal_matrix;
2461#endif
2462#ifdef RENDER_SHADOWS
2463uniform 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;
2464#endif
2465out vec4 v_position_height;out lowp vec4 v_color_mix;
2466#ifdef TERRAIN_FRAGMENT_OCCLUSION
2467out highp float v_depth;
2468#endif
2469#ifdef HAS_ATTRIBUTE_a_pbr
2470out lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;
2471#endif
2472vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {
2473#pragma mapbox: initialize-attribute highp vec3 normal_3f
2474#pragma mapbox: initialize-attribute highp vec2 uv_2f
2475#pragma mapbox: initialize-attribute highp vec3 color_3f
2476#pragma mapbox: initialize-attribute highp vec4 color_4f
2477#pragma mapbox: initialize-attribute-custom highp vec4 pbr
2478#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength
2479highp mat4 normal_matrix;
2480#ifdef INSTANCED_ARRAYS
2481normal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);
2482#else
2483normal_matrix=u_normal_matrix;
2484#endif
2485vec3 local_pos;mat3 rs;
2486#ifdef MODEL_POSITION_ON_GPU
2487vec3 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;
2488#else
2489local_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);
2490#endif
2491v_position_height.w=a_pos_3f.z;
2492#ifdef HAS_ATTRIBUTE_a_pbr
2493vec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;
2494#endif
2495#ifdef FOG
2496v_fog_pos=fog_position(local_pos);
2497#endif
2498#ifdef RENDER_CUTOFF
2499v_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);
2500#endif
2501#ifdef TERRAIN_FRAGMENT_OCCLUSION
2502v_depth=gl_Position.z/gl_Position.w;
2503#endif
2504#ifdef HAS_ATTRIBUTE_a_normal_3f
2505#ifdef MODEL_POSITION_ON_GPU
2506float 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_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);
2507#else
2508normal_3f=vec3(normal_matrix*vec4(normal_3f,0));
2509#endif
2510#endif
2511#ifdef HAS_ATTRIBUTE_a_pbr
2512#ifdef HAS_ATTRIBUTE_a_color_4f
2513v_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);
2514#endif
2515#endif
2516#ifdef RENDER_SHADOWS
2517vec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);
2518#ifdef NORMAL_OFFSET
2519#ifdef HAS_ATTRIBUTE_a_normal_3f
2520#ifdef MODEL_POSITION_ON_GPU
2521vec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();
2522#else
2523vec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();
2524#endif
2525#endif
2526#endif
2527v_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;
2528#endif
2529}`),modelDepth:hr(`in highp float v_depth;void main() {
2530#ifndef DEPTH_TEXTURE
2531glFragColor=pack_depth(v_depth);
2532#endif
2533}`,`in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;
2534#ifdef MODEL_POSITION_ON_GPU
2535#ifdef INSTANCED_ARRAYS
2536in vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;
2537#else
2538uniform highp mat4 u_instance;
2539#endif
2540uniform highp mat4 u_node_matrix;
2541#endif
2542void main() {
2543#ifdef MODEL_POSITION_ON_GPU
2544highp mat4 instance;
2545#ifdef INSTANCED_ARRAYS
2546instance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);
2547#else
2548instance=u_instance;
2549#endif
2550vec3 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;
2550rs[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);
2551#else
2552gl_Position=u_matrix*vec4(a_pos_3f,1);
2553#endif
2554v_depth=gl_Position.z/gl_Position.w;}`),stars:hr(`in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)
2555{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;}`,`
2556in vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_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_fade_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);}`),snowParticle:hr("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;}",`
2557in 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; 
2558uniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; 
2559uniform float u_horizontalOscillationRate; 
2560uniform 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+
2561localY*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:hr("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;}",`
2562in 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; 
2563uniform float u_velocity; 
2564uniform 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;
2564pos*=halfBoxSize; 
2565pos+=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+
2566localY*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:hr("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);}"),occlusion:hr("uniform vec4 u_color;void main() {glFragColor=u_color;}",`#include "_prelude_terrain.vertex.glsl"
2567in 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;
2568#ifdef TERRAIN
2569float e=elevation(world_pos.xy);world_pos.z+=e;
2570#endif
2571vec4 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 Ja(F,t){const l=F.replace(/\s*\/\/[^\n]*\n/g,`
2572`).split(`
2573`);for(let B of l)if(B=B.trim(),B[0]==="#"&&B.includes("if")&&!B.includes("endif")){B=B.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const G=B.split(" ");for(const Z of G)t.includes(Z)||t.push(Z)}}function hr(F,t){const l=/#include\s+"([^"]+)"/g,B=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g;let G=t.match(/(attribute(\S*)|(^\s*|;)in) (highp |mediump |lowp )?([\w]+) ([\w]+)/gm);G&&(G=G.map(ce=>{const he=ce.split(" ");return he[he.length-1]}),G=[...new Set(G)]);const Z={},Y=[],re=[];if(F=F.replace(l,(ce,he)=>(re.push(he),"")),(t=t.replace(l,(ce,he)=>(Y.push(he),""))).includes("flat out"))return void console.error('The usage of "flat" qualifier is disallowed, see: https://bugs.webkit.org/show_bug.cgi?id=268071');let oe=[...Ya];Ja(F,oe),Ja(t,oe);for(const ce of[...Y,...re])mo[ce]||console.error(`Undefined include: ${ce}`),ll[ce]||(ll[ce]=[],Ja(mo[ce],ll[ce])),oe=[...oe,...ll[ce]];return{fragmentSource:F=F.replace(B,(ce,he,pe,fe,be)=>(Z[be]=!0,he==="define"?`
2574#ifndef HAS_UNIFORM_u_${be}
2575in ${pe} ${fe} ${be};
2576#else
2577uniform ${pe} ${fe} u_${be};
2578#endif
2579`:he==="initialize"?`
2580#ifdef HAS_UNIFORM_u_${be}
2581    ${pe} ${fe} ${be} = u_${be};
2582#endif
2583`:he==="define-attribute"?`
2584#ifdef HAS_ATTRIBUTE_a_${be}
2585    in ${pe} ${fe} ${be};
2586#endif
2587`:he==="initialize-attribute"?"":void 0)),vertexSource:t=t.replace(B,(ce,he,pe,fe,be)=>{const ze=fe==="float"?"vec2":fe,De=be.match(/color/)?"color":ze;return he==="define-attribute-vertex-shader-only"?`
2588#ifdef HAS_ATTRIBUTE_a_${be}
2589in ${pe} ${fe} a_${be};
2590#endif
2591`:Z[be]?he==="define"?`
2592#ifndef HAS_UNIFORM_u_${be}
2593uniform lowp float u_${be}_t;
2594in ${pe} ${ze} a_${be};
2595out ${pe} ${fe} ${be};
2596#else
2597uniform ${pe} ${fe} u_${be};
2598#endif
2599`:he==="initialize"?De==="vec4"?`
2600#ifndef HAS_UNIFORM_u_${be}
2601    ${be} = a_${be};
2602#else
2603    ${pe} ${fe} ${be} = u_${be};
2604#endif
2605`:`
2606#ifndef HAS_UNIFORM_u_${be}
2607    ${be} = unpack_mix_${De}(a_${be}, u_${be}_t);
2608#else
2609    ${pe} ${fe} ${be} = u_${be};
2610#endif
2611`:he==="define-attribute"?`
2612#ifdef HAS_ATTRIBUTE_a_${be}
2613    in ${pe} ${fe} a_${be};
2614    out ${pe} ${fe} ${be};
2615#endif
2616`:he==="initialize-attribute"?`
2617#ifdef HAS_ATTRIBUTE_a_${be}
2618    ${be} = a_${be};
2619#endif
2620`:void 0:he==="define"?`
2621#ifndef HAS_UNIFORM_u_${be}
2622uniform lowp float u_${be}_t;
2623in ${pe} ${ze} a_${be};
2624#else
2625uniform ${pe} ${fe} u_${be};
2626#endif
2627`:he==="define-instanced"?De==="mat4"?`
2628#ifdef INSTANCED_ARRAYS
2629in vec4 a_${be}0;
2630in vec4 a_${be}1;
2631in vec4 a_${be}2;
2632in vec4 a_${be}3;
2633#else
2634uniform ${pe} ${fe} u_${be};
2635#endif
2636`:`
2637#ifdef INSTANCED_ARRAYS
2638in ${pe} ${ze} a_${be};
2639#else
2640uniform ${pe} ${fe} u_${be};
2641#endif
2642`:he==="initialize-attribute-custom"?`
2643#ifdef HAS_ATTRIBUTE_a_${be}
2644    ${pe} ${fe} ${be} = a_${be};
2645#endif
2646`:De==="vec4"?`
2647#ifndef HAS_UNIFORM_u_${be}
2648    ${pe} ${fe} ${be} = a_${be};
2649#else
2650    ${pe} ${fe} ${be} = u_${be};
2651#endif
2652`:`
2653#ifndef HAS_UNIFORM_u_${be}
2654    ${pe} ${fe} ${be} = unpack_mix_${De}(a_${be}, u_${be}_t);
2655#else
2656    ${pe} ${fe} ${be} = u_${be};
2657#endif
2658`}),staticAttributes:G,usedDefines:oe,vertexIncludes:Y,fragmentIncludes:re}}class ad{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(t,l,B,G,Z,Y,re,oe){this.context=t;let ce=this.boundPaintVertexBuffers.length!==G.length;for(let pe=0;!ce&&pe<G.length;pe++)this.boundPaintVertexBuffers[pe]!==G[pe]&&(ce=!0);let he=this.boundDynamicVertexBuffers.length!==re.length;for(let pe=0;!he&&pe<re.length;pe++)this.boundDynamicVertexBuffers[pe]!==re[pe]&&(he=!0);if(!this.vao||this.boundProgram!==l||this.boundLayoutVertexBuffer!==B||ce||he||this.boundIndexBuffer!==Z||this.boundVertexOffset!==Y)this.freshBind(l,B,G,Z,Y,re,oe);else{t.bindVertexArrayOES.set(this.vao);for(const pe of re)pe&&(pe.bind(),oe&&pe.instanceCount&&pe.setVertexAttribDivisor(t.gl,l,oe));Z&&Z.dynamicDraw&&Z.bind()}}freshBind(t,l,B,G,Z,Y,re){const oe=t.numAttributes,ce=this.context,he=ce.gl;this.vao&&this.destroy(),this.vao=ce.gl.createVertexArray(),ce.bindVertexArrayOES.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=l,this.boundPaintVertexBuffers=B,this.boundIndexBuffer=G,this.boundVertexOffset=Z,this.boundDynamicVertexBuffers=Y,l.enableAttributes(he,t),l.bind(),l.setVertexAttribPointers(he,t,Z);for(const pe of B)pe.enableAttributes(he,t),pe.bind(),pe.setVertexAttribPointers(he,t,Z);for(const pe of Y)pe&&(pe.enableAttributes(he,t),pe.bind(),pe.setVertexAttribPointers(he,t,Z),re&&pe.instanceCount&&pe.setVertexAttribDivisor(he,t,re));G&&G.bind(),ce.currentNumAttributes=oe}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null)}}function _o(F,t){const l=Math.pow(2,t.canonical.z),B=t.canonical.y;return[new o.aa(0,B/l).toLngLat().lat,new o.aa(0,(B+1)/l).toLngLat().lat]}function od(F,t,l,B,G,Z,Y){const re=F.context,oe=re.gl,ce=l.hillshadeFBO;if(!ce)return;F.prepareDrawTile();const he=F.isTileAffectedByFog(t),pe=F.getOrCreateProgram("hillshade",{overrideFog:he});
vendor: 41,514 bytes, lines 2658-2659
2658re.activeTexture.set(oe.TEXTURE0),oe.bindTexture(oe.TEXTURE_2D,ce.colorAttachment.get());const fe=((Oe,Fe,Ge,Xe)=>{const Ze=Ge.paint.get("hillshade-shadow-color"),nt=Ge.paint.get("hillshade-shadow-color-use-theme").constantOr("default")==="none",Qe=Ge.paint.get("hillshade-highlight-color"),it=Ge.paint.get("hillshade-highlight-color-use-theme").constantOr("default")==="none",Ke=Ge.paint.get("hillshade-accent-color"),ht=Ge.paint.get("hillshade-accent-color-use-theme").constantOr("default")==="none",yt=Ge.paint.get("hillshade-emissive-strength");let Nt=o.ai(Ge.paint.get("hillshade-illumination-direction"));if(Ge.paint.get("hillshade-illumination-anchor")==="viewport")Nt-=Oe.transform.angle;else if(Oe.style&&Oe.style.enable3dLights()&&Oe.style.directionalLight){const Wt=Oe.style.directionalLight.properties.get("direction"),$t=o.cb(Wt.x,Wt.y,Wt.z);Nt=o.ai($t[1])}const Dt=!Oe.options.moving;return{u_matrix:Xe||Oe.transform.calculateProjMatrix(Fe.tileID.toUnwrapped(),Dt),u_image:0,u_latrange:_o(0,Fe.tileID),u_light:[Ge.paint.get("hillshade-exaggeration"),Nt],u_shadow:Ze.toRenderColor(nt?null:Ge.lut),u_highlight:Qe.toRenderColor(it?null:Ge.lut),u_emissive_strength:yt,u_accent:Ke.toRenderColor(ht?null:Ge.lut)}})(F,l,B,F.terrain?t.projMatrix:null);F.uploadCommonUniforms(re,pe,t.toUnwrapped());const{tileBoundsBuffer:be,tileBoundsIndexBuffer:ze,tileBoundsSegments:De}=F.getTileBoundsBuffers(l);pe.draw(F,oe.TRIANGLES,G,Z,Y,qi.disabled,fe,B.id,be,ze,De)}function ld(F,t,l){if(!t.needsDEMTextureUpload)return;const B=F.context,G=B.gl;B.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||F.getTileTexture(l.stride);const Z=l.getPixels();t.demTexture?t.demTexture.update(Z,{premultiply:!1}):t.demTexture=new o.T(B,Z,G.R32F,{premultiply:!1}),t.needsDEMTextureUpload=!1}function Gp(F,t,l){const B=F.context,G=B.gl;if(!t.dem)return;const Z=t.dem;if(B.activeTexture.set(G.TEXTURE1),ld(F,t,Z),!t.demTexture)return;t.demTexture.bind(G.NEAREST,G.CLAMP_TO_EDGE);const Y=Z.dim;B.activeTexture.set(G.TEXTURE0);let re=t.hillshadeFBO;if(!re){const fe=new o.T(B,{width:Y,height:Y,data:null},G.RGBA8);fe.bind(G.LINEAR,G.CLAMP_TO_EDGE),re=t.hillshadeFBO=B.createFramebuffer(Y,Y,!0,"renderbuffer"),re.colorAttachment.set(fe.texture)}B.bindFramebuffer.set(re.framebuffer),B.viewport.set([0,0,Y,Y]);const{tileBoundsBuffer:oe,tileBoundsIndexBuffer:ce,tileBoundsSegments:he}=F.getMercatorTileBoundsBuffers(),pe=[];F.linearFloatFilteringSupported()&&pe.push("TERRAIN_DEM_FLOAT_FORMAT"),F.getOrCreateProgram("hillshadePrepare",{defines:pe}).draw(F,G.TRIANGLES,ki.disabled,Ui.disabled,ir.unblended,qi.disabled,((fe,be)=>{const ze=be.stride,De=o.ab.mat4.create();return o.ab.mat4.ortho(De,0,o.ag,-o.ag,0,0,1),o.ab.mat4.translate(De,De,[0,-o.ag,0]),{u_matrix:De,u_image:1,u_dimension:[ze,ze],u_zoom:fe.overscaledZ}})(t.tileID,Z),l.id,oe,ce,he),t.needsHillshadePrepare=!1}class qr{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Sh extends qr{getDefault(){return o.aj.transparent}set(t){const l=this.current;(t.r!==l.r||t.g!==l.g||t.b!==l.b||t.a!==l.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Th extends qr{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Eh extends qr{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class Ah extends qr{getDefault(){return[!0,!0,!0,!0]}set(t){const l=this.current;(t[0]!==l[0]||t[1]!==l[1]||t[2]!==l[2]||t[3]!==l[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class cd extends qr{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class hd extends qr{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class qp extends qr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const l=this.current;(t.func!==l.func||t.ref!==l.ref||t.mask!==l.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class hl extends qr{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const l=this.current;(t[0]!==l[0]||t[1]!==l[1]||t[2]!==l[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class ul extends qr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;t?l.enable(l.STENCIL_TEST):l.disable(l.STENCIL_TEST),this.current=t,this.dirty=!1}}class ud extends qr{getDefault(){return[0,1]}set(t){const l=this.current;(t[0]!==l[0]||t[1]!==l[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class us extends qr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;t?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),this.current=t,this.dirty=!1}}class Mh extends qr{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class lc extends qr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;t?l.enable(l.BLEND):l.disable(l.BLEND),this.current=t,this.dirty=!1}}class cc extends qr{getDefault(){const t=this.gl;return[t.ONE,t.ZERO,t.ONE,t.ZERO]}set(t){const l=this.current;(t[0]!==l[0]||t[1]!==l[1]||t[2]!==l[2]||t[3]!==l[3]||this.dirty)&&(this.gl.blendFuncSeparate(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Ph extends qr{getDefault(){return o.aj.transparent}set(t){const l=this.current;(t.r!==l.r||t.g!==l.g||t.b!==l.b||t.a!==l.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Ch extends qr{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(t,t),this.current=t,this.dirty=!1)}}class hc extends qr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;t?l.enable(l.CULL_FACE):l.disable(l.CULL_FACE),this.current=t,this.dirty=!1}}class Ih extends qr{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class Dh extends qr{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}let uc=class extends qr{getDefault(){return null}set(F){(F!==this.current||this.dirty)&&(this.gl.useProgram(F),this.current=F,this.dirty=!1)}};class dd extends qr{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class pd extends qr{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const l=this.current;(t[0]!==l[0]||t[1]!==l[1]||t[2]!==l[2]||t[3]!==l[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class yo extends qr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;l.bindFramebuffer(l.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class $p extends qr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;l.bindRenderbuffer(l.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Hp extends qr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;l.bindTexture(l.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Wp extends qr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;l.bindBuffer(l.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Zp extends qr{getDefault(){return null}set(t){const l=this.gl;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Xp extends qr{getDefault(){return null}set(t){this.gl&&(t!==this.current||this.dirty)&&(this.gl.bindVertexArray(t),this.current=t,this.dirty=!1)}}class Yp extends qr{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;l.pixelStorei(l.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class kh extends qr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Rh extends qr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const l=this.gl;l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class dc extends qr{constructor(t,l){super(t),this.context=t,this.parent=l}getDefault(){return null}}class vo extends dc{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const l=this.gl;l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class zh extends dc{attachment(){return this.gl.DEPTH_ATTACHMENT}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const l=this.gl;l.framebufferRenderbuffer(l.FRAMEBUFFER,this.attachment(),l.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class fd extends dc{attachment(){return this.gl.DEPTH_ATTACHMENT}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const l=this.gl;l.framebufferTexture2D(l.FRAMEBUFFER,this.attachment(),l.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class md extends zh{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const Lh=(F,t,l)=>({u_matrix:F,u_image0:0,u_skirt_height:t,u_ground_shadow_factor:l}),Aa=(F,t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De)=>({u_proj_matrix:Float32Array.from(F),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(B),u_merc_matrix:l,u_zoom_transition:G,u_merc_center:Z,u_image0:0,u_frustum_tl:Y,u_frustum_tr:re,u_frustum_br:oe,u_frustum_bl:ce,u_globe_pos:he,u_globe_radius:pe,u_viewport:fe,u_grid_matrix:De?Float32Array.from(De):new Float32Array(9),u_skirt_height:be,u_far_z_cutoff:ze});function Fh(F,t){return F!=null&&t!=null&&!(!F.hasData()||!t.hasData())&&F.demTexture!=null&&t.demTexture!=null&&F.tileID.key!==t.tileID.key}const gs=new class{constructor(){this.operations={}}newMorphing(F,t,l,B,G){if(F in this.operations){const Z=this.operations[F];Z.to.tileID.key!==l.tileID.key&&(Z.queued=l)}else this.operations[F]={startTime:B,phase:0,duration:G,from:t,to:l,queued:null}}getMorphValuesForProxy(F){if(!(F in this.operations))return null;const t=this.operations[F];return{from:t.from,to:t.to,phase:t.phase}}update(F){for(const t in this.operations){const l=this.operations[t];for(l.phase=(F-l.startTime)/l.duration;l.phase>=1||!this._validOp(l);)if(!this._nextOp(l,F)){delete this.operations[t];break}}}_nextOp(F,t){return!!F.queued&&(F.from=F.to,F.to=F.queued,F.queued=null,F.phase=0,F.startTime=t,!0)}_validOp(F){return F.from.hasData()&&F.to.hasData()}},pc={0:null,1:"TERRAIN_VERTEX_MORPHING"};function dl(F,t,l){if(t===0)return 0;const B=t<1&&l===514?.25/t:1;return 6*Math.pow(1.5,22-F)*Math.max(t,1)*B}function gd(F,t){const l=1<<F.z;return!t&&(F.x===0||F.x===l-1)||F.y===0||F.y===l-1}const fc=F=>({u_matrix:F});function pl(F,t,l,B,G){if(G>0){const Z=o.q.now(),Y=(Z-F.timeAdded)/G,re=t?(Z-t.timeAdded)/G:-1,oe=l.getSource(),ce=B.coveringZoomLevel({tileSize:oe.tileSize,roundZoom:oe.roundZoom}),he=!t||Math.abs(t.tileID.overscaledZ-ce)>Math.abs(F.tileID.overscaledZ-ce),pe=he&&F.refreshedUponExpiration?1:o.aw(he?Y:1-re,0,1);return F.refreshedUponExpiration&&Y>=1&&(F.refreshedUponExpiration=!1),t?{opacity:1,mix:1-pe}:{opacity:pe,mix:0}}return{opacity:1,mix:0}}class Oh extends Es{constructor(t){const l={type:"raster-dem",maxzoom:t.transform.maxZoom},B=new o.D(o.ci(),null),G=ts("mock-dem",l,B,t.style);super("mock-dem",G,!1),G.setEventedParent(this),this._sourceLoaded=!0}_loadTile(t,l){t.state="loaded",l(null)}}class Jp extends Es{constructor(t){const l=ts("proxy",{type:"geojson",maxzoom:t.transform.maxZoom},new o.D(o.ci(),null),t.style);super("proxy",l,!1),l.setEventedParent(this),this.map=this.getSource().map=t,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(t,l,B){if(t.freezeTileCoverage)return;this.transform=t;const G=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((Z,Y)=>{if(Z[Y.key]="",!this._tiles[Y.key]){const re=new ba(Y,this._source.tileSize*Y.overscaleFactor(),t.tileZoom);re.state="loaded",this._tiles[Y.key]=re}return Z},{});for(const Z in this._tiles)Z in G||(this.freeFBO(Z),this._tiles[Z].unloadVectorData(),delete this._tiles[Z])}freeFBO(t){const l=this.proxyCachedFBO[t];if(l!==void 0){const B=Object.values(l);this.renderCachePool.push(...B),delete this.proxyCachedFBO[t]}}deallocRenderCache(){this.renderCache.forEach(t=>t.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Bh extends o.aG{constructor(t,l,B){super(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y),this.proxyTileKey=l,this.projMatrix=B}}class xo extends o.cJ{constructor(t,l){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},t.tp.registerParameter(this._debugParams,["Terrain"],"sortTilesHiZFirst",{},()=>{this._style.map.triggerRepaint()}),t.tp.registerParameter(this._debugParams,["Terrain"],"disableRenderCache",{},()=>{this._style.map.triggerRepaint()}),t.tp.registerButton(["Terrain"],"Invalidate Render Cache",()=>{this.invalidateRenderCache=!0,this._style.map.triggerRepaint()}),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[B,G,Z]=function(oe){const ce=new o.b4,he=new o.aU,pe=131;ce.reserve(17161),he.reserve(33800);const fe=o.ag/128,be=o.ag+fe/2,ze=be+fe;for(let Oe=-fe;Oe<ze;Oe+=fe)for(let Fe=-fe;Fe<ze;Fe+=fe){const Ge=Fe<0||Fe>be||Oe<0||Oe>be?24575:0,Xe=o.aw(Math.round(Fe),0,o.ag),Ze=o.aw(Math.round(Oe),0,o.ag);ce.emplaceBack(Xe+Ge,Ze)}const De=(Oe,Fe)=>{const Ge=Fe*pe+Oe;he.emplaceBack(Ge+1,Ge,Ge+pe),he.emplaceBack(Ge+pe,Ge+pe+1,Ge+1)};for(let Oe=1;Oe<129;Oe++)for(let Fe=1;Fe<129;Fe++)De(Fe,Oe);return[0,129].forEach(Oe=>{for(let Fe=0;Fe<130;Fe++)De(Fe,Oe),De(Oe,Fe)}),[ce,he,32768]}(),Y=t.context;this.gridBuffer=Y.createVertexBuffer(B,o.b6.members),this.gridIndexBuffer=Y.createIndexBuffer(G),this.gridSegments=o.b7.simpleSegment(0,0,B.length,G.length),this.gridNoSkirtSegments=o.b7.simpleSegment(0,0,B.length,Z),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Jp(l.map),this.orthoMatrix=o.ab.mat4.create(),o.ab.mat4.ortho(this.orthoMatrix,this.painter.transform.projection.name==="globe"?.015:0,o.ag,0,o.ag,0,1);const re=Y.gl;this._overlapStencilMode=new Ui({func:re.GEQUAL,mask:255},0,255,re.KEEP,re.KEEP,re.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=l,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Oh(l.map),this._pendingGroundEffectLayers=[]}set style(t){t.on("data",this._onStyleDataEvent.bind(this)),this._style=t,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(t,l,B){if(t&&t.terrain){this._style!==t&&(this.style=t,this._evaluationZoom=void 0);const G=t.terrain.properties,Z=t.terrain.drapeRenderMode===0,Y=t.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=o.q.now();const re=t.terrain&&t.terrain.scope,oe=G.get("source"),ce=Z?this._mockSourceCache:t.getSourceCache(oe,re);if(!ce)return void o.w(`Couldn't find terrain source "${oe}".`);if(this.sourceCache=ce,this._attenuationRange=t.terrain.getAttenuationRange(),this._exaggeration=Y?this.calculateExaggeration(l):G.get("exaggeration"),!l.projection.requiresDraping&&Y&&this._exaggeration===0)return void this._disable();this.enabled=!0;const he=()=>{this.sourceCache.used&&o.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.
2659This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const pe=this.getScaledDemTileSize();this.sourceCache.update(l,pe,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,he(),this._initializing=!0),he(),l.updateElevation(!0,B),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(l),this._emptyDEMTextureDirty=!0,this._previousZoom=l.zoom}else this._disable()}calculateExaggeration(t){if(this._attenuationRange&&t.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(t.zoom);const l=this._previousCameraAltitude,B=t.getFreeCameraOptions().position.z/t.pixelsPerMeter*t.worldSize;this._previousCameraAltitude=B;const G=l!=null?B-l:Number.MAX_VALUE;if(Math.abs(G)<2)return this._exaggeration;const Z=t.zoom,Y=this._style.terrain;if(!this._previousUpdateTimestamp)return Y.getExaggeration(Z);let re=Z-this._previousZoom;const oe=this._previousUpdateTimestamp;let ce=Z;this._evaluationZoom!=null&&(ce=this._evaluationZoom,Math.abs(Z-ce)>.5&&(re=.5*(Z-ce+re)),re*G<0&&(ce+=re)),this._evaluationZoom=ce;const he=Y.getExaggeration(ce),pe=he===Y.getExaggeration(Math.max(0,ce-.1));if(pe&&Math.abs(he-this._exaggeration)<.01)return he;let fe=Math.min(.1,.00375*(this._updateTimestamp-oe));return(pe||he<.1||Math.abs(re)<1e-4)&&(fe=Math.min(.2,4*fe)),o.af(this._exaggeration,he,fe)}resetTileLookupCache(t){this._findCoveringTileCache[t]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(t){t.coord&&t.dataType==="source"?this._clearRenderCacheForTile(t.sourceCacheId,t.coord):t.dataType==="style"&&(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 t in this._style._mergedSourceCaches)this._style._mergedSourceCaches[t].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(t=>t.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 t=2*this.proxySourceCache.getSource().tileSize;return[t,t]}set useVertexMorphing(t){this._useVertexMorphing=t}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const l=this.proxySourceCache,B=this.painter.transform;this._initializing&&(this._initializing=B._centerAltitude===0&&this.getAtPointOrZero(o.aa.fromLngLat(B.center),-1)===-1,this._emptyDEMTextureDirty=!this._initializing);const G=this.proxyCoords=l.getIds().map(oe=>{const ce=l.getTileByID(oe).tileID;return ce.projMatrix=B.calculateProjMatrix(ce.toUnwrapped()),ce});(function(oe,ce){const he=ce.transform.pointCoordinate(ce.transform.getCameraPoint()),pe=new o.P(he.x,he.y);oe.sort((fe,be)=>{if(be.overscaledZ-fe.overscaledZ)return be.overscaledZ-fe.overscaledZ;const ze=new o.P(fe.canonical.x+(1<<fe.canonical.z)*fe.wrap,fe.canonical.y),De=new o.P(be.canonical.x+(1<<be.canonical.z)*be.wrap,be.canonical.y),Oe=pe.mult(1<<fe.canonical.z);return Oe.x-=.5,Oe.y-=.5,Oe.distSqr(ze)-Oe.distSqr(De)})})(G,this.painter);const Z=this.proxyToSource||{};this.proxyToSource={},G.forEach(oe=>{this.proxyToSource[oe.key]={}}),this.terrainTileForTile={};const Y=this._style._mergedSourceCaches;for(const oe in Y){const ce=Y[oe];if(!ce.used||(ce!==this.sourceCache&&this.resetTileLookupCache(ce.id),this._setupProxiedCoordsForOrtho(ce,t[oe],Z),ce.usedForTerrain))continue;const he=t[oe];ce.getSource().reparseOverscaled&&this._assignTerrainTiles(he)}this.proxiedCoords[l.id]=G.map(oe=>new Bh(oe,oe.key,this.orthoMatrix)),this._assignTerrainTiles(G),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(Z),this.renderingToTexture=!1;const re={};this._visibleDemTiles=[];for(const oe of this.proxyCoords){const ce=this.terrainTileForTile[oe.key];if(!ce)continue;const he=ce.tileID.key;he in re||(this._visibleDemTiles.push(ce),re[he]=he)}}_assignTerrainTiles(t){this._initializing||t.forEach(l=>{if(this.terrainTileForTile[l.key])return;const B=this._findTileCoveringTileID(l,this.sourceCache);B&&(this.terrainTileForTile[l.key]=B)})}_prepareDEMTextures(){const t=this.painter.context,l=t.gl;for(const B in this.terrainTileForTile){const G=this.terrainTileForTile[B],Z=G.dem;!Z||G.demTexture&&!G.needsDEMTextureUpload||(t.activeTexture.set(l.TEXTURE1),ld(this.painter,G,Z))}}_prepareDemTileUniforms(t,l,B,G){if(!l||l.demTexture==null)return!1;const Z=t.tileID.canonical,Y=Math.pow(2,l.tileID.canonical.z-Z.z),re=G||"";return B[`u_dem_tl${re}`]=[Z.x*Y%1,Z.y*Y%1],B[`u_dem_scale${re}`]=Y,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let t=0;const l=this._visibleDemTiles.reduce((B,G)=>{if(!G.dem)return B;const Z=G.dem.tree.minimums[0];return Z>0&&t++,B+Z},0);return t?l/t:0}_updateEmptyDEMTexture(){const t=this.painter.context,l=t.gl;t.activeTexture.set(l.TEXTURE2);const B=this._getLoadedAreaMinimum(),G=new o.cK({width:1,height:1},new Float32Array([B]));this._emptyDEMTextureDirty=!1;let Z=this._emptyDEMTexture;return Z?Z.update(G,{premultiply:!1}):Z=this._emptyDEMTexture=new o.T(t,G,l.R32F,{premultiply:!1}),Z}setupElevationDraw(t,l,B){const G=this.painter.context,Z=G.gl,Y={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};Y.u_exaggeration=this.exaggeration();let re=null,oe=null,ce=1;if(B&&B.morphing&&this._useVertexMorphing){const be=B.morphing.srcDemTile,ze=B.morphing.dstDemTile;ce=B.morphing.phase,be&&ze&&(this._prepareDemTileUniforms(t,be,Y,"_prev")&&(oe=be),this._prepareDemTileUniforms(t,ze,Y)&&(re=ze))}const he=be=>be&&be.demTexture&&this.painter.linearFloatFilteringSupported()?Z.LINEAR:Z.NEAREST;let pe=null;var fe;if(this.enabled?oe&&re?(pe=re.demTexture,G.activeTexture.set(Z.TEXTURE4),oe.demTexture.bind(he(oe),Z.CLAMP_TO_EDGE),Y.u_dem_lerp=ce):(re=this.terrainTileForTile[t.tileID.key],pe=this._prepareDemTileUniforms(t,re,Y)?re.demTexture:this.emptyDEMTexture):pe=this.emptyDEMTexture,G.activeTexture.set(Z.TEXTURE2),pe&&(Y.u_dem_size=(fe=pe).size[0]===1?1:fe.size[0]-2,pe.bind(he(re),Z.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(B&&B.useDepthForOcclusion,l,Y),B&&B.useMeterToDem&&re){const be=(1<<re.tileID.canonical.z)*o.bH(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;Y.u_meter_to_dem=be}if(B&&B.labelPlaneMatrixInv&&(Y.u_label_plane_matrix_inv=B.labelPlaneMatrixInv),l.setTerrainUniformValues(G,Y),this.painter.transform.projection.name==="globe"){const be=this.globeUniformValues(this.painter.transform,t.tileID.canonical,B&&B.useDenormalizedUpVectorScale);l.setGlobeUniformValues(G,be)}}globeUniformValues(t,l,B){const G=t.projection;return{u_tile_tl_up:G.upVector(l,0,0),u_tile_tr_up:G.upVector(l,o.ag,0),u_tile_br_up:G.upVector(l,o.ag,o.ag),u_tile_bl_up:G.upVector(l,0,o.ag),u_tile_up_scale:B?o.cL(1):G.upVectorScale(l,t.center.lat,t.worldSize).metersToTile}}renderToBackBuffer(t){const l=this.painter,B=this.painter.context;t.length!==0&&(B.bindFramebuffer.set(null),B.viewport.set([0,0,l.width,l.height]),l.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(G,Z,Y,re,oe){if(G.transform.projection.name==="globe")(function(ce,he,pe,fe,be){const ze=ce.context,De=ze.gl;let Oe,Fe;const Ge=ce.transform,Xe=o.cC(ce,ze,Ge),Ze=(Wt,$t)=>{if(Fe===$t)return;const At=[pc[$t],"PROJECTION_GLOBE_VIEW"];Xe&&At.push("CUSTOM_ANTIALIASING");const Vt=ce.isTileAffectedByFog(Wt);Oe=ce.getOrCreateProgram("globeRaster",{defines:At,overrideFog:Vt}),Fe=$t},nt=ce.colorModeForRenderPass(),Qe=new ki(De.LEQUAL,ki.ReadWrite,ce.depthRangeFor3D);gs.update(be);const it=o.cD(Ge),Ke=[o.at(Ge.center.lng),o.aA(Ge.center.lat)],ht=ce.globeSharedBuffers,yt=[Ge.width*o.q.devicePixelRatio,Ge.height*o.q.devicePixelRatio],Nt=Float32Array.from(Ge.globeMatrix),Dt={useDenormalizedUpVectorScale:!0};{const Wt=ce.transform,$t=dl(Wt.zoom,he.exaggeration(),he.sourceCache._source.tileSize);Fe=-1;const At=De.TRIANGLES;for(const Vt of fe){const ii=pe.getTile(Vt),Et=Ui.disabled,Jt=he.prevTerrainTileForTile[Vt.key],Ut=he.terrainTileForTile[Vt.key];Fh(Jt,Ut)&&gs.newMorphing(Vt.key,Jt,Ut,be,250),ze.activeTexture.set(De.TEXTURE0),ii.texture&&ii.texture.bind(De.LINEAR,De.CLAMP_TO_EDGE);const hi=gs.getMorphValuesForProxy(Vt.key),Qt=hi?1:0;hi&&o.J(Dt,{morphing:{srcDemTile:hi.from,dstDemTile:hi.to,phase:o.cB(hi.phase)}});const Xt=o.cE(Vt.canonical),ri=o.cF(Xt.getCenter().lat),ci=o.cG(Vt.canonical,Xt,ri,Wt.worldSize/Wt._pixelsPerMercatorPixel),xi=o.bb(o.cH(Vt.canonical)),Si=Aa(Wt.expandedFarZProjMatrix,Nt,it,xi,o.ae(Wt.zoom),Ke,Wt.frustumCorners.TL,Wt.frustumCorners.TR,Wt.frustumCorners.BR,Wt.frustumCorners.BL,Wt.globeCenterInViewSpace,Wt.globeRadius,yt,$t,Wt._farZ,ci);if(Ze(Vt,Qt),Oe&&(he.setupElevationDraw(ii,Oe,Dt),ce.uploadCommonUniforms(ze,Oe,Vt.toUnwrapped()),ht)){const[Vi,Ci,Ri]=ht.getGridBuffers(ri,$t!==0);Oe.draw(ce,At,Qe,Et,nt,qi.backCCW,Si,"globe_raster",Vi,Ci,Ri)}}}if(ht&&(ce.renderDefaultNorthPole||ce.renderDefaultSouthPole)){const Wt=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];Xe&&Wt.push("CUSTOM_ANTIALIASING"),Oe=ce.getOrCreateProgram("globeRaster",{defines:Wt});for(const $t of fe){const{x:At,y:Vt,z:ii}=$t.canonical,Et=Vt===0,Jt=Vt===(1<<ii)-1,[Ut,hi,Qt,Xt]=ht.getPoleBuffers(ii,!1);if(Xt&&(Et||Jt)){const ri=pe.getTile($t);ze.activeTexture.set(De.TEXTURE0),ri.texture&&ri.texture.bind(De.LINEAR,De.CLAMP_TO_EDGE);let ci=o.cI(ii,At,Ge);const xi=o.bb(o.cH($t.canonical)),Si=(Vi,Ci)=>Vi.draw(ce,De.TRIANGLES,Qe,Ui.disabled,nt,qi.disabled,Aa(Ge.expandedFarZProjMatrix,ci,ci,xi,0,Ke,Ge.frustumCorners.TL,Ge.frustumCorners.TR,Ge.frustumCorners.BR,Ge.frustumCorners.BL,Ge.globeCenterInViewSpace,Ge.globeRadius,yt,0,Ge._farZ),"globe_pole_raster",Ci,Qt,Xt);he.setupElevationDraw(ri,Oe,Dt),ce.uploadCommonUniforms(ze,Oe,$t.toUnwrapped()),Et&&ce.renderDefaultNorthPole&&Si(Oe,Ut),Jt&&ce.renderDefaultSouthPole&&(ci=o.ab.mat4.scale(o.ab.mat4.create(),ci,[1,-1,1]),Si(Oe,hi))}}}})(G,Z,Y,re,oe);else{const ce=G.context,he=ce.gl;let pe,fe;const be=G.shadowRenderer,ze=Ta(G,G.longestCutoffRange),De=nt=>{if(fe===nt)return;const Qe=[];Qe.push(pc[nt]),ze.shouldRenderCutoff&&Qe.push("RENDER_CUTOFF"),be&&(Qe.push("RENDER_SHADOWS","DEPTH_TEXTURE"),be.useNormalOffset&&Qe.push("NORMAL_OFFSET")),pe=G.getOrCreateProgram("terrainRaster",{defines:Qe}),fe=nt},Oe=G.colorModeForRenderPass(),Fe=new ki(he.LEQUAL,ki.ReadWrite,G.depthRangeFor3D);gs.update(oe);const Ge=G.transform,Xe=dl(Ge.zoom,Z.exaggeration(),Z.sourceCache._source.tileSize);let Ze=[0,0,0];if(be){const nt=G.style.directionalLight,Qe=G.style.ambientLight;nt&&Qe&&(Ze=_h(G.style,nt,Qe))}{fe=-1;const nt=he.TRIANGLES,[Qe,it]=[Z.gridIndexBuffer,Z.gridSegments];for(const Ke of re){const ht=Y.getTile(Ke),yt=Ui.disabled,Nt=Z.prevTerrainTileForTile[Ke.key],Dt=Z.terrainTileForTile[Ke.key];Fh(Nt,Dt)&&gs.newMorphing(Ke.key,Nt,Dt,oe,250),ce.activeTexture.set(he.TEXTURE0),ht.texture&&ht.texture.bind(he.LINEAR,he.CLAMP_TO_EDGE);const Wt=gs.getMorphValuesForProxy(Ke.key),$t=Wt?1:0;let At;Wt&&(At={morphing:{srcDemTile:Wt.from,dstDemTile:Wt.to,phase:o.cB(Wt.phase)}});const Vt=Lh(Ke.projMatrix,gd(Ke.canonical,Ge.renderWorldCopies)?Xe/10:Xe,Ze);if(De($t),!pe)continue;Z.setupElevationDraw(ht,pe,At);const ii=Ke.toUnwrapped();be&&be.setupShadows(ii,pe),G.uploadCommonUniforms(ce,pe,ii,null,ze),pe.draw(G,nt,Fe,yt,Oe,qi.backCCW,Vt,"terrain_raster",Z.gridBuffer,Qe,it)}}}}(l,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,l.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(this._drapedRenderBatches.length===0)return t+1;this.renderingToTexture=!0;const l=this.painter,B=this.painter.context,G=this.proxySourceCache,Z=this.proxiedCoords[G.id],Y=this._drapedRenderBatches.shift(),re=l.style.order,oe=[];let ce=0;for(const he of Z){const pe=G.getTileByID(he.proxyTileKey),fe=G.proxyCachedFBO[he.key]?G.proxyCachedFBO[he.key][t]:void 0,be=fe!==void 0?G.renderCache[fe]:this.pool[ce++],ze=fe!==void 0;if(pe.texture=be.tex,ze&&!be.dirty){oe.push(pe.tileID);continue}let De;B.bindFramebuffer.set(be.fb.framebuffer),this.renderedToTile=!1,be.dirty&&(B.clear({color:o.aj.transparent,stencil:0}),be.dirty=!1);for(let Oe=Y.start;Oe<=Y.end;++Oe){const Fe=l.style._mergedLayers[re[Oe]];if(Fe.isHidden(l.transform.zoom))continue;const Ge=l.style.getLayerSourceCache(Fe),Xe=Ge?this.proxyToSource[he.key][Ge.id]:[he];if(!Xe)continue;const Ze=Xe;B.viewport.set([0,0,be.fb.width,be.fb.height]),De!==(Ge?Ge.id:null)&&(this._setupStencil(be,Xe,Fe,Ge),De=Ge?Ge.id:null),l.renderLayer(l,Ge,Fe,Ze)}if(this._drapedRenderBatches.length===0)for(const Oe of this._pendingGroundEffectLayers){const Fe=l.style._mergedLayers[re[Oe]];if(Fe.isHidden(l.transform.zoom))continue;const Ge=l.style.getLayerSourceCache(Fe),Xe=Ge?this.proxyToSource[he.key][Ge.id]:[he];if(!Xe)continue;const Ze=Xe;B.viewport.set([0,0,be.fb.width,be.fb.height]),De!==(Ge?Ge.id:null)&&(this._setupStencil(be,Xe,Fe,Ge),De=Ge?Ge.id:null),l.renderLayer(l,Ge,Fe,Ze)}this.renderedToTile?(be.dirty=!0,oe.push(pe.tileID)):ze||--ce,ce===5&&(ce=0,this.renderToBackBuffer(oe))}return this.renderToBackBuffer(oe),this.renderingToTexture=!1,B.bindFramebuffer.set(null),B.viewport.set([0,0,l.width,l.height]),Y.end+1}postRender(){}isLayerOrderingCorrect(t){const l=t.order.length;let B=-1,G=l;for(let Z=0;Z<l;++Z)this._style.isLayerDraped(t._mergedLayers[t.order[Z]])?B=Math.max(B,Z):G=Math.min(G,Z);return G>B}getMinElevationBelowMSL(){let t=0;return this._visibleDemTiles.filter(l=>l.dem).forEach(l=>{t=Math.min(t,l.dem.tree.minimums[0])}),t===0?t:(t-30)*this._exaggeration}raycast(t,l,B){if(!this._visibleDemTiles)return null;const G=this._visibleDemTiles.filter(Z=>Z.dem).map(Z=>{const Y=Z.tileID,re=1<<Y.overscaledZ,{x:oe,y:ce}=Y.canonical,he=oe/re,pe=(oe+1)/re,fe=ce/re,be=(ce+1)/re;return{minx:he,miny:fe,maxx:pe,maxy:be,t:Z.dem.tree.raycastRoot(he,fe,pe,be,t,l,B),tile:Z}});G.sort((Z,Y)=>(Z.t!==null?Z.t:Number.MAX_VALUE)-(Y.t!==null?Y.t:Number.MAX_VALUE));for(const Z of G){if(Z.t==null)return null;const Y=Z.tile.dem.tree.raycast(Z.minx,Z.miny,Z.maxx,Z.maxy,t,l,B);if(Y!=null)return Y}return null}_createFBO(){const t=this.painter.context,l=t.gl,B=this.drapeBufferSize;t.activeTexture.set(l.TEXTURE0);const G=new o.T(t,{width:B[0],height:B[1],data:null},l.RGBA8);G.bind(l.LINEAR,l.CLAMP_TO_EDGE);const Z=t.createFramebuffer(B[0],B[1],!0,null);return Z.colorAttachment.set(G.texture),Z.depthAttachment=new md(t,Z.framebuffer),this._sharedDepthStencil===void 0?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,B[0],B[1]),this._stencilRef=0,Z.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):Z.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&l.texParameterf(l.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:Z,tex:G,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._debugParams.disableRenderCache||this._style.hasLightTransitions())return!0;for(const t in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[t].hasTransition())return!0;return this._style.order.some(t=>{const l=this._style._mergedLayers[t],B=l.isHidden(this.painter.transform.zoom);return l.type==="hillshade"||l.type==="custom"?!B&&l.shouldRedrape():!B&&l.hasTransition()})}_clearLineLayersFromRenderCache(){let t=!1;for(const B of this._style.getSources())if(B instanceof gn){t=!0;break}if(!t)return;const l={};for(let B=0;B<this._style.order.length;++B){const G=this._style._mergedLayers[this._style.order[B]],Z=this._style.getLayerSourceCache(G);if(Z&&!l[Z.id]&&!G.isHidden(this.painter.transform.zoom)&&G.type==="line"&&G.widthExpression()instanceof o.a9){l[Z.id]=!0;for(const Y of this.proxyCoords){const re=this.proxyToSource[Y.key][Z.id];if(re)for(const oe of re)this._clearRenderCacheForTile(Z.id,oe)}}}}_clearRasterLayersFromRenderCache(){let t=!1;for(const B in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[B]._source instanceof Us){t=!0;break}if(!t)return;const l={};for(let B=0;B<this._style.order.length;++B){const G=this._style._mergedLayers[this._style.order[B]],Z=this._style.getLayerSourceCache(G);if(!Z||l[Z.id]||G.isHidden(this.painter.transform.zoom)||G.type!=="raster")continue;const Y=G.paint.get("raster-fade-duration");for(const re of this.proxyCoords){const oe=this.proxyToSource[re.key][Z.id];if(oe)for(const ce of oe){const he=pl(Z.getTile(ce),Z.findLoadedParent(ce,0),Z,this.painter.transform,Y);(he.opacity!==1||he.mix!==0)&&this._clearRenderCacheForTile(Z.id,ce)}}}}_setupDrapedRenderBatches(){this._style.updateDrapeFirstLayers();const t=this._style.order,l=t.length;if(l===0)return;const B=[];this._pendingGroundEffectLayers=[];let G,Z=0,Y=this._style._mergedLayers[t[Z]];for(;!this._style.isLayerDraped(Y)&&Y.isHidden(this.painter.transform.zoom)&&++Z<l;)Y=this._style._mergedLayers[t[Z]];for(;Z<l;++Z){const re=this._style._mergedLayers[t[Z]];re.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(re)?G===void 0&&(G=Z):(re.type==="fill-extrusion"&&this._pendingGroundEffectLayers.push(Z),G!==void 0&&(B.push({start:G,end:Z-1}),G=void 0)))}if(G!==void 0&&B.push({start:G,end:Z-1}),B.length!==0){const re=B[B.length-1];this._pendingGroundEffectLayers.every(oe=>oe>re.end)||o.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=B}_setupRenderCache(t){const l=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,l.renderCache.length>l.renderCachePool.length){const Y=Object.values(l.proxyCachedFBO);l.proxyCachedFBO={};for(let re=0;re<Y.length;++re){const oe=Object.values(Y[re]);l.renderCachePool.push(...oe)}}return}this._clearRasterLayersFromRenderCache();const B=this.proxyCoords,G=this._tilesDirty;for(let Y=B.length-1;Y>=0;Y--){const re=B[Y];if(l.getTileByID(re.key),l.proxyCachedFBO[re.key]!==void 0){const oe=t[re.key],ce=this.proxyToSource[re.key];let he=0;for(const pe in ce){const fe=ce[pe],be=oe[pe];if(!be||be.length!==fe.length||fe.some((ze,De)=>ze!==be[De]||G[pe]&&G[pe].hasOwnProperty(ze.key))){he=-1;break}++he}for(const pe in l.proxyCachedFBO[re.key])l.renderCache[l.proxyCachedFBO[re.key][pe]].dirty=he<0||he!==Object.values(oe).length}}const Z=[...this._drapedRenderBatches];Z.sort((Y,re)=>re.end-re.start-(Y.end-Y.start));for(const Y of Z)for(const re of B){if(l.proxyCachedFBO[re.key])continue;let oe=l.renderCachePool.pop();oe===void 0&&l.renderCache.length<50&&(oe=l.renderCache.length,l.renderCache.push(this._createFBO())),oe!==void 0&&(l.proxyCachedFBO[re.key]={},l.proxyCachedFBO[re.key][Y.start]=oe,l.renderCache[oe].dirty=!0)}this._tilesDirty={}}_setupStencil(t,l,B,G){if(!G||!this._sourceTilesOverlap[G.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const Z=this.painter.context,Y=Z.gl;if(l.length<=1)return void(this._overlapStencilType=!1);let re;if(B.isTileClipped())re=l.length,this._overlapStencilMode.test={func:Y.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(l[0].overscaledZ>l[l.length-1].overscaledZ))return void(this._overlapStencilType=!1);re=1,this._overlapStencilMode.test={func:Y.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+re>255&&(Z.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=re,this._overlapStencilMode.ref=this._stencilRef,B.isTileClipped()&&this._renderTileClippingMasks(l,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return this._overlapStencilType==="Clip"||this._overlapStencilType==="Mask"}stencilModeForRTTOverlap(t){return this.renderingToTexture&&this._overlapStencilType?(this._overlapStencilType==="Clip"&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[t.key]),this._overlapStencilMode):Ui.disabled}_renderTileClippingMasks(t,l){const B=this.painter,G=this.painter.context,Z=G.gl;B._tileClippingMaskIDs={},G.setColorMode(ir.disabled),G.setDepthMode(ki.disabled);const Y=B.getOrCreateProgram("clippingMask");for(const re of t){const oe=B._tileClippingMaskIDs[re.key]=--l;Y.draw(B,Z.TRIANGLES,ki.disabled,new Ui({func:Z.ALWAYS,mask:0},oe,255,Z.KEEP,Z.KEEP,Z.REPLACE),ir.disabled,qi.disabled,fc(re.projMatrix),"$clipping",B.tileExtentBuffer,B.quadTriangleIndexBuffer,B.tileExtentSegments)}}pointCoordinate(t){const l=this.painter.transform;if(t.x<0||t.x>l.width||t.y<0||t.y>l.height)return null;const B=[t.x,t.y,1,1];o.ab.vec4.transformMat4(B,B,l.pixelMatrixInverse),o.ab.vec4.scale(B,B,1/B[3]),B[0]/=l.worldSize,B[1]/=l.worldSize;const G=l._camera.position,Z=o.bH(1,l.center.lat),Y=[G[0],G[1],G[2]/Z,0],re=o.ab.vec3.subtract([],B.slice(0,3),Y);o.ab.vec3.normalize(re,re);const oe=this.raycast(Y,re,this._exaggeration);return oe!==null&&oe?(o.ab.vec3.scaleAndAdd(Y,Y,re,oe),Y[3]=Y[2],Y[2]*=Z,Y):null}_setupProxiedCoordsForOrtho(t,l,B){if(t.getSource()instanceof o.aJ)return this._setupProxiedCoordsForImageSource(t,l,B);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const G=this.proxiedCoords[t.id]=[],Z=this.proxyCoords;for(let oe=0;oe<Z.length;oe++){const ce=Z[oe],he=this._findTileCoveringTileID(ce,t);if(he){const pe=this._createProxiedId(ce,he,B[ce.key]&&B[ce.key][t.id]);G.push(pe),this.proxyToSource[ce.key][t.id]=[pe]}}let Y=!1;const re=new Set;for(let oe=0;oe<l.length;oe++){const ce=t.getTile(l[oe]);if(!ce||!ce.hasData())continue;const he=this._findTileCoveringTileID(ce.tileID,this.proxySourceCache);if(he&&he.tileID.canonical.z!==ce.tileID.canonical.z){const pe=this.proxyToSource[he.tileID.key][t.id],fe=this._createProxiedId(he.tileID,ce,B[he.tileID.key]&&B[he.tileID.key][t.id]);pe?pe.splice(pe.length-1,0,fe):this.proxyToSource[he.tileID.key][t.id]=[fe];const be=this.proxyToSource[he.tileID.key][t.id];re.has(be)||re.add(be),G.push(fe),Y=!0}}if(this._sourceTilesOverlap[t.id]=Y,Y&&this._debugParams.sortTilesHiZFirst)for(const oe of re)oe.sort((ce,he)=>he.overscaledZ-ce.overscaledZ)}_setupProxiedCoordsForImageSource(t,l,B){if(!t.getSource().loaded())return;const G=this.proxiedCoords[t.id]=[],Z=this.proxyCoords,Y=t.getSource(),re=Y.tileID;if(!re)return;const oe=new o.P(re.x,re.y)._div(1<<re.z),ce=Y.coordinates.map(o.aa.fromLngLat).reduce((pe,fe)=>(pe.min.x=Math.min(pe.min.x,fe.x-oe.x),pe.min.y=Math.min(pe.min.y,fe.y-oe.y),pe.max.x=Math.max(pe.max.x,fe.x-oe.x),pe.max.y=Math.max(pe.max.y,fe.y-oe.y),pe),{min:new o.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new o.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),he=(pe,fe)=>{const be=pe.wrap+pe.canonical.x/(1<<pe.canonical.z),ze=pe.canonical.y/(1<<pe.canonical.z),De=o.ag/(1<<pe.canonical.z),Oe=fe.wrap+fe.canonical.x/(1<<fe.canonical.z),Fe=fe.canonical.y/(1<<fe.canonical.z);return be+De<Oe+ce.min.x||be>Oe+ce.max.x||ze+De<Fe+ce.min.y||ze>Fe+ce.max.y};for(let pe=0;pe<Z.length;pe++){const fe=Z[pe];for(let be=0;be<l.length;be++){const ze=t.getTile(l[be]);if(!ze||!ze.hasData()||he(fe,ze.tileID))continue;const De=this._createProxiedId(fe,ze,B[fe.key]&&B[fe.key][t.id]),Oe=this.proxyToSource[fe.key][t.id];Oe?Oe.push(De):this.proxyToSource[fe.key][t.id]=[De],G.push(De)}}}_createProxiedId(t,l,B){let G=this.orthoMatrix;if(B){const Z=B.find(Y=>Y.key===l.tileID.key);if(Z)return Z}if(l.tileID.key!==t.key){const Z=t.canonical.z-l.tileID.canonical.z;let Y,re,oe;G=o.ab.mat4.create();const ce=l.tileID.wrap-t.wrap<<t.overscaledZ;Z>0?(Y=o.ag>>Z,re=Y*((l.tileID.canonical.x<<Z)-t.canonical.x+ce),oe=Y*((l.tileID.canonical.y<<Z)-t.canonical.y)):(Y=o.ag<<-Z,re=o.ag*(l.tileID.canonical.x-(t.canonical.x+ce<<-Z)),oe=o.ag*(l.tileID.canonical.y-(t.canonical.y<<-Z))),o.ab.mat4.ortho(G,0,Y,0,Y,0,1),o.ab.mat4.translate(G,G,[re,oe,0])}return new Bh(l.tileID,t.key,G)}_findTileCoveringTileID(t,l){let B=l.getTile(t);if(B&&B.hasData())return B;const G=this._findCoveringTileCache[l.id],Z=G[t.key];if(B=Z?l.getTileByID(Z):null,B&&B.hasData()||Z===null)return B;let Y=B?B.tileID:t,re=Y.overscaledZ;const oe=l.getSource().minzoom,ce=[];if(!Z){const pe=l.getSource().maxzoom;if(t.canonical.z>=pe){const fe=t.canonical.z-pe;l.getSource().reparseOverscaled?(re=Math.max(t.canonical.z+2,l.transform.tileZoom),Y=new o.aG(re,t.wrap,pe,t.canonical.x>>fe,t.canonical.y>>fe)):fe!==0&&(re=pe,Y=new o.aG(re,t.wrap,pe,t.canonical.x>>fe,t.canonical.y>>fe))}
2659Y.key!==t.key&&(ce.push(Y.key),B=l.getTile(Y))}const he=pe=>{ce.forEach(fe=>{G[fe]=pe}),ce.length=0};for(re-=1;re>=oe&&(!B||!B.hasData());re--){B&&he(B.tileID.key);const pe=Y.calculateScaledKey(re);if(B=l.getTileByID(pe),B&&B.hasData())break;const fe=G[pe];if(fe===null)break;fe===void 0?ce.push(pe):B=l.getTileByID(fe)}return he(B?B.tileID.key:null),B&&B.hasData()?B:null}findDEMTileFor(t){return this.enabled?this._findTileCoveringTileID(t,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(t,l){let B=this._tilesDirty[t];B||(B=this._tilesDirty[t]={}),B[l.key]=!0}}function Kp(F,t,l){const B=function(re,oe,ce){const he=o.ab.vec3.dot(oe,re),pe=o.ab.vec3.dot(ce,[.2126,.7152,.0722]),fe=(ze,De,Oe)=>(1-Oe)*ze+Oe*De,be=fe(1-.3*Math.min(pe,1),1,Math.min(he+1,1));return fe(.92,1,Math.asin(o.aw(oe[2],-1,1))/Math.PI+.5)*be}(F,[0,0,1],t),G=[0,0,0];o.ab.vec3.scale(G,l.slice(0,3),B);const Z=[0,0,0];o.ab.vec3.scale(Z,t.slice(0,3),F[2]);const Y=[0,0,0];return o.ab.vec3.add(Y,G,Z),o.cf(Y)}const Qp=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],_d=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","model","symbol"];class yd{static cacheKey(t,l,B,G){let Z=`${l}${G?G.cacheKey:""}`;for(const Y of B)t.usedDefines.includes(Y)&&(Z+=`/${Y}`);return Z}constructor(t,l,B,G,Z,Y){const re=t.gl;this.program=re.createProgram(),this.configuration=G,this.name=l,this.fixedDefines=[...Y];const oe=G?G.getBinderAttributes():[],ce=(B.staticAttributes||[]).concat(oe);let he=G?G.defines():[];he=he.concat(Y.map(Oe=>`#define ${Oe}`));const pe=`#version 300 es
2660`;let fe=pe+he.concat("precision mediump float;",cl,oc.fragmentSource).join(`
2661`);for(const Oe of B.fragmentIncludes)fe+=`
2662${mo[Oe]}`;fe+=`
2663${B.fragmentSource}`;let be=pe+he.concat("precision highp float;",cl,oc.vertexSource).join(`
2664`);for(const Oe of B.vertexIncludes)be+=`
2665${mo[Oe]}`;this.forceManualRenderingForInstanceIDShaders=t.forceManualRenderingForInstanceIDShaders&&B.vertexSource.indexOf("gl_InstanceID")!==-1,this.forceManualRenderingForInstanceIDShaders&&(be+=`
2666uniform int u_instanceID;
2667`),be+=`
2668${B.vertexSource}`,this.forceManualRenderingForInstanceIDShaders&&(be=be.replaceAll("gl_InstanceID","u_instanceID"));const ze=re.createShader(re.FRAGMENT_SHADER);if(re.isContextLost())return void(this.failedToCreate=!0);re.shaderSource(ze,fe),re.compileShader(ze),re.attachShader(this.program,ze);const De=re.createShader(re.VERTEX_SHADER);if(re.isContextLost())this.failedToCreate=!0;else{re.shaderSource(De,be),re.compileShader(De),re.attachShader(this.program,De),this.attributes={},this.numAttributes=ce.length;for(let Oe=0;Oe<this.numAttributes;Oe++)if(ce[Oe]){const Fe=ce[Oe].startsWith("a_")?ce[Oe]:`a_${ce[Oe]}`;re.bindAttribLocation(this.program,Oe,Fe),this.attributes[Fe]=Oe}re.linkProgram(this.program),re.deleteShader(De),re.deleteShader(ze),this.fixedUniforms=Z(t),this.binderUniforms=G?G.getUniforms(t):[],this.forceManualRenderingForInstanceIDShaders&&(this.instancingUniforms=(Oe=>({u_instanceID:new o.bN(Oe)}))(t)),(Y.includes("TERRAIN")||l.indexOf("symbol")!==-1||l.indexOf("circle")!==-1)&&(this.terrainUniforms=(Oe=>({u_dem:new o.bN(Oe),u_dem_prev:new o.bN(Oe),u_dem_tl:new o.bK(Oe),u_dem_scale:new o.bM(Oe),u_dem_tl_prev:new o.bK(Oe),u_dem_scale_prev:new o.bM(Oe),u_dem_size:new o.bM(Oe),u_dem_lerp:new o.bM(Oe),u_exaggeration:new o.bM(Oe),u_depth:new o.bN(Oe),u_depth_size_inv:new o.bK(Oe),u_depth_range_unpack:new o.bK(Oe),u_occluder_half_size:new o.bM(Oe),u_occlusion_depth_offset:new o.bM(Oe),u_meter_to_dem:new o.bM(Oe),u_label_plane_matrix_inv:new o.bJ(Oe)}))(t)),Y.includes("GLOBE")&&(this.globeUniforms=(Oe=>({u_tile_tl_up:new o.bL(Oe),u_tile_tr_up:new o.bL(Oe),u_tile_br_up:new o.bL(Oe),u_tile_bl_up:new o.bL(Oe),u_tile_up_scale:new o.bM(Oe)}))(t)),Y.includes("FOG")&&(this.fogUniforms=(Oe=>({u_fog_matrix:new o.bJ(Oe),u_fog_range:new o.bK(Oe),u_fog_color:new o.ca(Oe),u_fog_horizon_blend:new o.bM(Oe),u_fog_vertical_limit:new o.bK(Oe),u_fog_temporal_offset:new o.bM(Oe),u_frustum_tl:new o.bL(Oe),u_frustum_tr:new o.bL(Oe),u_frustum_br:new o.bL(Oe),u_frustum_bl:new o.bL(Oe),u_globe_pos:new o.bL(Oe),u_globe_radius:new o.bM(Oe),u_globe_transition:new o.bM(Oe),u_is_globe:new o.bN(Oe),u_viewport:new o.bK(Oe)}))(t)),Y.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(Oe=>({u_cutoff_params:new o.ca(Oe)}))(t)),Y.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(Oe=>({u_lighting_ambient_color:new o.bL(Oe),u_lighting_directional_dir:new o.bL(Oe),u_lighting_directional_color:new o.bL(Oe),u_ground_radiance:new o.bL(Oe)}))(t)),Y.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(Oe=>({u_light_matrix_0:new o.bJ(Oe),u_light_matrix_1:new o.bJ(Oe),u_fade_range:new o.bK(Oe),u_shadow_normal_offset:new o.bL(Oe),u_shadow_intensity:new o.bM(Oe),u_shadow_texel_size:new o.bM(Oe),u_shadow_map_resolution:new o.bM(Oe),u_shadow_direction:new o.bL(Oe),u_shadow_bias:new o.bL(Oe),u_shadowmap_0:new o.bN(Oe),u_shadowmap_1:new o.bN(Oe)}))(t))}}setTerrainUniformValues(t,l){if(!this.terrainUniforms)return;const B=this.terrainUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const G in l)B[G]&&B[G].set(this.program,G,l[G])}}setGlobeUniformValues(t,l){if(!this.globeUniforms)return;const B=this.globeUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const G in l)B[G]&&B[G].set(this.program,G,l[G])}}setFogUniformValues(t,l){if(!this.fogUniforms)return;const B=this.fogUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const G in l)B[G].set(this.program,G,l[G])}}setCutoffUniformValues(t,l){if(!this.cutoffUniforms)return;const B=this.cutoffUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const G in l)B[G].set(this.program,G,l[G])}}setLightsUniformValues(t,l){if(!this.lightsUniforms)return;const B=this.lightsUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const G in l)B[G].set(this.program,G,l[G])}}setShadowUniformValues(t,l){if(this.failedToCreate||!this.shadowUniforms)return;const B=this.shadowUniforms;t.program.set(this.program);for(const G in l)B[G].set(this.program,G,l[G])}_drawDebugWireframe(t,l,B,G,Z,Y,re,oe,ce,he){const pe=t.options.wireframe;if(pe.terrain===!1&&pe.layers2D===!1&&pe.layers3D===!1)return;const fe=t.context;if(!(!(!pe.terrain||this.name!=="terrainRaster"&&this.name!=="globeRaster")||!(!pe.layers2D||t._terrain&&t._terrain.renderingToTexture||!Qp.includes(this.name))||!(!pe.layers3D||!_d.includes(this.name))))return;const be=fe.gl,ze=t.wireframeDebugCache.getLinesFromTrianglesBuffer(t.frameCounter,Z,fe);if(!ze)return;const De=[...this.fixedDefines];
2668De.push("DEBUG_WIREFRAME");const Oe=t.getOrCreateProgram(this.name,{config:this.configuration,defines:De});fe.program.set(Oe.program);const Fe=(Ze,nt,Qe)=>{if(nt[Ze]&&Qe[Ze])for(const it in nt[Ze])Qe[Ze][it]&&Qe[Ze][it].set(Qe.program,it,nt[Ze][it].current)};ce&&ce.setUniforms(Oe.program,fe,Oe.binderUniforms,re,{zoom:oe}),Fe("fixedUniforms",this,Oe),Fe("terrainUniforms",this,Oe),Fe("globeUniforms",this,Oe),Fe("fogUniforms",this,Oe),Fe("lightsUniforms",this,Oe),Fe("shadowUniforms",this,Oe),ze.bind(),fe.setColorMode(new ir([be.ONE,be.ONE_MINUS_SRC_ALPHA,be.ZERO,be.ONE],o.aj.transparent,[!0,!0,!0,!1])),fe.setDepthMode(new ki(l.func===be.LESS?be.LEQUAL:l.func,ki.ReadOnly,l.range)),fe.setStencilMode(Ui.disabled);const Ge=3*Y.primitiveLength*2,Xe=3*Y.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const Ze=he||1;for(let nt=0;nt<Ze;++nt)Oe.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",nt),be.drawElements(be.LINES,Ge,be.UNSIGNED_SHORT,Xe)}else he&&he>1?be.drawElementsInstanced(be.LINES,Ge,be.UNSIGNED_SHORT,Xe,he):be.drawElements(be.LINES,Ge,be.UNSIGNED_SHORT,Xe);Z.bind(),fe.program.set(this.program),fe.setDepthMode(l),fe.setStencilMode(B),fe.setColorMode(G)}checkUniforms(t,l,B){if(this.fixedDefines.includes(l)){for(const G of Object.keys(B))if(!B[G].initialized)throw new Error(`Program '${this.name}', from draw '${t}': uniform ${G} not set but required by ${l} being defined`)}}draw(t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De,Oe){const Fe=t.context,Ge=Fe.gl;if(this.failedToCreate)return;Fe.program.set(this.program),Fe.setDepthMode(B),Fe.setStencilMode(G),Fe.setColorMode(Z),Fe.setCullFace(Y);for(const nt of Object.keys(this.fixedUniforms))this.fixedUniforms[nt].set(this.program,nt,re[nt]);ze&&ze.setUniforms(this.program,Fe,this.binderUniforms,fe,{zoom:be});const Xe={[Ge.POINTS]:1,[Ge.LINES]:2,[Ge.TRIANGLES]:3,[Ge.LINE_STRIP]:1}[l];this.checkUniforms(oe,"RENDER_SHADOWS",this.shadowUniforms);const Ze=Oe&&Oe>0?1:void 0;for(const nt of pe.get()){const Qe=nt.vaos||(nt.vaos={});if((Qe[oe]||(Qe[oe]=new ad)).bind(Fe,this,ce,ze?ze.getPaintVertexBuffers():[],he,nt.vertexOffset,De||[],Ze),this.forceManualRenderingForInstanceIDShaders){const it=Oe||1;for(let Ke=0;Ke<it;++Ke)this.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",Ke),he?Ge.drawElements(l,nt.primitiveLength*Xe,Ge.UNSIGNED_SHORT,nt.primitiveOffset*Xe*2):Ge.drawArrays(l,nt.vertexOffset,nt.vertexLength)}else Oe&&Oe>1?Ge.drawElementsInstanced(l,nt.primitiveLength*Xe,Ge.UNSIGNED_SHORT,nt.primitiveOffset*Xe*2,Oe):he?Ge.drawElements(l,nt.primitiveLength*Xe,Ge.UNSIGNED_SHORT,nt.primitiveOffset*Xe*2):Ge.drawArrays(l,nt.vertexOffset,nt.vertexLength);l===Ge.TRIANGLES&&he&&this._drawDebugWireframe(t,B,G,Z,he,nt,fe,be,ze,Oe)}}}function mc(F,t){const l=Math.pow(2,t.tileID.overscaledZ),B=t.tileSize*Math.pow(2,F.transform.tileZoom)/l,G=B*(t.tileID.canonical.x+t.tileID.wrap*l),Z=B*t.tileID.canonical.y;return{u_image:0,u_texsize:t.imageAtlasTexture?t.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/o.ar(t,1,F.transform.tileZoom),u_pixel_coord_upper:[G>>16,Z>>16],u_pixel_coord_lower:[65535&G,65535&Z]}}const bo={terrain:0,flat:1},wo=o.ab.mat4.create(),gc=(F,t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De,Oe,Fe)=>{const Ge=t.style.light,Xe=Ge.properties.get("position"),Ze=[Xe.x,Xe.y,Xe.z],nt=o.ab.mat3.create();Ge.properties.get("anchor")==="viewport"&&(o.ab.mat3.fromRotation(nt,-t.transform.angle),o.ab.vec3.transformMat3(Ze,Ze,nt));const Qe=Ge.properties.get("color"),it=t.transform,Ke={u_matrix:F,u_lightpos:Ze,u_lightintensity:Ge.properties.get("intensity"),u_lightcolor:[Qe.r,Qe.g,Qe.b],u_vertical_gradient:+l,u_opacity:B,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:wo,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:bo[ce],u_base_type:bo[he],u_ao:G,u_edge_radius:Z,u_width_scale:Y,u_flood_light_color:ze,u_vertical_scale:De,u_flood_light_intensity:Oe,u_ground_shadow_factor:Fe};return it.projection.name==="globe"&&(Ke.u_tile_id=[re.canonical.x,re.canonical.y,1<<re.canonical.z],Ke.u_zoom_transition=pe,Ke.u_inv_rot_matrix=be,Ke.u_merc_center=fe,Ke.u_up_dir=it.projection.upVector(new o.bT(0,0,0),fe[0]*o.ag,fe[1]*o.ag),Ke.u_height_lift=oe),Ke},fl=(F,t,l,B,G,Z)=>({u_matrix:F,u_edge_radius:t,u_width_scale:l,u_vertical_scale:B,u_height_type:bo[G],u_base_type:bo[Z]}),vd=(F,t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De,Oe)=>{const Fe=gc(F,t,l,B,G,Z,Y,re,ce,he,pe,fe,be,ze,De,Oe,1,[0,0,0]),Ge={u_height_factor:-Math.pow(2,re.overscaledZ
vendor: 2,714 bytes, line 2668
2668)/oe.tileSize/8};return o.l(Fe,mc(t,oe),Ge)},ml=(F,t)=>({u_matrix:F,u_emissive_strength:t}),gl=(F,t,l,B)=>o.l(ml(F,t),mc(l,B)),Nh=(F,t,l)=>({u_matrix:F,u_world:l,u_emissive_strength:t}),xd=(F,t,l,B,G)=>o.l(gl(F,t,l,B),{u_world:G}),ef=(F,t,l,B)=>{const G=o.ag/l.tileSize;return{u_matrix:F,u_camera_to_center_distance:t.getCameraToCenterDistance(B),u_extrude_scale:[t.pixelsToGLUnits[0]/G,t.pixelsToGLUnits[1]/G]}},Ka=(F,t,l=1)=>({u_matrix:F,u_color:t.toRenderColor(null),u_overlay:0,u_overlay_scale:l}),_c=o.ab.mat4.create(),Ti=(F,t,l,B,G,Z,Y)=>{const re=F.transform,oe=re.projection.name==="globe",ce=oe?o.cN(re.zoom,t.canonical)*re._pixelsPerMercatorPixel:o.ar(l,1,Z),he={u_matrix:t.projMatrix,u_extrude_scale:ce,u_intensity:Y,u_inv_rot_matrix:_c,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(oe){he.u_inv_rot_matrix=B,he.u_merc_center=G,he.u_tile_id=[t.canonical.x,t.canonical.y,1<<t.canonical.z],he.u_zoom_transition=o.ae(re.zoom);const pe=G[0]*o.ag,fe=G[1]*o.ag;he.u_up_dir=re.projection.upVector(new o.bT(0,0,0),pe,fe)}return he};function Vh(F,[t,l,B,G],[Z,Y]){if(Z===Y)return[0,0,0,0];const re=255*(F-1)/(F*(Y-Z));return[t*re,l*re,B*re,G*re]}function Uh(F,t,[l,B]){return l===B?0:.5/F+(t-l)*(F-1)/(F*(B-l))}const Ma=(F,t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De,Oe,Fe,Ge,Xe,Ze)=>({u_matrix:F,u_normalize_matrix:t,u_globe_matrix:l,u_merc_matrix:B,u_grid_matrix:G,u_tl_parent:Z,u_scale_parent:ce,u_fade_t:he.mix,u_opacity:he.opacity*pe.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:pe.paint.get("raster-brightness-min"),u_brightness_high:pe.paint.get("raster-brightness-max"),u_saturation_factor:o.cO(pe.paint.get("raster-saturation")),u_contrast_factor:o.cP(pe.paint.get("raster-contrast")),u_spin_weights:Qa(pe.paint.get("raster-hue-rotate")),u_perspective_transform:fe,u_raster_elevation:be,u_zoom_transition:Y,u_merc_center:re,u_cutoff_params:oe,u_colorization_mix:Vh(o.cQ,De,Fe),u_colorization_offset:Uh(o.cQ,Oe,Fe),u_color_ramp:ze,u_texture_offset:[Xe/(Ge+2*Xe),Ge/(Ge+2*Xe)],u_texture_res:[Ge+2*Xe,Ge+2*Xe],u_emissive_strength:Ze});function Qa(F){F*=Math.PI/180;const t=Math.sin(F),l=Math.cos(F);return[(2*l+1)/3,(-Math.sqrt(3)*t-l+1)/3,(Math.sqrt(3)*t-l+1)/3]}const Mi=.05,jh=(F,t,l,B,G,Z,Y,re,oe,ce,he,pe)=>({u_matrix:F,u_normalize_matrix:t,u_globe_matrix:l,u_merc_matrix:B,u_grid_matrix:G,u_tl_parent:Z,u_scale_parent:ce,u_fade_t:he.mix,u_opacity:he.opacity,u_image0:0,u_image1:1,u_raster_elevation:pe,u_zoom_transition:Y,u_merc_center:re,u_cutoff_params:oe}),tf=(F,t,l,B,G,Z,Y,re,oe,ce)=>({u_particle_texture:F,u_particle_texture_side_len:t,u_tile_offset:l,u_velocity:B,u_color_ramp:Z,u_velocity_res:G,u_max_speed:Y,u_uv_offset:re,u_data_scale:[255*
2668oe[0],255*oe[1]],u_data_offset:ce,u_particle_pos_scale:1.1,u_particle_pos_offset:[Mi,Mi]}),rf=(F,t,l,B,G,Z,Y,re,oe,ce)=>({u_particle_texture:F,u_particle_texture_side_len:t,u_velocity:l,u_velocity_res:B,u_max_speed:G,u_speed_factor:Z,u_reset_rate:Y,u_rand_seed:Math.random(),u_uv_offset:re,u_data_scale:[255*oe[0],255*oe[1]],u_data_offset:ce,u_particle_pos_scale:1.1,u_particle_pos_offset:[Mi,Mi]}),yc=o.ab.mat4.create(),Gh=(F,t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De,Oe,Fe,Ge,Xe,Ze,nt)=>{const Qe=G.transform,it={u_is_size_zoom_constant:+(F==="constant"||F==="source"),u_is_size_feature_constant:+(F==="constant"||F==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:Qe.getCameraToCenterDistance(Ge),u_rotate_symbol:+l,u_aspect_ratio:Qe.width/Qe.height,u_fade_change:G.options.fadeDuration?G.symbolFadeChange:1,u_matrix:Z,u_label_plane_matrix:Y,u_coord_matrix:re,u_is_text:+ce,u_elevation_from_sea:oe?1:0,u_pitch_with_map:+B,u_texsize:he,u_texsize_icon:pe,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:yc,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:yc,u_up_vector:[0,-1,0],u_color_adj_mat:Xe,u_icon_transition:Ze||0,u_gamma_scale:B?G.transform.getCameraToCenterDistance(Ge)*Math.cos(G.terrain?0:G.transform._pitch):1,u_device_pixel_ratio:o.q.devicePixelRatio,u_is_halo:1,u_scale_factor:nt||1};return Ge.name==="globe"&&(it.u_tile_id=[be.canonical.x,be.canonical.y,1<<be.canonical.z],it.u_zoom_transition=ze,it.u_inv_rot_matrix=Oe,it.u_merc_center=De,it.u_camera_forward=Qe._camera.forward(),it.u_ecef_origin=o.cR(Qe.globeMatrix,be.toUnwrapped()),it.u_tile_matrix=Float32Array.from(Qe.globeMatrix),it.u_up_vector=Fe),it},qh=(F,t,l,B)=>({u_matrix:F,u_emissive_strength:t,u_opacity:l,u_color:B}),bd=(F,t,l,B,G,Z,Y,re,oe)=>o.l(function(ce,he,pe,fe,be,ze){const{width:De,height:Oe}=fe.imageManager.getPixelSize(he),Fe=Math.pow(2,ze.tileID.overscaledZ),Ge=ze.tileSize*Math.pow(2,fe.transform.tileZoom)/Fe,Xe=Ge*(ze.tileID.canonical.x+ze.tileID.wrap*Fe),Ze=Ge*ze.tileID.canonical.y;return{u_image:0,u_pattern_tl:pe.tl,u_pattern_br:pe.br,u_texsize:[De,Oe],u_pattern_size:pe.displaySize,u_pattern_units_to_pixels:be?[fe.transform.width,-1*fe.transform.height]:[1/o.ar(ze,1,fe.transform.tileZoom),1/o.ar(ze,1,fe.transform.tileZoom)],u_pixel_coord_upper:[Xe>>16,Ze>>16],u_pixel_coord_lower:[65535&Xe,65535&Ze]}}(0,Z,Y,B,re,oe),{u_matrix:F,u_emissive_strength:t,u_opacity:l}),$h=new Float32Array(o.ab.mat4.identity([])),_l=(F,t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be=[0,0,0],ze)=>{const De=G.style.light,Oe=De.properties.get("position"),Fe=[-Oe.x,-Oe.y,Oe.z],Ge=o.ab.mat3.create();De.properties.get("anchor")==="viewport"&&(o.ab.mat3.fromRotation(Ge,-G.transform.angle),o.ab.vec3.transformMat3(Fe,Fe,Ge));const Xe=he.alphaMode==="MASK",Ze=De.properties.get("color").toRenderColor(null),nt=fe.paint.get("model-ambient-occlusion-intensity"),Qe=fe.paint.get("model-color").constantOr(o.aj.white).toRenderColor(null),it=fe.paint.get("model-color-mix-intensity").constantOr(0);return{u_matrix:F,u_lighting_matrix:t,u_normal_matrix:l,u_node_matrix:B||$h,u_lightpos:Fe,u_lightintensity:De.properties.get("intensity"),u_lightcolor:[Ze.r,Ze.g,Ze.b],u_camera_pos:be,u_opacity:Z,u_baseTextureIsAlpha:0,u_alphaMask:+Xe,u_alphaCutoff:he.alphaCutoff,u_baseColorFactor:[Y.r,Y.g,Y.b,Y.a],u_emissiveFactor:[re[0],re[1],re[2],1],u_metallicFactor:oe,u_roughnessFactor:ce,u_baseColorTexture:jn.BaseColor,u_metallicRoughnessTexture:jn.MetallicRoughness,u_normalTexture:jn.Normal,u_occlusionTexture:jn.Occlusion,u_emissionTexture:jn.Emission,u_lutTexture:jn.LUT,u_color_mix:[Qe.r,Qe.g,Qe.b,it],u_aoIntensity:nt,u_emissive_strength:pe,u_occlusionTextureTransform:ze||[0,0,0,0]}},vc=(F,t=$h,l=$h)=>({u_matrix:F,u_instance:t,u_node_matrix:l}),Hh={fillExtrusion:F=>({u_matrix:new o.bJ(F),u_lightpos:new o.bL(F),u_lightintensity:new o.bM(F),u_lightcolor:new o.bL(F),u_vertical_gradient:new o.bM(F),u_opacity:new o.bM(F),u_edge_radius:new o.bM(F),u_width_scale:new o.bM(F),u_ao:new o.bK(F),u_height_type:new o.bN(F),u_base_type:new o.bN(F),u_tile_id:new o.bL(F),u_zoom_transition:new o.bM(F),u_inv_rot_matrix:new o.bJ(F),u_merc_center:new o.bK(F),u_up_dir:new o.bL(F),u_height_lift:new o.bM(F),u_flood_light_color:new o.bL(F),u_vertical_scale:new o.bM(F),u_flood_light_intensity:new o.bM(F),u_ground_shadow_factor:new o.bL(F)}),fillExtrusionDepth:F=>({u_matrix:new o.bJ(F),u_edge_radius:new o.bM(F),u_width_scale:new o.bM(F),u_vertical_scale:new o.bM(F),u_height_type:new o.bN(F),u_base_type:new o.bN(F)}),fillExtrusionPattern:F=>({u_matrix:new o.bJ(F),u_lightpos:new o.bL(F),u_lightintensity:new o.bM(F),u_lightcolor:new o.bL(F),u_vertical_gradient:new o.bM(F),u_height_factor:new o.bM(F),u_edge_radius:new o.bM(F),u_width_scale:new o.bM(F),u_ao:new o.bK(F),u_height_type:new o.bN(F),u_base_type:new o.bN(F),u_tile_id:new o.bL(F),u_zoom_transition:new o.bM(F),u_inv_rot_matrix:new o.bJ(F),u_merc_center:new o.bK(F),u_up_dir:new o.bL(F),u_height_lift:new o.bM(F),u_image:new o.bN(F),u_texsize:new o.bK(F),u_pixel_coord_upper:new o.bK(F),u_pixel_coord_lower:new o.bK(F),u_tile_units_to_pixels:new o.bM(F),u_opacity:new o.bM(F)}),fillExtrusionGroundEffect:F=>({u_matrix:new o.bJ(F),u_opacity:new o.bM(F),u_ao_pass:new o.bM(F),u_meter_to_tile:new o.bM(F),u_ao:new o.bK(F),u_flood_light_intensity:new o.bM(F),u_flood_light_color:new o.bL(F),u_attenuation:new o.bM(F),u_edge_radius:new o.bM(F),u_fb:new o.bN(F),u_fb_size:new o.bM(F),u_dynamic_offset:new o.bM(F)}),fill:F=>({u_matrix:new o.bJ(F),u_emissive_strength:new o.bM(F)}),fillPattern:F=>({u_matrix:new o.bJ(F),u_emissive_strength:new o.bM(F),u_image:new o.bN(F),u_texsize:new o.bK(F),u_pixel_coord_upper:new o.bK(F),u_pixel_coord_lower:new o.bK(F),u_tile_units_to_pixels:new o.bM(F)}),fillOutline:F=>({u_matrix:new o.bJ(F),u_emissive_strength:new o.bM(F),u_world:new o.bK(F)}),fillOutlinePattern:F=>({u_matrix:new o.bJ(F),u_emissive_strength:new o.bM(F),u_world:new o.bK(F),u_image:new o.bN(F),u_texsize:new o.bK(F),u_pixel_coord_upper:new o.bK(F),u_pixel_coord_lower:new o.bK(F),u_tile_units_to_pixels:new o.bM(F)}),circle:o.cS,collisionBox:F=>({u_matrix:new o.bJ(F),u_camera_to_center_distance:new o.bM(F),u_extrude_scale:new o.bK(F)}),collisionCircle:F=>({u_matrix:new o.bJ(F),u_inv_matrix:new o.bJ(F),u_camera_to_center_distance:new o.bM(F),u_viewport_size:new o.bK(F)}),debug:F=>({u_color:new o.cz(F),u_matrix:new o.bJ(F),u_overlay:new o.bN(F),u_overlay_scale:new o.bM(F)}),clippingMask:F=>({u_matrix:new o.bJ(F)}),heatmap:F=>({u_extrude_scale:new o.bM(F),u_intensity:new o.bM(F),u_matrix:new o.bJ(F),u_inv_rot_matrix:new o.bJ(F),u_merc_center:new o.bK(F),u_tile_id:new o.bL(F),u_zoom_transition:new o.bM(F),u_up_dir:new o.bL(F)}),heatmapTexture:F=>({u_image:new o.bN(F),u_color_ramp:new o.bN(F),u_opacity:new o.bM(F)}),hillshade:F=>({u_matrix:new o.bJ(F),u_image:new o.bN(F),u_latrange:new o.bK(F),u_light:new o.bK(F),u_shadow:new o.cz(F),u_highlight:new o.cz(F),u_emissive_strength:new o.bM(F),u_accent:new o.cz(F)}),hillshadePrepare:F=>({u_matrix:new o.bJ(F),u_image:new o.bN(F),u_dimension:new o.bK(F),u_zoom:new o.bM(F)}),line:o.cT,linePattern:o.cU,raster:F=>({u_matrix:new o.bJ(F),u_normalize_matrix:new o.bJ(F),u_globe_matrix:new o.bJ(F),u_merc_matrix:new o.bJ(F),u_grid_matrix:new o.cA(F),u_tl_parent:new o.bK(F),u_scale_parent:new o.bM(F),u_fade_t:new o.bM(F),u_opacity:new o.bM(F),u_image0:new o.bN(F),u_image1:new o.bN(F),u_brightness_low:new o.bM(F),u_brightness_high:new o.bM(F),u_saturation_factor:new o.bM(F),u_contrast_factor:new o.bM(F),u_spin_weights:new o.bL(F),u_perspective_transform:new o.bK(F),u_raster_elevation:new o.bM(F),u_zoom_transition:new o.bM(F),u_merc_center:new o.bK(F),u_cutoff_params:new o.ca(F),u_colorization_mix:new o.ca(F),u_colorization_offset:new o.bM(F),u_color_ramp:new o.bN(F),u_texture_offset:new o.bK(F),u_texture_res:new o.bK(F),u_emissive_strength:new o.bM(F)}),rasterParticle:F=>({u_matrix:new o.bJ(F),u_normalize_matrix:new o.bJ(F),u_globe_matrix:new o.bJ(F),u_merc_matrix:new o.bJ(F),u_grid_matrix:new o.cA(F),u_tl_parent:new o.bK(F),u_scale_parent:new o.bM(F),u_fade_t:new o.bM(F),u_opacity:new o.bM(F),u_image0:new o.bN(F),u_image1:new o.bN(F),u_raster_elevation:new o.bM(F),u_zoom_transition:new o.bM(F),u_merc_center:new o.bK(F),u_cutoff_params:new o.ca(F)}),rasterParticleTexture:F=>({u_texture:new o.bN(F),u_opacity:new o.bM(F)}),rasterParticleDraw:F=>({u_particle_texture:new o.bN(F),u_particle_texture_side_len:new o.bM(F),u_tile_offset:new o.bK(F),u_velocity:new o.bN(F),u_color_ramp:new o.bN(F),u_velocity_res:new o.bK(F),u_max_speed:new o.bM(F),u_uv_offset:new o.bK(F),u_data_scale:new o.bK(F),u_data_offset:new o.bM(F),u_particle_pos_scale:new o.bM(F),u_particle_pos_offset:new o.bK(F)}),rasterParticleUpdate:F=>({u_particle_texture:new o.bN(F),u_particle_texture_side_len:new o.bM(F),u_velocity:new o.bN(F),u_velocity_res:new o.bK(F),u_max_speed:new o.bM(F),u_speed_factor:new o.bM(F),u_reset_rate:new o.bM(F),u_rand_seed:new o.bM(F),u_uv_offset:new o.bK(F),u_data_scale:new o.bK(F),u_data_offset:new o.bM(F),u_particle_pos_scale:new o.bM(F),u_particle_pos_offset:new o.bK(F)}),symbol:F=>({u_is_size_zoom_constant:new o.bN(F),u_is_size_feature_constant:new o.bN(F),u_size_t:new o.bM(F),u_size:new o.bM(F),u_camera_to_center_distance:new o.bM(F),u_rotate_symbol:new o.bN(F),u_aspect_ratio:new o.bM(F),u_fade_change:new o.bM(F),u_matrix:new o.bJ(F),u_label_plane_matrix:new o.bJ(F),u_coord_matrix:new o.bJ(F),u_is_text:new o.bN(F),u_elevation_from_sea:new o.bN(F),u_pitch_with_map:new o.bN(F),u_texsize:new o.bK(F),u_texsize_icon:new o.bK(F),u_texture:new o.bN(F),u_texture_icon:new o.bN(F),u_gamma_scale:new o.bM(F),u_device_pixel_ratio:new o.bM(F),u_tile_id:new o.bL(F),u_zoom_transition:new o.bM(F),u_inv_rot_matrix:new o.bJ(F),u_merc_center:new o.bK(F),u_camera_forward:new o.bL(F),u_tile_matrix:new o.bJ(F),u_up_vector:new o.bL(F),u_ecef_origin:new o.bL(F),u_is_halo:new o.bN(F),u_icon_transition:new o.bM(F),u_color_adj_mat:new o.bJ(F),u_scale_factor:new o.bM(F)}),background:F=>({u_matrix:new o.bJ(F),u_emissive_strength:new o.bM(F),u_opacity:new o.bM(F),u_color:new o.cz(F)}),backgroundPattern:F=>({u_matrix:new o.bJ(F),u_emissive_strength:new o.bM(F),u_opacity:new o.bM(F),u_image:new o.bN(F),u_pattern_tl:new o.bK(F),u_pattern_br:new o.bK(F),u_texsize:new o.bK(F),u_pattern_size:new o.bK(F),u_pixel_coord_upper:new o.bK(F),u_pixel_coord_lower:new o.bK(F),u_pattern_units_to_pixels:new o.bK(F)}),terrainRaster:F=>({u_matrix:new o.bJ(F),u_image0:new o.bN(F),u_skirt_height:new o.bM(F),u_ground_shadow_factor:new o.bL(F)}),skybox:F=>({u_matrix:new o.bJ(F),u_sun_direction:new o.bL(F),u_cubemap:new o.bN(F),u_opacity:new o.bM(F),u_temporal_offset:new o.bM(F)}),skyboxGradient:F=>({u_matrix:new o.bJ(F),u_color_ramp:new o.bN(F),u_center_direction:new o.bL(F),u_radius:new o.bM(F),u_opacity:new o.bM(F),u_temporal_offset:new o.bM(F)}),skyboxCapture:F=>({u_matrix_3f:new o.cA(F),u_sun_direction:new o.bL(F),u_sun_intensity:new o.bM(F),u_color_tint_r:new o.ca(F),u_color_tint_m:new o.ca(F),u_luminance:new o.bM(F)}),globeRaster:F=>({u_proj_matrix:new o.bJ(F),u_globe_matrix:new o.bJ(F),u_normalize_matrix:new o.bJ(F),u_merc_matrix:new o.bJ(F),u_zoom_transition:new o.bM(F),u_merc_center:new o.bK(F),u_image0:new o.bN(F),u_grid_matrix:new o.cA(F),u_skirt_height:new o.bM(F),u_far_z_cutoff:new o.bM(F),u_frustum_tl:new o.bL(F),u_frustum_tr:new o.bL(F),u_frustum_br:new o.bL(F),u_frustum_bl:new o.bL(F),u_globe_pos:new o.bL(F),u_globe_radius:new o.bM(F),u_viewport:new o.bK(F)}),globeAtmosphere:F=>({u_frustum_tl:new o.bL(F),u_frustum_tr:new o.bL(F),u_frustum_br:new o.bL(F),u_frustum_bl:new o.bL(F),u_horizon:new o.bM(F),u_transition:new o.bM(F),u_fadeout_range:new o.bM(F),u_color:new o.ca(F),u_high_color:new o.ca(F),u_space_color:new o.ca(F),u_temporal_offset:new o.bM(F),u_horizon_angle:new o.bM(F)}),model:F=>({u_matrix:new o.bJ(F),u_lighting_matrix:new o.bJ(F),u_normal_matrix:new o.bJ(F),u_node_matrix:new o.bJ(F),u_lightpos:new o.bL(F),u_lightintensity:new o.bM(F),u_lightcolor:new o.bL(F),u_camera_pos:new o.bL(F),u_opacity:new o.bM(F),u_baseColorFactor:new o.ca(F),u_emissiveFactor:new o.ca(F),u_metallicFactor:new o.bM(F),u_roughnessFactor:new o.bM(F),u_baseTextureIsAlpha:new o.bN(F),u_alph
2668aMask:new o.bN(F),u_alphaCutoff:new o.bM(F),u_baseColorTexture:new o.bN(F),u_metallicRoughnessTexture:new o.bN(F),u_normalTexture:new o.bN(F),u_occlusionTexture:new o.bN(F),u_emissionTexture:new o.bN(F),u_lutTexture:new o.bN(F),u_color_mix:new o.ca(F),u_aoIntensity:new o.bM(F),u_emissive_strength:new o.bM(F),u_occlusionTextureTransform:new o.ca(F)}),modelDepth:F=>({u_matrix:new o.bJ(F),u_instance:new o.bJ(F),u_node_matrix:new o.bJ(F)}),groundShadow:F=>({u_matrix:new o.bJ(F),u_ground_shadow_factor:new o.bL(F)}),stars:F=>({u_matrix:new o.bJ(F),u_up:new o.bL(F),u_right:new o.bL(F),u_intensity_multiplier:new o.bM(F)}),snowParticle:F=>({u_modelview:new o.bJ(F),u_projection:new o.bJ(F),u_time:new o.bM(F),u_cam_pos:new o.bL(F),u_velocityConeAperture:new o.bM(F),u_velocity:new o.bM(F),u_horizontalOscillationRadius:new o.bM(F),u_horizontalOscillationRate:new o.bM(F),u_boxSize:new o.bM(F),u_billboardSize:new o.bM(F),u_simpleShapeParameters:new o.bK(F),u_screenSize:new o.bK(F),u_thinningCenterPos:new o.bK(F),u_thinningShape:new o.bL(F),u_thinningAffectedRatio:new o.bM(F),u_thinningParticleOffset:new o.bM(F),u_particleColor:new o.ca(F),u_direction:new o.bL(F)}),rainParticle:F=>({u_modelview:new o.bJ(F),u_projection:new o.bJ(F),u_time:new o.bM(F),u_cam_pos:new o.bL(F),u_texScreen:new o.bN(F),u_velocityConeAperture:new o.bM(F),u_velocity:new o.bM(F),u_boxSize:new o.bM(F),u_rainDropletSize:new o.bK(F),u_distortionStrength:new o.bM(F),u_rainDirection:new o.bL(F),u_color:new o.ca(F),u_screenSize:new o.bK(F),u_thinningCenterPos:new o.bK(F),u_thinningShape:new o.bL(F),u_thinningAffectedRatio:new o.bM(F),u_thinningParticleOffset:new o.bM(F),u_shapeDirectionalPower:new o.bM(F),u_shapeNormalPower:new o.bM(F),u_mode:new o.bM(F)}),vignette:F=>({u_vignetteShape:new o.bL(F),u_vignetteColor:new o.ca(F)}),occlusion:F=>({u_matrix:new o.bJ(F),u_anchorPos:new o.bL(F),u_screenSizePx:new o.bK(F),u_occluderSizePx:new o.bK(F),u_color:new o.ca(F)})};class Hs{constructor(t,l,B,G){this.id=Hs.uniqueIdxCounter,Hs.uniqueIdxCounter++,this.context=t;const Z=t.gl;this.buffer=Z.createBuffer(),this.dynamicDraw=!!B,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),Z.bufferData(Z.ELEMENT_ARRAY_BUFFER,l.arrayBuffer,this.dynamicDraw?Z.DYNAMIC_DRAW:Z.STATIC_DRAW),this.dynamicDraw||G||l.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){this.id=Hs.uniqueIdxCounter,Hs.uniqueIdxCounter++;const l=this.context.gl;this.context.unbindVAO(),this.bind(),l.bufferSubData(l.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}Hs.uniqueIdxCounter=0;const ds={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Pa{constructor(t,l,B,G,Z,Y){this.length=l.length,this.attributes=B,this.itemSize=l.bytesPerElement,this.dynamicDraw=G,this.instanceCount=Y,this.context=t;const re=t.gl;this.buffer=re.createBuffer(),t.bindVertexBuffer.set(this.buffer),re.bufferData(re.ARRAY_BUFFER,l.arrayBuffer,this.dynamicDraw?re.DYNAMIC_DRAW:re.STATIC_DRAW),this.dynamicDraw||Z||l.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){const l=this.context.gl;this.bind(),l.bufferSubData(l.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,l){for(let B=0;B<this.attributes.length;B++){const G=l.attributes[this.attributes[B].name];G!==void 0&&t.enableVertexAttribArray(G)}}setVertexAttribPointers(t,l,B){for(let G=0;G<this.attributes.length;G++){const Z=this.attributes[G],Y=l.attributes[Z.name];Y!==void 0&&t.vertexAttribPointer(Y,Z.components,t[ds[Z.type]],!1,this.itemSize,Z.offset+this.itemSize*(B||0))}}setVertexAttribDivisor(t,l,B){for(let G=0;G<this.attributes.length;G++){const Z=l.attributes[this.attributes[G].name];Z!==void 0&&this.instanceCount&&this.instanceCount>0&&t.vertexAttribDivisor(Z,B)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Wh{constructor(t,l,B,G,Z){this.context=t,this.width=l,this.height=B;const Y=this.framebuffer=t.gl.createFramebuffer();
vendor: 6,383 bytes, line 2668
2668G&&(this.colorAttachment=new vo(t,Y)),Z&&(this.depthAttachmentType=Z,this.depthAttachment=Z==="renderbuffer"?new zh(t,Y):new fd(t,Y))}destroy(){const t=this.context.gl;if(this.colorAttachment){const l=this.colorAttachment.get();l&&t.deleteTexture(l)}if(this.depthAttachment&&this.depthAttachmentType)if(this.depthAttachmentType==="renderbuffer"){const l=this.depthAttachment.get();l&&t.deleteRenderbuffer(l)}else{const l=this.depthAttachment.get();l&&t.deleteTexture(l)}t.deleteFramebuffer(this.framebuffer)}}class Zh{constructor(t,l){this.gl=t,this.clearColor=new Sh(this),this.clearDepth=new Th(this),this.clearStencil=new Eh(this),this.colorMask=new Ah(this),this.depthMask=new cd(this),this.stencilMask=new hd(this),this.stencilFunc=new qp(this),this.stencilOp=new hl(this),this.stencilTest=new ul(this),this.depthRange=new ud(this),this.depthTest=new us(this),this.depthFunc=new Mh(this),this.blend=new lc(this),this.blendFunc=new cc(this),this.blendColor=new Ph(this),this.blendEquation=new Ch(this),this.cullFace=new hc(this),this.cullFaceSide=new Ih(this),this.frontFace=new Dh(this),this.program=new uc(this),this.activeTexture=new dd(this),this.viewport=new pd(this),this.bindFramebuffer=new yo(this),this.bindRenderbuffer=new $p(this),this.bindTexture=new Hp(this),this.bindVertexBuffer=new Wp(this),this.bindElementBuffer=new Zp(this),this.bindVertexArrayOES=new Xp(this),this.pixelStoreUnpack=new Yp(this),this.pixelStoreUnpackPremultiplyAlpha=new kh(this),this.pixelStoreUnpackFlipY=new Rh(this),this.options=l?Object.assign({},l):{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=t.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=t.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=t.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=l&&!!l.forceManualRenderingForInstanceIDShaders||this.renderer&&this.renderer.indexOf("PowerVR")!==-1,this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=t.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxPointSize=t.getParameter(t.ALIASED_POINT_SIZE_RANGE)[1]}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(t,l,B){return new Hs(this,t,l,B)}createVertexBuffer(t,l,B,G,Z){return new Pa(this,t,l,B,G,Z)}createRenderbuffer(t,l,B){const G=this.gl,Z=G.createRenderbuffer();return this.bindRenderbuffer.set(Z),G.renderbufferStorage(G.RENDERBUFFER,t,l,B),this.bindRenderbuffer.set(null),Z}createFramebuffer(t,l,B,G){return new Wh(this,t,l,B,G)}clear({color:t,depth:l,stencil:B,colorMask:G}){const Z=this.gl;let Y=0;t&&(Y|=Z.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set(G||[!0,!0,!0,!0])),l!==void 0&&(Y|=Z.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(l),this.depthMask.set(!0)),B!==void 0&&(Y|=Z.STENCIL_BUFFER_BIT,this.clearStencil.set(B),this.stencilMask.set(255)),Z.clear(Y)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){o.bn(t.blendFunction,ir.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)}}let So;function xc(F,t,l,B,G,Z,Y){const re=F.context,oe=re.gl,ce=F.transform,he=F.getOrCreateProgram("collisionBox"),pe=[];let fe=0,be=0;for(let Ze=0;Ze<B.length;Ze++){const nt=B[Ze],Qe=t.getTile(nt),it=Qe.getBucket(l);if(!it)continue;const Ke=zs(nt,it,ce);let ht=Ke;G[0]===0&&G[1]===0||(ht=F.translatePosMatrix(Ke,Qe,G,Z));const yt=Y?it.textCollisionBox:it.iconCollisionBox,Nt=it.collisionCircleArray;
2668if(Nt.length>0){const Dt=o.ab.mat4.create(),Wt=ht;o.ab.mat4.mul(Dt,it.placementInvProjMatrix,ce.glCoordMatrix),o.ab.mat4.mul(Dt,Dt,it.placementViewportMatrix),pe.push({circleArray:Nt,circleOffset:be,transform:Wt,invTransform:Dt,projection:it.getProjection()}),fe+=Nt.length/4,be=fe}yt&&(F.terrain&&F.terrain.setupElevationDraw(Qe,he),he.draw(F,oe.LINES,ki.disabled,Ui.disabled,F.colorModeForRenderPass(),qi.disabled,ef(ht,ce,Qe,it.getProjection()),l.id,yt.layoutVertexBuffer,yt.indexBuffer,yt.segments,null,ce.zoom,null,[yt.collisionVertexBuffer,yt.collisionVertexBufferExt]))}if(!Y||!pe.length)return;const ze=F.getOrCreateProgram("collisionCircle"),De=new o.cV;De.resize(4*fe),De._trim();let Oe=0;for(const Ze of pe)for(let nt=0;nt<Ze.circleArray.length/4;nt++){const Qe=4*nt,it=Ze.circleArray[Qe+0],Ke=Ze.circleArray[Qe+1],ht=Ze.circleArray[Qe+2],yt=Ze.circleArray[Qe+3];De.emplace(Oe++,it,Ke,ht,yt,0),De.emplace(Oe++,it,Ke,ht,yt,1),De.emplace(Oe++,it,Ke,ht,yt,2),De.emplace(Oe++,it,Ke,ht,yt,3)}(!So||So.length<2*fe)&&(So=function(Ze){const nt=2*Ze,Qe=new o.aU;Qe.resize(nt),Qe._trim();for(let it=0;it<nt;it++){const Ke=6*it;Qe.uint16[Ke+0]=4*it+0,Qe.uint16[Ke+1]=4*it+1,Qe.uint16[Ke+2]=4*it+2,Qe.uint16[Ke+3]=4*it+2,Qe.uint16[Ke+4]=4*it+3,Qe.uint16[Ke+5]=4*it+0}return Qe}(fe));const Fe=re.createIndexBuffer(So,!0),Ge=re.createVertexBuffer(De,o.cW.members,!0);for(const Ze of pe){const nt={u_matrix:Ze.transform,u_inv_matrix:Ze.invTransform,u_camera_to_center_distance:(Xe=ce).getCameraToCenterDistance(Ze.projection),u_viewport_size:[Xe.width,Xe.height]};ze.draw(F,oe.TRIANGLES,ki.disabled,Ui.disabled,F.colorModeForRenderPass(),qi.disabled,nt,l.id,Ge,Fe,o.b7.simpleSegment(0,2*Ze.circleOffset,Ze.circleArray.length,Ze.circleArray.length/2),null,ce.zoom)}var Xe;Ge.destroy(),Fe.destroy()}const yl=o.ab.mat4.create();function _s(F){const t=F._camera.getWorldToCamera(F.worldSize,1),l=o.ab.mat4.multiply([],t,F.globeMatrix);o.ab.mat4.invert(l,l);const B=[0,0,0],G=[0,1,0,0];return o.ab.vec4.transformMat4(G,G,l),B[0]=G[0],B[1]=G[1],B[2]=G[2],o.ab.vec3.normalize(B,B),B}function Nr({width:F,height:t,anchor:l,textOffset:B,textScale:G},Z){const{horizontalAlign:Y,verticalAlign:re}=o.bD(l),oe=-(Y-.5)*F,ce=-(re-.5)*t,he=o.bC(l,B);return new o.P((oe/G+he[0])*Z,(ce/G+he[1])*Z)}function bc(F,t,l,B,G,Z,Y,re,oe,ce,he){const pe=F.text.placedSymbolArray,fe=F.text.dynamicLayoutVertexArray,be=F.icon.dynamicLayoutVertexArray,ze={},De=F.getProjection(),Oe=Ua(re,De,Z),Fe=Z.elevation,Ge=De.upVectorScale(re.canonical,Z.center.lat,Z.worldSize).metersToTile;fe.clear();for(let Xe=0;Xe<pe.length;Xe++){const Ze=pe.get(Xe),{tileAnchorX:nt,tileAnchorY:Qe,numGlyphs:it}=Ze,Ke=Ze.hidden||!Ze.crossTileID||F.allowVerticalPlacement&&!Ze.placedOrientation?null:B[Ze.crossTileID];if(Ke){let ht=0,yt=0,Nt=0;if(Fe){const Ut=Fe?Fe.getAtTileOffset(re,nt,Qe):0,[hi,Qt,Xt]=De.upVector(re.canonical,nt,Qe);ht=Ut*hi*Ge,yt=Ut*Qt*Ge,Nt=Ut*Xt*Ge}let[Dt,Wt,$t,At]=as(Ze.projectedAnchorX+ht,Ze.projectedAnchorY+yt,Ze.projectedAnchorZ+Nt,l?Oe:Y);const Vt=Jl(Z.getCameraToCenterDistance(De),At);let ii=G.evaluateSizeForFeature(F.textSizeData,ce,Ze)*Vt/o.bw;l&&(ii*=F.tilePixelRatio/oe);const Et=Nr(Ke,ii);l?({x:Dt,y:Wt,z:$t}=De.projectTilePoint(nt+Et.x,Qe+Et.y,re.canonical),[Dt,Wt,$t]=as(Dt+ht,Wt+yt,$t+Nt,Y)):(t&&Et._rotate(-Z.angle),Dt+=Et.x,Wt+=Et.y,$t=0);const Jt=F.allowVerticalPlacement&&Ze.placedOrientation===o.bq.vertical?Math.PI/2:0;for(let Ut=0;Ut<it;Ut++)o.bt(fe,Dt,Wt,$t,Jt);he&&Ze.associatedIconIndex>=0&&(ze[Ze.associatedIconIndex]={x:Dt,y:Wt,z:$t,angle:Jt})}else Kr(it,fe)}if(he){be.clear();const Xe=F.icon.placedSymbolArray;for(let Ze=0;Ze<Xe.length;Ze++){const nt=Xe.get(Ze),{numGlyphs:Qe}=nt,it=ze[Ze];if(nt.hidden||!it)Kr(Qe,be);else{const{x:Ke,y:ht,z:yt,angle:Nt}=it;for(let Dt=0;Dt<Qe;Dt++)o.bt(be,Ke,ht,yt,Nt)}}F.icon.dynamicLayoutVertexBuffer.updateData(be)}F.text.dynamicLayoutVertexBuffer.updateData(fe)}function vl(F,t,l,B,G,Z,Y={}){const re=l.paint.get("icon-translate"),oe=l.paint.get("text-translate"),ce=l.paint.get("icon-translate-anchor"),he=l.paint.get("text-translate-anchor"),pe=l.layout.get("icon-rotation-alignment"),fe=l.layout.get("text-rotation-alignment"),be=l.layout.get("icon-pitch-alignment"),ze=l.layout.get("text-pitch-alignment"),De=l.layout.get("icon-keep-upright"),Oe=l.layout.get("text-keep-upright"),Fe=l.paint.get("icon-color-saturation"),Ge=l.paint.get("icon-color-contrast"),Xe=l.paint.get("icon-color-brightness-min"),Ze=l.paint.get("icon-color-brightness-max"),nt=l.layout.get("symbol-elevation-reference")==="sea",Qe=F.context,it=Qe.gl,Ke=F.transform,ht=pe==="map",yt=fe==="map",Nt=be==="map",Dt=ze==="map",Wt=l.layout.get("symbol-sort-key").constantOr(1)!==void 0;let $t=!1;const At=F.depthModeForSublayer(0,ki.ReadOnly),Vt=[o.at(Ke.center.lng),o.aA(Ke.center.lat)],ii=l.layout.get("text-variable-anchor"),Et=Ke.projection.name==="globe",Jt=[],Ut=[0,-1,0];for(const hi of B){const Qt=t.getTile(hi),Xt=Qt.getBucket(l);if(!Xt||Xt.projection.name==="mercator"&&Et||Xt.fullyClipped)continue;const ri=Xt.projection.name==="globe",ci=ri?o.ae(Ke.zoom):0,xi=Ua(hi,Xt.getProjection(),Ke),Si=Ke.calculatePixelsToTileUnitsMatrix(Qt),Vi=ii&&Xt.hasTextData(),Ci=Xt.hasIconTextFit()&&Vi&&Xt.hasIconData(),Ri=Xt.getProjection().createInversionMatrix(Ke,hi.canonical),Hi=br=>{Ke.depthOcclusionForSymbolsAndCircles&&(l.hasInitialOcclusionOpacityProperties||F.terrain)&&(br.push("DEPTH_D24"),br.push("DEPTH_OCCLUSION"))},cr=()=>{const br=ht&&l.layout.get("symbol-placement")!=="point",Er=[];Hi(Er);const Zr=br||Ci,Cn=l.paint.get("icon-image-cross-fade").constantOr(0);F.terrainRenderModeElevated()&&Nt&&Er.push("PITCH_WITH_MAP_TERRAIN"),ri&&(Er.push("PROJECTION_GLOBE_VIEW"),Zr&&Er.push("PROJECTED_POS_ON_VIEWPORT")),Cn>0&&Er.push("ICON_TRANSITION"),Xt.icon.zOffsetVertexBuffer&&Er.push("Z_OFFSET"),Fe===0&&Ge===0&&Xe===0&&Ze===1||Er.push("COLOR_ADJUSTMENT"),Xt.sdfIcons&&Er.push("RENDER_SDF");const xn=Xt.icon.programConfigurations.get(l.id),bn=F.getOrCreateProgram("symbol",{c
2668onfig:xn,defines:Er}),xs=Qt.imageAtlasTexture?Qt.imageAtlasTexture.size:[0,0],Zn=Xt.iconSizeData,Xr=o.bp(Zn,Ke.zoom),Or=Nt||Ke.pitch!==0,zr=zn(xi,Qt.tileID.canonical,Nt,ht,Ke,Xt.getProjection(),Si),ur=ah(xi,Qt.tileID.canonical,Nt,ht,Ke,Xt.getProjection(),Si),hn=F.translatePosMatrix(ur,Qt,re,ce,!0),In=F.translatePosMatrix(xi,Qt,re,ce),Fr=Zr?yl:zr,Xn=ht&&!Nt&&!br;let Cs=Ut;!Et&&!Ke.mercatorFromTransition||ht||(Cs=_s(Ke));const ms=ri?Cs:Ut,hs=l.getColorAdjustmentMatrix(Fe,Ge,Xe,Ze),Ks=Gh(Zn.kind,Xr,Xn,Nt,F,In,Fr,hn,nt,!1,xs,[0,0],!0,hi,ci,Vt,Ri,ms,Xt.getProjection(),hs,Cn),Is=Qt.imageAtlasTexture?Qt.imageAtlasTexture:null,bs=l.layout.get("icon-size").constantOr(0)!==1||Xt.iconsNeedLinear,oo=Xt.sdfIcons||F.options.rotating||F.options.zooming||bs||Or?it.LINEAR:it.NEAREST,Qs=Xt.sdfIcons&&l.paint.get("icon-halo-width").constantOr(1)!==0,lo=F.terrain&&Nt&&br?o.ab.mat4.invert(o.ab.mat4.create(),zr):yl;if(br&&Xt.icon){const Fo=Ke.elevation,Oc=Fo?Fo.getAtTileOffsetFunc(hi,Ke.center.lat,Ke.worldSize,Xt.getProjection()):null,_u=sn(xi,Qt.tileID.canonical,Nt,ht,Ke,Xt.getProjection(),Si);Kl(Xt,xi,F,!1,_u,ur,Nt,De,Oc,hi)}return{program:bn,buffers:Xt.icon,uniformValues:Ks,atlasTexture:Is,atlasTextureIcon:null,atlasInterpolation:oo,atlasInterpolationIcon:null,isSDF:Xt.sdfIcons,hasHalo:Qs,tile:Qt,labelPlaneMatrixInv:lo}},Cr=()=>{const br=yt&&l.layout.get("symbol-placement")!=="point",Er=[],Zr=br||ii||Ci;F.terrainRenderModeElevated()&&Dt&&Er.push("PITCH_WITH_MAP_TERRAIN"),ri&&(Er.push("PROJECTION_GLOBE_VIEW"),Zr&&Er.push("PROJECTED_POS_ON_VIEWPORT")),Xt.text.zOffsetVertexBuffer&&Er.push("Z_OFFSET"),Xt.iconsInText&&Er.push("RENDER_TEXT_AND_SYMBOL"),Er.push("RENDER_SDF"),Hi(Er);const Cn=Xt.text.programConfigurations.get(l.id),xn=F.getOrCreateProgram("symbol",{config:Cn,defines:Er});let bn,xs=[0,0],Zn=null;const Xr=Xt.textSizeData;Xt.iconsInText&&(xs=Qt.imageAtlasTexture?Qt.imageAtlasTexture.size:[0,0],Zn=Qt.imageAtlasTexture?Qt.imageAtlasTexture:null,bn=Dt||Ke.pitch!==0||F.options.rotating||F.options.zooming||Xr.kind==="composite"||Xr.kind==="camera"?it.LINEAR:it.NEAREST);const Or=Qt.glyphAtlasTexture?Qt.glyphAtlasTexture.size:[0,0],zr=l.layout.get("text-size-scale-range"),ur=o.aw(F.scaleFactor,zr[0],zr[1]),hn=o.bp(Xr,Ke.zoom,ur),In=zn(xi,Qt.tileID.canonical,Dt,yt,Ke,Xt.getProjection(),Si),Fr=ah(xi,Qt.tileID.canonical,Dt,yt,Ke,Xt.getProjection(),Si),Xn=F.translatePosMatrix(Fr,Qt,oe,he,!0),Cs=F.translatePosMatrix(xi,Qt,oe,he),ms=Zr?yl:In,hs=yt&&!Dt&&!br;let Ks=Ut;!Et&&!Ke.mercatorFromTransition||yt||(Ks=_s(Ke));const Is=Gh(Xr.kind,hn,hs,Dt,F,Cs,ms,Xn,nt,!0,Or,xs,!0,hi,ci,Vt,Ri,ri?Ks:Ut,Xt.getProjection(),null,null,ur),bs=Qt.glyphAtlasTexture?Qt.glyphAtlasTexture:null,oo=it.LINEAR,Qs=l.paint.get("text-halo-width").constantOr(1)!==0,lo=F.terrain&&Dt&&br?o.ab.mat4.invert(o.ab.mat4.create(),In):yl;if(br&&Xt.text){const Fo=Ke.elevation,Oc=Fo?Fo.getAtTileOffsetFunc(hi,Ke.center.lat,Ke.worldSize,Xt.getProjection()):null,_u=sn(xi,Qt.tileID.canonical,Dt,yt,Ke,Xt.getProjection(),Si);Kl(Xt,xi,F,!0,_u,Fr,Dt,Oe,Oc,hi)}return{program:xn,buffers:Xt.text,uniformValues:Is,atlasTexture:bs,atlasTextureIcon:Zn,atlasInterpolation:oo,atlasInterpolationIcon:bn,isSDF:!0,hasHalo:Qs,tile:Qt,labelPlaneMatrixInv:lo}},Yr=Xt.icon.segments.get().length,Ur=Xt.text.segments.get().length,Zi=Yr&&!Y.onlyText?cr():null,fr=Ur&&!Y.onlyIcons?Cr():null,Pi=l.paint.get("icon-opacity").constantOr(1),ar=l.paint.get("text-opacity").constantOr(1);if(Wt&&Xt.canOverlap){$t=!0;const br=Pi&&!Y.onlyText?Xt.icon.segments.get():[],Er=ar&&!Y.onlyIcons?Xt.text.segments.get():[];for(const Zr of br)Jt.push({segments:new o.b7([Zr]),sortKey:Zr.sortKey,state:Zi});for(const Zr of Er)Jt.push({segments:new o.b7([Zr]),sortKey:Zr.sortKey,state:fr})}else Y.onlyText||Jt.push({segments:Pi?Xt.icon.segments:new o.b7([]),sortKey:0,state:Zi}),Y.onlyIcons||Jt.push({segments:ar?Xt.text.segments:new o.b7([]),sortKey:0,state:fr})}$t&&Jt.sort((hi,Qt)=>hi.sortKey-Qt.sortKey);for(const hi of Jt){const Qt=hi.state;if(Qt)if(F.terrain?F.terrain.setupElevationDraw(Qt.tile,Qt.program,{useDepthForOcclusion:Ke.depthOcclusionForSymbolsAndCircles,labelPlaneMatr
2668ixInv:Qt.labelPlaneMatrixInv}):F.setupDepthForOcclusion(Ke.depthOcclusionForSymbolsAndCircles,Qt.program),Qe.activeTexture.set(it.TEXTURE0),Qt.atlasTexture&&Qt.atlasTexture.bind(Qt.atlasInterpolation,it.CLAMP_TO_EDGE,!0),Qt.atlasTextureIcon&&(Qe.activeTexture.set(it.TEXTURE1),Qt.atlasTextureIcon&&Qt.atlasTextureIcon.bind(Qt.atlasInterpolationIcon,it.CLAMP_TO_EDGE,!0)),F.uploadCommonLightUniforms(F.context,Qt.program),Qt.hasHalo){const Xt=Qt.uniformValues;Xt.u_is_halo=1,wc(Qt.buffers,hi.segments,l,F,Qt.program,At,G,Z,Xt,2),Xt.u_is_halo=0}else{if(Qt.isSDF){const Xt=Qt.uniformValues;Qt.hasHalo&&(Xt.u_is_halo=1,wc(Qt.buffers,hi.segments,l,F,Qt.program,At,G,Z,Xt,1)),Xt.u_is_halo=0}wc(Qt.buffers,hi.segments,l,F,Qt.program,At,G,Z,Qt.uniformValues,1)}}}function wc(F,t,l,B,G,Z,Y,re,oe,ce){const he=[F.dynamicLayoutVertexBuffer,F.opacityVertexBuffer,F.iconTransitioningVertexBuffer,F.globeExtVertexBuffer,F.zOffsetVertexBuffer];G.draw(B,B.context.gl.TRIANGLES,Z,Y,re,qi.disabled,oe,l.id,F.layoutVertexBuffer,F.indexBuffer,t,l.paint,B.transform.zoom,F.programConfigurations.get(l.id),he,ce)}function Xh(F,t,l,B,G,Z,Y){const re=F.context.gl,oe=l.paint.get("fill-pattern"),ce=l.is3D(),he=ce?F.stencilModeFor3D():Ui.disabled,pe=oe&&oe.constantOr(1);let fe,be,ze,De,Oe;Y?(be=pe&&!l.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",fe=re.LINES):(be=pe?"fillPattern":"fill",fe=re.TRIANGLES);for(const Fe of B){const Ge=t.getTile(Fe);if(pe&&!Ge.patternsLoaded())continue;const Xe=Ge.getBucket(l);if(!Xe)continue;F.prepareDrawTile();const Ze=Xe.programConfigurations.get(l.id),nt=F.isTileAffectedByFog(Fe),Qe=F.getOrCreateProgram(be,{config:Ze,overrideFog:nt});pe&&(F.context.activeTexture.set(re.TEXTURE0),Ge.imageAtlasTexture&&Ge.imageAtlasTexture.bind(re.LINEAR,re.CLAMP_TO_EDGE),Ze.updatePaintBuffers());const it=oe.constantOr(null);if(it&&Ge.imageAtlas){const yt=Ge.imageAtlas,Nt=o.A.from(it).getPrimary().scaleSelf(o.q.devicePixelRatio).serialize(),Dt=yt.patternPositions[Nt];Dt&&Ze.setConstantPatternPositions(Dt)}const Ke=F.translatePosMatrix(Fe.projMatrix,Ge,l.paint.get("fill-translate"),l.paint.get("fill-translate-anchor")),ht=l.paint.get("fill-emissive-strength");if(Y){De=Xe.indexBuffer2,Oe=Xe.segments2;const yt=F.terrain&&F.terrain.renderingToTexture?F.terrain.drapeBufferSize:[re.drawingBufferWidth,re.drawingBufferHeight];ze=be==="fillOutlinePattern"&&pe?xd(Ke,ht,F,Ge,yt):Nh(Ke,ht,yt)}else De=Xe.indexBuffer,Oe=Xe.segments,ze=pe?gl(Ke,ht,F,Ge):ml(Ke,ht);F.uploadCommonUniforms(F.context,Qe,Fe.toUnwrapped()),Qe.draw(F,fe,G,ce?he:F.stencilModeForClipping(Fe),Z,qi.disabled,ze,l.id,Xe.layoutVertexBuffer,De,Oe,l.paint,F.transform.zoom,Ze,void 0)}}function xl(F,t,l,B,G,Z,Y,re){l.resetLayerRenderingStats(F);const oe=F.context,ce=oe.gl,he=F.transform,pe=l.paint.get("fill-extrusion-pattern"),fe=pe.constantOr(1),be=l.paint.get("fill-extrusion-opacity"),ze=F.style.enable3dLights(),De=l.paint.get(ze&&!fe?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),Oe=[l.paint.get("fill-extrusion-ambient-occlusion-intensity"),De],Fe=l.layout.get("fill-extrusion-edge-radius"),Ge=Fe>0&&!l.paint.get("fill-extrusion-rounded-roof"),Xe=Ge?0:Fe,Ze=he.projection.name==="globe"?o.d3():0,nt=he.projection.name==="globe",Qe=nt?o.ae(he.zoom):0,it=[o.at(he.center.lng),o.aA(he.center.lat)],Ke=l.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default")==="none",ht=l.paint.get("fill-extrusion-flood-light-color").toRenderColor(Ke?null:l.lut).toArray01().slice(0,3),yt=l.paint.get("fill-extrusion-flood-light-intensity"),Nt=l.paint.get("fill-extrusion-vertical-scale"),Dt=l.paint.get("fill-extrusion-line-width").constantOr(1)!==0,Wt=l.paint.get("fill-extrusion-height-alignment"),$t=l.paint.get("fill-extrusion-base-alignment"),At=Ta(F,l.paint.get("fill-extrusion-cutoff-fade-range")),Vt=[];let ii;nt&&Vt.push("PROJECTION_GLOBE_VIEW"),Oe[0]>0&&Vt.push("FAUX_AO"),Ge&&Vt.push("ZERO_ROOF_RADIUS"),re&&Vt.push("HAS_CENTROID"),yt>0&&Vt.push("FLOOD_LIGHT"),At.shouldRenderCutoff&&Vt.push("RENDER_CUTOFF"),Dt&&Vt.push("RENDER_WALL_MODE");const Et=F.renderPass==="shadow",Jt=F.shadowRenderer,Ut=Et&&!!Jt;F.shadowRenderer&&(F.shadowRenderer.useNormalOffset=!0);let hi=[0,0,0];if(Jt){const ri=F.style.directionalLight,ci=F.style.ambientLight;ri&&ci&&(hi=_h(F.style,ri,ci)),Et||(Vt.push("RENDER_SHADOWS","DEPTH_TEXTURE"),Jt.useNormalOffset&&Vt.push("NORMAL_OFFSET")),ii=Vt.concat(["SHADOWS_SINGLE_CASCADE"])}const Qt=Ut?"fillExtrusionDepth":fe?"fillExtrusionPattern":"fillExtrusion",Xt=l.getLayerRenderingStats();for(const ri of B){const ci=t.getTile(ri),xi=ci.getBucket(l);if(!xi||xi.projection.name!==he.projection.name)continue;let Si=!1;Jt&&(Si=Jt.getMaxCascadeForTile(ri.toUnwrapped())===0);const Vi=F.isTileAffectedByFog(ri),Ci=xi.programConfigurations.get(l.id),Ri=F.getOrCreateProgram(Qt,{config:Ci,defines:Si?ii:Vt,overrideFog:Vi});if(F.terrain&&F.terrain.setupElevationDraw(ci,Ri,{useMeterToDem:!0}),!xi.centroidVertexBuffer){const fr=Ri.attributes.a_centroid_pos;fr!==void 0&&ce.vertexAttrib2f(fr,0,0)}!Et&&Jt&&Jt.setupShadows(ci.tileID.toUnwrapped(),Ri,"vector-tile",ci.tileID.overscaledZ
2668),fe&&(F.context.activeTexture.set(ce.TEXTURE0),ci.imageAtlasTexture&&ci.imageAtlasTexture.bind(ce.LINEAR,ce.CLAMP_TO_EDGE),Ci.updatePaintBuffers());const Hi=pe.constantOr(null);if(Hi&&ci.imageAtlas){const fr=ci.imageAtlas,Pi=o.A.from(Hi).getPrimary().scaleSelf(o.q.devicePixelRatio),ar=fr.patternPositions[Pi.serialize()];ar&&Ci.setConstantPatternPositions(ar)}const cr=l.paint.get("fill-extrusion-vertical-gradient"),Cr=1/xi.tileToMeter;let Yr;if(Et&&Jt){if(Mo(ci.tileID,xi,F))continue;const fr=Jt.calculateShadowPassMatrixFromTile(ci.tileID.toUnwrapped());Yr=fl(fr,Xe,Cr,Nt,Wt,$t)}else{const fr=F.translatePosMatrix(ri.expandedProjMatrix,ci,l.paint.get("fill-extrusion-translate"),l.paint.get("fill-extrusion-translate-anchor")),Pi=he.projection.createInversionMatrix(he,ri.canonical);Yr=fe?vd(fr,F,cr,be,Oe,Xe,Cr,ri,ci,Ze,Wt,$t,Qe,it,Pi,ht,Nt):gc(fr,F,cr,be,Oe,Xe,Cr,ri,Ze,Wt,$t,Qe,it,Pi,ht,Nt,yt,hi)}F.uploadCommonUniforms(oe,Ri,ri.toUnwrapped(),null,At);let Ur=xi.segments;if(he.projection.name==="mercator"&&!Et&&(Ur=xi.getVisibleSegments(ci.tileID,F.terrain,F.transform.getFrustum(0)),!Ur.get().length))continue;if(Xt)if(Et)for(const fr of Ur.get())Xt.numRenderedVerticesInShadowPass+=fr.primitiveLength;else for(const fr of Ur.get())Xt.numRenderedVerticesInTransparentPass+=fr.primitiveLength;const Zi=[];(F.terrain||re)&&Zi.push(xi.centroidVertexBuffer),nt&&Zi.push(xi.layoutVertexExtBuffer),Dt&&Zi.push(xi.wallVertexBuffer),Ri.draw(F,oe.gl.TRIANGLES,G,Z,Y,qi.backCCW,Yr,l.id,xi.layoutVertexBuffer,xi.indexBuffer,Ur,l.paint,F.transform.zoom,Ci,Zi)}F.shadowRenderer&&(F.shadowRenderer.useNormalOffset=!1)}function To(F,t,l,B,G,Z,Y,re,oe,ce,he,pe,fe,be,ze,De,Oe,Fe,Ge){const Xe=F.context,Ze=Xe.gl,nt=F.transform,Qe=F.transform.zoom,it=[],Ke=Ta(F,l.paint.get("fill-extrusion-cutoff-fade-range"));ce==="clear"?(it.push("CLEAR_SUBPASS"),Ge&&(it.push("CLEAR_FROM_TEXTURE"),Xe.activeTexture.set(Ze.TEXTURE0),Ge.bind(Ze.LINEAR,Ze.CLAMP_TO_EDGE))):ce==="sdf"&&it.push("SDF_SUBPASS"),Oe&&it.push("HAS_CENTROID"),Ke.shouldRenderCutoff&&it.push("RENDER_CUTOFF");const ht=l.layout.get("fill-extrusion-edge-radius"),yt=(Nt,Dt,Wt,$t,At)=>{const Vt=Dt.programConfigurations.get(l.id),ii=F.isTileAffectedByFog(Nt),Et=F.getOrCreateProgram("fillExtrusionGroundEffect",{config:Vt,defines:it,overrideFog:ii}),Jt=((hi,Qt,Xt,ri,ci,xi,Si,Vi,Ci,Ri,Hi)=>({u_matrix:Qt,u_opacity:Xt,u_ao_pass:ri?1:0,u_meter_to_tile:ci,u_ao:xi,u_flood_light_intensity:Si,u_flood_light_color:Vi,u_attenuation:Ci,u_edge_radius:Ri,u_fb:0,u_fb_size:Hi,u_dynamic_offset:1}))(0,$t,he,oe,At,[pe,fe*At],be,ze,De,Qe>=17?0:ht*At,Ge?Ge.size[0]:0),Ut=[];Oe&&Ut.push(Dt.hiddenByLandmarkVertexBuffer),F.uploadCommonUniforms(Xe,Et,Nt.toUnwrapped(),null,Ke),Et.draw(F,Xe.gl.TRIANGLES,G,Z,Y,re,Jt,l.id,Dt.vertexBuffer,Dt.indexBuffer,Wt,l.paint,Qe,Vt,Ut)};for(const Nt of B){const Dt=t.getTile(Nt),Wt=Dt.getBucket(l);if(!Wt||Wt.projection.name!==nt.projection.name||!Wt.groundEffect||Wt.groundEffect&&!Wt.groundEffect.hasData())continue;const $t=Wt.groundEffect,At=1/Wt.tileToMeter;{const Vt=F.translatePosMatrix(Nt.projMatrix,Dt,l.paint.get("fill-extrusion-translate"),l.paint.get("fill-extrusion-translate-anchor")),ii=$t.getDefaultSegment();yt(Nt,$t,ii,Vt,At)}if(Fe)for(let Vt=0;Vt<4;Vt++){const ii=o.d4[Vt](Nt),Et=t.getTile(ii);if(!Et)continue;const Jt=Et.getBucket(l);if(!Jt||Jt.projection.name!==nt.projection.name||!Jt.groundEffect||Jt.groundEffect&&!Jt.groundEffect.hasData())continue;const Ut=Jt.groundEffect;let hi,Qt;Vt===0?(hi=[-o.ag,0,0],Qt=1):Vt===1?(hi=[o.ag,0,0],Qt=0):Vt===2?(hi=[0,-o.ag,0],Qt=3):(hi=[0,o.ag,0],Qt=2);const Xt=Ut.regionSegments[Qt];if(!Xt)continue;const ri=new Float32Array(16);o.ab.mat4.translate(ri,Nt.projMatrix,hi),yt(Nt,Ut,Xt,F.translatePosMatrix(ri,Dt,l.paint.get("fill-extrusion-translate"),l.paint.get("fill-extrusion-translate-anchor")),At)}}}function Eo(F,t,l,B,G,Z,Y){B.centroidVertexArray.length===0&&B.createCentroidsBuffer();const re=Z?Z.findDEMTileFor(l):null;if(!(re&&re.dem||Y))return;Z&&re&&re.dem&&B.selfDEMTileTimestamp!==re.dem._timestamp&&(B.borderDoneWithNeighborZ=[-1,-1,-1,-1],B.selfDEMTileTimestamp=re.dem._timestamp);const oe=Fe=>new o.P(Math.ceil((Fe+o.d7)*o.d8),0),ce=Fe=>{const Ge=t.getSource().minzoom,Xe=nt=>{const Qe=t.getTileByID(nt);if(Qe&&Qe.hasData())return Qe.getBucket(G)},Ze=[0,-1,1];for(const nt of Ze){if(Fe.overscaledZ+nt<Ge)continue;const Qe=Xe(Fe.calculateScaledKey(Fe.overscaledZ+nt));if(Qe)return Qe}}
2668,he=[0,0,0],pe=(Fe,Ge)=>(he[0]=Math.min(Fe.min.y,Ge.min.y),he[1]=Math.max(Fe.max.y,Ge.max.y),he[2]=o.ag-Ge.min.x>Fe.max.x?Ge.min.x-o.ag:Fe.max.x,he),fe=(Fe,Ge)=>(he[0]=Math.min(Fe.min.x,Ge.min.x),he[1]=Math.max(Fe.max.x,Ge.max.x),he[2]=o.ag-Ge.min.y>Fe.max.y?Ge.min.y-o.ag:Fe.max.y,he),be=[(Fe,Ge)=>pe(Fe,Ge),(Fe,Ge)=>pe(Ge,Fe),(Fe,Ge)=>fe(Fe,Ge),(Fe,Ge)=>fe(Ge,Fe)],ze=(Fe,Ge,Xe,Ze,nt,Qe,it)=>{if(!Z)return 0;const Ke=[[Qe?Xe:Fe,Qe?Fe:Xe,0],[Qe?Xe:Ge,Qe?Ge:Xe,0]],ht=it<0?o.ag+it:it,yt=[Qe?ht:(Fe+Ge)/2,Qe?(Fe+Ge)/2:ht,0];return Xe===0&&it<0||Xe!==0&&it>0?Z.getForTilePoints(nt,[yt],!0,Ze):Ke.push(yt),Z.getForTilePoints(l,Ke,!0,re),Math.max(Ke[0][2],Ke[1][2],yt[2])/Z.exaggeration()};for(let Fe=0;Fe<4;Fe++){const Ge=B.borderFeatureIndices[Fe];if(Ge.length===0)continue;const Xe=o.d4[Fe](l),Ze=ce(Xe);if(!(Ze&&Ze instanceof o.d5))continue;const nt=Z?Z.findDEMTileFor(Xe):null;if(!(nt&&nt.dem||Y)||(Z&&nt&&nt.dem&&B.borderDEMTileTimestamp[Fe]!==nt.dem._timestamp&&(B.borderDoneWithNeighborZ[Fe]=-1,B.borderDEMTileTimestamp[Fe]=nt.dem._timestamp),B.borderDoneWithNeighborZ[Fe]===Ze.canonical.z))continue;Ze.centroidVertexArray.length===0&&Ze.createCentroidsBuffer();const Qe=(Fe<2?1:5)-Fe,it=Ze.borderDoneWithNeighborZ[Qe]!==B.canonical.z,Ke=Ze.borderFeatureIndices[Qe];let ht=0;if(B.canonical.z!==Ze.canonical.z){for(const yt of Ge)B.showCentroid(B.featuresOnBorder[yt]);if(it)for(const yt of Ke)Ze.showCentroid(Ze.featuresOnBorder[yt]);B.borderDoneWithNeighborZ[Fe]=Ze.canonical.z,Ze.borderDoneWithNeighborZ[Qe]=B.canonical.z}for(const yt of Ge){const Nt=B.featuresOnBorder[yt],Dt=B.centroidData[Nt.centroidDataIndex],Wt=Nt.borders[Fe];let $t;for(;ht<Ke.length;){$t=Ze.featuresOnBorder[Ke[ht]];const At=$t.borders[Qe];if(At[1]>Wt[0]+3||At[0]>Wt[0]-3)break;Ze.showCentroid($t),ht++}if($t&&ht<Ke.length){const At=ht;let Vt=0;for(;!($t.borders[Qe][0]>Wt[1]-3)&&(Vt++,++ht!==Ke.length);)$t=Ze.featuresOnBorder[Ke[ht]];$t=Ze.featuresOnBorder[Ke[At]];let ii=!1;if(Vt>=1){const Ut=$t.borders[Qe];Math.abs(Wt[0]-Ut[0])<3&&Math.abs(Wt[1]-Ut[1])<3&&(Vt=1,ii=!0,ht=At+1)}else if(Vt===0){B.showCentroid(Nt);continue}const Et=Ze.centroidData[$t.centroidDataIndex];Y&&ii&&(((De=Dt).flags|(Oe=Et).flags)&o.d6?(De.flags|=o.d6,Oe.flags|=o.d6):(De.flags&=~o.d6,Oe.flags&=~o.d6));const Jt=Nt.intersectsCount()>1||$t.intersectsCount()>1;if(Vt>1)ht=At,Dt.centroidXY=Et.centroidXY=new o.P(0,0);else if(nt&&nt.dem&&!Jt){const Ut=be[Fe](Dt,Et),hi=Fe%2?o.ag-1:0,Qt=ze(Ut[0],Math.min(o.ag-1,Ut[1]),hi,nt,Xe,Fe<2,Ut[2]);Dt.centroidXY=Et.centroidXY=oe(Qt)}else Jt?Dt.centroidXY=Et.centroidXY=new o.P(0,0):(Dt.centroidXY=B.encodeBorderCentroid(Nt),Et.centroidXY=Ze.encodeBorderCentroid($t));B.writeCentroidToBuffer(Dt),Ze.writeCentroidToBuffer(Et)}else B.showCentroid(Nt)}B.borderDoneWithNeighborZ[Fe]=Ze.canonical.z,Ze.borderDoneWithNeighborZ[Qe]=B.canonical.z}var De,Oe;(B.needsCentroidUpdate||!B.centroidVertexBuffer&&B.centroidVertexArray.length!==0)&&B.uploadCentroid(F)}const Ao=[1,0,0],oi=[0,1,0],bi=[0,0,1];function Mo(F,t,l){const B=l.transform,G=l.shadowRenderer;if(!G)return!0;const Z=F.toUnwrapped(),Y=B.tileSize*G._cascades[l.currentShadowCascade].scale;let re=t.maxHeight;if(B.elevation){const De=B.elevation.getMinMaxForTile(F);De&&(re+=De.max)}const oe=[...G.shadowDirection];oe[2]=-oe[2];const ce=G.computeSimplifiedTileShadowVolume(Z,re,Y,oe);if(!ce)return!1;const he=[Ao,oi,bi,oe,[oe[0],0,oe[2]],[0,oe[1],oe[2]]],pe=B.projection.name==="globe",fe=B.scaleZoom(Y),be=o.bR.fromInvProjectionMatrix(B.invProjMatrix,B.worldSize,fe,!pe),ze=G.getCurrentCascadeFrustum();return be.intersectsPrecise(ce.vertices,ce.planes,he)===0||ze.intersectsPrecise(ce.vertices,ce.planes,he)===0}function Wr(F){return[F[0]*o.d9,F[1]*o.d9,F[2]*o.d9,0]}function Rt(F,t,l,B,G,Z,Y,re,oe){const ce=B.getSource(),he=l.globeSharedBuffers;if(!he)return;let pe,fe,be;if(t&&(pe=B.getTile(t)),ce instanceof o.aJ?(fe=ce.texture,be=o.cI(0,0,l.transform)):pe&&t&&(fe=pe.texture,be=o.cI(t.canonical.z,t.canonical.x,l.transform)),!fe||!be)return;F||(be=o.ab.mat4.scale(o.ab.mat4.create(),be,[1,-1,1]));const ze=l.context,De=ze.gl,Oe=G.paint.get("raster-resampling")==="nearest"?De.NEAREST:De.LINEAR,Fe=l.colorModeForDrapableLayerRenderPass(Z),Ge=Y.defines;Ge.push("GLOBE_POLES");
vendor: 11,286 bytes, line 2668
2668const Xe=new ki(De.LEQUAL,ki.ReadWrite,l.depthRangeFor3D),Ze=Float32Array.from(l.transform.expandedFarZProjMatrix),nt=Float32Array.from(o.bb(o.cH(new o.bT(0,0,0))));l.terrain&&l.terrain.prepareDrawTile(),ze.activeTexture.set(De.TEXTURE0),fe.bind(Oe,De.CLAMP_TO_EDGE),ze.activeTexture.set(De.TEXTURE1),fe.bind(Oe,De.CLAMP_TO_EDGE),fe.useMipmap&&ze.extTextureFilterAnisotropic&&l.transform.pitch>20&&De.texParameterf(De.TEXTURE_2D,ze.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ze.extTextureFilterAnisotropicMax);const[Qe,it,Ke,ht]=t?he.getPoleBuffers(t.canonical.z,!1):he.getPoleBuffers(0,!0),yt=G.paint.get("raster-elevation");let Nt;F?(Nt=Qe,l.renderDefaultNorthPole=yt!==0):(Nt=it,l.renderDefaultSouthPole=yt!==0);const Dt=Wr(Y.mix),Wt=((At,Vt,ii,Et,Jt,Ut,hi,Qt,Xt,ri,ci,xi,Si)=>Ma(At,Vt,ii,new Float32Array(16),new Float32Array(9),[0,0],Et,[0,0],[0,0,0,0],1,{opacity:1,mix:0},Ut,[0,0],Qt,2,ri,ci,xi,1,0,Si))(Ze,nt,be,o.ae(l.transform.zoom),0,G,0,yt,0,Dt,Y.offset,Y.range,Z),$t=l.getOrCreateProgram("raster",{defines:Ge});l.uploadCommonUniforms(ze,$t,null),$t.draw(l,De.TRIANGLES,Xe,oe,Fe,re,Wt,G.id,Nt,Ke,ht)}function wd(F){const t=F._nearZ,l=F.projection.farthestPixelDistance(F),B=l-t,G=.2*F.height,Z=t+G;return[t,l,(Z-G-t)/B,(Z-t)/B]}function Sc(F,t,l,B){if(F)return t instanceof Tn&&F instanceof wa?t.getTextureDescriptor(F,l,!0):{texture:F.texture,mix:Wr(B.mix),offset:B.offset,buffer:0,tileSize:1}}var Yh=o.da([{name:"a_index",type:"Int16",components:1}]);class Sd{constructor(t,l,B,G){const Z={width:B[0],height:B[1],data:null},Y=t.gl;this.targetColorTexture=new o.T(t,Z,Y.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new o.T(t,Z,Y.RGBA8,{useMipmap:!1}),this.context=t,this.updateParticleTexture(l,G),this.lastInvalidatedAt=0}updateParticleTexture(t,l){if(this.particleTextureDimension===l.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const B=this.context.gl,G=l.width*l.height;this.particleTexture0=new o.T(this.context,l,B.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new o.T(this.context,l,B.RGBA8,{premultiply:!1,useMipmap:!1});const Z=new o.db;Z.reserve(G);for(let Y=0;Y<G;Y++)Z.emplaceBack(Y);this.particleIndexBuffer=this.context.createVertexBuffer(Z,Yh.members,!0),this.particleSegment=o.b7.simpleSegment(0,0,this.particleIndexBuffer.length,0),this.particleTextureDimension=l.width}update(t){return!(this.lastInvalidatedAt<t&&(this.lastInvalidatedAt=o.q.now(),1))}destroy(){this.targetColorTexture.destroy(),this.backgroundColorTexture.destroy(),this.particleIndexBuffer.destroy(),this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleSegment.destroy()}}function Td(F,t,l){if(!F)return null;const B=t.getTextureDescriptor(F,l,!0);if(!B)return null;let{texture:G,mix:Z,offset:Y,tileSize:re,buffer:oe,format:ce}=B;if(!G||!ce)return null;let he=!1;return ce==="uint32"&&(he=!0,Z[3]=0,Z=Vh(o.dc,Z,[0,l.paint.get("raster-particle-max-speed")]),Y=Uh(o.dc,Y,[0,l.paint.get("raster-particle-max-speed")])),{texture:G,textureOffset:[oe/(re+2*oe),re/(re+2*oe)],tileSize:re,scalarData:he,scale:Z,offset:Y,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[ce]]}}function Ed(F){const t=F._nearZ,l=F.projection.farthestPixelDistance(F),B=l-t,G=.2*F.height,Z=t+G;return[t,l,(Z-G-t)/B,(Z-t)/B]}const Po=new o.aj(1,0,0,1),nf=new o.aj(0,1,0,1),sf=new o.aj(0,0,1,1),Ad=new o.aj(1,0,1,1),Tc=new o.aj(0,1,1,1);function Ca(F,t,l,B,G,Z,Y){const re=F.context,oe=F.transform,ce=re.gl,he=oe.projection.name==="globe",pe=he?["PROJECTION_GLOBE_VIEW"]:[];let fe=o.ab.mat4.clone(l.projMatrix);if(he&&o.ae(oe.zoom)>0){const Dt=o.ba(l.canonical,oe),Wt=o.dd(Dt);fe=o.ab.mat4.multiply(new Float32Array(16),oe.globeMatrix,Wt),o.ab.mat4.multiply(fe,oe.projMatrix,fe)}const be=o.ab.mat4.create();be[12]+=2*G/(o.q.devicePixelRatio*oe.width),be[13]+=2*Z/(o.q.devicePixelRatio*oe.height),o.ab.mat4.multiply(fe,be,fe);const ze=F.getOrCreateProgram("debug",{defines:pe}),De=t.getTileByID(l.key);F.terrain&&F.terrain.setupElevationDraw(De,ze);const Oe=ki.disabled,Fe=Ui.disabled,Ge=F.colorModeForRenderPass(),Xe="$debug";re.activeTexture.set(ce.TEXTURE0),F.emptyTexture.bind(ce.LINEAR,ce.CLAMP_TO_EDGE),he?De._makeGlobeTileDebugBuffers(F.context,oe):De._makeDebugTileBoundsBuffers(F.context,oe.projection);const Ze=De._tileDebugBuffer||F.debugBuffer,nt=De._tileDebugIndexBuffer||F.debugIndexBuffer,Qe=De._tileDebugSegments||F.debugSegments;if(ze.draw(F,ce.LINE_STRIP,Oe,Fe,Ge,qi.disabled,Ka(fe,B),Xe,Ze,nt,Qe,null,null,null,[De._globeTileDebugBorderBuffer]),Y){const Dt=De.latestRawTileData,Wt=Math.floor((Dt&&Dt.byteLength||0)/1024);let $t=l.canonical.toString();l.overscaledZ!==l.canonical.z&&($t+=` => ${l.overscaledZ}`),$t+=` ${De.state}`,$t+=` ${Wt}kb`,function(At,Vt){At.initDebugOverlayCanvas();const ii=At.debugOverlayCanvas,Et=At.context.gl,Jt=At.debugOverlayCanvas.getContext("2d");Jt.clearRect(0,0,ii.width,ii.height),Jt.shadowColor="white",Jt.shadowBlur=2,Jt.lineWidth=1.5,Jt.strokeStyle="white",Jt.textBaseline="top",Jt.font="bold 36px Open Sans, sans-serif",Jt.fillText(Vt,5,5),Jt.strokeText(Vt,5,5),At.debugOverlayTexture.update(ii),At.debugOverlayTexture.bind(Et.LINEAR,Et.CLAMP_TO_EDGE)}(F,$t)}const it=t.getTile(l).tileSize,Ke=512/Math.min(it,512)*(l.overscaledZ/oe.zoom)*.5,ht=De._tileDebugTextBuffer||F.debugBuffer,yt=De._tileDebugTextIndexBuffer||F.quadTriangleIndexBuffer,Nt=De._tileDebugTextSegments||F.debugSegments;ze.draw(F,ce.TRIANGLES,Oe,Fe,ir.alphaBlended,qi.disabled,Ka(fe,o.aj.transparent,Ke),Xe,ht,yt,Nt,null,null,null,[De._globeTileDebugTextBuffer])}function Jh(F,t,l,B){eo(F,0,t+l/2,F.transform.width,l,B)}function Kh(F,t,l,B){eo(F,t-l/2,0,l,F.transform.height,B)}function eo(F,t,l,B,G,Z){const Y=F.context,re=Y.gl;re.enable(re.SCISSOR_TEST),re.scissor(t*o.q.devicePixelRatio,l*o.q.devicePixelRatio,B*o.q.devicePixelRatio,G*o.q.devicePixelRatio),Y.clear({color:Z}),re.disable(re.SCISSOR_TEST)}const Ec=o.da([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Ws}=Ec;function ua(F,t,l,B){F.emplaceBack(t,l,B)}class Md{constructor(t){this.vertexArray=new o.de,this.indices=new o.aU,ua(this.vertexArray,-1,-1,1),ua(this.vertexArray,1,-1,1),ua(this.vertexArray,-1,1,1),ua(this.vertexArray,1,1,1),ua(this.vertexArray,-1,-1,-1),ua(this.vertexArray,1,-1,-1),ua(this.vertexArray,-1,1,-1),ua(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,Ws),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=o.b7.simpleSegment(0,0,36,12)}}function kn(F,t,l,B,G,Z){const Y=F.context.gl,re=t.paint.get("sky-atmosphere-color"),oe=t.paint.get("sky-atmosphere-halo-color"),ce=t.paint.get("sky-atmosphere-sun-intensity"),he=((pe,fe,be,ze,De)=>({u_matrix_3f:pe,u_sun_direction:fe,u_sun_intensity:be,u_color_tint_r:[ze.r,ze.g,ze.b,ze.a],u_color_tint_m:[De.r,De.g,De.b,De.a],u_luminance:5e-5}))(o.ab.mat3.fromMat4(o.ab.mat3.create(),B),G,ce,re,oe);Y.framebufferTexture2D(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,Y.TEXTURE_CUBE_MAP_POSITIVE_X+Z,t.skyboxTexture,0),l.draw(F,Y.TRIANGLES,ki.disabled,Ui.disabled,ir.unblended,qi.frontCW,he,"skyboxCapture",t.skyboxGeometry.vertexBuffer,t.skyboxGeometry.indexBuffer,t.skyboxGeometry.segment)}const af=o.da([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class bl{constructor(t){const l=new o.df;l.emplaceBack(-1,1,1,0,0),l.emplaceBack(1,1,1,1,0),l.emplaceBack(1,-1,1,1,1),l.emplaceBack(-1,-1,1,0,1);const B=new o.aU;B.emplaceBack(0,1,2),B.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(l,af.members),this.indexBuffer=t.createIndexBuffer(B),this.segments=o.b7.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Vr=o.da([{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_fade_opacity",components:1}]);class Tr{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200}}class Pd{constructor(t){this.colorModeAlphaBlendedWriteRGB=new ir([1,ja,1,ja],o.aj.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new ir([1,0,1,0],o.aj.transparent,[!1,!1,!1,!0]),this.params=new Tr,this.updateNeeded=!0,t.tp.registerParameter(this.params,["Stars"],"starsCount",{min:100,max:16e3,step:1},()=>{this.updateNeeded=!0}),t.tp.registerParameter(this.params,["Stars"],"sizeMultiplier",{min:.01,max:2,step:.01}),t.tp.registerParameter(this.params,["Stars"],"sizeRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0}),t.tp.registerParameter(this.params,["Stars"],"intensityRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0})}update(t){const l=t.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new bl(l);const B=this.params.sizeRange,G=this.params.intensityRange,Z=function(he){const pe=o.di(30),fe=[];for(let be=0;be<he;++be){const ze=2*Math.PI*pe(),De=Math.acos(1-2*pe())-.5*Math.PI;fe.push(o.ab.vec3.fromValues(Math.cos(De)*Math.cos(ze),Math.cos(De)*Math.sin(ze),Math.sin(De)))}return fe}(this.params.starsCount),Y=o.di(300),re=new o.dg,oe=new o.aU;let ce=0;for(let he=0;he<Z.length;++he){const pe=o.ab.vec3.scale([],Z[he],200),fe=Math.max(0,1+.01*B*(1*Y()-.5)),be=Math.max(0,1+.01*G*(1*Y()-.5));re.emplaceBack(pe[0],pe[1],pe[2],-1,-1,fe,be),re.emplaceBack(pe[0],pe[1],pe[2],1,-1,fe,be),re.emplaceBack(pe[0],pe[1],pe[2],1,1,fe,be),re.emplaceBack(pe[0],pe[1],pe[2],-1,1,fe,be),oe.emplaceBack(ce+0,ce+1,ce+2),oe.emplaceBack(ce+0,ce+2,ce+3),ce+=4}this.starsVx=l.createVertexBuffer(re,Vr.members),this.starsIdx=l.createIndexBuffer(oe),this.starsSegments=o.b7.simpleSegment(0,0,re.length,oe.length)}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy()}drawAtmosphereGlow(t,l){const B=t.context,G=B.gl,Z=t.transform,Y=new ki(G.LEQUAL,ki.ReadOnly,[0,1]),re=o.ae(Z.zoom),oe=t.style.getLut(l.scope),ce=l.properties.get("color-use-theme")==="none",he=l.properties.get("color").toRenderColor(ce?null:oe).toArray01(),pe=l.properties.get("high-color-use-theme")==="none",fe=l.properties.get("high-color").toRenderColor(pe?null:oe).toArray01(),be=l.properties.get("space-color-use-theme")==="none",ze=l.properties.get("space-color").toRenderColor(be?null:oe).toArray01PremultipliedAlpha(),De=5e-4,Oe=o.dh(l.properties.get("horizon-blend"),0,1,De,.25),Fe=o.cC(t,B,Z)&&Oe===De?Z.worldSize/(2*Math.PI*1.025)-1:Z.globeRadius,Ge=t.frameCounter/1e3%1,Xe=o.ab.vec3.length(Z.globeCenterInViewSpace),Ze=Math.sqrt(Math.pow(Xe,2)-Math.pow(Fe,2)),nt=Math.acos(Ze/Xe),Qe=it=>{const Ke=Z.projection.name==="globe"?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];
2668it&&Ke.push("ALPHA_PASS");const ht=t.getOrCreateProgram("globeAtmosphere",{defines:Ke}),yt=((Dt,Wt,$t,At,Vt,ii,Et,Jt,Ut,hi,Qt,Xt)=>({u_frustum_tl:Dt,u_frustum_tr:Wt,u_frustum_br:$t,u_frustum_bl:At,u_horizon:Vt,u_transition:ii,u_fadeout_range:Et,u_color:Jt,u_high_color:Ut,u_space_color:hi,u_temporal_offset:Qt,u_horizon_angle:Xt}))(Z.frustumCorners.TL,Z.frustumCorners.TR,Z.frustumCorners.BR,Z.frustumCorners.BL,Z.frustumCorners.horizon,re,Oe,he,fe,ze,Ge,nt);t.uploadCommonUniforms(B,ht);const Nt=this.atmosphereBuffer;Nt&&ht.draw(t,G.TRIANGLES,Y,Ui.disabled,it?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,qi.backCW,yt,it?"atmosphere_glow_alpha":"atmosphere_glow",Nt.vertexBuffer,Nt.indexBuffer,Nt.segments)};Qe(!1),Qe(!0)}drawStars(t,l){const B=o.aw(l.properties.get("star-intensity"),0,1);if(B===0)return;const G=t.context,Z=G.gl,Y=t.transform,re=t.getOrCreateProgram("stars"),oe=o.ab.quat.identity([]);o.ab.quat.rotateX(oe,oe,-Y._pitch),o.ab.quat.rotateZ(oe,oe,-Y.angle),o.ab.quat.rotateX(oe,oe,o.ai(Y._center.lat)),o.ab.quat.rotateY(oe,oe,-o.ai(Y._center.lng));const ce=o.ab.mat4.fromQuat(new Float32Array(16),oe),he=o.ab.mat4.multiply([],Y.starsProjMatrix,ce),pe=o.ab.mat3.fromMat4([],ce),fe=o.ab.mat3.invert([],pe),be=[0,1,0];o.ab.vec3.transformMat3(be,be,fe),o.ab.vec3.scale(be,be,this.params.sizeMultiplier);const ze=[1,0,0];o.ab.vec3.transformMat3(ze,ze,fe),o.ab.vec3.scale(ze,ze,this.params.sizeMultiplier);const De=(Oe=be,Fe=ze,Ge=B,{u_matrix:Float32Array.from(he),u_up:Oe,u_right:Fe,u_intensity_multiplier:Ge});var Oe,Fe,Ge;t.uploadCommonUniforms(G,re),this.starsVx&&this.starsIdx&&re.draw(t,Z.TRIANGLES,ki.disabled,Ui.disabled,this.colorModeAlphaBlendedWriteRGB,qi.disabled,De,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}function da(F,t){const l=[...F],B=t.cameraWorldSizeForFog/t.worldSize,G=o.ab.mat4.identity([]);return o.ab.mat4.scale(G,G,[B,B,1]),o.ab.mat4.multiply(l,G,l),o.ab.mat4.multiply(l,t.worldToFogMatrix,l),l}function Co(F,t,l,B,G){const Z=l.material,Y=B.context,{baseColorTexture:re,metallicRoughnessTexture:oe}=Z.pbrMetallicRoughness,{normalTexture:ce,occlusionTexture:he,emissionTexture:pe}=Z;function fe(ze,De,Oe){if(ze&&(F.push(De),Y.activeTexture.set(Y.gl.TEXTURE0+Oe),ze.gfxTexture)){const{minFilter:Fe,magFilter:Ge,wrapS:Xe,wrapT:Ze}=ze.sampler;ze.gfxTexture.bindExtraParam(Fe,Ge,Xe,Ze)}}fe(re,"HAS_TEXTURE_u_baseColorTexture",jn.BaseColor),fe(oe,"HAS_TEXTURE_u_metallicRoughnessTexture",jn.MetallicRoughness),fe(ce,"HAS_TEXTURE_u_normalTexture",jn.Normal),fe(he,"HAS_TEXTURE_u_occlusionTexture",jn.Occlusion),fe(pe,"HAS_TEXTURE_u_emissionTexture",jn.Emission),G&&(G.texture||(G.texture=new o.dk(B.context,G.image,[G.image.height,G.image.height,G.image.height],Y.gl.RGBA8)),Y.activeTexture.set(Y.gl.TEXTURE0+jn.LUT),G.texture&&G.texture.bind(Y.gl.LINEAR,Y.gl.CLAMP_TO_EDGE),F.push("APPLY_LUT_ON_GPU")),l.texcoordBuffer&&(F.push("HAS_ATTRIBUTE_a_uv_2f"),t.push(l.texcoordBuffer)),l.colorBuffer&&(F.push(l.colorBuffer.itemSize===12?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),t.push(l.colorBuffer)),l.normalBuffer&&(F.push("HAS_ATTRIBUTE_a_normal_3f"),t.push(l.normalBuffer)),l.pbrBuffer&&(F.push("HAS_ATTRIBUTE_a_pbr"),F.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),t.push(l.pbrBuffer)),Z.alphaMode!=="OPAQUE"&&Z.alphaMode!=="MASK"||F.push("UNPREMULT_TEXTURE_IN_SHADER"),Z.defined||F.push("DIFFUSE_SHADED");const be=B.shadowRenderer;be&&(F.push("RENDER_SHADOWS","DEPTH_TEXTURE"),be.useNormalOffset&&F.push("NORMAL_OFFSET"))}function pa(F,t,l,B,G,Z){const Y=l.paint.get("model-opacity").constantOr(1),re=t.context,oe=new ki(t.context.gl.LEQUAL,ki.ReadWrite,t.depthRangeFor3D),ce=t.transform,he=F.mesh,pe=he.material,fe=pe.pbrMetallicRoughness,be=t.style.fog;let ze;ze=t.transform.projection.zAxisUnit==="pixels"?[...F.nodeModelMatrix]:o.ab.mat4.multiply([],B.zScaleMatrix,F.nodeModelMatrix),o.ab.mat4.multiply(ze,B.negCameraPosMatrix,ze);const De=o.ab.mat4.invert([],ze);o.ab.mat4.transpose(De,De);const Oe=l.paint.get("model-color-use-theme").constantOr("default")==="none",Fe=l.paint.get("model-emissive-strength").constantOr(0),Ge=_l(new Float32Array(F.worldViewProjection),new Float32Array(ze),new Float32Array(De),null,t,Y,fe.baseColorFactor.toRenderColor(null),pe.emissiveFactor,fe.metallicFactor,fe.roughnessFactor,pe,Fe,l),Xe={defines:[]},Ze=[],nt=t.shadowRenderer;nt&&(nt.useNormalOffset=!1),Co(Xe.defines,Ze,he,t,Oe?null:l.lut);let Qe=null;if(be){const ht=da(F.nodeModelMatrix,t.transform);if(Qe=new Float32Array(ht),ce.projection.name!=="globe"){const yt=he.aabb.min,Nt=he.aabb.max,[Dt,Wt]=be.getOpacityForBounds(ht,yt[0],yt[1],Nt[0],Nt[1]);
2668Xe.overrideFog=Dt>=ot||Wt>=ot}}const it=Ta(t,l.paint.get("model-cutoff-fade-range"));it.shouldRenderCutoff&&Xe.defines.push("RENDER_CUTOFF");const Ke=t.getOrCreateProgram("model",Xe);t.uploadCommonUniforms(re,Ke,null,Qe,it),t.renderPass!=="shadow"&&nt&&nt.setupShadowsFromMatrix(F.nodeModelMatrix,Ke),Ke.draw(t,re.gl.TRIANGLES,oe,G,Z,he.material.doubleSided?qi.disabled:qi.backCCW,Ge,l.id,he.vertexBuffer,he.indexBuffer,he.segments,l.paint,t.transform.zoom,void 0,Ze)}function Ac(F,t,l,B,G,Z,Y){let re;re=F.projection.name==="globe"?o.dl(l,F):[...l],o.ab.mat4.multiply(re,re,t.matrix);const oe=o.ab.mat4.multiply([],B,re);if(t.meshes)for(const ce of t.meshes){if(ce.material.alphaMode!=="BLEND"){Y.push({mesh:ce,depth:0,modelIndex:G,worldViewProjection:oe,nodeModelMatrix:re});continue}const he=o.ab.vec3.transformMat4([],ce.centroid,oe);!F.isOrthographic&&he[2]<=0||Z.push({mesh:ce,depth:he[2],modelIndex:G,worldViewProjection:oe,nodeModelMatrix:re})}if(t.children)for(const ce of t.children)Ac(F,ce,l,B,G,Z,Y)}function wl(F,t,l,B){const G=l.shadowRenderer;if(!G)return;const Z=G.getShadowPassDepthMode(),Y=G.getShadowPassColorMode(),re=G.calculateShadowPassMatrixFromMatrix(t),oe=vc(re);l.getOrCreateProgram("modelDepth",{defines:l._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(l,l.context.gl.TRIANGLES,Z,Ui.disabled,Y,qi.backCCW,oe,B.id,F.vertexBuffer,F.indexBuffer,F.segments,B.paint,l.transform.zoom,void 0,void 0)}function Zs(F,t,l){const B=t.updateZoomBasedPaintProperties(),G=function(Z,Y,re){let oe,ce,he,pe=Z.terrain?Z.terrain.exaggeration():0;if(Z.terrain&&pe>0){const fe=Z.terrain,be=fe.findDEMTileFor(re);be&&be.dem?oe=o.dn.create(fe,re,be):pe=0}if(pe===0&&(Y.terrainElevationMin=0,Y.terrainElevationMax=0),pe===Y.validForExaggeration&&(pe===0||oe&&oe._demTile&&oe._demTile.tileID===Y.validForDEMTile.id&&oe._dem._timestamp===Y.validForDEMTile.timestamp))return!1;for(const fe in Y.instancesPerModel){const be=Y.instancesPerModel[fe];for(let ze=0;ze<be.instancedDataArray.length;++ze){const De=(oe?pe*oe.getElevationAt(0|be.instancedDataArray.float32[16*ze],0|be.instancedDataArray.float32[16*ze+1],!0,!0):0)+be.instancesEvaluatedElevation[ze];be.instancedDataArray.float32[16*ze+6]=De,ce=ce?Math.min(Y.terrainElevationMin,De):De,he=he?Math.max(Y.terrainElevationMax,De):De}}return Y.terrainElevationMin=ce||0,Y.terrainElevationMax=he||0,Y.validForExaggeration=pe,Y.validForDEMTile=oe&&oe._demTile?{id:oe._demTile.tileID,timestamp:oe._dem._timestamp}:{id:void 0,timestamp:0},!0}(F,t,l);(B||G)&&(t.uploaded=!1,t.upload(F.context))}const Wn={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new o.cd([0,0,0],[o.ag,o.ag,0])};function Mc(F,t){const l=1<<F.canonical.z,B=t.getFreeCameraOptions().position,G=t.elevation,Z=F.canonical.x/l,Y=(F.canonical.x+1)/l,re=F.canonical.y/l,oe=(F.canonical.y+1)/l;let ce=t._centerAltitude;if(G){const be=G.getMinMaxForTile(F);be&&be.max>ce&&(ce=be.max)}const he=o.aw(B.x,Z,Y)-B.x,pe=o.aw(B.y,re,oe)-B.y,fe=o.bH(ce,t.center.lat)-B.z;return t._zoomFromMercatorZ(Math.sqrt(he*he+pe*pe+fe*fe))}function Sl(F,t,l,B,G,Z,Y){const re=F.context,oe=F.renderPass==="shadow",ce=F.shadowRenderer,he=oe&&ce?ce.getShadowPassDepthMode():new ki(re.gl.LEQUAL,ki.ReadWrite,F.depthRangeFor3D),pe=F.isTileAffectedByFog(Z);if(l.meshes)for(const fe of l.meshes){const be=["MODEL_POSITION_ON_GPU"],ze=[];let De,Oe,Fe;B.instancedDataArray.length>20&&be.push("INSTANCED_ARRAYS");const Ge=Ta(F,t.paint.get("model-cutoff-fade-range"));if(Ge.shouldRenderCutoff&&be.push("RENDER_CUTOFF"),oe&&ce)De=F.getOrCreateProgram("modelDepth",{defines:be}),Oe=vc(Y.shadowTileMatrix,Y.shadowTileMatrix,Float32Array.from(l.matrix)),Fe=ce.getShadowPassColorMode();else{Co(be,ze,fe,F,t.paint.get("model-color-use-theme").constantOr("default")==="none"?null:t.lut),De=F.getOrCreateProgram("model",{defines:be,overrideFog:pe});const Ze=fe.material,nt=Ze.pbrMetallicRoughness,Qe=t.paint.get("model-opacity").constantOr(1),it=t.paint.get("model-emissive-strength").constantOr(0);Oe=_l(Z.expandedProjMatrix,Float32Array.from(l.matrix),new Float32Array(16),null,F,Qe,nt.baseColorFactor.toRenderColor(null),Ze.emissiveFactor,nt.metallicFactor,nt.roughnessFactor,Ze,it,t,G),ce&&(Y.shadowUniformsInitialized?De.setShadowUniformValues(re,ce.getShadowUniformValues()):(ce.setupShadows(Z.toUnwrapped(),De,"model-tile",Z.overscaledZ
2668),Y.shadowUniformsInitialized=!0)),Fe=Ge.shouldRenderCutoff||Qe<1||Ze.alphaMode!=="OPAQUE"?ir.alphaBlended:ir.unblended}F.uploadCommonUniforms(re,De,Z.toUnwrapped(),null,Ge);const Xe=fe.material.doubleSided?qi.disabled:qi.backCCW;if(B.instancedDataArray.length>20)ze.push(B.instancedDataBuffer),De.draw(F,re.gl.TRIANGLES,he,Ui.disabled,Fe,Xe,Oe,t.id,fe.vertexBuffer,fe.indexBuffer,fe.segments,t.paint,F.transform.zoom,void 0,ze,B.instancedDataArray.length);else{const Ze=oe?"u_instance":"u_normal_matrix";for(let nt=0;nt<B.instancedDataArray.length;++nt)Oe[Ze]=new Float32Array(B.instancedDataArray.arrayBuffer,64*nt,16),De.draw(F,re.gl.TRIANGLES,he,Ui.disabled,Fe,Xe,Oe,t.id,fe.vertexBuffer,fe.indexBuffer,fe.segments,t.paint,F.transform.zoom,void 0,ze)}}if(l.children)for(const fe of l.children)Sl(F,t,fe,B,G,Z,Y)}const Qh=[1,-1,1];function eu(F,t,l,B){if(!l.modelManager)return!0;const G=l.modelManager;if(!l.shadowRenderer)return!0;const Z=l.shadowRenderer,Y=t.aabb;let re=!0,oe=F.maxHeight;if(oe===0){let he=0;for(const pe in F.instancesPerModel){const fe=G.getModel(pe,B);fe?he=Math.max(he,Math.max(Math.max(fe.aabb.max[0],fe.aabb.max[1]),fe.aabb.max[2])):re=!1}oe=F.maxScale*he*1.41+F.maxVerticalOffset,re&&(F.maxHeight=oe)}Y.max[2]=oe,Y.min[2]+=F.terrainElevationMin,Y.max[2]+=F.terrainElevationMax,o.ab.vec3.transformMat4(Y.min,Y.min,t.tileMatrix),o.ab.vec3.transformMat4(Y.max,Y.max,t.tileMatrix);const ce=Y.intersects(Z.getCurrentCascadeFrustum());return l.currentShadowCascade===0&&(F.isInsideFirstShadowMapFrustum=ce===2),ce===0}function to(F,t){const l=F.uniformValues.u_cutoff_params[0],B=F.uniformValues.u_cutoff_params[1],G=F.uniformValues.u_cutoff_params[2],Z=F.uniformValues.u_cutoff_params[3];return B===l||Z===G?1:o.aw(((t-l)/(B-l)-G)/(Z-G),0,1)}function tu(F,t,l,B){if(t.pitch<20)return 1;const G=t.getWorldToCameraMatrix();o.ab.mat4.multiply(G,G,F);const Z=o.ab.vec4.fromValues(l.min[0],l.min[1],l.min[2],1);let Y=o.ab.vec4.transformMat4(o.ab.vec4.create(),Z,G),re=Y,oe=Y;Z[1]=l.max[1],Y=o.ab.vec4.transformMat4(o.ab.vec4.create(),Z,G),re=Y[1]<re[1]?Y:re,oe=Y[1]>oe[1]?Y:oe,Z[0]=l.max[0],Y=o.ab.vec4.transformMat4(o.ab.vec4.create(),Z,G),re=Y[1]<re[1]?Y:re,oe=Y[1]>oe[1]?Y:oe,Z[1]=l.min[1],Y=o.ab.vec4.transformMat4(o.ab.vec4.create(),Z,G),re=Y[1]<re[1]?Y:re,oe=Y[1]>oe[1]?Y:oe;const ce=o.aw(B[0],0,1),he=100*t.pixelsPerMeter*o.aw(B[1],0,1),pe=o.aw(B[2],0,1),fe=o.ab.vec4.lerp(o.ab.vec4.create(),re,oe,ce),be=Math.tan(.5*t.fovX),ze=-fe[2]*be;if(he===0)return fe[1]<-Math.abs(ze)?pe:1;const De=(-Math.abs(ze)-fe[1])/he,Oe=(Ge,Xe,Ze)=>(1-Ze)*Ge+Ze*Xe,Fe=o.aw(Oe(1,pe,De),pe,1);return Oe(1,Fe,o.aw((t.pitch-20)/20,0,1))}class Ia{}class iu{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(t,l,B){{const pe=this._storage.get(l.id);if(pe)return pe.lastUsedFrameIdx=t,pe.buf}const G=B.gl,Z=G.getBufferParameter(G.ELEMENT_ARRAY_BUFFER,G.BUFFER_SIZE),Y=new ArrayBuffer(Z),re=new Int16Array(Y);G.getBufferSubData(G.ELEMENT_ARRAY_BUFFER,0,new Int16Array(Y));const oe=new o.dq;for(let pe=0;pe<Z/2;pe+=3){const fe=re[pe],be=re[pe+1],ze=re[pe+2];oe.emplaceBack(fe,be),oe.emplaceBack(be,ze),oe.emplaceBack(ze,fe)}const ce=B.bindVertexArrayOES.current,he=new Ia;return he.buf=new Hs(B,oe),he.lastUsedFrameIdx=t,this._storage.set(l.id,he),B.bindVertexArrayOES.set(ce),he.buf}update(t){for(const[l,B]of this._storage)t-B.lastUsedFrameIdx>30&&(B.buf.destroy(),this._storage.delete(l))}destroy(){for(const[t,l]of this._storage)l.buf.destroy(),this._storage.delete(t)}}class Pc{constructor(t){this.occluderSize=30,this.depthOffset=-1e-4,t.registerParameter(this,["Occlusion"],"occluderSize",{min:1,max:100,step:1}),t.registerParameter(this,["Occlusion"],"depthOffset",{min:-.05,max:0,step:1e-5})}}const ru=o.da([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]);class nu{registerParameter(){}registerButton(){}registerBinding(){}refreshUI(){}}class On{constructor(t,l){this.revealStart=11,this.revealRange=2,t.registerParameter(this,[...l,"Reveal"],"revealStart",{min:0,max:17,step:.05}
2668),t.registerParameter(this,[...l,"Reveal"],"revealRange",{min:.1,max:5.1,step:.05})}}const su=o.da([{type:"Float32",name:"a_pos_2f",components:2}]);class au{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(t,l){const B=t.getOrCreateProgram("vignette");if(!this.vignetteVx||!this.vignetteIdx){const Y=new o.dr,re=new o.aU;Y.emplaceBack(-1,-1),Y.emplaceBack(1,-1),Y.emplaceBack(1,1),Y.emplaceBack(-1,1),re.emplaceBack(0,1,2),re.emplaceBack(0,2,3),this.vignetteVx=t.context.createVertexBuffer(Y,su.members),this.vignetteIdx=t.context.createIndexBuffer(re)}const G=o.b7.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){t.uploadCommonUniforms(t.context,B);const Y={u_vignetteShape:(Z={vignetteShape:[l.start,l.range,Math.pow(10,l.fadePower)],vignetteColor:[l.color.r,l.color.g,l.color.b,l.color.a*l.strength]}).vignetteShape,u_vignetteColor:Z.vignetteColor};B.draw(t,t.context.gl.TRIANGLES,ki.disabled,Ui.disabled,ir.alphaBlended,qi.disabled,Y,"vignette",this.vignetteVx,this.vignetteIdx,G,{})}var Z}}class Tl{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(t,l){const B=t.getFreeCameraOptions().position,G=B.toAltitude(),Z=B.toLngLat(),Y=o.ai(Z.lng),re=o.ai(Z.lat),oe=t.pixelsPerMeter/l,ce=Y*o.ds,he=o.ds*Math.log(Math.tan(Math.PI/4+re/2));if(this._offsetXPrev===void 0)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{const pe=-this._offsetYPrev+he,fe=-this._elevationPrev+G;this._accumulatedOffsetX+=(-this._offsetXPrev+ce)*oe,this._accumulatedOffsetY+=pe*oe,this._accumulatedElevation+=fe*oe,this._offsetXPrev=ce,this._offsetYPrev=he,this._elevationPrev=G}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function Da(F,t){return[-(F[0]-Math.floor(F[0]/t)*t),-(F[1]-Math.floor(F[1]/t)*t),-(F[2]-Math.floor(F[2]/t)*t)]}function Cc(F){const t=o.di(1323123451230),l=[];for(let B=0;B<F;++B){const G=2*t()-1,Z=2*t()-1,Y=2*t()-1;l.push(o.ab.vec3.fromValues(G,Z,Y))}return l}function Xs(F,t,l,B,G){const Z=o.aw((G-l)/(B-l),0,1);return(1-Z)*F+Z*t}class Ic{constructor(t){this._movement=new Tl,this._accumulatedTimeFromStart=0,this._prevTime=Date.now()/1e3,this._vignette=new au,this._ppmScaleFactor=t}destroy(){this.particlesVx&&this.particlesVx.destroy(),this.particlesIdx&&this.particlesIdx.destroy(),this._vignette&&this._vignette.destroy()}updateOnRender(t,l){const B=t.transform;this._movement.update(B,this._ppmScaleFactor);const G=B.starsProjMatrix,Z=o.ab.quat.identity([]);o.ab.quat.rotateX(Z,Z,o.ai(90)-B._pitch),o.ab.quat.rotateZ(Z,Z,-B.angle);const Y=o.ab.mat4.fromQuat(new Float32Array(16),Z),re=o.ab.mat4.fromValues(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),oe=o.ab.mat4.transpose([],re),ce=o.ab.mat4.multiply([],oe,Y),he=Date.now()/1e3;return this._accumulatedTimeFromStart+=(he-this._prevTime)*l,this._prevTime=he,{projectionMatrix:G,modelviewMatrix:ce}}}class Io extends Ic{constructor(t){super(4.25),this._params={overrideStyleParameters:!1,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._revealParams=new On(t.tp,["Precipitation","Rain"]),this._vignetteParams={strength:1,start:.7,range:1,fadePower:.4,color:{r:.27,g:.27,b:.27,a:1}},this.particlesCount=16e3}update(t){const l=t.context;if(!this.particlesVx){const B=Cc(this.particlesCount),G=new o.dt,Z=new o.aU;let Y=0;const re=o.di(1323123451230);for(let oe=0;oe<B.length;++oe){const ce=B[oe],he=[2*re()-1,re(),re(),re()];G.emplaceBack(ce[0],ce[1],ce[2],-1,-1,...he),G.emplaceBack(ce[0],ce[1],ce[2],1,-1,...he),G.emplaceBack(ce[0],ce[1],ce[2],1,1,...he),G.emplaceBack(ce[0],ce[1],ce[2],-1,1,...he),Z.emplaceBack(Y+0,Y+1,Y+2),Z.emplaceBack(Y+0,Y+2,Y+3),Y+=4}this.particlesVx=l.createVertexBuffer(G,ru.members),this.particlesIdx=l.createIndexBuffer(Z)}}draw(t){if(!this._params.overrideStyleParameters&&!t.style.rain)return;const l=this._params.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},B=t.transform.zoom;if(l.revealStart>B)return;const G=Xs(0,1,l.revealStart,l.revealStart+l.revealRange,B);if(!this.particlesVx||!this.particlesIdx)return;const Z=structuredClone(this._params);let Y=[-Z.direction.x,Z.direction.y,-100];o.ab.vec3.normalize(Y,Y);
2668const re=structuredClone(this._vignetteParams);re.strength*=G,Z.overrideStyleParameters||(Z.intensity=t.style.rain.state.density,Z.timeFactor=t.style.rain.state.intensity,Z.color=structuredClone(t.style.rain.state.color),Y=structuredClone(t.style.rain.state.direction),Z.screenThinning.intensity=t.style.rain.state.centerThinning,Z.dropletSizeX=t.style.rain.state.dropletSize[0],Z.dropletSizeYScale=t.style.rain.state.dropletSize[1]/t.style.rain.state.dropletSize[0],Z.distortionStrength=100*t.style.rain.state.distortionStrength,re.strength=1,re.color=structuredClone(t.style.rain.state.vignetteColor));const oe=this.updateOnRender(t,Z.timeFactor),ce=t.context,he=ce.gl,pe=t.transform;this.screenTexture&&this.screenTexture.size[0]===t.width&&this.screenTexture.size[1]===t.height||(this.screenTexture=new o.T(ce,{width:t.width,height:t.height,data:null},he.RGBA8)),Z.distortionStrength>0&&(ce.activeTexture.set(he.TEXTURE0),this.screenTexture.bind(he.LINEAR,he.CLAMP_TO_EDGE),he.copyTexSubImage2D(he.TEXTURE_2D,0,0,0,0,0,t.width,t.height));const fe=t.getOrCreateProgram("rainParticle");t.uploadCommonUniforms(ce,fe),ce.activeTexture.set(he.TEXTURE0),this.screenTexture.bind(he.LINEAR,he.CLAMP_TO_EDGE);const be=[Z.color.r,Z.color.g,Z.color.b,Z.color.a],ze=(De,Oe)=>{const Fe=Da(this._movement.getPosition(),De),Ge=Z.dropletSizeX,Xe=Z.dropletSizeX*Z.dropletSizeYScale,Ze=t.width/2,nt=t.height/2,Qe=Xs(0,Z.screenThinning.start,0,1,Z.screenThinning.intensity),it=Xs(.001,Z.screenThinning.range,0,1,Z.screenThinning.intensity),Ke=Xs(0,Z.screenThinning.particleOffset,0,1,Z.screenThinning.intensity),ht=(yt={modelview:oe.modelviewMatrix,projection:oe.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:Fe,velocityConeAperture:Z.velocityConeAperture,velocity:Z.velocity,boxSize:De,rainDropletSize:[Ge,Xe],distortionStrength:Z.distortionStrength,rainDirection:Y,color:be,screenSize:[pe.width,pe.height],thinningCenterPos:[Ze,nt],thinningShape:[Qe,it,Math.pow(10,Z.screenThinning.fadePower)],thinningAffectedRatio:Z.screenThinning.affectedRatio,thinningParticleOffset:Ke,shapeDirectionalPower:Z.shapeDirPower,shapeNormalPower:Z.shapeNormalPower,mode:Oe?0:1},{u_modelview:Float32Array.from(yt.modelview),u_projection:Float32Array.from(yt.projection),u_time:yt.time,u_cam_pos:yt.camPos,u_texScreen:0,u_velocityConeAperture:yt.velocityConeAperture,u_velocity:yt.velocity,u_boxSize:yt.boxSize,u_rainDropletSize:yt.rainDropletSize,u_distortionStrength:yt.distortionStrength,u_rainDirection:yt.rainDirection,u_color:yt.color,u_screenSize:yt.screenSize,u_thinningCenterPos:yt.thinningCenterPos,u_thinningShape:yt.thinningShape,u_thinningAffectedRatio:yt.thinningAffectedRatio,u_thinningParticleOffset:yt.thinningParticleOffset,u_shapeDirectionalPower:yt.shapeDirectionalPower,u_shapeNormalPower:yt.shapeNormalPower,u_mode:yt.mode});var yt;const Nt=Math.round(Z.intensity*this.particlesCount),Dt=o.b7.simpleSegment(0,0,4*Nt,2*Nt);fe.draw(t,he.TRIANGLES,ki.disabled,Ui.disabled,ir.alphaBlended,qi.disabled,ht,"rain_particles",this.particlesVx,this.particlesIdx,Dt,{})};Z.distortionStrength>0&&ze(Z.boxSize,!0),ze(Z.boxSize,!1),this._vignette.draw(t,re)}}const ou=o.da([{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}]);class lu extends Ic{constructor(t){super(2.25),this._params={overrideStyleParameters:!1,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._revealParams=new On(t.tp,["Precipitation","Snow"]),this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3}update(t){const l=t.context;if(!this.particlesVx){const B=Cc(this.particlesCount),G=new o.du,Z=new o.aU;let Y=0;const re=o.di(1323123451230);for(let oe=0;oe<B.length;++oe){const ce=B[oe],he=re(),pe=re(),fe=re(),be=[oe/B.length,he,pe,fe],ze=[re(),re()];G.emplaceBack(ce[0],ce[1],ce[2],-1,-1,...be,...ze),G.emplaceBack(ce[0],ce[1],ce[2],1,-1,...be,...ze),G.emplaceBack(ce[0],ce[1],ce[2],1,1,...be,...ze),G.emplaceBack(ce[0],ce[1],ce[2],-1,1,...be,...ze),Z.emplaceBack(Y+0,Y+1,Y+2),Z.emplaceBack(Y+0,Y+2,Y+3),Y+=4}this.particlesVx=l.createVertexBuffer(G,ou.members),this.particlesIdx=l.createIndexBuffer(Z)}}draw(t){if(!this._params.overrideStyleParameters&&!t.style.snow)return;const l=structuredClone(this._params);let B=[-l.direction.x,l.direction.y,-100];o.ab.vec3.normalize(B,B);
2668const G=structuredClone(this._vignetteParams),Z=l.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},Y=t.transform.zoom;if(Z.revealStart>Y)return;const re=Xs(0,1,Z.revealStart,Z.revealStart+Z.revealRange,Y);G.strength*=re,l.overrideStyleParameters||(l.intensity=t.style.snow.state.density,l.timeFactor=t.style.snow.state.intensity,l.color=structuredClone(t.style.snow.state.color),B=structuredClone(t.style.snow.state.direction),l.screenThinning.intensity=t.style.snow.state.centerThinning,l.billboardSize=2.79*t.style.snow.state.flakeSize,G.strength=1,G.color=structuredClone(t.style.snow.state.vignetteColor));const oe=this.updateOnRender(t,l.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const ce=t.context,he=ce.gl,pe=t.transform,fe=t.getOrCreateProgram("snowParticle");t.uploadCommonUniforms(ce,fe),((be,ze,De)=>{const Oe=Da(this._movement.getPosition(),be),Fe=pe.width/2,Ge=pe.height/2,Xe=Xs(0,De.screenThinning.start,0,1,De.screenThinning.intensity),Ze=Xs(.001,De.screenThinning.range,0,1,De.screenThinning.intensity),nt=Xs(0,De.screenThinning.particleOffset,0,1,De.screenThinning.intensity),Qe=(it={modelview:oe.modelviewMatrix,projection:oe.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:Oe,velocityConeAperture:De.velocityConeAperture,velocity:De.velocity,horizontalOscillationRadius:De.horizontalOscillationRadius,horizontalOscillationRate:De.horizontalOscillationRate,boxSize:be,billboardSize:1*De.billboardSize,simpleShapeParameters:[De.shapeFadeStart,De.shapeFadePower],screenSize:[pe.width,pe.height],thinningCenterPos:[Fe,Ge],thinningShape:[Xe,Ze,Math.pow(10,De.screenThinning.fadePower)],thinningAffectedRatio:De.screenThinning.affectedRatio,thinningParticleOffset:nt,color:[De.color.r,De.color.g,De.color.b,De.color.a],direction:B},{u_modelview:Float32Array.from(it.modelview),u_projection:Float32Array.from(it.projection),u_time:it.time,u_cam_pos:it.camPos,u_velocityConeAperture:it.velocityConeAperture,u_velocity:it.velocity,u_horizontalOscillationRadius:it.horizontalOscillationRadius,u_horizontalOscillationRate:it.horizontalOscillationRate,u_boxSize:it.boxSize,u_billboardSize:it.billboardSize,u_simpleShapeParameters:it.simpleShapeParameters,u_screenSize:it.screenSize,u_thinningCenterPos:it.thinningCenterPos,u_thinningShape:it.thinningShape,u_thinningAffectedRatio:it.thinningAffectedRatio,u_thinningParticleOffset:it.thinningParticleOffset,u_particleColor:it.color,u_direction:it.direction});var it;const Ke=Math.round(De.intensity*this.particlesCount),ht=o.b7.simpleSegment(0,0,4*Ke,2*Ke);this.particlesVx&&this.particlesIdx&&fe.draw(t,he.TRIANGLES,ki.disabled,Ui.disabled,ir.alphaBlended,qi.disabled,Qe,"snow_particles",this.particlesVx,this.particlesIdx,ht,{})})(l.boxSize,0,l),this._vignette.draw(t,G)}}const El={symbol:function(F,t,l,B,G){if(F.renderPass!=="translucent")return;const Z=Ui.disabled,Y=F.colorModeForRenderPass(),re=l.layout.get("text-variable-anchor"),oe=l.layout.get("text-size-scale-range"),ce=o.aw(F.scaleFactor,oe[0],oe[1]);re&&function(fe,be,ze,De,Oe,Fe,Ge,Xe){const Ze=be.transform,nt=Oe==="map",Qe=Fe==="map";for(const it of fe){const Ke=De.getTile(it),ht=Ke.getBucket(ze);if(!ht||!ht.text||!ht.text.segments.get().length)continue;const yt=o.bp(ht.textSizeData,Ze.zoom,Xe),Nt=Ua(it,ht.getProjection(),Ze),Dt=Ze.calculatePixelsToTileUnitsMatrix(Ke),Wt=zn(Nt,Ke.tileID.canonical,Qe,nt,Ze,ht.getProjection(),Dt),$t=ht.hasIconTextFit()&&ht.hasIconData();if(yt){const At=Math.pow(2,Ze.zoom-Ke.tileID.overscaledZ);bc(ht,nt,Qe,Ge,o.cX,Ze,Wt,it,At,yt,$t)}}}(B,F,l,t,l.layout.get("text-rotation-alignment"),l.layout.get("text-pitch-alignment"),G,ce);const he=l.paint.get("icon-opacity").constantOr(1)!==0,pe=l.paint.get("text-opacity").constantOr(1)!==0;l.layout.get("symbol-sort-key").constantOr(1)!==void 0&&(he||pe)?vl(F,t,l,B,Z,Y):(he&&vl(F,t,l,B,Z,Y,{onlyIcons:!0}),pe&&vl(F,t,l,B,Z,Y,{onlyText:!0})),t.map.showCollisionBoxes&&(xc(F,t,l,B,l.paint.get("text-translate"),l.paint.get("text-translate-anchor"),!0),xc(F,t,l,B,l.paint.get("icon-translate"),l.paint.get("icon-translate-anchor"),!1))},circle:function(F,t,l,B){if(F.renderPass!=="translucent")return;const G=l.paint.get("circle-opacity"),Z=l.paint.get("circle-stroke-width"),Y=l.paint.get("circle-stroke-opacity"),re=l.layout.get("
2668circle-sort-key").constantOr(1)!==void 0,oe=l.paint.get("circle-emissive-strength");if(G.constantOr(1)===0&&(Z.constantOr(1)===0||Y.constantOr(1)===0))return;const ce=F.context,he=ce.gl,pe=F.transform,fe=F.depthModeForSublayer(0,ki.ReadOnly),be=Ui.disabled,ze=F.colorModeForDrapableLayerRenderPass(oe),De=pe.projection.name==="globe",Oe=[o.at(pe.center.lng),o.aA(pe.center.lat)],Fe=[];for(let Xe=0;Xe<B.length;Xe++){const Ze=B[Xe],nt=t.getTile(Ze),Qe=nt.getBucket(l);if(!Qe||Qe.projection.name!==pe.projection.name)continue;const it=Qe.programConfigurations.get(l.id),Ke=o.cY(l),ht=F.isTileAffectedByFog(Ze);De&&Ke.push("PROJECTION_GLOBE_VIEW"),Ke.push("DEPTH_D24"),F.terrain&&pe.depthOcclusionForSymbolsAndCircles&&Ke.push("DEPTH_OCCLUSION");const yt=F.getOrCreateProgram("circle",{config:it,defines:Ke,overrideFog:ht}),Nt=Qe.layoutVertexBuffer,Dt=Qe.globeExtVertexBuffer,Wt=Qe.indexBuffer,$t=pe.projection.createInversionMatrix(pe,Ze.canonical),At={programConfiguration:it,program:yt,layoutVertexBuffer:Nt,globeExtVertexBuffer:Dt,indexBuffer:Wt,uniformValues:o.cZ(F,Ze,nt,$t,Oe,l),tile:nt};if(re){const Vt=Qe.segments.get();for(const ii of Vt)Fe.push({segments:new o.b7([ii]),sortKey:ii.sortKey,state:At})}else Fe.push({segments:Qe.segments,sortKey:0,state:At})}re&&Fe.sort((Xe,Ze)=>Xe.sortKey-Ze.sortKey);const Ge={useDepthForOcclusion:pe.depthOcclusionForSymbolsAndCircles};for(const Xe of Fe){const{programConfiguration:Ze,program:nt,layoutVertexBuffer:Qe,globeExtVertexBuffer:it,indexBuffer:Ke,uniformValues:ht,tile:yt}=Xe.state,Nt=Xe.segments;F.terrain&&F.terrain.setupElevationDraw(yt,nt,Ge),F.uploadCommonUniforms(ce,nt,yt.tileID.toUnwrapped()),nt.draw(F,he.TRIANGLES,fe,be,ze,qi.disabled,ht,l.id,Qe,Ke,Nt,l.paint,pe.zoom,Ze,[it])}},heatmap:function(F,t,l,B){if(l.paint.get("heatmap-opacity")!==0)if(F.renderPass==="offscreen"){const G=F.context,Z=G.gl,Y=Ui.disabled,re=new ir([Z.ONE,Z.ONE,Z.ONE,Z.ONE],o.aj.transparent,[!0,!0,!0,!0]);(function(be,ze,De,Oe){const Fe=be.gl,Ge=ze.width*Oe,Xe=ze.height*Oe;be.activeTexture.set(Fe.TEXTURE1),be.viewport.set([0,0,Ge,Xe]);let Ze=De.heatmapFbo;if(!Ze||Ze&&(Ze.width!==Ge||Ze.height!==Xe)){Ze&&Ze.destroy();const nt=Fe.createTexture();Fe.bindTexture(Fe.TEXTURE_2D,nt),Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_WRAP_S,Fe.CLAMP_TO_EDGE),Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_WRAP_T,Fe.CLAMP_TO_EDGE),Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_MIN_FILTER,Fe.LINEAR),Fe.texParameteri(Fe.TEXTURE_2D,Fe.TEXTURE_MAG_FILTER,Fe.LINEAR),Ze=De.heatmapFbo=be.createFramebuffer(Ge,Xe,!0,null),function(Qe,it,Ke,ht,yt,Nt){const Dt=Qe.gl;Dt.texImage2D(Dt.TEXTURE_2D,0,Qe.extRenderToTextureHalfFloat?Dt.RGBA16F:Dt.RGBA,yt,Nt,0,Dt.RGBA,Qe.extRenderToTextureHalfFloat?Dt.HALF_FLOAT:Dt.UNSIGNED_BYTE,null),ht.colorAttachment.set(Ke)}(be,0,nt,Ze,Ge,Xe)}else Fe.bindTexture(Fe.TEXTURE_2D,Ze.colorAttachment.get()),be.bindFramebuffer.set(Ze.framebuffer)})(G,F,l,F.transform.projection.name==="globe"?.5:.25),G.clear({color:o.aj.transparent});const oe=F.transform,ce=oe.projection.name==="globe",he=ce?["PROJECTION_GLOBE_VIEW"]:[],pe=ce?qi.frontCCW:qi.disabled,fe=[o.at(oe.center.lng),o.aA(oe.center.lat)];for(let be=0;be<B.length;be++){const ze=B[be];if(t.hasRenderableParent(ze))continue;const De=t.getTile(ze),Oe=De.getBucket(l);if(!Oe||Oe.projection.name!==oe.projection.name)continue;const Fe=F.isTileAffectedByFog(ze),Ge=Oe.programConfigurations.get(l.id),Xe=F.getOrCreateProgram("heatmap",{config:Ge,defines:he,overrideFog:Fe}),{zoom:Ze}=F.transform;F.terrain&&F.terrain.setupElevationDraw(De,Xe),F.uploadCommonUniforms(G,Xe,ze.toUnwrapped());const nt=oe.projection.createInversionMatrix(oe,ze.canonical);Xe.draw(F,Z.TRIANGLES,ki.disabled,Y,re,pe,Ti(F,ze,De,nt,fe,Ze,l.paint.get("heatmap-intensity")),l.id,Oe.layoutVertexBuffer,Oe.indexBuffer,Oe.segments,l.paint,F.transform.zoom,Ge,ce?[Oe.globeExtVertexBuffer]:null)}G.viewport.set([0,0,F.width,F.height])}else F.renderPass==="translucent"&&(F.context.setColorMode(F.colorModeForRenderPass()),function(G,Z){const Y=G.context,re=Y.gl,oe=Z.heatmapFbo;if(!oe)return;Y.activeTexture.set(re.TEXTURE0),re.bindTexture(re.TEXTURE_2D,oe.colorAttachment.get()),Y.activeTexture.set(re.TEXTURE1);
2668let ce=Z.colorRampTexture;ce||(ce=Z.colorRampTexture=new o.T(Y,Z.colorRamp,re.RGBA8)),ce.bind(re.LINEAR,re.CLAMP_TO_EDGE),G.getOrCreateProgram("heatmapTexture").draw(G,re.TRIANGLES,ki.disabled,Ui.disabled,G.colorModeForRenderPass(),qi.disabled,((he,pe,fe,be)=>({u_image:0,u_color_ramp:1,u_opacity:pe.paint.get("heatmap-opacity")}))(0,Z),Z.id,G.viewportBuffer,G.quadTriangleIndexBuffer,G.viewportSegments,Z.paint,G.transform.zoom)}(F,l))},line:function(F,t,l,B){if(F.renderPass!=="translucent")return;const G=l.paint.get("line-opacity"),Z=l.paint.get("line-width");if(G.constantOr(1)===0||Z.constantOr(1)===0)return;const Y=l.paint.get("line-emissive-strength"),re=l.paint.get("line-occlusion-opacity"),oe=l.layout.get("line-elevation-reference"),ce=l.layout.get("line-width-unit")==="meters",he=oe==="sea",pe=F.context,fe=pe.gl;if(l.hasElevatedBuckets&&F.transform.projection.name==="globe")return;const be=l.layout.get("line-cross-slope"),ze=be!==void 0,De=be<1,Oe=F.colorModeForDrapableLayerRenderPass(Y),Fe=F.terrain&&F.terrain.renderingToTexture,Ge=Fe?1:o.q.devicePixelRatio,Xe=l.paint.get("line-dasharray"),Ze=Xe.constantOr(1),nt=l.layout.get("line-cap"),Qe=Xe.constantOr(null),it=nt.constantOr(null),Ke=l.paint.get("line-pattern"),ht=Ke.constantOr(1),yt=Ke.constantOr(null),Nt=l.paint.get("line-opacity").constantOr(1);let Dt=!ht&&Nt!==1||F.depthOcclusion&&re>0&&re<1;const Wt=l.paint.get("line-gradient"),$t=ht?"linePattern":"line",At=o.c_(l);let Vt;if(Fe&&F.terrain&&F.terrain.clipOrMaskOverlapStencilType()&&(Dt=!1),re!==0&&F.depthOcclusion){const Et=l.paint._values["line-opacity"];Et&&Et.value&&Et.value.kind==="constant"?Vt=Et.value:o.w(`Occlusion opacity for layer ${l.id} is supported only when line-opacity isn't data-driven.`)}Z.value.kind!=="constant"&&Z.value.isLineProgressConstant===!1&&At.push("VARIABLE_LINE_WIDTH");const ii=(Et,Jt,Ut,hi,Qt)=>{for(const Xt of Et){const ri=t.getTile(Xt);if(ht&&!ri.patternsLoaded())continue;const ci=ri.getBucket(l);if(!ci||ci.hasZOffset&&!Qt||!ci.hasZOffset&&Qt)continue;F.prepareDrawTile();const xi=ci.programConfigurations.get(l.id),Si=F.isTileAffectedByFog(Xt),Vi=F.getOrCreateProgram($t,{config:xi,defines:Jt,overrideFog:Si,overrideRtt:!Qt&&void 0});if(yt&&ri.imageAtlas){const Zi=o.A.from(yt).getPrimary().scaleSelf(Ge).serialize(),fr=ri.imageAtlas.patternPositions[Zi];fr&&xi.setConstantPatternPositions(fr)}if(!ht&&Qe&&it&&ri.lineAtlas){const Zi=ri.lineAtlas.getDash(Qe,it);Zi&&xi.setConstantPatternPositions(Zi)}let[Ci,Ri]=l.paint.get("line-trim-offset");(it==="round"||it==="square")&&Ci!==Ri&&(Ci===0&&(Ci-=1),Ri===1&&(Ri+=1));const Hi=Fe?Xt.projMatrix:null,cr=ce?1/ci.tileToMeter/o.ar(ri,1,F.transform.zoom):1,Cr=ce?1/ci.tileToMeter/o.ar(ri,1,Math.floor(F.transform.zoom)):1,Yr=ht?o.c$(F,ri,l,Hi,Ge,cr,Cr,[Ci,Ri]):o.d0(F,ri,l,Hi,ci.lineClipsArray.length,Ge,cr,Cr,[Ci,Ri]);if(Wt){const Zi=ci.gradients[l.id];let fr=Zi.texture;if(l.gradientVersion!==Zi.version){let Pi=256;if(l.stepInterpolant){const ar=t.getSource().maxzoom,br=Xt.canonical.z===ar?Math.ceil(1<<F.transform.maxZoom-Xt.canonical.z):1;Pi=o.aw(o.d1(ci.maxLineLength/o.ag*1024*br),256,pe.maxTextureSize)}Zi.gradient=o.d2({expression:l.gradientExpression(),evaluationKey:"lineProgress",resolution:Pi,image:Zi.gradient||void 0,clips:ci.lineClipsArray}),Zi.texture?Zi.texture.update(Zi.gradient):Zi.texture=new o.T(pe,Zi.gradient,fe.RGBA8),Zi.version=l.gradientVersion,fr=Zi.texture}pe.activeTexture.set(fe.TEXTURE1),fr.bind(l.stepInterpolant?fe.NEAREST:fe.LINEAR,fe.CLAMP_TO_EDGE)}Ze&&(pe.activeTexture.set(fe.TEXTURE0),ri.lineAtlasTexture&&ri.lineAtlasTexture.bind(fe.LINEAR,fe.REPEAT),xi.updatePaintBuffers()),ht&&(pe.activeTexture.set(fe.TEXTURE0),ri.imageAtlasTexture&&ri.imageAtlasTexture.bind(fe.LINEAR,fe.CLAMP_TO_EDGE),xi.updatePaintBuffers()),Qt&&!he&&F.terrain.setupElevationDraw(ri,Vi),F.uploadCommonUniforms(pe,Vi,Xt.toUnwrapped());const Ur=Zi=>{Vt!=null&&(Vt.value=Nt*re),Vi.draw(F,fe.TRIANGLES,Ut,Zi,Oe,qi.disabled,Yr,l.id,ci.layoutVertexBuffer,ci.indexBuffer,ci.segments,l.paint,F.transform.zoom,xi,[ci.layoutVertexBuffer2,ci.patternVertexBuffer,ci.zOffsetVertexBuffer]),Vt!=null&&(Vt.value=Nt)};if(Dt&&!Qt){const Zi=F.stencilModeForClipping(Xt).ref;Zi===0&&Fe&&pe.clear({stencil:0});const fr={func:fe.EQUAL,mask:255};Yr.u_alpha_discard_threshold=.8,Ur(new Ui(fr,Zi,255,fe.KEEP,fe.KEEP,fe.INVERT)),Yr.u_alpha_discard_threshold=0,Ur(new Ui(fr,Zi,255,fe.KEEP,fe.KEEP,fe.KEEP))}else Dt&&Qt&&(Yr.u_alpha_discard_threshold=.001),Ur(Qt?hi:F.stencilModeForClipping(Xt))}};if(l.hasNonElevatedBuckets){const Et=!Fe&&F.terrain;re!==0&&Et?o.w(`Occlusion opacity for layer ${l.id} is supported on terrain only if the layer has line-z-offset enabled.`):Et?o.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${l.id}.`):ii(B,At,F.depthModeForSublayer(0,ki.ReadOnly),Ui.disabled,!1)}if(l.hasElevatedBuckets){At.push("ELEVATED"),ze&&At.push(De?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),he&&At.push("ELEVATION_REFERENCE_SEA");const Et=Dt?F.stencilModeFor3D():Ui.disabled,Jt=new ki(F.depthOcclusion?fe.GREATER:fe.LEQUAL,ki.ReadOnly,F.depthRangeFor3D);F.forceTerrainMode=!0,ii(B,At,Jt,Et,!0),F.forceTerrainMode=!1}Dt&&(F.resetStencilClippingMasks(),Fe&&pe.clear({stencil:0})),re===0||F.depthOcclusion||Fe||F.layersWithOcclusionOpacity.push(F.currentLayer)},fill:function(F,t,l,B){const G=l.paint.get("fill-color"),Z=l.paint.get("fill-opacity"),Y=l.is3D(),re=new ki(F.context.gl.LEQUAL,ki.ReadWrite,F.depthRangeFor3D);if(Z.constantOr(1)===0)return;const oe=l.paint.get("fill-emissive-strength"),ce=F.colorModeForDrapableLayerRenderPass(oe),he=l.paint.get("fill-pattern"),pe=F.opaquePassEnabledForLayer()&&!he.constantOr(1)&&G.constantOr(o.aj.transparent).a===1&&Z.constantOr(0)===1?"opaque":"translucent";if(F.renderPass===pe){const fe=Y?re:F.depthModeForSublayer(1,F.renderPass==="opaque"?ki.ReadWrite:ki.ReadOnly);Xh(F,t,l,B,fe,ce,!1)}if(!Y&&F.renderPass==="translucent"&&l.paint.get("fill-antialias")){const fe=Y?re:F.depthModeForSublayer(l.getPaintProperty("fill-outline-color")?2:0,ki.ReadOnly);Xh(F,t,l,B,fe,ce,!0)}},"fill-extrusion":function(F,t,l,B){const G=l.paint.get("fill-extrusion-opacity"),Z=F.context,Y=Z.gl,re=F.terrain,oe=re&&re.renderingToTexture;if(G===0)return;const ce=F.conflationActive&&F.style.isLayerClipped(l,t.getSource()),he=F.style.order.indexOf(l.fqid);if(ce&&function(pe,fe,be,ze,De){for(const Oe of ze){const Fe=fe.getTile(Oe).getBucket(be);Fe&&(Fe.updateReplacement(Oe,pe.replacementSource,De),Fe.uploadCentroid(pe.context))}}(F,t,l,B,he),re||ce)for(const pe of B){const fe=t.getTile(pe).getBucket(l);fe&&Eo(F.context,t,pe,fe,l,re,ce)}if(F.renderPass==="shadow"&&F.shadowRenderer){const pe=F.shadowRenderer;if(re&&G<.65&&l._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof o.a9)return;const fe=pe.getShadowPassDepthMode(),be=pe.getShadowPassColorMode();xl(F,t,l,B,fe,Ui.disabled,be,ce)}else if(F.renderPass==="translucent"){const pe=!l.paint.get("fill-extrusion-pattern").constantOr(1),fe=l.paint.get("fill-extrusion-color").constantOr(o.aj.white);if(!oe&&fe.a!==0){const be=new ki(F.context.gl.LEQUAL,ki.ReadWrite,F.depthRangeFor3D);G===1&&pe?xl(F,t,l,B,be,Ui.disabled,ir.unblended,ce):(xl(F,t,l,B,be,Ui.disabled,ir.disabled,ce),xl(F,t,l,B,be,F.stencilModeFor3D(),F.colorModeForRenderPass(),ce),F.resetStencilClippingMasks())}if(F.style.enable3dLights()&&pe&&(!re&&F.transform.projection.name!=="globe"||oe)){const be=l.paint.get("fill-extrusion-opacity"),ze=l.paint.get("fill-extrusion-ambient-occlusion-intensity"),De=l.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),Oe=l.paint.get("fill-extrusion-flood-light-intensity"),Fe=l.paint.get("fill-extrusion-flood-light-color-use-theme").
2668constantOr("default")==="none",Ge=l.paint.get("fill-extrusion-flood-light-color").toRenderColor(Fe?null:l.lut).toArray01().slice(0,3),Xe=ze>0&&De>0,Ze=Oe>0,nt=(it,Ke,ht)=>(1-ht)*it+ht*Ke,Qe=it=>{const Ke=F.depthModeForSublayer(1,ki.ReadOnly,Y.LEQUAL,!0),ht=l.paint.get(it?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),yt=nt(.1,3,ht),Nt=F._showOverdrawInspector;if(!Nt){const Dt=new Ui({func:Y.ALWAYS,mask:255},255,255,Y.KEEP,Y.KEEP,Y.REPLACE),Wt=new ir([Y.ONE,Y.ONE,Y.ONE,Y.ONE],o.aj.transparent,[!1,!1,!1,!0],Y.MIN);To(F,t,l,B,Ke,Dt,Wt,qi.disabled,it,"sdf",be,ze,De,Oe,Ge,yt,ce,!1)}{const Dt=Nt?Ui.disabled:new Ui({func:Y.EQUAL,mask:255},255,255,Y.KEEP,Y.DECR,Y.DECR),Wt=Nt?F.colorModeForRenderPass():new ir([Y.ONE_MINUS_DST_ALPHA,Y.DST_ALPHA,Y.ONE,Y.ONE],o.aj.transparent,[!0,!0,!0,!0]);To(F,t,l,B,Ke,Dt,Wt,qi.disabled,it,"color",be,ze,De,Oe,Ge,yt,ce,!1)}};if(oe){const it=(Ke,ht,yt)=>{const Nt=F.depthModeForSublayer(1,ki.ReadOnly,Y.LEQUAL,!1),Dt=l.paint.get(Ke?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),Wt=nt(.1,3,Dt);{const $t=new ir([Y.ONE,Y.ONE,Y.ONE,Y.ONE],o.aj.transparent,[!1,!1,!1,!0]);To(F,t,l,B,Nt,Ui.disabled,$t,qi.disabled,Ke,"clear",be,ze,De,Oe,Ge,Wt,ce,ht)}{const $t=new Ui({func:Y.ALWAYS,mask:255},255,255,Y.KEEP,Y.KEEP,Y.REPLACE),At=new ir([Y.ONE,Y.ONE,Y.ONE,Y.ONE],o.aj.transparent,[!1,!1,!1,!0],Y.MIN);To(F,t,l,B,Nt,$t,At,qi.disabled,Ke,"sdf",be,ze,De,Oe,Ge,Wt,ce,ht)}{const $t=Ke?Y.ZERO:Y.ONE_MINUS_DST_ALPHA,At=new Ui({func:Y.EQUAL,mask:255},255,255,Y.KEEP,Y.DECR,Y.DECR),Vt=new ir([$t,Y.DST_ALPHA,Y.ONE_MINUS_DST_ALPHA,Y.ZERO],o.aj.transparent,[!0,!0,!0,!0]);To(F,t,l,B,Nt,At,Vt,qi.disabled,Ke,"color",be,ze,De,Oe,Ge,Wt,ce,ht)}{const $t=new ir([Y.ONE,Y.ONE,Y.ONE,Ke?Y.ZERO:Y.ONE],o.aj.transparent,[!1,!1,!1,!0],Ke?Y.FUNC_ADD:Y.MAX);To(F,t,l,B,Nt,Ui.disabled,$t,qi.disabled,Ke,"clear",be,ze,De,Oe,Ge,Wt,ce,ht,yt)}};if(Xe||Ze){let Ke;if(F.prepareDrawTile(),re){const ht=re.drapeBufferSize[0],yt=re.drapeBufferSize[1];Ke=re.framebufferCopyTexture,Ke&&(!Ke||Ke.size[0]===ht&&Ke.size[1]===yt)||(Ke&&Ke.destroy(),Ke=re.framebufferCopyTexture=new o.T(Z,new o.r({width:ht,height:yt}),Y.RGBA8)),Ke.bind(Y.LINEAR,Y.CLAMP_TO_EDGE),Y.copyTexSubImage2D(Y.TEXTURE_2D,0,0,0,0,0,ht,yt)}Xe&&it(!0,!1,Ke),Ze&&it(!1,!0,Ke)}}else Xe&&Qe(!0),Ze&&Qe(!1),(Xe||Ze)&&F.resetStencilClippingMasks()}}},hillshade:function(F,t,l,B){if(F.renderPass!=="offscreen"&&F.renderPass!=="translucent"||F.style.disableElevatedTerrain)return;const G=F.context,Z=F.terrain&&F.terrain.renderingToTexture,[Y,re]=F.renderPass!=="translucent"||Z?[{},B]:F.stencilConfigForOverlap(B);for(const oe of re){const ce=t.getTile(oe);if(ce.needsHillshadePrepare&&F.renderPass==="offscreen")Gp(F,ce,l);else if(F.renderPass==="translucent"){const he=F.depthModeForSublayer(0,ki.ReadOnly),pe=l.paint.get("hillshade-emissive-strength"),fe=F.colorModeForDrapableLayerRenderPass(pe),be=Z&&F.terrain?F.terrain.stencilModeForRTTOverlap(oe):Y[oe.overscaledZ];od(F,oe,ce,l,he,be,fe)}}G.viewport.set([0,0,F.width,F.height]),F.resetStencilClippingMasks()},raster:function(F,t,l,B,G,Z){if(F.renderPass!=="translucent"||l.paint.get("raster-opacity")===0)return;const Y=F.transform.projection.name==="globe",re=l.paint.get("raster-elevation")!==0,oe=re&&Y;if(F.renderElevatedRasterBackface&&!oe)return;const ce=F.context,he=ce.gl,pe=t.getSource(),fe=function(Qe,it,Ke,ht){const yt=it.paint.get("raster-color"),Nt=Qe.type==="raster-array",Dt=[],Wt=it.paint.get("raster-resampling"),$t=it.paint.get("raster-color-mix");let At=it.paint.get("raster-color-range");const Vt=[$t[0],$t[1],$t[2],0],ii=$t[3];let Et=Wt==="nearest"?ht.NEAREST:ht.LINEAR;if(Nt&&(Dt.push("RASTER_ARRAY"),yt||Dt.push("RASTER_COLOR"),Wt==="linear"&&Dt.push("RASTER_ARRAY_LINEAR"),Et=ht.NEAREST,!At&&Qe.rasterLayers)){const Jt=Qe.rasterLayers.find(({id:Ut})=>Ut===it.sourceLayer);Jt&&Jt.fields&&Jt.fields.range&&(At=Jt.fields.range)}if(At=At||[0,1],yt){Dt.push("RASTER_COLOR"),Ke.activeTexture.set(ht.TEXTURE2),it.updateColorRamp(At);let Jt=it.colorRampTexture;Jt||(Jt=it.colorRampTexture=new o.T(Ke,it.colorRamp,ht.RGBA8)),Jt.bind(ht.LINEAR,ht.CLAMP_TO_EDGE)}return{mix:Vt,range:At,offset:ii,defines:Dt,resampling:Et}}(pe,l,ce,he);if(pe instanceof o.aJ&&!B.length&&!Y)return;const be=l.paint.get("raster-emissive-strength"),ze=F.colorModeForDrapableLayerRenderPass(be),De=F.terrain&&F.terrain.renderingToTexture,Oe=!F.options.moving,Fe=l.paint.get("raster-resampling")==="nearest"?he.NEAREST:he.LINEAR;if(pe instanceof o.aJ&&!B.length&&(pe.onNorthPole||pe.onSouthPole)){const Qe=re?F.stencilModeFor3D():Ui.disabled;return void Rt(!!pe.onNorthPole,null,F,t,l,be,fe,qi.disabled,Qe)}if(!B.length)return;const[Ge,Xe]=pe instanceof o.aJ||De?[{},B]:F.stencilConfigForOverlap(B),Ze=Xe[Xe.length-1].overscaledZ;oe&&fe.defines.push("PROJECTION_GLOBE_VIEW"),re&&fe.defines.push("RENDER_CUTOFF");const nt=(Qe,it,Ke)=>{for(const ht of Qe){const yt=ht.toUnwrapped(),Nt=t.getTile(ht);if(De&&(!Nt||!Nt.hasData()))continue;ce.activeTexture.set(he.TEXTURE0);const Dt=Sc(Nt,pe,l,fe);if(!Dt||!Dt.texture)continue;const{texture:Wt,mix:$t,offset:At,tileSize:Vt,buffer:ii}=Dt;let Et,Jt;De?(Et=ki.disabled,Jt=ht.projMatrix):re?(Et=new ki(he.LEQUAL,ki.ReadWrite,F.depthRangeFor3D),Jt=Y?Float32Array.from(F.transform.expandedFarZProjMatrix):F.transform.calculateProjMatrix(yt,Oe)):(Et=F.depthModeForSublayer(ht.overscaledZ-Ze,l.paint.get("raster-opacity")===1?ki.ReadWrite:ki.ReadOnly,he.LESS),Jt=F.transform.calculateProjMatrix(yt,Oe));const Ut=F.terrain&&De?F.terrain.stencilModeForRTTOverlap(ht):Ge[ht.overscaledZ],hi=Z?0:l.paint.get("raster-fade-duration");Nt.registerFadeDuration(hi);const Qt=t.findLoadedParent(ht,0),Xt=pl(Nt,Qt,t,F.transform,hi);let ri,ci;F.terrain&&F.terrain.prepareDrawTile(),ce.activeTexture.set(he.TEXTURE0),Wt.bind(Fe,he.CLAMP_TO_EDGE),ce.activeTexture.set(he.TEXTURE1),Qt?(Qt.texture&&Qt.texture.bind(Fe,he.CLAMP_TO_EDGE),ri=Math.pow(2,Qt.tileID.overscaledZ-Nt.tileID.overscaledZ
2668),ci=[Nt.tileID.canonical.x*ri%1,Nt.tileID.canonical.y*ri%1]):Wt.bind(Fe,he.CLAMP_TO_EDGE),Wt.useMipmap&&ce.extTextureFilterAnisotropic&&F.transform.pitch>20&&he.texParameterf(he.TEXTURE_2D,ce.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ce.extTextureFilterAnisotropicMax);const xi=F.transform;let Si;const Vi=re?wd(xi):[0,0,0,0];let Ci,Ri,Hi,cr,Cr,Yr=0;if(oe&&pe instanceof o.aJ&&pe.coordinates.length>3)Ci=Float32Array.from(o.bb(o.cH(new o.bT(0,0,0)))),Ri=Float32Array.from(xi.globeMatrix),Hi=Float32Array.from(o.cD(xi)),cr=[o.at(xi.center.lng),o.aA(xi.center.lat)],Si=pe.elevatedGlobePerspectiveTransform,Cr=pe.elevatedGlobeGridMatrix||new Float32Array(9);else if(oe){const Pi=o.cE(ht.canonical);Yr=o.cF(Pi.getCenter().lat),Ci=Float32Array.from(o.bb(o.cH(ht.canonical))),Ri=Float32Array.from(xi.globeMatrix),Hi=Float32Array.from(o.cD(xi)),cr=[o.at(xi.center.lng),o.aA(xi.center.lat)],Si=[0,0],Cr=Float32Array.from(o.cG(ht.canonical,Pi,Yr,xi.worldSize/xi._pixelsPerMercatorPixel))}else Si=pe instanceof o.aJ?pe.perspectiveTransform:[0,0],Ci=new Float32Array(16),Ri=new Float32Array(9),Hi=new Float32Array(16),cr=[0,0],Cr=new Float32Array(9);const Ur=Ma(Jt,Ci,Ri,Hi,Cr,ci||[0,0],o.ae(F.transform.zoom),cr,Vi,ri||1,Xt,l,Si,re?l.paint.get("raster-elevation"):0,2,$t,At,fe.range,Vt,ii,be),Zi=F.isTileAffectedByFog(ht),fr=F.getOrCreateProgram("raster",{defines:fe.defines,overrideFog:Zi});if(F.uploadCommonUniforms(ce,fr,yt),pe instanceof o.aJ){const Pi=pe.elevatedGlobeVertexBuffer,ar=pe.elevatedGlobeIndexBuffer;if(De||!Y)pe.boundsBuffer&&pe.boundsSegments&&fr.draw(F,he.TRIANGLES,Et,Ui.disabled,ze,qi.disabled,Ur,l.id,pe.boundsBuffer,F.quadTriangleIndexBuffer,pe.boundsSegments);else if(Pi&&ar){const br=xi.zoom<=o.c6?pe.elevatedGlobeSegments:pe.getSegmentsForLongitude(xi.center.lng);br&&fr.draw(F,he.TRIANGLES,Et,Ui.disabled,ze,it,Ur,l.id,Pi,ar,br)}}else if(oe){Et=new ki(he.LEQUAL,ki.ReadOnly,F.depthRangeFor3D);const Pi=F.globeSharedBuffers;if(Pi){const[ar,br,Er]=Pi.getGridBuffers(Yr,!1);fr.draw(F,he.TRIANGLES,Et,Ke||Ut,F.colorModeForRenderPass(),it,Ur,l.id,ar,br,Er)}}else{const{tileBoundsBuffer:Pi,tileBoundsIndexBuffer:ar,tileBoundsSegments:br}=F.getTileBoundsBuffers(Nt);fr.draw(F,he.TRIANGLES,Et,Ut,ze,qi.disabled,Ur,l.id,Pi,ar,br)}}if(!(pe instanceof o.aJ)&&oe)for(const ht of Qe){const yt=ht.canonical.y===(1<<ht.canonical.z)-1;ht.canonical.y===0&&Rt(!0,ht,F,t,l,be,fe,it,Ke||Ui.disabled),yt&&Rt(!1,ht,F,t,l,be,fe,it===qi.frontCW?qi.backCW:qi.frontCW,Ke||Ui.disabled)}};oe?nt(Xe,F.renderElevatedRasterBackface?qi.backCW:qi.frontCW,F.stencilModeFor3D()):nt(Xe,qi.disabled,void 0),F.resetStencilClippingMasks()},"raster-particle":function(F,t,l,B,G,Z){F.renderPass==="offscreen"&&function(Y,re,oe,ce){if(!ce.length)return;const he=Y.context,pe=he.gl,fe=re.getSource();if(!(fe instanceof Tn))return;const be=Math.ceil(Math.sqrt(oe.paint.get("raster-particle-count")));let ze=oe.particlePositionRGBAImage;if(!ze||ze.width!==be){const Xe=function(Ze){const nt=Ze*Ze,Qe=new Uint8Array(4*nt),it=function(ht){return ht|=0,ht=Math.imul(2747636419^ht,2654435769),ht=Math.imul(ht^ht>>>16,2654435769),((ht=Math.imul(ht^ht>>>16,2654435769))>>>0)/4294967296},Ke=1/1.1;for(let ht=0;ht<nt;ht++){const yt=Ke*(it(2*ht+0)+Mi),Nt=Ke*(it(2*ht+1)+Mi),Dt=255*yt%1,Wt=255*Nt%1,$t=Dt,At=Nt-Wt/255,Vt=Wt;Qe[4*ht+0]=255*(yt-Dt/255),Qe[4*ht+1]=255*$t,Qe[4*ht+2]=255*At,Qe[4*ht+3]=255*Vt}return Qe}(be);ze=oe.particlePositionRGBAImage=new o.r({width:be,height:be},Xe)}let De=oe.particleFramebuffer;De?De.width!==be&&(De.destroy(),De=oe.particleFramebuffer=he.createFramebuffer(be,be,!0,null)):De=oe.particleFramebuffer=he.createFramebuffer(be,be,!0,null);const Oe=[];for(const Xe of ce){const Ze=re.getTile(Xe);if(!(Ze instanceof wa))continue;const nt=Td(Ze,fe,oe);if(!nt)continue;const Qe=[Ze.tileSize,Ze.tileSize];let it=oe.tileFramebuffer;it||(it=oe.tileFramebuffer=he.createFramebuffer(Qe[0],Qe[1],!0,null));let Ke=Ze.rasterParticleState;Ke||(Ke=Ze.rasterParticleState=new Sd(he,Xe,Qe,ze));const ht=Ke.update(oe.lastInvalidatedAt);Ke.particleTextureDimension!==be&&Ke.updateParticleTexture(Xe,ze);const yt=Ke.targetColorTexture;Ke.targetColorTexture=Ke.backgroundColorTexture,Ke.backgroundColorTexture=yt;const Nt=Ke.particleTexture0;Ke.particleTexture0=Ke.particleTexture1,Ke.particleTexture1=Nt,Oe.push([Xe,nt,Ke,ht])}if(Oe.length===0)return;const Fe=o.q.now(),Ge=oe.previousDrawTimestamp?.001*(Fe-oe.previousDrawTimestamp):.0167;if(oe.previousDrawTimestamp=Fe,oe.hasColorMap()){he.activeTexture.set(pe.TEXTURE0+2);let Xe=oe.colorRampTexture;
vendor: 4,501 bytes, line 2668
2668Xe||(Xe=oe.colorRampTexture=new o.T(he,oe.colorRamp,pe.RGBA8)),Xe.bind(pe.LINEAR,pe.CLAMP_TO_EDGE)}he.bindFramebuffer.set(oe.tileFramebuffer.framebuffer),function(Xe,Ze,nt){const Qe=Xe.context,it=Qe.gl,Ke=Ze.tileFramebuffer;Qe.activeTexture.set(it.TEXTURE0);const ht={u_texture:0,u_opacity:1.05*(Nt=Ze.paint.get("raster-particle-fade-opacity-factor"))/(Nt+.05)},yt=Xe.getOrCreateProgram("rasterParticleTexture",{defines:[],overrideFog:!1});var Nt;for(const Dt of nt){const[,,Wt,$t]=Dt;Ke.colorAttachment.set(Wt.targetColorTexture.texture),Qe.viewport.set([0,0,Ke.width,Ke.height]),Qe.clear({color:o.aj.transparent}),$t&&(Wt.backgroundColorTexture.bind(it.NEAREST,it.CLAMP_TO_EDGE),yt.draw(Xe,it.TRIANGLES,ki.disabled,Ui.disabled,ir.alphaBlended,qi.disabled,ht,Ze.id,Xe.viewportBuffer,Xe.quadTriangleIndexBuffer,Xe.viewportSegments))}}(Y,oe,Oe),function(Xe,Ze,nt,Qe){const it=Xe.context,Ke=it.gl,ht=nt.tileFramebuffer,yt=Xe.transform.projection.name==="globe",Nt=nt.paint.get("raster-particle-max-speed");for(const Dt of Qe){const[Wt,$t,At]=Dt;it.activeTexture.set(Ke.TEXTURE0+0),$t.texture.bind(Ke.LINEAR,Ke.CLAMP_TO_EDGE),ht.colorAttachment.set(At.targetColorTexture.texture);const Vt=Xe.getOrCreateProgram("rasterParticleDraw",{defines:$t.defines,overrideFog:!1});it.activeTexture.set(Ke.TEXTURE0+1);const ii=$t.scalarData?[]:[0,1,2,3].map(Ut=>o.d4[Ut](Wt));ii.push(Wt);const Et=Wt.canonical.x,Jt=Wt.canonical.y;for(const Ut of ii){const hi=Ze.getTile(yt?Ut.wrapped():Ut);if(!hi)continue;const Qt=hi.rasterParticleState;if(!Qt)continue;const Xt=Ut.canonical.x+(1<<Ut.canonical.z)*(Ut.wrap-Wt.wrap),ri=Ut.canonical.y;Qt.particleTexture0.bind(Ke.NEAREST,Ke.CLAMP_TO_EDGE);const ci=tf(1,Qt.particleTexture0.size[0],[Xt-Et,ri-Jt],0,$t.texture.size,2,Nt,$t.textureOffset,$t.scale,$t.offset);Vt.draw(Xe,Ke.POINTS,ki.disabled,Ui.disabled,ir.alphaBlended,qi.disabled,ci,nt.id,Qt.particleIndexBuffer,void 0,Qt.particleSegment)}}}(Y,re,oe,Oe),he.bindFramebuffer.set(oe.particleFramebuffer.framebuffer),function(Xe,Ze,nt,Qe){const it=Xe.context,Ke=it.gl,ht=Ze.paint.get("raster-particle-max-speed"),yt=Qe*Ze.paint.get("raster-particle-speed-factor")*.15,Nt=function(Wt){return Math.pow(Wt,6)}(.01+1*Ze.paint.get("raster-particle-reset-rate-factor")),Dt=Ze.particleFramebuffer;it.viewport.set([0,0,Dt.width,Dt.height]);for(const Wt of nt){const[,$t,At]=Wt;it.activeTexture.set(Ke.TEXTURE0+0),$t.texture.bind(Ke.LINEAR,Ke.CLAMP_TO_EDGE),it.activeTexture.set(Ke.TEXTURE0+1);const Vt=At.particleTexture0;Vt.bind(Ke.NEAREST,Ke.CLAMP_TO_EDGE);const ii=rf(1,Vt.size[0],0,$t.texture.size,ht,yt,Nt,$t.textureOffset,$t.scale,$t.offset);Dt.colorAttachment.set(At.particleTexture1.texture),it.clear({color:o.aj.transparent}),Xe.getOrCreateProgram("rasterParticleUpdate",{defines:$t.defines}).draw(Xe,Ke.TRIANGLES,ki.disabled,Ui.disabled,ir.unblended,qi.disabled,ii,Ze.id,Xe.viewportBuffer,Xe.quadTriangleIndexBuffer,Xe.viewportSegments)}}(Y,oe,Oe,Ge)}(F,t,l,B),F.renderPass==="translucent"&&(function(Y,re,oe,ce,he){const pe=Y.context,fe=pe.gl,be=re.getSource().tileSize,ze=5*(1-o.ac(o.bY,o.bY+1,Y.transform.zoom))*be+oe.paint.get("raster-particle-elevation"),De=!Y.options.moving,Oe=Y.transform.projection.name==="globe";if(!ce.length)return;const[Fe,Ge]=Y.stencilConfigForOverlap(ce),Xe=[];Oe&&Xe.push("PROJECTION_GLOBE_VIEW");const Ze=Y.stencilModeFor3D();for(const nt of Ge){const Qe=nt.toUnwrapped(),it=re.getTile(nt);if(!it.rasterParticleState)continue;const Ke=it.rasterParticleState,ht=100;it.registerFadeDuration(ht);const yt=re.findLoadedParent(nt,0),Nt=pl(it,yt,re,Y.transform,ht);let Dt,Wt;Y.terrain&&Y.terrain.prepareDrawTile(),pe.activeTexture.set(fe.TEXTURE0),Ke.targetColorTexture.bind(fe.LINEAR,fe.CLAMP_TO_EDGE),pe.activeTexture.set(fe.TEXTURE1),yt&&yt.rasterParticleState?(yt.rasterParticleState.targetColorTexture.bind(fe.LINEAR,fe.CLAMP_TO_EDGE),Dt=Math.pow(2,yt.tileID.overscaledZ-it.tileID.overscaledZ),Wt=[it.tileID.canonical.x*Dt%1,it.tileID.canonical.y*Dt%1]):Ke.targetColorTexture.bind(fe.LINEAR,fe.CLAMP_TO_EDGE);const $t=Oe?Float32Array.from(Y.transform.expandedFarZProjMatrix):Y.transform.calculateProjMatrix(Qe,De),At=Y.transform,Vt=Ed(At),ii=o.cE(nt.canonical),Et=o.cF(ii.getCenter().lat);let Jt,Ut,hi,Qt,Xt;Oe?(Jt=Float32Array.from(o.bb(o.cH(nt.canonical))),Ut=Float32Array.from(At.globeMatrix),hi=Float32Array.from(o.cD(At)),Qt=[o.at(At.center.lng),o.aA(At.center.lat)],Xt=Float32Array.from(o.cG(nt.canonical,ii,Et,At.worldSize/At._pixelsPerMercatorPixel))):(Jt=new Float32Array(16),Ut=ne
2668w Float32Array(9),hi=new Float32Array(16),Qt=[0,0],Xt=new Float32Array(9));const ri=jh($t,Jt,Ut,hi,Xt,Wt||[0,0],o.ae(Y.transform.zoom),Qt,Vt,Dt||1,Nt,ze),ci=Y.isTileAffectedByFog(nt),xi=Y.getOrCreateProgram("rasterParticle",{defines:Xe,overrideFog:ci});if(Y.uploadCommonUniforms(pe,xi,Qe),Oe){const Si=new ki(fe.LEQUAL,ki.ReadOnly,Y.depthRangeFor3D),Vi=0,Ci=Y.globeSharedBuffers;if(Ci){const[Ri,Hi,cr]=Ci.getGridBuffers(Et,Vi!==0);xi.draw(Y,fe.TRIANGLES,Si,Ze,ir.alphaBlended,Y.renderElevatedRasterBackface?qi.frontCCW:qi.backCCW,ri,oe.id,Ri,Hi,cr)}}else{const Si=Y.depthModeForSublayer(0,ki.ReadOnly),Vi=Fe[nt.overscaledZ],{tileBoundsBuffer:Ci,tileBoundsIndexBuffer:Ri,tileBoundsSegments:Hi}=Y.getTileBoundsBuffers(it);xi.draw(Y,fe.TRIANGLES,Si,Vi,ir.alphaBlended,qi.disabled,ri,oe.id,Ci,Ri,Hi)}}Y.resetStencilClippingMasks()}(F,t,l,B),F.style.map.triggerRepaint())},background:function(F,t,l,B){const G=l.paint.get("background-color"),Z=l.paint.get("background-color-use-theme").constantOr("default")==="none",Y=l.paint.get("background-opacity"),re=l.paint.get("background-emissive-strength"),oe=l.paint.get("background-pitch-alignment")==="viewport";if(Y===0)return;const ce=F.context,he=ce.gl,pe=F.transform,fe=pe.tileSize,be=l.paint.get("background-pattern");let ze;if(be!==void 0&&(be===null||(ze=F.imageManager.getPattern(be.toString(),l.scope,F.style.getLut(l.scope)),!ze)))return;const De=!be&&G.a===1&&Y===1&&F.opaquePassEnabledForLayer()?"opaque":"translucent";if(F.renderPass!==De)return;const Oe=Ui.disabled,Fe=F.depthModeForSublayer(0,De==="opaque"?ki.ReadWrite:ki.ReadOnly),Ge=F.colorModeForDrapableLayerRenderPass(re),Xe=be?"backgroundPattern":"background";let Ze,nt=B;if(nt||(Ze=F.getBackgroundTiles(),nt=Object.values(Ze).map(Qe=>Qe.tileID)),be&&(ce.activeTexture.set(he.TEXTURE0),F.imageManager.bind(F.context,l.scope)),oe){const Qe=F.getOrCreateProgram(Xe,{overrideFog:!1,overrideRtt:!0}),it=new Float32Array(o.ab.mat4.identity([])),Ke=new o.aG(0,0,0,0,0),ht=be?bd(it,re,Y,F,0,l.scope,ze,oe,{tileID:Ke,tileSize:fe}):qh(it,re,Y,G.toRenderColor(Z?null:l.lut));Qe.draw(F,he.TRIANGLES,Fe,Oe,Ge,qi.disabled,ht,l.id,F.viewportBuffer,F.quadTriangleIndexBuffer,F.viewportSegments)}else for(const Qe of nt){const it=F.isTileAffectedByFog(Qe),Ke=F.getOrCreateProgram(Xe,{overrideFog:it}),ht=Qe.toUnwrapped(),yt=B?Qe.projMatrix:F.transform.calculateProjMatrix(ht);F.prepareDrawTile();const Nt=t?t.getTile(Qe):Ze?Ze[Qe.key]:new ba(Qe,fe,pe.zoom,F),Dt=be?bd(yt,re,Y,F,0,l.scope,ze,oe,{tileID:Qe,tileSize:fe}):qh(yt,re,Y,G.toRenderColor(Z?null:l.lut));F.uploadCommonUniforms(ce,Ke,ht);const{tileBoundsBuffer:Wt,tileBoundsIndexBuffer:$t,tileBoundsSegments:At}=F.getTileBoundsBuffers(Nt);Ke.draw(F,he.TRIANGLES,Fe,Oe,Ge,qi.disabled,Dt,l.id,Wt,$t,At)}},sky:function(F,t,l){const B=F._atmosphere?o.ae(F.transform.zoom):1,G=l.paint.get("sky-opacity")*B;if(G===0)return;const Z=F.context,Y=l.paint.get("sky-type"),re=new ki(Z.gl.LEQUAL,ki.ReadOnly,[0,1]),oe=F.frameCounter/1e3%1;Y==="atmosphere"?F.renderPass==="offscreen"?l.needsSkyboxCapture(F)&&(function(ce,he,pe,fe){const be=ce.context,ze=be.gl;let De=he.skyboxFbo;if(!De){De=he.skyboxFbo=be.createFramebuffer(32,32,!0,null),he.skyboxGeometry=new Md(be),he.skyboxTexture=be.gl.createTexture(),ze.bindTexture(ze.TEXTURE_CUBE_MAP,he.skyboxTexture),ze.texParameteri(ze.TEXTURE_CUBE_MAP,ze.TEXTURE_WRAP_S,ze.CLAMP_TO_EDGE),ze.texParameteri(ze.TEXTURE_CUBE_MAP,ze.TEXTURE_WRAP_T,ze.CLAMP_TO_EDGE),ze.texParameteri(ze.TEXTURE_CUBE_MAP,ze.TEXTURE_MIN_FILTER,ze.LINEAR),ze.texParameteri(ze.TEXTURE_CUBE_MAP,ze.TEXTURE_MAG_FILTER,ze.LINEAR);for(let Xe=0;Xe<6;++Xe)ze.texImage2D(ze.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0,ze.RGBA,32,32,0,ze.RGBA,ze.UNSIGNED_BYTE,null)}be.bindFramebuffer.set(De.framebuffer),be.viewport.set([0,0,32,32]);const Oe=he.getCenter(ce,!0),Fe=ce.getOrCreateProgram("skyboxCapture"),Ge=new Float64Array(16);o.ab.mat4.identity(Ge),o.ab.mat4.rotateY(Ge,Ge,.5*-Math.PI),kn(ce,he,Fe,Ge,Oe,0),o.ab.mat4.identity(Ge),o.ab.mat4.rotateY(Ge,Ge,.5*Math.PI),kn(ce,he,Fe,Ge,Oe,1),o.ab.mat4.identity(Ge),o.ab.mat4.rotateX(Ge,Ge,.5*-Math.PI),kn(ce,he,Fe,Ge,Oe,2),o.ab.mat4.identity(Ge),o.ab.mat4.rotateX(Ge,Ge,.5*Math.PI),kn(ce,he,Fe,Ge,Oe,3),o.ab.mat4.identity(Ge),kn(ce,he,Fe,Ge,Oe,4),o.ab.mat4.identity(Ge),o.ab.mat4.rotateY(Ge,Ge,Math.PI),kn(ce,he,Fe,Ge,Oe,5),be.viewport.set([0,0,ce.width,ce.height])}(F,l),l.markSkyboxValid(F)):F.renderPass==="sky"&&function(ce,he,pe,fe,be){const ze=ce.context,De=ze.gl,Oe=ce.transform,Fe=ce.getOrCreateProgram("skybox");ze.activeTexture.set(De.TEXTURE0),De.bindTexture(De.TEXTURE_CUBE_MAP,he.skyboxTexture);const Ge=((Xe,Ze,nt,Qe,it)=>({u_matrix:Xe,u_sun_direction:Ze,u_cubemap:0,u_opacity:Qe,u_temporal_offset:it}))(Oe.skyboxMatrix,he.getCenter(ce,!1),0,fe,be);ce.uploadCommonUniforms(ze,Fe),Fe.draw(ce,De.TRIANGLES,pe,Ui.disabled,ce.colorModeForRenderPass(),qi.backCW,Ge,"skybox",he.skyboxGeometry.vertexBuffer,he.skyboxGeometry.indexBuffer,he.skyboxGeometry.segment)}(F,l,re,G,oe):Y==="gradient"&&F.renderPass==="sky"&&function(ce,he,pe,fe,be){const ze=ce.context,De=ze.gl,Oe=ce.transform,Fe=ce.getOrCreateProgram("skyboxGradient");he.skyboxGeometry||(he.skyboxGeometry=new Md(ze)),ze.activeTexture.set(De.TEXTURE0);let Ge=he.colorRampTexture;Ge||(Ge=he.colorRampTexture=new o.T(ze,he.colorRamp,De.RGBA8)),Ge.bind(De.LINEAR,De.CLAMP_TO_EDGE);const Xe=((Ze,nt,Qe,it,Ke)=>({u_matrix:Ze,u_color_ramp:0,u_center_direction:nt,u_radius:o.ai(Qe),u_opacity:it,u_temporal_offset:Ke}))(Oe.skyboxMatrix,he.getCenter(ce,!1),he.paint.get("sky-gradient-radius"),fe,be);ce.uploadCommonUniforms(ze,Fe),Fe.draw(ce,De.TRIANGLES,pe,Ui.disabled,ce.colorModeForRenderPass(),qi.backCW,Xe,"skyboxGradient",he.skyboxGeometry.vertexBuffer,he.skyboxGeometry.indexBuffer,he.skyboxGeometry.segment)}(F,l,re,G,oe)},debug:function(F,t,l,B,G,Z){for(let Y=0;Y<l.length;Y++)if(G){const ce=new o.aj(B.r*.8,B.g*.8,B.b*.8,1);Ca(F,t,l[Y],B,-1,-1,Z),Ca(F,t,l[Y],B,-1,1,Z),Ca(F,t,l[Y],B,1,1,Z),Ca(F,t,l[Y],B,1,-1,Z),Ca(F,t,l[Y],ce,0,0,Z)}else Ca(F,t,l[Y],B,0,0,Z)},custom:function(F,t,l,B){const G=F.context,Z=l.implementation;if(!F.transform.projection.unsupportedLayers||!F.transform.projection.unsupportedLayers.includes("custom")||F.terrain&&(F.terrain.renderingToTexture||F.renderPass==="offscreen")&&l.isDraped(t)){if(F.renderPass==="offscreen"){const Y=Z.prerender;if(Y){if(F.setCustomLayerDefaults(),G.setColorMode(F.colorModeForRenderPass()),F.transform.projection.name==="globe"){const re=F.transform.pointMerc;Y.call(Z,G.gl,F.transform.customLayerMatrix(),F.transform.getProjection(),F.transform.globeToMercatorMatrix(),o.ae(F.transform.zoom),[re.x,re.y],F.transform.pixelsPerMeterRatio)}else Y.call(Z,G.gl,F.transform.customLayerMatrix());G.setDirty(),F.setBaseState()}}else if(F.renderPass==="translucent"){if(F.terrain&&F.terrain.renderingToTexture){const re=Z.renderToTile;if(re){const oe=B[0].canonical,ce=new o.aa(oe.x+B[0].wrap*(1<<oe.z),oe.y,oe.z);G.setDepthMode(ki.disabled),G.setStencilMode(Ui.disabled),G.setColorMode(F.colorModeForRenderPass()),F.setCustomLayerDefaults(),re.call(Z,G.gl,ce),G.setDirty(),F.setBaseState()}return}F.setCustomLayerDefaults(),G.setColorMode(F.colorModeForRenderPass()),G.setStencilMode(Ui.disabled);const Y=Z.renderingMode==="3d"?new ki(F.context.gl.LEQUAL,ki.ReadWrite,F.depthRangeFor3D):F.depthModeForSublayer(0,ki.ReadOnly);if(G.setDepthMode(Y),F.transform.projection.name==="globe"){const re=F.transform.pointMerc;Z.render(G.gl,F.transform.customLayerMatrix(),F.transform.getProjection(),F.transform.globeToMercatorMatrix(),o.ae(F.transform.zoom),[re.x,re.y],F.transform.pixelsPerMeterRatio)}else Z.render(G.gl,F.transform.customLayerMatrix());G.setDirty(),F.setBaseState(),G.bindFramebuffer.set(null)}}else o.w("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")},model:function(F,t,l,B){if(F.renderPass==="opaque")return;const G=l.paint.get("model-opacity").constantOr(1);if(G===0)return;const Z=l.paint.get("model-cast-shadows");
2668if(F.renderPass==="shadow"&&(!Z||F.terrain&&G<.65&&l._transitionablePaint._values["model-opacity"].value.expression instanceof o.a9))return;const Y=F.shadowRenderer,re=l.paint.get("model-receive-shadows");Y&&(Y.useNormalOffset=!0,re||(Y.enabled=!1));const oe=()=>{Y&&(Y.useNormalOffset=!0,re||(Y.enabled=!0))},ce=t.getSource();if(F.renderPass==="light-beam"&&ce.type!=="batched-model")return;if(ce.type==="vector"||ce.type==="geojson")return function(Fe,Ge,Xe,Ze,nt){const Qe=Fe.transform;if(Qe.projection.name!=="mercator")return void o.w(`Drawing 3D models for ${Qe.projection.name} projection is not yet implemented`);const it=Qe.getFreeCameraOptions().position;if(!Fe.modelManager)return;const Ke=Fe.modelManager;Xe.modelManager=Ke;const ht=Fe.shadowRenderer;if(!Xe._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const yt=Xe._unevaluatedLayout._values["model-id"],Nt=Object.assign({},Xe.layout.get("model-id").parameters),Dt=Fe.style.order.indexOf(Xe.fqid);for(const Wt of Ze){const $t=Ge.getTile(Wt).getBucket(Xe);if(!$t||$t.projection.name!==Qe.projection.name)continue;const At=$t.getModelUris();At&&!$t.modelsRequested&&(Ke.addModelsFromBucket(At,nt),$t.modelsRequested=!0);const Vt=Mc(Wt,Qe);Nt.zoom=Vt;const ii=yt.possiblyEvaluate(Nt);if(Zs(Fe,$t,Wt),Wn.shadowUniformsInitialized=!1,Wn.useSingleShadowCascade=!!ht&&ht.getMaxCascadeForTile(Wt.toUnwrapped())===0,Fe.renderPass==="shadow"&&ht){if(Fe.currentShadowCascade===1&&$t.isInsideFirstShadowMapFrustum)continue;const Ut=Qe.calculatePosMatrix(Wt.toUnwrapped(),Qe.worldSize);if(Wn.tileMatrix.set(Ut),Wn.shadowTileMatrix=Float32Array.from(ht.calculateShadowPassMatrixFromMatrix(Ut)),Wn.aabb.min.fill(0),Wn.aabb.max[0]=Wn.aabb.max[1]=o.ag,Wn.aabb.max[2]=0,eu($t,Wn,Fe,Xe.scope))continue}const Et=1<<Wt.canonical.z,Jt=[((it.x-Wt.wrap)*Et-Wt.canonical.x)*o.ag,(it.y*Et-Wt.canonical.y)*o.ag,it.z*Et*o.ag];Fe.conflationActive&&Object.keys($t.instancesPerModel).length>0&&Fe.style.isLayerClipped(Xe,Ge.getSource())&&$t.updateReplacement(Wt,Fe.replacementSource,Dt,nt)&&($t.uploaded=!1,$t.upload(Fe.context));for(let Ut in $t.instancesPerModel){const hi=$t.instancesPerModel[Ut];hi.features.length>0&&(Ut=ii.evaluate(hi.features[0].feature,{}));const Qt=Ke.getModel(Ut,nt);if(Qt&&Qt.uploaded)for(const Xt of Qt.nodes)Sl(Fe,Xe,Xt,hi,Jt,Wt,Wn)}}}(F,t,l,B,ce.type==="vector"?l.scope:""),void oe();if(!ce.loaded())return;if(ce.type==="batched-model")return function(Fe,Ge,Xe,Ze){Xe.resetLayerRenderingStats(Fe);const nt=Fe.context,Qe=Fe.transform,it=Fe.style.fog,Ke=Fe.shadowRenderer;if(Qe.projection.name!=="mercator")return void o.w(`Drawing 3D landmark models for ${Qe.projection.name} projection is not yet implemented`);const ht=Fe.transform.getFreeCameraOptions().position,yt=o.ab.vec3.scale([],[ht.x,ht.y,ht.z],Fe.transform.worldSize),Nt=o.ab.vec3.negate([],yt),Dt=o.ab.mat4.identity([]),Wt=o.dj(Qe.center.lat,Qe.zoom),$t=o.ab.mat4.fromScaling([],[1,1,1/Wt]);o.ab.mat4.translate(Dt,Dt,Nt);const At=Xe.paint.get("model-opacity").constantOr(1),Vt=new ki(nt.gl.LEQUAL,ki.ReadWrite,Fe.depthRangeFor3D),ii=new ki(nt.gl.LEQUAL,ki.ReadOnly,Fe.depthRangeFor3D),Et=new o.cd([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),Jt=Fe.renderPass==="shadow",Ut=Jt&&Ke?Ke.getCurrentCascadeFrustum():Qe.getFrustum(Qe.scaleZoom(Qe.worldSize)),hi=Xe.paint.get("model-front-cutoff"),Qt=hi[2]<1,Xt=Ta(Fe,Xe.paint.get("model-cutoff-fade-range")),ri=Xe.getLayerRenderingStats();(function(ci,xi,Si,Vi){const Ci=ci.terrain?ci.terrain.exaggeration():0,Ri=ci.transform.zoom;for(const Hi of Vi){const cr=xi.getTile(Hi).getBucket(Si);cr&&(ci.conflationActive&&cr.updateReplacement(Hi,ci.replacementSource),cr.evaluateScale(ci,Si),ci.terrain&&Ci>0&&cr.elevationUpdate(ci.terrain,Ci,Hi,Si.source),cr.needsReEvaluation(ci,Ri,Si)&&cr.evaluate(Si))}})(Fe,Ge,Xe,Ze),function(){let ci,xi,Si;Qt?(ci=Ze.length-1,xi=-1,Si=-1):(ci=0,xi=Ze.length,Si=1);const Vi=new Float64Array(16),Ci=o.ab.vec3.create(),Ri=new o.P(0,0);for(let Hi=ci;Hi!==xi;Hi+=Si){const cr=Ze[Hi],Cr=Ge.getTile(cr).getBucket(Xe);if(!Cr||!Cr.uploaded)continue;let Yr=!1;Ke&&(Yr=Ke.getMaxCascadeForTile(cr.toUnwrapped())===0);const Ur=Qe.calculatePosMatrix(cr.toUnwrapped(),Qe.worldSize),Zi=Cr.modelTraits;!Jt&&Qt&&(o.ab.mat4.invert(Vi,Ur),o.ab.vec3.transformMat4(Ci,yt,Vi),Ri.x=Ci[0],Ri.y=Ci[1]);const fr=[];
2668for(const Pi of Cr.getNodesInfo()){if(Pi.hiddenByReplacement||!Pi.node.meshes)continue;const ar=Pi.node;let br=0;Fe.terrain&&ar.elevation&&(br=ar.elevation*Fe.terrain.exaggeration());const Er=(()=>{const ur=Pi.aabb;return Et.min=[...ur.min],Et.max=[...ur.max],Et.min[2]+=br,Et.max[2]+=br,o.ab.vec3.transformMat4(Et.min,Et.min,Ur),o.ab.vec3.transformMat4(Et.max,Et.max,Ur),Et})(),Zr=Pi.evaluatedScale;if(Zr[0]<=1&&Zr[1]<=1&&Zr[2]<=1&&Er.intersects(Ut)===0)continue;if(!Jt&&Qt){const ur=.16666666666666666;Pi.cameraCollisionOpacity=yt[0]>Er.min[0]&&yt[0]<Er.max[0]&&yt[1]>Er.min[1]&&yt[1]<Er.max[1]&&yt[2]*Wt<Er.max[2]&&ar.footprint&&o.bA(Ri,ar.footprint)?Math.max(Pi.cameraCollisionOpacity-ur,0):Math.min(1,Pi.cameraCollisionOpacity+ur)}const Cn=[...Ur],xn=ar.anchor?ar.anchor[0]:0,bn=ar.anchor?ar.anchor[1]:0;o.ab.mat4.translate(Cn,Cn,[xn*(Zr[0]-1),bn*(Zr[1]-1),br]),o.ab.vec3.exactEquals(Zr,o.dm)||o.ab.mat4.scale(Cn,Cn,Zr);const xs=o.ab.mat4.multiply([],Cn,ar.matrix),Zn=o.ab.mat4.multiply([],Qe.expandedFarZProjMatrix,xs),Xr=o.ab.mat4.multiply([],Qe.expandedFarZProjMatrix,Cn),Or=o.ab.vec4.transformMat4([],[xn,bn,br,1],Zn)[2];ar.hidden=!1;let zr=At;Jt||(Qt&&(zr*=Pi.cameraCollisionOpacity,zr*=tu(Cn,Qe,Pi.aabb,hi)),zr*=to(Xt,Or)),zr!==0?fr.push({nodeInfo:Pi,depth:Or,opacity:zr,wvpForNode:Zn,wvpForTile:Xr,nodeModelMatrix:xs,tileModelMatrix:Cn}):ar.hidden=!0}Jt||fr.sort((Pi,ar)=>!Qt||Pi.opacity===1&&ar.opacity===1?Pi.depth<ar.depth?-1:1:Pi.opacity===1?-1:ar.opacity===1?1:Pi.depth>ar.depth?-1:1);for(const Pi of fr){const ar=Pi.nodeInfo,br=ar.node;let Er=o.ab.mat4.multiply([],$t,Pi.tileModelMatrix);o.ab.mat4.multiply(Er,Dt,Er);const Zr=o.ab.mat4.invert([],Er);o.ab.mat4.transpose(Zr,Zr),o.ab.mat4.scale(Zr,Zr,Qh),Er=o.ab.mat4.multiply(Er,Er,br.matrix);const Cn=Fe.renderPass==="light-beam",xn=Xe.paint.get("model-color-use-theme").constantOr("default")==="none",bn=Zi&o.dp.HasMapboxMeshFeatures,xs=bn?0:ar.evaluatedRMEA[0][2];for(let Zn=0;Zn<br.meshes.length;++Zn){const Xr=br.meshes[Zn],Or=Zn===br.lightMeshIndex;let zr=Pi.wvpForNode;if(Or){if(!Cn&&!Fe.terrain&&Fe.shadowRenderer){Fe.currentLayer<Fe.firstLightBeamLayer&&(Fe.firstLightBeamLayer=Fe.currentLayer);continue}zr=Pi.wvpForTile}else if(Cn)continue;const ur={defines:[]},hn=[];if(!Jt&&Ke&&(Ke.useNormalOffset=!!Xr.normalBuffer),Co(ur.defines,hn,Xr,Fe,xn?null:Xe.lut),bn||ur.defines.push("DIFFUSE_SHADED"),Yr&&ur.defines.push("SHADOWS_SINGLE_CASCADE"),ri&&(Jt?ri.numRenderedVerticesInShadowPass+=Xr.vertexArray.length:ri.numRenderedVerticesInTransparentPass+=Xr.vertexArray.length),Jt){wl(Xr,Pi.nodeModelMatrix,Fe,Xe);continue}let In=null;if(it){const Ks=da(Pi.nodeModelMatrix,Fe.transform);if(In=new Float32Array(Ks),Qe.projection.name!=="globe"){const Is=Xr.aabb.min,bs=Xr.aabb.max,[oo,Qs]=it.getOpacityForBounds(Ks,Is[0],Is[1],bs[0],bs[1]);ur.overrideFog=oo>=ot||Qs>=ot}}const Fr=Xr.material;let Xn;Fr.occlusionTexture&&Fr.occlusionTexture.offsetScale&&(Xn=Fr.occlusionTexture.offsetScale,ur.defines.push("OCCLUSION_TEXTURE_TRANSFORM"));const Cs=Fe.getOrCreateProgram("model",ur);!Jt&&Ke&&Ke.setupShadowsFromMatrix(Pi.tileModelMatrix,Cs,Ke.useNormalOffset),Fe.uploadCommonUniforms(nt,Cs,null,In);const ms=Fr.pbrMetallicRoughness;ms.metallicFactor=.9,ms.roughnessFactor=.5;const hs=_l(new Float32Array(zr),new Float32Array(Er),new Float32Array(Zr),new Float32Array(br.matrix),Fe,Pi.opacity,ms.baseColorFactor.toRenderColor(null),Fr.emissiveFactor,ms.metallicFactor,ms.roughnessFactor,Fr,xs,Xe,[0,0,0],Xn);!Or&&(ar.hasTranslucentParts||Pi.opacity<1)&&Cs.draw(Fe,nt.gl.TRIANGLES,Vt,Ui.disabled,ir.disabled,qi.backCCW,hs,Xe.id,Xr.vertexBuffer,Xr.indexBuffer,Xr.segments,Xe.paint,Fe.transform.zoom,void 0,hn),Cs.draw(Fe,nt.gl.TRIANGLES,Or?ii:Vt,Ui.disabled,Or||Pi.opacity<1||ar.hasTranslucentParts?ir.alphaBlended:ir.unblended,qi.backCCW,hs,Xe.id,Xr.vertexBuffer,Xr.indexBuffer,Xr.segments,Xe.paint,Fe.transform.zoom,void 0,hn)}}}}()}(F,t,l,B),void oe();if(ce.type!=="model")return;const he=ce.getModels(),pe=[],fe=F.transform.getFreeCameraOptions().position,be=o.ab.vec3.scale([],[fe.x,fe.y,fe.z],F.transform.worldSize);o.ab.vec3.negate(be,be);const ze=[],De=[];let Oe=0;for(const Fe of he){const Ge=l.paint.get("model-rotation").constantOr(null),Xe=l.paint.get("model-scale").constantOr(null),Ze=l.paint.get("model-translation").constantOr(null);Fe.computeModelMatrix(F,Ge,Xe,Ze,!0,!0,!1);const nt=o.ab.mat4.identity([]),Qe=o.dj(Fe.position.lat,F.transform.zoom),it=o.ab.mat4.fromScaling([],[1,1,1/Qe]);o.ab.mat4.translate(nt,nt,be),pe.push({zScaleMatrix:it,negCameraPosMatrix:nt});for(const Ke of Fe.nodes)Ac(F.transform,Ke,Fe.matrix,F.transform.expandedFarZProjMatrix,Oe,ze,De);Oe++}if(ze.sort((Fe,Ge)=>Ge.depth-Fe.depth),F.renderPass!=="shadow"){if(G===1)for(const Fe of De)pa(Fe,F,l,pe[Fe.modelIndex],Ui.disabled,F.colorModeForRenderPass());else{for(const Fe of De)pa(Fe,F,l,pe[Fe.modelIndex],Ui.disabled,ir.disabled);for(const Fe of De)pa(Fe,F,l,pe[Fe.modelIndex],F.stencilModeFor3D(),F.colorModeForRenderPass());F.resetStencilClippingMasks()}for(const Fe of ze)pa(Fe,F,l,pe[Fe.modelIndex],Ui.disabled,F.colorModeForRenderPass());oe()}else{for(const Fe of De)wl(Fe.mesh,Fe.nodeModelMatrix,F,l);for(const Fe of ze)wl(Fe.mesh,Fe.nodeModelMatrix,F,l);oe()}}},Al={line:function(F,t,l){if(F.hasElevatedBuckets=!1,F.hasNonElevatedBuckets=!1,F._unevaluatedLayout.getValue("line-elevation-reference")!==void 0||F._unevaluatedLayout.getValue("line-z-offset")!==void 0){if(t){const B=t.getVisibleCoordinates();for(const G of B){const Z=t.getTile(G).getBucket(F);if(Z&&(Z.hasZOffset?F.hasElevatedBuckets=!0:F.hasNonElevatedBuckets=!0,F.hasElevatedBuckets&&F.hasNonElevatedBuckets))break}}}else F.hasNonElevatedBuckets=!0},model:function(F,t,l){const B=t.getSource();if(!B.loaded())return;if(B.type==="vector"||B.type==="geojson")return void(l.modelManager&&l.modelManager.upload(l,B.type==="vector"?F.scope:""));if(B.type==="batched-model"||B.type!=="model")return;const G=B.getModels();for(const Z of G)Z.upload(l.context)},raster:function(F,t,l){const B=t.getSource();if(!(B instanceof Tn&&B.loaded()))return;const G=F.sourceLayer||B.rasterLayerIds&&B.rasterLayerIds[0];if(!G)return;const Z=F.paint.get("raster-array-band")||B.getInitialBand(G);if(Z==null)return;const Y=t.getIds().map(re=>t.getTileByID(re));for(const re of Y)re.updateNeeded(G,Z)&&B.prepareTile(re,G,Z)},"raster-particle":function(F,t,l){const B=t.getSource();if(!(B instanceof Tn&&B.loaded()))return;const G=F.sourceLayer||B.rasterLayerIds&&B.rasterLayerIds[0];if(!G)return;const Z=F.paint.get("raster-particle-array-band")||B.getInitialBand(G);if(Z==null)return;const Y=t.getIds().map(re=>t.getTileByID(re));for(const re of Y)re.updateNeeded(G,Z)&&B.prepareTile(re,G,Z)}};class cu{constructor(t,l,B,G,Z){this.context=new Zh(t,l),this.transform=B,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.tp=Z,this._timeStamp=o.q.now(),this._averageFPS=0,this._fpsHistory=[],this._dt=0,this._debugParams={forceEnablePrecipitation:!1,showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const Y=["fill","line","symbol","circle","heatmap","fill-extrusion","raster","raster-particle","hillshade","model","background","sky"];for(const oe of Y)this._debugParams.enabledLayers[oe]=!0;Z.registerParameter(this._debugParams,["Terrain"],"showTerrainProxyTiles",{},()=>{this.style.map.triggerRepaint()}),Z.registerParameter(this._debugParams,["Precipitation"],"forceEnablePrecipitation"),Z.registerParameter(this._debugParams,["FPS"],"fpsWindow",{min:1,max:100,step:1}),Z.registerBinding(this._debugParams,["FPS"],"continousRedraw",{readonly:!0,label:"continuous redraw"}),Z.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"value"}),Z.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"graph",view:"graph",min:0,max:200});for(const oe of Y)Z.registerParameter(this._debugParams.enabledLayers,["Debug","Layers"],oe);this.occlusionParams=new Pc(Z),this.setup(),this.numSublayers=Es.maxUnderzooming+Es.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new o.dv,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new qa(this),this._wireframeDebugCache=new iu,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const re=new o.r({width:1,height:1},Uint8Array.of(0,0,0,0));
vendor: 5,171 bytes, line 2668
2668this.emptyDepthTexture=new o.T(this.context,re,t.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=G}updateTerrain(t,l){const B=!!t&&!!t.terrain&&this.transform.projection.supportsTerrain;if(!(B||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new xo(this,t));const G=this._terrain;this.transform.elevation=B?G:null,G.update(t,this.transform,l),this.transform.elevation&&!G.enabled&&(this.transform.elevation=null)}_updateFog(t){const l=t.fog;if(!l||this.transform.projection.name==="globe"||l.getOpacity(this.transform.pitch)<1||l.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[B,G]=l.getFovAdjustedRange(this.transform._fov);if(B>G)return void(this.transform.fogCullDistSq=null);const Z=B+.78*(G-B);this.transform.fogCullDistSq=Z*Z}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(t){t&&!this._terrain&&(this._terrain=new xo(this,this.style)),this._forceTerrainMode=t}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(t,l){if(this.width=t*o.q.devicePixelRatio,this.height=l*o.q.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const B of this.style.order)this.style._mergedLayers[B].resize()}setup(){const t=this.context,l=new o.b4;l.emplaceBack(0,0),l.emplaceBack(o.ag,0),l.emplaceBack(0,o.ag),l.emplaceBack(o.ag,o.ag),this.tileExtentBuffer=t.createVertexBuffer(l,o.b6.members),this.tileExtentSegments=o.b7.simpleSegment(0,0,4,2);const B=new o.b4;B.emplaceBack(0,0),B.emplaceBack(o.ag,0),B.emplaceBack(0,o.ag),B.emplaceBack(o.ag,o.ag),this.debugBuffer=t.createVertexBuffer(B,o.b6.members),this.debugSegments=o.b7.simpleSegment(0,0,4,5);const G=new o.b4;G.emplaceBack(-1,-1),G.emplaceBack(1,-1),G.emplaceBack(-1,1),G.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(G,o.b6.members),this.viewportSegments=o.b7.simpleSegment(0,0,4,2);const Z=new o.aT;Z.emplaceBack(0,0,0,0),Z.emplaceBack(o.ag,0,o.ag,0),Z.emplaceBack(0,o.ag,0,o.ag),Z.emplaceBack(o.ag,o.ag,o.ag,o.ag),this.mercatorBoundsBuffer=t.createVertexBuffer(Z,o.b9.members),this.mercatorBoundsSegments=o.b7.simpleSegment(0,0,4,2);const Y=new o.aU;Y.emplaceBack(0,1,2),Y.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(Y);const re=new o.b5;for(const ce of[0,1,3,2,0])re.emplaceBack(ce);this.debugIndexBuffer=t.createIndexBuffer(re),this.emptyTexture=new o.T(t,new o.r({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA8),this.identityMat=o.ab.mat4.create();const oe=this.context.gl;this.stencilClearMode=new Ui({func:oe.ALWAYS,mask:0},0,255,oe.ZERO,oe.ZERO,oe.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(t){return t._makeTileBoundsBuffers(this.context,this.transform.projection),t._tileBoundsBuffer?{tileBoundsBuffer:t._tileBoundsBuffer,tileBoundsIndexBuffer:t._tileBoundsIndexBuffer,tileBoundsSegments:t._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,ki.disabled,this.stencilClearMode,ir.disabled,qi.disabled,fc(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(t,l,B){if(!l||this.currentStencilSource===l.id||!t.isTileClipped()||!B||B.length===0)return;if(this._tileClippingMaskIDs&&!this.terrain){let re=!1;for(const oe of B)if(this._tileClippingMaskIDs[oe.key]===void 0){re=!0;break}if(!re)return}this.currentStencilSource=l.id;const G=this.context,Z=G.gl;this.nextStencilID+B.length>256&&this.clearStencil(),G.setColorMode(ir.disabled),G.setDepthMode(ki.disabled);const Y=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const re of B){const oe=l.getTile(re),ce=this._tileClippingMaskIDs[re.key]=this.nextStencilID++,{tileBoundsBuffer:he,tileBoundsIndexBuffer:pe,tileBoundsSegments:fe}=this.getTileBoundsBuffers(oe);Y.draw(this,Z.TRIANGLES,ki.disabled,new Ui({func:Z.ALWAYS,mask:0},ce,255,Z.KEEP,Z.KEEP,Z.REPLACE),ir.disabled,qi.disabled,fc(re.projMatrix),"$clipping",he,pe,fe)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,l=this.context.gl;return new Ui({func:l.NOTEQUAL,mask:255},t,255,l.KEEP,l.KEEP,l.REPLACE)}stencilModeForClipping(t){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(t);const l=this.context.gl;return new Ui({func:l.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,l.KEEP,l.KEEP,l.REPLACE)}stencilConfigForOverlap(t){const l=this.context.gl,B=t.sort((Y,re)=>
2668re.overscaledZ-Y.overscaledZ),G=B[B.length-1].overscaledZ,Z=B[0].overscaledZ-G+1;if(Z>1){this.currentStencilSource=void 0,this.nextStencilID+Z>256&&this.clearStencil();const Y={};for(let re=0;re<Z;re++)Y[re+G]=new Ui({func:l.GEQUAL,mask:255},re+this.nextStencilID,255,l.KEEP,l.KEEP,l.REPLACE);return this.nextStencilID+=Z,[Y,B]}return[{[G]:Ui.disabled},B]}colorModeForRenderPass(){const t=this.context.gl;return this._showOverdrawInspector?new ir([t.CONSTANT_COLOR,t.ONE,t.CONSTANT_COLOR,t.ONE],new o.aj(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?ir.unblended:ir.alphaBlended}colorModeForDrapableLayerRenderPass(t){const l=this.context.gl;return this.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture&&this.renderPass==="translucent"?new ir([l.ONE,l.ONE_MINUS_SRC_ALPHA,l.CONSTANT_ALPHA,l.ONE_MINUS_SRC_ALPHA],new o.aj(0,0,0,t===void 0?0:t),[!0,!0,!0,!0]):this.colorModeForRenderPass()}depthModeForSublayer(t,l,B,G=!1){if(this.depthOcclusion)return new ki(this.context.gl.GREATER,ki.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!G)return ki.disabled;const Z=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new ki(B||this.context.gl.LEQUAL,l,[Z,Z])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}blitDepth(){const t=this.context.gl,l=Math.ceil(this.width),B=Math.ceil(this.height),G=this.context.bindFramebuffer.get(),Z=t.getParameter(t.TEXTURE_BINDING_2D);this.depthFBO&&this.depthFBO.width===l&&this.depthFBO.height===B||(this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),l!==0&&B!==0&&(this.depthFBO=new Wh(this.context,l,B,!1,"texture"),this.depthTexture=new o.T(this.context,{width:l,height:B,data:null},t.DEPTH24_STENCIL8),this.depthFBO.depthAttachment.set(this.depthTexture.texture))),this.context.bindFramebuffer.set(G),t.bindTexture(t.TEXTURE_2D,Z),this.depthFBO&&(t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,this.depthFBO.framebuffer),t.blitFramebuffer(0,0,l,B,0,0,l,B,t.DEPTH_BUFFER_BIT,t.NEAREST),t.bindFramebuffer(t.FRAMEBUFFER,this.context.bindFramebuffer.current))}updateAverageFPS(){this._fpsHistory.push(this._dt===0?0:1e3/this._dt),this._fpsHistory.length>this._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce((t,l)=>t+l/this._fpsHistory.length,0))}render(t,l){const B=o.q.now();this._dt=B-this._timeStamp,this._timeStamp=B,this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=t.map.repaint,this.style=t,this.options=l;const G=this.style._mergedLayers,Z=!(!this.terrain||!this.terrain.enabled),Y=()=>this.style._getOrder(Z).filter(At=>{const Vt=G[At];return!(Vt.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[Vt.type]});let re=Y(),oe=!1,ce=!1;for(const At of re){const Vt=G[At];Vt.type==="circle"&&(oe=!0),Vt.type==="symbol"&&(Vt.hasInitialOcclusionOpacityProperties?ce=!0:oe=!0)}let he=re.map(At=>G[At]);const pe=this.style._mergedSourceCaches;this.imageManager=t.imageManager,this.modelManager=t.modelManager,this.symbolFadeChange=t.placement.symbolFadeChange(o.q.now()),this.imageManager.beginFrame();let fe=0,be=!1;for(const At in pe){const Vt=pe[At];Vt.used&&(Vt.prepare(this.context),Vt.getSource().usedInConflation&&++fe)}let ze=!1;for(const At of he)At.isHidden(this.transform.zoom)||(At.type==="clip"&&(ze=!0),this.prepareLayer(At));const De={},Oe={},Fe={},Ge={},Xe={};for(const At in pe){const Vt=pe[At];De[At]=Vt.getVisibleCoordinates(),Oe[At]=De[At].slice().reverse(),Fe[At]=Vt.getVisibleCoordinates(!0).reverse(),Ge[At]=Vt.getShadowCasterCoordinates(),Xe[At]=Vt.sortCoordinatesByDistance(De[At])}const Ze=At=>{const Vt=this.style.getLayerSourceCache(At);return Vt&&Vt.used?Vt.getSource():null};if(fe||ze||this._clippingActiveLastFrame){const At=[],Vt=[];let ii=0;for(const Et of he)this.isSourceForClippingOrConflation(Et,Ze(Et))&&(At.push(Et),Vt.push(ii)),ii++;if(At&&(ze||At.length>1)||this._clippingActiveLastFrame){ze=!1;const Et=[];for(let Jt=0;Jt<At.length;Jt++){const Ut=At[Jt],hi=Vt[Jt],Qt=this.style.getLayerSourceCache(Ut);if(!Qt||!Qt.used||!Qt.getSource().usedInConflation&&Ut.type!=="clip")continue;let Xt=o.dx,ri=o.by.None;const ci=[];let xi=!0;if(Ut.type==="clip"){Xt=hi;
vendor: 4,489 bytes, line 2668
2668for(const Si of Ut.layout.get("clip-layer-types"))ri|=Si==="model"?o.by.Model:Si==="symbol"?o.by.Symbol:o.by.FillExtrusion;for(const Si of Ut.layout.get("clip-layer-scope"))ci.push(Si);Ut.isHidden(this.transform.zoom)?xi=!1:ze=!0}xi&&Et.push({layer:Ut.fqid,cache:Qt,order:Xt,clipMask:ri,clipScope:ci})}this.replacementSource.setSources(Et),be=!0}}this._clippingActiveLastFrame=ze,be||this.replacementSource.clear(),this.conflationActive=be,this.minCutoffZoom=0,this.longestCutoffRange=0,this.opaquePassCutoff=1/0,this._lastOcclusionLayer=-1,this.layersWithOcclusionOpacity=[];for(let At=0;At<he.length;At++){const Vt=he[At],ii=Vt.cutoffRange();if(this.longestCutoffRange=Math.max(ii,this.longestCutoffRange),ii>0){const Et=Ze(Vt);Et&&(this.minCutoffZoom=Math.max(Et.minzoom,this.minCutoffZoom)),Vt.minzoom&&(this.minCutoffZoom=Math.max(Vt.minzoom,this.minCutoffZoom))}Vt.is3D()&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=At),this._lastOcclusionLayer=At)}const nt=this.style&&this.style.fog;nt?(this._fogVisible=nt.getOpacity(this.transform.pitch)!==0,this._fogVisible&&this.transform.projection.name!=="globe"&&(this._fogVisible=nt.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(Fe),this.opaquePassCutoff=0,re=Y(),he=re.map(At=>G[At]));const Qe=this._shadowRenderer;if(Qe){Qe.updateShadowParameters(this.transform,this.style.directionalLight);for(const At in pe)for(const Vt of De[At]){let ii={min:0,max:0};this.terrain&&(ii=this.terrain.getMinMaxForTile(Vt)||ii),Qe.addShadowReceiver(Vt.toUnwrapped(),ii.min,ii.max)}}this.transform.projection.name!=="globe"||this.globeSharedBuffers||(this.globeSharedBuffers=new o.dw(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new Pd(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);const it=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.snow),Ke=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.rain);if(it&&!this._snow&&(this._snow=new lu(this)),!it&&this._snow&&(this._snow.destroy(),delete this._snow),Ke&&!this._rain&&(this._rain=new Io(this)),!Ke&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),!pn.has(this.context.gl))return;this.renderPass="offscreen";for(const At of he){const Vt=t.getLayerSourceCache(At);if(!At.hasOffscreenPass()||At.isHidden(this.transform.zoom))continue;const ii=Vt?Oe[Vt.id]:void 0;(At.type==="custom"||At.type==="raster"||At.type==="raster-particle"||At.isSky()||ii&&ii.length)&&this.renderLayer(this,Vt,At,ii)}this.depthRangeFor3D=[0,1-(he.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,Ge)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const ht=this.transform.projection.name==="globe"||this.transform.isHorizonVisible(),yt=(()=>{if(l.showOverdrawInspector)return o.aj.black;const At=this.style.fog;if(At&&this.transform.projection.supportsFog){const Vt=this.style.getLut(At.scope);if(!ht){const ii=At.properties.get("color-use-theme")==="none",Et=At.properties.get("color").toRenderColor(ii?null:Vt).toArray01();return new o.aj(...Et)}if(ht){const ii=At.properties.get("space-color-use-theme")==="none",Et=At.properties.get("space-color").toRenderColor(ii?null:Vt).toArray01();return new o.aj(...Et)}}return o.aj.transparent})();if(this.context.clear({color:yt,depth:1}),this.clearStencil(),this._showOverdrawInspector=l.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&ht&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=re.length-1;this.currentLayer>=0;this.currentLayer--){const At=he[this.currentLayer],Vt=t.getLayerSourceCache(At);if(At.isSky())continue;const ii=Vt?(At.is3D()?Xe:Oe)[Vt.id]:void 0;this._renderTileClippingMasks(At,Vt,ii),this.renderLayer(this,Vt,At,ii)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&ht&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||o.ae(this.transform.zoom)>0)&&(this.transform.projection.name==="globe"||this.transform.isH
2668orizonVisible()))for(this.currentLayer=0;this.currentLayer<re.length;this.currentLayer++){const At=he[this.currentLayer],Vt=t.getLayerSourceCache(At);At.isSky()&&this.renderLayer(this,Vt,At,Vt?Oe[Vt.id]:void 0)}function Nt(At,Vt){let ii;return Vt&&(ii=(At.type==="symbol"?Fe:At.is3D()?Xe:Oe)[Vt.id]),ii}if(this.renderPass="translucent",this.transform.projection.name==="globe"){for(this.renderElevatedRasterBackface=!0,this.currentLayer=0;this.currentLayer<re.length;){const At=he[this.currentLayer];if(At.type==="raster"||At.type==="raster-particle"){const Vt=t.getLayerSourceCache(At);this.renderLayer(this,Vt,At,Nt(At,Vt))}++this.currentLayer}this.renderElevatedRasterBackface=!1}this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;let Dt=0;Qe&&(Dt=Qe.getShadowCastingLayerCount());let Wt=!1,$t=-1;for(let At=0;At<re.length;++At){const Vt=he[At];Vt.isHidden(this.transform.zoom)||Vt.is3D()&&($t=At)}for(ce&&$t===-1&&(oe=!0);this.currentLayer<re.length;){const At=he[this.currentLayer],Vt=t.getLayerSourceCache(At);if(At.isSky())++this.currentLayer;else if(this.terrain&&this.style.isLayerDraped(At)){if(At.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer),this._lastOcclusionLayer=Math.max(this.currentLayer,this._lastOcclusionLayer)}else{if(oe&&!Wt&&this.terrain&&!this.transform.isOrthographic&&(Wt=!0,this.blitDepth()),ce&&$t!==-1&&this.currentLayer===$t+1&&!this.transform.isOrthographic&&this.blitDepth(),At.is3D()||this.terrain||this._renderTileClippingMasks(At,Vt,Vt?De[Vt.id]:void 0),this.renderLayer(this,Vt,At,Nt(At,Vt)),!this.terrain&&Qe&&Dt>0&&At.hasShadowPass()&&--Dt==0&&(Qe.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer)){const ii=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=ii;this.currentLayer++){const Et=he[this.currentLayer];if(!Et.hasLightBeamPass())continue;const Jt=t.getLayerSourceCache(Et);this.renderLayer(this,Jt,Et,Jt?Oe[Jt.id]:void 0)}this.currentLayer=ii,this.renderPass="translucent"}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const ii=this.currentLayer;this.depthOcclusion=!0;for(const Et of this.layersWithOcclusionOpacity){this.currentLayer=Et;const Jt=he[this.currentLayer],Ut=t.getLayerSourceCache(Jt),hi=Ut?Oe[Ut.id]:void 0;Jt.is3D()||this.terrain||this._renderTileClippingMasks(Jt,Ut,Ut?De[Ut.id]:void 0),this.renderLayer(this,Ut,Jt,hi)}this.depthOcclusion=!1,this.currentLayer=ii,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 At=null;he.forEach(Vt=>{const ii=t.getLayerSourceCache(Vt);ii&&!Vt.isHidden(this.transform.zoom)&&ii.getVisibleCoordinates().length&&(!At||At.getSource().maxzoom<ii.getSource().maxzoom)&&(At=ii)}),At&&this.options.showTileBoundaries&&El.debug(this,At,At.getVisibleCoordinates(),o.aj.red,!1,this.options.showParseStatus)}this.terrain&&this._debugParams.showTerrainProxyTiles&&El.debug(this,this.terrain.proxySourceCache,this.terrain.proxyCoords,new o.aj(1,.8,.1,1),!0,this.options.showParseStatus),this.options.showPadding&&function(At){const Vt=At.transform.padding;Jh(At,At.transform.height-(Vt.top||0),3,Po),Jh(At,Vt.bottom||0,3,nf),Kh(At,Vt.left||0,3,sf),Kh(At,At.transform.width-(Vt.right||0),3,Ad);const ii=At.transform.centerPoint;(function(Et,Jt,Ut,hi){eo(Et,Jt-1,Ut-10,2,20,hi),eo(Et,Jt-10,Ut-1,20,2,hi)})(At,ii.x,At.transform.height-ii.y,Tc)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(performance.now()),this.saveC
2668anvasCopy()),be||(this.conflationActive=!1)}prepareLayer(t){this.gpuTimingStart(t);const{unsupportedLayers:l}=this.transform.projection,B=!l||!l.includes(t.type);if(Al[t.type]&&(B||this.terrain&&t.type==="custom")){const G=this.style.getLayerSourceCache(t);Al[t.type](t,G,this)}this.gpuTimingEnd()}renderLayer(t,l,B,G){B.isHidden(this.transform.zoom)||(B.type==="background"||B.type==="sky"||B.type==="custom"||B.type==="model"||B.type==="raster"||B.type==="raster-particle"||G&&G.length)&&(this.id=B.id,this.gpuTimingStart(B),t.transform.projection.unsupportedLayers&&t.transform.projection.unsupportedLayers.includes(B.type)&&(!t.terrain||B.type!=="custom")||B.type==="clip"||El[B.type](t,l,B,G,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(t){if(!this.options.gpuTiming)return;const l=this.context.extTimerQuery,B=this.context.gl;let G=this.gpuTimers[t.id];G||(G=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:B.createQuery()}),G.calls++,B.beginQuery(l.TIME_ELAPSED_EXT,G.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const t=this.context.extTimerQuery,l=this.context.gl,B=l.createQuery();this.deferredRenderGpuTimeQueries.push(B),l.beginQuery(t.TIME_ELAPSED_EXT,B)}}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 t=this.gpuTimers;return this.gpuTimers={},t}collectDeferredRenderGpuQueries(){const t=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],t}queryGpuTimers(t){const l={};for(const B in t){const G=t[B],Z=this.context.extTimerQuery,Y=Z.getQueryParameter(G.query,this.context.gl.QUERY_RESULT)/1e6;Z.deleteQueryEXT(G.query),l[B]=Y}return l}queryGpuTimeDeferredRender(t){if(!this.options.gpuTimingDeferredRender)return 0;const l=this.context.gl;let B=0;for(const G of t)B+=l.getQueryParameter(G,l.QUERY_RESULT)/1e6,l.deleteQuery(G);return B}translatePosMatrix(t,l,B,G,Z){if(!B[0]&&!B[1])return t;const Y=Z?G==="map"?this.transform.angle:0:G==="viewport"?-this.transform.angle:0;if(Y){const ce=Math.sin(Y),he=Math.cos(Y);B=[B[0]*he-B[1]*ce,B[0]*ce+B[1]*he]}const re=[Z?B[0]:o.ar(l,B[0],this.transform.zoom),Z?B[1]:o.ar(l,B[1],this.transform.zoom),0],oe=new Float32Array(16);return o.ab.mat4.translate(oe,t,re),oe}saveTileTexture(t){const l=t.size[0],B=this._tileTextures[l];B?B.push(t):this._tileTextures[l]=[t]}getTileTexture(t){const l=this._tileTextures[t];return l&&l.length>0?l.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return this.context.extTextureFloatLinear!=null}currentGlobalDefines(t,l,B){const G=B===void 0?this.terrain&&this.terrain.renderingToTexture:B,Z=[];return this.style&&this.style.enable3dLights()&&(t==="globeRaster"||t==="terrainRaster"?(Z.push("LIGHTING_3D_MODE"),Z.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):G||Z.push("LIGHTING_3D_MODE")),this.renderPass==="shadow"&&(this._shadowMapDebug||Z.push("DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(Z.push("TERRAIN"),this.linearFloatFilteringSupported()&&Z.push("TERRAIN_DEM_FLOAT_FORMAT")),this.transform.projection.name==="globe"&&Z.push("GLOBE"),!this._fogVisible||G||l!==void 0&&!l||Z.push("FOG","FOG_DITHERING"),G&&Z.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&Z.push("OVERDRAW_INSPECTOR"),Z}getOrCreateProgram(t,l){this.cache=this.cache||{};const B=l&&l.defines||[],G=l&&l.config,Z=this.currentGlobalDefines(t,l&&l.overrideFog,l&&l.overrideRtt).concat(B),Y=yd.cacheKey(go[t],t,Z,G);return this.cache[Y]||(this.cache[Y]=new yd(this.context,t,go[t],G,Hh[t],Z)),this.cache[Y]}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 t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new o.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.de
vendor: 39,887 bytes, line 2668
2668stroy(),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()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(t,l){if(this.style.enable3dLights()){const B=this.style.directionalLight,G=this.style.ambientLight;if(B&&G){const Z=((Y,re,oe)=>{const ce=Y.properties.get("direction"),he=Y.properties.get("color-use-theme")==="none",pe=Y.properties.get("color").toRenderColor(he?null:oe.getLut(Y.scope)).toArray01(),fe=Y.properties.get("intensity"),be=re.properties.get("color-use-theme")==="none",ze=re.properties.get("color").toRenderColor(be?null:oe.getLut(re.scope)).toArray01(),De=re.properties.get("intensity"),Oe=[ce.x,ce.y,ce.z],Fe=o.cM(ze,De),Ge=o.cM(pe,fe);return{u_lighting_ambient_color:Fe,u_lighting_directional_dir:Oe,u_lighting_directional_color:Ge,u_ground_radiance:Kp(Oe,Ge,Fe)}})(B,G,this.style);l.setLightsUniformValues(t,Z)}}}uploadCommonUniforms(t,l,B,G,Z){if(this.uploadCommonLightUniforms(t,l),this.terrain&&this.terrain.renderingToTexture)return;const Y=this.style.fog;if(Y){const re=Y.getOpacity(this.transform.pitch),oe=((ce,he,pe,fe,be,ze,De,Oe,Fe,Ge,Xe,Ze)=>{const nt=ce.transform,Qe=he.properties.get("color-use-theme")==="none",it=he.properties.get("color").toRenderColor(Qe?null:ce.style.getLut(he.scope)).toArray01();it[3]=fe;const Ke=ce.frameCounter/1e3%1,[ht,yt]=he.properties.get("vertical-range");return{u_fog_matrix:pe?nt.calculateFogTileMatrix(pe):Ze||ce.identityMat,u_fog_range:he.getFovAdjustedRange(nt._fov),u_fog_color:it,u_fog_horizon_blend:he.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(ht,yt),yt],u_fog_temporal_offset:Ke,u_frustum_tl:be,u_frustum_tr:ze,u_frustum_br:De,u_frustum_bl:Oe,u_globe_pos:Fe,u_globe_radius:Ge,u_viewport:Xe,u_globe_transition:o.ae(nt.zoom),u_is_globe:+(nt.projection.name==="globe")}})(this,Y,B,re,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*o.q.devicePixelRatio,this.transform.height*o.q.devicePixelRatio],G);l.setFogUniformValues(t,oe)}Z&&l.setCutoffUniformValues(t,Z.uniformValues)}setTileLoadedFlag(t){this.tileLoaded=t}saveCanvasCopy(){const t=this.canvasCopy();t&&(this.frameCopies.push(t),this.tileLoaded=!1)}canvasCopy(){const t=this.context.gl,l=t.createTexture();return t.bindTexture(t.TEXTURE_2D,l),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,t.drawingBufferWidth,t.drawingBufferHeight,0),l}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const t=this.style&&this.style.fog;return!!t&&t.getOpacity(this.transform.pitch)!==0}getBackgroundTiles(){const t=this._backgroundTiles,l=this._backgroundTiles={},B=this.transform.coveringTiles({tileSize:512});for(const G of B)l[G.key]=t[G.key]||new ba(G,512,this.transform.tileZoom,this);return l}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(t,l){return!(!t.is3D()||t.type!=="clip"&&(t.minzoom&&t.minzoom>this.transform.zoom||(this.style._clipLayerPresent||t.sourceLayer!=="building")&&(!l||l.type!=="batched-model")))}isTileAffectedByFog(t){if(!this.style||!this.style.fog)return!1;if(this.transform.projection.name==="globe")return!0;let l=this._cachedTileFogOpacities[t.key];return l||(this._cachedTileFogOpacities[t.key]=l=this.style.fog.getOpacityForTile(t)),l[0]>=ot||l[1]>=ot}setupDepthForOcclusion(t,l,B){const G=this.context,Z=G.gl,Y=!!B;var re;B||(B={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}),G.activeTexture.set(Z.TEXTURE3),t&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(Z.NEAREST,Z.CLAMP_TO_EDGE),B.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],B.u_depth_range_unpack=[2/((re=this.depthRangeFor3D)[1]-re[0]),-1-2*re[0]/(re[1]-re[0])],B.u_occluder_half_size=.5*this.occlusionParams.occluderSize,B.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(Z.NEAREST,Z.CLAMP_TO_EDGE),G.activeTexture.set(Z.TEXTURE0),Y||l.setTerrainUniformValues(G,B)}}function Dc(F,t){let l=!1,B=null;const G=()=>{B=null,l&&(F(),B=setTimeout(G,t),l=!1)};return()=>(l=!0,B||G(),B)}class Cd{constructor(t){this._hashName=t&&encodeURIComponent(t),o.aP(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Dc(this._updateHashUnthrottled.bind(this),300)}addTo(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),t.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 t=this._map;if(!t)return"";const l=hu(t);if(this._hashName){const B=this._hashName;let G=!1;const Z=location.hash.slice(1).split("&").map(Y=>{const re=Y.split("=")[0];return re===B?(G=!0,`${re}=${l}`):Y}).filter(Y=>Y);return G||Z.push(`${B}=${l}`),`#${Z.join("&")}`}return`#${l}`}_getCurrentHash(){const t=location.hash.replace("#","");if(this._hashName){let l;return t.split("&").map(B=>B.split("=")).forEach(B=>{B[0]===this._hashName&&(l=B)}),(l&&l[1]||"").split("/")}return t.split("/")}_onHashChange(){const t=this._map;if(!t)return!1;const l=this._getCurrentHash();if(l.length>=3&&!l.some(B=>isNaN(B))){const B=t.dragRotate.isEnabled()&&t.touchZoomRotate.isEnabled()?+(l[3]||0):t.getBearing();return t.jumpTo({center:[+l[2],+l[1]],zoom:+l[0],bearing:B,pitch:+(l[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()))}}function hu(F,t){const l=F.getCenter(),B=Math.round(100*F.getZoom())/100,G=Math.ceil((B*Math.LN2+Math.log(512/360/.5))/Math.LN10),Z=Math.pow(10,G),Y=Math.round(l.lng*Z)/Z,re=Math.round(l.lat*Z)/Z,oe=F.getBearing(),ce=F.getPitch();let he=t?`/${Y}/${re}/${B}`:`${B}/${re}/${Y}`;return(oe||ce)&&(he+="/"+Math.round(10*oe)/10),ce&&(he+=`/${Math.round(ce)}`),he}const Ml={linearity:.3,easing:o.dy(0,0,.3,1)},Id=o.l({deceleration:2500,maxSpeed:1400},Ml),Dd=o.l({deceleration:20,maxSpeed:1400},Ml),kd=o.l({deceleration:1e3,maxSpeed:360},Ml),Rd=o.l({deceleration:1e3,maxSpeed:90},Ml);class zd{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.q.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,l=o.q.now();for(;t.length>0&&l-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const l={zoom:0,bearing:0,pitch:0,pan:new o.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Z}of this._inertiaBuffer)l.zoom+=Z.zoomDelta||0,l.bearing+=Z.bearingDelta||0,l.pitch+=Z.pitchDelta||0,Z.panDelta&&l.pan._add(Z.panDelta),Z.around&&(l.around=Z.around),Z.pinchAround&&(l.pinchAround=Z.pinchAround);const B=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,G={};if(l.pan.mag()){const Z=Cl(l.pan.mag(),B,o.l({},Id,t||{}));G.offset=l.pan.mult(Z.amount/l.pan.mag()),G.center=this._map.transform.center,Pl(G,Z)}if(l.zoom){const Z=Cl(l.zoom,B,Dd);G.zoom=this._map.transform.zoom+Z.amount,Pl(G,Z)}if(l.bearing){const Z=Cl(l.bearing,B,kd);G.bearing=this._map.transform.bearing+o.aw(Z.amount,-179,179),Pl(G,Z)}if(l.pitch){const Z=Cl(l.pitch,B,Rd);G.pitch=this._map.transform.pitch+Z.amount,Pl(G,Z)}if(G.zoom||G.bearing){const Z=l.pinchAround===void 0?l.around:l.pinchAround;G.around=Z?this._map.unproject(Z):this._map.getCenter()}return this.clear(),G.noMoveStart=!0,G}}function Pl(F,t){(!F.duration||F.duration<t.duration)&&(F.duration=t.duration,F.easing=t.easing)}function Cl(F,t,l){const{maxSpeed:B,linearity:G,deceleration:Z}=l,Y=o.aw(F*G/(t/1e3),-B,B),re=Math.abs(Y)/(Z*G);return{easing:l.easing,duration:1e3*re,amount:Y*(re/2)}}class ps extends o.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,l,B,G={}){const Z=Bt(l.getCanvasContainer(),B),Y=l.unproject(Z);super(t,o.l({point:Z,lngLat:Y,originalEvent:B},G)),this._defaultPrevented=!1,this.target=l}}class Il extends o.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,l,B){const G=t==="touchend"?B.changedTouches:B.touches,Z=Zt(l.getCanvasContainer(),G),Y=Z.map(oe=>l.unproject(oe)),re=Z.reduce((oe,ce,he,pe)=>oe.add(ce.div(pe.length)),new o.P(0,0));super(t,{points:Z,point:re,lngLats:Y,lngLat:l.unproject(re),originalEvent:B}),this._defaultPrevented=!1}}class Ld extends o.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,l){super("wheel",{originalEvent:l}),this._defaultPrevented=!1}}class of{constructor(t,l){this._map=t,this._clickTolerance=l.clickTolerance}reset(){this._mousedownPos=void 0}wheel(t){return this._firePreventable(new Ld(this._map,t))}mousedown(t,l){return this._mousedownPos=l,this._firePreventable(new ps(t.type,this._map,t))}mouseup(t){this._map.fire(new ps(t.type,this._map,t))}preclick(t){const l=o.l({},t);l.type="preclick",this._map.fire(new ps(l.type,this._map,l))}click(t,l){this._mousedownPos&&this._mousedownPos.dist(l)>=this._clickTolerance||(this.preclick(t),this._map.fire(new ps(t.type,this._map,t)))}dblclick(t){return this._firePreventable(new ps(t.type,this._map,t))}mouseover(t){this._map.fire(new ps(t.type,this._map,t))}mouseout(t){this._map.fire(new ps(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Il(t.type,this._map,t))}touchmove(t){this._map.fire(new Il(t.type,this._map,t))}touchend(t){this._map.fire(new Il(t.type,this._map,t))}touchcancel(t){this._map.fire(new Il(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class lf{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(t){this._map.fire(new ps(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ps("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new ps(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class an{constructor(t,l){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=l.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,l){this.isEnabled()&&t.shiftKey&&t.button===0&&(et(),this._startPos=this._lastPos=l,this._active=!0)}mousemoveWindow(t,l){if(!this._active)return;const B=l,G=this._startPos,Z=this._lastPos;if(!G||!Z||Z.equals(B)||!this._box&&B.dist(G)<this._clickTolerance)return;this._lastPos=B,this._box||(this._box=ge("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));const Y=Math.min(G.x,B.x),re=Math.max(G.x,B.x),oe=Math.min(G.y,B.y),ce=Math.max(G.y,B.y);this._map._requestDomTask(()=>{this._box&&(this._box.style.transform=`translate(${Y}px,${oe}px)`,this._box.style.width=re-Y+"px",this._box.style.height=ce-oe+"px")})}mouseupWindow(t,l){if(!this._active)return;const B=this._startPos,G=l;if(B&&t.button===0){if(this.reset(),St(),B.x!==G.x||B.y!==G.y)return this._map.fire(new o.z("boxzoomend",{originalEvent:t})),{cameraAnimation:Z=>Z.fitScreenCoordinates(B,G,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),Mt(),delete this._startPos,delete this._lastPos}_fireEvent(t,l){return this._map.fire(new o.z(t,{originalEvent:l}))}}function kc(F,t){const l={};for(let B=0;B<F.length;B++)l[F[B].identifier]=t[B];return l}class cf{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(t,l,B){(this.centroid||B.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===0&&(this.startTime=t.timeStamp),B.length===this.numTouches&&(this.centroid=function(G){const Z=new o.P(0,0);for(const Y of G)Z._add(Y);return Z.div(G.length)}(l),this.touches=kc(B,l)))}touchmove(t,l,B){if(this.aborted||!this.centroid)return;const G=kc(B,l);for(const Z in this.touches){const Y=G[Z];(!Y||Y.dist(this.touches[Z])>30)&&(this.aborted=!0)}}touchend(t,l,B){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),B.length===0){const G=!this.aborted&&this.centroid;if(this.reset(),G)return G}}}class uu{constructor(t){this.singleTap=new cf(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(t,l,B){this.singleTap.touchstart(t,l,B)}touchmove(t,l,B){this.singleTap.touchmove(t,l,B)}touchend(t,l,B){const G=this.singleTap.touchend(t,l,B);if(G){const Z=t.timeStamp-this.lastTime<500,Y=!this.lastTap||this.lastTap.dist(G)<30;if(Z&&Y||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=G,this.count===this.numTaps)return this.reset(),G}}}class Dl{constructor(){this._zoomIn=new uu({numTouches:1,numTaps:2}),this._zoomOut=new uu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,l,B){this._zoomIn.touchstart(t,l,B),this._zoomOut.touchstart(t,l,B)}touchmove(t,l,B){this._zoomIn.touchmove(t,l,B),this._zoomOut.touchmove(t,l,B)}touchend(t,l,B){const G=this._zoomIn.touchend(t,l,B),Z=this._zoomOut.touchend(t,l,B);return G?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Y=>Y.easeTo({duration:300,zoom:Y.getZoom()+1,around:Y.unproject(G)},{originalEvent:t})}):Z?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Y=>Y.easeTo({duration:300,zoom:Y.getZoom()-1,around:Y.unproject(Z)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Fd={0:1,2:2};class kl{constructor(t){this.reset(),this._clickTolerance=t.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(t,l){return!1}_move(t,l){return{}}mousedown(t,l){if(this._lastPoint)return;const B=xt(t);this._correctButton(t,B)&&(this._lastPoint=l,this._eventButton=B)}mousemoveWindow(t,l){const B=this._lastPoint;if(B){if(t.preventDefault(),this._eventButton!=null&&function(G,Z){const Y=Fd[Z];return G.buttons===void 0||(G.buttons&Y)!==Y}(t,this._eventButton))this.reset();else if(this._moved||!(l.dist(B)<this._clickTolerance))return this._moved=!0,this._lastPoint=l,this._move(B,l)}}mouseupWindow(t){this._lastPoint&&xt(t)===this._eventButton&&(this._moved&&St(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Rc extends kl{mousedown(t,l){super.mousedown(t,l),this._lastPoint&&(this._active=!0)}_correctButton(t,l){return l===0&&!t.ctrlKey}_move(t,l){return{around:l,panDelta:l.sub(t)}}}class Ys extends kl{_correctButton(t,l){return l===0&&t.ctrlKey||l===2}_move(t,l){const B=.8*(l.x-t.x);if(B)return this._active=!0,{bearingDelta:B}}contextmenu(t){t.preventDefault()}}class Rl extends kl{_correctButton(t,l){return l===0&&t.ctrlKey||l===2}_move(t,l){const B=-.5*(l.y-t.y);if(B)return this._active=!0,{pitchDelta:B}}contextmenu(t){t.preventDefault()}}class cn{constructor(t,l){this._map=t,this._el=t.getCanvasContainer(),this._minTouches=1,this._clickTolerance=l.clickTolerance||1,this.reset(),o.aP(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new o.P(0,0)}touchstart(t,l,B){return this._calculateTransform(t,l,B)}touchmove(t,l,B){if(this._active&&!(B.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(B.length===1&&!o.dz())return void this._showTouchPanBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return t.cancelable&&t.preventDefault(),this._calculateTransform(t,l,B)}}touchend(t,l,B){this._calculateTransform(t,l,B),this._active&&B.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,l,B){B.length>0&&(this._active=!0);const G=kc(B,l),Z=new o.P(0,0),Y=new o.P(0,0);let re=0;for(const ce in G){const he=G[ce],pe=this._touches[ce];pe&&(Z._add(he),Y._add(he.sub(pe)),re++,G[ce]=he)}if(this._touches=G,re<this._minTouches||!Y.mag())return;const oe=Y.div(re);return this._sum._add(oe),this._sum.mag()<this._clickTolerance?void 0:{around:Z.div(re),panDelta:oe}}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=ge("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 Ps{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(t){}_move(t,l,B){return{}}touchstart(t,l,B){this._firstTwoTouches||B.length<2||(this._firstTwoTouches=[B[0].identifier,B[1].identifier],this._start([l[0],l[1]]))}touchmove(t,l,B){const G=this._firstTwoTouches;if(!G)return;t.preventDefault();const[Z,Y]=G,re=Do(B,l,Z),oe=Do(B,l,Y);if(!re||!oe)return;const ce=this._aroundCenter?null:re.add(oe).div(2);return this._move([re,oe],ce,t)}touchend(t,l,B){if(!this._firstTwoTouches)return;const[G,Z]=this._firstTwoTouches,Y=Do(B,l,G),re=Do(B,l,Z);Y&&re||(this._active&&St(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Do(F,t,l){for(let B=0;B<F.length;B++)if(F[B].identifier===l)return t[B]}function zl(F,t){return Math.log(F/t)/Math.LN2}class Od extends Ps{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,l){const B=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(zl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:zl(this._distance,B),pinchAround:l}}}function Bd(F,t){return 180*F.angleWith(t)/Math.PI}class Ll extends Ps{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,l){const B=this._vector;if(this._vector=t[0].sub(t[1]),B&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Bd(this._vector,B),pinchAround:l}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const l=25/(Math.PI*this._minDiameter)*360,B=this._startVector;if(!B)return!1;const G=Bd(t,B);return Math.abs(G)<l}}function du(F){return Math.abs(F.y)>Math.abs(F.x)}class hf extends Ps{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(t){this._lastPoints=t,du(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,l,B){const G=this._lastPoints;if(!G)return;const Z=t[0].sub(G[0]),Y=t[1].sub(G[1]);return this._map._cooperativeGestures&&!o.dz()&&B.touches.length<3||(this._valid=this.gestureBeginsVertically(Z,Y,B.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(Z.y+Y.y)/2*-.5})}gestureBeginsVertically(t,l,B){if(this._valid!==void 0)return this._valid;const G=t.mag()>=2,Z=l.mag()>=2;if(!G&&!Z)return;if(!G||!Z)return this._firstMove==null&&(this._firstMove=B),B-this._firstMove<100&&void 0;const Y=t.y>0==l.y>0;return du(t)&&du(l)&&Y}}const pu={panStep:100,bearingStep:15,pitchStep:10};class fu{constructor(){const t=pu;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let l=0,B=0,G=0,Z=0,Y=0;switch(t.keyCode){case 61:case 107:case 171:case 187:l=1;break;case 189:case 109:case 173:l=-1;break;case 37:t.shiftKey?B=-1:(t.preventDefault(),Z=-1);break;case 39:t.shiftKey?B=1:(t.preventDefault(),Z=1);break;case 38:t.shiftKey?G=1:(t.preventDefault(),Y=-1);break;case 40:t.shiftKey?G=-1:(t.preventDefault(),Y=1);break;default:return}return this._rotationDisabled&&(B=0,G=0),{cameraAnimation:re=>{const oe=re.getZoom();re.easeTo({duration:300,easeId:"keyboardHandler",easing:io,zoom:l?Math.round(oe)+l*(t.shiftKey?2:1):oe,bearing:re.getBearing()+B*this._bearingStep,pitch:re.getPitch()+G*this._pitchStep,offset:[-Z*this._panStep,-Y*this._panStep],center:re.getCenter()},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function io(F){return F*(2-F)}const ro=4.000244140625,fa=1/450;class Fs{constructor(t,l){this._map=t,this._el=t.getCanvasContainer(),this._handler=l,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=fa,o.aP(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center",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()||o.dz()))return void this._showBlockerAlert();this._alertContainer.style.visibility!=="hidden"&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let l=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const B=o.q.now(),G=B-(this._lastWheelEventTime||0);this._lastWheelEventTime=B,l!==0&&l%ro==0?this._type="wheel":l!==0&&Math.abs(l)<4?this._type="trackpad":G>400?(this._type=null,this._lastValue=l,this._timeout=window.setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(G*l)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,l+=this._lastValue)),t.shiftKey&&l&&(l/=4),this._type&&(this._lastWheelEvent=t,this._delta-=l,this._active||this._start(t)),t.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){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 l=Bt(this._el,t);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:l,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._map.transform;this._type==="wheel"&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const l=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(this._delta!==0){const ce=this._type==="wheel"&&Math.abs(this._delta)>ro?this._wheelZoomRate:this._defaultZoomRate;let he=2/(1+Math.exp(-Math.abs(this._delta*ce)));this._delta<0&&he!==0&&(he=1/he);const pe=l(),fe=Math.pow(2,pe),be=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):fe;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(be*he))),this._type==="wheel"&&(this._startZoom=pe,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const B=typeof this._targetZoom=="number"?this._targetZoom:l(),G=this._startZoom,Z=this._easing;let Y,re=!1;if(this._type==="wheel"&&G&&Z){const ce=Math.min((o.q.now()-this._lastWheelEventTime)/200,1),he=Z(ce);Y=o.af(G,B,he),ce<1?this._frameId||(this._frameId=!0):re=!0}else Y=B,re=!0;this._active=!0,re&&(this._active=!1,this._finishTimeout=window.setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let oe=Y-l();return oe*this._lastDelta<0&&(oe=0),{noInertia:!0,needsRenderFrame:!re,zoomDelta:oe,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let l=o.dA;if(this._prevEase){const B=this._prevEase,G=(o.q.now()-B.start)/B.duration,Z=B.easing(G+.01)-B.easing(G),Y=.27/Math.sqrt(Z*Z+1e-4)*.01,re=Math.sqrt(.0729-Y*Y);l=o.dy(Y,re,.25,1)}return this._prevEase={start:o.q.now(),duration:t,easing:l},l}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=ge("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.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 ka{constructor(t,l){this._clickZoom=t,this._tapZoom=l}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 no{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(t,l){return t.preventDefault(),{cameraAnimation:B=>{B.easeTo({duration:300,zoom:B.getZoom()+(t.shiftKey?-1:1),around:B.unproject(l)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ra{constructor(){this._tap=new uu({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(t,l,B){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?B.length>0&&(this._swipePoint=l[0],this._swipeTouch=B[0].identifier):this._tap.touchstart(t,l,B))}touchmove(t,l,B){if(this._tapTime){if(this._swipePoint){if(B[0].identifier!==this._swipeTouch)return;const G=l[0],Z=G.y-this._swipePoint.y;return this._swipePoint=G,t.preventDefault(),this._active=!0,{zoomDelta:Z/128}}}else this._tap.touchmove(t,l,B)}touchend(t,l,B){this._tapTime?this._swipePoint&&B.length===0&&this.reset():this._tap.touchend(t,l,B)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class uf{constructor(t,l,B){this._el=t,this._mousePan=l,this._touchPan=B}enable(t){this._inertiaOptions=t||{},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 df{constructor(t,l,B){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=l,this._mousePitch=B}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class pf{constructor(t,l,B,G){this._el=t,this._touchZoom=l,this._touchRotate=B,this._tapDragZoom=G,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const zc=F=>F.zoom||F.drag||F.pitch||F.rotate;class Nd extends o.z{}class rs{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,l){const B=o.ab.vec3.sub([],l,t);this.radius=o.ab.vec3.length(B[2]<0?o.ab.vec3.div([],B,this.constants):[B[0],B[1],0])}projectRay(t){o.ab.vec3.div(t,t,this.constants),o.ab.vec3.normalize(t,t),o.ab.vec3.mul(t,t,this.constants);const l=o.ab.vec3.scale([],t,this.radius);if(l[2]>0){const B=o.ab.vec3.scale([],[0,0,1],o.ab.vec3.dot(l,[0,0,1])),G=o.ab.vec3.scale([],o.ab.vec3.normalize([],[l[0],l[1],0]),this.radius),Z=o.ab.vec3.add([],l,o.ab.vec3.scale([],o.ab.vec3.sub([],o.ab.vec3.add([],G,B),l),2));l[0]=Z[0],l[1]=Z[1]}return l}}function ko(F){return F.panDelta&&F.panDelta.mag()||F.zoomDelta||F.bearingDelta||F.pitchDelta}class Vd{constructor(t,l){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zd(t),this._bearingSnap=l.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new rs,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(l),o.aP(["handleEvent","handleWindowEvent"],this);const B=this._el;this._listeners=[[B,"touchstart",{passive:!0}],[B,"touchmove",{passive:!1}],[B,"touchend",void 0],[B,"touchcancel",void 0],[B,"mousedown",void 0],[B,"mousemove",void 0],[B,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[B,"mouseover",void 0],[B,"mouseout",void 0],[B,"dblclick",void 0],[B,"click",void 0],[B,"keydown",{capture:!1}],[B,"keyup",void 0],[B,"wheel",{passive:!1}],[B,"contextmenu",void 0],[window,"blur",void 0]];for(const[G,Z,Y]of this._listeners){const re=G===document?this.handleWindowEvent:this.handleEvent;G.addEventListener(Z,re,Y)}}destroy(){for(const[t,l,B]of this._listeners){const G=t===document?this.handleWindowEvent:this.handleEvent;t.removeEventListener(l,G,B)}}_addDefaultHandlers(t){const l=this._map,B=l.getCanvasContainer();this._add("mapEvent",new of(l,t));const G=l.boxZoom=new an(l,t);this._add("boxZoom",G);const Z=new Dl,Y=new no;l.doubleClickZoom=new ka(Y,Z),this._add("tapZoom",Z),this._add("clickZoom",Y);const re=new Ra;this._add("tapDragZoom",re);const oe=l.touchPitch=new hf(l);this._add("touchPitch",oe);const ce=new Ys(t),he=new Rl(t);l.dragRotate=new df(t,ce,he),this._add("mouseRotate",ce,["mousePitch"]),this._add("mousePitch",he,["mouseRotate"]);const pe=new Rc(t),fe=new cn(l,t);l.dragPan=new uf(B,pe,fe),this._add("mousePan",pe),this._add("touchPan",fe,["touchZoom","touchRotate"]);const be=new Ll,ze=new Od;l.touchZoomRotate=new pf(B,ze,be,re),this._add("touchRotate",be,["touchPan","touchZoom"]),this._add("touchZoom",ze,["touchPan","touchRotate"]),this._add("blockableMapEvent",new lf(l));const De=l.scrollZoom=new Fs(l,this);this._add("scrollZoom",De,["mousePan"]);const Oe=l.keyboard=new fu;this._add("keyboard",Oe);for(const Fe of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[Fe]&&l[Fe].enable(t[Fe])}_add(t,l,B){this._handlers.push({handlerName:t,handler:l,allowed:B}),this._handlersById[t]=l}stop(t){if(!this._updatingCamera){for(const{handler:l}of this._handlers)l.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!zc(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(t,l,B){for(const G in t)if(G!==B&&(!l||l.indexOf(G)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){const l=[];for(const B of t)this._el.contains(B.target)&&l.push(B);return l}handleEvent(t,l){this._updatingCamera=!0;const B=t.type==="renderFrame",G=B?void 0:t,Z={needsRenderFrame:!1},Y={},re={},oe=t.touches?this._getMapTouches(t.touches):void 0,ce=oe?Zt(this._el,oe):B?void 0:Bt(this._el,t);for(const{handlerName:fe,handler:be,allowed:ze}of this._handlers){if(!be.isEnabled())continue;let De;this._blockedByActive(re,ze,fe)?be.reset():be[l||t.type]&&(De=be[l||t.type](t,ce,oe),this.mergeHandlerResult(Z,Y,De,fe,G),De&&De.needsRenderFrame&&this._triggerRenderFrame()),(De||be.isActive())&&(re[fe]=be)}const he={};for(const fe in this._previousActiveHandlers)re[fe]||(he[fe]=G);this._previousActiveHandlers=re,(Object.keys(he).length||ko(Z))&&(this._changes.push([Z,Y,he]),this._triggerRenderFrame()),(Object.keys(re).length||ko(Z))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:pe}=Z;pe&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],pe(this._map))}mergeHandlerResult(t,l,B,G,Z){if(!B)return;o.l(t,B);const Y={handlerName:G,originalEvent:B.originalEvent||Z};B.zoomDelta!==void 0&&(l.zoom=Y),B.panDelta!==void 0&&(l.drag=Y),B.pitchDelta!==void 0&&(l.pitch=Y),B.bearingDelta!==void 0&&(l.rotate=Y)}_applyChanges(){const t={},l={},B={};for(const[G,Z,Y]of this._changes)G.panDelta&&(t.panDelta=(t.panDelta||new o.P(0,0))._add(G.panDelta)),G.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+G.zoomDelta),G.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+G.bearingDelta),G.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+G.pitchDelta),G.around!==void 0&&(t.around=G.around),G.aroundCoord!==void 0&&(t.aroundCoord=G.aroundCoord),G.pinchAround!==void 0&&(t.pinchAround=G.pinchAround),G.noInertia&&(t.noInertia=G.noInertia),o.l(l,Z),o.l(B,Y);this._updateMapTransform(t,l,B),this._changes=[]}_updateMapTransform(t,l,B){const G=this._map,Z=G.transform,Y=Ge=>[Ge.x,Ge.y,Ge.z];if((Ge=>{const Xe=this._eventsInProgress.drag;return Xe&&!this._handlersById[Xe.handlerName].isActive()})()&&!ko(t)){const Ge=Z.zoom;Z.cameraElevationReference="sea",this._originalZoom!=null&&Z._orthographicProjectionAtLowPitch&&Z.projection.name!=="globe"&&Z.pitch===0?(Z.cameraElevationReference="ground",Z.zoom=this._originalZoom):(Z.recenterOnTerrain(),Z.cameraElevationReference="ground"),Ge!==Z.zoom&&this._map._update(!0)}if(Z._isCameraConstrained&&G._stop(!0),!ko(t))return void this._fireEvents(l,B,!0);let{panDelta:re,zoomDelta:oe,bearingDelta:ce,pitchDelta:he,around:pe,aroundCoord:fe,pinchAround:be}=t;Z._isCameraConstrained&&(oe>0&&(oe=0),Z._isCameraConstrained=!1),be!==void 0&&(pe=be),(oe||(Ge=>l[Ge]&&!this._eventsInProgress[Ge])("drag"))&&pe&&(this._dragOrigin=Y(Z.pointCoordinate3D(pe)),this._originalZoom=Z.zoom,this._trackingEllipsoid.setup(Z._camera.position,this._dragOrigin)),Z.cameraElevationReference="sea",G._stop(!0),pe=pe||G.transform.centerPoint,ce&&(Z.bearing+=ce),he&&(Z.pitch+=he),Z._updateCameraState();const ze=[0,0,0];if(re)if(Z.projection.name==="mercator"){const Ge=this._trackingEllipsoid.projectRay(Z.screenPointToMercatorRay(pe).dir),Xe=this._trackingEllipsoid.projectRay(Z.screenPointToMercatorRay(pe.sub(re)).dir);ze[0]=Xe[0]-Ge[0],ze[1]=Xe[1]-Ge[1]}else{const Ge=Z.pointCoordinate(pe);if(Z.projection.name==="globe"){re=re.rotate(-Z.angle);const Xe=Z._pixelsPerMercatorPixel/Z.worldSize;ze[0]=-re.x*o.dB(o.aS(Ge.y))*Xe,ze[1]=-re.y*o.dB(Z.center.lat)*Xe}else{const Xe=Z.pointCoordinate(pe.sub(re));Ge&&Xe&&(ze[0]=Xe.x-Ge.x,ze[1]=Xe.y-Ge.y)}}const De=Z.zoom,Oe=[0,0,0];if(oe){const Ge=Y(fe||Z.pointCoordinate3D(pe)),Xe={dir:o.ab.vec3.normalize([],o.ab.vec3.sub([],Ge,Z._camera.position))};if(Xe.dir[2]<0){const Ze=Z.zoomDeltaToMovement(Ge,oe);o.ab.vec3.scale(Oe,Xe.dir,Ze)}}const Fe=o.ab.vec3.add(ze,ze,Oe);Z._translateCameraConstrained(Fe),oe&&Math.abs(Z.zoom-De)>1e-4&&Z.recenterOnTerrain(),Z.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(l,B,!0)}_fireEvents(t,l,B){const G=zc(this._eventsInProgress),Z=zc(t),Y={};for(const he in t){const{originalEvent:pe}=t[he];this._eventsInProgress[he]||(Y[`${he}start`]=pe),this._eventsInProgress[he]=t[he]}!G&&Z&&this._fireEvent("movestart",Z.originalEvent);for(const he in Y)this._fireEvent(he,Y[he]);Z&&this._fireEvent("move",Z.originalEvent);for(const he in t){const{originalEvent:pe}=t[he];this._fireEvent(he,pe)}const re={};let oe;for(const he in this._eventsInProgress){const{handlerName:pe,originalEvent:fe}=this._eventsInProgress[he];this._handlersById[pe].isActive()||(delete this._eventsInProgress[he],oe=l[pe]||fe,re[`${he}end`]=oe)}for(const he in re)this._fireEvent(he,re[he]);const ce=zc(this._eventsInProgress);if(B&&(G||Z)&&!ce){this._updatingCamera=!0;const he=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),pe=fe=>fe!==0&&-this._bearingSnap<fe&&fe<this._bearingSnap;
2668he?(pe(he.bearing||this._map.getBearing())&&(he.bearing=0),this._map.easeTo(he,{originalEvent:oe})):(this._map.fire(new o.z("moveend",{originalEvent:oe})),pe(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,l){this._map.fire(new o.z(t,l?{originalEvent:l}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{this._frameId=void 0,this.handleEvent(new Nd("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const Ud="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Ro extends o.E{constructor(t,l){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=l.bearingSnap,this._respectPrefersReducedMotion=l.respectPrefersReducedMotion!==!1,o.aP(["_renderFrameCallback"],this)}getCenter(){return new o.bO(this.transform.center.lng,this.transform.center.lat)}setCenter(t,l){return this.jumpTo({center:t},l)}panBy(t,l,B){return t=o.P.convert(t).mult(-1),this.panTo(this.transform.center,o.l({offset:t},l),B)}panTo(t,l,B){return this.easeTo(o.l({center:t},l),B)}getZoom(){return this.transform.zoom}setZoom(t,l){return this.jumpTo({zoom:t},l),this}zoomTo(t,l,B){return this.easeTo(o.l({zoom:t},l),B)}zoomIn(t,l){return this.zoomTo(this.getZoom()+1,t,l),this}zoomOut(t,l){return this.zoomTo(this.getZoom()-1,t,l),this}getBearing(){return this.transform.bearing}setBearing(t,l){return this.jumpTo({bearing:t},l),this}getPadding(){return this.transform.padding}setPadding(t,l){return this.jumpTo({padding:t},l),this}rotateTo(t,l,B){return this.easeTo(o.l({bearing:t},l),B)}resetNorth(t,l){return this.rotateTo(0,o.l({duration:1e3},t),l),this}resetNorthPitch(t,l){return this.easeTo(o.l({bearing:0,pitch:0,duration:1e3},t),l),this}snapToNorth(t,l){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,l):this}getPitch(){return this.transform.pitch}setPitch(t,l){return this.jumpTo({pitch:t},l),this}cameraForBounds(t,l){t=o.az.convert(t);const B=l&&l.bearing||0,G=l&&l.pitch||0,Z=t.getNorthWest(),Y=t.getSouthEast();return this._cameraForBounds(this.transform,Z,Y,B,G,l)}_extendPadding(t){const l={top:0,right:0,bottom:0,left:0};return t==null?o.l({},l,this.transform.padding):typeof t=="number"?{top:t,bottom:t,right:t,left:t}:o.l({},l,t)}_extendCameraOptions(t){return(t=o.l({offset:[0,0],maxZoom:this.transform.maxZoom},t)).padding=this._extendPadding(t.padding),t}_minimumAABBFrustumDistance(t,l){const B=l.max[0]-l.min[0],G=l.max[1]-l.min[1];return B/G>t.aspect?B/(2*Math.tan(.5*t.fovX)*t.aspect):G/(2*Math.tan(.5*t.fovY)*t.aspect)}_cameraForBoundsOnGlobe(t,l,B,G,Z,Y){const re=t.clone(),oe=this._extendCameraOptions(Y);re.bearing=G,re.pitch=Z;const ce=o.bO.convert(l),he=o.bO.convert(B),pe=.5*(ce.lat+he.lat),fe=.5*(ce.lng+he.lng),be=o.dC(pe,fe),ze=o.ab.vec3.normalize([],be),De=o.ab.vec3.normalize([],o.ab.vec3.cross([],ze,[0,1,0])),Oe=o.ab.vec3.cross([],De,ze),Fe=[De[0],De[1],De[2],0,Oe[0],Oe[1],Oe[2],0,ze[0],ze[1],ze[2],0,0,0,0,1],Ge=[be,o.dC(ce.lat,ce.lng),o.dC(he.lat,ce.lng),o.dC(he.lat,he.lng),o.dC(ce.lat,he.lng),o.dC(pe,ce.lng),o.dC(pe,he.lng),o.dC(ce.lat,fe),o.dC(he.lat,fe)];let Xe=o.cd.fromPoints(Ge.map(Ut=>[o.ab.vec3.dot(De,Ut),o.ab.vec3.dot(Oe,Ut),o.ab.vec3.dot(ze,Ut)]));const Ze=o.ab.vec3.transformMat4([],Xe.center,Fe);o.ab.vec3.squaredLength(Ze)===0&&o.ab.vec3.set(Ze,0,0,1),o.ab.vec3.normalize(Ze,Ze),o.ab.vec3.scale(Ze,Ze,o.ax),re.center=o.dD(Ze);const nt=re.getWorldToCameraMatrix(),Qe=o.ab.mat4.invert(new Float64Array(16),nt);Xe=o.cd.applyTransform(Xe,o.ab.mat4.multiply([],nt,Fe));const it=this._extendAABB(Xe,re,oe,G);if(!it)return void o.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");Xe=it,o.ab.vec3.transformMat4(Ze,Ze,nt);const Ke=.5*(Xe.max[2]-Xe.min[2]),ht=this._minimumAABBFrustumDistance(re,Xe),yt=o.ab.vec3.scale([],[0,0,1],Ke),Nt=o.ab.vec3.add(yt,Ze,yt),Dt=ht+(re.pitch===0?0:o.ab.vec3.distance(Ze,Nt)),Wt=re.globeCenterInViewSpace,$t=o.ab.vec3.sub([],Ze,[Wt[0],Wt[1],Wt[2]]);o.ab.vec3.normalize($t,$t),o.ab.vec3.scale($t,$t,Dt);const At=o.ab.vec3.add([],Ze,$t);o.ab.vec3.transformMat4(At,At,Qe);const Vt=o.ds/o.ax,ii=o.ab.vec3.length(At),Et=o.bH(Math.max(ii*Vt-o.ds,Number.EPSILON),0),Jt=Math.min(re.zoomFromMercatorZAdjusted(Et),oe.maxZoom);return Jt>.5*(o.c6+o.bY)?(re.setProjection({name:"mercator"}),re.zoom=Jt,this._cameraForBounds(re,l,B,G,Z,Y)):{center:re.center,zoom:Jt,bearing:G,pitch:Z}}_extendAABB(t,l,B,G){const Z=.5*((B.padding.left||0)+(B.padding.right||0)),Y=.5*((B.padding.top||0)+(B.padding.bottom||0)),re=Y,oe=Z,ce=Z,he
vendor: 13,304 bytes, line 2668
2668=Y,pe=l.width-(oe+ce),fe=l.height-(re+he),be=o.ab.vec3.sub([],t.max,t.min),ze=Math.min(pe/be[0],fe/be[1]),De=Math.min(l.scaleZoom(l.scale*ze),B.maxZoom);if(isNaN(De))return null;const Oe=l.scale/l.zoomScale(De),Fe=new o.cd([t.min[0]-oe*Oe,t.min[1]-he*Oe,t.min[2]],[t.max[0]+ce*Oe,t.max[1]+re*Oe,t.max[2]]),Ge=(typeof B.offset.x=="number"&&typeof B.offset.y=="number"?new o.P(B.offset.x,B.offset.y):o.P.convert(B.offset)).rotate(-o.ai(G));return Fe.center[0]-=Ge.x*Oe,Fe.center[1]+=Ge.y*Oe,Fe}queryTerrainElevation(t,l){const B=this.transform.elevation;return B?(l=o.l({},{exaggerated:!0},l),B.getAtPoint(o.aa.fromLngLat(t),null,l.exaggerated)):null}_cameraForBounds(t,l,B,G,Z,Y){if(t.projection.name==="globe")return this._cameraForBoundsOnGlobe(t,l,B,G,Z,Y);const re=t.clone(),oe=this._extendCameraOptions(Y);re.bearing=G,re.pitch=Z;const ce=o.bO.convert(l),he=o.bO.convert(B),pe=new o.bO(ce.lng,he.lat),fe=new o.bO(he.lng,ce.lat),be=re.project(ce),ze=re.project(he),De=this.queryTerrainElevation(ce),Oe=this.queryTerrainElevation(he),Fe=this.queryTerrainElevation(pe),Ge=this.queryTerrainElevation(fe),Xe=[[be.x,be.y,Math.min(De||0,Oe||0,Fe||0,Ge||0)],[ze.x,ze.y,Math.max(De||0,Oe||0,Fe||0,Ge||0)]];let Ze=o.cd.fromPoints(Xe);const nt=re.getWorldToCameraMatrix(),Qe=o.ab.mat4.invert(new Float64Array(16),nt);Ze=o.cd.applyTransform(Ze,nt);const it=this._extendAABB(Ze,re,oe,G);if(!it)return void o.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");Ze=it;const Ke=.5*o.ab.vec3.sub([],Ze.max,Ze.min)[2],ht=this._minimumAABBFrustumDistance(re,Ze),yt=[0,0,1,0];o.ab.vec4.transformMat4(yt,yt,nt),o.ab.vec4.normalize(yt,yt);const Nt=o.ab.vec3.scale([],yt,ht+Ke),Dt=o.ab.vec3.add([],Ze.center,Nt);o.ab.vec3.transformMat4(Ze.center,Ze.center,Qe),o.ab.vec3.transformMat4(Dt,Dt,Qe);const Wt=re.unproject(new o.P(Ze.center[0],Ze.center[1])),$t=o.dE(re.projection,Wt),At=Math.pow(2,$t),Vt=Math.min(re._zoomFromMercatorZ(Dt[2]*re.pixelsPerMeter*At/re.worldSize),oe.maxZoom);return re.mercatorFromTransition&&Vt<.5*(o.c6+o.bY)?(re.setProjection({name:"globe"}),re.zoom=Vt,this._cameraForBounds(re,l,B,G,Z,Y)):{center:Wt,zoom:Vt,bearing:G,pitch:Z}}fitBounds(t,l,B){const G=this.cameraForBounds(t,l);return this._fitInternal(G,l,B)}fitScreenCoordinates(t,l,B,G,Z){const Y=o.P.convert(t),re=o.P.convert(l),oe=new o.P(Math.min(Y.x,re.x),Math.min(Y.y,re.y)),ce=new o.P(Math.max(Y.x,re.x),Math.max(Y.y,re.y));if(this.transform.projection.name==="mercator"&&this.transform.anyCornerOffEdge(Y,re))return this;const he=this.transform.pointLocation3D(oe),pe=this.transform.pointLocation3D(ce),fe=this.transform.pointLocation3D(new o.P(oe.x,ce.y)),be=this.transform.pointLocation3D(new o.P(ce.x,oe.y)),ze=[Math.min(he.lng,pe.lng,fe.lng,be.lng),Math.min(he.lat,pe.lat,fe.lat,be.lat)],De=[Math.max(he.lng,pe.lng,fe.lng,be.lng),Math.max(he.lat,pe.lat,fe.lat,be.lat)],Oe=G&&G.pitch?G.pitch:this.getPitch(),Fe=this._cameraForBounds(this.transform,ze,De,B,Oe,G);return this._fitInternal(Fe,G,Z)}_fitInternal(t,l,B){return t?(l=o.l(t,l)).linear?this.easeTo(l,B):this.flyTo(l,B):this}jumpTo(t,l){this.stop();const B=t.preloadOnly?this.transform.clone():this.transform;let G=!1,Z=!1,Y=!1;"zoom"in t&&B.zoom!==+t.zoom&&(G=!0,B.zoom=+t.zoom),t.center!==void 0&&(B.center=o.bO.convert(t.center)),"bearing"in t&&B.bearing!==+t.bearing&&(Z=!0,B.bearing=+t.bearing),"pitch"in t&&B.pitch!==+t.pitch&&(Y=!0,B.pitch=+t.pitch);const re=typeof t.padding=="number"?this._extendPadding(t.padding):t.padding;if(t.padding!=null&&!B.isPaddingEqual(re))if(t.retainPadding===!1){const oe=B.clone();oe.padding=re,B.setLocationAtPoint(B.center,oe.centerPoint)}else B.padding=re;return t.preloadOnly?(this._preloadTiles(B),this):(this.fire(new o.z("movestart",l)).fire(new o.z("move",l)),G&&this.fire(new o.z("zoomstart",l)).fire(new o.z("zoom",l)).fire(new o.z("zoomend",l)),Z&&this.fire(new o.z("rotatestart",l)).fire(new o.z("rotate",l)).fire(new o.z("rotateend",l)),Y&&this.fire(new o.z("pitchstart",l)).fire(new o.z("pitch",l)).fire(new o.z("pitchend",l)),this.fire(new o.z("moveend",l)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||o.w(Ud),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,l){const B=this.transform;if(!B.projection.supportsFreeCamera)return o.w(Ud),this;this.stop();const G=B.zoom,Z=B.pitch,Y=B.bearing;B.setFreeCameraOptions(t);const re=G!==B.zoom,oe=Z!==B.pitch,ce=Y!==B.bearing;return this.fire(new o.z("movestart",l)).fire(new o.z("move",l)),re&&this.fire(new o.z("zoomstart",l)).fire(new o.z("zoom",l)).fire(new o.z("zoomend",l)),ce&&this.fire(new o.z("rotatestart",l)).fire(new o.z("rotate",l)).fire(new o.z("rotateend",l)),oe&&this.fire(new o.z("pitchstart",l)).fire(new o.z("pitch",l)).fire(new o.z("pitchend",l)),this.fire(new o.z("moveend",l)),this}easeTo(t,l){this._stop(!1,t.easeId),((t=o.l({offset:[0,0],duration:500,easing:o.dA},t)).animate===!1||this._prefersReducedMotion(t))&&(t.duration=0);const B=this.transform,G=this.getZoom(),Z=this.getBearing(),Y=this.getPitch(),re=this.getPadding(),oe="zoom"in t?+t.zoom:G,ce="bearing"in t?this._normalizeBearing(t.bearing,Z):Z,he="pitch"in t?+t.pitch:Y,pe=this._extendPadding(t.padding),fe=o.P.convert(t.offset);let be,ze,De;if(B.projection.name==="globe"){const yt=o.aa.fromLngLat(B.center),Nt=fe.rotate(-B.angle);yt.x+=Nt.x/B.worldSize,yt.y+=Nt.y/B.worldSize;const Dt=yt.toLngLat(),Wt=o.bO.convert(t.center||Dt);this._normalizeCenter(Wt),be=B.centerPoint.add(Nt),ze=new o.P(yt.x,yt.y).mult(B.worldSize),De=new o.P(o.at(Wt.lng),o.aA(Wt.lat)).mult(B.worldSize).sub(ze)}else{be=B.centerPoint.add(fe);const yt=B.pointLocation(be),Nt=o.bO.convert(t.center||yt);this._normalizeCenter(Nt),ze=B.project(yt),De=B.project(Nt).sub(ze)}const Oe=B.zoomScale(oe-G);let Fe,Ge;t.around&&(Fe=o.bO.convert(t.around),Ge=B.locationPoint(Fe));const Xe=this._zooming||oe!==G,Ze=this._rotating||Z!==ce,nt=this._pitching||he!==Y,Qe=!B.isPaddingEqual(pe),it=t.retainPadding===!1?B.clone():B,Ke=yt=>Nt=>{if(Xe&&(yt.zoom=o.af(G,oe,Nt)),Ze&&(yt.bearing=o.af(Z,ce,Nt)),nt&&(yt.pitch=o.af(Y,he,Nt)),Qe&&(it.interpolatePadding(re,pe,Nt),be=it.centerPoint.add(fe)),Fe)yt.setLocationAtPoint(Fe,Ge);else{const Dt=yt.zoomScale(yt.zoom-G),Wt=oe>G?Math.min(2,Oe):Math.max(.5,Oe),$t=Math.pow(Wt,1-Nt),At=yt.unproject(ze.add(De.mult(Nt*$t)).mult(Dt));yt.setLocationAtPoint(yt.renderWorldCopies?At.wrap():At,be)}return t.preloadOnly||this._fireMoveEvents(l),yt};if(t.preloadOnly){const yt=this._emulate(Ke,t.duration,B);return this._preloadTiles(yt),this}const ht={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=Xe,this._rotating=Ze,this._pitching=nt,this._padding=Qe,this._easeId=t.easeId,this._prepareEase(l,t.noMoveStart,ht),this._ease(Ke(B),yt=>{B.cameraElevationReference==="sea"&&B.recenterOnTerrain(),this._afterEase(l,yt)},t),this}_prepareEase(t,l,B={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&this.transform.pitch===0&&this.transform.projection.name!=="globe"&&(this.transform.cameraElevationReference="ground"),l||B.moving||this.fire(new o.z("movestart",t)),this._zooming&&!B.zooming&&this.fire(new o.z("zoomstart",t)),this._rotating&&!B.rotating&&this.fire(new o.z("rotatestart",t)),this._pitching&&!B.pitching&&this.fire(new o.z("pitchstart",t))}_fireMoveEvents(t){this.fire(new o.z("move",t)),this._zooming&&this.fire(new o.z("zoom",t)),this._rotating&&this.fire(new o.z("rotate",t)),this._pitching&&this.fire(new o.z("pitch",t))}_afterEase(t,l){if(this._easeId&&l&&this._easeId===l)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const B=this._zooming,G=this._rotating,Z=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,B&&this.fire(new o.z("zoomend",t)),G&&this.fire(new o.z("rotateend",t)),Z&&this.fire(new o.z("pitchend",t)),this.fire(new o.z("moveend",t))}flyTo(t,l){if(this._prefersReducedMotion(t)){const Ut=o.ay(t,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(Ut,l)}this.stop(),t=o.l({offset:[0,0],speed:1.2,curve:1.42,easing:o.dA},t);const B=this.transform,G=this.getZoom(),Z=this.getBearing(),Y=this.getPitch(),re=this.getPadding(),oe="zoom"in t?o.aw(+t.zoom,B.minZoom,B.maxZoom):G,ce="bearing"in t?this._normalizeBearing(t.bearing,Z):Z,he="pitch"in t?+t.pitch:Y,pe=this._extendPadding(t.padding),fe=B.zoomScale(oe-G),be=o.P.convert(t.offset);let ze=B.centerPoint.add(be);const De=B.pointLocation(ze),Oe=o.bO.convert(t.center||De);this._normalizeCenter(Oe);const Fe=B.project(De),Ge=B.project(Oe).sub(Fe);let Xe=t.curve;const Ze=Math.max(B.width,B.height),nt=Ze/fe,Qe=Ge.mag();if("minZoom"in t){const Ut=o.aw(Math.min(t.minZoom,G,oe),B.minZoom,B.maxZoom),hi=Ze/B.zoomScale(Ut-G);Xe=Math.sqrt(hi/Qe*2)}const it=Xe*Xe;function Ke(Ut){const hi=(nt*nt-Ze*Ze+(Ut?-1:1)*it*it*Qe*Qe)/(2*(Ut?nt:Ze)*it*Qe);return Math.log(Math.sqrt(hi*hi+1)-hi)}function ht(Ut){return(Math.exp(Ut)-Math.exp(-Ut))/2}function yt(Ut){return(Math.exp(Ut)+Math.exp(-Ut))/2}const Nt=Ke(0);let Dt=function(Ut){return yt(Nt)/yt(Nt+Xe*Ut)},Wt=function(Ut){return Ze*((yt(Nt)*(ht(hi=Nt+Xe*Ut)/yt(hi))-ht(Nt))/it)/Qe;var hi},$t=(Ke(1)-Nt)/Xe;if(Math.abs(Qe)<1e-6||!isFinite($t)){if(Math.abs(Ze-nt)<1e-6)return this.easeTo(t,l);const Ut=nt<Ze?-1:1;$t=Math.abs(Math.log(nt/Ze))/Xe,Wt=function(){return 0},Dt=function(hi){return Math.exp(Ut*Xe*hi)}}t.duration="duration"in t?+t.duration:1e3*$t/("screenSpeed"in t?+t.screenSpeed/Xe:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0);const At=Z!==ce,Vt=he!==Y,ii=!B.isPaddingEqual(pe),Et=t.retainPadding===!1?B.clone():B,Jt=Ut=>hi=>{const Qt=hi*$t,Xt=1/Dt(Qt);Ut.zoom=hi===1?oe:G+Ut.scaleZoom(Xt),At&&(Ut.bearing=o.af(Z,ce,hi)),Vt&&(Ut.pitch=o.af(Y,he,hi)),ii&&(Et.interpolatePadding(re,pe,hi),ze=Et.centerPoint.add(be));const ri=hi===1?Oe:Ut.unproject(Fe.add(Ge.mult(Wt(Qt))).mult(Xt));return Ut.setLocationAtPoint(Ut.renderWorldCopies?ri.wrap():ri,ze),Ut._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(l),Ut};if(t.preloadOnly){const Ut=this._emulate(Jt,t.duration,B);return this._preloadTiles(Ut),this}return this._zooming=!0,this._rotating=At,this._pitching=Vt,this._padding=ii,this._prepareEase(l,!1),this._ease(Jt(B),()=>this._afterEase(l),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(t){}_cancelRenderFrame(t){}_stop(t,l){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const B=this._onEaseEnd;this._onEaseEnd=void 0,B.call(this,l)}if(!t){const B=this.handlers;B&&B.stop(!1)}return this}_ease(t,l,B){B.animate===!1||B.duration===0?(t(1),l()):(this._easeStart=o.q.now(),this._easeOptions=B,this._onEaseFrame=t,this._onEaseEnd=l,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((o.q.now()-this._easeStart)/this._easeOptions.duration,1),l=this._onEaseFrame;l&&l(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,l){t=o.bF(t,-180,180);const B=Math.abs(t-l);return Math.abs(t-360-l)<B&&(t-=360),Math.abs(t+360-l)<B&&(t+=360),t}_normalizeCenter(t){const l=this.transform;if(l.maxBounds||l.projection.name!=="globe"&&!l.renderWorldCopies)return;const B=t.lng-l.center.lng;t.lng+=B>180?-360:B<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&o.q.prefersReducedMotion&&!(t&&t.essential)}_emulate(t,l,B){const G=Math.ceil(15*l/1e3),Z=[],Y=t(B.clone());for(let re=0;re<=G;re++){const oe=Y(re/G);Z.push(oe.clone())}return Z}_preloadTiles(t,l){}}class Lc{constructor(t={}){this.options=t,o.aP(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){const l=this.options&&this.options.compact,B=t._getUIString("AttributionControl.ToggleAttribution");this._map=t,this._container=ge("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=ge("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",B);const G=ge("span","mapboxgl-ctrl-icon",this._compactButton);return G.setAttribute("aria-hidden","true"),G.setAttribute("title",B),this._innerContainer=ge("div","mapboxgl-ctrl-attrib-inner",this._container),l&&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),l===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
2668se")):(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 l=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||o.e.ACCESS_TOKEN}];if(t){const B=l.reduce((G,Z,Y)=>(Z.value&&(G+=`${Z.key}=${Z.value}${Y<l.length-1?"&":""}`),G),"?");t.href=`${o.e.FEEDBACK_URL}/${B}#${hu(this._map,!0)}`,t.rel="noopener nofollow"}}_updateData(t){!t||t.sourceDataType!=="metadata"&&t.sourceDataType!=="visibility"&&t.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let t=[];if(this._map.style.stylesheet){const G=this._map.style.stylesheet;this.styleOwner=G.owner,this.styleId=G.id}const l=this._map.style._mergedSourceCaches;for(const G in l){const Z=l[G];if(Z.used){const Y=Z.getSource();Y.attribution&&t.indexOf(Y.attribution)<0&&t.push(Y.attribution)}}t.sort((G,Z)=>G.length-Z.length),t=t.filter((G,Z)=>{for(let Y=Z+1;Y<t.length;Y++)if(t[Y].indexOf(G)>=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=[...this.options.customAttribution,...t]:t.unshift(this.options.customAttribution));const B=t.join(" | ");B!==this._attribHTML&&(this._attribHTML=B,t.length?(this._innerContainer.innerHTML=B,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 ys{constructor(){o.aP(["_updateLogo","_updateCompact"],this)}onAdd(t){this._map=t,this._container=ge("div","mapboxgl-ctrl");const l=ge("a","mapboxgl-ctrl-logo");return l.target="_blank",l.rel="noopener nofollow",l.href="https://www.mapbox.com/",l.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),l.setAttribute("rel","noopener nofollow"),this._container.appendChild(l),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(t){t&&t.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const t=this._map.style._sourceCaches;if(Object.entries(t).length===0)return!0;for(const l in t){const B=t[l].getSource();if(B.hasOwnProperty("mapbox_logo")&&!B.mapbox_logo)return!1}return!0}_updateCompact(){const t=this._container.children;if(t.length){const l=t[0];this._map.getCanvasContainer().offsetWidth<250?l.classList.add("mapboxgl-compact"):l.classList.remove("mapboxgl-compact")}}}class vs{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const l=++this._id;return this._queue.push({callback:t,id:l,cancelled:!1}),l}remove(t){const l=this._currentlyRunning,B=l?this._queue.concat(l):this._queue;for(const G of B)if(G.id===t)return void(G.cancelled=!0)}run(t=0){const l=this._currentlyRunning=this._queue;this._queue=[];for(const B of l)if(!B.cancelled&&(B.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class zo{constructor(t){this.jumpTo(t)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const l=o.cB((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-l)+this._end*l}isEasing(t){return t>=this._startTime&&t<=this._endTime}jumpTo(t){this._startTime=-1/0,this._endTime=-1/0,this._start=t,this._end=t}easeTo(t,l,B){this._start=this.getValue(l),this._end=t,this._startTime=l,this._endTime=l+B}}const so={"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 ao extends o.z{constructor(t,l,B,G){const{point:Z,lngLat:Y,originalEvent:re,target:oe}=t;super(t.type,{point:Z,lngLat:Y,originalEvent:re,target:oe}),this.preventDefault=()=>{t.preventDefault()},this.id=l,this.interaction=B,this.feature=G}}class mu{constructor(t){this.map=t,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: 5,364 bytes, line 2668
2668add(t,l){if(this.typeById.has(t))throw new Error(`Interaction id "${t}" already exists.`);const B=l.filter;let G=l.type;B&&this.filters.set(t,o.aZ(B)),G==="mouseover"&&(G="mouseenter"),G==="mouseout"&&(G="mouseleave");const Z=this.interactionsByType.get(G)||new Map;G==="mouseenter"||G==="mouseleave"?(this.delegatedInteractions.size===0&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(t,l)):Z.size===0&&this.map.on(G,this.handleType),Z.size===0&&this.interactionsByType.set(G,Z),Z.set(t,l),this.typeById.set(t,G)}get(t){const l=this.typeById.get(t);if(!l)return;const B=this.interactionsByType.get(l);return B?B.get(t):void 0}remove(t){const l=this.typeById.get(t);if(!l)return;this.typeById.delete(t),this.filters.delete(t);const B=this.interactionsByType.get(l);B&&(B.delete(t),l==="mouseenter"||l==="mouseleave"?(this.delegatedInteractions.delete(t),this.delegatedInteractions.size===0&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):B.size===0&&this.map.off(l,this.handleType))}queryTargets(t,l){const B=[];for(const[G,Z]of l)Z.target&&B.push({targetId:G,target:Z.target,filter:this.filters.get(G)});return this.map.style.queryRenderedTargets(t,B,this.map.transform)}handleMove(t){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const l=this.queryTargets(t.point,Array.from(this.delegatedInteractions).reverse());l.length&&(t.type="mouseenter",this.handleType(t,l));const B=new Map;for(const[G,{feature:Z}]of this.prevHoveredFeatures)this.hoveredFeatures.has(G)||B.set(Z.id,Z);B.size&&(t.type="mouseleave",this.handleType(t,Array.from(B.values())))}handleOut(t){const l=Array.from(this.hoveredFeatures.values()).map(({feature:B})=>B);l.length&&(t.type="mouseleave",this.handleType(t,l)),this.hoveredFeatures.clear()}handleType(t,l){const B=Array.from(this.interactionsByType.get(t.type)).reverse(),G=!!l;l=l||this.queryTargets(t.point,B);const Z=t.type==="mouseenter";let Y=!1;const re=new Set;for(const oe of l){for(const[ce,he]of B){if(!he.target)continue;const pe=oe.variants?oe.variants[ce]:null;if(pe){for(const fe of pe){if(na(fe,oe,re,ce))continue;const be=new o.cw(oe,fe),ze=$o(fe,oe,ce);G&&(be.state=this.map.getFeatureState(be));const De=Z?this.prevHoveredFeatures.get(ze):null,Oe=new ao(t,ce,he,be),Fe=De?De.stop:he.handler(Oe);if(Z&&this.hoveredFeatures.set(ze,{feature:oe,stop:Fe}),Fe!==!1){Y=!0;break}}if(Y)break}}if(Y)break}if(!Y)for(const[oe,ce]of B){const{handler:he,target:pe}=ce;if(!pe&&he(new ao(t,oe,ce,null))!==!1)break}}}function _r(F,t){if(Array.isArray(F)&&Array.isArray(t)){const l=new Set(F),B=new Set(t);return l.size===B.size&&F.every(G=>B.has(G))}return o.bn(F,t)}const za={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,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1,spriteFormat:"auto"},ff={showCompass:!0,showZoom:!0,visualizePitch:!1};class mf{constructor(t,l,B=!1){this._clickTolerance=10,this.element=l,this.mouseRotate=new Ys({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,B&&(this.mousePitch=new Rl({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),o.aP(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),l.addEventListener("mousedown",this.mousedown),l.addEventListener("touchstart",this.touchstart,{passive:!1}),l.addEventListener("touchmove",this.touchmove),l.addEventListener("touchend",this.touchend),l.addEventListener("touchcancel",this.reset)}down(t,l){this.mouseRotate.mousedown(t,l),this.mousePitch&&this.mousePitch.mousedown(t,l),et()}move(t,l){const B=this.map,G=this.mouseRotate.mousemoveWindow(t,l),Z=G&&G.bearingDelta;if(Z&&B.setBearing(B.getBearing()+Z),this.mousePitch){const Y=this.mousePitch.mousemoveWindow(t,l),re=Y&&Y.pitchDelta;re&&B.setPitch(B.getPitch()+re)}}off(){const t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart,{passive:!1}),t.removeEventListener("touchmove",this.touchmove),t.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){Mt(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(t){this.down(o.l({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),Bt(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(t){this.move(t,Bt(this.element,t))}mouseup(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()}touchstart(t){t.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=
vendor: 5,304 bytes, line 2668
2668Zt(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>t.preventDefault()},this._startPos))}touchmove(t){t.targetTouches.length!==1?this.reset():(this._lastPos=Zt(this.element,t.targetTouches)[0],this.move({preventDefault:()=>t.preventDefault()},this._lastPos))}touchend(t){t.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}function Fc(F,t,l){if(F=new o.bO(F.lng,F.lat),t){const B=new o.bO(F.lng-360,F.lat),G=new o.bO(F.lng+360,F.lat),Z=360*Math.ceil(Math.abs(F.lng-l.center.lng)/360),Y=l.locationPoint(F).distSqr(t),re=t.x<0||t.y<0||t.x>l.width||t.y>l.height;l.locationPoint(B).distSqr(t)<Y&&(re||Math.abs(B.lng-l.center.lng)<Z)?F=B:l.locationPoint(G).distSqr(t)<Y&&(re||Math.abs(G.lng-l.center.lng)<Z)&&(F=G)}for(;Math.abs(F.lng-l.center.lng)>180;){const B=l.locationPoint(F);if(B.x>=0&&B.y>=0&&B.x<=l.width&&B.y<=l.height)break;F.lng>l.center.lng?F.lng-=360:F.lng+=360}return F}const Js={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class Os extends o.E{constructor(t,l){if(super(),(t instanceof HTMLElement||l)&&(t=o.l({element:t},l)),o.aP(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=t&&t.occludedOpacity||.2,t&&t.element)this._element=t.element,this._offset=o.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=ge("div");const Z=41,Y=27,re=Se("svg",{display:"block",height:Z*this._scale+"px",width:Y*this._scale+"px",viewBox:`0 0 ${Y} ${Z}`},this._element),oe=Se("radialGradient",{id:"shadowGradient"},Se("defs",{},re));Se("stop",{offset:"10%","stop-opacity":.4},oe),Se("stop",{offset:"100%","stop-opacity":.05},oe),Se("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},re),Se("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"},re),Se("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"},re),Se("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},re),this._offset=o.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",Z=>{Z.preventDefault()}),this._element.addEventListener("mousedown",Z=>{Z.preventDefault()});const B=this._element.classList;for(const Z in Js)B.remove(`mapboxgl-marker-anchor-${Z}`);B.add(`mapboxgl-marker-anchor-${this._anchor}`);const G=t&&t.className?t.className.trim().split(/\s+/):[];B.add(...G),this._popup=null}addTo(t){return t===this._map||(this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._updateMoving),t.on("moveend",this._update),t.on("remove",this._clearFadeTimer),t._addMarker(this),this.setDraggable(this._draggable),this._update(),t.on("click",this._onMapClick)),this}remove(){const t=this._map;return t&&(t.off("click",this._onMapClick),t.off("move",this._updateMoving),t.off("moveend",this._update),t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler),t.off("mouseup",this._onUp),t.off("touchend",this._onUp),t.off("mousemove",this._onMove),t.off("touchmove",this._onMove),t.off("remove",this._clearFadeTimer),t._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=o.bO.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(t){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")),t){if(!("offset"in t.options)){const G=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
vendor: 8,093 bytes, lines 2668-2673
26680,-38.1],"bottom-left":[G,-1*(38.1-13.5+G)],"bottom-right":[-G,-1*(38.1-13.5+G)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,t._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(t){const l=t.code,B=t.charCode||t.keyCode;l!=="Space"&&l!=="Enter"&&B!==32&&B!==13||this.togglePopup()}_onMapClick(t){const l=t.originalEvent.target,B=this._element;this._popup&&(l===B||B.contains(l))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?(t.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(t.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const t=this._map,l=this._pos;if(!t||!l)return!1;const B=t.unproject(l),G=t.getFreeCameraOptions();if(!G.position)return!1;const Z=G.position.toLngLat();return Z.distanceTo(B)<.9*Z.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const l=this._pos;if(!l||l.x<0||l.x>t.transform.width||l.y<0||l.y>t.transform.height)return void this._clearFadeTimer();const B=t.unproject(l);let G;t._showingGlobe()&&o.dH(t.transform,this._lngLat)?G=0:(G=1-t._queryFogOpacity(B),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(G*=this._occludedOpacity)),this._element.style.opacity=`${G}`,this._element.style.pointerEvents=G>0?"auto":"none",this._popup&&this._popup._setOpacity(G),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const t=this._pos;if(!t||!this._map)return;const l=this._offset.mult(this._scale);this._element.style.transform=`
2669            translate(${t.x}px,${t.y}px)
2670            ${Js[this._anchor]}
2671            ${this._calculateXYTransform()} ${this._calculateZTransform()}
2672            translate(${l.x}px,${l.y}px)
2673        `}_calculateXYTransform(){const t=this._pos,l=this._map,B=this.getPitchAlignment();if(!l||!t||B!=="map")return"";if(!l._showingGlobe()){const oe=l.getPitch();return oe?`rotateX(${oe}deg)`:""}const G=o.c4(o.dI(l.transform,this._lngLat)),Z=t.sub(o.dJ(l.transform)),Y=Math.abs(Z.x)+Math.abs(Z.y);if(Y===0)return"";const re=G/Y;return`rotateX(${-Z.y*re}deg) rotateY(${Z.x*re}deg)`}_calculateZTransform(){const t=this._pos,l=this._map;if(!l||!t)return"";let B=0;const G=this.getRotationAlignment();if(G==="map")if(l._showingGlobe()){const Z=l.project(new o.bO(this._lngLat.lng,this._lngLat.lat+.001)),Y=l.project(new o.bO(this._lngLat.lng,this._lngLat.lat-.001)).sub(Z);B=o.c4(Math.atan2(Y.y,Y.x))-90}else B=-l.getBearing();else if(G==="horizon"){const Z=o.ac(4,6,l.getZoom()),Y=o.dJ(l.transform);Y.y+=Z*l.transform.height;const re=t.sub(Y),oe=o.c4(Math.atan2(re.y,re.x));B=(oe>90?oe-270:oe+90)*(1-Z)}return B+=this._rotation,B?`rotateZ(${B}deg)`:""}_update(t){cancelAnimationFrame(this._updateFrameId);const l=this._map;l&&(l.transform.renderWorldCopies&&(this._lngLat=Fc(this._lngLat,this._pos,l.transform)),this._pos=l.project(this._lngLat),t===!0?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),l._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(l._showingGlobe()||l.getTerrain()||l.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(t){return this._offset=o.P.convert(t),this._update(),this}addClassName(t){return this._element.classList.add(t),this}removeClassName(t){return this._element.classList.remove(t),this}toggleClassName(t){return this._element.classList.toggle(t)}_onMove(t){const l=this._map;if(!l)return;const B=this._pointerdownPos,G=this._positionDelta;if(B&&G){if(!this._isDragging){const Z=this._clickTolerance||l._clickTolerance;if(t.point.dist(B)<Z)return;this._isDragging=!0}this._pos=t.point.sub(G),this._lngLat=l.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new o.z("dragstart"))),this.fire(new o.z("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)),this._state==="active"&&this.fire(new o.z("dragend")),this._state="inactive"}_addDragHandler(t){const l=this._map,B=this._pos;l&&B&&this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(B),this._pointerdownPos=t.point,this._state="pending",l.on("mousemove",this._onMove),l.on("touchmove",this._onMove),l.once("mouseup",this._onUp),l.once("touchend",this._onUp))}setDraggable(t){this._draggable=!!t;const l=this._map;return l&&(t?(l.on("mousedown",this._addDragHandler),l.on("touchstart",this._addDragHandler)):(l.off("mousedown",this._addDragHandler),l.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment==="auto"||this._rotationAlignment==="horizon"&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t||"auto",this._update(),this}getPitchAlignment(){return this._pitchAlignment==="auto"?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(t){return this._occludedOpacity=t||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const ns={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},fs={maxWidth:100,unit:"metric"},Bn={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},jd={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},cs=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function gu(F=new o.P(0,0),t="bottom"){if(typeof F=="number"){const l=Math.round(Math.sqrt(.5*Math.pow(F,2)));switch(t){case"top":return new o.P(0,F);case"top-left":return new o.P(l,l);case"top-right":return new o.P(-l,l);case"bottom":return new o.P(0,-F);case"bottom-left":return new o.P(l,-l);case"bottom-right":return new o.P(-l,-l);case"left":return new o.P(F,0);case"right":return new o.P(-F,0)}return new o.P(0,0)}return F instanceof o.P||Array.isArray(F)?o.P.convert(F):o.P.convert(F[t]||[0,0])}return{version:Te,supported:ye.supported,setRTLTextPlugin:o.dK,getRTLTextPluginStatus:o.dL,Map:class extends Ro{constructor(F){ve.mark(Pe.create);const t=F;if((F=o.l({},za,F)).minZoom!=null&&F.maxZoom!=null&&F.minZoom>F.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(F.minPitch!=null&&F.maxPitch!=null&&F.minPitch>F.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(F.minPitch!=null&&F.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(F.maxPitch!=null&&F.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(F.antialias&&o.dF(window)&&(F.antialias=!1,o.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new rl(F.minZoom,F.maxZoom,F.minPitch,F.maxPitch,F.renderWorldCopies),F),this._repaint=!!F.repaint,this._interactive=F.interactive,this._minTileCacheSize=F.minTileCacheSize,this._maxTileC
2673acheSize=F.maxTileCacheSize,this._failIfMajorPerformanceCaveat=F.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=F.preserveDrawingBuffer,this._antialias=F.antialias,this._trackResize=F.trackResize,this._bearingSnap=F.bearingSnap,this._refreshExpiredTiles=F.refreshExpiredTiles,this._fadeDuration=F.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=F.crossSourceCollisions,this._collectResourceTiming=F.collectResourceTiming,this._language=this._parseLanguage(F.language),this._worldview=F.worldview,this._renderTaskQueue=new vs,this._domRenderTaskQueue=new vs,this._controls=[],this._markers=[],this._popups=[],this._mapId=o.aV(),this._locale=o.l({},so,F.locale),this._clickTolerance=F.clickTolerance,this._cooperativeGestures=F.cooperativeGestures,this._performanceMetricsCollection=F.performanceMetricsCollection,this._tessellationStep=F.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=F.precompilePrograms,this._scaleFactorChanged=!1,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new zo(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=F.scaleFactor,this._requestManager=new lt(F.transformRequest,F.accessToken,F.testMode),this._silenceAuthErrors=!!F.testMode,this._contextCreateOptions=F.contextCreateOptions?Object.assign({},F.contextCreateOptions):{},typeof F.container=="string"){const l=document.getElementById(F.container);if(!l)throw new Error(`Container '${F.container.toString()}' not found.`);this._container=l}else{if(!(F.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=F.container}if(this._container.childNodes.length>0&&o.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."),F.maxBounds&&this.setMaxBounds(F.maxBounds),this._spriteFormat=F.spriteFormat,o.aP(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._tp||(this._tp=new nu),this._tp.registerParameter(this,["Debug"],"showOverdrawInspector"),this._tp.registerParameter(this,["Debug"],"showTileBoundaries"),this._tp.registerParameter(this,["Debug"],"showParseStatus"),this._tp.registerParameter(this,["Debug"],"repaint"),this._tp.registerParameter(this,["Debug"],"showTileAABBs"),this._tp.registerParameter(this,["Debug"],"showPadding"),this._tp.registerParameter(this,["Debug"],"showCollisionBoxes",{noSave:!0}),this._tp.registerParameter(this.transform,["Debug"],"freezeTileCoverage",{noSave:!0},()=>{this._update()}),this._tp.registerParameter(this,["Debug","Wireframe"],"showTerrainWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers2DWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers3DWireframe"),this._tp.registerParameter(this,["Scaling"],"_scaleFactor",{min:.1,max:10,step:.1},()=>{this.setScaleFactor(this._scaleFactor)}),this._setupPainter(),this.painter===void 0)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 Vd(this,F),this._localFontFamily=F.localFontFamily,this._localIdeographFontFamily=F.localIdeographFontFamily,(F.style||!F.testMode)&&this.setStyle(F.style||o.e.DEFAULT_STYLE,{config:F.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),F.projection&&this.setProjection(F.projection),this.indoor=new xh(this),F.hash&&(this._hash=new Cd(typeof F.hash=="string"&&F.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){t.center==null&&t.zoom==null||(this.transform._unmodified=!1),this.jumpTo({center:F.center,zoom:F.zoom,bearing:F.bearing,pitch:F.pitch});const l=F.bounds;l&&(this.resize(),this.fitBounds(l,o.l({},F.fitBoundsOptions,{duration:0})))}this.resize(),F.attributionControl&&this.addControl(new Lc({customAttribution:F.customAttribution}
vendor: 10,680 bytes, line 2673
2673)),this._logoControl=new ys,this.addControl(this._logoControl,F.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent()}),this.on("data",l=>{this._update(l.dataType==="style"),this.fire(new o.z(`${l.dataType}data`,l))}),this.on("dataloading",l=>{this.fire(new o.z(`${l.dataType}dataloading`,l))}),this._interactions=new mu(this)}_getMapId(){return this._mapId}addControl(F,t){if(t===void 0&&(t=F.getDefaultPosition?F.getDefaultPosition():"top-right"),!F||!F.onAdd)return this.fire(new o.y(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const l=F.onAdd(this);this._controls.push(F);const B=this._controlPositions[t];return t.indexOf("bottom")!==-1?B.insertBefore(l,B.firstChild):B.appendChild(l),this}removeControl(F){if(!F||!F.onRemove)return this.fire(new o.y(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(F);return t>-1&&this._controls.splice(t,1),F.onRemove(this),this}hasControl(F){return this._controls.indexOf(F)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(F){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const t=!this._moving;return t&&this.fire(new o.z("movestart",F)).fire(new o.z("move",F)),this.fire(new o.z("resize",F)),t&&this.fire(new o.z("moveend",F)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(F){return this.transform.setMaxBounds(o.az.convert(F)),this._update()}setMinZoom(F){if((F=F??-2)>=-2&&F<=this.transform.maxZoom)return this.transform.minZoom=F,this._update(),this.getZoom()<F?this.setZoom(F):this.fire(new o.z("zoomstart")).fire(new o.z("zoom")).fire(new o.z("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(F){if((F=F??22)>=this.transform.minZoom)return this.transform.maxZoom=F,this._update(),this.getZoom()>F?this.setZoom(F):this.fire(new o.z("zoomstart")).fire(new o.z("zoom")).fire(new o.z("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(F){if((F=F??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(F>=0&&F<=this.transform.maxPitch)return this.transform.minPitch=F,this._update(),this.getPitch()<F?this.setPitch(F):this.fire(new o.z("pitchstart")).fire(new o.z("pitch")).fire(new o.z("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(F){if((F=F??85)>85)throw new Error("maxPitch must be less than or equal to 85");if(F>=this.transform.minPitch)return this.transform.maxPitch=F,this._update(),this.getPitch()>F?this.setPitch(F):this.fire(new o.z("pitchstart")).fire(new o.z("pitch")).fire(new o.z("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(F){return this._scaleFactor=F,this.painter.scaleFactor=F,this._tp.refreshUI(),this._scaleFactorChanged=!0,this.style._updateFilteredLayers(t=>t.type==="symbol"),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(F){return this.transform.renderWorldCopies=F,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(F){return F==="auto"?navigator.language:Array.isArray(F)?F.length===0?void 0:F.map(t=>t==="auto"?navigator.language:t):F}setLanguage(F){const t=this._parseLanguage(F);if(!this.style||t===this._language)return this;this._language=t,this.style.reloadSources();for(const l of this._controls)l._setLanguage&&l._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(F){return this.style&&F!==this._worldview?(this._worldview=F,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return this.transform.projection.name==="globe"}setProjection(F){return this._lazyInitEmptyStyle(),F?typeof F=="string"&&(F={name:F}):F=null,this._useExplicitProjection=!!F,this._prioritizeAndUpdateProjection(F,this.style.projection)}_updateProjectionTransition(){if(this.getProjection().name!=="globe")return;const F=this.transform,t=F.projection.name;let l;t==="globe"&&F.zoom>=o.bY?(F.setMercatorFromTransition(),l=!0):t==="mercator"&&F.zoom<o.bY&&(F.setProjection({name:"globe"}),l=!0),l&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate())}_prioritizeAndUpdateProjection(F,t){return this._updateProjection(F||t||{name:"mercator"})}_updateProjection(F){let t;return t=F.name==="globe"&&this.transform.zoom>=o.bY?this.transform.setMercatorFromTransition():this.transform.setProjection(F),this.style.applyProjectionUpdate(),t&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(F){return this.transform.locationPoint3D(o.bO.convert(F))}unproject(F){return this.transform.pointLocation3D(o.P.convert(F))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(F,t,l){const B=G=>{let Z=[];if(Array.isArray(t)){const Y=t.filter(re=>this.getLayer(re));Z=Y.length?this.queryRenderedFeatures(G,{layers:Y}):[]}else Z=this.queryRenderedFeatures(G,{target:t});return Z};if(F==="mouseenter"||F==="mouseover"){let G=!1;return{listener:l,targets:t,delegates:{mousemove:Y=>{const re=B(Y.point);re.length?G||(G=!0,l.call(this,new ps(F,this,Y.originalEvent,{features:re}))):G=!1},mouseout:()=>{G=!1}}}}if(F==="mouseleave"||F==="mouseout"){let G=!1;return{listener:l,targets:t,delegates:{mousemove:re=>{B(re.point).length?G=!0:G&&(G=!1,l.call(this,new ps(F,this,re.originalEvent)))},mouseout:re=>{G&&(G=!1,l.call(this,new ps(F,this,re.originalEvent)))}}}}{const G=Z=>{const Y=B(Z.point);Y.length&&(Z.features=Y,l.call(this,Z),delete Z.features)};return{listener:l,targets:t,delegates:{[F]:G}}}}on(F,t,l){if(typeof t=="function"||l===void 0)return super.on(F,t);if(typeof t=="string"&&(t=[t]),!this._areTargetsValid(t))return this;const B=this._createDelegatedListener(F,t,l);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[F]=this._delegatedListeners[F]||[],this._delegatedListeners[F].push(B);for(const G in B.delegates)this.on(G,B.delegates[G]);return this}once(F,t,l){if(typeof t=="function"||l===void 0)return super.once(F,t);if(typeof t=="string"&&(t=[t]),!this._areTargetsValid(t))return this;const B=this._createDelegatedListener(F,t,l);for(const G in B.delegates)this.once(G,B.delegates[G]);return this}off(F,t,l){if(typeof t=="function"||l===void 0)return super.off(F,t);if(typeof t=="string"&&(t=[t]),!this._areTargetsValid(t))return this;const B=this._delegatedListeners?this._delegatedListeners[F]:void 0;return B&&(G=>{for(let Z=0;Z<G.length;Z++){const Y=G[Z];if(Y.listener===l&&_r(Y.targets,t)){for(const re in Y.delegates)this.off(re,Y.delegates[re]);return G.splice(Z,1),this}}})(B),this}queryRenderedFeatures(F,t){if(!this.style)return[];if(F===void 0||F instanceof o.P||Array.isArray(F)||t!==void 0||(t=F,F=void 0),F=F||[[0,0],[this.transform.width,this.transform.height]],!t){const Z=this.style.queryRenderedFeatures(F,void 0,this.transform),Y=this.style.queryRenderedFeatureset(F,void 0,this.transform);return Z.concat(Y)}let l=!0;if(t.target&&(l=this._isTargetValid(t.target),l&&!t.layers))return this.style.queryRenderedFeatureset(F,t,this.transform);let B=!0;if(t.layers&&Array.isArray(t.layers)){for(const Z of t.layers)if(!this._isValidId(Z)){B=!1;break}if(B&&!t.target)return this.style.queryRenderedFeatures(F,t,this.transform)}let G=[];return B&&(G=G.concat(this.style.queryRenderedFeatures(F,t,this.transform))),l&&(G=G.concat(this.style.queryRenderedFeatureset(F,t,this.transform))),G}querySourceFeatures(F,t){return!F||typeof F=="string"&&!this._isValidId(F)?[]:this.style.querySourceFeatures(F,t)}isPointOnSurface(F){const{name:t}=this.transform.projection;return t!=="globe"&&t!=="mercator"&&o.w(`${t} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(o.P.convert(F))}addInteraction(F,t){return this._interactions.add(F,t),this}removeInteraction(F){return this._interactions.remove(F),this}setStyle(F,t){return t=o.l({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},t),this.style&&F&&t.diff!==!1&&t.localFontFamily===this._localFontFamily&&t.localIdeographFontFamily===this._localIdeographFontFamily&&!t.config?(this.style._diffStyle(F,(l,B)=>{l?(o.w(`Unable to perform style diff: ${String(l.message||l.error||l)}. Rebuilding the style from scratch.`),this._updateStyle(F,t)):B&&this._update(!0)},()=>{this._postStyleLoadEvent()}),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._localFontFamily=t.localFontFamily,this._updateStyle(F,t))}_getUIString(F){const t=this._locale[F];if(t==null)throw new Error(`Missing UI string '${F}'`);return t}_updateStyle(F,t){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),F){const l=o.l({},t);t&&t.config&&(l.initialConfig=t.config,delete l.config),this.style=new Ms(this,l).load(F),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Ms(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():(o.w("There is no style added to the map."),!1)}_isValidId(F){return F==null?(this.fire(new o.y(new Error("IDs can't be empty."))),!1):!o.cr(F)||(this.fire(new o.y(new Error(`IDs can't 
2673contain special symbols: "${F}".`))),!1)}_isTargetValid(F){return"featuresetId"in F?this._isValidId("importId"in F?F.importId:F.featuresetId):"layerId"in F&&this._isValidId(F.layerId)}_areTargetsValid(F){if(Array.isArray(F)){for(const t of F)if(!this._isValidId(t))return!1;return!0}return this._isTargetValid(F)}addSource(F,t){return this._isValidId(F)?(this._lazyInitEmptyStyle(),this.style.addSource(F,t),this._update(!0)):this}isSourceLoaded(F){return!!this._isValidId(F)&&!!this.style&&this.style._isSourceCacheLoaded(F)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(F,t,l){this._lazyInitEmptyStyle(),this.style.addSourceType(F,t,l)}removeSource(F){return this._isValidId(F)?(this.style.removeSource(F),this._updateTerrain(),this._update(!0)):this}getSource(F){return this._isValidId(F)?this.style.getOwnSource(F):null}addImage(F,t,{pixelRatio:l=1,sdf:B=!1,stretchX:G,stretchY:Z,content:Y}={}){if(this._lazyInitEmptyStyle(),t instanceof HTMLImageElement||ImageBitmap&&t instanceof ImageBitmap){const{width:re,height:oe,data:ce}=o.q.getImageData(t);this.style.addImage(F,{data:new o.r({width:re,height:oe},ce),pixelRatio:l,stretchX:G,stretchY:Z,content:Y,sdf:B,version:0,usvg:!1})}else if(t.width===void 0||t.height===void 0)this.fire(new o.y(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:re,height:oe}=t,ce=t;this.style.addImage(F,{data:new o.r({width:re,height:oe},new Uint8Array(ce.data)),pixelRatio:l,stretchX:G,stretchY:Z,content:Y,sdf:B,usvg:!1,version:0,userImage:ce}),ce.onAdd&&ce.onAdd(this,F)}}updateImage(F,t){this._lazyInitEmptyStyle();const l=this.style.getImage(F);if(!l)return void this.fire(new o.y(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const B=t instanceof HTMLImageElement||ImageBitmap&&t instanceof ImageBitmap?o.q.getImageData(t):t,{width:G,height:Z,data:Y}=B;if(G===void 0||Z===void 0)return void this.fire(new o.y(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(G!==(l.usvg?l.icon.usvg_tree.width:l.data.width)||Z!==(l.usvg?l.icon.usvg_tree.height:l.data.height))return void this.fire(new o.y(new Error(`The width and height of the updated image (${G}, ${Z})
2674                must be that same as the previous version of the image
2675                (${l.data.width}, ${l.data.height})`)));const re=!(t instanceof HTMLImageElement||ImageBitmap&&t instanceof ImageBitmap);let oe=!1;l.usvg?(l.data=new o.r({width:G,height:Z},new Uint8Array(Y)),l.usvg=!1,l.icon=void 0,oe=!0):l.data.replace(Y,re),this.style.updateImage(F,l,oe)}hasImage(F){return F?!!this.style&&!!this.style.getImage(F):(this.fire(new o.y(new Error("Missing required image id"))),!1)}removeImage(F){this.style.removeImage(F)}loadImage(F,t){o.o(this._requestManager.transformRequest(F,o.R.Image),(l,B)=>{t(l,B instanceof HTMLImageElement?o.q.getImageData(B):B)})}listImages(){return this.style.listImages()}addModel(F,t){this._lazyInitEmptyStyle(),this.style.addModel(F,t)}hasModel(F){return F?this.style.hasModel(F):(this.fire(new o.y(new Error("Missing required model id"))),!1)}removeModel(F){this.style.removeModel(F)}listModels(){return this.style.listModels()}addLayer(F,t){return this._isValidId(F.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(F,t),this._update(!0)):this}getSlot(F){const t=this.getLayer(F);return t&&t.slot||null}setSlot(F,t){return this.style.setSlot(F,t),this.style.mergeLayers(),this._update(!0)}addImport(F,t){return this.style.addImport(F,t),this}updateImport(F,t){return typeof t!="string"&&t.id!==F?(this.removeImport(F),this.addImport(t)):(this.style.updateImport(F,t),this._update(!0))}removeImport(F){return this.style.removeImport(F),this}moveImport(F,t){return this.style.moveImport(F,t),this._update(!0)}moveLayer(F,t){return this._isValidId(F)?(this.style.moveLayer(F,t),this._update(!0)):this}removeLayer(F){return this._isValidId(F)?(this.style.removeLayer(F),this._update(!0)):this}getLayer(F){if(!this._isValidId(F))return null;const t=this.style.getOwnLayer(F);return t?t.type==="custom"?t.implementation:t.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(F,t,l){return this._isValidId(F)?(this.style.setLayerZoomRange(F,t,l),this._update(!0)):this}setFilter(F,t,l={}){return this._isValidId(F)?(this.style.setFilter(F,t,l),this._update(!0)):this}getFilter(F){return this._isValidId(F)?this.style.getFilter(F):null}setPaintProperty(F,t,l,B={}){return this._isValidId(F)?(this.style.setPaintProperty(F,t,l,B),this._update(!0)):this}getPaintProperty(F,t){return this._isValidId(F)?this.style.getPaintProperty(F,t):null}setLayoutProperty(F,t,l,B={}){return this._isValidId(F)?(this.style.setLayoutProperty(F,t,l,B),this._update(!0)):this}getLayoutProperty(F,t){return this._isValidId(F)?this.style.getLayoutProperty(F,t):null}getSchema(F){return this.style.getSchema(F)}setSchema(F,t){return this.style.setSchema(F,t),this._update(!0)}getConfig(F){return this.style.getConfig(F)}setConfig(F,t){return this.style.setConfig(F,t),this._update(!0)}getConfigProperty(F,t){return this.style.getConfigProperty(F,t)}setConfigProperty(F,t,l){return this.style.setConfigProperty(F,t,l),this._update(!0)}getFeaturesetDescriptors(F){return this.style.getFeaturesetDescriptors(F)}setLights(F){if(this._lazyInitEmptyStyle(),F&&F.length===1&&F[0].type==="flat"){const t=F[0];t.properties?this.style.setFlatLight(t.properties,t.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(F),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const F=this.style.getLights()||[];return F.length===0&&F.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),F}setLight(F,t={}
vendor: 21,450 bytes, line 2675
2675){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:F}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(F){return this._lazyInitEmptyStyle(),!F&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(F),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(F){return this._lazyInitEmptyStyle(),this.style.setFog(F),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(F){return this._lazyInitEmptyStyle(),this.style.setSnow(F),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(F){return this._lazyInitEmptyStyle(),this.style.setRain(F),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(F){return this._lazyInitEmptyStyle(),this.style.setColorTheme(F),this._update(!0)}setImportColorTheme(F,t){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(F,t),this._update(!0)}setCamera(F){return this.style.setCamera(F),this._triggerCameraUpdate(F)}_triggerCameraUpdate(F){return this._update(this.transform.setOrthographicProjectionAtLowPitch(F["camera-projection"]==="orthographic"))}getCamera(){return this.style.camera}_queryFogOpacity(F){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(o.bO.convert(F),this.transform):0}setFeatureState(F,t){return F.source&&!this._isValidId(F.source)?this:(this.style.setFeatureState(F,t),this._update())}removeFeatureState(F,t){return F.source&&!this._isValidId(F.source)?this:(this.style.removeFeatureState(F,t),this._update())}getFeatureState(F){return F.source&&!this._isValidId(F.source)?null:this.style.getFeatureState(F)}_updateContainerDimensions(){if(!this._container)return;const F=this._container.getBoundingClientRect().width||400,t=this._container.getBoundingClientRect().height||300;let l,B,G,Z=this._container;for(;Z&&(!B||!G);){const Y=window.getComputedStyle(Z).transform;Y&&Y!=="none"&&(l=Y.match(/matrix.*\((.+)\)/)[1].split(", "),l[0]&&l[0]!=="0"&&l[0]!=="1"&&(B=l[0]),l[3]&&l[3]!=="0"&&l[3]!=="1"&&(G=l[3])),Z=Z.parentElement}this._containerWidth=B?Math.abs(F/B):F,this._containerHeight=G?Math.abs(t/G):t}_detectMissingCSS(){window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&o.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 F=this._container;F.classList.add("mapboxgl-map"),(this._missingCSSCanary=ge("div","mapboxgl-canary",F)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=ge("div","mapboxgl-canvas-container",F);this._canvas=ge("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 l=this._controlContainer=ge("div","mapboxgl-control-container",F),B=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(G=>{B[G]=ge("div",`mapboxgl-ctrl-${G}`,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(F,t){const l=o.q.devicePixelRatio||1;this._canvas.width=l*Math.ceil(F),this._canvas.height=l*Math.ceil(t),this._canvas.style.width=`${F}px`,this._canvas.style.height=`${t}px`}_addMarker(F){this._markers.push(F)}_removeMarker(F){const t=this._markers.indexOf(F);t!==-1&&this._markers.splice(t,1)}_addPopup(F){this._popups.push(F)}_removePopup(F){const t=this._popups.indexOf(F);t!==-1&&this._popups.splice(t,1)}_setupPainter(){const F=o.l({},ye.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),t=this._canvas.getContext("webgl2",F);t?(Mn(t,!0),this.painter=new cu(t,this._contextCreateOptions,this.transform,this._scaleFactor,this._tp),this.on("data",l=>{l.dataType==="source"&&this.painter.setTileLoadedFlag(!0)}),o.m.testSupport(t)):this.fire(new o.y(new Error("Failed to initialize WebGL")))}_contextLost(F){F.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new o.z("webglcontextlost",{originalEvent:F}))}_contextRestored(F){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style.reloadModels(),this.style.clearSources(),this._update(),this.fire(new o.z("webglcontextrestored",{originalEvent:F}))}_onMapScroll(F){if(F.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(F){return this.style?(this._styleDirty=this._styleDirty||F,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(F){return this._update(),this._renderTaskQueue.add(F)}_cancelRenderFrame(F){this._renderTaskQueue.remove(F)}_requestDomTask(F){!this.loaded()||this.loaded()&&!this.isMoving()?F():this._domRenderTaskQueue.add(F)}_render(F){let t;this.fire(new o.z("renderstart")),++this._frameId;const l=this.painter.context.extTimerQuery,B=o.q.now(),G=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(t=G.createQuery(),G.beginQuery(l.TIME_ELAPSED_EXT,t)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(F),this._domRenderTaskQueue.run(F),this._removed)return;this._updateProjectionTransition();const Z=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const ce=this.transform.zoom,he=this.transform.pitch,pe=o.q.now(),fe=new o.a8(ce,{now:pe,fadeDuration:Z,pitch:he,transition:this.style.transition});this.style.update(fe)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let Y=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),Y=this._updateAverageElevation(B),this.style.updateSources(this.transform),this._forceMarkerAndPopupUpdate()):Y=this._updateAverageElevation(B);const re=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,Z,this._crossSourceCollisions,this.painter.replacementSource,this._scaleFactorChanged);if(this._scaleFactorChanged&&(this._scaleFactorChanged=!1),re&&(this._placementDirty=re.needsRerender),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:Z,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new o.z("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,ve.mark(Pe.load),this.fire(new o.z("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),t){const ce=o.q.now()-B;G.endQuery(l.TIME_ELAPSED_EXT),setTimeout(()=>{const he=G.getQueryParameter(t,G.QUERY_RESULT)/1e6;G.deleteQuery(t),this.fire(new o.z("gpu-timing-frame",{cpuTime:ce,gpuTime:he}))},50)}if(this.listens("gpu-timing-layer")){const ce=this.painter.collectGpuTimers();setTimeout(()=>{const he=this.painter.queryGpuTimers(ce);this.fire(new o.z("gpu-timing-layer",{layerTimes:he}))},50)}if(this.listens("gpu-timing-deferred-render")){const ce=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const he=this.painter.queryGpuTimeDeferredRender(ce);this.fire(new o.z("gpu-timing-deferred-render",{gpuTime:he}))},50)}const oe=this._sourcesDirty||this._styleDirty||this._placementDirty||Y;if(oe||this._repaint)this.triggerRepaint();else{const ce=this.idle();if(ce&&(Y=this._updateAverageElevation(B,!0)),Y)this.triggerRepaint();else if(this._triggerFrame(!1),ce&&(this.fire(new o.z("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const he=this._calculateSpeedIndex();this.fire(new o.z("speedindexcompleted",{speedIndex:he})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||oe||(this._fullyLoaded=!0,ve.mark(Pe.fullLoad),this._performanceMetricsCollection&&Pr(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(F){for(const t of this._markers)F&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!F||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(F,t=!1){const l=G=>(this.transform.averageElevation=G,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return this.transform.averageElevation!==0&&l(0);const B=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(B||(t||F-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(F)){const G=this.transform.averageElevation;let Z=this.transform.sampleAverageElevation();this.transform.elevation!=null&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(Z)?Z=0:this._averageElevationLastSampledAt=F;const Y=Math.abs(G-Z);if(Y>1){if(this._isInitialLoad||B)return this._averageElevation.jumpTo(Z),l(Z);this._averageElevation.easeTo(Z,F,300)}else if(Y>1e-4)return this._averageElevation.jumpTo(Z),l(Z)}return!!this._averageElevation.isEasing(F)&&l(this._averageElevation.getValue(F))}_authenticate(){pt(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,F=>{if(F&&(F.message===ut||F.status===401)){const t=this.painter.context.gl;Mn(t,!1),this._logoControl instanceof ys&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new o.y(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/")))}}),en(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&Jr(this._requestManager._customAccessToken,{map:this,skuToken:this._requestManager._skuToken,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_updateTerrain(){const F=this._isDragging();this.painter.updateTerrain(this.style,F)}_calculateSpeedIndex(){const F=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const l=this.painter.context.gl,B=l.createFramebuffer();function G(Z){l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,Z,0);const Y=new Uint8Array(l.drawingBufferWidth*l.drawingBufferHeight*4);return l.readPixels(0,0,l.drawingBufferWidth,l.drawingBufferHeight,l.RGBA,l.UNSIGNED_BYTE,Y),Y}return l.bindFramebuffer(l.FRAMEBUFFER,B),this._canvasPixelComparison(G(F),t.canvasCopies.map(G),t.timeStamps)}_canvasPixelComparison(F,t,l){let B=l[1]-l[0];const G=F.length/4;for(let Z=0;Z<t.length;Z++){const Y=t[Z];let re=0;for(let oe=0;oe<Y.length;oe+=4)Y[oe]===F[oe]&&Y[oe+1]===F[oe+1]&&Y[oe+2]===F[oe+2]&&Y[oe+3]===F[oe+3]&&(re+=1);B+=(l[Z+2]-l[Z+1])*(1-re/G)}return B}remove(){this._hash&&this._hash.remove();for(const t of this._controls)t.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.indoor.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 F=this.painter.context.gl.getExtension("WEBGL_lose_context");F&&F.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),pn.delete(this.painter.context.gl),An.remove(),Ii.remove(),this._removed=!0,this.fire(new o.z("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(F){this._renderNextFrame=this._renderNextFrame||F,this.style&&!this._frame&&(this._frame=o.q.frame(t=>{const l=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,l&&this._render(t)}))}_preloadTiles(F){const t=this.style?this.style.getSourceCaches():[];return o.bl(t,(l,B)=>l._preloadTiles(F,B),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(F){this._trackResize&&this.resize({originalEvent:F})._update()}_onVisibilityChange(){document.visibilityState==="hidden"&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(F){this._showTileBoundaries!==F&&(this._showTileBoundaries=F,this._tp.refreshUI(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(F){this._showParseStatus!==F&&(this._showParseStatus=F,this._tp.refreshUI(),this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(F){this._showTerrainWireframe!==F&&(this._showTerrainWireframe=F,this._tp.refreshUI(),this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(F){this._showLayers2DWireframe!==F&&(this._showLayers2DWireframe=F,this._tp.refreshUI(),this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(F){this._showLayers3DWireframe!==F&&(this._showLayers3DWireframe=F,this._tp.refreshUI(),this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(F){this._speedIndexTiming!==F&&(this._speedIndexTiming=F,this._update())}get showPadding(){return!!this._showPadding}set showPadding(F){this._showPadding!==F&&(this._showPadding=F,this._tp.refreshUI(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(F){this._showCollisionBoxes!==F&&(this._showCollisionBoxes=F,this._tp.refreshUI(),F?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(F){this._showOverdrawInspector!==F&&(this._showOverdrawInspector=F,this._tp.refreshUI(),this._update())}get repaint(){return!!this._repaint}set repaint(F){this._repaint!==F&&(this._repaint=F,this._tp.refreshUI(),this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(F){this._vertices=F,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(F){this._showTileAABBs!==F&&(this._showTileAABBs=F,this._tp.refreshUI(),F&&this._update())}_setCacheLimits(F,t){o.dG(F,t)}get version(){return Te}},NavigationControl:class{constructor(F={}){this.options=o.l({},ff,F),this._container=ge("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(o.aP(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",t=>{this._map&&this._map.zoomIn({},{originalEvent:t})}),ge("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",t=>{this._map&&this._map.zoomOut({},{originalEvent:t})}),ge("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(o.aP(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",t=>{const l=this._map;l&&(this.options.visualizePitch?l.resetNorthPitch({},{originalEvent:t}):l.resetNorth({},{originalEvent:t}))}),this._compassIcon=ge("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const F=this._map;if(!F)return;const t=F.getZoom(),l=t===F.getMaxZoom(),B=t===F.getMinZoom();this._zoomInButton.disabled=l,this._zoomOutButton.disabled=B,this._zoomInButton.setAttribute("aria-disabled",l.toString()),this._zoomOutButton.setAttribute("aria-disabled",B.toString())}_rotateCompassArrow(){const F=this._map;if(!F)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(F.transform.pitch*(Math.PI/180)),.5)}) rotateX(${F.transform.pitch}deg) rotateZ(${F.transform.angle*(180/Math.PI)}deg)`:`rotate(${F.transform.angle*(180/Math.PI)}deg)`;F._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=t)})}onAdd(F){return this._map=F,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),F.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&F.on("pitch",this._rotateCompassArrow),F.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new mf(F,this._compass,this.options.visualizePitch)),this._container}onRemove(){const F=this._map;F&&(this._container.remove(),this.options.showZoom&&F.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&F.off("pitch",this._rotateCompassArrow),F.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(F,t){const l=ge("button",F,this._container);return l.type="button",l.addEventListener("click",t),l}_setButtonTitle(F,t){if(!this._map)return;const l=this._map._getUIString(`NavigationControl.${t}`);F.setAttribute("aria-label",l),F.firstElementChild&&F.firstElementChild.setAttribute("title",l)}},GeolocateControl:class extends o.E{constructor(F={}){super();const t=navigator.geolocation;this.options=o.l({geolocation:t},ns,F),o.aP(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Dc(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(F){return this._map=F,this._container=ge("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(F){const t=(l=!!this.options.geolocation)=>{this._supportsGeolocation=l,F(l)};this._supportsGeolocation!==void 0?F(this._supportsGeolocation):navigator.permissions!==void 0?navigator.permissions.query({name:"geolocation"}).then(l=>t(l.state!=="denied")).catch(()=>t()):t()}_isOutOfMapMaxBounds(F){const t=this._map.getMaxBounds(),l=F.coords;return!!t&&(l.longitude<t.getWest()||l.longitude>t.getEast()||l.latitude<t.getSouth()||l.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
2675RROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(F){if(this._map){if(this._isOutOfMapMaxBounds(F))return this._setErrorState(),this.fire(new o.z("outofmaxbounds",F)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=F,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(F),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(F),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new o.z("geolocate",F)),this._finish()}}_updateCamera(F){const t=new o.bO(F.coords.longitude,F.coords.latitude),l=F.coords.accuracy,B=this._map.getBearing(),G=o.l({bearing:B},this.options.fitBoundsOptions);this._map.fitBounds(t.toBounds(l),G,{geolocateSource:!0})}_updateMarker(F){if(F){const t=new o.bO(F.coords.longitude,F.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=F.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const F=this._map.transform,t=o.bH(1,F._center.lat)*F.worldSize,l=Math.ceil(2*this._accuracy*t);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&typeof this._heading=="number"?(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(F){if(this._map){if(this.options.trackUserLocation)if(F.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(F.code===3&&this._noTimeout)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new o.z("error",F)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(F){if(this._map!==void 0){if(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=ge("button","mapboxgl-ctrl-geolocate",this._container),ge("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",F===!1){o.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
2675se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ge("div","mapboxgl-user-location"),this._dotElement.appendChild(ge("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(ge("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Os({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=ge("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Os({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||t.originalEvent&&t.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new o.z("trackuserlocationend")))})}}_onDeviceOrientation(F){this._userLocationDotMarker&&(F.webkitCompassHeading?this._heading=F.webkitCompassHeading:F.absolute===!0&&(this._heading=-1*F.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return o.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new o.z("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new o.z("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.z("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let F;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(F={maximumAge:6e5,timeout:0},this._noTimeout=!0):(F=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,F),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const F=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};typeof DeviceMotionEvent<"u"&&typeof DeviceMotionEvent.requestPermission=="function"?DeviceOrientationEvent.requestPermission().then(t=>{t==="granted"&&F()}).catch(console.error):F()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
2675se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Lc,ScaleControl:class{constructor(F={}){this.options=o.l({},fs,F),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),o.aP(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const F=this.options.maxWidth||100,t=this._map,l=t._containerHeight/2,B=t._containerWidth/2-F/2,G=t.unproject([B,l]),Z=t.unproject([B+F,l]),Y=G.distanceTo(Z);if(this.options.unit==="imperial"){const re=3.2808*Y;re>5280?this._setScale(F,re/5280,"mile"):this._setScale(F,re,"foot")}else this.options.unit==="nautical"?this._setScale(F,Y/1852,"nautical-mile"):Y>=1e3?this._setScale(F,Y/1e3,"kilometer"):this._setScale(F,Y,"meter")}_setScale(F,t,l){this._map._requestDomTask(()=>{const B=function(Z){const Y=Math.pow(10,`${Math.floor(Z)}`.length-1);let re=Z/Y;return re=re>=10?10:re>=5?5:re>=3?3:re>=2?2:re>=1?1:function(oe){const ce=Math.pow(10,Math.ceil(-Math.log(oe)/Math.LN10));return Math.round(oe*ce)/ce}(re),Y*re}(t),G=B/t;this._container.innerHTML=this._isNumberFormatSupported&&l!=="nautical-mile"?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:l}).format(B):`${B}&nbsp;${Bn[l]}`,this._container.style.width=F*G+"px"})}onAdd(F){return this._map=F,this._language=F.getLanguage(),this._container=ge("div","mapboxgl-ctrl mapboxgl-ctrl-scale",F.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(F){this._language=F,this._update()}setUnit(F){this.options.unit=F,this._update()}},FullscreenControl:class{constructor(F={}){this._fullscreen=!1,F&&F.container&&(F.container instanceof HTMLElement?this._container=F.container:o.w("Full screen control 'container' must be a DOM element.")),o.aP(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(F){return this._map=F,this._container||(this._container=this._map.getContainer()),this._controlContainer=ge("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",o.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 F=this._fullscreenButton=ge("button","mapboxgl-ctrl-fullscreen",this._controlContainer);ge("span","mapboxgl-ctrl-icon",F).setAttribute("aria-hidden","true"),F.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const F=this._getTitle();this._fullscreenButton.setAttribute("aria-label",F),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",F)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(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()}},Popup:class extends o.E{constructor(F){super(),this.options=o.l(Object.create(jd),F),o.aP(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(F&&F.className?F.className.trim().split(/\s+/):[])}addTo(F){return this._map&&this.remove(),this._map=F,this.options.closeOnClick&&F.on("preclick",this._onClose),this.options.closeOnMove&&F.on("move",this._onClose),F.on("remove",this.remove),this._update(),F._addPopup(this),this._focusFirstElement(),this._trackPointer?(F.on("mousemove",this._onMouseEvent),F.on("mouseup",this._onMouseEvent),F._canvasContainer.classList.add("mapboxgl-track-pointer")):F.on("move",this._update),this.fire(new o.z("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const F=this._map;return F&&(F.off("move",this._update),F.off("move",this._onClose),F.off("preclick",this._onClose),F.off("click",this._onClose),F.off("remove",this.remove),F.off("mousemove",this._onMouseEvent),F.off("mouseup",this._onMouseEvent),F.off("drag",this._onMouseEvent),F._canvasContainer&&F._canvasContainer.classList.remove("mapboxgl-track-pointer"),F._removePopup(this),this._map=void 0),this.fire(new o.z("close")),this}getLngLat(){return this._lngLat}setLngLat(F){this._lngLat=o.bO.convert(F),this._pos=null,this._trackPointer=!1,this._update();const t=this._map;return t&&(t.on("move",this._update),t.off("mousemove",this._onMouseEvent),t._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const F=this._map;return F&&(F.off("move",this._update),F.on("mousemove",this._onMouseEvent),F.on("drag",this._onMouseEvent),F._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(F){return this.setDOMContent(document.createTextNode(F))}setHTML(F){const t=document.createDocumentFragment(),l=document.createElement("body");let B;for(l.innerHTML=F;B=l.firstChild,B;)t.appendChild(B);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(F){return this.options.maxWidth=F,this._update(),this}setDOMContent(F){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=ge("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(F),this.options.closeButton){const l=this._closeButton=ge("button","mapboxgl-popup-close-button",t);l.type="button",l.setAttribute("aria-label","Close popup"),l.innerHTML='<span aria-hidden="true">&#215;</span>',l.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(F){return this._classList.add(F),this._updateClassList(),this}removeClassName(F){return this._classList.delete(F),this._updateClassList(),this}setOffset(F){return this.options.offset=F,this._update(),this}toggleClassName(F){let t;return this._classList.delete(F)?t=!1:(this._classList.add(F),t=!0),this._updateClassList(),t}_onMouseEvent(F){this._update(F.point)}_getAnchor(F){if(this.options.anchor)return this.options.anchor;const t=this._map,l=this._container,B=this._pos;if(!t||!l||!B)return"bottom";const G=l.offsetWidth,Z=l.offsetHeight,Y=B.x<G/2,re=B.x>t.transform.width-G/2;if(B.y+F<Z)return Y?"top-left":re?"top-right":"top";if(B.y>t.transform.height-Z){if(Y)return"bottom-left";if(re)return"bottom-right"}return Y?"left":re?"right":"bottom"}_updateClassList(){const F=this._container;if(!F)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"),F.className=t.join(" ")}_update(F){const t=this._map,l=this._content;if(!t||!this._lngLat&&!this._trackPointer||!l)return;let B=this._container;if(B||(B=this._container=ge("div","mapboxgl-popup",t.getContainer()),this._tip=ge("div","mapboxgl-popup-tip",B),B.appendChild(l)),this.options.maxWidth&&B.style.maxWidth!==this.options.maxWidth&&(B.style.maxWidth=this.options.maxWidth),t.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Fc(this._lngLat,this._pos,t.transform)),!this._trackPointer||F){const G=this._pos=this._trackPointer&&F instanceof o.P?F:t.project(this._lngLat),Z=gu(this.options.offset),Y=this._anchor=this._getAnchor(Z.y),re=gu(this.options.offset,Y),oe=G.add(re).round();t._requestDomTask(()=>{this._container&&Y&&(this._container.style.transform=`${Js[Y]} translate(${oe.x}px,${oe.y}
2675px)`)})}if(!this._marker&&t._showingGlobe()){const G=o.dH(t.transform,this._lngLat)?0:1;this._setOpacity(G)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const F=this._container.querySelector(cs);F&&F.focus()}_onClose(){this.remove()}_setOpacity(F){this._container&&(this._container.style.opacity=`${F}`),this._content&&(this._content.style.pointerEvents=F?"auto":"none")}},Marker:Os,Style:Ms,LngLat:o.bO,LngLatBounds:o.az,Point:o.P,MercatorCoordinate:o.aa,FreeCameraOptions:ic,Evented:o.E,config:o.e,prewarm:o.dM,clearPrewarmedResources:o.dN,get accessToken(){return o.e.ACCESS_TOKEN},set accessToken(F){o.e.ACCESS_TOKEN=F},get baseApiUrl(){return o.e.API_URL},set baseApiUrl(F){o.e.API_URL=F},get workerCount(){return o.dO.workerCount},set workerCount(F){o.dO.workerCount=F},get maxParallelImageRequests(){return o.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(F){o.e.MAX_PARALLEL_IMAGE_REQUESTS=F},clearStorage(F){o.dP(F)},get workerUrl(){return o.dQ.workerUrl}
2675,set workerUrl(F){o.dQ.workerUrl=F},get workerClass(){return o.dQ.workerClass},set workerClass(F){o.dQ.workerClass=F},get workerParams(){return o.dQ.workerParams},set workerParams(F){o.dQ.workerParams=F},get dracoUrl(){return o.dR()},set dracoUrl(F){o.dS(F)},get meshoptUrl(){return o.dT()},set meshoptUrl(F){o.dU(F)},setNow:o.q.setNow,restoreNow:o.q.restoreNow}});var _e=ie;return _e})}(mapboxGl$1)),mapboxGl$1.exports}var mapboxGlExports=requireMapboxGl();const mapboxgl=getDefaultExportFromCjs(mapboxGlExports);var immutable,hasRequiredImmutable;function requireImmutable(){if(hasRequiredImmutable)return immutable;hasRequiredImmutable=1,immutable=O;var D=Object.prototype.hasOwnProperty;function O(){for(var q={},J=0;J<arguments.length;J++){var ie=arguments[J];for(var le in ie)D.call(ie,le)&&(q[le]=ie[le])}return q}return immutable}var isPlainObj,hasRequiredIsPlainObj;function requireIsPlainObj(){if(hasRequiredIsPlainObj)return isPlainObj;hasRequiredIsPlainObj=1;var D=Object.prototype.toString;return isPlainObj=function(O){var q;return D.call(O)==="[object Object]"&&(q=Object.getPrototypeOf(O),q===null||q===Object.getPrototypeOf({}))},isPlainObj}var lib,hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var D=requireIsPlainObj(),O=requireImmutable(),q="value",J=`
2676  `,ie={};ie.assert=function(ye,ge){return ge=ge||{},function(Se){var Ce=_e(ye,Se);if(Ce){var Ve=o(Ce,ge);throw ge.apiName&&(Ve=ge.apiName+": "+Ve),new Error(Ve)}}},ie.shape=function(ge){var Se=Ie(ge);return function(Ve){var at=_e(ie.plainObject,Ve);if(at)return at;for(var et,Mt,jt=[],St=0;St<Se.length;St++)et=Se[St].key,Mt=Se[St].value,at=_e(Mt,Ve[et]),at&&jt.push([et].concat(at));return jt.length<2?jt[0]:function(Bt){jt=jt.map(function(wt){var Je=wt[0],ut=o(wt,Bt).split(`
2677`).join(J);return"- "+Je+": "+ut});var Zt=Bt.path.join("."),xt=Zt===q?"":" of "+Zt;return"The following properties"+xt+" have invalid values:"+J+jt.join(J)}}},ie.strictShape=function(ge){var Se=ie.shape(ge);return function(Ve){var at=Se(Ve);if(at)return at;var et=Object.keys(Ve).reduce(function(Mt,jt){return ge[jt]===void 0&&Mt.push(jt),Mt},[]);if(et.length!==0)return function(){return"The following keys are invalid: "+et.join(", ")}}},ie.arrayOf=function(ge){return le(ge)},ie.tuple=function(){var ge=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments);return le(ge)};function le(ye){var ge=Array.isArray(ye),Se=function(Ce){return ge?ye[Ce]:ye};return function(Ve){var at=_e(ie.plainArray,Ve);if(at)return at;if(ge&&Ve.length!==ye.length)return"an array with "+ye.length+" items";for(var et=0;et<Ve.length;et++)if(at=_e(Se(et),Ve[et]),at)return[et].concat(at)}}ie.required=function(ge){function Se(Ce){return Ce==null?function(Ve){return Ae(Ve,Ee(Ve.path)?"cannot be undefined/null.":"is required.")}:ge.apply(this,arguments)}return Se.__required=!0,Se},ie.oneOfType=function(){var ge=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments);return function(Ce){var Ve=ge.map(function(at){return _e(at,Ce)}).filter(Boolean);if(Ve.length===ge.length)return Ve.every(function(at){return at.length===1&&typeof at[0]=="string"})?Te(Ve.map(function(at){return at[0]})):Ve.reduce(function(at,et){return et.length>at.length?et:at})}},ie.equal=function(ge){return function(Ce){if(Ce!==ge)return JSON.stringify(ge)}},ie.oneOf=function(){var ge=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments),Se=ge.map(function(Ce){return ie.equal(Ce)});return ie.oneOfType.apply(this,Se)},ie.range=function(ge){var Se=ge[0],Ce=ge[1];return function(at){var et=_e(ie.number,at);if(et||at<Se||at>Ce)return"number between "+Se+" & "+Ce+" (inclusive)"}},ie.any=function(){},ie.boolean=function(ge){if(typeof ge!="boolean")return"boolean"},ie.number=function(ge){if(typeof ge!="number")return"number"},ie.plainArray=function(ge){if(!Array.isArray(ge))return"array"},ie.plainObject=function(ge){if(!D(ge))return"object"},ie.string=function(ge){if(typeof ge!="string")return"string"},ie.func=function(ge){if(typeof ge!="function")return"function"};function _e(ye,ge){if(!(ge==null&&!ye.hasOwnProperty("__required"))){var Se=ye(ge);if(Se)return Array.isArray(Se)?Se:[Se]}}function o(ye,ge){var Se=ye.length,Ce=ye[Se-1],Ve=ye.slice(0,Se-1);return Ve.length===0&&(Ve=[q]),ge=O(ge,{path:Ve}),typeof Ce=="function"?Ce(ge):Ae(ge,Pe(Ce))}function Te(ye){return ye.length<2?ye[0]:ye.length===2?ye.join(" or "):ye.slice(0,-1).join(", ")+", or "+ye.slice(-1)}function Pe(ye){return"must be "+ve(ye)+"."}function ve(ye){return/^an? /.test(ye)?ye:/^[aeiou]/i.test(ye)?"an "+ye:/^[a-z]/i.test(ye)?"a "+ye:ye}function Ae(ye,ge){var Se=Ee(ye.path),Ce=ye.path.join(".")+" "+ge,Ve=Se?"Item at position ":"";return Ve+Ce}function Ee(ye){return typeof ye[ye.length-1]=="number"||typeof ye[0]=="number"}function Ie(ye){return Object.keys(ye||{}).map(function(ge){return{key:ge,value:ye[ge]}})}return ie.validate=_e,ie.processMessage=o,lib=ie,lib}var validator,hasRequiredValidator;function requireValidator(){if(hasRequiredValidator)return validator;hasRequiredValidator=1;
2677var D=requireImmutable(),O=requireLib();function q(_e){if(typeof window<"u")return _e instanceof commonjsGlobal.Blob||_e instanceof commonjsGlobal.ArrayBuffer?void 0:"Blob or ArrayBuffer";if(!(typeof _e=="string"||_e.pipe!==void 0))return"Filename or Readable stream"}function J(_e,o){return O.assert(O.strictShape(_e),o)}function ie(_e){var o="date";if(typeof _e=="boolean")return o;try{var Te=new Date(_e);if(Te.getTime&&isNaN(Te.getTime()))return o}catch{return o}}function le(_e){return O.tuple(O.number,O.number)(_e)}return validator=D(O,{file:q,date:ie,coordinates:le,assertShape:J}),validator}var pick_1,hasRequiredPick;function requirePick(){if(hasRequiredPick)return pick_1;hasRequiredPick=1;function D(O,q){var J=function(ie,le){return q.indexOf(ie)!==-1&&le!==void 0};return typeof q=="function"&&(J=q),Object.keys(O).filter(function(ie){return J(ie,O[ie])}).reduce(function(ie,le){return ie[le]=O[le],ie},{})}return pick_1=D,pick_1}var objectMap_1,hasRequiredObjectMap;function requireObjectMap(){if(hasRequiredObjectMap)return objectMap_1;hasRequiredObjectMap=1;function D(O,q){return Object.keys(O).reduce(function(J,ie){return J[ie]=q(ie,O[ie]),J},{})}return objectMap_1=D,objectMap_1}var stringifyBooleans,hasRequiredStringifyBooleans;function requireStringifyBooleans(){if(hasRequiredStringifyBooleans)return stringifyBooleans;hasRequiredStringifyBooleans=1;var D=requireObjectMap();function O(q){return D(q,function(J,ie){return typeof ie=="boolean"?JSON.stringify(ie):ie})}return stringifyBooleans=O,stringifyBooleans}var base64$1={exports:{}};/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */var base64=base64$1.exports,hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(D,O){(function(q){var J=O,ie=D&&D.exports==J&&D,le=typeof commonjsGlobal=="object"&&commonjsGlobal;(le.global===le||le.window===le)&&(q=le);var _e=function(ye){this.message=ye};_e.prototype=new Error,_e.prototype.name="InvalidCharacterError";var o=function(ye){throw new _e(ye)},Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe=/[\t\n\f\r ]/g,ve=function(ye){ye=String(ye).replace(Pe,"");var ge=ye.length;ge%4==0&&(ye=ye.replace(/==?$/,""),ge=ye.length),(ge%4==1||/[^+a-zA-Z0-9/]/.test(ye))&&o("Invalid character: the string to be decoded is not correctly encoded.");for(var Se=0,Ce,Ve,at="",et=-1;++et<ge;)Ve=Te.indexOf(ye.charAt(et)),Ce=Se%4?Ce*64+Ve:Ve,Se++%4&&(at+=String.fromCharCode(255&Ce>>(-2*Se&6)));return at},Ae=function(ye){ye=String(ye),/[^\0-\xFF]/.test(ye)&&o("The string to be encoded contains characters outside of the Latin1 range.");for(var ge=ye.length%3,Se="",Ce=-1,Ve,at,et,Mt,jt=ye.length-ge;++Ce<jt;)Ve=ye.charCodeAt(Ce)<<16,at=ye.charCodeAt(++Ce)<<8,et=ye.charCodeAt(++Ce),Mt=Ve+at+et,Se+=Te.charAt(Mt>>18&63)+Te.charAt(Mt>>12&63)+Te.charAt(Mt>>6&63)+Te.charAt(Mt&63);return ge==2?(Ve=ye.charCodeAt(Ce)<<8,at=ye.charCodeAt(++Ce),Mt=Ve+at,Se+=Te.charAt(Mt>>10)+Te.charAt(Mt>>4&63)+Te.charAt(Mt<<2&63)+"="):ge==1&&(Mt=ye.charCodeAt(Ce),Se+=Te.charAt(Mt>>2)+Te.charAt(Mt<<4&63)+"=="),Se},Ee={encode:Ae,decode:ve,version:"0.1.0"};if(J&&!J.nodeType)if(ie)ie.exports=Ee;else for(var Ie in Ee)Ee.hasOwnProperty(Ie)&&(J[Ie]=Ee[Ie]);else q.base64=Ee})(base64)}(base64$1,base64$1.exports)),base64$1.exports}var parseMapboxToken,hasRequiredParseMapboxToken;function requireParseMapboxToken(){if(hasRequiredParseMapboxToken)return parseMapboxToken;hasRequiredParseMapboxToken=1;var D=requireBase64(),O={};function q(le){if(O[le])return O[le];var _e=le.split("."),o=_e[0],Te=_e[1];if(!Te)throw new Error("Invalid token");var Pe=J(Te),ve={usage:o,user:Pe.u};return ie(Pe,"a")&&(ve.authorization=Pe.a),ie(Pe,"exp")&&(ve.expires=Pe.exp*1e3),ie(Pe,"iat")&&(ve.created=Pe.iat*1e3),ie(Pe,"scopes")&&(ve.scopes=Pe.scopes),ie(Pe,"client")&&(ve.client=Pe.client),ie(Pe,"ll")&&(ve.lastLogin=Pe.ll),ie(Pe,"iu")&&(ve.impersonator=Pe.iu),O[le]=ve,ve}function J(le){try{return JSON.parse(D.decode(le))}catch{throw new Error("Invalid token")}}function ie(le,_e){return Object.prototype.hasOwnProperty.call(le,_e)}return parseMapboxToken=q,parseMapboxToken}var eventemitter3={exports:{}},hasRequiredEventemitter3;function requireEventemitter3(){return hasRequiredEventemitter3||(hasRequiredEventemitter3=1,function(D){var O=Object.prototype.hasOwnProperty,q="~";function J(){}Object.create&&(J.prototype=Object.create(null),new J().__proto__||(q=!1));function ie(Te,Pe,ve){this.fn=Te,this.context=Pe,this.once=ve||!1}function le(Te,Pe,ve,Ae,Ee){if(typeof ve!="function")throw new TypeError("The listener must be a function");var Ie=new ie(ve,Ae||Te,Ee),ye=q?q+Pe:Pe;return Te._events[ye]?Te._events[ye].fn?Te._events[ye]=[Te._events[ye],Ie]:Te._events[ye].push(Ie):(Te._events[ye]=Ie,Te._eventsCount++),Te}function _e(Te,Pe){--Te._eventsCount===0?Te._events=new J:delete Te._events[Pe]}function o(){this._events=new J,this._eventsCount=0}o.prototype.eventNames=function(){var Pe=[],ve,Ae;if(this._eventsCount===0)return Pe;for(Ae in ve=this._events)O.call(ve,Ae)&&Pe.push(q?Ae.slice(1):Ae);return Object.getOwnPropertySymbols?Pe.concat(Object.getOwnPropertySymbols(ve)):Pe},o.prototype.listeners=function(Pe){var ve=q?q+Pe:Pe,Ae=this._events[ve];if(!Ae)return[];if(Ae.fn)return[Ae.fn];for(var Ee=0,Ie=Ae.length,ye=new Array(Ie);Ee<Ie;Ee++)ye[Ee]=Ae[Ee].fn;return ye},o.prototype.listenerCount=function(Pe){var ve=q?q+Pe:Pe,Ae=this._events[ve];return Ae?Ae.fn?1:Ae.length:0},o.prototype.emit=function(Pe,ve,Ae,Ee,Ie,ye){var ge=q?q+Pe:Pe;if(!this._events[ge])return!1;var Se=this._events[ge],Ce=arguments.length,Ve,at;if(Se.fn){switch(Se.once&&this.removeListener(Pe,Se.fn,void 0,!0),Ce){case 1:return Se.fn.c
2677all(Se.context),!0;case 2:return Se.fn.call(Se.context,ve),!0;case 3:return Se.fn.call(Se.context,ve,Ae),!0;case 4:return Se.fn.call(Se.context,ve,Ae,Ee),!0;case 5:return Se.fn.call(Se.context,ve,Ae,Ee,Ie),!0;case 6:return Se.fn.call(Se.context,ve,Ae,Ee,Ie,ye),!0}for(at=1,Ve=new Array(Ce-1);at<Ce;at++)Ve[at-1]=arguments[at];Se.fn.apply(Se.context,Ve)}else{var et=Se.length,Mt;for(at=0;at<et;at++)switch(Se[at].once&&this.removeListener(Pe,Se[at].fn,void 0,!0),Ce){case 1:Se[at].fn.call(Se[at].context);break;case 2:Se[at].fn.call(Se[at].context,ve);break;case 3:Se[at].fn.call(Se[at].context,ve,Ae);break;case 4:Se[at].fn.call(Se[at].context,ve,Ae,Ee);break;default:if(!Ve)for(Mt=1,Ve=new Array(Ce-1);Mt<Ce;Mt++)Ve[Mt-1]=arguments[Mt];Se[at].fn.apply(Se[at].context,Ve)}}return!0},o.prototype.on=function(Pe,ve,Ae){return le(this,Pe,ve,Ae,!1)},o.prototype.once=function(Pe,ve,Ae){return le(this,Pe,ve,Ae,!0)},o.prototype.removeListener=function(Pe,ve,Ae,Ee){var Ie=q?q+Pe:Pe;if(!this._events[Ie])return this;if(!ve)return _e(this,Ie),this;var ye=this._events[Ie];if(ye.fn)ye.fn===ve&&(!Ee||ye.once)&&(!Ae||ye.context===Ae)&&_e(this,Ie);else{for(var ge=0,Se=[],Ce=ye.length;ge<Ce;ge++)(ye[ge].fn!==ve||Ee&&!ye[ge].once||Ae&&ye[ge].context!==Ae)&&Se.push(ye[ge]);Se.length?this._events[Ie]=Se.length===1?Se[0]:Se:_e(this,Ie)}return this},o.prototype.removeAllListeners=function(Pe){var ve;return Pe?(ve=q?q+Pe:Pe,this._events[ve]&&_e(this,ve)):(this._events=new J,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=q,o.EventEmitter=o,D.exports=o}(eventemitter3)),eventemitter3.exports}var urlUtils,hasRequiredUrlUtils;function requireUrlUtils(){if(hasRequiredUrlUtils)return urlUtils;hasRequiredUrlUtils=1;function D(_e){return _e.map(encodeURIComponent).join(",")}function O(_e){return Array.isArray(_e)?D(_e):encodeURIComponent(String(_e))}function q(_e,o,Te){if(Te===!1||Te===null)return _e;var Pe=/\?/.test(_e)?"&":"?",ve=encodeURIComponent(o);return Te!==void 0&&Te!==""&&Te!==!0&&(ve+="="+O(Te)),""+_e+Pe+ve}function J(_e,o){if(!o)return _e;var Te=_e;return Object.keys(o).forEach(function(Pe){var ve=o[Pe];ve!==void 0&&(Array.isArray(ve)&&(ve=ve.filter(function(Ae){return Ae!=null}).join(",")),Te=q(Te,Pe,ve))}),Te}function ie(_e,o){if(!o||_e.slice(0,4)==="http")return _e;var Te=_e[0]==="/"?"":"/";return""+o.replace(/\/$/,"")+Te+_e}function le(_e,o){return o?_e.replace(/\/:([a-zA-Z0-9]+)/g,function(Te,Pe){var ve=o[Pe];if(ve===void 0)throw new Error("Unspecified route parameter "+Pe);var Ae=O(ve);return"/"+Ae}):_e}return urlUtils={appendQueryObject:J,appendQueryParam:q,prependOrigin:ie,interpolateRouteParams:le},urlUtils}var constants,hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,constants={API_ORIGIN:"https://api.mapbox.com",EVENT_PROGRESS_DOWNLOAD:"downloadProgress",EVENT_PROGRESS_UPLOAD:"uploadProgress",EVENT_ERROR:"error",EVENT_RESPONSE:"response",ERROR_HTTP:"HttpError",ERROR_REQUEST_ABORTED:"RequestAbortedError"}),constants}var mapiRequest,hasRequiredMapiRequest;function requireMapiRequest(){if(hasRequiredMapiRequest)return mapiRequest;hasRequiredMapiRequest=1;var D=requireParseMapboxToken(),O=requireImmutable(),q=requireEventemitter3(),J=requireUrlUtils(),ie=requireConstants(),le=1;function _e(o,Te){if(!o)throw new Error("MapiRequest requires a client");if(!Te||!Te.path||!Te.method)throw new Error("MapiRequest requires an options object with path and method properties");var Pe={};Te.body&&(Pe["content-type"]="application/json");var ve=O(Pe,Te.headers),Ae=Object.keys(ve).reduce(function(Ee,Ie){return Ee[Ie.toLowerCase()]=ve[Ie],Ee},{});this.id=le++,this._options=Te,this.emitter=new q,this.client=o,this.response=null,this.error=null,this.sent=!1,this.aborted=!1,this.path=Te.path,this.method=Te.method,this.origin=Te.origin||o.origin,this.query=Te.query||{},this.params=Te.params||{},this.body=Te.body||null,this.file=Te.file||null,this.encoding=Te.encoding||"utf8",this.sendFileAs=Te.sendFileAs||null,this.headers=Ae}return _e.prototype.url=function(Te){var Pe=J.prependOrigin(this.path,this.origin);Pe=J.appendQueryObject(Pe,this.query);var ve=this.params,Ae=Te??this.client.accessToken;if(Ae){Pe=J.appendQueryParam(Pe,"access_token",Ae);var Ee=D(Ae).user;ve=O({ownerId:Ee},ve)}
2677return Pe=J.interpolateRouteParams(Pe,ve),Pe},_e.prototype.send=function(){var Te=this;if(Te.sent)throw new Error("This request has already been sent. Check the response and error properties. Create a new request with clone().");return Te.sent=!0,Te.client.sendRequest(Te).then(function(Pe){return Te.response=Pe,Te.emitter.emit(ie.EVENT_RESPONSE,Pe),Pe},function(Pe){throw Te.error=Pe,Te.emitter.emit(ie.EVENT_ERROR,Pe),Pe})},_e.prototype.abort=function(){this._nextPageRequest&&(this._nextPageRequest.abort(),delete this._nextPageRequest),!(this.response||this.error||this.aborted)&&(this.aborted=!0,this.client.abortRequest(this))},_e.prototype.eachPage=function(Te){var Pe=this;function ve(Ie){function ye(){delete Pe._nextPageRequest;var ge=Ie.nextPage();ge&&(Pe._nextPageRequest=ge,Ee(ge))}Te(null,Ie,ye)}function Ae(Ie){Te(Ie,null,function(){})}function Ee(Ie){Ie.send().then(ve,Ae)}Ee(this)},_e.prototype.clone=function(){return this._extend()},_e.prototype._extend=function(Te){var Pe=O(this._options,Te);return new _e(this.client,Pe)},mapiRequest=_e,mapiRequest}var mapiClient,hasRequiredMapiClient;function requireMapiClient(){if(hasRequiredMapiClient)return mapiClient;hasRequiredMapiClient=1;var D=requireParseMapboxToken(),O=requireMapiRequest(),q=requireConstants();function J(ie){if(!ie||!ie.accessToken)throw new Error("Cannot create a client without an access token");D(ie.accessToken),this.accessToken=ie.accessToken,this.origin=ie.origin||q.API_ORIGIN}return J.prototype.createRequest=function(le){return new O(this,le)},mapiClient=J,mapiClient}var parseLinkHeader_1,hasRequiredParseLinkHeader;function requireParseLinkHeader(){if(hasRequiredParseLinkHeader)return parseLinkHeader_1;hasRequiredParseLinkHeader=1;function D(J){var ie=J.match(/\s*(.+)\s*=\s*"?([^"]+)"?/);return ie?{key:ie[1],value:ie[2]}:null}function O(J){var ie=J.match(/<?([^>]*)>(.*)/);if(!ie)return null;var le=ie[1],_e=ie[2].split(";"),o=null,Te=_e.reduce(function(Pe,ve){var Ae=D(ve);return Ae?Ae.key==="rel"?(o||(o=Ae.value),Pe):(Pe[Ae.key]=Ae.value,Pe):Pe},{});return o?{url:le,rel:o,params:Te}:null}function q(J){return J?J.split(/,\s*</).reduce(function(ie,le){var _e=O(le);if(!_e)return ie;var o=_e.rel.split(/\s+/);return o.forEach(function(Te){ie[Te]||(ie[Te]={url:_e.url,params:_e.params})}),ie},{}):{}}return parseLinkHeader_1=q,parseLinkHeader_1}var mapiResponse,hasRequiredMapiResponse;function requireMapiResponse(){if(hasRequiredMapiResponse)return mapiResponse;hasRequiredMapiResponse=1;var D=requireParseLinkHeader();function O(q,J){this.request=q,this.headers=J.headers,this.rawBody=J.body,this.statusCode=J.statusCode;try{this.body=JSON.parse(J.body||"{}")}catch{this.body=J.body}this.links=D(this.headers.link)}return O.prototype.hasNextPage=function(){return!!this.links.next},O.prototype.nextPage=function(){return this.hasNextPage()?this.request._extend({path:this.links.next.url}):null},mapiResponse=O,mapiResponse}var mapiError,hasRequiredMapiError;function requireMapiError(){if(hasRequiredMapiError)return mapiError;hasRequiredMapiError=1;var D=requireConstants();function O(q){var J=q.type||D.ERROR_HTTP,ie;if(q.body)try{ie=JSON.parse(q.body)}catch{ie=q.body}else ie=null;var le=q.message||null;le||(typeof ie=="string"?le=ie:ie&&typeof ie.message=="string"?le=ie.message:J===D.ERROR_REQUEST_ABORTED&&(le="Request aborted")),this.message=le,this.type=J,this.statusCode=q.statusCode||null,this.request=q.request,this.body=ie}return mapiError=O,mapiError}var parseHeaders_1,hasRequiredParseHeaders;function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders_1;hasRequiredParseHeaders=1;function D(q){var J=q.indexOf(":"),ie=q.substring(0,J).trim().toLowerCase(),le=q.substring(J+1).trim();return{name:ie,value:le}}function O(q){var J={};return q&&q.trim().split(/[\r|\n]+/).forEach(function(ie){var le=D(ie);J[le.name]=le.value}),J}return parseHeaders_1=O,parseHeaders_1}var browserLayer,hasRequiredBrowserLayer;function requireBrowserLayer(){if(hasRequiredBrowserLayer)return browserLayer;hasRequiredBrowserLayer=1;var D=requireMapiResponse(),O=requireMapiError(),q=requireConstants(),J=requireParseHeaders(),ie={};function le(Ae){var Ee=ie[Ae.id];Ee&&(Ee.abort(),delete ie[Ae.id])}function _e(Ae,Ee){return new D(Ae,{body:Ee.response,headers:J(Ee.getAllResponseHeaders()),statusCode:Ee.status})}function o(Ae){var Ee=Ae.total,Ie=Ae.loaded,ye=100*Ie/Ee;return{total:Ee,transferred:Ie,percent:ye}}function Te(Ae,Ee){return new Promise(function(Ie,ye){Ee.onprogress=function(Ce){Ae.emitter.emit(q.EVENT_PROGRESS_DOWNLOAD,o(Ce))};var ge=Ae.file;ge&&(Ee.upload.onprogress=function(Ce){Ae.emitter.emit(q.EVENT_PROGRESS_UPLOAD,o(Ce))}),Ee.onerror=function(Ce){ye(Ce)},Ee.onabort=function(){var Ce=new O({request:Ae,type:q.ERROR_REQUEST_ABORTED});ye(Ce)},Ee.onload=function(){if(delete ie[Ae.id],Ee.status<200||Ee.status>=400){var Ce=new O({request:Ae,body:Ee.response,statusCode:Ee.status});ye(Ce);return}Ie(Ee)};var Se=Ae.body;typeof Se=="string"?Ee.send(Se):Se?Ee.send(JSON.stringify(Se)):ge?Ee.send(ge):Ee.send(),ie[Ae.id]=Ee}).then(function(Ie){return _e(Ae,Ie)})}function Pe(Ae,Ee){var Ie=Ae.url(Ee),ye=new window.XMLHttpRequest;
2677return ye.open(Ae.method,Ie),Object.keys(Ae.headers).forEach(function(ge){ye.setRequestHeader(ge,Ae.headers[ge])}),ye}function ve(Ae){return Promise.resolve().then(function(){var Ee=Pe(Ae,Ae.client.accessToken);return Te(Ae,Ee)})}return browserLayer={browserAbort:le,sendRequestXhr:Te,browserSend:ve,createRequestXhr:Pe},browserLayer}var browserClient,hasRequiredBrowserClient;function requireBrowserClient(){if(hasRequiredBrowserClient)return browserClient;hasRequiredBrowserClient=1;var D=requireBrowserLayer(),O=requireMapiClient();function q(ie){O.call(this,ie)}q.prototype=Object.create(O.prototype),q.prototype.constructor=q,q.prototype.sendRequest=D.browserSend,q.prototype.abortRequest=D.browserAbort;function J(ie){return new q(ie)}return browserClient=J,browserClient}var createServiceFactory_1,hasRequiredCreateServiceFactory;function requireCreateServiceFactory(){if(hasRequiredCreateServiceFactory)return createServiceFactory_1;hasRequiredCreateServiceFactory=1;var D=requireMapiClient(),O=requireBrowserClient();function q(J){return function(ie){var le;D.prototype.isPrototypeOf(ie)?le=ie:le=O(ie);var _e=Object.create(J);return _e.client=le,_e}}return createServiceFactory_1=q,createServiceFactory_1}var geocoding,hasRequiredGeocoding;function requireGeocoding(){if(hasRequiredGeocoding)return geocoding;hasRequiredGeocoding=1;var D=requireImmutable(),O=requireValidator(),q=requirePick(),J=requireStringifyBooleans(),ie=requireCreateServiceFactory(),le={},_e=["country","region","postcode","district","place","locality","neighborhood","address","poi","poi.landmark"];return le.forwardGeocode=function(o){O.assertShape({query:O.required(O.string),mode:O.oneOf("mapbox.places","mapbox.places-permanent"),countries:O.arrayOf(O.string),proximity:O.oneOf(O.coordinates,"ip"),types:O.arrayOf(O.oneOf(_e)),autocomplete:O.boolean,bbox:O.arrayOf(O.number),limit:O.number,language:O.arrayOf(O.string),routing:O.boolean,fuzzyMatch:O.boolean,worldview:O.string,session_token:O.string})(o),o.mode=o.mode||"mapbox.places";var Te=J(D({country:o.countries},q(o,["proximity","types","autocomplete","bbox","limit","language","routing","fuzzyMatch","worldview","session_token"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:q(o,["mode","query"]),query:Te})},le.reverseGeocode=function(o){O.assertShape({query:O.required(O.coordinates),mode:O.oneOf("mapbox.places","mapbox.places-permanent"),countries:O.arrayOf(O.string),types:O.arrayOf(O.oneOf(_e)),bbox:O.arrayOf(O.number),limit:O.number,language:O.arrayOf(O.string),reverseMode:O.oneOf("distance","score"),routing:O.boolean,worldview:O.string,session_token:O.string})(o),o.mode=o.mode||"mapbox.places";var Te=J(D({country:o.countries},q(o,["country","types","bbox","limit","language","reverseMode","routing","worldview","session_token"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:q(o,["mode","query"]),query:Te})},geocoding=ie(le),geocoding}var geocodingExports=requireGeocoding();const MapboxGeocoding=getDefaultExportFromCjs(geocodingExports);var earthRadius=63710088e-1,factors={centimeters:earthRadius*100,centimetres:earthRadius*100,degrees:360/(2*Math.PI),feet:earthRadius*3.28084,inches:earthRadius*39.37,kilometers:earthRadius/1e3,kilometres:earthRadius/1e3,meters:earthRadius,metres:earthRadius,miles:earthRadius/1609.344,millimeters:earthRadius*1e3,millimetres:earthRadius*1e3,nauticalmiles:earthRadius/1852,radians:1,yards:earthRadius*1.0936};function radiansToLength(D,O="kilometers"){const q=factors[O];
vendor: 13,724 bytes, lines 2677-2689
2677if(!q)throw new Error(O+" units is invalid");return D*q}function degreesToRadians(D){return D%360*Math.PI/180}function getCoord(D){if(!D)throw new Error("coord is required");if(!Array.isArray(D)){if(D.type==="Feature"&&D.geometry!==null&&D.geometry.type==="Point")return[...D.geometry.coordinates];if(D.type==="Point")return[...D.coordinates]}if(Array.isArray(D)&&D.length>=2&&!Array.isArray(D[0])&&!Array.isArray(D[1]))return[...D];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function distance(D,O,q={}){var J=getCoord(D),ie=getCoord(O),le=degreesToRadians(ie[1]-J[1]),_e=degreesToRadians(ie[0]-J[0]),o=degreesToRadians(J[1]),Te=degreesToRadians(ie[1]),Pe=Math.pow(Math.sin(le/2),2)+Math.pow(Math.sin(_e/2),2)*Math.cos(o)*Math.cos(Te);return radiansToLength(2*Math.atan2(Math.sqrt(Pe),Math.sqrt(1-Pe)),q.units)}var md5$1={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$1=getAugmentedNamespace(__viteBrowserExternal$1);/**
2678 * [js-md5]{@link https://github.com/emn178/js-md5}
2679 *
2680 * @namespace md5
2681 * @version 0.8.3
2682 * @author Chen, Yi-Cyuan [[email protected]]
2683 * @copyright Chen, Yi-Cyuan 2014-2023
2684 * @license MIT
2685 */var hasRequiredMd5;function requireMd5(){return hasRequiredMd5||(hasRequiredMd5=1,function(D){(function(){var O="input is invalid type",q="finalize already called",J=typeof window=="object",ie=J?window:{};ie.JS_MD5_NO_WINDOW&&(J=!1);var le=!J&&typeof self=="object",_e=!ie.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;_e?ie=commonjsGlobal:le&&(ie=self);var o=!ie.JS_MD5_NO_COMMON_JS&&!0&&D.exports,Te=!ie.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",Pe="0123456789abcdef".split(""),ve=[128,32768,8388608,-2147483648],Ae=[0,8,16,24],Ee=["hex","array","digest","buffer","arrayBuffer","base64"],Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),ye=[],ge;if(Te){var Se=new ArrayBuffer(68);ge=new Uint8Array(Se),ye=new Uint32Array(Se)}var Ce=Array.isArray;(ie.JS_MD5_NO_NODE_JS||!Ce)&&(Ce=function(Je){return Object.prototype.toString.call(Je)==="[object Array]"});var Ve=ArrayBuffer.isView;Te&&(ie.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!Ve)&&(Ve=function(Je){return typeof Je=="object"&&Je.buffer&&Je.buffer.constructor===ArrayBuffer});var at=function(Je){var ut=typeof Je;if(ut==="string")return[Je,!0];if(ut!=="object"||Je===null)throw new Error(O);if(Te&&Je.constructor===ArrayBuffer)return[new Uint8Array(Je),!1];if(!Ce(Je)&&!Ve(Je))throw new Error(O);return[Je,!1]},et=function(Je){return function(ut){return new Zt(!0).update(ut)[Je]()}},Mt=function(){var Je=et("hex");_e&&(Je=jt(Je)),Je.create=function(){return new Zt},Je.update=function(Ye){return Je.create().update(Ye)};for(var ut=0;ut<Ee.length;++ut){var lt=Ee[ut];Je[lt]=et(lt)}return Je},jt=function(Je){var ut=require$$1,lt=require$$1.Buffer,Ye;lt.from&&!ie.JS_MD5_NO_BUFFER_FROM?Ye=lt.from:Ye=function(si){return new lt(si)};var pi=function(si){if(typeof si=="string")return ut.createHash("md5").update(si,"utf8").digest("hex");if(si==null)throw new Error(O);return si.constructor===ArrayBuffer&&(si=new Uint8Array(si)),Ce(si)||Ve(si)||si.constructor===lt?ut.createHash("md5").update(Ye(si)).digest("hex"):Je(si)};return pi},St=function(Je){return function(ut,lt){return new xt(ut,!0).update(lt)[Je]()}},Bt=function(){var Je=St("hex");Je.create=function(Ye){return new xt(Ye)},Je.update=function(Ye,pi){return Je.create(Ye).update(pi)};for(var ut=0;ut<Ee.length;++ut){var lt=Ee[ut];Je[lt]=St(lt)}return Je};function Zt(Je){if(Je)ye[0]=ye[16]=ye[1]=ye[2]=ye[3]=ye[4]=ye[5]=ye[6]=ye[7]=ye[8]=ye[9]=ye[10]=ye[11]=ye[12]=ye[13]=ye[14]=ye[15]=0,this.blocks=ye,this.buffer8=ge;else if(Te){var ut=new ArrayBuffer(68);this.buffer8=new Uint8Array(ut),this.blocks=new Uint32Array(ut)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Zt.prototype.update=function(Je){if(this.finalized)throw new Error(q);var ut=at(Je);Je=ut[0];for(var lt=ut[1],Ye,pi=0,si,rt=Je.length,kt=this.blocks,_i=this.buffer8;pi<rt;){if(this.hashed&&(this.hashed=!1,kt[0]=kt[16],kt[16]=kt[1]=kt[2]=kt[3]=kt[4]=kt[5]=kt[6]=kt[7]=kt[8]=kt[9]=kt[10]=kt[11]=kt[12]=kt[13]=kt[14]=kt[15]=0),lt)if(Te)for(si=this.start;pi<rt&&si<64;++pi)Ye=Je.charCodeAt(pi),Ye<128?_i[si++]=Ye:Ye<2048?(_i[si++]=192|Ye>>>6,_i[si++]=128|Ye&63):Ye<55296||Ye>=57344?(_i[si++]=224|Ye>>>12,_i[si++]=128|Ye>>>6&63,_i[si++]=128|Ye&63):(Ye=65536+((Ye&1023)<<10|Je.charCodeAt(++pi)&1023),_i[si++]=240|Ye>>>18,_i[si++]=128|Ye>>>12&63,_i[si++]=128|Ye>>>6&63,_i[si++]=128|Ye&63);else for(si=this.start;pi<rt&&si<64;++pi)Ye=Je.charCodeAt(pi),Ye<128?kt[si>>>2]|=Ye<<Ae[si++&3]:Ye<2048?(kt[si>>>2]|=(192|Ye>>>6)<<Ae[si++&3],kt[si>>>2]|=(128|Ye&63)<<Ae[si++&3]):Ye<55296||Ye>=57344?(kt[si>>>2]|=(224|Ye>>>12)<<Ae[si++&3],kt[si>>>2]|=(128|Ye>>>6&63)<<Ae[si++&3],kt[si>>>2]|=(128|Ye&63)<<Ae[si++&3]):(Ye=65536+((Ye&1023)<<10|Je.charCodeAt(++pi)&1023),kt[si>>>2]|=(240|Ye>>>18)<<Ae[si++&3],kt[si>>>2]|=(128|Ye>>>12&63)<<Ae[si++&3],kt[si>>>2]|=(128|Ye>>>6&63)<<Ae[si++&3],kt[si>>>2]|=(128|Ye&63)<<Ae[si++&3]);else if(Te)for(si=this.start;pi<rt&&si<64;++pi)_i[si++]=Je[pi];else for(si=this.start;pi<rt&&si<64;++pi)kt[si>>>2]|=Je[pi]<<Ae[si++&3];this.lastByteIndex=si,this.bytes+=si-this.start,si>=64?(this.start=si-64,this.hash(),this.hashed=!0):this.start=si}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},Zt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var Je=this.blocks,ut=this.lastByteIndex;Je[ut>>>2]|=ve[ut&3],ut>=56&&(this.hashed||this.hash(),Je[0]=Je[16],Je[16]=Je[1]=Je[2]=Je[3]=Je[4]=Je[5]=Je[6]=Je[7]=Je[8]=Je[9]=Je[10]=Je[11]=Je[12]=Je[13]=Je[14]=Je[15]=0),Je[14]=this.bytes<<3,Je[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Zt.prototype.hash=function(){var Je,ut,lt,Ye,pi,si,rt=this.blocks;this.first?(Je=rt[0]-680876937,Je=(Je<<7|Je>>>25)-271733879<<0,Ye=(-1732584194^Je&2004318071)+rt[1]-117830708,Ye=(Ye<<12|Ye>>>20)+Je<<0,lt=(-271733879^Ye&(Je^-271733879))+rt[2]-1126478375,lt=(lt<<17|lt>>>15)+Ye<<0,ut=(Je^lt&(Ye^Je))+rt[3]-1316259209,ut=(ut<<22|ut>>>10)+lt<<0):(Je=this.h0,ut=this.h1,lt=this.h2,Ye=this.h3,Je+=(Ye^ut&(lt^Ye))+rt[0]-680876936,Je=(Je<<7|Je>>>25)+ut<<0,Ye+=(lt^Je&(ut^lt))+rt[1]-389564586,Ye=(Ye<<12|Ye>>>20)+Je<<0,lt+=(ut^Ye&(Je^ut))+rt[2]+606105819,lt=(lt<<17|lt>>>15)+Ye<<0,ut+=(Je^lt&(Ye^Je))+rt[3]-1044525330,ut=(ut<<22|ut>>>10)+lt<<0),Je+=(Ye^ut&(lt^Ye))+rt[4]-176418897,Je=(Je<<7|Je>>>25)+ut<<0,Ye+=(lt^Je&(ut^lt))+rt[5]+1200080426,Ye=(Ye<<12|Ye>>>20)+Je<<0,lt+=(ut^Ye&(Je^ut))+rt[6]-1473231341,lt=(lt<<17|lt>>>15)+Ye<<0,ut+=(Je^lt&(Ye^Je))+rt[7]-45705983,ut=(ut<<22|ut>>>10)+lt<<0,Je+=(Ye^ut&(lt^Ye))+rt[8]+1770035416,Je=(Je<<7|Je>>>25)+ut<<0,Ye+=(lt^Je&(ut^lt))+rt[9]-1958414417,Ye=(Ye<<12|Ye>>>20)+Je<<0,lt+=(ut^Ye&(Je^ut))+rt[10]-42063,lt=(lt<<17|lt>>>15)+Ye<<0,ut+=(Je^lt&(Ye^Je))+rt[11]-1990404162,ut=(ut<<22|ut>>>10)+lt<<0,Je+=(Ye^ut&(lt^Ye))+rt[12]+1804603682,Je=(Je<<7|Je>>>25)+ut<<0,Ye+=(lt^Je&(ut^lt))+rt[13]-40341101,Ye=(Ye<<12|Ye>>>20)+Je<<0,lt+=(ut^Ye&(Je^ut))+rt[14]-1502002290,lt=(lt<<17|lt>>>15)+Ye<<0,ut+=(Je^lt&(Ye^Je))+rt[15]+1236535329,ut=(ut<<22|ut>>>10)+lt<<0,Je+=(lt^Ye&(ut^lt))+rt[1]-165796510,Je=(Je<<5|Je>>>27)+ut<<0,Ye+=(ut^lt&(Je^ut))+rt[6]-1069501632,Ye=(Ye<<9|Ye>>>23)+Je<<0,lt+=(Je^ut&(Ye^Je))+rt[11]+643717713,lt=(lt<<14|lt>>>18)+Ye<<0,ut+=(Ye^Je&(lt^Ye))+rt[0]-373897302,ut=(ut<<20|ut>>>12)+lt<<0,Je+=(lt^Ye&(ut^lt))+rt[5]-701558691,Je=(Je<<5|Je>>>27)+ut<<0,Ye+=(ut^lt&(Je^ut))+rt[10]+38016083,Ye=(Ye<<9|Ye>>>23)+Je<<0,lt+=(Je^ut&(Ye^Je))+rt[15]-660478335,lt=(lt<<14|lt>>>18)+Ye<<0,ut+=(Ye^Je&(lt^Ye))+rt[4]-405537848,ut=(ut<<20|ut>>>12)+lt<<0,Je+=(lt^Ye&(ut^lt))+rt[9]+568446438,Je=(Je<<5|Je>>>27)+ut<<0,Ye+=(ut^lt&(Je^ut))+rt[14]-1019803690,Ye=(Ye<<9|Ye>>>23)+Je<<0,lt+=(Je^ut&(Ye^Je))+rt[3]-187363961,lt=(lt<<14|lt>>>18)+Ye<<0,ut+=(Ye^Je&(lt^Ye))+rt[8]+1163531501,ut=(ut<<20|ut>>>12)+lt<<0,Je+=(lt^Ye&(ut^lt))+rt[13]-1444681467,Je=(Je<<5|Je>>>27)+ut<<0,Ye+=(ut^lt&(Je^ut))+rt[2]-51403784,Ye=(Ye<<9|Ye>>>23)+Je<<0,lt+=(Je^ut&(Ye^Je))+rt[7]+1735328473,lt=(lt<<14|lt>>>18)+Ye<<0,ut+=(Ye^Je&(lt^Ye))+rt[12]-1926607734,ut=(ut<<20|ut>>>12)+lt<<0,pi=ut^lt,Je+=(pi^Ye)+rt[5]-378558,Je=(Je<<4|Je>>>28)+ut<<0,Ye+=(pi^Je)+rt[8]-2022574463,Ye=(Ye<<11|Ye>>>21)+Je<<0,si=Ye^Je,lt+=(si^ut)+rt[11]+1839030562,lt=(lt<<16|lt>>>16)+Ye<<0,ut+=(si^lt)+rt[14]-35309556,ut=(ut<<23|ut>>>9)+lt<<0,pi=ut^lt,Je+=(pi^Ye)+rt[1]-1530992060,Je=(Je<<4|Je>>>28)+ut<<0,Ye+=(pi^Je)+rt[4]+1272893353,Ye=(Ye<<11|Ye>>>21)+Je<<0,si=Ye^Je,lt+=(si^ut)+rt[7]-155497632,lt=(lt<<16|lt>>>16)+Ye<<0,ut+=(si^lt)+rt[10]-1094730640,ut=(ut<<23|ut>>>9)+lt<<0,pi=ut^lt,Je+=(pi^Ye)+rt[13]+681279174,Je=(Je<<4|Je>>>28)+ut<<0,Ye+=(pi^Je)+rt[0]-358537222,Ye=(Ye<<11|Ye>>>21)+Je<<0,si=Ye^Je,lt+=(si^ut)+rt[3]-722521979,lt=(lt<<16|lt>>>16)+Ye<<0,ut+=(si^lt)+rt[6]+76029189,ut=(ut<<23|ut>>>9)+lt<<0,pi=ut^lt,Je+=(pi^Ye)+rt[9]-640364487,Je=(Je<<4|Je>>>28)+ut<<0,Ye+=(pi^Je)+rt[12]-421815835,Ye=(Ye<<11|Ye>>>21)+Je<<0,si=Ye^Je,lt+=(si^ut)+rt[15]+530742520,lt=(lt<<16|lt>>>16)+Ye<<0,ut+=(si^lt)+rt[2]-995338651,ut=(ut<<23|ut>>>9)+lt<<0,Je+=(lt^(ut|~Ye))+rt[0]-198630844,Je=(Je<<6|Je>>>26)+ut<<0,Ye+=(ut^(Je|~lt))+rt[7]+1126891415,Ye=(Ye<<10|Ye>>>22)+Je<<0,lt+=(Je^(Ye|~ut))+rt[14]-1416354905,lt=(lt<<15|lt>>>17)+Ye<<0,ut+=(Ye^(lt|~Je))+rt[5]-57434055,ut=(ut<<21|ut>>>11)+lt<<0,Je+=(lt^(ut|~Ye))+rt[12]+1700485571,Je=(Je<<6|Je>>>26)+ut<<0,Ye+=(ut^(Je|~lt))+rt[3]-1894986606,Ye=(Ye<<10|Ye>>>22)+Je<<0,lt+=(Je^(Ye|~ut))+rt[10]-1051523,lt=(lt<<15|lt>>>17)+Ye<<0,ut+=(Ye^(lt|~Je))+rt[1]-2054922799,ut=(ut<<21|ut>>>11)+lt<<0,Je+=(lt^(ut|~Ye))+rt[8]+1873313359,Je=(Je<<6|Je>>>26)+ut<<0,Ye+=(ut^(Je|~lt))+rt[15]-30611744,Ye=(Ye<<10|Ye>>>22)+Je<<0,lt+=(Je^(Ye|~ut))+rt[6]-1560198380,lt=(lt<<15|lt>>>17)+Ye<<0,ut+=(Ye^(lt|~Je))+rt[13]+1309151649,ut=(ut<<21|ut>>>11)+lt<<0,Je+=(lt^(ut|~Ye))+rt[4]-145523070,Je=(Je<<6|Je>>>26)+ut<<0,Ye+=(ut^(Je|~lt))+rt[11]-1120210379,Ye=(Ye<<10|Ye>>>22)+Je<<0,lt+=(Je^(Ye|~ut))+rt[2]+718787259,lt=(lt<<15|lt>>>17)+Ye<<0,ut+=(Ye^(lt|~Je))+rt[9]-343485551,ut=(ut<<21|ut>>>11)+lt<<0,this.first?(this.h0=Je+1732584193<<0,this.h1=ut-271733879<<0,this.h2=lt-1732584194<<0,this.h3=Ye+271733878<<0,this.first=!1):(this.h0=this.h0+Je<<0,this.h1=this.h1+ut<<0,this.h2=this.h2+lt<<0,this.h3=this.h3+Ye<<0)},Zt.prototype.hex=function(){this.finalize();var Je=this.h0,ut=this.h1,lt=this.h2,Ye=this.h3;return Pe[Je>>>4&15]+Pe[Je&15]+Pe[Je>>>12&15]+Pe[Je>>>8&15]+Pe[Je>>>20&15]+Pe[Je>>>16&15]+Pe[Je>>>28&15]+Pe[Je>>>24&15]+Pe[ut>>>4&15]+Pe[ut&15]+Pe[ut>>>12&15]+Pe[ut>>>8&15]+Pe[ut>>>20&15]+Pe[ut>>>16&15]+Pe[ut>>>28&15]+Pe[ut>>>24&15]+Pe[lt>>>4&15]+Pe[lt&15]+Pe[lt>>>12&15]+Pe[lt>>>8&15]+Pe[lt>>>20&15]+Pe[lt>>>16&15]+Pe[lt>>>28&15]+Pe[lt>>>24&15]+Pe[Ye>>>4&15]+Pe[Ye&15]+Pe[Ye>>>12&15]+Pe[Ye>>>8&15]+Pe[Ye>>>20&15]+Pe[Ye>>>16&15]+Pe[Ye>>>28&15]+Pe[Ye>>>24&15]},Zt.prototype.toString=Zt.prototype.hex,Zt.prototype.digest=function(){this.finalize();var Je=this.h0,ut=this.h1,lt=this.h2,Ye=this.h3;return[Je&255,Je>>>8&255,Je>>>16&255,Je>>>24&255,ut&255,ut>>>8&255,ut>>>16&255,ut>>>24&255,lt&255,lt>>>8&255,lt>>>16&255,lt>>>24&255,Ye&255,Ye>>>8&255,Ye>>>16&255,Ye>>>24&255]},Zt.prototype.array=Zt.prototype.digest,Zt.prototype.arrayBuffer=function(){this.finalize();var Je=new ArrayBuffer(16),ut=new Uint32Array(Je);return ut[0]=this.h0,ut[1]=this.h1,ut[2]=this.h2,ut[3]=this.h3,Je},Zt.prototype.buffer=Zt.prototype.arrayBuffer,Zt.prototype.base64=function(){for(var Je,ut,lt,Ye="",pi=this.array(),si=0;si<15;)Je=pi[si++],ut=pi[si++],lt=pi[si++],Ye+=Ie[Je>>>2]+Ie[(Je<<4|ut>>>4)&63]+Ie[(ut<<2|lt>>>6)&63]+Ie[lt&63];return Je=pi[si],Ye+=Ie[Je>>>2]+Ie[Je<<4&63]+"==",Ye};function xt(Je,ut){var lt,Ye=at(Je);if(Je=Ye[0],Ye[1]){var pi=[],si=Je.length,rt=0,kt;for(lt=0;lt<si;++lt)kt=Je.charCodeAt(lt),kt<128?pi[rt++]=kt:kt<2048?(pi[rt++]=192|kt>>>6,pi[rt++]=128|kt&63):kt<55296||kt>=57344?(pi[rt++]=224|kt>>>12,pi[rt++]=128|kt>>>6&63,pi[rt++]=128|kt&63):(kt=65536+((kt&1023)<<10|Je.charCodeAt(++lt)&1023),pi[rt++]=240|kt>>>18,pi[rt++]=128|kt>>>12&63,pi[rt++]=128|kt>>>6&63,pi[rt++]=128|kt&63);Je=pi}Je.length>64&&(Je=new Zt(!0).update(Je).array());var _i=[],Yi=[];for(lt=0;lt<64;++lt){var Lr=Je[lt]||0;_i[lt]=92^Lr,Yi[lt]=54^Lr}Zt.call(this,ut),this.update(Yi),this.oKeyPad=_i,this.inner=!0,this.sharedMemory=ut}xt.prototype=new Zt,xt.prototype.finalize=function(){if(Zt.prototype.finalize.call(this),this.inner){this.inner=!1;var Je=this.array();Zt.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(Je),Zt.prototype.finalize.call(this)}};var wt=Mt();wt.md5=wt,wt.md5.hmac=Bt(),o?D.exports=wt:ie.md5=wt})()}(md5$1)),md5$1.exports}var md5Exports=requireMd5();const md5=getDefaultExportFromCjs(md5Exports),_token="pk.eyJ1IjoiamF6dW5haCIsImEiOiJjbWJ6MHE4YWkxNDZlMmtzNmkzMzJkYWwwIn0.ytMNa3D7wJslVEdUx4M51A";function farmermap(){if(document.querySelector(".farmermap")){let Te=function(ge,Se,Ce){return Se.filter(Ve=>distance(ge,Ve.coordinates,{units:"kilometers"})<=Ce)},ve=function(ge,Se){let{title:Ce,categories:Ve,fullAddress:at,permalink:et}=ge.properties;const Mt=ge.geometry.coordinates.slice();let jt="";typeof Ve=="string"&&(Ve=JSON.parse(Ve));for(const Zt of Ve)jt+=`<div class="category"><img src="${Zt.icon}}" alt="${Zt.title}}"><span class="cat-title">${Zt.title}</span></div>`;let St=ge.properties.uid!==Se?`<a href="${et}" target="_blank" class="button">Mehr zu ${Ce}</a>`:"",Bt=`<div class="manufacturer_popup">
2686				<div class="categories">${jt}</div>
2687				<div class="title">${Ce}</div>
2688				<div class="address">${at}</div>
2689				${St}
2690				</div>`;new mapboxgl.Popup({focusAfterOpen:!1}).setLngLat(Mt).setHTML(Bt).addTo(q)},Ae=function(ge){const Se=q.getSource("locations");if(!Se||!O)return;const Ce=O.features.filter(Ve=>Ve.properties.categories.some(at=>ge.includes(at.ID)));if(Se.setData({type:"FeatureCollection",features:Ce}),Ce.length>0){const Ve=new mapboxgl.LngLatBounds;Ce.forEach(at=>Ve.extend(at.geometry.coordinates))}},Ie=function(ge){ge.classList.remove("_error_NaN","_error_length"),document.querySelector("._text_error_NaN").classList.remove("active"),document.querySelector("._text_error_NaPLZ").classList.remove("active"),document.querySelector("._text_error_length").classList.remove("active"),document.querySelector("._text_notice_none").classList.remove("active"),document.querySelector("._text_notice_number").classList.remove("active"),document.querySelector(".error_wrapper").classList.remove("active")};mapboxgl.accessToken=_token;const D=MapboxGeocoding({accessToken:_token});let O=null;const q=new mapboxgl.Map({container:"farmermap",style:"mapbox://styles/jazunah/cmbz0rcm6015x01qx4tj8dp06",center:[13.256113577563674,47.73399838910318],zoom:7});q.scrollZoom.disable(),q.addControl(new mapboxgl.NavigationControl);const J=JSON.parse(q._container.dataset.posts);for(const ge of J)ge.bgHash=md5(ge.bg),ge.iconHash=md5(ge.icon),ge.mergedHash=`merged-${ge.bgHash}-${ge.iconHash}`;async function ie(ge){try{const Ce=(await D.forwardGeocode({query:ge,limit:1}).send()).body.features;return Ce.length?Ce[0].center:null}catch(Se){return console.error("Geocoding error:",Se),null}}async function le(ge){const Se=[];for(const Ce of ge){const Ve=`${Ce.street} ${Ce.house_nr}, ${Ce.city}, ${Ce.zip}`,at=`${Ce.street} ${Ce.house_nr},  ${Ce.zip} ${Ce.city}`,Mt=-(await _e(Ce)).height/2,jt=await ie(Ve);jt?(Se.push({type:"Feature",geometry:{type:"Point",coordinates:jt},properties:{title:Ce.title,description:Ce.description,icon:md5(Ce.icon+Ce.title),iconOffset:[0,Mt],categories:Ce.categories,fullAddress:at,permalink:Ce.permalink,uid:Ce.uid}}),Ce.coordinates=jt):console.warn("Could not geocode:",Ve)}return{type:"FeatureCollection",features:Se}}async function _e(ge){return new Promise((Se,Ce)=>{q.loadImage(ge.icon,(Ve,at)=>{if(Ve)Ce(Ve);else{const et=md5(ge.icon+ge.title);q.addImage(et,at),Se(at)}
2690})})}async function o(ge){const Ce=await(await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(ge)}.json?types=postcode&country=AT&access_token=${mapboxgl.accessToken}`)).json();if(Ce.features.length>0){const Ve=Ce.features[0].geometry.coordinates,at=Te(Ve,J,50);if(at.length>0){const et=new mapboxgl.LngLatBounds;for(const Mt of at)et.extend(Mt.coordinates);q.fitBounds(et,{padding:200,maxZoom:12}),document.querySelector("._text_notice_number span").innerText=at.length,document.querySelector(".error_wrapper").classList.add("active"),document.querySelector("._text_notice_number").classList.add("active")}else at.length===0&&(document.querySelector(".error_wrapper").classList.add("active"),document.querySelector("._text_notice_none").classList.add("active"))}else Ce.features.length===0&&(document.querySelector(".error_wrapper").classList.add("active"),document.querySelector("._text_error_NaPLZ").classList.add("active"))}async function Pe(ge){if(typeof le!="function"){console.error("createGeoJSON is not defined.");return}if(O=await le(ge),q.addSource("locations",{type:"geojson",data:O,cluster:!0,clusterMaxZoom:10,clusterRadius:55}),q.addLayer({id:"clusters",type:"circle",source:"locations",filter:["has","point_count"],paint:{"circle-color":"#000000","circle-radius":25,"circle-opacity":1}}),q.addLayer({id:"cluster-count",type:"symbol",source:"locations",filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":14},paint:{"text-color":"#FFFFFF"}}),q.addLayer({id:"icon-layer",type:"symbol",source:"locations",filter:["!",["has","point_count"]],layout:{"icon-image":["get","icon"],"icon-size":.35,"icon-offset":["get","iconOffset"],"icon-allow-overlap":!0}}),q.on("click","clusters",Se=>{const Ce=q.queryRenderedFeatures(Se.point,{layers:["clusters"]}),Ve=Ce[0].properties.cluster_id;q.getSource("locations").getClusterExpansionZoom(Ve,(at,et)=>{at||q.easeTo({center:Ce[0].geometry.coordinates,zoom:et})})}),q.on("click","icon-layer",Se=>{ve(Se.features[0],q._container.dataset.uid)}),q._container.dataset.uid){const Se=O.features.find(Ce=>Ce.properties.uid===q._container.dataset.uid);ve(Se,q._container.dataset.uid),q.flyTo({center:Se.geometry.coordinates,zoom:9})}q.on("mouseenter","clusters",()=>q.getCanvas().style.cursor="pointer"),q.on("mouseleave","clusters",()=>q.getCanvas().style.cursor=""),q.on("mouseenter","icon-layer",()=>q.getCanvas().style.cursor="pointer"),q.on("mouseleave","icon-layer",()=>q.getCanvas().style.cursor="")}async function Ee(){const ge=q.getSource("locations");if(!ge||!O)return;ge.setData(O);const Se=new mapboxgl.LngLatBounds;O.features.forEach(Ce=>Se.extend(Ce.geometry.coordinates))}async function ye(){const ge=document.querySelector(".filterbox form.search-wrapper");if(!ge)return null;const Se=document.querySelector(".filterbox .filter-opener"),Ce=document.querySelector(".filterbox .filter-wrapper"),Ve=document.querySelectorAll(".filterbox .filter-wrapper .filter"),at=ge.querySelector("input.search");at.removeAttribute("disabled"),ge.querySelector("button[type='submit']").removeAttribute("disabled");const Mt=ge.querySelector("button[type='reset']");Mt.removeAttribute("disabled"),at.addEventListener("keyup",function(jt){!Mt.classList.contains("active")&&at.value&&Mt.classList.add("active"),at.value===""&&Mt.classList.remove("active")}),ge.addEventListener("reset",function(jt){return ge.querySelector("button[type='reset']").classList.remove("active"),Ie(ge),q.flyTo({center:[13.256113577563674,47.73399838910318],zoom:7}),!1}),ge.addEventListener("submit",function(jt){jt.preventDefault(),Ie(ge);const Bt=new FormData(ge).get("plz");if(!Bt)return q.flyTo({center:[13.256113577563674,47.73399838910318],zoom:7}),!1;if(isNaN(parseInt(Bt)))return ge.classList.add("_error_NaN"),document.querySelector(".error_wrapper").classList.add("active"),document.querySelector("._text_error_NaN").classList.add("active"),!1;if(Bt.length!==4)return ge.classList.add("_error_length"),document.querySelector(".error_wrapper").classList.add("active"),document.querySelector("._text_error_length").classList.add("active"),!1;o(Bt)}),Se.addEventListener("click",function(jt){Se.classList.toggle("active"),Ce.classList.toggle("active")});for(const jt of Ve)jt.addEventListener("click",function(){jt.classList.toggle("active");const St=document.querySelectorAll(".filterbox .filter-wrapper .filter.active");if(St.length>0){const Bt=[];
2690for(const Zt of St)Bt.push(parseInt(Zt.dataset.filter));Ae(Bt)}else Ee()})}q.on("load",async()=>{try{await Pe(J).then(()=>{ye()})}catch(ge){console.error("Error initializing clustered markers:",ge)}})}}function farmerlist(){if(document.querySelector(".farmerlist")){const O=document.querySelectorAll(".farmerlist .pagination .char-toggle"),q=document.querySelectorAll(".farmerlist .farmer-wrapper .farmer-item"),J=Array.from(q,ie=>ie.dataset.char);for(const ie of O)J.includes(ie.dataset.char)?ie.addEventListener("click",function(le){D(ie)}):ie.setAttribute("disabled",!0)}function D(O){const q=document.querySelector(".farmerlist .farmer-wrapper .farmer-item[data-char="+O.dataset.char+"]");q&&q.scrollIntoView({behavior:"smooth",block:"center"})}}function manufacturer(){const D=document.getElementsByClassName("moreswiper");for(const O of D)new Swiper(O,{modules:[Navigation,Pagination],pagination:{el:".swiper-pagination",clickable:!0,dynamicMainBullets:3},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},slidesPerView:1,spaceBetween:0,breakpoints:{1280:{slidesPerView:2,spaceBetween:10}},on:{setTranslate(q,J){q.wrapperEl.style.transform=`translateX(${J}px) translateZ(0)`}}})}function video(){new g$1({}),document.querySelectorAll(".video-container-inner").forEach(O=>{const q=O.querySelector("video"),J=O.querySelector(".video-button");O.addEventListener("click",function(ie){q.paused?(q.play(),J.classList.remove("play-button"),J.classList.add("pause-button")):(q.pause(),J.classList.remove("pause-button"),J.classList.add("play-button"))})})}function logoslider(){const D=document.getElementsByClassName("logo-slider__swiper");for(const O of D){const q=O.querySelector(".swiper-wrapper");O.querySelectorAll(".swiper-slide").length;const J=Array.from(q.querySelectorAll(".swiper-slide")),ie=J[0].offsetWidth,le=window.innerWidth,_e=Math.ceil(le/ie);for(;q.querySelectorAll(".swiper-slide").length<_e;)J.forEach(o=>q.appendChild(o.cloneNode(!0)));new Swiper(O,{modules:[Autoplay],slidesPerView:"auto",loop:!0,spaceBetween:15,centeredSlides:!1,slidesOffsetBefore:15,slidesOffsetAfter:15,autoplay:{delay:2500,disableOnInteraction:!0},breakpoints:{1024:{spaceBetween:20,slidesOffsetBefore:20,slidesOffsetAfter:20}}})}}var glightbox_min$1={exports:{}},glightbox_min=glightbox_min$1.exports,hasRequiredGlightbox_min;function requireGlightbox_min(){return hasRequiredGlightbox_min||(hasRequiredGlightbox_min=1,function(D,O){(function(q,J){D.exports=J()})(glightbox_min,function(){function q(Le,Ue){if(!(Le instanceof Ue))throw new TypeError("Cannot call a class as a function")}function J(Le,Ue){for(var bt=0;bt<Ue.length;bt++){var It=Ue[bt];It.enumerable=It.enumerable||!1,It.configurable=!0,"value"in It&&(It.writable=!0),Object.defineProperty(Le,le(It.key),It)}}function ie(Le,Ue,bt){return Ue&&J(Le.prototype,Ue),Object.defineProperty(Le,"prototype",{writable:!1}),Le}function le(Le){var Ue=function(bt,It){if(typeof bt!="object"||!bt)return bt;var Yt=bt[Symbol.toPrimitive];if(Yt!==void 0){var ai=Yt.call(bt,It);if(typeof ai!="object")return ai;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(bt)}(Le,"string");return typeof Ue=="symbol"?Ue:Ue+""}function _e(Le){return(_e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ue){return typeof Ue}:function(Ue){return Ue&&typeof Symbol=="function"&&Ue.constructor===Symbol&&Ue!==Symbol.prototype?"symbol":typeof Ue})(Le)}var o=Date.now();function Te(){var Le={},Ue=!0,bt=0,It=arguments.length;Object.prototype.toString.call(arguments[0])==="[object Boolean]"&&(Ue=arguments[0],bt++);for(var Yt=function(li){for(var di in li)Object.prototype.hasOwnProperty.call(li,di)&&(Ue&&Object.prototype.toString.call(li[di])==="[object Object]"?Le[di]=Te(!0,Le[di],li[di]):Le[di]=li[di])};bt<It;bt++){var ai=arguments[bt];Yt(ai)}return Le}function Pe(Le,Ue){if((Je(Le)||Le===window||Le===document)&&(Le=[Le]),lt(Le)||Ye(Le)||(Le=[Le]),rt(Le)!=0){if(lt(Le)&&!Ye(Le))for(var bt=Le.length,It=0;It<bt&&Ue.call(Le[It],Le[It],It,Le)!==!1;It++);else if(Ye(Le)){for(var Yt in Le)if(si(Le,Yt)&&Ue.call(Le[Yt],Le[Yt],Yt,Le)===!1)break}}}function ve(Le){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,bt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,It=Le[o]=Le[o]||[],Yt={all:It,evt:null,found:null};return Ue&&bt&&rt(It)>0&&Pe(It,function(ai,li){if(ai.eventName==Ue&&ai.fn.toString()==bt.toString())return Yt.found=!0,Yt.evt=li,!1}),Yt}function Ae(Le){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},bt=Ue.onElement,It=Ue.withCallback,Yt=Ue.avoidDuplicate,ai=Yt===void 0||Yt,li=Ue.once,di=li!==void 0&&li,Gi=Ue.useCapture,Ni=Gi!==void 0&&Gi,$i=arguments.length>2?arguments[2]:void 0,er=bt||[];function yr(or){xt(It)&&It.call($i,or,this),di&&yr.destroy()}return wt(er)&&(er=document.querySelectorAll(er)),yr.destroy=function(){Pe(er,function(or){var wr=ve(or,Le,yr);wr.found&&wr.all.splice(wr.evt,1),or.removeEventListener&&or.removeEventListener(Le,yr,Ni)})},Pe(er,function(or){var wr=ve(or,Le,yr);
2690(or.addEventListener&&ai&&!wr.found||!ai)&&(or.addEventListener(Le,yr,Ni),wr.all.push({eventName:Le,fn:yr}))}),yr}function Ee(Le,Ue){Pe(Ue.split(" "),function(bt){return Le.classList.add(bt)})}function Ie(Le,Ue){Pe(Ue.split(" "),function(bt){return Le.classList.remove(bt)})}function ye(Le,Ue){return Le.classList.contains(Ue)}function ge(Le,Ue){for(;Le!==document.body;){if(!(Le=Le.parentElement))return!1;if(typeof Le.matches=="function"?Le.matches(Ue):Le.msMatchesSelector(Ue))return Le}}function Se(Le){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",bt=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!Le||Ue==="")return!1;if(Ue==="none")return xt(bt)&&bt(),!1;var It=jt(),Yt=Ue.split(" ");Pe(Yt,function(ai){Ee(Le,"g"+ai)}),Ae(It,{onElement:Le,avoidDuplicate:!1,once:!0,withCallback:function(ai,li){Pe(Yt,function(di){Ie(li,"g"+di)}),xt(bt)&&bt()}})}function Ce(Le){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(Ue==="")return Le.style.webkitTransform="",Le.style.MozTransform="",Le.style.msTransform="",Le.style.OTransform="",Le.style.transform="",!1;Le.style.webkitTransform=Ue,Le.style.MozTransform=Ue,Le.style.msTransform=Ue,Le.style.OTransform=Ue,Le.style.transform=Ue}function Ve(Le){Le.style.display="block"}function at(Le){Le.style.display="none"}function et(Le){var Ue=document.createDocumentFragment(),bt=document.createElement("div");for(bt.innerHTML=Le;bt.firstChild;)Ue.appendChild(bt.firstChild);return Ue}function Mt(){return{width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}function jt(){var Le,Ue=document.createElement("fakeelement"),bt={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(Le in bt)if(Ue.style[Le]!==void 0)return bt[Le]}function St(Le,Ue,bt,It){if(Le())Ue();else{var Yt;bt||(bt=100);var ai=setInterval(function(){Le()&&(clearInterval(ai),Yt&&clearTimeout(Yt),Ue())},bt)}}function Bt(Le,Ue,bt){if(pi(Le))console.error("Inject assets error");else if(xt(Ue)&&(bt=Ue,Ue=!1),wt(Ue)&&Ue in window)xt(bt)&&bt();else{var It;if(Le.indexOf(".css")!==-1){if((It=document.querySelectorAll('link[href="'+Le+'"]'))&&It.length>0)return void(xt(bt)&&bt());var Yt=document.getElementsByTagName("head")[0],ai=Yt.querySelectorAll('link[rel="stylesheet"]'),li=document.createElement("link");return li.rel="stylesheet",li.type="text/css",li.href=Le,li.media="all",ai?Yt.insertBefore(li,ai[0]):Yt.appendChild(li),void(xt(bt)&&bt())}if((It=document.querySelectorAll('script[src="'+Le+'"]'))&&It.length>0){if(xt(bt)){if(wt(Ue))return St(function(){return window[Ue]!==void 0},function(){bt()}),!1;bt()}}else{var di=document.createElement("script");di.type="text/javascript",di.src=Le,di.onload=function(){if(xt(bt)){if(wt(Ue))return St(function(){return window[Ue]!==void 0},function(){bt()}),!1;bt()}},document.body.appendChild(di)}}}function Zt(){return"navigator"in window&&window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i)}function xt(Le){return typeof Le=="function"}function wt(Le){return typeof Le=="string"}function Je(Le){return!(!Le||!Le.nodeType||Le.nodeType!=1)}function ut(Le){return Array.isArray(Le)}function lt(Le){return Le&&Le.length&&isFinite(Le.length)}function Ye(Le){return _e(Le)==="object"&&Le!=null&&!xt(Le)&&!ut(Le)}function pi(Le){return Le==null}function si(Le,Ue){return Le!==null&&hasOwnProperty.call(Le,Ue)}function rt(Le){if(Ye(Le)){if(Le.keys)return Le.keys().length;var Ue=0;for(var bt in Le)si(Le,bt)&&Ue++;return Ue}return Le.length}function kt(Le){return!isNaN(parseFloat(Le))&&isFinite(Le)}function _i(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1,Ue=document.querySelectorAll(".gbtn[data-taborder]:not(.disabled)");if(!Ue.length)return!1;if(Ue.length==1)return Ue[0];typeof Le=="string"&&(Le=parseInt(Le));var bt=[];Pe(Ue,function(di){bt.push(di.getAttribute("data-taborder"))});var It=Math.max.apply(Math,bt.map(function(di){return parseInt(di)})),Yt=Le<0?1:Le+1;Yt>It&&(Yt="1");var ai=bt.filter(function(di){return di>=parseInt(Yt)}),li=ai.sort()[0];return document.querySelector('.gbtn[data-taborder="'.concat(li,'"]'))}function Yi(Le){if(Le.events.hasOwnProperty("keyboard"))return!1;Le.events.keyboard=Ae("keydown",{onElement:window,withCallback:function(Ue,bt){var It=(Ue=Ue||window.event).keyCode;if(It==9){var Yt=document.querySelector(".gbtn.focused");
2690if(!Yt){var ai=!(!document.activeElement||!document.activeElement.nodeName)&&document.activeElement.nodeName.toLocaleLowerCase();if(ai=="input"||ai=="textarea"||ai=="button")return}Ue.preventDefault();var li=document.querySelectorAll(".gbtn[data-taborder]");if(!li||li.length<=0)return;if(!Yt){var di=_i();return void(di&&(di.focus(),Ee(di,"focused")))}var Gi=_i(Yt.getAttribute("data-taborder"));Ie(Yt,"focused"),Gi&&(Gi.focus(),Ee(Gi,"focused"))}It==39&&Le.nextSlide(),It==37&&Le.prevSlide(),It==27&&Le.close()}})}var Lr=ie(function Le(Ue,bt){var It=this,Yt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(q(this,Le),this.img=Ue,this.slide=bt,this.onclose=Yt,this.img.setZoomEvents)return!1;this.active=!1,this.zoomedIn=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.img.addEventListener("mousedown",function(ai){return It.dragStart(ai)},!1),this.img.addEventListener("mouseup",function(ai){return It.dragEnd(ai)},!1),this.img.addEventListener("mousemove",function(ai){return It.drag(ai)},!1),this.img.addEventListener("click",function(ai){return It.slide.classList.contains("dragging-nav")?(It.zoomOut(),!1):It.zoomedIn?void(It.zoomedIn&&!It.dragging&&It.zoomOut()):It.zoomIn()},!1),this.img.setZoomEvents=!0},[{key:"zoomIn",value:function(){var Le=this.widowWidth();if(!(this.zoomedIn||Le<=768)){var Ue=this.img;if(Ue.setAttribute("data-style",Ue.getAttribute("style")),Ue.style.maxWidth=Ue.naturalWidth+"px",Ue.style.maxHeight=Ue.naturalHeight+"px",Ue.naturalWidth>Le){var bt=Le/2-Ue.naturalWidth/2;this.setTranslate(this.img.parentNode,bt,0)}this.slide.classList.add("zoomed"),this.zoomedIn=!0}}},{key:"zoomOut",value:function(){this.img.parentNode.setAttribute("style",""),this.img.setAttribute("style",this.img.getAttribute("data-style")),this.slide.classList.remove("zoomed"),this.zoomedIn=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.onclose&&typeof this.onclose=="function"&&this.onclose()}},{key:"dragStart",value:function(Le){Le.preventDefault(),this.zoomedIn?(Le.type==="touchstart"?(this.initialX=Le.touches[0].clientX-this.xOffset,this.initialY=Le.touches[0].clientY-this.yOffset):(this.initialX=Le.clientX-this.xOffset,this.initialY=Le.clientY-this.yOffset),Le.target===this.img&&(this.active=!0,this.img.classList.add("dragging"))):this.active=!1}},{key:"dragEnd",value:function(Le){var Ue=this;Le.preventDefault(),this.initialX=this.currentX,this.initialY=this.currentY,this.active=!1,setTimeout(function(){Ue.dragging=!1,Ue.img.isDragging=!1,Ue.img.classList.remove("dragging")},100)}},{key:"drag",value:function(Le){this.active&&(Le.preventDefault(),Le.type==="touchmove"?(this.currentX=Le.touches[0].clientX-this.initialX,this.currentY=Le.touches[0].clientY-this.initialY):(this.currentX=Le.clientX-this.initialX,this.currentY=Le.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.img.isDragging=!0,this.dragging=!0,this.setTranslate(this.img,this.currentX,this.currentY))}},{key:"onMove",value:function(Le){if(this.zoomedIn){var Ue=Le.clientX-this.img.naturalWidth/2,bt=Le.clientY-this.img.naturalHeight/2;this.setTranslate(this.img,Ue,bt)}}},{key:"setTranslate",value:function(Le,Ue,bt){Le.style.transform="translate3d("+Ue+"px, "+bt+"px, 0)"}},{key:"widowWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}}]),Ii=ie(function Le(){var Ue=this,bt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};q(this,Le);var It=bt.dragEl,Yt=bt.toleranceX,ai=Yt===void 0?40:Yt,li=bt.toleranceY,di=li===void 0?65:li,Gi=bt.slide,Ni=Gi===void 0?null:Gi,$i=bt.instance,er=$i===void 0?null:$i;this.el=It,this.active=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.direction=null,this.lastDirection=null,this.toleranceX=ai,this.toleranceY=di,this.toleranceReached=!1,this.dragContainer=this.el,this.slide=Ni,this.instance=er,this.el.addEventListener("mousedown",function(yr){return Ue.dragStart(yr)},!1),this.el.addEventListener("mouseup",function(yr){return Ue.dragEnd(yr)},!1),this.el.addEventListener("mousemove",function(yr){return Ue.drag(yr)},!1)},[{key:"dragStart",value:function(Le){if(this.slide.classList.contains("zoomed"))this.active=!1;else{Le.type==="touchstart"?(this.initialX=Le.touches[0].clientX-this.xOffset,this.initialY=Le.touches[0].clientY-this.yOffset):(this.initialX=Le.clientX-this.xOffset,this.initialY=Le.clientY-this.yOffset);var Ue=Le.target.nodeName.toLowerCase();Le.target.classList.contains("nodrag")||ge(Le.target,".nodrag")||["input","select","textarea","button","a"].indexOf(Ue)!==-1?this.active=!1:(Le.preventDefault(),(Le.target===this.el||Ue!=="img"&&ge(Le.target,".gslide-inline"))&&(this.active=!0,this.el.classList.add("dragging"),this.dragContainer=ge(Le.target,".ginner-container")))}}},{key:"dragEnd",value:function(Le){var Ue=this;Le&&Le.preventDefault(),this.initialX=0,this.initialY=0,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.active=!1,this.doSlideChange&&(this.instance.preventOutsideClick=!0,this.doSlideChange=="right"&&this.instance.prevSlide(),this.doSlideChange=="left"&&this.instance.nextSlide()),this.doSlideClose&&this.instance.close(),this.toleranceReached||this.setTranslate(this.dragContainer,0,0,!0),setTimeout(function(){Ue.instance.preventOutsideClick=!1,Ue.toleranceReached=!1,Ue.lastDirection=null,Ue.dragging=!1,Ue.el.isDragging=!1,Ue.el.classList.remove("dragging"),Ue.slide.classList.remove("dragging-nav"),Ue.dragContainer.style.transform="",Ue.dragContainer.style.transition=""},100)}},{key:"drag",value:function(Le){if(this.active){Le.preventDefault(),this.slide.classList.add("dragging-nav"),Le.type==="touchmove"?(this.currentX=Le.touches[0].clientX-this.initialX,this.currentY=Le.touches[0].clientY-this.initialY):(this.currentX=Le.clientX-this.initialX,this.currentY=Le.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.el.isDragging=!0,this.dragging=!0,this.doSlideChange=!1,this.doSlideClose=!1;var Ue=Math.abs(this.currentX),bt=Math.abs(this.currentY);if(Ue>0&&Ue>=Math.abs(this.currentY)&&(!this.lastDirection||this.lastDirection=="x")){this.yOffset=0,this.lastDirection="x",this.setTranslate(this.dragContainer,this.currentX,0);var It=this.shouldChange();if(!this.instance.settings.dragAutoSnap&&It&&(this.doSlideChange=It),this.instance.settings.dragAutoSnap&&It)return this.instance.preventOutsideClick=!0,this.toleranceReached=!0,this.active=!1,this.instance.preventOutsideClick=!0,this.dragEnd(null),It=="right"&&this.instance.prevSlide(),void(It=="left"&&this.instance.nextSlide())}if(this.toleranceY>0&&bt>0&&bt>=Ue&&(!this.lastDirection||this.lastDirection=="y")){this.xOffset=0,this.lastDirection="y",this.setTranslate(this.dragContainer,0,this.currentY);var Yt=this.shouldClose();return!this.instance.settings.dragAutoSnap&&Yt&&(this.doSlideClose=!0),void(this.instance.settings.dragAutoSnap&&Yt&&this.instance.close())}}}},{key:"shouldChange",value:function(){var Le=!1;if(Math.abs(this.currentX)>=this.toleranceX){var Ue=this.currentX>0?"right":"left";(Ue=="left"&&this.slide!==this.slide.parentNode.lastChild||Ue=="right"&&this.slide!==this.slide.parentNode.firstChild)&&(Le=Ue)}return Le}},{key:"shouldClose",value:function(){var Le=!1;return Math.abs(this.currentY)>=this.toleranceY&&(Le=!0),Le}},{key:"setTranslate",value:function(Le,Ue,bt){var It=arguments.length>3&&arguments[3]!==void 0&&arguments[3];Le.style.transition=It?"all .2s ease":"",Le.style.transform="translate3d(".concat(Ue,"px, ").concat(bt,"px, 0)")}}]);function en(Le,Ue,bt,It){var Yt=Le.querySelector(".gslide-media"),ai=new Image,li="gSlideTitle_"+bt,di="gSlideDesc_"+bt;ai.addEventListener("load",function(){xt(It)&&It()},!1),ai.src=Ue.href,Ue.sizes!=""&&Ue.srcset!=""&&(ai.sizes=Ue.sizes,ai.srcset=Ue.srcset),ai.alt="",pi(Ue.alt)||Ue.alt===""||(ai.alt=Ue.alt),Ue.title!==""&&ai.setAttribute("aria-labelledby",li),Ue.description!==""&&ai.setAttribute("aria-describedby",di),Ue.hasOwnProperty("_hasCustomWidth")&&Ue._hasCustomWidth&&(ai.style.width=Ue.width),Ue.hasOwnProperty("_hasCustomHeight")&&Ue._hasCustomHeight&&(ai.style.height=Ue.height),Yt.insertBefore(ai,Yt.firstChild)}function Rr(Le,Ue,bt,It){var Yt=this,ai=Le.querySelector(".ginner-container"),li="gvideo"+bt,di=Le.querySelector(".gslide-media"),Gi=this.getAllPlayers();Ee(ai,"gvideo-container"),di.insertBefore(et('<div class="gvideo-wrapper"></div>'),di.firstChild);var Ni=Le.querySelector(".gvideo-wrapper");Bt(this.settings.plyr.css,"Plyr");var $i=Ue.href,er=Ue==null?void 0:Ue.videoProvider,yr=!1;di.style.maxWidth=Ue.width,Bt(this.settings.plyr.js,"Plyr",function(){if(!er&&$i.match(/vimeo\.com\/([0-9]*)/)&&(er="vimeo"),!er&&($i.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||$i.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||$i.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||$i.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/))&&
2690(er="youtube"),er==="local"||!er){er="local";var or='<video id="'+li+'" ';or+='style="background:#000; max-width: '.concat(Ue.width,';" '),or+='preload="metadata" ',or+='x-webkit-airplay="allow" ',or+="playsinline ",or+="controls ",or+='class="gvideo-local">',or+='<source src="'.concat($i,'">'),yr=et(or+="</video>")}var wr=yr||et('<div id="'.concat(li,'" data-plyr-provider="').concat(er,'" data-plyr-embed-id="').concat($i,'"></div>'));Ee(Ni,"".concat(er,"-video gvideo")),Ni.appendChild(wr),Ni.setAttribute("data-id",li),Ni.setAttribute("data-index",bt);var zi=si(Yt.settings.plyr,"config")?Yt.settings.plyr.config:{},vn=new Plyr("#"+li,zi);vn.on("ready",function(Vn){Gi[li]=Vn.detail.plyr,xt(It)&&It()}),St(function(){return Le.querySelector("iframe")&&Le.querySelector("iframe").dataset.ready=="true"},function(){Yt.resize(Le)}),vn.on("enterfullscreen",Jr),vn.on("exitfullscreen",Jr)})}function Jr(Le){var Ue=ge(Le.target,".gslide-media");Le.type==="enterfullscreen"&&Ee(Ue,"fullscreen"),Le.type==="exitfullscreen"&&Ie(Ue,"fullscreen")}function kr(Le,Ue,bt,It){var Yt,ai=this,li=Le.querySelector(".gslide-media"),di=!(!si(Ue,"href")||!Ue.href)&&Ue.href.split("#").pop().trim(),Gi=!(!si(Ue,"content")||!Ue.content)&&Ue.content;if(Gi&&(wt(Gi)&&(Yt=et('<div class="ginlined-content">'.concat(Gi,"</div>"))),Je(Gi))){Gi.style.display=="none"&&(Gi.style.display="block");var Ni=document.createElement("div");Ni.className="ginlined-content",Ni.appendChild(Gi),Yt=Ni}if(di){var $i=document.getElementById(di);if(!$i)return!1;var er=$i.cloneNode(!0);er.style.height=Ue.height,er.style.maxWidth=Ue.width,Ee(er,"ginlined-content"),Yt=er}if(!Yt)return console.error("Unable to append inline slide content",Ue),!1;li.style.height=Ue.height,li.style.width=Ue.width,li.appendChild(Yt),this.events["inlineclose"+di]=Ae("click",{onElement:li.querySelectorAll(".gtrigger-close"),withCallback:function(yr){yr.preventDefault(),ai.close()}}),xt(It)&&It()}function Pr(Le,Ue,bt,It){var Yt=Le.querySelector(".gslide-media"),ai=function(li){var di=li.url,Gi=li.allow,Ni=li.callback,$i=li.appendTo,er=document.createElement("iframe");return er.className="vimeo-video gvideo",er.src=di,er.style.width="100%",er.style.height="100%",Gi&&er.setAttribute("allow",Gi),er.onload=function(){er.onload=null,Ee(er,"node-ready"),xt(Ni)&&Ni()},$i&&$i.appendChild(er),er}({url:Ue.href,callback:It});Yt.parentNode.style.maxWidth=Ue.width,Yt.parentNode.style.height=Ue.height,Yt.appendChild(ai)}var An=ie(function Le(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};q(this,Le),this.defaults={href:"",sizes:"",srcset:"",title:"",type:"",videoProvider:"",description:"",alt:"",descPosition:"bottom",effect:"",width:"",height:"",content:!1,zoomable:!0,draggable:!0},Ye(Ue)&&(this.defaults=Te(this.defaults,Ue))},[{key:"sourceType",value:function(Le){var Ue=Le;return(Le=Le.toLowerCase()).match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/)!==null?"image":Le.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||Le.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||Le.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||Le.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/)||Le.match(/vimeo\.com\/([0-9]*)/)||Le.match(/\.(mp4|ogg|webm|mov)/)!==null?"video":Le.match(/\.(mp3|wav|wma|aac|ogg)/)!==null?"audio":Le.indexOf("#")>-1&&Ue.split("#").pop().trim()!==""?"inline":Le.indexOf("goajax=true")>-1?"ajax":"external"}},{key:"parseConfig",value:function(Le,Ue){var bt=this,It=Te({descPosition:Ue.descPosition},this.defaults);if(Ye(Le)&&!Je(Le)){si(Le,"type")||(si(Le,"content")&&Le.content?Le.type="inline":si(Le,"href")&&(Le.type=this.sourceType(Le.href)));var Yt=Te(It,Le);return this.setSize(Yt,Ue),Yt}var ai="",li=Le.getAttribute("data-glightbox"),di=Le.nodeName.toLowerCase();if(di==="a"&&(ai=Le.href),di==="img"&&(ai=Le.src,It.alt=Le.alt),It.href=ai,Pe(It,function(or,wr){si(Ue,wr)&&wr!=="width"&&(It[wr]=Ue[wr]);var zi=Le.dataset[wr];pi(zi)||(It[wr]=bt.sanitizeValue(zi))}),It.content&&(It.type="inline"),!It.type&&ai&&(It.type=this.sourceType(ai)),pi(li)){if(!It.title&&di=="a"){var Gi=Le.title;pi(Gi)||Gi===""||(It.title=Gi)}if(!It.title&&di=="img"){var Ni=Le.alt;pi(Ni)||Ni===""||(It.title=Ni)}}else{var $i=[];Pe(It,function(or,wr){$i.push(";\\s?"+wr)}),$i=$i.join("\\s?:|"),li.trim()!==""&&Pe(It,function(or,wr){var zi=li,vn=new RegExp("s?"+wr+"s?:s?(.*?)("+$i+"s?:|$)"),Vn=zi.match(vn);if(Vn&&Vn.length&&Vn[1]){var mn=Vn[1].trim().replace(/;\s*$/,"");
2690It[wr]=bt.sanitizeValue(mn)}})}if(It.description&&It.description.substring(0,1)==="."){var er;try{er=document.querySelector(It.description).innerHTML}catch(or){if(!(or instanceof DOMException))throw or}er&&(It.description=er)}if(!It.description){var yr=Le.querySelector(".glightbox-desc");yr&&(It.description=yr.innerHTML)}return this.setSize(It,Ue,Le),this.slideConfig=It,It}},{key:"setSize",value:function(Le,Ue){var bt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,It=Le.type=="video"?this.checkSize(Ue.videosWidth):this.checkSize(Ue.width),Yt=this.checkSize(Ue.height);return Le.width=si(Le,"width")&&Le.width!==""?this.checkSize(Le.width):It,Le.height=si(Le,"height")&&Le.height!==""?this.checkSize(Le.height):Yt,bt&&Le.type=="image"&&(Le._hasCustomWidth=!!bt.dataset.width,Le._hasCustomHeight=!!bt.dataset.height),Le}},{key:"checkSize",value:function(Le){return kt(Le)?"".concat(Le,"px"):Le}},{key:"sanitizeValue",value:function(Le){return Le!=="true"&&Le!=="false"?Le:Le==="true"}}]),pt=ie(function Le(Ue,bt,It){q(this,Le),this.element=Ue,this.instance=bt,this.index=It},[{key:"setContent",value:function(){var Le=this,Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,bt=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(ye(Ue,"loaded"))return!1;var It=this.instance.settings,Yt=this.slideConfig,ai=Zt();xt(It.beforeSlideLoad)&&It.beforeSlideLoad({index:this.index,slide:Ue,player:!1});var li=Yt.type,di=Yt.descPosition,Gi=Ue.querySelector(".gslide-media"),Ni=Ue.querySelector(".gslide-title"),$i=Ue.querySelector(".gslide-desc"),er=Ue.querySelector(".gdesc-inner"),yr=bt,or="gSlideTitle_"+this.index,wr="gSlideDesc_"+this.index;if(xt(It.afterSlideLoad)&&(yr=function(){xt(bt)&&bt(),It.afterSlideLoad({index:Le.index,slide:Ue,player:Le.instance.getSlidePlayerInstance(Le.index)})}),Yt.title==""&&Yt.description==""?er&&er.parentNode.parentNode.removeChild(er.parentNode):(Ni&&Yt.title!==""?(Ni.id=or,Ni.innerHTML=Yt.title):Ni.parentNode.removeChild(Ni),$i&&Yt.description!==""?($i.id=wr,ai&&It.moreLength>
26900?(Yt.smallDescription=this.slideShortDesc(Yt.description,It.moreLength,It.moreText),$i.innerHTML=Yt.smallDescription,this.descriptionEvents($i,Yt)):$i.innerHTML=Yt.description):$i.parentNode.removeChild($i),Ee(Gi.parentNode,"desc-".concat(di)),Ee(er.parentNode,"description-".concat(di))),Ee(Gi,"gslide-".concat(li)),Ee(Ue,"loaded"),li!=="video"){if(li!=="external")return li==="inline"?(kr.apply(this.instance,[Ue,Yt,this.index,yr]),void(Yt.draggable&&new Ii({dragEl:Ue.querySelector(".gslide-inline"),toleranceX:It.dragToleranceX,toleranceY:It.dragToleranceY,slide:Ue,instance:this.instance}))):void(li!=="image"?xt(yr)&&yr():en(Ue,Yt,this.index,function(){var zi=Ue.querySelector("img");Yt.draggable&&new Ii({dragEl:zi,toleranceX:It.dragToleranceX,toleranceY:It.dragToleranceY,slide:Ue,instance:Le.instance}),Yt.zoomable&&zi.naturalWidth>zi.offsetWidth&&(Ee(zi,"zoomable"),new Lr(zi,Ue,function(){Le.instance.resize()})),xt(yr)&&yr()}));Pr.apply(this,[Ue,Yt,this.index,yr])}else Rr.apply(this.instance,[Ue,Yt,this.index,yr])}}
vendor: 11,958 bytes, line 2690
2690,{key:"slideShortDesc",value:function(Le){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:50,bt=arguments.length>2&&arguments[2]!==void 0&&arguments[2],It=document.createElement("div");It.innerHTML=Le;var Yt=It.innerText,ai=bt;if((Le=Yt.trim()).length<=Ue)return Le;var li=Le.substr(0,Ue-1);return ai?(It=null,li+'... <a href="#" class="desc-more">'+bt+"</a>"):li}},{key:"descriptionEvents",value:function(Le,Ue){var bt=this,It=Le.querySelector(".desc-more");if(!It)return!1;Ae("click",{onElement:It,withCallback:function(Yt,ai){Yt.preventDefault();var li=document.body,di=ge(ai,".gslide-desc");if(!di)return!1;di.innerHTML=Ue.description,Ee(li,"gdesc-open");var Gi=Ae("click",{onElement:[li,ge(di,".gslide-description")],withCallback:function(Ni,$i){Ni.target.nodeName.toLowerCase()!=="a"&&(Ie(li,"gdesc-open"),Ee(li,"gdesc-closed"),di.innerHTML=Ue.smallDescription,bt.descriptionEvents(di,Ue),setTimeout(function(){Ie(li,"gdesc-closed")},400),Gi.destroy())}})}})}},{key:"create",value:function(){return et(this.instance.settings.slideHTML)}},{key:"getConfig",value:function(){Je(this.element)||this.element.hasOwnProperty("draggable")||(this.element.draggable=this.instance.settings.draggable);var Le=new An(this.instance.settings.slideExtraAttributes);return this.slideConfig=Le.parseConfig(this.element,this.instance.settings),this.slideConfig}}]);function pn(Le){return Math.sqrt(Le.x*Le.x+Le.y*Le.y)}function Mn(Le,Ue){var bt=function(It,Yt){var ai=pn(It)*pn(Yt);if(ai===0)return 0;var li=function(di,Gi){return di.x*Gi.x+di.y*Gi.y}(It,Yt)/ai;return li>1&&(li=1),Math.acos(li)}(Le,Ue);return function(It,Yt){return It.x*Yt.y-Yt.x*It.y}(Le,Ue)>0&&(bt*=-1),180*bt/Math.PI}var fn=ie(function Le(Ue){q(this,Le),this.handlers=[],this.el=Ue},[{key:"add",value:function(Le){this.handlers.push(Le)}},{key:"del",value:function(Le){Le||(this.handlers=[]);for(var Ue=this.handlers.length;Ue>=0;Ue--)this.handlers[Ue]===Le&&this.handlers.splice(Ue,1)}},{key:"dispatch",value:function(){for(var Le=0,Ue=this.handlers.length;Le<Ue;Le++){var bt=this.handlers[Le];typeof bt=="function"&&bt.apply(this.el,arguments)}}}]);function Ht(Le,Ue){var bt=new fn(Le);return bt.add(Ue),bt}var on=ie(function Le(Ue,bt){q(this,Le),this.element=typeof Ue=="string"?document.querySelector(Ue):Ue,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var It=function(){};this.rotate=Ht(this.element,bt.rotate||It),this.touchStart=Ht(this.element,bt.touchStart||It),this.multipointStart=Ht(this.element,bt.multipointStart||It),this.multipointEnd=Ht(this.element,bt.multipointEnd||It),this.pinch=Ht(this.element,bt.pinch||It),this.swipe=Ht(this.element,bt.swipe||It),this.tap=Ht(this.element,bt.tap||It),this.doubleTap=Ht(this.element,bt.doubleTap||It),this.longTap=Ht(this.element,bt.longTap||It),this.singleTap=Ht(this.element,bt.singleTap||It),this.pressMove=Ht(this.element,bt.pressMove||It),this.twoFingerPressMove=Ht(this.element,bt.twoFingerPressMove||It),this.touchMove=Ht(this.element,bt.touchMove||It),this.touchEnd=Ht(this.element,bt.touchEnd||It),this.touchCancel=Ht(this.element,bt.touchCancel||It),this.translateContainer=this.element,this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}},[{key:"start",value:function(Le){if(Le.touches)if(Le.target&&Le.target.nodeName&&["a","button","input"].indexOf(Le.target.nodeName.toLowerCase())>=0)console.log("ignore drag for this touched element",Le.target.nodeName.toLowerCase());else{this.now=Date.now(),this.x1=Le.touches[0].pageX,this.y1=Le.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(Le,this.element),this.preTapPosition.x!==null&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var Ue=this.preV;if(Le.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var bt={x:Le.touches[1].pageX-this.x1,y:Le.touches[1].pageY-this.y1};Ue.x=bt.x,Ue.y=bt.y,this.pinchStartLen=pn(Ue),this.multipointStart.dispatch(Le,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout((function(){this.longTap.dispatch(Le,this.element),this._preventTap=!0}).bind(this),750)}}},{key:"move",value:function(Le){if(Le.touches){var Ue=this.preV,bt=Le.touches.length,It=Le.touches[0].pageX,Yt=Le.touches[0].pageY;if(this.isDoubleTap=!1,bt>1){var ai=Le.touches[1].pageX,li=Le.touches[1].pageY,di={x:Le.touches[1].pageX-It,y:Le.touches[1].pageY-Yt};Ue.x!==null&&(this.pinchStartLen>0&&(Le.zoom=pn(di)/this.pinchStartLen,this.pinch.dispatch(Le,this.element)),Le.angle=Mn(di,Ue),this.rotate.dispatch(Le,this.element)),Ue.x=di.x,Ue.y=di.y,this.x2!==null&&this.sx2!==null?(Le.deltaX=(It-this.x2+ai-this.sx2)/2,Le.deltaY=(Yt-this.y2+li-this.sy2)/2):(Le.deltaX=0,Le.deltaY=0),this.twoFingerPressMove.dispatch(Le,this.element),this.sx2=ai,this.sy2=li}else{if(this.x2!==null){Le.deltaX=It-this.x2,Le.deltaY=Yt-this.y2;var Gi=Math.abs(this.x1-this.x2),Ni=Math.abs(this.y1-this.y2);(Gi>10||Ni>10)&&(this._preventTap=!0)}else Le.deltaX=0,Le.deltaY=0;this.pressMove.dispatch(Le,this.element)}this.touchMove.dispatch(Le,this.element),this._cancelLongTap(),this.x2=It,this.y2=Yt,bt>1&&Le.preventDefault()}}},{key:"end",value:function(Le){if(Le.changedTouches){this._cancelLongTap();var Ue=this;Le.touches.length<2&&(this.multipointEnd.dispatch(Le,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(Le.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout(function(){Ue.swipe.dispatch(Le,Ue.element)},0)):(this.tapTimeout=setTimeout(function(){Ue._preventTap||Ue.tap.dispatch(Le,Ue.element),Ue.isDoubleTap&&(Ue.doubleTap.dispatch(Le,Ue.element),Ue.isDoubleTap=!1)},0),Ue.isDoubleTap||(Ue.singleTapTimeout=setTimeout(function(){Ue.singleTap.dispatch(Le,Ue.element)},250))),this.touchEnd.dispatch(Le,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}}},{key:"cancelAll",value:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)}},{key:"cancel",value:function(Le){this.cancelAll(),this.touchCancel.dispatch(Le,this.element)}},{key:"_cancelLongTap",value:function(){clearTimeout(this.longTapTimeout)}},{key:"_cancelSingleTap",value:function(){clearTimeout(this.singleTapTimeout)}},{key:"_swipeDirection",value:function(Le,Ue,bt,It){return Math.abs(Le-Ue)>=Math.abs(bt-It)?Le-Ue>0?"Left":"Right":bt-It>0?"Up":"Down"}},{key:"on",value:function(Le,Ue){this[Le]&&this[Le].add(Ue)}},{key:"off",value:function(Le,Ue){this[Le]&&this[Le].del(Ue)}},{key:"destroy",value:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}}]);function tn(Le){var Ue=function(){var li,di=document.createElement("fakeelement"),Gi={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(li in Gi)if(di.style[li]!==void 0)return Gi[li]}(),bt=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,It=ye(Le,"gslide-media")?Le:Le.querySelector(".gslide-media"),Yt=ge(It,".ginner-container"),ai=Le.querySelector(".gslide-description");bt>769&&(It=Yt),Ee(It,"greset"),Ce(It,"translate3d(0, 0, 0)"),Ae(Ue,{onElement:It,once:!0,withCallback:function(li,di){Ie(It,"greset")}}),It.style.opacity="",ai&&(ai.style.opacity="")}function Kn(Le){if(Le.events.hasOwnProperty("touch"))return!1;var Ue,bt,It,Yt=Mt(),ai=Yt.width,li=Yt.height,di=!1,Gi=null,Ni=null,$i=null,er=!1,yr=1,or=1,wr=!1,zi=!1,vn=null,Vn=null,mn=null,rn=null,Qn=0,es=0,Ts=!1,Ds=!1,qn={},ss={},Oa=0,ln=0,Ba=document.getElementById("glightbox-slider"),ra=document.querySelector(".goverlay"),Na=new on(Ba,{touchStart:function(mr){if(di=!0,(ye(mr.targetTouches[0].target,"ginner-container")||ge(mr.targetTouches[0].target,".gslide-desc")||mr.targetTouches[0].target.nodeName.toLowerCase()=="a")&&(di=!1),ge(mr.targetTouches[0].target,".gslide-inline")&&!ye(mr.targetTouches[0].target.parentNode,"gslide-inline")&&(di=!1),di){if(ss=mr.targetTouches[0],qn.pageX=mr.targetTouches[0].pageX,qn.pageY=mr.targetTouches[0].pageY,Oa=mr.targetTouches[0].clientX,ln=mr.targetTouches[0].clientY,Gi=Le.activeSlide,Ni=Gi.querySelector(".gslide-media"),It=Gi.querySelector(".gslide-inline"),$i=null,ye(Ni,"gslide-image")&&($i=Ni.querySelector("img")),(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>769&&(Ni=Gi.querySelector(".ginner-container")),Ie(ra,"greset"),mr.pageX>20&&mr.pageX<window.innerWidth-20)return;mr.preventDefault()}},touchMove:function(mr){if(di&&(ss=mr.targetTouches[0],!wr&&!zi)){if(It&&It.offsetHeight>li){var nn=qn.pageX-ss.pageX;if(Math.abs(nn)<=13)return!1}er=!0;var Lt,Re=mr.targetTouches[0].clientX,Ne=mr.targetTouches[0].clientY,je=Oa-Re,tt=ln-Ne;if(Math.abs(je)>Math.abs(tt)?(Ts=!1,Ds=!0):(Ds=!1,Ts=!0),Ue=ss.pageX-qn.pageX,Qn=100*Ue/ai,bt=ss.pageY-qn.pageY,es=100*bt/li,Ts&&$i&&(Lt=1-Math.abs(bt)/li,ra.style.opacity=Lt,Le.settings.touchFollowAxis&&(Qn=0)),Ds&&(Lt=1-Math.abs(Ue)/ai,Ni.style.opacity=Lt,Le.settings.touchFollowAxis&&(es=0)),!$i)return Ce(Ni,"translate3d(".concat(Qn,"%, 0, 0)"));Ce(Ni,"translate3d(".concat(Qn,"%, ").concat(es,"%, 0)"))}},touchEnd:function(){if(di){if(er=!1,zi||wr)return mn=vn,void(rn=Vn);var mr=Math.abs(parseInt(es)),nn=Math.abs(parseInt(Qn));if(!(mr>29&&$i))return mr<29&&nn<25?(Ee(ra,"greset"),ra.style.opacity=1,tn(Ni)):void 0;Le.close()}},multipointEnd:function(){setTimeout(function(){wr=!1},50)},multipointStart:function(){wr=!0,yr=or||1},pinch:function(mr){if(!$i||er)return!1;wr=!0,$i.scaleX=$i.scaleY=yr*mr.zoom;var nn=yr*mr.zoom;if(zi=!0,nn<=1)return zi=!1,nn=1,rn=null,mn=null,vn=null,Vn=null,void $i.setAttribute("style","");nn>4.5&&(nn=4.5),$i.style.transform="scale3d(".concat(nn,", ").concat(nn,", 1)"),or=nn},pressMove:function(mr){if(zi&&!wr){var nn=ss.pageX-qn.pageX,Lt=ss.pageY-qn.pageY;
2690mn&&(nn+=mn),rn&&(Lt+=rn),vn=nn,Vn=Lt;var Re="translate3d(".concat(nn,"px, ").concat(Lt,"px, 0)");or&&(Re+=" scale3d(".concat(or,", ").concat(or,", 1)")),Ce($i,Re)}},swipe:function(mr){if(!zi)if(wr)wr=!1;else{if(mr.direction=="Left"){if(Le.index==Le.elements.length-1)return tn(Ni);Le.nextSlide()}if(mr.direction=="Right"){if(Le.index==0)return tn(Ni);Le.prevSlide()}}}});Le.events.touch=Na}var Xi=Zt(),Gr=Zt()!==null||document.createTouch!==void 0||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msMaxTouchPoints,Hr=document.getElementsByTagName("html")[0],Rn={selector:".glightbox",elements:null,skin:"clean",theme:"clean",closeButton:!0,startAt:null,autoplayVideos:!0,autofocusVideos:!0,descPosition:"bottom",width:"900px",height:"506px",videosWidth:"960px",beforeSlideChange:null,afterSlideChange:null,beforeSlideLoad:null,afterSlideLoad:null,slideInserted:null,slideRemoved:null,slideExtraAttributes:null,onOpen:null,onClose:null,loop:!1,zoomable:!0,draggable:!0,dragAutoSnap:!1,dragToleranceX:40,dragToleranceY:65,preload:!0,oneSlidePerOpen:!1,touchNavigation:!0,touchFollowAxis:!0,keyboardNavigation:!0,closeOnOutsideClick:!0,plugins:!1,plyr:{css:"https://cdn.plyr.io/3.6.12/plyr.css",js:"https://cdn.plyr.io/3.6.12/plyr.js",config:{ratio:"16:9",fullscreen:{enabled:!0,iosNative:!0},youtube:{noCookie:!0,rel:0,showinfo:0,iv_load_policy:3},vimeo:{byline:!1,portrait:!1,title:!1,transparent:!1}}},openEffect:"zoom",closeEffect:"zoom",slideEffect:"slide",moreText:"See more",moreLength:60,cssEfects:{fade:{in:"fadeIn",out:"fadeOut"},zoom:{in:"zoomIn",out:"zoomOut"},slide:{in:"slideInRight",out:"slideOutLeft"},slideBack:{in:"slideInLeft",out:"slideOutRight"},none:{in:"none",out:"none"}},svg:{close:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve"><g><g><path d="M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306C514.019,27.23,514.019,14.135,505.943,6.058z"/></g></g><g><g><path d="M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z"/></g></g></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"> <g><path d="M360.731,229.075l-225.1-225.1c-5.3-5.3-13.8-5.3-19.1,0s-5.3,13.8,0,19.1l215.5,215.5l-215.5,215.5c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4c3.4,0,6.9-1.3,9.5-4l225.1-225.1C365.931,242.875,365.931,234.275,360.731,229.075z"/></g></svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 477.175 477.175" xml:space="preserve"><g><path d="M145.188,238.575l215.5-215.5c5.3-5.3,5.3-13.8,0-19.1s-13.8-5.3-19.1,0l-225.1,225.1c-5.3,5.3-5.3,13.8,0,19.1l225.1,225c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1L145.188,238.575z"/></g></svg>'},slideHTML:`<div class="gslide">
2691    <div class="gslide-inner-content">
2692        <div class="ginner-container">
2693            <div class="gslide-media">
2694            </div>
2695            <div class="gslide-description">
2696                <div class="gdesc-inner">
2697                    <h4 class="gslide-title"></h4>
2698                    <div class="gslide-desc"></div>
2699                </div>
2700            </div>
2701        </div>
2702    </div>
2703</div>`,lightboxHTML:`<div id="glightbox-body" class="glightbox-container" tabindex="-1" role="dialog" aria-hidden="false">
2704    <div class="gloader visible"></div>
2705    <div class="goverlay"></div>
2706    <div class="gcontainer">
2707    <div id="glightbox-slider" class="gslider"></div>
2708    <button class="gclose gbtn" aria-label="Close" data-taborder="3">{closeSVG}</button>
2709    <button class="gprev gbtn" aria-label="Previous" data-taborder="2">{prevSVG}</button>
2710    <button class="gnext gbtn" aria-label="Next" data-taborder="1">{nextSVG}</button>
2711</div>
2712</div>`},Nn=ie(function Le(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};q(this,Le),this.customOptions=Ue,this.settings=Te(Rn,Ue),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1},[{key:"init",value:function(){var Le=this,Ue=this.getSelector();Ue&&(this.baseEvents=Ae("click",{onElement:Ue,withCallback:function(bt,It){bt.preventDefault(),Le.open(It)}})),this.elements=this.getElements()}},{key:"open",value:function(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.elements.length===0)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;var bt=kt(Ue)?Ue:this.settings.startAt;if(Je(Le)){var It=Le.getAttribute("data-gallery");It&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,It)),pi(bt)&&(bt=this.getElementIndex(Le))<0&&(bt=0)}kt(bt)||(bt=0),this.build(),Se(this.overlay,this.settings.openEffect==="none"?"none":this.settings.cssEfects.fade.in);var Yt=document.body,ai=window.innerWidth-document.documentElement.clientWidth;if(ai>0){var li=document.createElement("style");li.type="text/css",li.className="gcss-styles",li.innerText=".gscrollbar-fixer {margin-right: ".concat(ai,"px}"),document.head.appendChild(li),Ee(Yt,"gscrollbar-fixer")}Ee(Yt,"glightbox-open"),Ee(Hr,"glightbox-open"),Xi&&(Ee(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(bt,!0),this.elements.length===1?(Ee(this.prevButton,"glightbox-button-hidden"),Ee(this.nextButton,"glightbox-button-hidden")):(Ie(this.prevButton,"glightbox-button-hidden"),Ie(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),xt(this.settings.onOpen)&&this.settings.onOpen(),Gr&&this.settings.touchNavigation&&Kn(this),this.settings.keyboardNavigation&&Yi(this)}},{key:"openAt",value:function(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.open(null,Le)}},{key:"showSlide",value:function(){var Le=this,Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,bt=arguments.length>1&&arguments[1]!==void 0&&arguments[1];Ve(this.loader),this.index=parseInt(Ue);var It=this.slidesContainer.querySelector(".current");It&&Ie(It,"current"),this.slideAnimateOut();var Yt=this.slidesContainer.querySelectorAll(".gslide")[Ue];if(ye(Yt,"loaded"))this.slideAnimateIn(Yt,bt),at(this.loader);else{Ve(this.loader);var ai=this.elements[Ue],li={index:this.index,slide:Yt,slideNode:Yt,slideConfig:ai.slideConfig,slideIndex:this.index,trigger:ai.node,player:null};this.trigger("slide_before_load",li),ai.instance.setContent(Yt,function(){at(Le.loader),Le.resize(),Le.slideAnimateIn(Yt,bt),Le.trigger("slide_after_load",li)})}this.slideDescription=Yt.querySelector(".gslide-description"),this.slideDescriptionContained=this.slideDescription&&ye(this.slideDescription.parentNode,"gslide-media"),this.settings.preload&&(this.preloadSlide(Ue+1),this.preloadSlide(Ue-1)),this.updateNavigationClasses(),this.activeSlide=Yt}},{key:"preloadSlide",value:function(Le){var Ue=this;if(Le<0||Le>this.elements.length-1||pi(this.elements[Le]))return!1;var bt=this.slidesContainer.querySelectorAll(".gslide")[Le];if(ye(bt,"loaded"))return!1;var It=this.elements[Le],Yt=It.type,ai={index:Le,slide:bt,slideNode:bt,slideConfig:It.slideConfig,slideIndex:Le,trigger:It.node,player:null};this.trigger("slide_before_load",ai),Yt==="video"||Yt==="external"?setTimeout(function(){It.instance.setContent(bt,function(){Ue.trigger("slide_after_load",ai)})},200):It.instance.setContent(bt,function(){Ue.trigger("slide_after_load",ai)})}},{key:"prevSlide",value:function(){this.goToSlide(this.index-1)}},{key:"nextSlide",value:function(){this.goToSlide(this.index+1)}},{key:"goToSlide",value:function(){var Le=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(Le<0||Le>this.elements.length-1))return!1;Le<0?Le=this.elements.length-1:Le>=this.elements.length&&(Le=0),this.showSlide(Le)}},{key:"insertSlide",value:function(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;Ue<0&&(Ue=this.elements.length);var bt=new pt(Le,this,Ue),It=bt.getConfig(),Yt=Te({},It),ai=bt.create(),li=this.elements.length-1;Yt.index=Ue,Yt.node=!1,Yt.instance=bt,Yt.slideConfig=It,this.elements.splice(Ue,0,Yt);var di=null,Gi=null;if(this.slidesContainer){if(Ue>li)this.slidesContainer.appendChild(ai);else{var Ni=this.slidesContainer.querySelectorAll(".gslide")[Ue];this.slidesContainer.insertBefore(ai,Ni)}(this.settings.preload&&this.index==0&&Ue==0||this.index-1==Ue||this.index+1==Ue)&&this.preloadSlide(Ue),this.index===0&&Ue===0&&(this.index=1),this.updateNavigationClasses(),di=this.slidesContainer.querySelectorAll(".gslide")[Ue],Gi=this.getSlidePlayerInstance(Ue),Yt.slideNode=di}
2712this.trigger("slide_inserted",{index:Ue,slide:di,slideNode:di,slideConfig:It,slideIndex:Ue,trigger:null,player:Gi}),xt(this.settings.slideInserted)&&this.settings.slideInserted({index:Ue,slide:di,player:Gi})}},{key:"removeSlide",value:function(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;if(Le<0||Le>this.elements.length-1)return!1;var Ue=this.slidesContainer&&this.slidesContainer.querySelectorAll(".gslide")[Le];Ue&&(this.getActiveSlideIndex()==Le&&(Le==this.elements.length-1?this.prevSlide():this.nextSlide()),Ue.parentNode.removeChild(Ue)),this.elements.splice(Le,1),this.trigger("slide_removed",Le),xt(this.settings.slideRemoved)&&this.settings.slideRemoved(Le)}},{key:"slideAnimateIn",value:function(Le,Ue){var bt=this,It=Le.querySelector(".gslide-media"),Yt=Le.querySelector(".gslide-description"),ai={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:pi(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:pi(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},li={index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideConfig:this.elements[this.index].slideConfig,slideIndex:this.index,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)};if(It.offsetWidth>0&&Yt&&(at(Yt),Yt.style.display=""),Ie(Le,this.effectsClasses),Ue)Se(Le,this.settings.cssEfects[this.settings.openEffect].in,function(){bt.settings.autoplayVideos&&bt.slidePlayerPlay(Le),bt.trigger("slide_changed",{prev:ai,current:li}),xt(bt.settings.afterSlideChange)&&bt.settings.afterSlideChange.apply(bt,[ai,li])});else{var di=this.settings.slideEffect,Gi=di!=="none"?this.settings.cssEfects[di].in:di;this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(Gi=this.settings.cssEfects.slideBack.in),Se(Le,Gi,function(){bt.settings.autoplayVideos&&bt.slidePlayerPlay(Le),bt.trigger("slide_changed",{prev:ai,current:li}),xt(bt.settings.afterSlideChange)&&bt.settings.afterSlideChange.apply(bt,[ai,li])})}setTimeout(function(){bt.resize(Le)},100),Ee(Le,"current")}},{key:"slideAnimateOut",value:function(){if(!this.prevActiveSlide)return!1;var Le=this.prevActiveSlide;Ie(Le,this.effectsClasses),Ee(Le,"prev");var Ue=this.settings.slideEffect,bt=Ue!=="none"?this.settings.cssEfects[Ue].out:Ue;this.slidePlayerPause(Le),this.trigger("slide_before_change",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:pi(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:pi(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},current:{index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideIndex:this.index,slideConfig:this.elements[this.index].slideConfig,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)}}),xt(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&this.settings.slideEffect=="slide"&&(bt=this.settings.cssEfects.slideBack.out),Se(Le,bt,function(){var It=Le.querySelector(".ginner-container"),Yt=Le.querySelector(".gslide-media"),ai=Le.querySelector(".gslide-description");It.style.transform="",Yt.style.transform="",Ie(Yt,"greset"),Yt.style.opacity="",ai&&(ai.style.opacity=""),Ie(Le,"prev")})}},{key:"getAllPlayers",value:function(){return this.videoPlayers}},{key:"getSlidePlayerInstance",value:function(Le){var Ue="gvideo"+Le,bt=this.getAllPlayers();return!(!si(bt,Ue)||!bt[Ue])&&bt[Ue]}},{key:"stopSlideVideo",value:function(Le){if(Je(Le)){var Ue=Le.querySelector(".gvideo-wrapper");Ue&&(Le=Ue.getAttribute("data-index"))}console.log("stopSlideVideo is deprecated, use slidePlayerPause");var bt=this.getSlidePlayerInstance(Le);bt&&bt.playing&&bt.pause()}},{key:"slidePlayerPause",value:function(Le){if(Je(Le)){var Ue=Le.querySelector(".gvideo-wrapper");Ue&&(Le=Ue.getAttribute("data-index"))}var bt=this.getSlidePlayerInstance(Le);bt&&bt.playing&&bt.pause()}},{key:"playSlideVideo",value:function(Le){if(Je(Le)){var Ue=Le.querySelector(".gvideo-wrapper");Ue&&(Le=Ue.getAttribute("data-index"))}console.log("playSlideVideo is deprecated, use slidePlayerPlay");var bt=this.getSlidePlayerInstance(Le);bt&&!bt.playing&&bt.play()}},{key:"slidePlayerPlay",value:function(Le){var Ue;if(!Xi||(Ue=this.settings.plyr.config)!==null&&Ue!==void 0&&Ue.muted){if(Je(Le)){var bt=Le.querySelector(".gvideo-wrapper");bt&&(Le=bt.getAttribute("data-index"))}var It=this.getSlidePlayerInstance(Le);It&&!It.playing&&(It.play(),this.settings.autofocusVideos&&It.elements.container.focus())}}},{key:"setElements",value:function(Le){var Ue=this;this.settings.elements=!1;var bt=[];Le&&Le.length&&Pe(Le,function(It,Yt){var ai=new pt(It,Ue,Yt),li=ai.getConfig(),di=Te({},li);di.slideConfig=li,di.instance=ai,di.index=Yt,bt.push(di)}),this.elements=bt,this.lightboxOpen&&(this.slidesContainer.innerHTML="",this.elements.length&&(Pe(this.elements,function(){var It=et(Ue.settings.slideHTML);Ue.slidesContainer.appendChild(It)}),this.showSlide(0,!0)))}},{key:"getElementIndex",value:function(Le){var Ue=!1;return Pe(this.elements,function(bt,It){if(si(bt,"node")&&bt.node==Le)return Ue=It,!0}),Ue}},{key:"getElements",value:function(){var Le=this,Ue=[];this.elements=this.elements?this.elements:[],!pi(this.settings.elements)&&ut(this.settings.elements)&&this.settings.elements.length&&Pe(this.settings.elements,function(It,Yt){var ai=new pt(It,Le,Yt),li=ai.getConfig(),di=Te({},li);
2712di.node=!1,di.index=Yt,di.instance=ai,di.slideConfig=li,Ue.push(di)});var bt=!1;return this.getSelector()&&(bt=document.querySelectorAll(this.getSelector())),bt&&Pe(bt,function(It,Yt){var ai=new pt(It,Le,Yt),li=ai.getConfig(),di=Te({},li);di.node=It,di.index=Yt,di.instance=ai,di.slideConfig=li,di.gallery=It.getAttribute("data-gallery"),Ue.push(di)}),Ue}},{key:"getGalleryElements",value:function(Le,Ue){return Le.filter(function(bt){return bt.gallery==Ue})}},{key:"getSelector",value:function(){return!this.settings.elements&&(this.settings.selector&&this.settings.selector.substring(0,5)=="data-"?"*[".concat(this.settings.selector,"]"):this.settings.selector)}},{key:"getActiveSlide",value:function(){return this.slidesContainer.querySelectorAll(".gslide")[this.index]}},{key:"getActiveSlideIndex",value:function(){return this.index}},{key:"getAnimationClasses",value:function(){var Le=[];for(var Ue in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(Ue)){var bt=this.settings.cssEfects[Ue];Le.push("g".concat(bt.in)),Le.push("g".concat(bt.out))}return Le.join(" ")}},{key:"build",value:function(){var Le=this;if(this.built)return!1;var Ue=document.body.childNodes,bt=[];Pe(Ue,function(Ni){Ni.parentNode==document.body&&Ni.nodeName.charAt(0)!=="#"&&Ni.hasAttribute&&!Ni.hasAttribute("aria-hidden")&&(bt.pu
2712sh(Ni),Ni.setAttribute("aria-hidden","true"))});var It=si(this.settings.svg,"next")?this.settings.svg.next:"",Yt=si(this.settings.svg,"prev")?this.settings.svg.prev:"",ai=si(this.settings.svg,"close")?this.settings.svg.close:"",li=this.settings.lightboxHTML;li=et(li=(li=(li=li.replace(/{nextSVG}/g,It)).replace(/{prevSVG}/g,Yt)).replace(/{closeSVG}/g,ai)),document.body.appendChild(li);var di=document.getElementById("glightbox-body");this.modal=di;var Gi=di.querySelector(".gclose");this.prevButton=di.querySelector(".gprev"),this.nextButton=di.querySelector(".gnext"),this.overlay=di.querySelector(".goverlay"),this.loader=di.querySelector(".gloader"),this.slidesContainer=document.getElementById("glightbox-slider"),this.bodyHiddenChildElms=bt,this.events={},Ee(this.modal,"glightbox-"+this.settings.skin),this.settings.closeButton&&Gi&&(this.events.close=Ae("click",{onElement:Gi,withCallback:function(Ni,$i){Ni.preventDefault(),Le.close()}})),Gi&&!this.settings.closeButton&&Gi.parentNode.removeChild(Gi),this.nextButton&&(this.events.next=Ae("click",{onElement:this.nextButton,withCallback:function(Ni,$i){Ni.preventDefault(),Le.nextSlide()}})),this.prevButton&&(this.events.prev=Ae("click",{onElement:this.prevButton,withCallback:function(Ni,$i){Ni.preventDefault(),Le.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=Ae("click",{onElement:di,withCallback:function(Ni,$i){Le.preventOutsideClick||ye(document.body,"glightbox-mobile")||ge(Ni.target,".ginner-container")||ge(Ni.target,".gbtn")||ye(Ni.target,"gnext")||ye(Ni.target,"gprev")||Le.close()}})),Pe(this.elements,function(Ni,$i){Le.slidesContainer.appendChild(Ni.instance.create()),Ni.slideNode=Le.slidesContainer.querySelectorAll(".gslide")[$i]}),Gr&&Ee(document.body,"glightbox-touch"),this.events.resize=Ae("resize",{onElement:window,withCallback:function(){Le.resize()}}),this.built=!0}},{key:"resize",value:function(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if((Le=Le||this.activeSlide)&&!ye(Le,"zoomed")){var Ue=Mt(),bt=Le.querySelector(".gvideo-wrapper"),It=Le.querySelector(".gslide-image"),Yt=this.slideDescription,ai=Ue.width,li=Ue.height;if(ai<=768?Ee(document.body,"glightbox-mobile"):Ie(document.body,"glightbox-mobile"),bt||It){var di=!1;if(Yt&&(ye(Yt,"description-bottom")||ye(Yt,"description-top"))&&!ye(Yt,"gabsolute")&&(di=!0),It){if(ai<=768)It.querySelector("img");else if(di){var Gi,Ni,$i=Yt.offsetHeight,er=It.querySelector("img"),yr=(Gi=this.elements[this.index])===null||Gi===void 0?void 0:Gi.node,or="100vh";yr&&(or=(Ni=yr.getAttribute("data-height"))!==null&&Ni!==void 0?Ni:or),er.setAttribute("style","max-height: calc(".concat(or," - ").concat($i,"px)")),Yt.setAttribute("style","max-width: ".concat(er.offsetWidth,"px;"))}}if(bt){var wr=si(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!wr){var zi=bt.clientWidth,vn=bt.clientHeight,Vn=zi/vn;wr="".concat(zi/Vn,":").concat(vn/Vn)}var mn=wr.split(":"),rn=this.settings.videosWidth,Qn=this.settings.videosWidth,es=(Qn=kt(rn)||rn.indexOf("px")!==-1?parseInt(rn):rn.indexOf("vw")!==-1?ai*parseInt(rn)/100:rn.indexOf("vh")!==-1?li*parseInt(rn)/100:rn.indexOf("%")!==-1?ai*parseInt(rn)/100:parseInt(bt.clientWidth))/(parseInt(mn[0])/parseInt(mn[1]));if(es=Math.floor(es),di&&(li-=Yt.offsetHeight),Qn>ai||es>li||li<es&&ai>Qn){var Ts=bt.offsetWidth,Ds=bt.offsetHeight,qn=li/Ds,ss={width:Ts*qn,height:Ds*qn};bt.parentNode.setAttribute("style","max-width: ".concat(ss.width,"px")),di&&Yt.setAttribute("style","max-width: ".concat(ss.width,"px;"))}else bt.parentNode.style.maxWidth="".concat(rn),di&&Yt.setAttribute("style","max-width: ".concat(rn,";"))}}}}},{key:"reload",value:function(){this.init()}},{key:"updateNavigationClasses",value:function(){var Le=this.loop();Ie(this.nextButton,"disabled"),Ie(this.prevButton,"disabled"),this.index==0&&this.elements.length-1==0?(Ee(this.prevButton,"disabled"),Ee(this.nextButton,"disabled")):this.index!==0||Le?this.index!==this.elements.length-1||Le||Ee(this.nextButton,"disabled"):Ee(this.prevButton,"disabled")}},{key:"loop",value:function(){var Le=si(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return Le=si(this.settings,"loop")?this.settings.loop:Le,Le}},{key:"close",value:function(){var Le=this;if(!this.lightboxOpen){if(this.events){for(var Ue in this.events)this.events.hasOwnProperty(Ue)&&this.events[Ue].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&Pe(this.bodyHiddenChildElms,function(bt){bt.removeAttribute("aria-hidden")}),Ee(this.modal,"glightbox-closing"),Se(this.overlay,this.settings.openEffect=="none"?"none":this.settings.cssEfects.fade.out),Se(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,function(){if(Le.activeSlide=null,Le.prevActiveSlideIndex=null,Le.prevActiveSlide=null,Le.built=!1,Le.events){for(var bt in Le.events)Le.events.hasOwnProperty(bt)&&Le.events[bt].destroy();Le.events=null}var It=document.body;
2712Ie(Hr,"glightbox-open"),Ie(It,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),Le.modal.parentNode.removeChild(Le.modal),Le.trigger("close"),xt(Le.settings.onClose)&&Le.settings.onClose();var Yt=document.querySelector(".gcss-styles");Yt&&Yt.parentNode.removeChild(Yt),Le.lightboxOpen=!1,Le.closing=null})}},{key:"destroy",value:function(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}},{key:"on",value:function(Le,Ue){var bt=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!Le||!xt(Ue))throw new TypeError("Event name and callback must be defined");this.apiEvents.push({evt:Le,once:bt,callback:Ue})}},{key:"once",value:function(Le,Ue){this.on(Le,Ue,!0)}},{key:"trigger",value:function(Le){var Ue=this,bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,It=[];Pe(this.apiEvents,function(Yt,ai){var li=Yt.evt,di=Yt.once,Gi=Yt.callback;li==Le&&(Gi(bt),di&&It.push(ai))}),It.length&&Pe(It,function(Yt){return Ue.apiEvents.splice(Yt,1)})}},{key:"clearAllEvents",value:function(){this.apiEvents.splice(0,this.apiEvents.length)}},{key:"version",value:function(){return"3.3.1"}}]);return function(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ue=new Nn(Le);return Ue.init(),Ue}})}(glightbox_min$1)),glightbox_min$1.exports}var glightbox_minExports=requireGlightbox_min();const GLightbox=getDefaultExportFromCjs(glightbox_minExports);function imageslider(){var O;const D=document.getElementsByClassName("image-slider");for(const q of D){const J=(O=q.querySelector(".glightbox"))==null?void 0:O.dataset.gallery;J&&GLightbox({selector:`[data-gallery="${J}"]`,touchNavigation:!0}),new Swiper(q,{modules:[Navigation,Pagination],pagination:{el:q.querySelector(".swiper-pagination"),clickable:!0,dynamicMainBullets:3},navigation:{nextEl:q.querySelector(".swiper-button-next"),prevEl:q.querySelector(".swiper-button-prev")},slidesPerView:1.1,spaceBetween:15,breakpoints:{425:{slidesPerView:1.5,spaceBetween:15},767:{slidesPerView:2.5,spaceBetween:15}},on:{setTranslate(ie,le){ie.wrapperEl.style.transform=`translateX(${le}px) translateZ(0)`}}})}}function textimageslider(){document.querySelectorAll("[data-text-image-slider]").forEach(O=>{const q=O.querySelector("[data-tis-images]"),J=O.querySelector("[data-tis-steps]");if(!q||!J)return;const ie=J.querySelectorAll("[data-tis-step]"),le=O.querySelector("[data-tis-active-number]"),_e=O.querySelector(".text-image-slider__arrow--prev"),o=O.querySelector(".text-image-slider__arrow--next"),Te=window.matchMedia("(min-width: 1024px)");let Pe=0,ve=null;function Ae(){ve&&ve.destroy(!0,!0),Te.matches?ve=new Swiper(q,{modules:[EffectCreative],effect:"creative",allowTouchMove:!1,slidesPerView:1,creativeEffect:{prev:{translate:["-100%",0,0],opacity:0},next:{translate:["36px","18px",-60],rotate:[0,0,1.8],opacity:.85},limitProgress:3}}):ve=new Swiper(q,{modules:[EffectFade],effect:"fade",allowTouchMove:!1,slidesPerView:1,fadeEffect:{crossFade:!0}}),ve.slideTo(Pe,0)}function Ee(){_e&&(_e.disabled=Pe===0),o&&(o.disabled=Pe===ie.length-1)}function Ie(ye){ie.forEach((ge,Se)=>{ge.classList.toggle("is-active",Se===ye)}),ve.slideTo(ye),Pe=ye,le&&(le.textContent=ye+1),Ee()}ie.forEach(ye=>{ye.addEventListener("click",()=>{Ie(parseInt(ye.dataset.tisStep,10))})}),_e==null||_e.addEventListener("click",()=>{Pe>0&&Ie(Pe-1)}),o==null||o.addEventListener("click",()=>{Pe<ie.length-1&&Ie(Pe+1)}),Ae(),Te.addEventListener("change",Ae),Ee()})}function textteasersmedia(){document.querySelectorAll(".textteasers-media__video-wrapper").forEach(D=>{const O=D.querySelector("video"),q=D.querySelector("[data-tvm-play]"),J=D.querySelector("[data-tvm-mute]"),ie=D.querySelectorAll("[data-tvm-fullscreen]");O&&(O.muted&&D.classList.add("is-muted"),q==null||q.addEventListener("click",()=>{O.paused?(O.play(),D.classList.remove("is-paused")):(O.pause(),D.classList.add("is-paused"))}),J==null||J.addEventListener("click",()=>{O.muted=!O.muted,D.classList.toggle("is-muted",O.muted)}),ie.forEach(le=>{le.addEventListener("click",()=>{O.requestFullscreen?O.requestFullscreen():O.webkitRequestFullscreen?O.webkitRequestFullscreen():O.webkitEnterFullscreen&&O.webkitEnterFullscreen()})}),O.addEventListener("pause",()=>D.classList.add("is-paused")),O.addEventListener("play",()=>D.classList.remove("is-paused")))})}function cover(){const D=document.querySelectorAll(".wp-block-cover");if(!D.length)return;let O=!1;function q(){const J=window.innerHeight/2;D.forEach(ie=>{const le=ie.querySelector(".wp-block-cover__image-background");if(!le)return;const Te=(ie.getBoundingClientRect().top+ie.offsetHeight/2-J)*.2;le.style.transform=`translateY(${Te}
2712px)`}),O=!1}window.addEventListener("scroll",()=>{O||(requestAnimationFrame(q),O=!0)},{passive:!0}),q()}document.addEventListener("DOMContentLoaded",function(){mobilemenu(),buttonstyle(),hero(),categories(),accordion(),farmerslider(),boxes(),farmermap(),farmerlist(),manufacturer(),video(),logoslider(),imageslider(),textimageslider(),textteasersmedia(),cover(),new g$1({})},!1);

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.